![]() |
![]() |
![]() |
MATE UI Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <libmateui/libmateui.h> enum MateUIInfoType; enum MateUIInfoConfigurableTypes; #define MATE_APP_CONFIGURABLE_ITEM_EXIT enum MateUIPixmapType; MateUIInfo; struct MateUIBuilderData; #define MATEUIINFO_KEY_UIDATA #define MATEUIINFO_KEY_UIBDATA void (*MateUISignalConnectFunc) (MateUIInfo *uiinfo
,const char *signal_name
,MateUIBuilderData *uibdata
); void mate_accelerators_sync (void
); void mate_app_fill_menu (GtkMenuShell *menu_shell
,MateUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gboolean uline_accels
,gint pos
); void mate_app_fill_menu_with_data (GtkMenuShell *menu_shell
,MateUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gboolean uline_accels
,gint pos
,gpointer user_data
); void mate_app_fill_menu_custom (GtkMenuShell *menu_shell
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
,GtkAccelGroup *accel_group
,gboolean uline_accels
,gint pos
); void mate_app_ui_configure_configurable (MateUIInfo *uiinfo
); void mate_app_create_menus (MateApp *app
,MateUIInfo *uiinfo
); void mate_app_create_menus_interp (MateApp *app
,MateUIInfo *uiinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
); void mate_app_create_menus_with_data (MateApp *app
,MateUIInfo *uiinfo
,gpointer user_data
); void mate_app_create_menus_custom (MateApp *app
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
); void mate_app_fill_toolbar (GtkToolbar *toolbar
,MateUIInfo *uiinfo
,GtkAccelGroup *accel_group
); void mate_app_fill_toolbar_with_data (GtkToolbar *toolbar
,MateUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gpointer user_data
); void mate_app_fill_toolbar_custom (GtkToolbar *toolbar
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
,GtkAccelGroup *accel_group
); void mate_app_create_toolbar (MateApp *app
,MateUIInfo *uiinfo
); void mate_app_create_toolbar_interp (MateApp *app
,MateUIInfo *uiinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
); void mate_app_create_toolbar_with_data (MateApp *app
,MateUIInfo *uiinfo
,gpointer user_data
); void mate_app_create_toolbar_custom (MateApp *app
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
); GtkWidget * mate_app_find_menu_pos (GtkWidget *parent
,const gchar *path
,gint *pos
); void mate_app_remove_menus (MateApp *app
,const gchar *path
,gint items
); void mate_app_remove_menu_range (MateApp *app
,const gchar *path
,gint start
,gint items
); void mate_app_insert_menus_custom (MateApp *app
,const gchar *path
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
); void mate_app_insert_menus (MateApp *app
,const gchar *path
,MateUIInfo *menuinfo
); void mate_app_insert_menus_with_data (MateApp *app
,const gchar *path
,MateUIInfo *menuinfo
,gpointer data
); void mate_app_insert_menus_interp (MateApp *app
,const gchar *path
,MateUIInfo *menuinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
); void mate_app_install_appbar_menu_hints (MateAppBar *appbar
,MateUIInfo *uiinfo
); void mate_app_install_statusbar_menu_hints (GtkStatusbar *bar
,MateUIInfo *uiinfo
); void mate_app_install_menu_hints (MateApp *app
,MateUIInfo *uiinfo
); void mate_app_setup_toolbar (GtkToolbar *toolbar
,MateComponentDockItem *dock_item
); #define MATEUIINFO_END #define MATEUIINFO_SEPARATOR #define MATEUIINFO_ITEM (label, tooltip, callback, xpm_data) #define MATEUIINFO_ITEM_STOCK (label, tooltip, callback, stock_id) #define MATEUIINFO_ITEM_NONE (label, tooltip, callback) #define MATEUIINFO_ITEM_DATA (label, tooltip, callback, user_data, xpm_data) #define MATEUIINFO_TOGGLEITEM (label, tooltip, callback, xpm_data) #define MATEUIINFO_TOGGLEITEM_DATA (label, tooltip, callback, user_data, xpm_data) #define MATEUIINFO_HELP (app_name) #define MATEUIINFO_SUBTREE (label, tree) #define MATEUIINFO_SUBTREE_HINT (label, hint, tree) #define MATEUIINFO_SUBTREE_STOCK (label, tree, stock_id) #define MATEUIINFO_INCLUDE (tree) #define MATEUIINFO_RADIOLIST (list) #define MATEUIINFO_RADIOITEM (label, tooltip, callback, xpm_data) #define MATEUIINFO_RADIOITEM_DATA (label, tooltip, callback, user_data, xpm_data) #define MATEUIINFO_MENU_NEW_ITEM (label, tip, cb, data) #define MATEUIINFO_MENU_NEW_SUBTREE (tree) #define MATEUIINFO_MENU_OPEN_ITEM (cb, data) #define MATEUIINFO_MENU_SAVE_ITEM (cb, data) #define MATEUIINFO_MENU_SAVE_AS_ITEM (cb, data) #define MATEUIINFO_MENU_REVERT_ITEM (cb, data) #define MATEUIINFO_MENU_PRINT_ITEM (cb, data) #define MATEUIINFO_MENU_PRINT_SETUP_ITEM (cb, data) #define MATEUIINFO_MENU_CLOSE_ITEM (cb, data) #define MATEUIINFO_MENU_EXIT_ITEM (cb, data) #define MATEUIINFO_MENU_QUIT_ITEM (cb, data) #define MATEUIINFO_MENU_CUT_ITEM (cb, data) #define MATEUIINFO_MENU_COPY_ITEM (cb, data) #define MATEUIINFO_MENU_PASTE_ITEM (cb, data) #define MATEUIINFO_MENU_SELECT_ALL_ITEM (cb, data) #define MATEUIINFO_MENU_CLEAR_ITEM (cb, data) #define MATEUIINFO_MENU_UNDO_ITEM (cb, data) #define MATEUIINFO_MENU_REDO_ITEM (cb, data) #define MATEUIINFO_MENU_FIND_ITEM (cb, data) #define MATEUIINFO_MENU_FIND_AGAIN_ITEM (cb, data) #define MATEUIINFO_MENU_REPLACE_ITEM (cb, data) #define MATEUIINFO_MENU_PROPERTIES_ITEM (cb, data) #define MATEUIINFO_MENU_PREFERENCES_ITEM (cb, data) #define MATEUIINFO_MENU_NEW_WINDOW_ITEM (cb, data) #define MATEUIINFO_MENU_CLOSE_WINDOW_ITEM (cb, data) #define MATEUIINFO_MENU_ABOUT_ITEM (cb, data) #define MATEUIINFO_MENU_NEW_GAME_ITEM (cb, data) #define MATEUIINFO_MENU_PAUSE_GAME_ITEM (cb, data) #define MATEUIINFO_MENU_RESTART_GAME_ITEM (cb, data) #define MATEUIINFO_MENU_UNDO_MOVE_ITEM (cb, data) #define MATEUIINFO_MENU_REDO_MOVE_ITEM (cb, data) #define MATEUIINFO_MENU_HINT_ITEM (cb, data) #define MATEUIINFO_MENU_SCORES_ITEM (cb, data) #define MATEUIINFO_MENU_END_GAME_ITEM (cb, data) #define MATEUIINFO_MENU_FILE_TREE (tree) #define MATEUIINFO_MENU_EDIT_TREE (tree) #define MATEUIINFO_MENU_VIEW_TREE (tree) #define MATEUIINFO_MENU_SETTINGS_TREE (tree) #define MATEUIINFO_MENU_FILES_TREE (tree) #define MATEUIINFO_MENU_WINDOWS_TREE (tree) #define MATEUIINFO_MENU_HELP_TREE (tree) #define MATEUIINFO_MENU_GAME_TREE (tree) #define MATE_MENU_FILE_STRING #define MATE_MENU_FILE_PATH #define MATE_MENU_EDIT_STRING #define MATE_MENU_EDIT_PATH #define MATE_MENU_VIEW_STRING #define MATE_MENU_VIEW_PATH #define MATE_MENU_SETTINGS_STRING #define MATE_MENU_SETTINGS_PATH #define MATE_MENU_NEW_STRING #define MATE_MENU_NEW_PATH #define MATE_MENU_FILES_STRING #define MATE_MENU_FILES_PATH #define MATE_MENU_WINDOWS_STRING #define MATE_MENU_WINDOWS_PATH const gchar * mate_app_helper_gettext (const gchar *string
); #define L_ (x) #define D_ (x)
This module lets a developer easily create menus and toolbars for use in their applications. Basically, a hierarchy of MateUIInfo structures are defined and then the appropriate functions from this module are called to create the menu or tool bars.
typedef enum { MATE_APP_UI_ENDOFINFO, MATE_APP_UI_ITEM, MATE_APP_UI_TOGGLEITEM, MATE_APP_UI_RADIOITEMS, MATE_APP_UI_SUBTREE, MATE_APP_UI_SEPARATOR, MATE_APP_UI_HELP, MATE_APP_UI_BUILDER_DATA, MATE_APP_UI_ITEM_CONFIGURABLE, MATE_APP_UI_SUBTREE_STOCK, MATE_APP_UI_INCLUDE } MateUIInfoType;
These values identify the item type that a particular MateUIInfo structure specifies.
One should be careful when using mate_app_create_[custom|interp|with_data] functions with MateUIInfo arrays containing MATE_APP_UI_BUILDER_DATA items, since their MateUIBuilderData 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 MATE_APP_UI_SUBTREE, but the texts should be looked up in the libmate catalog. | |
Almost like MATE_APP_UI_SUBTREE , but inserts items
into the current menu or whatever, instead of making a submenu.
|
typedef enum { /* 0 */ MATE_APP_CONFIGURABLE_ITEM_NEW, MATE_APP_CONFIGURABLE_ITEM_OPEN, MATE_APP_CONFIGURABLE_ITEM_SAVE, MATE_APP_CONFIGURABLE_ITEM_SAVE_AS, MATE_APP_CONFIGURABLE_ITEM_REVERT, MATE_APP_CONFIGURABLE_ITEM_PRINT, MATE_APP_CONFIGURABLE_ITEM_PRINT_SETUP, MATE_APP_CONFIGURABLE_ITEM_CLOSE, MATE_APP_CONFIGURABLE_ITEM_QUIT, MATE_APP_CONFIGURABLE_ITEM_CUT, /* 10 */ MATE_APP_CONFIGURABLE_ITEM_COPY, MATE_APP_CONFIGURABLE_ITEM_PASTE, MATE_APP_CONFIGURABLE_ITEM_CLEAR, MATE_APP_CONFIGURABLE_ITEM_UNDO, MATE_APP_CONFIGURABLE_ITEM_REDO, MATE_APP_CONFIGURABLE_ITEM_FIND, MATE_APP_CONFIGURABLE_ITEM_FIND_AGAIN, MATE_APP_CONFIGURABLE_ITEM_REPLACE, MATE_APP_CONFIGURABLE_ITEM_PROPERTIES, MATE_APP_CONFIGURABLE_ITEM_PREFERENCES, /* 20 */ MATE_APP_CONFIGURABLE_ITEM_ABOUT, MATE_APP_CONFIGURABLE_ITEM_SELECT_ALL, MATE_APP_CONFIGURABLE_ITEM_NEW_WINDOW, MATE_APP_CONFIGURABLE_ITEM_CLOSE_WINDOW, MATE_APP_CONFIGURABLE_ITEM_NEW_GAME, MATE_APP_CONFIGURABLE_ITEM_PAUSE_GAME, MATE_APP_CONFIGURABLE_ITEM_RESTART_GAME, MATE_APP_CONFIGURABLE_ITEM_UNDO_MOVE, MATE_APP_CONFIGURABLE_ITEM_REDO_MOVE, MATE_APP_CONFIGURABLE_ITEM_HINT, /* 30 */ MATE_APP_CONFIGURABLE_ITEM_SCORES, MATE_APP_CONFIGURABLE_ITEM_END_GAME } MateUIInfoConfigurableTypes;
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 MATE_APP_CONFIGURABLE_ITEM_EXIT MATE_APP_CONFIGURABLE_ITEM_QUIT
The EXIT
and QUIT
commands are synonyms
(they were used interchangably and inconsistently in MATE 1). This define
just makes this the case for configurable menu items as well. Note, however,
that in MATE 2, the use of exit is deprecated and all new
applications should use the word quit whenever termination
of an application is being discussed.
typedef enum { MATE_APP_PIXMAP_NONE, MATE_APP_PIXMAP_STOCK, MATE_APP_PIXMAP_DATA, MATE_APP_PIXMAP_FILENAME } MateUIPixmapType;
These values identify the type of pixmap used in an item.
typedef struct { MateUIInfoType 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). */ MateUIPixmapType 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 mate_app_create* functions. */ } MateUIInfo;
This is the structure that defines an item in a menu bar or toolbar. The idea is to create an array of such structures with the information needed to create menus or toolbars. The most convenient way to create such a structure is to use the MATEUIINFO_* macros provided below.
The moreinfo
parameter contents depend on the type
. For 'item',
'toggleitem' and 'radioitem' types, this is a pointer to the function to
call when the item is activated. For 'subtrees', it is a pointer to another
array of MateUIInfo structures. For 'radioitem lead' entry, it is a
pointer to an array of MateUIInfo structures for the radio item group. For
a 'help' item, it specifies the help node to load (i.e. the application's
identifier) or NULL
for the main program's name. For 'builder data',
moreinfo
points to the MateUIBuilderData structure for the subsequent
items.
The contents of the pixmap_info
depend upon the value of pixmap_type
. If
pixmap_type
is MATE_APP_PIXMAP_STOCK
, then pixmap_info
is a pointer to a
stock icon name. For MATE_APP_PIXMAP_DATA pixmaps, pixmap_info
is a
pointer to inline xpm data. For MATE_APP_PIXMAP_FILENAME pixmaps, it is a
pointer to the filename string.
When type
is MATE_APP_UI_ITEM_CONFIGURABLE, accelerator_key
is
overloaded to be the name of the configurable pixmap (an element from the
MateUIInfoConfigurableTypes enum). In this case ac_mods
should be 0.
The widget
field in the MateUIInfo structure is filled in by the creation
function. It can be used to tweak the widgets once they have been created if
the application requires that level of fine-grained control.
struct MateUIBuilderData { MateUISignalConnectFunc 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
MATE_APP_UI_BUILDER_DATA item in an array of MateUIInfo structures or
all of the menu items that are connected as a result of a call to
mate_app_create_menu_custom()
and similar functions.
MateUISignalConnectFunc |
Function that connects to the item's signals. |
User data pointer for the signal callback. | |
If TRUE , the signal should be connected with
g_signal_connect_closure_by_id() , otherwise, g_signal_connect() is used.
|
|
Marshaller function for language bindings. | |
Destroy notification function for language bindings. |
#define MATEUIINFO_KEY_UIDATA "uidata"
The widget
element in a MateUIInfo structure will have
this parameter set to the user data that was given in the MateUIInfo instance.
#define MATEUIINFO_KEY_UIBDATA "uibdata"
The widget
element in a MateUIInfo structure will have
this parameter set to the user data that was given in the relevant
MateUIBuilderData structure that was applicable at the time of construction
of the widget.
void (*MateUISignalConnectFunc) (MateUIInfo *uiinfo
,const char *signal_name
,MateUIBuilderData *uibdata
);
The template for functions that are called as a result of signals being emitted from a menu or tool bar item. Fnuctions of this type are given as the first element of a MateUIBuilderData instance.
|
The user data that was part of the MateUIInfo instance. |
|
The name of the emitted signal. |
|
The user data that was part of the relevant MateUIBuilderData instance. |
void mate_accelerators_sync (void
);
Flush the accelerator definitions into the application specific configuration file $HOME/.mate2/accels/<app-id>.
void mate_app_fill_menu (GtkMenuShell *menu_shell
,MateUIInfo *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.
|
A GtkMenuShell instance (a menu bar). |
|
A pointer to the first element in an array of MateUIInfo structures. The last element of the array should have a type of MATE_APP_UI_ENDOFINFO. |
|
A GtkAccelGroup. |
|
TRUE if underline accelerators will be drawn for the menu
item labels.
|
|
The position in the menu bar at which to start inserting items. |
void mate_app_fill_menu_with_data (GtkMenuShell *menu_shell
,MateUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gboolean uline_accels
,gint pos
,gpointer user_data
);
This is the same as mate_app_fill_menu()
, except that all the user data
pointers are filled with the value of user_data
.
|
A GtkMenuShell instance (a menu bar). |
|
A pointer to the first element in an array of MateUIInfo structures. The last element of the array should have a type of MATE_APP_UI_ENDOFINFO. |
|
A GtkAccelGroup. |
|
TRUE if underline accelerators will be drawn for the menu
item labels.
|
|
The position in the menu bar at which to start inserting items. |
|
Some application-specific data. |
void mate_app_fill_menu_custom (GtkMenuShell *menu_shell
,MateUIInfo *uiinfo
,MateUIBuilderData *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 mate_app_fill_menu()
.
|
A GtkMenuShell instance (a menu bar). |
|
A pointer to the first element in an array of MateUIInfo structures. The last element of the array should have a type of MATE_APP_UI_ENDOFINFO. |
|
A MateUIInfoBuilderData instance. |
|
A GtkAccelGroup. |
|
TRUE if underline accelerators will be drawn for the menu
item labels.
|
|
The position in the menu bar at which to start inserting items. |
void mate_app_ui_configure_configurable (MateUIInfo *uiinfo
);
Configure all user-configurable elements in the given UI info structure. This includes loading and setting previously-set options from MATE config files.
Normally, mate_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 mate_popup_menu_new()
, which clears a copy of the
pass in MateUIInfo structures.
|
Pointer to MATE UI menu/toolbar info |
void mate_app_create_menus (MateApp *app
,MateUIInfo *uiinfo
);
Constructs a menu bar and attaches it to the specified application window.
|
A MateApp instance representing the current application. |
|
The first in an array MateUIInfo instances containing the menu data. |
void mate_app_create_menus_interp (MateApp *app
,MateUIInfo *uiinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
);
Identical to mate_app_create_menus()
, except that extra functions and data
can be passed in for finer control of the destruction and marshalling.
|
A MateApp instance, representing the current application. |
|
The first item in an array of MateUIInfo structures describing the menu bar. |
|
A marshaller for the signal callbacks. |
|
Application specific data passed to the signal callback functions. |
|
The function to call when the menu bar is destroyed. |
void mate_app_create_menus_with_data (MateApp *app
,MateUIInfo *uiinfo
,gpointer user_data
);
Identical to mate_app_create_menus()
, except that user_data
is passed to
all the callback functions when signals are emitted.
|
A MateApp instance representing the current application. |
|
The first in an array MateUIInfo instances containing the menu data. |
|
Application-specific data that is passed to every callback function. |
void mate_app_create_menus_custom (MateApp *app
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
);
Identical to mate_app_create_menus()
, except that uibdata
is also
specified for creating the signal handlers. Mostly for use by language
bindings.
|
A MateApp instance representing the current application. |
|
The first in an array MateUIInfo instances containing the menu data. |
|
An appropriate MateUIBuilderData instance. |
void mate_app_fill_toolbar (GtkToolbar *toolbar
,MateUIInfo *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.
|
A GtkToolbar instance. |
|
An array of MateUIInfo structures containing the items for the toolbar. |
|
A GtkAccelGroup for holding the accelerator keys of the items
(or NULL ).
|
void mate_app_fill_toolbar_with_data (GtkToolbar *toolbar
,MateUIInfo *uiinfo
,GtkAccelGroup *accel_group
,gpointer user_data
);
The same as mate_app_fill_toolbar()
, except that the user data pointers in
the signal handlers are set to user_data
.
|
A GtkToolbar instance. |
|
An array of MateUIInfo structures containing the items for the toolbar. |
|
A GtkAccelGroup for holding the accelerator keys of the items
(or NULL ).
|
|
Application specific data. |
void mate_app_fill_toolbar_custom (GtkToolbar *toolbar
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
,GtkAccelGroup *accel_group
);
The same as mate_app_fill_toolbar()
, except that the sepcified uibdata
instance is used. This is mostly for the benefit of language bindings.
|
A GtkToolbar instance. |
|
An array of MateUIInfo structures containing the items for the toolbar. |
|
The MateUIBuilderData data for the toolbar. |
|
A GtkAccelGroup for holding the accelerator keys of the items
(or NULL ).
|
void mate_app_create_toolbar (MateApp *app
,MateUIInfo *uiinfo
);
Constructs a toolbar and attaches it to the specified application window.
|
A MateApp instance. |
|
A MateUIInfo array specifying the contents of the toolbar. |
void mate_app_create_toolbar_interp (MateApp *app
,MateUIInfo *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.
|
A MateApp instance. |
|
A MateUIInfo array specifying the contents of the toolbar. |
|
Argument marshalling function. |
|
Application specific data to pass to signal callbacks. |
|
The function to call when the toolbar is destroyed. |
void mate_app_create_toolbar_with_data (MateApp *app
,MateUIInfo *uiinfo
,gpointer user_data
);
Constructs a toolbar, sets all the user data pointers to
user_data
, and attaches it to app
.
|
A MateApp instance. |
|
A MateUIInfo array specifying the contents of the toolbar. |
|
Application specific data to be sent to each signal callback function. |
void mate_app_create_toolbar_custom (MateApp *app
,MateUIInfo *uiinfo
,MateUIBuilderData *uibdata
);
Constructs a toolbar and attaches it to the app
window,
using uibdata
builder data -- intended for language bindings.
|
A MateApp instance. |
|
A MateUIInfo array specifying the contents of the toolbar. |
|
A MateUIBuilderData instance specifying the handlers to use for the toolbar. |
GtkWidget * mate_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.
|
Root menu shell widget containing menu items to be searched. |
|
Specifies the target menu item by menu path. |
|
Used to hold the returned menu items' position. |
Returns : |
The parent menu shell of path .
|
void mate_app_remove_menus (MateApp *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.
|
A MateApp instance. |
|
A path to the menu item concerned. |
|
The number of items to remove. |
void mate_app_remove_menu_range (MateApp *app
,const gchar *path
,gint start
,gint items
);
Same as the mate_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.
|
A MateApp instance. |
|
A path to the menu item concerned. |
|
An offset beyond the start of path at which to begin removing.
|
|
The number of items to remove. |
void mate_app_insert_menus_custom (MateApp *app
,const gchar *path
,MateUIInfo *uiinfo
,MateUIBuilderData *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.
|
A MateApp instance. |
|
A path to the menu item concerned. |
|
A MateUIInfo array describing the menus. |
|
A MateUIBuilderData instance describing the functions to attach as the menu's callbacks. |
void mate_app_insert_menus (MateApp *app
,const gchar *path
,MateUIInfo *menuinfo
);
Insert the menus given by menuinfo
beginning at path
into the pre-existing
app
.
|
A MateApp instance. |
|
A path to the menu item concerned. |
|
A MateUIInfo array describing the menus. |
void mate_app_insert_menus_with_data (MateApp *app
,const gchar *path
,MateUIInfo *menuinfo
,gpointer data
);
This is the same as mate_app_insert_menus()
, except that the specified
data
is passed to each signal callback.
|
A MateApp instance. |
|
A path to the menu item concerned. |
|
A MateUIInfo array describing the menus. |
|
Application specific data to send to each signal callback. |
void mate_app_insert_menus_interp (MateApp *app
,const gchar *path
,MateUIInfo *menuinfo
,GtkCallbackMarshal relay_func
,gpointer data
,GDestroyNotify destroy_func
);
THe same as mate_app_insert_menus()
, except that the given functions are
attached to each menu item. Mostly of use for language bindings.
|
A MateApp instance. |
|
A path to the menu item concerned. |
|
A MateUIInfo array describing the menus. |
|
A custom marshallar for signal data., |
|
Application-specific data to send to each signal callback. |
|
The function to call when the menu item is destroyed. |
void mate_app_install_appbar_menu_hints (MateAppBar *appbar
,MateUIInfo *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
.
|
An existing MateAppBar instance. |
|
A MateUIInfo array of a menu for which hints will be set. |
void mate_app_install_statusbar_menu_hints (GtkStatusbar *bar
,MateUIInfo *uiinfo
);
Install menu hints for the given status bar.
|
Pointer to GtkStatusbar instance. |
|
MateUIInfo for the menu to be changed. |
void mate_app_install_menu_hints (MateApp *app
,MateUIInfo *uiinfo
);
Set menu hints for the app
object's attached status bar.
|
An existing MateAppBar instance. |
|
A MateUIInfo array of a menu for which hints will be set. |
void mate_app_setup_toolbar (GtkToolbar *toolbar
,MateComponentDockItem *dock_item
);
Sets up a toolbar to use MATE user preferences.
|
Pointer to a GtkToolbar instance. |
|
Pointer to the MateComponentDockItem the toolbar is inside, or NULL
for none.
|
#define MATEUIINFO_END
A macro that can be used to terminate an arrau of MateUIInfo structures.
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_SEPARATOR
A macro that defines a menu seperator bar. Can be put into an array of MateUIInfo structures.
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_ITEM(label, tooltip, callback, xpm_data)
A generic menu item with an inline xpm icon.
|
Menu label. |
|
Tooltip for the label. |
|
Function to call on selection of this item. |
|
Pixmap data. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_ITEM_STOCK(label, tooltip, callback, stock_id)
A menu item with a stock icon.
|
Menu label. |
|
Tooltip for the label. |
|
Function to call on selection of this item. |
|
The value of stock icon (from the mate-stock-item module of this library). |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_ITEM_NONE(label, tooltip, callback)
A menu item with no icon.
|
Menu label. |
|
Tooltip for the label. |
|
Function to call on selection of this item. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_ITEM_DATA(label, tooltip, callback, user_data, xpm_data)
A menu item with an inline xpm icon and user data pointer for callback
.
|
Menu label. |
|
Tooltip for the label. |
|
Function to call on selection of this item. |
|
User data to pass to the callback function. |
|
Pixmap data. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_TOGGLEITEM(label, tooltip, callback, xpm_data)
A toggle item (check box) with inline xpm icon.
|
Menu label. |
|
Tooltip for the label. |
|
Function to call on selection of this item. |
|
Pixmap data. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_TOGGLEITEM_DATA(label, tooltip, callback, user_data, xpm_data)
A toggle item (chekc box) with inline xpm icon and user data pointer for
callback
.
|
Menu label. |
|
Tooltip for the label. |
|
Function to call on selection of this item. |
|
User data to pass to the callback function. |
|
Pixmap data. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_HELP(app_name)
A menu containing all help topics based on app_name
.
|
Application id string. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_SUBTREE(label, tree)
A subtree (submenu).
|
Submenu label. |
|
A pointer to an array of MateUIInfo structures. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_SUBTREE_HINT(label, hint, tree)
A subtree with a hint.
|
Submenu label. |
|
Hint for statusbar. |
|
A pointer to an array of MateUIInfo structures. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_SUBTREE_STOCK(label, tree, stock_id)
A subtree using a stock icon.
|
|
|
A pointer to an array of MateUIInfo structs. |
|
The value of stock icon (from the mate-stock-item module of this library). |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_INCLUDE(tree)
A menu that should be included at the current point of the current menu (like MATEUIINFO_SUBTREE, but doesn't create a submenu).
|
A pointer to an array of MateUIInfo structures. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_RADIOLIST(list)
A list of radio items.
|
Pointer to a list of MATEUIINFO_RADIOITEM elements. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_RADIOITEM(label, tooltip, callback, xpm_data)
A radio item with an inline xpm icon.
|
Item label. |
|
Tooltip for the item. |
|
Function to call on selection of this item. |
|
Pixmap data. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_RADIOITEM_DATA(label, tooltip, callback, user_data, xpm_data)
A radio item with an inline xpm icon and user data for callback
.
|
Item label. |
|
Tooltip for the item. |
|
Function to call on selection of this item. |
|
User data for the callback function. |
|
Pixmap data. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_NEW_ITEM(label, tip, cb, data)
A "New" entry (typically in the "File" menu).
|
The label for the menu item (the thing being created). |
|
Tooltip for the item. |
|
Callback for when the menu item is selected. |
|
User data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_NEW_SUBTREE(tree)
A "New" menu item that creates a subtree (for when you have more than one thing that can be created anew).
|
Pointer to a list of MateUIInfo menu structures. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_OPEN_ITEM(cb, data)
An "Open..." menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_SAVE_ITEM(cb, data)
A "Save" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_SAVE_AS_ITEM(cb, data)
A "Save as..." menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_REVERT_ITEM(cb, data)
A "Revert" (to last saved) menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_PRINT_ITEM(cb, data)
A "Print" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_PRINT_SETUP_ITEM(cb, data)
A "Print setup..." menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_CLOSE_ITEM(cb, data)
A "Close" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_EXIT_ITEM(cb, data) MATEUIINFO_MENU_QUIT_ITEM(cb, data)
An "Exit" menu item (deprecated).
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_QUIT_ITEM(cb, data)
A "Quit" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_CUT_ITEM(cb, data)
A "Cut" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_COPY_ITEM(cb, data)
A "Copy" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_PASTE_ITEM(cb, data)
A "Paste" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_SELECT_ALL_ITEM(cb, data)
A "Select All" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_CLEAR_ITEM(cb, data)
A "clear" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_UNDO_ITEM(cb, data)
An "Undo" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_REDO_ITEM(cb, data)
A "Redo" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_FIND_ITEM(cb, data)
A "Find" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_FIND_AGAIN_ITEM(cb, data)
A "Find Again" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_REPLACE_ITEM(cb, data)
A "Replace" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_PROPERTIES_ITEM(cb, data)
A "Properties..." menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_PREFERENCES_ITEM(cb, data)
A "Preferences..." menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_NEW_WINDOW_ITEM(cb, data)
A "New Window" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_CLOSE_WINDOW_ITEM(cb, data)
A "Close Window" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_ABOUT_ITEM(cb, data)
An "About..." menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_NEW_GAME_ITEM(cb, data)
A "New Game" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_PAUSE_GAME_ITEM(cb, data)
A "Pause Game" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_RESTART_GAME_ITEM(cb, data)
A "Restart Game" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_UNDO_MOVE_ITEM(cb, data)
An "Undo Move" menu item (for games, usually).
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_REDO_MOVE_ITEM(cb, data)
A "Redo move" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_HINT_ITEM(cb, data)
A "Hint" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_SCORES_ITEM(cb, data)
A "Scores" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_END_GAME_ITEM(cb, data)
An "End Game" menu item.
|
Callback for when the menu item is selected. |
|
Used data to pass to the callback. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_FILE_TREE(tree)
A "File" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_EDIT_TREE(tree)
An "Edit" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_VIEW_TREE(tree)
A "View" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_SETTINGS_TREE(tree)
A "Settings" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_FILES_TREE(tree)
A "Files" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_WINDOWS_TREE(tree)
A "Windows" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_HELP_TREE(tree)
A "Help" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATEUIINFO_MENU_GAME_TREE(tree)
A "Game" menu tree.
|
Pointer to a tree containing menu items for inside this menu. |
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_FILE_STRING D_("_File")
A string which is the title of the "File" menu (when the menu is created using MATEUIINFO_MENU_FILE_TREE).
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_FILE_PATH D_("_File/")
A pre-defined path to the "File" menu (when the menu is created using
MATEUIINFO_MENU_FILE_TREE). Used in calls like mate_app_find_menu_pos()
.
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_EDIT_STRING D_("_Edit")
A string which is the title of the "Edit" menu (when the menu is created using MATEUIINFO_MENU_FILE_TREE).
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_EDIT_PATH D_("_Edit/")
A pre-defined path to the "Edit" menu (when the menu is created using
MATEUIINFO_MENU_EDIT_TREE). Used in calls like mate_app_find_menu_pos()
.
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_VIEW_STRING D_("_View")
A string which is the title of the "View" menu (when the menu is created using MATEUIINFO_MENU_VIEW_TREE).
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_VIEW_PATH D_("_View/")
A pre-defined path to the "View" menu (when the menu is created using
MATEUIINFO_MENU_FILE_TREE). Used in calls like mate_app_find_menu_pos()
.
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_SETTINGS_STRING D_("_Settings")
A string which is the title of the "Settings" menu (when the menu is created using MATEUIINFO_MENU_SETTINGS_TREE).
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_SETTINGS_PATH D_("_Settings/")
A pre-defined path to the "Settings" menu (when the menu is created using
MATEUIINFO_MENU_FILE_TREE). Used in calls like mate_app_find_menu_pos()
.
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_NEW_STRING D_("_New")
A string which is the title of the "New" menu (when the menu is created using MATEUIINFO_MENU_NEW_TREE).
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_NEW_PATH D_("_New/")
A pre-defined path to the "New" menu (when the menu is created using
MATEUIINFO_MENU_FILE_TREE). Used in calls like mate_app_find_menu_pos()
.
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_FILES_STRING D_("Fi_les")
A string which is the title of the "Files" menu (when the menu is created using MATEUIINFO_MENU_FILES_TREE).
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_FILES_PATH D_("Fi_les/")
A pre-defined path to the "Files" menu (when the menu is created using
MATEUIINFO_MENU_FILE_TREE). Used in calls like mate_app_find_menu_pos()
.
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_WINDOWS_STRING D_("_Windows")
A string which is the title of the "Windows" menu (when the menu is created using MATEUIINFO_MENU_WINDOWS_TREE).
Returns : |
A MateUIInfo structure. |
#define MATE_MENU_WINDOWS_PATH D_("_Windows/")
A pre-defined path to the "Windows" menu (when the menu is created using
MATEUIINFO_MENU_FILE_TREE). Used in calls like mate_app_find_menu_pos()
.
Returns : |
A MateUIInfo structure. |
const gchar * mate_app_helper_gettext (const gchar *string
);
Translate string
by calling gettext()
and then, if that did not change the
string, dgettext()
with the domain set to libmate's message domain.
|
The string to translate. |
Returns : |
The localised value of the string. |