Classes | Enumerations | Functions | Variables

go-combo-box.c File Reference

#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, }

Enumeration Type Documentation

anonymous enum
Enumerator:
POP_DOWN_DONE 
LAST_SIGNAL 

Function Documentation

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]
static gboolean cb_popup_delete ( GOComboBox combo  )  [static]
static void cb_state_change ( GtkWidget *  widget,
G_GNUC_UNUSED GtkStateType  old_state,
GOComboBox combo_box 
) [static]
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]
static void cb_tearoff_state_changed ( GtkMenu *  menu,
G_GNUC_UNUSED GParamSpec *  pspec,
GOComboBox combo 
) [static]
static void do_focus_change ( GtkWidget *  widget,
gboolean  in 
) [static]
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]
void go_combo_box_construct ( GOComboBox combo,
GtkWidget *  display_widget,
GtkWidget *  popdown_container,
G_GNUC_UNUSED GtkWidget *  popdown_focus 
)
static void go_combo_box_destroy ( GtkWidget *  widget  )  [static]
static void go_combo_box_finalize ( GObject *  object  )  [static]
void go_combo_box_get_pos ( GOComboBox combo_box,
int *  x,
int *  y 
)
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]
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  ) 
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]
static void go_combo_box_realize ( GtkWidget *  widget  )  [static]
void go_combo_box_set_relief ( GOComboBox combo,
GtkReliefStyle  relief 
)
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]
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]

Variable Documentation

GObjectClass* go_combo_box_parent_class [static]
guint go_combo_box_signals[LAST_SIGNAL] = { 0, } [static]