pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gntmenuitem.h File Reference
#include <glib.h>
#include <glib-object.h>
#include "gntmenu.h"
Include dependency graph for gntmenuitem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _GntMenuItemPriv
 
struct  _GntMenuItem
 
struct  _GntMenuItemClass
 

Macros

#define GNT_TYPE_MENU_ITEM   (gnt_menuitem_get_gtype())
 
#define GNT_MENU_ITEM(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_MENU_ITEM, GntMenuItem))
 
#define GNT_MENU_ITEM_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_MENU_ITEM, GntMenuItemClass))
 
#define GNT_IS_MENU_ITEM(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_MENU_ITEM))
 
#define GNT_IS_MENU_ITEM_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_MENU_ITEM))
 
#define GNT_MENU_ITEM_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_MENU_ITEM, GntMenuItemClass))
 
#define GNT_MENU_ITEM_FLAGS(obj)   (GNT_MENU_ITEM(obj)->priv.flags)
 
#define GNT_MENU_ITEM_SET_FLAGS(obj, flags)   (GNT_MENU_ITEM_FLAGS(obj) |= flags)
 
#define GNT_MENU_ITEM_UNSET_FLAGS(obj, flags)   (GNT_MENU_ITEM_FLAGS(obj) &= ~(flags))
 

Typedefs

typedef struct _GntMenuItem GntMenuItem
 
typedef struct _GntMenuItemPriv GntMenuItemPriv
 
typedef struct _GntMenuItemClass GntMenuItemClass
 
typedef void(* GntMenuItemCallback) (GntMenuItem *item, gpointer data)
 

Functions

G_BEGIN_DECLS GType gnt_menuitem_get_gtype (void)
 
GntMenuItemgnt_menuitem_new (const char *text)
 
void gnt_menuitem_set_callback (GntMenuItem *item, GntMenuItemCallback callback, gpointer data)
 
void gnt_menuitem_set_submenu (GntMenuItem *item, GntMenu *menu)
 
GntMenugnt_menuitem_get_submenu (GntMenuItem *item)
 
void gnt_menuitem_set_trigger (GntMenuItem *item, char trigger)
 
char gnt_menuitem_get_trigger (GntMenuItem *item)
 
void gnt_menuitem_set_id (GntMenuItem *item, const char *id)
 
const char * gnt_menuitem_get_id (GntMenuItem *item)
 
gboolean gnt_menuitem_activate (GntMenuItem *item)
 

Detailed Description

Menuitem API

Definition in file gntmenuitem.h.

Macro Definition Documentation

◆ GNT_IS_MENU_ITEM

#define GNT_IS_MENU_ITEM (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_MENU_ITEM))

Definition at line 36 of file gntmenuitem.h.

◆ GNT_IS_MENU_ITEM_CLASS

#define GNT_IS_MENU_ITEM_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_MENU_ITEM))

Definition at line 37 of file gntmenuitem.h.

◆ GNT_MENU_ITEM

#define GNT_MENU_ITEM (   obj)    (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_MENU_ITEM, GntMenuItem))

Definition at line 34 of file gntmenuitem.h.

◆ GNT_MENU_ITEM_CLASS

#define GNT_MENU_ITEM_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_MENU_ITEM, GntMenuItemClass))

Definition at line 35 of file gntmenuitem.h.

◆ GNT_MENU_ITEM_FLAGS

#define GNT_MENU_ITEM_FLAGS (   obj)    (GNT_MENU_ITEM(obj)->priv.flags)

Definition at line 40 of file gntmenuitem.h.

◆ GNT_MENU_ITEM_GET_CLASS

#define GNT_MENU_ITEM_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_MENU_ITEM, GntMenuItemClass))

Definition at line 38 of file gntmenuitem.h.

◆ GNT_MENU_ITEM_SET_FLAGS

#define GNT_MENU_ITEM_SET_FLAGS (   obj,
  flags 
)    (GNT_MENU_ITEM_FLAGS(obj) |= flags)

Definition at line 41 of file gntmenuitem.h.

◆ GNT_MENU_ITEM_UNSET_FLAGS

#define GNT_MENU_ITEM_UNSET_FLAGS (   obj,
  flags 
)    (GNT_MENU_ITEM_FLAGS(obj) &= ~(flags))

Definition at line 42 of file gntmenuitem.h.

◆ GNT_TYPE_MENU_ITEM

#define GNT_TYPE_MENU_ITEM   (gnt_menuitem_get_gtype())

Definition at line 33 of file gntmenuitem.h.

Typedef Documentation

◆ GntMenuItem

typedef struct _GntMenuItem GntMenuItem

Definition at line 44 of file gntmenuitem.h.

◆ GntMenuItemCallback

typedef void(* GntMenuItemCallback) (GntMenuItem *item, gpointer data)

Definition at line 59 of file gntmenuitem.h.

◆ GntMenuItemClass

Definition at line 46 of file gntmenuitem.h.

◆ GntMenuItemPriv

Definition at line 45 of file gntmenuitem.h.

Function Documentation

◆ gnt_menuitem_activate()

gboolean gnt_menuitem_activate ( GntMenuItem item)

Activate a menuitem. Activating the menuitem will first trigger the 'activate' signal for the menuitem. Then the callback for the menuitem is triggered, if there is one.

