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)  

gntwidget.h File Reference
#include <stdio.h>
#include <glib.h>
#include <ncurses.h>
#include "gntbindable.h"
Include dependency graph for gntwidget.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _GntWidgetPriv
 
struct  _GntWidget
 
struct  _GntWidgetClass
 

Macros

#define GNT_TYPE_WIDGET   (gnt_widget_get_gtype())
 
#define GNT_WIDGET(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WIDGET, GntWidget))
 
#define GNT_WIDGET_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_WIDGET, GntWidgetClass))
 
#define GNT_IS_WIDGET(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WIDGET))
 
#define GNT_IS_WIDGET_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WIDGET))
 
#define GNT_WIDGET_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WIDGET, GntWidgetClass))
 
#define GNT_WIDGET_FLAGS(obj)   (GNT_WIDGET(obj)->priv.flags)
 
#define GNT_WIDGET_SET_FLAGS(obj, flags)   (GNT_WIDGET_FLAGS(obj) |= flags)
 
#define GNT_WIDGET_UNSET_FLAGS(obj, flags)   (GNT_WIDGET_FLAGS(obj) &= ~(flags))
 
#define GNT_WIDGET_IS_FLAG_SET(obj, flags)   (GNT_WIDGET_FLAGS(obj) & (flags))
 

Typedefs

typedef struct _GntWidget GntWidget
 
typedef struct _GntWidgetPriv GntWidgetPriv
 
typedef struct _GntWidgetClass GntWidgetClass
 
typedef enum _GntWidgetFlags GntWidgetFlags
 
typedef enum _GntMouseEvent GntMouseEvent
 
typedef enum _GntParamFlags GntParamFlags
 

Enumerations

enum  _GntWidgetFlags {
  GNT_WIDGET_DESTROYING = 1 << 0, GNT_WIDGET_CAN_TAKE_FOCUS = 1 << 1, GNT_WIDGET_MAPPED = 1 << 2, GNT_WIDGET_NO_BORDER = 1 << 3,
  GNT_WIDGET_NO_SHADOW = 1 << 4, GNT_WIDGET_HAS_FOCUS = 1 << 5, GNT_WIDGET_DRAWING = 1 << 6, GNT_WIDGET_URGENT = 1 << 7,
  GNT_WIDGET_GROW_X = 1 << 8, GNT_WIDGET_GROW_Y = 1 << 9, GNT_WIDGET_INVISIBLE = 1 << 10, GNT_WIDGET_TRANSIENT = 1 << 11,
  GNT_WIDGET_DISABLE_ACTIONS = 1 << 12
}
 
enum  _GntMouseEvent {
  GNT_LEFT_MOUSE_DOWN = 1, GNT_RIGHT_MOUSE_DOWN, GNT_MIDDLE_MOUSE_DOWN, GNT_MOUSE_UP,
  GNT_MOUSE_SCROLL_UP, GNT_MOUSE_SCROLL_DOWN
}
 
enum  _GntParamFlags { GNT_PARAM_SERIALIZABLE = 1 << G_PARAM_USER_SHIFT }
 

Functions

G_BEGIN_DECLS GType gnt_widget_get_gtype (void)
 
void gnt_widget_destroy (GntWidget *widget)
 
void gnt_widget_show (GntWidget *widget)
 
void gnt_widget_draw (GntWidget *widget)
 
void gnt_widget_expose (GntWidget *widget, int x, int y, int width, int height)
 
void gnt_widget_hide (GntWidget *widget)
 
void gnt_widget_get_position (GntWidget *widget, int *x, int *y)
 
void gnt_widget_set_position (GntWidget *widget, int x, int y)
 
void gnt_widget_size_request (GntWidget *widget)
 
void gnt_widget_get_size (GntWidget *widget, int *width, int *height)
 
gboolean gnt_widget_set_size (GntWidget *widget, int width, int height)
 
gboolean gnt_widget_confirm_size (GntWidget *widget, int width, int height)
 
gboolean gnt_widget_key_pressed (GntWidget *widget, const char *keys)
 
gboolean gnt_widget_clicked (GntWidget *widget, GntMouseEvent event, int x, int y)
 
gboolean gnt_widget_set_focus (GntWidget *widget, gboolean set)
 
void gnt_widget_activate (GntWidget *widget)
 
void gnt_widget_set_name (GntWidget *widget, const char *name)
 
const char * gnt_widget_get_name (GntWidget *widget)
 
void gnt_widget_queue_update (GntWidget *widget)
 
void gnt_widget_set_take_focus (GntWidget *widget, gboolean set)
 
void gnt_widget_set_visible (GntWidget *widget, gboolean set)
 
gboolean gnt_widget_has_shadow (GntWidget *widget)
 

Detailed Description

Widget API

Definition in file gntwidget.h.

Macro Definition Documentation

◆ GNT_IS_WIDGET

#define GNT_IS_WIDGET (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_WIDGET))

Definition at line 39 of file gntwidget.h.

◆ GNT_IS_WIDGET_CLASS

#define GNT_IS_WIDGET_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_WIDGET))

Definition at line 40 of file gntwidget.h.

◆ GNT_TYPE_WIDGET

#define GNT_TYPE_WIDGET   (gnt_widget_get_gtype())

Definition at line 36 of file gntwidget.h.

◆ GNT_WIDGET

#define GNT_WIDGET (   obj)    (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WIDGET, GntWidget))

Definition at line 37 of file gntwidget.h.

◆ GNT_WIDGET_CLASS

#define GNT_WIDGET_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_WIDGET, GntWidgetClass))

Definition at line 38 of file gntwidget.h.

◆ GNT_WIDGET_FLAGS

#define GNT_WIDGET_FLAGS (   obj)    (GNT_WIDGET(obj)->priv.flags)

Definition at line 43 of file gntwidget.h.

◆ GNT_WIDGET_GET_CLASS

#define GNT_WIDGET_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_WIDGET, GntWidgetClass))

Definition at line 41 of file gntwidget.h.

◆ GNT_WIDGET_IS_FLAG_SET

#define GNT_WIDGET_IS_FLAG_SET (   obj,
  flags 
)    (GNT_WIDGET_FLAGS(obj) & (flags))

Definition at line 46 of file gntwidget.h.

◆ GNT_WIDGET_SET_FLAGS

#define GNT_WIDGET_SET_FLAGS (   obj,
  flags 
)    (GNT_WIDGET_FLAGS(obj) |= flags)

Definition at line 44 of file gntwidget.h.

◆ GNT_WIDGET_UNSET_FLAGS

#define GNT_WIDGET_UNSET_FLAGS (   obj,
  flags 
)    (GNT_WIDGET_FLAGS(obj) &= ~(flags))

Definition at line 45 of file gntwidget.h.

Typedef Documentation

◆ GntMouseEvent

◆ GntParamFlags

◆ GntWidget

typedef struct _GntWidget GntWidget

Definition at line 48 of file gntwidget.h.

◆ GntWidgetClass

Definition at line 50 of file gntwidget.h.

◆ GntWidgetFlags

◆ GntWidgetPriv

typedef struct _GntWidgetPriv GntWidgetPriv

Definition at line 49 of file gntwidget.h.

Enumeration Type Documentation

◆ _GntMouseEvent

Enumerator
GNT_LEFT_MOUSE_DOWN 
GNT_RIGHT_MOUSE_DOWN 
GNT_MIDDLE_MOUSE_DOWN 
GNT_MOUSE_UP 
GNT_MOUSE_SCROLL_UP 
GNT_MOUSE_SCROLL_DOWN 

Definition at line 72 of file gntwidget.h.

◆ _GntParamFlags

Enumerator
GNT_PARAM_SERIALIZABLE 

Definition at line 83 of file gntwidget.h.

◆ _GntWidgetFlags

