diff options
author | Brian Tarricone <brian@tarricone.org> | 2007-10-20 19:10:14 +0000 |
---|---|---|
committer | Brian Tarricone <brian@tarricone.org> | 2007-10-20 19:10:14 +0000 |
commit | 9f9efd34b6bbe197e102ac96b3c2b943fcab17aa (patch) | |
tree | 9162990f0ea1de325c87c84e8cc0e596bbaad76c /src/xfce-desktop.h | |
parent | e0347014379759c2b7ade7e8db3f479112f6b963 (diff) | |
download | xfdesktop-9f9efd34b6bbe197e102ac96b3c2b943fcab17aa.tar.gz |
Redo how the menu system works so i can support multiple menus on the
desktop propery. Instead of the old method, where main.c watched the
desktop for mouse clicks, not XfceDesktop does that, and emits two new
signals: populate-root-menu and populate-secondary-root-menu. Handlers
of these get passed a GtkMenu, which they should fill with menu items.
They can (optionally) check to see if the passed GtkMenu already has
menu items in it (put there by another handler) and put menu items in
a submenu of the passed item.
This cleaned up interfaces quite a bit and moved code to some more sane
locations. The semi-downside of this is that now XfceDesktopMenu needs
to generate a GtkMenu tree from the XfceMenu every time the menu has
popped up. Performance doesn't seem to be hurt too much on my system,
but it might be a problem for some really slow old hardware (but hopefully
not). The upside is that the full GtkMenu tree isn't kept around in
RAM all the time.
End-user behavior hasn't changed yet, but this will let me properly fix the
context menu for the desktop when file icons are enabled.
(Old svn revision: 26158)
Diffstat (limited to 'src/xfce-desktop.h')
-rw-r--r-- | src/xfce-desktop.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/xfce-desktop.h b/src/xfce-desktop.h index 7ee5bfd0..59149581 100644 --- a/src/xfce-desktop.h +++ b/src/xfce-desktop.h @@ -1,7 +1,7 @@ /* * xfdesktop - xfce4's desktop manager * - * Copyright (c) 2004 Brian Tarricone, <bjt23@cornell.edu> + * Copyright (c) 2004-2007 Brian Tarricone, <bjt23@cornell.edu> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,9 +21,7 @@ #ifndef _XFCE_DESKTOP_H_ #define _XFCE_DESKTOP_H_ -#include <glib.h> -#include <glib-object.h> -#include <gtk/gtkwindow.h> +#include <gtk/gtk.h> #include "xfce-backdrop.h" @@ -60,6 +58,16 @@ struct _XfceDesktop struct _XfceDesktopClass { GtkWindowClass parent_class; + + /*< signals >*/ + + /* for the app menu/file context menu */ + void (*populate_root_menu)(XfceDesktop *desktop, + GtkMenuShell *menu); + + /* for the windowlist menu */ + void (*populate_secondary_root_menu)(XfceDesktop *desktop, + GtkMenuShell *menu); }; GType xfce_desktop_get_type () G_GNUC_CONST; @@ -96,6 +104,13 @@ void xfce_desktop_thaw_updates(XfceDesktop *desktop); XfceBackdrop *xfce_desktop_peek_backdrop(XfceDesktop *desktop, guint monitor); +void xfce_desktop_popup_root_menu(XfceDesktop *desktop, + guint button, + guint activate_time); +void xfce_desktop_popup_secondary_root_menu(XfceDesktop *desktop, + guint button, + guint activate_time); + G_END_DECLS #endif |