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)  

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

Go to the source code of this file.

Macros

#define SEARCH_IN_RANGE(start, end)
 

Enumerations

enum  { SIG_SELECTION_CHANGED, SIGS }
 

Functions

static void set_selection (GntComboBox *box, gpointer key)
 
static void hide_popup (GntComboBox *box, gboolean set)
 
static void gnt_combo_box_draw (GntWidget *widget)
 
static void gnt_combo_box_size_request (GntWidget *widget)
 
static void gnt_combo_box_map (GntWidget *widget)
 
static void popup_dropdown (GntComboBox *box)
 
static gboolean gnt_combo_box_key_pressed (GntWidget *widget, const char *text)
 
static void gnt_combo_box_destroy (GntWidget *widget)
 
static void gnt_combo_box_lost_focus (GntWidget *widget)
 
static gboolean gnt_combo_box_clicked (GntWidget *widget, GntMouseEvent event, int x, int y)
 
static void gnt_combo_box_size_changed (GntWidget *widget, int oldw, int oldh)
 
static gboolean dropdown_menu (GntBindable *b, GList *null)
 
static void gnt_combo_box_class_init (GntComboBoxClass *klass)
 
static void gnt_combo_box_init (GTypeInstance *instance, gpointer class)
 
GType gnt_combo_box_get_gtype (void)
 
GntWidgetgnt_combo_box_new ()
 
void gnt_combo_box_add_data (GntComboBox *box, gpointer key, const char *text)
 
gpointer gnt_combo_box_get_selected_data (GntComboBox *box)
 
void gnt_combo_box_set_selected (GntComboBox *box, gpointer key)
 
void gnt_combo_box_remove (GntComboBox *box, gpointer key)
 
void gnt_combo_box_remove_all (GntComboBox *box)
 

Variables

static GntWidgetClassparent_class = NULL
 
static guint signals [SIGS] = { 0 }
 
static void(* widget_lost_focus )(GntWidget *widget)
 

Macro Definition Documentation

◆ SEARCH_IN_RANGE

#define SEARCH_IN_RANGE (   start,
  end 
)
Value:
do { \
GntTreeRow *row; \
for (row = start; row != end; \
row = gnt_tree_row_get_next(tree, row)) { \
gpointer key = gnt_tree_row_get_key(tree, row); \
GList *list = gnt_tree_get_row_text_list(tree, key); \
gboolean found = FALSE; \
found = (list->data && g_ascii_strncasecmp(text, list->data, len) == 0); \
g_list_foreach(list, (GFunc)g_free, NULL); \
g_list_free(list); \
if (found) { \
if (!showing) \
popup_dropdown(box); \
gnt_tree_set_selected(tree, key); \
return TRUE; \
} \
} \
} while (0)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

Enumerator
SIG_SELECTION_CHANGED 
SIGS 

Definition at line 33 of file gntcombobox.c.

Function Documentation

◆ dropdown_menu()

static gboolean dropdown_menu ( GntBindable b,
GList *  null 
)
static

◆ gnt_combo_box_add_data()

◆ gnt_combo_box_class_init()

◆ gnt_combo_box_clicked()

◆ gnt_combo_box_destroy()

static void gnt_combo_box_destroy ( GntWidget widget)
static

Definition at line 210 of file gntcombobox.c.

References GNT_COMBO_BOX, gnt_widget_destroy(), and widget.

Referenced by gnt_combo_box_class_init().

◆ gnt_combo_box_draw()

◆ gnt_combo_box_get_gtype()

GType gnt_combo_box_get_gtype ( void  )
Returns
Get the GType for GntComboBox

Definition at line 323 of file gntcombobox.c.

References gnt_combo_box_class_init(), gnt_combo_box_init(), GNT_TYPE_WIDGET, info, NULL, and dbus-analyze-signals::type.

◆ gnt_combo_box_get_selected_data()

gpointer gnt_combo_box_get_selected_data ( GntComboBox box)

Get the data that is currently selected

Parameters
boxThe GntComboBox
Returns
The data of the currently selected entry