Enumerator
GNT_WIDGET_DESTROYING 
GNT_WIDGET_CAN_TAKE_FOCUS 
GNT_WIDGET_MAPPED 
GNT_WIDGET_NO_BORDER 
GNT_WIDGET_NO_SHADOW 
GNT_WIDGET_HAS_FOCUS 
GNT_WIDGET_DRAWING 
GNT_WIDGET_URGENT 
GNT_WIDGET_GROW_X 
GNT_WIDGET_GROW_Y 
GNT_WIDGET_INVISIBLE 
GNT_WIDGET_TRANSIENT 
GNT_WIDGET_DISABLE_ACTIONS 

Definition at line 52 of file gntwidget.h.

Function Documentation

◆ gnt_widget_activate()

void gnt_widget_activate ( GntWidget widget)

Activate a widget. This only applies to widgets that can be activated (eg. GntButton)

Parameters
widgetThe widget to activate.

Definition at line 600 of file gntwidget.c.

References SIG_ACTIVATE, signals, and widget.

Referenced by button_activate(), check_for_trigger(), gnt_button_clicked(), gnt_entry_key_pressed(), gnt_file_sel_init(), gnt_menu_clicked(), gnt_menu_key_pressed(), gnt_tree_clicked(), gnt_tree_key_pressed(), key_pressed(), and show_menu().

◆ gnt_widget_clicked()

gboolean gnt_widget_clicked ( GntWidget widget,
GntMouseEvent  event,
int  x,
int  y 
)

Trigger the 'click' callback of a widget.

Parameters
widgetThe widget.
eventThe mouseevent.
xThe x-coordinate of the mouse.
yThe y-coordinate of the mouse.
Returns
TRUE if the event was handled, FALSE otherwise.

Definition at line 409 of file gntwidget.c.

References GNT_BINDABLE, gnt_bindable_perform_action_named(), GNT_RIGHT_MOUSE_DOWN, NULL, SIG_CLICKED, signals, and widget.

Referenced by detect_mouse_action(), and gnt_box_clicked().

◆ gnt_widget_confirm_size()

gboolean gnt_widget_confirm_size ( GntWidget widget,
int  width,
int  height 
)

Confirm a requested a size for a widget.

Parameters
widgetThe widget.
widthThe requested width.
heightThe requested height.
Returns
TRUE if the new size was confirmed, FALSE otherwise.

Definition at line 633 of file gntwidget.c.

References FALSE, SIG_CONFIRM_SIZE, signals, and widget.

Referenced by gnt_box_confirm_size(), gnt_box_size_request(), and gnt_widget_set_size().

◆ gnt_widget_destroy()

void gnt_widget_destroy ( GntWidget obj)

Destroy a widget.

Parameters
widgetThe widget to destroy.

gnt_widget_destroy: @obj: The GntWidget instance.

Emits the "destroy" signal notifying all reference holders that they should release @obj.

Definition at line 312 of file gntwidget.c.

References GNT_IS_WIDGET, GNT_WIDGET_DESTROYING, GNT_WIDGET_FLAGS, gnt_widget_hide(), GNT_WIDGET_SET_FLAGS, GNTDEBUG, and pietray::obj.

Referenced by action_list_activate(), ask_before_exit(), cancel_cb(), choose_cb(), configure_plugin_cb(), delete_win_cb(), destroy_cb(), destroy_list(), destroy_substatus_win(), destroy_suggest(), destroy_toaster(), draw_context_menu(), dump_file_cancel(), dump_file_save(), edit_account(), file_cancel(), file_cb(), file_save(), finch_accounts_uninit(), finch_certmgr_show(), finch_close_notify(), finch_close_request(), finch_destroy_conversation(), finch_notify_common(), finch_plugins_show_all(), finch_pounces_manager_hide(), finch_request_authorize(), finch_savedstatus_edit(), finch_savedstatus_show_all(), fl_close(), gnt_bindable_bindings_view(), gnt_bindable_rebinding_cancel(), gnt_bindable_rebinding_rebind(), gnt_box_remove_all(), gnt_combo_box_destroy(), gnt_entry_destroy(), gnt_menuitem_destroy(), gnt_menuitem_set_submenu(), gnt_widget_bindings_view(), gnt_widget_class_init(), gnt_window_destroy(), gnt_window_set_menu(), gnt_wm_destroy(), gnt_wm_process_input(), gnt_wm_switch_workspace(), notify(), plugin_toggled_cb(), popup_substatus(), really_delete_account(), really_delete_status(), release_pref_dialog(), remove_peripherals(), remove_tooltip(), s_mouse_clicked(), save_account_cb(), save_cb(), save_pounce_cb(), save_savedstatus_cb(), save_substatus_cb(), setup_email_dialog(), show_suggest_dropdown(), toggle_buddylist(), toggle_clipboard(), update_act_msg(), use_trans_status_cb(), window_close(), and window_list_activate().

