Commit aec41915 authored by Monty Montgomery's avatar Monty Montgomery

Correct usage of several deprecated GTK/GDK functions

Correct play-end no pop the button bug.


git-svn-id: https://svn.xiph.org/trunk/postfish@5468 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 0904a271
......@@ -7,7 +7,7 @@ LD=gcc
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)"
......
......@@ -695,9 +695,9 @@ void mainpanel_create(postfish_mainpanel *panel,char **chlabels){
}
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 @@ static void async_event_handle(gpointer data,
/* 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 @@ static void async_event_handle(gpointer data,
multibar_set(MULTIBAR(panel->inbar),rms,peak,input_ch+2);
}
return TRUE;
}
#include <stdlib.h>
......@@ -785,8 +785,22 @@ void mainpanel_go(int argc,char *argv[], int ch){
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 ();
......
......@@ -294,7 +294,7 @@ static gboolean configure(GtkWidget *widget, GdkEventConfigure *event){
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 configure(GtkWidget *widget, GdkEventConfigure *event){
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 @@ GtkWidget* multibar_new (int n, char **labels, double *levels, int flags){
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);
}
#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] */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment