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)  

gntbox.c File Reference
#include "gntinternal.h"
#include "gntbox.h"
#include "gntstyle.h"
#include "gntutils.h"
#include <string.h>
Include dependency graph for gntbox.c:

Go to the source code of this file.

Macros

#define PROP_LAST_RESIZE_S   "last-resize"
 
#define PROP_SIZE_QUEUED_S   "size-queued"
 

Enumerations

enum  { PROP_0, PROP_VERTICAL, PROP_HOMO }
 
enum  { SIGS = 1 }
 

Functions

static GntWidgetfind_focusable_widget (GntBox *box)
 
static void add_to_focus (gpointer value, gpointer data)
 
static void get_title_thingies (GntBox *box, char *title, int *p, int *r)
 
static void gnt_box_draw (GntWidget *widget)
 
static void reposition_children (GntWidget *widget)
 
static void gnt_box_set_position (GntWidget *widget, int x, int y)
 
static void gnt_box_size_request (GntWidget *widget)
 
static void gnt_box_map (GntWidget *widget)
 
static void find_next_focus (GntBox *box)
 
static void find_prev_focus (GntBox *box)
 
static gboolean gnt_box_key_pressed (GntWidget *widget, const char *text)
 
static gboolean box_focus_change (GntBox *box, gboolean next)
 
static gboolean action_focus_next (GntBindable *bindable, GList *null)
 
static gboolean action_focus_prev (GntBindable *bindable, GList *null)
 
static void gnt_box_lost_focus (GntWidget *widget)
 
static void gnt_box_gained_focus (GntWidget *widget)
 
static void gnt_box_destroy (GntWidget *w)
 
static void gnt_box_expose (GntWidget *widget, int x, int y, int width, int height)
 
static gboolean gnt_box_confirm_size (GntWidget *widget, int width, int height)
 
static void gnt_box_size_changed (GntWidget *widget, int oldw, int oldh)
 
static gboolean gnt_box_clicked (GntWidget *widget, GntMouseEvent event, int cx, int cy)
 
static void gnt_box_set_property (GObject *obj, guint prop_id, const GValue *value, GParamSpec *spec)
 
static void gnt_box_get_property (GObject *obj, guint prop_id, GValue *value, GParamSpec *spec)
 
static void gnt_box_class_init (GntBoxClass *klass)
 
static void gnt_box_init (GTypeInstance *instance, gpointer class)
 
GType gnt_box_get_gtype (void)
 
GntWidgetgnt_box_new (gboolean homo, gboolean vert)
 
void gnt_box_add_widget (GntBox *b, GntWidget *widget)
 
void gnt_box_set_title (GntBox *b, const char *title)
 
void gnt_box_set_pad (GntBox *box, int pad)
 
void gnt_box_set_toplevel (GntBox *box, gboolean set)
 
void gnt_box_sync_children (GntBox *box)
 
void gnt_box_set_alignment (GntBox *box, GntAlignment alignment)
 
void gnt_box_remove (GntBox *box, GntWidget *widget)
 
void gnt_box_remove_all (GntBox *box)
 
void gnt_box_readjust (GntBox *box)
 
void gnt_box_set_fill (GntBox *box, gboolean fill)
 
void gnt_box_move_focus (GntBox *box, int dir)
 
void gnt_box_give_focus_to_child (GntBox *box, GntWidget *widget)
 

Variables

static GntWidgetClassparent_class = NULL
 

Macro Definition Documentation

◆ PROP_LAST_RESIZE_S

#define PROP_LAST_RESIZE_S   "last-resize"

GNT - The GLib Ncurses Toolkit

GNT is the legal property of its developers, whose names are too numerous to list here. Please refer to the COPYRIGHT file distributed with this source distribution.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA

Definition at line 30 of file gntbox.c.

◆ PROP_SIZE_QUEUED_S

#define PROP_SIZE_QUEUED_S   "size-queued"

Definition at line 31 of file gntbox.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PROP_0 
PROP_VERTICAL 
PROP_HOMO 

Definition at line 33 of file gntbox.c.

◆ anonymous enum

anonymous enum
Enumerator
SIGS 

Definition at line 40 of file gntbox.c.

Function Documentation

◆ action_focus_next()

static gboolean action_focus_next ( GntBindable bindable,
GList *  null 
)
static

Definition at line 351 of file gntbox.c.

References box_focus_change(), GNT_BOX, and TRUE.

Referenced by gnt_box_class_init().

◆ action_focus_prev()

static gboolean action_focus_prev ( GntBindable bindable,
GList *  null 
)
static

Definition at line 357 of file gntbox.c.

References box_focus_change(), FALSE, and GNT_BOX.

Referenced by gnt_box_class_init().

◆ add_to_focus()

static void add_to_focus ( gpointer  value,
gpointer  data 
)
static

◆ box_focus_change()

static gboolean box_focus_change ( GntBox box,
gboolean  next 
)
static

◆ find_focusable_widget()

static GntWidget * find_focusable_widget ( GntBox box)
static

◆ find_next_focus()

static void find_next_focus ( GntBox box)
static

◆ find_prev_focus()

static void find_prev_focus ( GntBox box)
static

◆ get_title_thingies()

static void get_title_thingies ( GntBox box,
char *  title,
int *  p,
int *  r 
)
static

Definition at line 62 of file gntbox.c.

References gnt_util_onscreen_width_to_pointer(), GNT_WIDGET, r, and widget.

Referenced by gnt_box_draw(), and gnt_box_set_title().

◆ gnt_box_add_widget()

◆ gnt_box_class_init()

◆ gnt_box_clicked()

static gboolean gnt_box_clicked ( GntWidget widget,
GntMouseEvent  event,
int  cx,
int  cy 
)
static

◆ gnt_box_confirm_size()

◆ gnt_box_destroy()

static void gnt_box_destroy ( GntWidget w)
static

Definition at line 381 of file gntbox.c.

References GNT_BOX, gnt_box_remove_all(), and gnt_screen_release().

Referenced by gnt_box_class_init().

◆ gnt_box_draw()

◆ gnt_box_expose()

static void gnt_box_expose ( GntWidget widget,
int  x,
int  y,
int  width,
int  height 
)
static

Definition at line 390 of file gntbox.c.

References FALSE, and widget.

Referenced by gnt_box_class_init().

◆ gnt_box_gained_focus()

static void gnt_box_gained_focus ( GntWidget widget)
static

Definition at line 372 of file gntbox.c.

References GNT_BOX, gnt_widget_draw(), gnt_widget_set_focus(), TRUE, and widget.

Referenced by gnt_box_class_init().

◆ gnt_box_get_gtype()

GType gnt_box_get_gtype ( void  )

The GType for GntBox.

Returns
The GType.

Definition at line 635 of file gntbox.c.

References gnt_box_class_init(), gnt_box_init(), GNT_TYPE_WIDGET, info, NULL, and dbus-analyze-signals::type.

◆ gnt_box_get_property()

static void gnt_box_get_property ( GObject *  obj,
guint  prop_id,
GValue *  value,
GParamSpec *  spec 
)
static

Definition at line 553 of file gntbox.c.

References GNT_BOX, _GntBox::homogeneous, pietray::obj, PROP_HOMO, PROP_VERTICAL, value, and _GntBox::vertical.

Referenced by gnt_box_class_init().

◆ gnt_box_give_focus_to_child()

void gnt_box_give_focus_to_child ( GntBox box,
GntWidget widget 
)

◆ gnt_box_init()

static void gnt_box_init ( GTypeInstance *  instance,
gpointer  class 
)
static

◆ gnt_box_key_pressed()

static gboolean gnt_box_key_pressed ( GntWidget widget,
const char *  text 
)
static

◆ gnt_box_lost_focus()

static void gnt_box_lost_focus ( GntWidget widget)
static

Definition at line 363 of file gntbox.c.

References FALSE, GNT_BOX, gnt_widget_draw(), gnt_widget_set_focus(), and widget.

Referenced by gnt_box_class_init().

◆ gnt_box_map()

static void gnt_box_map ( GntWidget widget)
static

Definition at line 243 of file gntbox.c.

References find_focusable_widget(), GNT_BOX, gnt_widget_size_request(), GNTDEBUG, and widget.

Referenced by gnt_box_class_init().

◆ gnt_box_move_focus()

void gnt_box_move_focus ( GntBox box,
int  dir 
)