◆ gnt_widget_draw()

void gnt_widget_draw ( GntWidget widget)

◆ gnt_widget_expose()

void gnt_widget_expose ( GntWidget widget,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 419 of file gntwidget.c.

References SIG_EXPOSE, signals, and widget.

Referenced by gnt_widget_class_init().

◆ gnt_widget_get_gtype()

G_BEGIN_DECLS GType gnt_widget_get_gtype ( void  )
Returns
GType for GntWidget.

Definition at line 270 of file gntwidget.c.

References GNT_TYPE_BINDABLE, gnt_widget_class_init(), gnt_widget_init(), info, NULL, and dbus-analyze-signals::type.

◆ gnt_widget_get_name()

const char* gnt_widget_get_name ( GntWidget widget)

Get the name of a widget.

Parameters
widgetThe widget.
Returns
The name of the widget.

Definition at line 595 of file gntwidget.c.

References widget.

Referenced by find_widget(), gnt_window_set_menu(), irssi_new_window(), irssi_update_window(), is_budddylist(), new_widget_find_workspace(), refresh_window(), s_decorate_window(), and s_new_window().

◆ gnt_widget_get_position()

void gnt_widget_get_position ( GntWidget widget,
int *  x,
int *  y 
)

Get the position of a widget.

Parameters
widgetThe widget.
xLocation to store the x-coordinate of the widget.
yLocation to store the y-coordinate of the widget.

Definition at line 449 of file gntwidget.c.

References _GntWidget::priv, _GntWidgetPriv::x, and _GntWidgetPriv::y.

Referenced by draw_context_menu(), draw_tooltip_real(), finch_blist_get_position(), find_window_position(), gnt_box_clicked(), gnt_wm_process_input(), refresh_node(), refresh_window(), remove_toaster(), s_mouse_clicked(), s_new_window(), and show_suggest_dropdown().

◆ gnt_widget_get_size()

◆ gnt_widget_has_shadow()

gboolean gnt_widget_has_shadow ( GntWidget widget)

Check whether the widget has shadows.

Parameters
widgetThe widget.
Returns
TRUE if the widget has shadows. This checks both the user-setting and whether the widget can have shadows at all.

Definition at line 648 of file gntwidget.c.

References FALSE, gnt_style_get_bool(), GNT_STYLE_SHADOW, GNT_WIDGET_IS_FLAG_SET, GNT_WIDGET_NO_SHADOW, and widget.

Referenced by gnt_widget_draw(), gnt_widget_dummy_confirm_size(), gnt_widget_get_size(), gnt_widget_hide(), gnt_widget_set_size(), gnt_wm_new_window_real(), init_widget(), and window_reverse().

◆ gnt_widget_hide()

◆ gnt_widget_key_pressed()

gboolean gnt_widget_key_pressed ( GntWidget widget,
const char *  keys 
)

Trigger the key-press callbacks for a widget.

Parameters
widgetThe widget.
keysThe keypress on the widget.
Returns
TRUE if the key-press was handled, FALSE otherwise.

Definition at line 393 of file gntwidget.c.

References FALSE, GNT_BINDABLE, gnt_bindable_perform_action_key(), gnt_bindable_remap_keys(), GNT_WIDGET_CAN_TAKE_FOCUS, GNT_WIDGET_DISABLE_ACTIONS, GNT_WIDGET_IS_FLAG_SET, keys, SIG_KEY_PRESSED, signals, TRUE, and widget.

Referenced by completion_cb(), gnt_box_key_pressed(), gnt_combo_box_clicked(), gnt_combo_box_key_pressed(), gnt_menu_key_pressed(), and gnt_wm_process_input().

◆ gnt_widget_queue_update()

void gnt_widget_queue_update ( GntWidget widget)

Definition at line 618 of file gntwidget.c.

References NULL, update_queue_callback(), and widget.

Referenced by entry_redraw(), gnt_widget_draw(), and redraw_tree().

◆ gnt_widget_set_focus()

gboolean gnt_widget_set_focus ( GntWidget widget,
gboolean  set 
)

Give or remove focus to a widget.

Parameters
widgetThe widget.
setTRUE of focus should be given to the widget, FALSE if focus should be removed.
Returns
TRUE if the focus has been changed, FALSE otherwise.

Definition at line 568 of file gntwidget.c.

References FALSE, GNT_WIDGET_CAN_TAKE_FOCUS, GNT_WIDGET_FLAGS, GNT_WIDGET_HAS_FOCUS, GNT_WIDGET_IS_FLAG_SET, GNT_WIDGET_SET_FLAGS, GNT_WIDGET_UNSET_FLAGS, set(), SIG_GIVE_FOCUS, SIG_LOST_FOCUS, signals, TRUE, and widget.

Referenced by box_focus_change(), gnt_box_gained_focus(), gnt_box_give_focus_to_child(), gnt_box_lost_focus(), gnt_box_move_focus(), gnt_wm_give_focus(), gnt_wm_new_window_real(), gnt_wm_raise_window(), and gnt_ws_add_widget().

◆ gnt_widget_set_name()

void gnt_widget_set_name ( GntWidget widget,
const char *  name 
)

Set the name of a widget.

Parameters
widgetThe widget.
nameA new name for the widget.

Definition at line 589 of file gntwidget.c.

References name, and widget.

Referenced by blist_show(), draw_tooltip_real(), edit_account(), finch_accounts_show_all(), finch_create_conversation(), finch_debug_window_show(), gnt_bindable_rebinding_activate(), and update_act_msg().

◆ gnt_widget_set_position()

◆ gnt_widget_set_size()

◆ gnt_widget_set_take_focus()

void gnt_widget_set_take_focus ( GntWidget widget,
gboolean  set 
)

Set whether a widget can take focus or not.

Parameters
widgetThe widget.
setTRUE if the widget can take focus.

Definition at line 296 of file gntwidget.c.

References GNT_WIDGET_CAN_TAKE_FOCUS, GNT_WIDGET_SET_FLAGS, GNT_WIDGET_UNSET_FLAGS, and widget.

Referenced by gnt_button_new(), gnt_check_box_new(), gnt_label_init(), gnt_progress_bar_init(), and gnt_tree_init().

◆ gnt_widget_set_visible()

void gnt_widget_set_visible ( GntWidget widget,
gboolean  set 
)

Set the visibility of a widget.

Parameters
widgetThe widget.
setWhether the widget is visible or not.

Definition at line 640 of file gntwidget.c.

References GNT_WIDGET_INVISIBLE, GNT_WIDGET_SET_FLAGS, GNT_WIDGET_UNSET_FLAGS, set(), and widget.

Referenced by add_protocol_options(), decide_conf_button(), finch_create_conversation(), update_user_options(), and users_command_cb().

◆ gnt_widget_show()

◆ gnt_widget_size_request()

void gnt_widget_size_request ( GntWidget widget)

Request a widget to calculate its desired size.

Parameters
widgetThe widget.

Definition at line 458 of file gntwidget.c.

References SIG_SIZE_REQUEST, signals, and widget.

Referenced by gnt_box_map(), gnt_box_readjust(), gnt_box_size_request(), gnt_button_map(), gnt_combo_box_map(), gnt_combo_box_size_request(), gnt_entry_map(), gnt_line_map(), gnt_menu_map(), gnt_slider_map(), gnt_text_view_map(), gnt_tree_map(), and notify().