Parameters
itemThe menuitem.
Returns
Whether the callback for the menuitem was called.
Since
2.3.0

Definition at line 150 of file gntmenuitem.c.

References _GntMenuItem::callback, _GntMenuItem::callbackdata, FALSE, SIG_ACTIVATE, signals, and TRUE.

Referenced by gnt_menu_toggled(), gnt_wm_process_input(), and menuitem_activate().

Here is the caller graph for this function:

◆ gnt_menuitem_get_gtype()

G_BEGIN_DECLS GType gnt_menuitem_get_gtype ( void  )
Returns
GType for GntMenuItem.

Definition at line 74 of file gntmenuitem.c.

References gnt_menuitem_class_init(), gnt_menuitem_init(), info, NULL, and dbus-analyze-signals::type.

◆ gnt_menuitem_get_id()

const char* gnt_menuitem_get_id ( GntMenuItem item)

Get the ID of the menuitem.

Parameters
itemThe menuitem.
Returns
The ID for the menuitem.
Since
2.3.0

Definition at line 145 of file gntmenuitem.c.

References _GntMenuItemPriv::id, and _GntMenuItem::priv.

Referenced by gnt_menu_get_item().

Here is the caller graph for this function:

◆ gnt_menuitem_get_submenu()

GntMenu* gnt_menuitem_get_submenu ( GntMenuItem item)

Get the submenu for a menuitem.

Parameters
itemThe menuitem.
Returns
The submenu, or NULL.
Since
2.3.0

Definition at line 124 of file gntmenuitem.c.

References _GntMenuItem::submenu.

Referenced by gnt_menu_get_item(), and show_menu().

Here is the caller graph for this function:

◆ gnt_menuitem_get_trigger()

char gnt_menuitem_get_trigger ( GntMenuItem item)

Get the trigger key for a menuitem.

Parameters
itemThe menuitem
Returns
The trigger key for the menuitem.
See also
gnt_menuitem_set_trigger

Definition at line 134 of file gntmenuitem.c.

References _GntMenuItem::priv, and _GntMenuItemPriv::trigger.

Referenced by assign_triggers(), find_item_with_trigger(), and menu_tree_add().

Here is the caller graph for this function:

◆ gnt_menuitem_new()

GntMenuItem* gnt_menuitem_new ( const char *  text)

Create a new menuitem.

Parameters
textLabel for the menuitem.
Returns
The newly created menuitem.

Definition at line 101 of file gntmenuitem.c.

References GNT_MENU_ITEM, GNT_TYPE_MENU_ITEM, NULL, text, and _GntMenuItem::text.

Referenced by build_plugin_actions(), create_menu(), generate_send_to_menu(), gg_create_menu(), gnt_append_menu_action(), reconstruct_accounts_menu(), reconstruct_grouping_menu(), and reconstruct_plugins_menu().

Here is the caller graph for this function:

◆ gnt_menuitem_set_callback()

void gnt_menuitem_set_callback ( GntMenuItem item,
GntMenuItemCallback  callback,
gpointer  data 
)

Set a callback function for a menuitem.

Parameters
itemThe menuitem.
callbackThe callback function.
dataData to send to the callback function.

Definition at line 111 of file gntmenuitem.c.

References _GntMenuItem::callback, _GntMenuItem::callbackdata, and data.

Referenced by build_plugin_actions(), create_buddy_menu(), create_chat_menu(), create_menu(), generate_send_to_menu(), gg_create_menu(), gnt_append_menu_action(), and reconstruct_grouping_menu().

Here is the caller graph for this function:

◆ gnt_menuitem_set_id()

void gnt_menuitem_set_id ( GntMenuItem item,
const char *  id 
)

Set an ID for the menuitem.

Parameters
itemThe menuitem.
idThe ID for the menuitem.
Since
2.3.0

Definition at line 139 of file gntmenuitem.c.

References _GntMenuItemPriv::id, and _GntMenuItem::priv.

Referenced by create_menu(), and reconstruct_grouping_menu().

Here is the caller graph for this function:

◆ gnt_menuitem_set_submenu()

void gnt_menuitem_set_submenu ( GntMenuItem item,
GntMenu menu 
)

Set a submenu for a menuitem. A menuitem with a submenu cannot have a callback.

Parameters
itemThe menuitem.
menuThe submenu.

Definition at line 117 of file gntmenuitem.c.

References GNT_WIDGET, gnt_widget_destroy(), and _GntMenuItem::submenu.

Referenced by build_plugin_actions(), create_menu(), generate_send_to_menu(), gg_create_menu(), gnt_append_menu_action(), reconstruct_accounts_menu(), reconstruct_grouping_menu(), and reconstruct_plugins_menu().

Here is the caller graph for this function:

◆ gnt_menuitem_set_trigger()

void gnt_menuitem_set_trigger ( GntMenuItem item,
char  trigger 
)

Set a trigger key for the item.

Parameters
itemThe menuitem
triggerThe key that will trigger the item when the parent manu is visible

Definition at line 129 of file gntmenuitem.c.

References _GntMenuItem::priv, and _GntMenuItemPriv::trigger.

Referenced by assign_triggers().

Here is the caller graph for this function: