Top | ![]() |
![]() |
![]() |
![]() |
enum | GnomeUIInfoType |
enum | GnomeUIInfoConfigurableTypes |
#define | GNOME_APP_CONFIGURABLE_ITEM_EXIT |
enum | GnomeUIPixmapType |
GnomeUIInfo | |
struct | GnomeUIBuilderData |
#define | GNOMEUIINFO_KEY_UIDATA |
#define | GNOMEUIINFO_KEY_UIBDATA |
#define | GNOMEUIINFO_END |
#define | GNOMEUIINFO_SEPARATOR |
#define | GNOME_MENU_FILE_STRING |
#define | GNOME_MENU_FILE_PATH |
#define | GNOME_MENU_EDIT_STRING |
#define | GNOME_MENU_EDIT_PATH |
#define | GNOME_MENU_VIEW_STRING |
#define | GNOME_MENU_VIEW_PATH |
#define | GNOME_MENU_SETTINGS_STRING |
#define | GNOME_MENU_SETTINGS_PATH |
#define | GNOME_MENU_NEW_STRING |
#define | GNOME_MENU_NEW_PATH |
#define | GNOME_MENU_FILES_STRING |
#define | GNOME_MENU_FILES_PATH |
#define | GNOME_MENU_WINDOWS_STRING |
#define | GNOME_MENU_WINDOWS_PATH |
void (*GnomeUISignalConnectFunc) (GnomeUIInfo *uiinfo
,const char *signal_name
,GnomeUIBuilderData *uibdata
);
void
gnome_accelerators_sync (void
);
Flush the accelerator definitions into the application specific configuration file $HOME/.gnome2/accels/<app-id>.
void gnome_app_fill_menu (GtkMenuShell *menu_shell
,GnomeUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gboolean uline_accels
,gint pos
);
Fills the specified menu_shell
with items created from the specified
uiinfo
, inserting them from the item number pos
on. The accel_
group
will be used as the accel group for all newly created sub menus and serves
as the global accel group for all menu item hotkeys. If it is passed as
NULL
, global hotkeys will be disabled.
menu_shell |
A GtkMenuShell instance (a menu bar). |
|
uiinfo |
A pointer to the first element in an array of GnomeUIInfo structures. The last element of the array should have a type of GNOME_APP_UI_ENDOFINFO. |
|
accel_group |
||
uline_accels |
|
|
pos |
The position in the menu bar at which to start inserting items. |
void gnome_app_fill_menu_with_data (GtkMenuShell *menu_shell
,GnomeUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gboolean uline_accels
,gint pos
,gpointer user_data
);
This is the same as gnome_app_fill_menu()
, except that all the user data
pointers are filled with the value of user_data
.
menu_shell |
A GtkMenuShell instance (a menu bar). |
|
uiinfo |
A pointer to the first element in an array of GnomeUIInfo structures. The last element of the array should have a type of GNOME_APP_UI_ENDOFINFO. |
|
accel_group |
||
uline_accels |
|
|
pos |
The position in the menu bar at which to start inserting items. |
|
user_data |
Some application-specific data. |
void gnome_app_fill_menu_custom (GtkMenuShell *menu_shell
,GnomeUIInfo *uiinfo
,GnomeUIBuilderData *uibdata
,GtkAccelGroup *accel_group
,gboolean uline_accels
,gint pos
);
Fills the specified menu shell with items created from the specified
uiinfo
, inserting them from item number pos
on and using the specified
builder data (uibdata
) -- this is intended for language bindings.
The other parameters have the same meaning as in gnome_app_fill_menu()
.
menu_shell |
A GtkMenuShell instance (a menu bar). |
|
uiinfo |
A pointer to the first element in an array of GnomeUIInfo structures. The last element of the array should have a type of GNOME_APP_UI_ENDOFINFO. |
|
uibdata |
A GnomeUIInfoBuilderData instance. |
|
accel_group |
||
uline_accels |
|
|
pos |
The position in the menu bar at which to start inserting items. |
void
gnome_app_ui_configure_configurable (GnomeUIInfo *uiinfo
);
Configure all user-configurable elements in the given UI info structure. This includes loading and setting previously-set options from GNOME config files.
Normally, gnome_app_create_menus()
calls this function for the developer,
but if something needs to be altered afterwards, this function can be called
first. The main reason for this function being a public interface is so that
it can be called from gnome_popup_menu_new()
, which clears a copy of the
pass in GnomeUIInfo structures.
void gnome_app_create_menus (GnomeApp *app
,GnomeUIInfo *uiinfo
);
Constructs a menu bar and attaches it to the specified application window.
app |
A GnomeApp instance representing the current application. |
|
uiinfo |
The first in an array GnomeUIInfo instances containing the menu data. |
void gnome_app_create_menus_interp (GnomeApp *app
,GnomeUIInfo *uiinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
);
Identical to gnome_app_create_menus()
, except that extra functions and data
can be passed in for finer control of the destruction and marshalling.
app |
A GnomeApp instance, representing the current application. |
|
uiinfo |
The first item in an array of GnomeUIInfo structures describing the menu bar. |
|
relay_func |
A marshaller for the signal callbacks. |
|
data |
Application specific data passed to the signal callback functions. |
|
destroy_func |
The function to call when the menu bar is destroyed. |
void gnome_app_create_menus_with_data (GnomeApp *app
,GnomeUIInfo *uiinfo
,gpointer user_data
);
Identical to gnome_app_create_menus()
, except that user_data
is passed to
all the callback functions when signals are emitted.
app |
A GnomeApp instance representing the current application. |
|
uiinfo |
The first in an array GnomeUIInfo instances containing the menu data. |
|
user_data |
Application-specific data that is passed to every callback function. |
void gnome_app_create_menus_custom (GnomeApp *app
,GnomeUIInfo *uiinfo
,GnomeUIBuilderData *uibdata
);
Identical to gnome_app_create_menus()
, except that uibdata
is also
specified for creating the signal handlers. Mostly for use by language
bindings.
app |
A GnomeApp instance representing the current application. |
|
uiinfo |
The first in an array GnomeUIInfo instances containing the menu data. |
|
uibdata |
An appropriate GnomeUIBuilderData instance. |
void gnome_app_fill_toolbar (GtkToolbar *toolbar
,GnomeUIInfo *uiinfo
,GtkAccelGroup *accel_group
);
Fills toolbar
with buttons specified in uiinfo
. If accel_group
is not
NULL
, the items' accelrator keys are put into it.
toolbar |
A GtkToolbar instance. |
|
uiinfo |
An array of GnomeUIInfo structures containing the items for the toolbar. |
|
accel_group |
A GtkAccelGroup for holding the accelerator keys of the items
(or |
void gnome_app_fill_toolbar_with_data (GtkToolbar *toolbar
,GnomeUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gpointer user_data
);
The same as gnome_app_fill_toolbar()
, except that the user data pointers in
the signal handlers are set to user_data
.
toolbar |
A GtkToolbar instance. |
|
uiinfo |
An array of GnomeUIInfo structures containing the items for the toolbar. |
|
accel_group |
A GtkAccelGroup for holding the accelerator keys of the items
(or |
|
user_data |
Application specific data. |
void gnome_app_fill_toolbar_custom (GtkToolbar *toolbar
,GnomeUIInfo *uiinfo
,GnomeUIBuilderData *uibdata
,GtkAccelGroup *accel_group
);
The same as gnome_app_fill_toolbar()
, except that the sepcified uibdata
instance is used. This is mostly for the benefit of language bindings.
toolbar |
A GtkToolbar instance. |
|
uiinfo |
An array of GnomeUIInfo structures containing the items for the toolbar. |
|
uibdata |
The GnomeUIBuilderData data for the toolbar. |
|
accel_group |
A GtkAccelGroup for holding the accelerator keys of the items
(or |
void gnome_app_create_toolbar (GnomeApp *app
,GnomeUIInfo *uiinfo
);
Constructs a toolbar and attaches it to the specified application window.
app |
A GnomeApp instance. |
|
uiinfo |
A GnomeUIInfo array specifying the contents of the toolbar. |
void gnome_app_create_toolbar_interp (GnomeApp *app
,GnomeUIInfo *uiinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
);
Constructs a toolbar and attaches it to the specified application window -- this version is intended for language bindings.
app |
A GnomeApp instance. |
|
uiinfo |
A GnomeUIInfo array specifying the contents of the toolbar. |
|
relay_func |
Argument marshalling function. |
|
data |
Application specific data to pass to signal callbacks. |
|
destroy_func |
The function to call when the toolbar is destroyed. |
void gnome_app_create_toolbar_with_data (GnomeApp *app
,GnomeUIInfo *uiinfo
,gpointer user_data
);
Constructs a toolbar, sets all the user data pointers to
user_data
, and attaches it to app
.
app |
A GnomeApp instance. |
|
uiinfo |
A GnomeUIInfo array specifying the contents of the toolbar. |
|
user_data |
Application specific data to be sent to each signal callback function. |
void gnome_app_create_toolbar_custom (GnomeApp *app
,GnomeUIInfo *uiinfo
,GnomeUIBuilderData *uibdata
);
Constructs a toolbar and attaches it to the app
window,
using uibdata
builder data -- intended for language bindings.
app |
A GnomeApp instance. |
|
uiinfo |
A GnomeUIInfo array specifying the contents of the toolbar. |
|
uibdata |
A GnomeUIBuilderData instance specifying the handlers to use for the toolbar. |
GtkWidget * gnome_app_find_menu_pos (GtkWidget *parent
,const gchar *path
,gint *pos
);
Finds a menu item described by path starting in the GtkMenuShell top and
returns its parent GtkMenuShell and the position after this item in pos
.
The meaning of pos
is that a subsequent call to gtk_menu_shell_insert(p, w,
pos) would then insert widget w in GtkMenuShell p right after the menu item
described by path.
void gnome_app_remove_menus (GnomeApp *app
,const gchar *path
,gint items
);
Removes items
items from the existing app
's menu structure,
beginning with item described by path
.
The path
argument should be in the form "File/.../.../Something". "" will
insert the item as the first one in the menubar, "File/" will insert it as
the first one in the File menu, "File/Settings" will insert it after the
Setting item in the File menu use of "File/<Separator>" should be obvious.
However, the use of "<Separator>" stops after the first separator.
app |
A GnomeApp instance. |
|
path |
A path to the menu item concerned. |
|
items |
The number of items to remove. |
void gnome_app_remove_menu_range (GnomeApp *app
,const gchar *path
,gint start
,gint items
);
Same as the gnome_app_remove_menus()
, except it removes the specified number
of items
from the existing app
's menu structure begining with item
described by (path
plus start
). This is very useful for adding and
removing Recent document items in the File menu.
app |
A GnomeApp instance. |
|
path |
A path to the menu item concerned. |
|
start |
An offset beyond the start of |
|
items |
The number of items to remove. |
void gnome_app_insert_menus_custom (GnomeApp *app
,const gchar *path
,GnomeUIInfo *uiinfo
,GnomeUIBuilderData *uibdata
);
Inserts menus described by uiinfo
in existing app
's menu
structure right after the item described by path
. The uibdata
parameter
makes this, again, most useful for language bindings.
app |
A GnomeApp instance. |
|
path |
A path to the menu item concerned. |
|
uiinfo |
A GnomeUIInfo array describing the menus. |
|
uibdata |
A GnomeUIBuilderData instance describing the functions to attach as the menu's callbacks. |
void gnome_app_insert_menus (GnomeApp *app
,const gchar *path
,GnomeUIInfo *menuinfo
);
Insert the menus given by menuinfo
beginning at path
into the pre-existing
app
.
app |
A GnomeApp instance. |
|
path |
A path to the menu item concerned. |
|
menuinfo |
A GnomeUIInfo array describing the menus. |
void gnome_app_insert_menus_with_data (GnomeApp *app
,const gchar *path
,GnomeUIInfo *menuinfo
,gpointer data
);
This is the same as gnome_app_insert_menus()
, except that the specified
data
is passed to each signal callback.
app |
A GnomeApp instance. |
|
path |
A path to the menu item concerned. |
|
menuinfo |
A GnomeUIInfo array describing the menus. |
|
data |
Application specific data to send to each signal callback. |
void gnome_app_insert_menus_interp (GnomeApp *app
,const gchar *path
,GnomeUIInfo *menuinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
);
THe same as gnome_app_insert_menus()
, except that the given functions are
attached to each menu item. Mostly of use for language bindings.
app |
A GnomeApp instance. |
|
path |
A path to the menu item concerned. |
|
menuinfo |
A GnomeUIInfo array describing the menus. |
|
relay_func |
A custom marshallar for signal data., |
|
data |
Application-specific data to send to each signal callback. |
|
destroy_func |
The function to call when the menu item is destroyed. |
void gnome_app_install_appbar_menu_hints (GnomeAppBar *appbar
,GnomeUIInfo *uiinfo
);
Install menu hints for the given appbar
object. This function cannot just
be called automatically, since it is impossible to reliably find the correct
appbar
.
appbar |
An existing GnomeAppBar instance. |
|
uiinfo |
A GnomeUIInfo array of a menu for which hints will be set. |
void gnome_app_install_statusbar_menu_hints (GtkStatusbar *bar
,GnomeUIInfo *uiinfo
);
Install menu hints for the given status bar.
void gnome_app_install_menu_hints (GnomeApp *app
,GnomeUIInfo *uiinfo
);
Set menu hints for the app
object's attached status bar.
app |
An existing GnomeAppBar instance. |
|
uiinfo |
A GnomeUIInfo array of a menu for which hints will be set. |
void gnome_app_setup_toolbar (GtkToolbar *toolbar
,BonoboDockItem *dock_item
);
Sets up a toolbar to use GNOME user preferences.
toolbar |
Pointer to a GtkToolbar instance. |
|
dock_item |
Pointer to the BonoboDockItem the toolbar is inside, or |
#define GNOMEUIINFO_ITEM_DATA(label, tooltip, callback, user_data, xpm_data)
#define GNOMEUIINFO_TOGGLEITEM_DATA(label, tooltip, callback, user_data, xpm_data)
#define GNOMEUIINFO_RADIOITEM_DATA(label, tooltip, callback, user_data, xpm_data)
#define GNOMEUIINFO_MENU_EXIT_ITEM(cb, data) GNOMEUIINFO_MENU_QUIT_ITEM(cb, data)
These values identify the item type that a particular GnomeUIInfo structure specifies.
One should be careful when using gnome_app_create_[custom|interp|with_data] functions with GnomeUIInfo arrays containing GNOME_APP_UI_BUILDER_DATA items, since their GnomeUIBuilderData structures completely override the ones generated or supplied by the above functions.
No more items, use it at the end of an array. |
||
Normal item, or radio item if it is inside a radioitems group. |
||
Toggle (check box) item. |
||
Radio item group. |
||
Item that defines a subtree/submenu. |
||
Separator line (menus) or blank space (toolbars). |
||
Create a list of help topics, used in the Help menu. |
||
Specifies the builder data for the following entries, see code for further info. |
||
A configurable menu item. |
||
Item that defines a subtree/submenu, same as GNOME_APP_UI_SUBTREE, but the texts should be looked up in the libgnome catalog. |
||
Almost like |
A user can redefine the accelerator keys for each menu item (if the application supports this). This enum gives an identifier for each menu shortcut that can possible be redefined. If an application is not using one of these accelerators, then no shortcut redefinition is possible unless the application specifically implements it (moral: use standard menu items).
The "New" menu. |
||
The "Open" menu. |
||
The "Save" menu. |
||
The "Save as..." menu. |
||
The "Revert" menu. |
||
The "Print" menu. |
||
The "Print setup..." menu. |
||
The "Close" menu. |
||
The "Quit" menu. |
||
The "Cut" menu. |
||
The "Copy" menu. |
||
The "Paste" menu. |
||
The "Clear" menu. |
||
The "Undo" menu. |
||
The "Redo" menu. |
||
The "Find..." menu. |
||
The "Find again" menu. |
||
The "Replace..." menu. |
||
The "Properties..." menu. |
||
The "Preferences..." menu. |
||
The "About..." menu. |
||
The "Select all" menu. |
||
The "New window" menu. |
||
The "Close window" menu. |
||
The "New game" menu. |
||
The "Pause game" menu. |
||
The "Restart game" menu. |
||
The "Undo move" menu. |
||
The "Redo move" menu. |
||
The "Hint" menu. |
||
The "Scores..." menu. |
||
The "End game" menu. |
#define GNOME_APP_CONFIGURABLE_ITEM_EXIT GNOME_APP_CONFIGURABLE_ITEM_QUIT
typedef struct { GnomeUIInfoType type; /* Type of item */ gchar const *label; /* String to use in item's label */ gchar const *hint; /* Tooltip for toolbar items, status bar message for menu items. */ gpointer moreinfo; /* Extra information; depends on the type. */ gpointer user_data; /* User data sent to the callback. */ gpointer unused_data; /* Should be NULL (reserved). */ GnomeUIPixmapType pixmap_type; /* Type of pixmap for this item. */ gconstpointer pixmap_info; /* Pointer to pixmap information. */ guint accelerator_key; /* Accelerator key, or 0 for none. */ GdkModifierType ac_mods; /* Mask of modifier keys for the accelerator. */ GtkWidget *widget; /* Filled in by the gnome_app_create* functions. */ } GnomeUIInfo;
struct GnomeUIBuilderData { GnomeUISignalConnectFunc connect_func; gpointer data; gboolean is_interp; GtkCallbackMarshal relay_func; GDestroyNotify destroy_func; };
This structure defines how the relevant menu items are to have their signals
connected. This includes the activations signals, as well as the destroy
notifications. The affected menu items are either the items following aA
GNOME_APP_UI_BUILDER_DATA item in an array of GnomeUIInfo structures or
all of the menu items that are connected as a result of a call to
gnome_app_create_menu_custom()
and similar functions.
GnomeUISignalConnectFunc |
Function that connects to the item's signals. |
|
gpointer |
User data pointer for the signal callback. |
|
gboolean |
If |
|
GtkCallbackMarshal |
Marshaller function for language bindings. |
|
GDestroyNotify |
Destroy notification function for language bindings. |