Loading...
Searching...
No Matches
gx_gui::GxBuilder Class Reference

class GxBuilder More...

`#include <gx_ui_builder.h>`

Inheritance diagram for gx_gui::GxBuilder:

## Public Member Functions

void | fixup_controlparameters (gx_engine::GxMachineBase &machine, sigc::signal< void(bool)> *out_ctr)
template<class T_Widget>
void | find_widget (const Glib::ustring &name, T_Widget *&widget)
template<class T_Object>
void | find_object (const Glib::ustring &name, T_Object *&object)
template<class T_Widget, class F>
void | find_widget_derived (const Glib::ustring &name, T_Widget *&widget, F f)
bool | has_object (const Glib::ustring &name)
template<class T_Widget>
void | get_toplevel (const Glib::ustring &name, T_Widget *&widget)
Gtk::Window * | get_first_window ()
template<class T_Widget, class F>
void | get_toplevel_derived (const Glib::ustring &name, T_Widget *&widget, F f)

## Static Public Member Functions

static Glib::RefPtr< GxBuilder > | create ()
static Glib::RefPtr< GxBuilder > | create_from_file (const std::string &filename, gx_engine::GxMachineBase *pmach=0, const char *object_id=0, sigc::signal< void(bool)> *out_ctr=0)
static Glib::RefPtr< GxBuilder > | create_from_file (const std::string &filename, gx_engine::GxMachineBase *pmach, const Glib::StringArrayHandle &object_ids, sigc::signal< void(bool)> *out_ctr=0)
static Glib::RefPtr< GxBuilder > | create_from_string (const Glib::ustring &buffer, gx_engine::GxMachineBase *pmach=0, const char *object_id=0, sigc::signal< void(bool)> *out_ctr=0)
static Glib::RefPtr< GxBuilder > | create_from_string (const Glib::ustring &buffer, gx_engine::GxMachineBase *pmach, const Glib::StringArrayHandle &object_ids, sigc::signal< void(bool)> *out_ctr=0)
static bool | get_show_tooltips ()
static void | set_show_tooltips (bool v)
static void | connect_gx_tooltip_handler (GtkWidget *widget)
static void | set_tooltip_text_connect_handler (GtkWidget *widget, const char *text)
static void | set_tooltip_text_connect_handler (Gtk::Widget &widget, const char *text)
static void | set_tooltip_text_connect_handler (Gtk::Widget &widget, const Glib::ustring &text)

## Private Member Functions

GObject * | get_cobject (const Glib::ustring &name)

## Static Private Member Functions

static Glib::RefPtr< GxBuilder > | create_from_file (const std::string &filename, const char *object_id)
static Glib::RefPtr< GxBuilder > | create_from_file (const std::string &filename, const Glib::ustring &object_id)
static Glib::RefPtr< GxBuilder > | create_from_file (const std::string &filename, const Glib::StringArrayHandle &object_ids)
static Glib::RefPtr< GxBuilder > | create_from_string (const Glib::ustring &buffer, const char *object_id)
static Glib::RefPtr< GxBuilder > | create_from_string (const Glib::ustring &buffer, const Glib::ustring &object_id)
static Glib::RefPtr< GxBuilder > | create_from_string (const Glib::ustring &buffer, const Glib::StringArrayHandle &object_ids)

## Static Private Attributes

static bool | show_tooltips

## Detailed Description

class GxBuilder

Attempts to correct the mismatch between GtkBuilder and Gtk::Builder wrt. reference counting.

Use get_toplevel or get_toplevel_derived to become the owner of a toplevel widget of the loaded builder widget tree (specifying object id's for the loader means that only part of the defined widget tree is loaded). These pointers must be delete'd to destroy the widget (and its child widgets). If you loaded a window (GtkWindow or derived) you must use one of the get_toplevel functions and delete the instance to avoid a memory leak.

Use find_widget for getting a pointer to a widget (but you don't become owner of that widget, don't use delete). If you want to add the loaded widget tree to a container, use this function (the container will ref the widget and manage its lifetime).

template function code mostly copied from Gtk::Builder, look there for comments.

Definition at line 72 of file gx_ui_builder.h.

## Member Function Documentation

## connect_gx_tooltip_handler()

void gx_gui::GxBuilder::connect_gx_tooltip_handler | ( | GtkWidget * | widget | ) |

static

## create()

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create | ( |  | ) |

inline static

Definition at line 84 of file gx_ui_builder.h.

## create_from_file() [1/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_file | ( | const std::string & | filename,
|  | const char * | object_id )

static private

## create_from_file() [2/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_file | ( | const std::string & | filename,
|  | const Glib::StringArrayHandle & | object_ids )

static private

## create_from_file() [3/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_file | ( | const std::string & | filename,
|  | const Glib::ustring & | object_id )

static private

