comparison pidgin/gtkdocklet-x11.c @ 20889:d41c5443f443

merge of 'bb426e3c52ba2442bfbf7ec6159714fca242cb92' and 'd35dd87d97af4087e74e0a16d574533ab62dad8f'
author Casey Harkins <charkins@pidgin.im>
date Sun, 28 Oct 2007 17:08:49 +0000
parents d3e0eb05ac94
children f16534ec2897 2a591a5b3322
comparison
equal deleted inserted replaced
20887:8c5e34b6782d 20889:d41c5443f443
227 227
228 purple_debug(PURPLE_DEBUG_INFO, "docklet", "destroyed\n"); 228 purple_debug(PURPLE_DEBUG_INFO, "docklet", "destroyed\n");
229 } 229 }
230 230
231 static gboolean 231 static gboolean
232 docklet_x11_get_geometry(gint *x, gint *y, gint *w, gint *h)
233 {
234 int lx,ly;
235 GtkWidget *widget = GTK_WIDGET(docklet);
236
237 if(docklet==NULL) return FALSE;
238
239 gdk_window_get_origin(GDK_WINDOW(widget->window), &lx, &ly);
240
241 if(x!=NULL) *x = lx + widget->allocation.x;
242 if(y!=NULL) *y = ly + widget->allocation.y;
243
244 if(w!=NULL) *w = widget->allocation.width;
245 if(h!=NULL) *h = widget->allocation.height;
246
247 return TRUE;
248 }
249
250 static GObject *
251 docklet_x11_get_gdk_screen()
252 {
253 #if GTK_CHECK_VERSION(2,2,0)
254 return (GObject *)gtk_widget_get_screen(GTK_WIDGET(docklet));
255 #else
256 return NULL;
257 #endif
258 }
259
260 static gboolean
261 docklet_x11_embed_timeout_cb() 232 docklet_x11_embed_timeout_cb()
262 { 233 {
263 /* The docklet was not embedded within the timeout. 234 /* The docklet was not embedded within the timeout.
264 * Remove it as a visibility manager, but leave the plugin 235 * Remove it as a visibility manager, but leave the plugin
265 * loaded so that it can embed automatically if/when a notification 236 * loaded so that it can embed automatically if/when a notification
340 docklet_x11_destroy, 311 docklet_x11_destroy,
341 docklet_x11_update_icon, 312 docklet_x11_update_icon,
342 docklet_x11_blank_icon, 313 docklet_x11_blank_icon,
343 docklet_x11_set_tooltip, 314 docklet_x11_set_tooltip,
344 #if GTK_CHECK_VERSION(2,2,0) 315 #if GTK_CHECK_VERSION(2,2,0)
345 docklet_x11_position_menu, 316 docklet_x11_position_menu
346 #else 317 #else
347 NULL, 318 NULL
348 #endif 319 #endif
349 docklet_x11_get_geometry,
350 docklet_x11_get_gdk_screen
351 }; 320 };
352 321
353 void 322 void
354 docklet_ui_init() 323 docklet_ui_init()
355 { 324 {