Definition at line 365 of file gntcombobox.c.

References _GntComboBox::selected.

Referenced by add_protocol_options(), fl_get_list(), remove_typing_cb(), request_choice_cb(), request_fields_cb(), save_account_cb(), save_cb(), save_pounce_cb(), save_savedstatus_cb(), save_substatus_cb(), setup_roomlist(), update_user_options(), update_user_splits(), and use_trans_status_cb().

◆ gnt_combo_box_init()

◆ gnt_combo_box_key_pressed()

◆ gnt_combo_box_lost_focus()

static void gnt_combo_box_lost_focus ( GntWidget widget)
static

◆ gnt_combo_box_map()

static void gnt_combo_box_map ( GntWidget widget)
static

Definition at line 118 of file gntcombobox.c.

References gnt_widget_size_request(), GNTDEBUG, and widget.

Referenced by gnt_combo_box_class_init().

◆ gnt_combo_box_new()

◆ gnt_combo_box_remove()

void gnt_combo_box_remove ( GntComboBox box,
gpointer  key 
)

Remove an entry

Parameters
boxThe GntComboBox
keyThe data to be removed

Definition at line 375 of file gntcombobox.c.

References _GntComboBox::dropdown, GNT_TREE, gnt_tree_remove(), NULL, _GntComboBox::selected, and set_selection().

◆ gnt_combo_box_remove_all()

void gnt_combo_box_remove_all ( GntComboBox box)

Remove all entries

Parameters
boxThe GntComboBox

Definition at line 382 of file gntcombobox.c.

References _GntComboBox::dropdown, GNT_TREE, gnt_tree_remove_all(), NULL, and set_selection().

Referenced by populate_status_dropdown(), and reset_account_list().

◆ gnt_combo_box_set_selected()

void gnt_combo_box_set_selected ( GntComboBox box,
gpointer  key 
)

Set the current selection to a specific entry

Parameters
boxThe GntComboBox
keyThe data to be set to

Definition at line 370 of file gntcombobox.c.

References set_selection().

Referenced by add_protocol_options(), create_account_field(), create_choice_field(), create_list_field(), edit_account(), finch_pounce_editor_show(), finch_request_choice(), finch_savedstatus_edit(), load_pref_window(), savedstatus_changed(), and update_selected_account().

◆ gnt_combo_box_size_changed()

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

◆ gnt_combo_box_size_request()

static void gnt_combo_box_size_request ( GntWidget widget)
static

◆ hide_popup()

◆ popup_dropdown()

◆ set_selection()

Variable Documentation

◆ parent_class

GntWidgetClass* parent_class = NULL
static

Definition at line 39 of file gntcombobox.c.

Referenced by gnt_combo_box_class_init().

◆ signals

guint signals[SIGS] = { 0 }
static

Definition at line 40 of file gntcombobox.c.

Referenced by gnt_combo_box_class_init(), and set_selection().

◆ widget_lost_focus

void(* widget_lost_focus) (GntWidget *widget)
static

Definition at line 41 of file gntcombobox.c.

Referenced by gnt_combo_box_class_init(), and gnt_combo_box_lost_focus().

gnt_tree_row_get_key
gpointer gnt_tree_row_get_key(GntTree *tree, GntTreeRow *row)
Definition: gnttree.c:1928
NULL
#define NULL
Definition: getopt1.c:52
TRUE
#define TRUE
Definition: protobuf-c.c:56
gnt_tree_row_get_next
GntTreeRow * gnt_tree_row_get_next(GntTree *tree, GntTreeRow *row)
Definition: gnttree.c:1934
FALSE
#define FALSE
Definition: protobuf-c.c:57
text
static char * text[]
Definition: zephyr_err.c:10
gnt_tree_get_row_text_list
GList * gnt_tree_get_row_text_list(GntTree *tree, gpointer key)
Definition: gnttree.c:1455
showing
gboolean showing
Definition: gntprefs.c:42
tree
GntWidget * tree
Definition: gntcertmgr.c:46