Move the focus from one widget to the other.

Parameters
boxThe box
dirThe direction. If it's 1, then the focus is moved forwards, if it's -1, the focus is moved backwards.

Definition at line 854 of file gntbox.c.

References _GntBox::active, FALSE, find_focusable_widget(), find_next_focus(), find_prev_focus(), GNT_WIDGET, gnt_widget_draw(), gnt_widget_set_focus(), NULL, TRUE, and window.

Referenced by status_selection_changed().

◆ gnt_box_new()

GntWidget* gnt_box_new ( gboolean  homo,
gboolean  vert 
)

Create a new GntBox.

Parameters
homoIf TRUE, all the widgets in it will have the same width (or height)
vertWhether the widgets in it should be stacked vertically (if TRUE) or horizontally (if FALSE).
Returns
The new GntBox.

Definition at line 662 of file gntbox.c.

References _GntBox::alignment, GNT_ALIGN_LEFT, GNT_ALIGN_MID, GNT_BOX, GNT_TYPE_BOX, _GntBox::homogeneous, NULL, _GntBox::vertical, and widget.

Referenced by draw_tooltip_real(), gnt_bindable_rebinding_activate(), gnt_combo_box_init(), gnt_widget_from_xmlnode(), and setup__list().

◆ gnt_box_readjust()

◆ gnt_box_remove()

void gnt_box_remove ( GntBox box,
GntWidget widget 
)

Remove a widget from the box. Calling this does NOT destroy the removed widget.

Parameters
boxThe box
widgetThe widget to remove

Definition at line 780 of file gntbox.c.

References _GntBox::active, find_next_focus(), _GntBox::focus, GNT_WIDGET, GNT_WIDGET_CAN_TAKE_FOCUS, gnt_widget_draw(), GNT_WIDGET_IS_FLAG_SET, GNT_WIDGET_MAPPED, _GntBox::list, NULL, and widget.

Referenced by finch_request_authorize().

◆ gnt_box_remove_all()

void gnt_box_remove_all ( GntBox box)

Remove all widgets from the box. This DOES destroy all widgets in the box.

Parameters
boxThe box

Definition at line 799 of file gntbox.c.

References _GntBox::focus, GNT_WIDGET, gnt_widget_destroy(), _GntBox::list, and NULL.

Referenced by add_protocol_options(), finch_conversation_set_info_widget(), gnt_box_destroy(), and update_user_splits().

◆ gnt_box_set_alignment()

◆ gnt_box_set_fill()

void gnt_box_set_fill ( GntBox box,
gboolean  fill 
)

Set whether the widgets in the box should fill the empty spaces.

Parameters
boxThe box
fillWhether the child widgets should fill the empty space

Definition at line 849 of file gntbox.c.

References _GntBox::fill.

Referenced by add_protocol_options(), config_frame(), edit_account(), finch_debug_window_show(), finch_notify_common(), finch_notify_searchresults(), finch_request_fields(), finch_savedstatus_edit(), finch_savedstatus_show_all(), finch_sounds_show_all(), finch_xfer_dialog_new(), gnt_widget_from_xmlnode(), setup_email_dialog(), and update_user_splits().

◆ gnt_box_set_pad()

◆ gnt_box_set_position()

static void gnt_box_set_position ( GntWidget widget,
int  x,
int  y 
)
static

◆ gnt_box_set_property()

static void gnt_box_set_property ( GObject *  obj,
guint  prop_id,
const GValue *  value,
GParamSpec *  spec 
)
static

Definition at line 535 of file gntbox.c.

References GNT_BOX, _GntBox::homogeneous, pietray::obj, PROP_HOMO, PROP_VERTICAL, value, and _GntBox::vertical.

Referenced by gnt_box_class_init().

◆ gnt_box_set_title()

◆ gnt_box_set_toplevel()

◆ gnt_box_size_changed()

static void gnt_box_size_changed ( GntWidget widget,
int  oldw,
int  oldh 
)
static

◆ gnt_box_size_request()

◆ gnt_box_sync_children()

◆ reposition_children()

Variable Documentation

◆ parent_class

GntWidgetClass* parent_class = NULL
static

Definition at line 45 of file gntbox.c.

Referenced by gnt_box_class_init().