## create_from_file() [4/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_file | ( | const std::string & | filename,
|  | gx_engine::GxMachineBase * | pmach,
|  | const Glib::StringArrayHandle & | object_ids,
|  | sigc::signal< void(bool)> * | out_ctr = 0 )

static

## create_from_file() [5/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_file | ( | const std::string & | filename,
|  | gx_engine::GxMachineBase * | pmach = 0,
|  | const char * | object_id = 0,
|  | sigc::signal< void(bool)> * | out_ctr = 0 )

static

## create_from_string() [1/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_string | ( | const Glib::ustring & | buffer,
|  | const char * | object_id )

static private

## create_from_string() [2/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_string | ( | const Glib::ustring & | buffer,
|  | const Glib::StringArrayHandle & | object_ids )

static private

## create_from_string() [3/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_string | ( | const Glib::ustring & | buffer,
|  | const Glib::ustring & | object_id )

static private

## create_from_string() [4/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_string | ( | const Glib::ustring & | buffer,
|  | gx_engine::GxMachineBase * | pmach,
|  | const Glib::StringArrayHandle & | object_ids,
|  | sigc::signal< void(bool)> * | out_ctr = 0 )

static

## create_from_string() [5/5]

Glib::RefPtr< GxBuilder > gx_gui::GxBuilder::create_from_string | ( | const Glib::ustring & | buffer,
|  | gx_engine::GxMachineBase * | pmach = 0,
|  | const char * | object_id = 0,
|  | sigc::signal< void(bool)> * | out_ctr = 0 )

static

## find_object()

template<class T_Object>

void gx_gui::GxBuilder::find_object | ( | const Glib::ustring & | name,
|  | T_Object *& | object )

inline

Definition at line 117 of file gx_ui_builder.h.

## find_widget()

template<class T_Widget>

void gx_gui::GxBuilder::find_widget | ( | const Glib::ustring & | name,
|  | T_Widget *& | widget )

inline

Definition at line 110 of file gx_ui_builder.h.

## find_widget_derived()

template<class T_Widget, class F>

void gx_gui::GxBuilder::find_widget_derived | ( | const Glib::ustring & | name,
|  | T_Widget *& | widget,
|  | F | f )

inline

Definition at line 123 of file gx_ui_builder.h.

## fixup_controlparameters()

void gx_gui::GxBuilder::fixup_controlparameters | ( | gx_engine::GxMachineBase & | machine,
|  | sigc::signal< void(bool)> * | out_ctr )

## get_cobject()

GObject * gx_gui::GxBuilder::get_cobject | ( | const Glib::ustring & | name | ) |

private

Referenced by find_widget_derived(), and get_toplevel_derived().

## get_first_window()

Gtk::Window * gx_gui::GxBuilder::get_first_window | ( |  | ) |

## get_show_tooltips()

bool gx_gui::GxBuilder::get_show_tooltips | ( |  | ) |

inline static

Definition at line 98 of file gx_ui_builder.h.

## get_toplevel()

template<class T_Widget>

void gx_gui::GxBuilder::get_toplevel | ( | const Glib::ustring & | name,
|  | T_Widget *& | widget )

inline

Definition at line 146 of file gx_ui_builder.h.

## get_toplevel_derived()

template<class T_Widget, class F>

void gx_gui::GxBuilder::get_toplevel_derived | ( | const Glib::ustring & | name,
|  | T_Widget *& | widget,
|  | F | f )

inline

Definition at line 156 of file gx_ui_builder.h.

## has_object()

bool gx_gui::GxBuilder::has_object | ( | const Glib::ustring & | name | ) |

inline

Definition at line 141 of file gx_ui_builder.h.

## set_show_tooltips()

void gx_gui::GxBuilder::set_show_tooltips | ( | bool | v | ) |

inline static

Definition at line 99 of file gx_ui_builder.h.

## set_tooltip_text_connect_handler() [1/3]

void gx_gui::GxBuilder::set_tooltip_text_connect_handler | ( | Gtk::Widget & | widget,
|  | const char * | text )

inline static

Definition at line 102 of file gx_ui_builder.h.

## set_tooltip_text_connect_handler() [2/3]

void gx_gui::GxBuilder::set_tooltip_text_connect_handler | ( | Gtk::Widget & | widget,
|  | const Glib::ustring & | text )

inline static

Definition at line 104 of file gx_ui_builder.h.

## set_tooltip_text_connect_handler() [3/3]

void gx_gui::GxBuilder::set_tooltip_text_connect_handler | ( | GtkWidget * | widget,
|  | const char * | text )

static

Referenced by set_tooltip_text_connect_handler(), and set_tooltip_text_connect_handler().

## Member Data Documentation

## show_tooltips

bool gx_gui::GxBuilder::show_tooltips

static private

Definition at line 74 of file gx_ui_builder.h.

Referenced by get_show_tooltips(), and set_show_tooltips().

The documentation for this class was generated from the following file:

- src/headers/gx_ui_builder.h