#include <goffice/goffice-config.h>
#include "go-combo-box.h"
#include <goffice/utils/go-marshalers.h>
#include <goffice/gtk/goffice-gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n-lib.h>
#include <gsf/gsf-impl-utils.h>
Classes | |
struct | _GOComboBoxPrivate |
Enumerations | |
enum | { POP_DOWN_DONE, LAST_SIGNAL } |
Functions | |
static void | go_combo_set_tearoff_state (GOComboBox *combo, gboolean torn_off) |
go_combo_set_tearoff_state : Combo box : TRUE: Tear off. | |
static void | go_combo_popup_reparent (GtkWidget *popup, GtkWidget *new_parent, gboolean unrealize) |
go_combo_popup_reparent : Popup : New parent : Unrealize popup if TRUE. | |
static void | go_combo_box_finalize (GObject *object) |
static void | go_combo_box_destroy (GtkWidget *widget) |
static void | do_focus_change (GtkWidget *widget, gboolean in) |
static void | set_arrow_state (GOComboBox *combo_box, gboolean state) |
static void | go_combo_box_popup_hide_unconditional (GOComboBox *combo_box) |
static gboolean | cb_arrow_pressed (GOComboBox *combo_box) |
static gboolean | go_combo_box_mnemonic_activate (GtkWidget *w, G_GNUC_UNUSED gboolean group_cycling) |
static void | go_combo_box_style_set (GtkWidget *widget, G_GNUC_UNUSED GtkStyle *prev_style) |
static void | go_combo_box_realize (GtkWidget *widget) |
static void | go_combo_box_class_init (GObjectClass *object_class) |
gboolean | _go_combo_is_updating (GOComboBox const *combo_box) |
static gint | cb_combo_keypress (G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event, GOComboBox *combo_box) |
static void | go_combo_popup_tear_off (GOComboBox *combo, gboolean set_position) |
go_combo_popup_tear_off : Combo box : Set to position of popup shell if true | |
void | go_combo_box_popup_hide (GOComboBox *combo_box) |
go_combo_box_popup_hide: : a GOComboBox | |
void | go_combo_box_get_pos (GOComboBox *combo_box, int *x, int *y) |
static void | go_combo_tearoff_bg_copy (G_GNUC_UNUSED GOComboBox *combo) |
go_combo_tearoff_bg_copy : Combo box | |
void | go_combo_box_popup_display (GOComboBox *combo_box) |
static gint | go_combo_box_button_press (GtkWidget *widget, GdkEventButton *event, GOComboBox *combo_box) |
static void | cb_state_change (GtkWidget *widget, G_GNUC_UNUSED GtkStateType old_state, GOComboBox *combo_box) |
static void | go_combo_box_init (GOComboBox *combo_box) |
GSF_CLASS (GOComboBox, go_combo_box, go_combo_box_class_init, go_combo_box_init, GTK_TYPE_HBOX) | |
static gboolean | cb_tearable_enter_leave (GtkWidget *w, G_GNUC_UNUSED GdkEventCrossing *event, gpointer data) |
static gboolean | cb_popup_delete (GOComboBox *combo) |
static gboolean | cb_tearable_button_release (GtkWidget *w, G_GNUC_UNUSED GdkEventButton *event, GOComboBox *combo) |
static void | cb_tearoff_state_changed (GtkMenu *menu, G_GNUC_UNUSED GParamSpec *pspec, GOComboBox *combo) |
static void | cb_tearable_parent_changed (GtkWidget *tearable_menu, GtkWidget *old_parent, GOComboBox *combo) |
void | go_combo_box_construct (GOComboBox *combo, GtkWidget *display_widget, GtkWidget *popdown_container, G_GNUC_UNUSED GtkWidget *popdown_focus) |
void | go_combo_box_set_title (GOComboBox *combo, char const *title) |
go_combo_box_set_title : Combo box : Title | |
char const * | go_combo_box_get_title (GOComboBox *combo) |
void | go_combo_box_set_tearable (GOComboBox *combo, gboolean tearable) |
go_combo_box_set_tearable: : Combo box : whether to allow the to be tearable | |
void | go_combo_box_set_relief (GOComboBox *combo, GtkReliefStyle relief) |
void | go_combo_box_set_tooltip (GOComboBox *c, G_GNUC_UNUSED void *tips, char const *text, G_GNUC_UNUSED char const *priv_text) |
Variables | |
static GObjectClass * | go_combo_box_parent_class |
static guint | go_combo_box_signals [LAST_SIGNAL] = { 0, } |
gboolean _go_combo_is_updating | ( | GOComboBox const * | combo_box | ) |
Referenced by cb_preview_clicked().
static gboolean cb_arrow_pressed | ( | GOComboBox * | combo_box | ) | [static] |
static gint cb_combo_keypress | ( | G_GNUC_UNUSED GtkWidget * | widget, | |
GdkEventKey * | event, | |||
GOComboBox * | combo_box | |||
) | [static] |
References GDK_KEY_Escape, and go_combo_box_popup_hide_unconditional().
Referenced by go_combo_box_init(), and go_combo_popup_tear_off().
static gboolean cb_popup_delete | ( | GOComboBox * | combo | ) | [static] |
References go_combo_box_popup_hide_unconditional().
Referenced by cb_tearable_button_release().
static void cb_state_change | ( | GtkWidget * | widget, | |
G_GNUC_UNUSED GtkStateType | old_state, | |||
GOComboBox * | combo_box | |||
) | [static] |
References _GOComboBoxPrivate::display_widget, and _GOComboBox::priv.
Referenced by go_combo_box_init().
static gboolean cb_tearable_button_release | ( | GtkWidget * | w, | |
G_GNUC_UNUSED GdkEventButton * | event, | |||
GOComboBox * | combo | |||
) | [static] |
static gboolean cb_tearable_enter_leave | ( | GtkWidget * | w, | |
G_GNUC_UNUSED GdkEventCrossing * | event, | |||
gpointer | data | |||
) | [static] |
Referenced by go_combo_box_construct().
static void cb_tearable_parent_changed | ( | GtkWidget * | tearable_menu, | |
GtkWidget * | old_parent, | |||
GOComboBox * | combo | |||
) | [static] |
References cb_tearoff_state_changed(), _GOComboBox::priv, _GOComboBoxPrivate::tearoff_signal, and _GOComboBoxPrivate::torn_off.
Referenced by go_combo_box_construct().
static void cb_tearoff_state_changed | ( | GtkMenu * | menu, | |
G_GNUC_UNUSED GParamSpec * | pspec, | |||
GOComboBox * | combo | |||
) | [static] |
References _GOComboBox::priv, and _GOComboBoxPrivate::torn_off.
Referenced by cb_tearable_parent_changed().
static void do_focus_change | ( | GtkWidget * | widget, | |
gboolean | in | |||
) | [static] |
References gtk_widget_get_window().
Referenced by go_combo_box_popup_display(), and go_combo_box_popup_hide_unconditional().
static gint go_combo_box_button_press | ( | GtkWidget * | widget, | |
GdkEventButton * | event, | |||
GOComboBox * | combo_box | |||
) | [static] |
References go_combo_box_popup_hide().
Referenced by go_combo_box_init().
static void go_combo_box_class_init | ( | GObjectClass * | object_class | ) | [static] |
References _, go__BOOLEAN__OBJECT(), go_combo_box_parent_class, and go_combo_box_signals.
void go_combo_box_construct | ( | GOComboBox * | combo, | |
GtkWidget * | display_widget, | |||
GtkWidget * | popdown_container, | |||
G_GNUC_UNUSED GtkWidget * | popdown_focus | |||
) |
References cb_tearable_button_release(), cb_tearable_enter_leave(), cb_tearable_parent_changed(), _GOComboBoxPrivate::display_widget, go_combo_box_set_display(), go_combo_box_set_relief(), go_combo_box_set_tearable(), GO_IS_COMBO_BOX, gtk_box_new(), _GOComboBoxPrivate::popdown_container, and _GOComboBox::priv.
Referenced by go_combo_color_new().
static void go_combo_box_destroy | ( | GtkWidget * | widget | ) | [static] |
static void go_combo_box_finalize | ( | GObject * | object | ) | [static] |
References GO_COMBO_BOX, go_combo_box_parent_class, and _GOComboBox::priv.
void go_combo_box_get_pos | ( | GOComboBox * | combo_box, | |
int * | x, | |||
int * | y | |||
) |
Referenced by go_combo_box_popup_display(), and go_combo_popup_tear_off().
char const* go_combo_box_get_title | ( | GOComboBox * | combo | ) |
Referenced by go_combo_popup_tear_off().
static void go_combo_box_init | ( | GOComboBox * | combo_box | ) | [static] |
References _GOComboBoxPrivate::arrow_button, cb_arrow_pressed(), cb_combo_keypress(), cb_state_change(), _GOComboBoxPrivate::frame, go_combo_box_button_press(), gtk_widget_set_can_focus(), _GOComboBoxPrivate::popup, _GOComboBox::priv, _GOComboBoxPrivate::tearoff_window, _GOComboBoxPrivate::toplevel, _GOComboBoxPrivate::torn_off, and _GOComboBoxPrivate::updating_buttons.
static gboolean go_combo_box_mnemonic_activate | ( | GtkWidget * | w, | |
G_GNUC_UNUSED gboolean | group_cycling | |||
) | [static] |
References cb_arrow_pressed(), and GO_COMBO_BOX.
void go_combo_box_popup_display | ( | GOComboBox * | combo_box | ) |
Referenced by cb_arrow_pressed(), and cb_preview_clicked().
void go_combo_box_popup_hide | ( | GOComboBox * | combo_box | ) |
go_combo_box_popup_hide: : a GOComboBox
Hides popup, but not when it is torn off. This is the external interface - for subclasses and apps which expect a regular combo which doesn't do tearoffs.
Referenced by cb_proxy_custom_dialog(), emit_color_changed(), and go_combo_box_button_press().
static void go_combo_box_popup_hide_unconditional | ( | GOComboBox * | combo_box | ) | [static] |
References do_focus_change(), _GOComboBoxPrivate::frame, go_combo_box_signals, go_combo_set_tearoff_state(), GO_IS_COMBO_BOX, POP_DOWN_DONE, _GOComboBoxPrivate::popdown_container, _GOComboBoxPrivate::popup, _GOComboBox::priv, set_arrow_state(), _GOComboBoxPrivate::toplevel, and _GOComboBoxPrivate::torn_off.
Referenced by cb_arrow_pressed(), cb_combo_keypress(), cb_popup_delete(), cb_tearable_button_release(), and go_combo_box_popup_hide().
static void go_combo_box_realize | ( | GtkWidget * | widget | ) | [static] |
void go_combo_box_set_relief | ( | GOComboBox * | combo, | |
GtkReliefStyle | relief | |||
) |
Referenced by go_combo_box_construct(), and EV_UnixToolbar::synthesize().
void go_combo_box_set_tearable | ( | GOComboBox * | combo, | |
gboolean | tearable | |||
) |
go_combo_box_set_tearable: : Combo box : whether to allow the to be tearable
controls whether the combo box's pop up widget can be torn off.
Referenced by go_combo_box_construct(), and go_combo_box_style_set().
void go_combo_box_set_title | ( | GOComboBox * | combo, | |
char const * | title | |||
) |
go_combo_box_set_title : Combo box : Title
Set a title to display over the tearoff window.
FIXME:
This should really change the title even when the popup is already torn off. I guess the tearoff window could attach a listener to title change or something. But I don't think we need the functionality, so I didn't bother to investigate.
MW: Just make it a property.
void go_combo_box_set_tooltip | ( | GOComboBox * | c, | |
G_GNUC_UNUSED void * | tips, | |||
char const * | text, | |||
G_GNUC_UNUSED char const * | priv_text | |||
) |
static void go_combo_box_style_set | ( | GtkWidget * | widget, | |
G_GNUC_UNUSED GtkStyle * | prev_style | |||
) | [static] |
References GO_COMBO_BOX, and go_combo_box_set_tearable().
static void go_combo_popup_reparent | ( | GtkWidget * | popup, | |
GtkWidget * | new_parent, | |||
gboolean | unrealize | |||
) | [static] |
go_combo_popup_reparent : Popup : New parent : Unrealize popup if TRUE.
Reparent the popup, taking care of the refcounting
Compare with gtk_menu_reparent in gtk/gtkmenu.c
Referenced by go_combo_box_popup_display(), go_combo_popup_tear_off(), and go_combo_set_tearoff_state().
static void go_combo_popup_tear_off | ( | GOComboBox * | combo, | |
gboolean | set_position | |||
) | [static] |
go_combo_popup_tear_off : Combo box : Set to position of popup shell if true
Tear off the popup
FIXME: Gtk popup menus are toplevel windows, not dialogs. I think this is wrong, and make the popups dialogs. But may be there should be a way to make them toplevel. We can do this after creating: GTK_WINDOW (tearoff)->type = GTK_WINDOW_TOPLEVEL;
References cb_combo_keypress(), gchar, go_combo_box_get_pos(), go_combo_box_get_title(), go_combo_popup_reparent(), gtk_widget_get_visible(), gtk_widget_get_window(), _GOComboBoxPrivate::popup, _GOComboBox::priv, _GOComboBoxPrivate::tearoff_window, and _GOComboBoxPrivate::toplevel.
Referenced by go_combo_box_popup_hide(), and go_combo_set_tearoff_state().
static void go_combo_set_tearoff_state | ( | GOComboBox * | combo, | |
gboolean | torn_off | |||
) | [static] |
go_combo_set_tearoff_state : Combo box : TRUE: Tear off.
FALSE: Pop down and reattach
Set the tearoff state of the popup
Compare with gtk_menu_set_tearoff_state in gtk/gtkmenu.c
References go_combo_popup_reparent(), go_combo_popup_tear_off(), GO_IS_COMBO_BOX, _GOComboBoxPrivate::popup, _GOComboBox::priv, set_arrow_state(), _GOComboBoxPrivate::tearoff_window, _GOComboBoxPrivate::toplevel, and _GOComboBoxPrivate::torn_off.
Referenced by cb_tearable_button_release(), go_combo_box_popup_hide_unconditional(), and go_combo_box_set_tearable().
static void go_combo_tearoff_bg_copy | ( | G_GNUC_UNUSED GOComboBox * | combo | ) | [static] |
go_combo_tearoff_bg_copy : Combo box
Copy popup window image to the tearoff window.
References gtk_widget_get_allocation(), and gtk_widget_get_window().
Referenced by go_combo_box_popup_display().
GSF_CLASS | ( | GOComboBox | , | |
go_combo_box | , | |||
go_combo_box_class_init | , | |||
go_combo_box_init | , | |||
GTK_TYPE_HBOX | ||||
) |
References GO_IS_COMBO_BOX.
static void set_arrow_state | ( | GOComboBox * | combo_box, | |
gboolean | state | |||
) | [static] |
GObjectClass* go_combo_box_parent_class [static] |
Referenced by go_combo_box_class_init(), go_combo_box_destroy(), go_combo_box_finalize(), and go_combo_box_realize().
guint go_combo_box_signals[LAST_SIGNAL] = { 0, } [static] |
Referenced by go_combo_box_class_init(), and go_combo_box_popup_hide_unconditional().