Mercurial > audlegacy-plugins
annotate src/statusicon/si_ui.c @ 452:829f029fbd03 trunk
[svn] - status icon plugin: display main menu on right click
author | giacomo |
---|---|
date | Wed, 17 Jan 2007 03:13:34 -0800 |
parents | da802c766018 |
children | 60395c0d7587 |
rev | line source |
---|---|
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
1 /* |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
2 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
3 * Author: Giacomo Lozito <james@develia.org>, (C) 2005-2007 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
4 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify it |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License as published by the |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
7 * Free Software Foundation; either version 2 of the License, or (at your |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
8 * option) any later version. |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
9 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, but |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
11 * WITHOUT ANY WARRANTY; without even the implied warranty of |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
13 * General Public License for more details. |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
14 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License along |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
16 * with this program; if not, write to the Free Software Foundation, Inc., |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
18 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
19 */ |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
20 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
21 #include "si_ui.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
22 #include "si_audacious.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
23 #include "si_common.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
24 #include "gtktrayicon.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
25 #include "si.xpm" |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
26 #include <audacious/playlist.h> |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
27 #include <audacious/titlestring.h> |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
28 #include <audacious/ui_fileinfopopup.h> |
452
829f029fbd03
[svn] - status icon plugin: display main menu on right click
giacomo
parents:
448
diff
changeset
|
29 #include <audacious/util.h> |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
30 #include <glib.h> |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
31 #include <glib/gi18n.h> |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
32 #include <gdk/gdk.h> |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
33 #include <gtk/gtk.h> |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
34 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
35 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
36 static GtkWidget * si_evbox = NULL; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
37 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
38 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
39 static GtkTrayIcon * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
40 si_ui_statusicon_create ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
41 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
42 GtkTrayIcon *si_applet = NULL; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
43 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
44 si_applet = _gtk_tray_icon_new( "audacious" ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
45 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
46 gtk_widget_show( GTK_WIDGET(si_applet) ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
47 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
48 return si_applet; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
49 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
50 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
51 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
52 static gboolean |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
53 si_ui_statusicon_cb_btpress ( GtkWidget * evbox , GdkEventButton * event ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
54 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
55 switch ( event->button ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
56 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
57 case 1: |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
58 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
59 si_audacious_toggle_visibility(); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
60 break; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
61 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
62 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
63 case 3: |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
64 { |
452
829f029fbd03
[svn] - status icon plugin: display main menu on right click
giacomo
parents:
448
diff
changeset
|
65 audacious_menu_main_show( event->x_root , event->y_root , 3 , event->time ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
66 break; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
67 } |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
68 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
69 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
70 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
71 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
72 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
73 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
74 static gboolean |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
75 si_ui_statusicon_popup_show ( gpointer evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
76 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
77 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "timer_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
78 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
79 TitleInput *tuple; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
80 Playlist *pl_active = playlist_get_active(); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
81 gint pos = playlist_get_position(pl_active); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
82 GtkWidget *popup = g_object_get_data( G_OBJECT(evbox) , "popup" ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
83 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
84 tuple = playlist_get_tuple( pl_active , pos ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
85 audacious_fileinfopopup_show_from_tuple( popup , tuple ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
86 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
87 g_object_set_data( G_OBJECT(evbox) , "popup_active" , GINT_TO_POINTER(1) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
88 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
89 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
90 g_object_set_data( G_OBJECT(evbox) , "timer_id" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
91 g_object_set_data( G_OBJECT(evbox) , "timer_active" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
92 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
93 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
94 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
95 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
96 static void |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
97 si_ui_statusicon_popup_hide ( gpointer evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
98 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
99 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
100 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
101 GtkWidget *popup = g_object_get_data( G_OBJECT(evbox) , "popup" ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
102 g_object_set_data( G_OBJECT(evbox) , "popup_active" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
103 audacious_fileinfopopup_hide( popup , NULL ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
104 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
105 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
106 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
107 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
108 static void |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
109 si_ui_statusicon_popup_timer_start ( GtkWidget * evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
110 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
111 gint timer_id = g_timeout_add( 500 , si_ui_statusicon_popup_show , evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
112 g_object_set_data( G_OBJECT(evbox) , "timer_id" , GINT_TO_POINTER(timer_id) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
113 g_object_set_data( G_OBJECT(evbox) , "timer_active" , GINT_TO_POINTER(1) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
114 return; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
115 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
116 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
117 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
118 static void |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
119 si_ui_statusicon_popup_timer_stop ( GtkWidget * evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
120 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
121 if ( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(evbox),"timer_active")) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
122 g_source_remove( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(evbox),"timer_id")) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
123 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
124 g_object_set_data( G_OBJECT(evbox) , "timer_id" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
125 g_object_set_data( G_OBJECT(evbox) , "timer_active" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
126 return; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
127 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
128 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
129 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
130 static gboolean |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
131 si_ui_statusicon_cb_popup ( GtkWidget * evbox , GdkEvent * event ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
132 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
133 if ((event->type == GDK_LEAVE_NOTIFY || event->type == GDK_ENTER_NOTIFY) && |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
134 event->crossing.detail == GDK_NOTIFY_INFERIOR) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
135 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
136 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
137 if ( event->type != GDK_KEY_PRESS && event->type != GDK_KEY_RELEASE ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
138 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
139 GtkWidget *event_widget = gtk_get_event_widget( event ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
140 if ( event_widget != evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
141 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
142 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
143 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
144 switch (event->type) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
145 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
146 case GDK_EXPOSE: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
147 /* do nothing */ |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
148 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
149 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
150 case GDK_ENTER_NOTIFY: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
151 si_ui_statusicon_popup_timer_start( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
152 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
153 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
154 case GDK_LEAVE_NOTIFY: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
155 si_ui_statusicon_popup_timer_stop( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
156 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
157 si_ui_statusicon_popup_hide( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
158 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
159 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
160 case GDK_MOTION_NOTIFY: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
161 break; /* ignore */ |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
162 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
163 case GDK_BUTTON_PRESS: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
164 case GDK_BUTTON_RELEASE: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
165 case GDK_KEY_PRESS: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
166 case GDK_KEY_RELEASE: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
167 case GDK_PROXIMITY_IN: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
168 case GDK_SCROLL: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
169 si_ui_statusicon_popup_timer_stop( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
170 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
171 si_ui_statusicon_popup_hide( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
172 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
173 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
174 default: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
175 break; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
176 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
177 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
178 return FALSE; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
179 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
180 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
181 |
440
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
182 static void |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
183 si_ui_statusicon_image_update ( GtkWidget * image ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
184 { |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
185 GdkPixbuf *si_pixbuf, *si_scaled_pixbuf; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
186 gint size = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(image) , "size" )); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
187 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
188 si_pixbuf = gdk_pixbuf_new_from_xpm_data( (const char**)si_xpm ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
189 si_scaled_pixbuf = gdk_pixbuf_scale_simple( si_pixbuf , size , size , GDK_INTERP_BILINEAR ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
190 gtk_image_set_from_pixbuf( GTK_IMAGE(image) , si_scaled_pixbuf ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
191 g_object_unref( si_pixbuf ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
192 g_object_unref( si_scaled_pixbuf ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
193 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
194 return; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
195 } |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
196 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
197 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
198 static void |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
199 si_ui_statusicon_cb_image_sizalloc ( GtkWidget * image , GtkAllocation * allocation , gpointer si_applet ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
200 { |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
201 GtkOrientation orientation; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
202 static gint prev_size = 0; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
203 gint size = 0; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
204 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
205 orientation = _gtk_tray_icon_get_orientation( GTK_TRAY_ICON(si_applet) ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
206 if ( orientation == GTK_ORIENTATION_HORIZONTAL ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
207 size = allocation->height; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
208 else |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
209 size = allocation->width; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
210 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
211 if ( prev_size != size ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
212 { |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
213 prev_size = size; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
214 g_object_set_data( G_OBJECT(image) , "size" , GINT_TO_POINTER(size) ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
215 si_ui_statusicon_image_update( image ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
216 } |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
217 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
218 return; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
219 } |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
220 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
221 |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
222 void |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
223 si_ui_statusicon_show ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
224 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
225 GtkWidget *si_image; |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
226 GtkWidget *si_popup; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
227 GtkTrayIcon *si_applet; |
448
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
228 GtkRequisition req; |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
229 GtkAllocation allocation; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
230 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
231 si_applet = si_ui_statusicon_create(); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
232 if ( si_applet == NULL ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
233 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
234 g_warning( "StatusIcon plugin: unable to create a status icon.\n" ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
235 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
236 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
237 |
440
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
238 si_image = gtk_image_new(); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
239 g_object_set_data( G_OBJECT(si_image) , "size" , GINT_TO_POINTER(0) ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
240 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
241 g_signal_connect( si_image , "size-allocate" , |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
242 G_CALLBACK(si_ui_statusicon_cb_image_sizalloc) , si_applet ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
243 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
244 si_evbox = gtk_event_box_new(); |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
245 si_popup = audacious_fileinfopopup_create(); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
246 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
247 g_object_set_data( G_OBJECT(si_evbox) , "applet" , si_applet ); |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
248 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
249 g_object_set_data( G_OBJECT(si_evbox) , "timer_id" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
250 g_object_set_data( G_OBJECT(si_evbox) , "timer_active" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
251 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
252 g_object_set_data( G_OBJECT(si_evbox) , "popup_active" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
253 g_object_set_data( G_OBJECT(si_evbox) , "popup" , si_popup ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
254 |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
255 g_signal_connect( G_OBJECT(si_evbox) , "button-press-event" , |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
256 G_CALLBACK(si_ui_statusicon_cb_btpress) , NULL ); |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
257 g_signal_connect_after( G_OBJECT(si_evbox) , "event-after" , |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
258 G_CALLBACK(si_ui_statusicon_cb_popup) , NULL ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
259 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
260 gtk_container_add( GTK_CONTAINER(si_evbox), si_image ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
261 gtk_container_add( GTK_CONTAINER(si_applet), si_evbox ); |
448
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
262 |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
263 gtk_widget_show_all( GTK_WIDGET(si_applet) ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
264 |
448
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
265 gtk_widget_size_request( GTK_WIDGET(si_applet) , &req ); |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
266 allocation.x = 0; |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
267 allocation.y = 0; |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
268 allocation.width = req.width; |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
269 allocation.height = req.height; |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
270 gtk_widget_size_allocate( GTK_WIDGET(si_applet) , &allocation ); |
da802c766018
[svn] status icon plugin: ensure that the size-allocate signal is called for the tray icon widget
giacomo
parents:
440
diff
changeset
|
271 |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
272 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
273 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
274 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
275 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
276 void |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
277 si_ui_statusicon_hide ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
278 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
279 if ( si_evbox != NULL ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
280 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
281 GtkTrayIcon *si_applet = g_object_get_data( G_OBJECT(si_evbox) , "applet" ); |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
282 si_ui_statusicon_popup_timer_stop( si_evbox ); /* just in case the timer is active */ |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
283 gtk_widget_destroy( GTK_WIDGET(si_evbox) ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
284 gtk_widget_destroy( GTK_WIDGET(si_applet) ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
285 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
286 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
287 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
288 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
289 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
290 void |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
291 si_ui_about_show ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
292 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
293 GtkWidget *about_dlg = gtk_message_dialog_new( |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
294 NULL , 0 , GTK_MESSAGE_INFO , GTK_BUTTONS_CLOSE , |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
295 _( "Status Icon Plugin " SI_VERSION_PLUGIN "\n" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
296 "written by Giacomo Lozito < james@develia.org >\n\n" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
297 "This plugin provides a status icon, placed in\n" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
298 "the system tray area of the window manager.\n" ) ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
299 gtk_dialog_run( GTK_DIALOG(about_dlg) ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
300 gtk_widget_destroy( about_dlg ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
301 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
302 } |