aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-07-29 16:42:04 +0100
committerConor Curran <conor.curran@canonical.com>2011-07-29 16:42:04 +0100
commit6f965506a63bc48c10c386b4567c09b2fdf01c2e (patch)
tree9e44ccc0175d6f43da4139698aeb7d2cf0ff26ad /src
parent5fcbaa67209c40c752b8b3c2b78cb26233b7ccb8 (diff)
parent65982386494b0ffe4ff8bdf4be698e8b7616f561 (diff)
downloadayatana-indicator-sound-6f965506a63bc48c10c386b4567c09b2fdf01c2e.tar.gz
ayatana-indicator-sound-6f965506a63bc48c10c386b4567c09b2fdf01c2e.tar.bz2
ayatana-indicator-sound-6f965506a63bc48c10c386b4567c09b2fdf01c2e.zip
merge the gtk2 compilation fixes
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/transport-widget.c15
2 files changed, 12 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 60c7249..9c56c0e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -109,7 +109,7 @@ indicator_sound_service_SOURCES = \
gen-sound-service.xml.c \
$(music_bridge_VALASOURCES:.vala=.c)
-indicator_sound_service_CFLAGS = $(PULSEAUDIO_CFLAGS) $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall
+indicator_sound_service_CFLAGS = $(PULSEAUDIO_CFLAGS) $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall -Werror
indicator_sound_service_LDADD = $(PULSEAUDIO_LIBS) $(SOUNDSERVICE_LIBS) $(GCONF_LIBS)
#########################
diff --git a/src/transport-widget.c b/src/transport-widget.c
index 898472e..564b76f 100644
--- a/src/transport-widget.c
+++ b/src/transport-widget.c
@@ -87,9 +87,11 @@ struct _TransportWidgetPrivate
gint skip_frequency;
};
+#if GTK_CHECK_VERSION(3, 0, 0)
static GList *transport_widget_list = NULL;
static GtkStyleContext *spinner_style_context = NULL;
static GtkWidgetPath *spinner_widget_path = NULL;
+#endif
// TODO refactor the UI handlers, consolidate functionality between key press /release
// and button press / release.
@@ -171,7 +173,7 @@ static void
transport_widget_init (TransportWidget *self)
{
TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(self);
-
+ #if GTK_CHECK_VERSION(3, 0, 0)
if (transport_widget_list == NULL){
/* append the object to the static linked list. */
transport_widget_list = g_list_append (transport_widget_list, self);
@@ -188,7 +190,7 @@ transport_widget_init (TransportWidget *self)
gtk_style_context_set_path (spinner_style_context, spinner_widget_path);
gtk_style_context_add_class (spinner_style_context, GTK_STYLE_CLASS_SPINNER);
}
-
+ #endif
priv->current_command = TRANSPORT_ACTION_NO_ACTION;
priv->current_state = TRANSPORT_STATE_PAUSED;
priv->key_event = TRANSPORT_ACTION_NO_ACTION;
@@ -248,6 +250,7 @@ transport_widget_init (TransportWidget *self)
static void
transport_widget_dispose (GObject *object)
{
+ #if GTK_CHECK_VERSION(3, 0, 0)
transport_widget_list = g_list_remove (transport_widget_list, object);
if (transport_widget_list == NULL){
@@ -261,7 +264,7 @@ transport_widget_dispose (GObject *object)
spinner_style_context = NULL;
}
}
-
+ #endif
G_OBJECT_CLASS (transport_widget_parent_class)->dispose (object);
}
@@ -280,7 +283,6 @@ transport_widget_expose (GtkWidget *button, GdkEventExpose *event)
cairo_t *cr;
cr = gdk_cairo_create (gtk_widget_get_window (button));
- g_debug("In the playbutton's expose method, x = %i, y=%i and width: %i and height: %i'");
cairo_rectangle (cr,
event->area.x, event->area.y,
event->area.width, event->area.height);
@@ -1791,10 +1793,13 @@ draw (GtkWidget* button, cairo_t *cr)
FALSE);
_finalize (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y);
}
+ #if GTK_CHECK_VERSION(3, 0, 0)
else if(priv->current_state == TRANSPORT_STATE_LAUNCHING)
{
+
gtk_render_activity (spinner_style_context, cr, 106, 6 , 30, 30);
}
+ #endif
return FALSE;
}
@@ -1831,12 +1836,14 @@ transport_widget_property_update(DbusmenuMenuitem* item, gchar* property,
TransportState new_state = (TransportState)g_variant_get_int32(value);
//g_debug("transport_widget_update_state - with value %i", new_state);
if (new_state == TRANSPORT_STATE_LAUNCHING){
+ #if GTK_CHECK_VERSION(3, 0, 0)
gtk_style_context_notify_state_change (spinner_style_context,
gtk_widget_get_window ( GTK_WIDGET(userdata)),
NULL,
GTK_STATE_FLAG_ACTIVE,
TRUE);
gtk_style_context_set_state (spinner_style_context, GTK_STATE_FLAG_ACTIVE);
+ #endif
priv->current_state = TRANSPORT_STATE_LAUNCHING;
g_debug("TransportWidget::toggle play state : %i", priv->current_state);