[xiph-cvs] cvs commit: postfish Makefile mainpanel.c multibar.c version.h

Monty xiphmont at xiph.org
Tue Oct 14 20:25:20 PDT 2003



xiphmont    03/10/14 23:25:20

  Modified:    .        Makefile mainpanel.c multibar.c version.h
  Log:
  Correct usage of several deprecated GTK/GDK functions
  Correct play-end no pop the button bug.

Revision  Changes    Path
1.7       +1 -1      postfish/Makefile

Index: Makefile
===================================================================
RCS file: /usr/local/cvsroot/postfish/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile	14 Oct 2003 19:25:07 -0000	1.6
+++ Makefile	15 Oct 2003 03:25:19 -0000	1.7
@@ -7,7 +7,7 @@
 
 SRC = main.c mainpanel.c multibar.c readout.c input.c output.c
 OBJ = main.o mainpanel.o multibar.o readout.o input.o output.o
-GCF = `pkg-config --cflags gtk+-2.0`
+GCF = `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
 
 all:	
         $(MAKE) target CFLAGS="-W -O2 $(GCF)"

<p><p>1.11      +22 -8     postfish/mainpanel.c

Index: mainpanel.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/mainpanel.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- mainpanel.c	15 Oct 2003 02:01:46 -0000	1.10
+++ mainpanel.c	15 Oct 2003 03:25:19 -0000	1.11
@@ -695,9 +695,9 @@
 
 }
 
-static void async_event_handle(gpointer data,
-			int fd, 
-			GdkInputCondition condition){
+static gboolean async_event_handle(GIOChannel *channel,
+				   GIOCondition condition,
+				   gpointer data){
   postfish_mainpanel *panel=data;
   int i;
   char buf[1];
@@ -706,9 +706,9 @@
   /* first order of business: release the play button if playback is
      no longer in progress */
   
-  if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel->buttonactive[3])))
+  if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(panel->deckactive[3])))
     if(!playback_active)
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel->buttonactive[3]),0);
+      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel->deckactive[3]),0);
 
   /* second order of business; update the input meter if data is available */
   if(input_feedback){
@@ -729,7 +729,7 @@
     multibar_set(MULTIBAR(panel->inbar),rms,peak,input_ch+2);
   }
 
-
+  return TRUE;
 }
 
 #include <stdlib.h>
@@ -785,8 +785,22 @@
 
   mainpanel_create(&p,labels);
   animate_fish(&p);
-  gtk_input_add_full(eventpipe[0],GDK_INPUT_READ,async_event_handle,NULL,
-		     &p,NULL);
+
+  {
+    GIOChannel *channel = g_io_channel_unix_new (eventpipe[0]);
+    GSource *source;
+    guint id;
+
+    g_io_channel_set_encoding (channel, NULL, NULL);
+    g_io_channel_set_buffered (channel, FALSE);
+    g_io_channel_set_close_on_unref (channel, TRUE);
+
+    id = g_io_add_watch (channel, G_IO_IN, async_event_handle, &p);
+
+    g_io_channel_unref (channel);
+
+  }
+
 
   gtk_main ();
 

<p><p>1.6       +14 -14    postfish/multibar.c

Index: multibar.c
===================================================================
RCS file: /usr/local/cvsroot/postfish/multibar.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- multibar.c	15 Oct 2003 02:01:46 -0000	1.5
+++ multibar.c	15 Oct 2003 03:25:19 -0000	1.6
@@ -294,7 +294,7 @@
   Multibar *m=MULTIBAR(widget);
   
   if (m->backing)
-    gdk_pixmap_unref(m->backing);
+    gdk_drawable_unref(m->backing);
   
   m->backing = gdk_pixmap_new(widget->window,
                               widget->allocation.width,
@@ -309,12 +309,12 @@
 
 static gboolean expose( GtkWidget *widget, GdkEventExpose *event ){
   Multibar *m=MULTIBAR(widget);
-  gdk_draw_pixmap(widget->window,
-		  widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
-		  m->backing,
-		  event->area.x, event->area.y,
-		  event->area.x, event->area.y,
-		  event->area.width, event->area.height);
+  gdk_draw_drawable(widget->window,
+		    widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+		    m->backing,
+		    event->area.x, event->area.y,
+		    event->area.x, event->area.y,
+		    event->area.width, event->area.height);
   
   return FALSE;
 }
@@ -399,12 +399,12 @@
 void multibar_set(Multibar *m,double *lo, double *hi, int n){
   GtkWidget *widget=GTK_WIDGET(m);
   draw(widget,lo,hi,n);
-  gdk_draw_pixmap(widget->window,
-		  widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
-		  m->backing,
-		  0, 0,
-		  0, 0,
-		  widget->allocation.width,		  
-		  widget->allocation.height);
+  gdk_draw_drawable(widget->window,
+		    widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+		    m->backing,
+		    0, 0,
+		    0, 0,
+		    widget->allocation.width,		  
+		    widget->allocation.height);
   
 }

<p><p>1.5       +2 -2      postfish/version.h

Index: version.h
===================================================================
RCS file: /usr/local/cvsroot/postfish/version.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- version.h	15 Oct 2003 02:01:46 -0000	1.4
+++ version.h	15 Oct 2003 03:25:19 -0000	1.5
@@ -1,2 +1,2 @@
-#define VERSION "$Id: version.h,v 1.4 2003/10/15 02:01:46 xiphmont Exp $ "
-/* DO NOT EDIT: Automated versioning hack [Tue Oct 14 22:00:08 EDT 2003] */
+#define VERSION "$Id: version.h,v 1.5 2003/10/15 03:25:19 xiphmont Exp $ "
+/* DO NOT EDIT: Automated versioning hack [Tue Oct 14 23:22:34 EDT 2003] */

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list