diff options
author | Harry van Haaren <harryhaaren@gmail.com> | 2011-07-27 17:14:59 +0100 |
---|---|---|
committer | Harry van Haaren <harryhaaren@gmail.com> | 2011-07-27 17:14:59 +0100 |
commit | b7e9be00dc76778b7e5148c1a343c0ff6133f2d9 (patch) | |
tree | 03cc3a7debd6748a1ee07cda1a96a3d0461eeaff | |
parent | 25f98c314a2e61968511c2eeefd7354cadb9439f (diff) | |
download | ayatana-indicator-sound-b7e9be00dc76778b7e5148c1a343c0ff6133f2d9.tar.gz ayatana-indicator-sound-b7e9be00dc76778b7e5148c1a343c0ff6133f2d9.tar.bz2 ayatana-indicator-sound-b7e9be00dc76778b7e5148c1a343c0ff6133f2d9.zip |
Implemented spinner to cairo interface, assertion of offscreen_window GDK_IS_WINDOW failing
-rw-r--r-- | src/player-controller.vala | 3 | ||||
-rw-r--r-- | src/transport-widget.c | 25 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala index a08f692..00b486e 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -143,11 +143,12 @@ public class PlayerController : GLib.Object public void update_layout() { - debug ("a call to update layout"); + debug ("player-controller update_layout()"); PlaylistsMenuitem playlists_menuitem = this.custom_items[widget_order.PLAYLISTS] as PlaylistsMenuitem; MetadataMenuitem metadata_menuitem = this.custom_items[widget_order.METADATA] as MetadataMenuitem; if(this.current_state != state.CONNECTED){ // TODO + debug("\tthis.current_state != state.CONNECTED, setting Transport property bool to %s now",this.app_info.get_id() ); metadata_menuitem.should_collapse (true); playlists_menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, false ); diff --git a/src/transport-widget.c b/src/transport-widget.c index 76c94aa..bd189a2 100644 --- a/src/transport-widget.c +++ b/src/transport-widget.c @@ -177,6 +177,10 @@ transport_widget_init (TransportWidget *self) priv->spinner = gtk_spinner_new(); priv->offscreen_window = gtk_offscreen_window_new(); + + g_assert(priv->spinner); + g_assert(priv->offscreen_window); + gtk_container_add( GTK_CONTAINER(priv->offscreen_window), priv->spinner); priv->current_command = TRANSPORT_ACTION_NO_ACTION; @@ -257,7 +261,7 @@ 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'"); + //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); @@ -283,7 +287,7 @@ transport_widget_toggle_play_pause(TransportWidget* button, { TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE(button); priv->current_state = update; - g_debug("TransportWidget::toggle play state : %i", priv->current_state); + //g_debug("TransportWidget::toggle play state : %i", priv->current_state); gtk_widget_queue_draw (GTK_WIDGET(button)); } @@ -314,7 +318,7 @@ static gboolean transport_widget_motion_notify_event (GtkWidget *menuitem, GdkEventMotion *event) { - g_debug("transport_widget_motion_notify_event()"); + //g_debug("transport_widget_motion_notify_event()"); g_return_val_if_fail ( IS_TRANSPORT_WIDGET(menuitem), FALSE ); TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE ( TRANSPORT_WIDGET(menuitem) ); @@ -337,7 +341,7 @@ static gboolean transport_widget_leave_notify_event (GtkWidget *menuitem, GdkEventCrossing *event) { - g_debug("transport_widget_leave_notify_event()"); + //g_debug("transport_widget_leave_notify_event()"); g_return_val_if_fail ( IS_TRANSPORT_WIDGET(menuitem), FALSE ); TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE ( TRANSPORT_WIDGET(menuitem) ); @@ -353,7 +357,7 @@ static gboolean transport_widget_button_press_event (GtkWidget *menuitem, GdkEventButton *event) { - g_debug("transport_widget_button_press_event()"); + //g_debug("transport_widget_button_press_event()"); g_return_val_if_fail ( IS_TRANSPORT_WIDGET(menuitem), FALSE ); TransportWidgetPrivate* priv = TRANSPORT_WIDGET_GET_PRIVATE ( TRANSPORT_WIDGET(menuitem) ); @@ -1771,8 +1775,16 @@ draw (GtkWidget* button, cairo_t *cr) } else if(priv->current_state == TRANSPORT_STATE_LAUNCHING) { - //g_debug ("===launching in draw==="); + g_debug ("launching in draw"); + + GtkOffscreenWindow* tmp_offscreen_win = (GtkOffscreenWindow*)priv->offscreen_window; + + cairo_t *tmp_cr = cairo_create( gtk_offscreen_window_get_surface( tmp_offscreen_win ) ); + + cairo_set_source_surface( tmp_cr, surf, 0, 0 ); + cairo_paint(tmp_cr); + /* _setup (&cr_surf, &surf, PLAY_WIDTH+6, PLAY_HEIGHT+6); _mask_play (cr_surf, PLAY_PADDING, @@ -1822,6 +1834,7 @@ draw (GtkWidget* button, cairo_t *cr) BUTTON_LAUNCHING_END, FALSE); _finalize (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y); + */ } return FALSE; |