annotate plugins/crazychat/cc_gtk_gl.h @ 12498:a2de852981c1

[gaim-migrate @ 14810] SF Patch #1380806 from charkins "leave docklet loaded when notification area is not present" "From the summary, this sounds weird, but I think its better behavior. This really only effects some odd corner cases. The existing behavior is that the docklet plugin unloads itself after 10 seconds if the tray icon isn't created. The behavior with this patch is that there is a 3 second timeout (this is necessary to avoid race condition when restoring the gtkblist's visibility state on startup). After this timeout, the docklet plugin stays loaded waiting for a notification to appear, but is essentially non-functional. In the typical scenario, this patch doesn't effect the behavior. Here are some examples of where it does matter: 1) If gaim is closed with the buddy list hidden to the docklet, then gaim is started again without a notification area, the buddy list doesn't show up for 10 seconds (the time it takes for the docklet to timeout). This patch would reduce this to 3 seconds. 2) If the user removes the notification area from their panel, maybe to remove it from one panel and add it to a different panel, but doesn't add a new one back within 10 seconds, the current behavior would cause the docklet plugin to be unloaded. With this patch, the tray icon would automatically be added to the new notification area when it becomes available. 3) The gnome-panel dies and is not restarted within 10 seconds. Similar to #2. (There was a bug filed for this, but can't find it right now). My main concern was that it could be confusing to the user if they enable the docklet plugin, then 10 seconds later it gets disabled without any notification. This patch doesn't add any notification, but leaves the plugin running so it will automatically use a notification area when one becomes available. I also removed an unused parameter from docklet_remove() and changed the plugin description slightly to reflect the change in queuing/notification. Not sure how clear this is, so bug me on #gaim if you have any questions. --charkins" I made a few changes to this patch, but nothing terribly significant... committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 16 Dec 2005 09:16:14 +0000
parents fc464a0abccc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11218
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
1 #include <gtk/gtk.h>
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
2 #include <gtk/gtkgl.h>
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
3
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
4 #define DEFAULT_FRAME_DELAY 40
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
5
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
6 typedef void (gl_init_func) (GtkWidget *widget, void *data);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
7 typedef gboolean (*gl_config_func) (GtkWidget *widget, GdkEventConfigure *event,
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
8 void *data);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
9 typedef gboolean (*gl_draw_func) (GtkWidget *widget, GdkEventExpose *event,
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
10 void *data);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
11
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
12 struct draw_info {
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
13 gboolean timeout; /* use/not use a timer callback */
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
14 int timer_id; /* glib timer callback id */
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
15 guint delay_ms; /* timer callback delay in ms */
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
16 void *data; /* drawing data */
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
17 };
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
18
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
19 struct window_box {
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
20 GtkWidget *window;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
21 GtkWidget *vbox;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
22 GtkWidget *draw_area;
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
23 };
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
24
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
25 /**
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
26 * Initialize the gtkglext framework for all our widgets.
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
27 * @return 0 on success, non-zero on failure
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
28 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 11218
diff changeset
29 int cc_init_gtk_gl(void);
11218
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
30
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
31 /**
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
32 * Create a new OpenGL enabled window
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
33 * @param init the initialize callback function
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
34 * @param draw the drawing callback function
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
35 * @param data drawing metadata
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
36 * @param ret struct with returned window and vbox
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
37 */
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
38 void cc_new_gl_window(gl_init_func init, gl_config_func config,
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
39 gl_draw_func draw, struct draw_info *data,
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
40 struct window_box *ret);
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
41
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
42 /**
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
43 * Create a new OpenGL enabled drawing area widget.
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
44 * @param init the initialize callback function
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
45 * @param draw the drawing callback function
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
46 * @param data drawing metadata
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
47 * @return the drawing widget
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
48 */
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
49 GtkWidget *cc_new_gl_area(gl_init_func init, gl_config_func config,
ed017b9c532d [gaim-migrate @ 13350]
Charlie Stockman <chuckleberry>
parents:
diff changeset
50 gl_draw_func draw, struct draw_info *data);