Functions

catalog_add_path (path)

catalog_destroy_all ()

catalog_get_extra_paths ()

catalog_is_loaded (name)

catalog_load_all ()

catalog_remove_path (path)

cursor_get_add_widget_pixbuf ()

cursor_init ()

cursor_set (project, window, type)

displayable_value_is_disabled (type, value)

displayable_value_set_disabled (type, value, disabled)

get_debug_flags ()

get_displayable_value (type, value)

get_value_from_displayable (type, displayabe)

init ()

init_debug_flags ()

param_spec_objects (name, nick, blurb, accepted_type, flags)

propert_get_insensitive_tooltip (property)

property_def_get_default_from_spec (spec)

property_def_make_flags_from_string (type, string)

property_def_set_weights (properties, parent)

property_def_update_from_node (node, object_type, property_def_ref, domain)

register_displayable_value (type, value, domain, string)

register_translated_value (type, value, string)

setup_log_handlers ()

standard_boolean_spec ()

standard_float_spec ()

standard_gdkcolor_spec ()

standard_int_spec ()

standard_objects_spec ()

standard_pixbuf_spec ()

standard_stock_append_prefix (prefix)

standard_stock_image_spec ()

standard_stock_spec ()

standard_string_spec ()

standard_strv_spec ()

standard_uint_spec ()

type_has_displayable_values (type)

util_canonical_path (path)

util_check_and_warn_scrollable (parent, child_adaptor, parent_widget)

util_compare_stock_labels (a, b)

util_container_get_all_children (container)

util_count_placeholders (parent)

util_duplicate_underscores (name)

util_file_dialog_new (title, project, parent, action)

util_file_is_writeable (path)

util_filename_to_icon_name (value)

util_find_iter_by_widget (model, findme, column)

util_get_devhelp_icon (size)

util_get_file_mtime (filename)

util_get_placeholder_from_pointer (container)

util_get_type_from_name (name, have_func)

util_have_devhelp ()

util_icon_name_to_filename (value)

util_object_is_loading (object)

util_read_prop_name (str)

util_remove_scroll_events (widget)

util_replace (str, a, b)

util_search_devhelp (book, page, search)

util_url_show (url)

utils_boolean_from_string (string)

utils_cairo_draw_line (cr, color, x1, y1, x2, y2)

utils_cairo_draw_rectangle (cr, color, filled, x, y, width, height)

utils_enum_string_from_value (enum_type, value)

utils_enum_string_from_value_displayable (flags_type, value)

utils_enum_value_from_string (enum_type, strval)

utils_flags_string_from_value (enum_type, value)

utils_flags_string_from_value_displayable (flags_type, value)

utils_flags_value_from_string (enum_type, strval)

utils_get_pointer (widget, window, device, x, y)

utils_get_pspec_from_funcname (funcname)

utils_hijack_key_press (win, event, user_data)

utils_liststore_from_enum_type (enum_type, include_empty)

utils_pointer_mode_render_icon (mode, size)

utils_replace_home_dir_with_tilde (path)

utils_string_from_value (value)

utils_value_from_string (type, string, project)

xml_dump_from_context (context)

xml_get_boolean (node, name, _default)

xml_get_content (node_in)

xml_get_property_boolean (node_in, name, _default)

xml_get_property_double (node_in, name, _default)

xml_get_property_int (node_in, name, _default)

xml_get_property_string (node_in, name)

xml_get_property_string_required (node_in, name, xtra)

xml_get_property_targetable_versions (node_in, name)

xml_get_property_version (node_in, name, major, minor)

xml_get_value_int (node_in, name, val)

xml_get_value_int_required (node, name, val)

xml_get_value_string (node, name)

xml_get_value_string_required (node, name, xtra_info)

xml_load_sym_from_node (node_in, module, tagname, sym_location)

xml_search_child (node, name)

xml_search_child_required (tree, name)

xml_set_content (node_in, content)

xml_set_value (node_in, name, val)

Details

Gladeui.catalog_add_path(path)
Parameters:

path (str) – the new path containing catalogs

Adds a new path to the list of path to look catalogs for.

Gladeui.catalog_destroy_all()

Destroy and free all resources related with every loaded catalog.

Gladeui.catalog_get_extra_paths()
Returns:

a list paths added by Gladeui.Catalog.add_path()

Return type:

[str]

Gladeui.catalog_is_loaded(name)
Parameters:

name (str) – a catalog object

Returns:

Whether name is loaded or not

Return type:

bool

Gladeui.catalog_load_all()
Returns:

the list of loaded Gladeui.Catalog *

Return type:

[Gladeui.Catalog]

Loads all available catalogs in the system. First loads catalogs from Gladeui.ENV_CATALOG_PATH, then from Gladeui.App.get_catalogs_dir() and finally from paths specified with Gladeui.Catalog.add_path()

Gladeui.catalog_remove_path(path)
Parameters:

path (str or None) – the new path containing catalogs or None to remove all of them

Remove path from the list of path to look catalogs for. None to remove all paths.

Gladeui.cursor_get_add_widget_pixbuf()
Return type:

GdkPixbuf.Pixbuf

Gladeui.cursor_init()

Initializes cursors for use with Gladeui.Cursor.set().

Gladeui.cursor_set(project, window, type)
Parameters:

Sets the cursor for window to something appropriate based on type. (also sets the cursor on all visible project widgets)

Gladeui.displayable_value_is_disabled(type, value)
Parameters:
Return type:

bool

Gladeui.displayable_value_set_disabled(type, value, disabled)
Parameters:
Gladeui.get_debug_flags()
Return type:

int

Gladeui.get_displayable_value(type, value)
Parameters:
Return type:

str

Gladeui.get_value_from_displayable(type, displayabe)
Parameters:
Return type:

str

Gladeui.init()

Initialization function for libgladeui (not Gladeui.App) It builds paths, bind text domain, and register icons

Gladeui.init_debug_flags()
Gladeui.param_spec_objects(name, nick, blurb, accepted_type, flags)
Parameters:
Returns:

a GObject.ParamSpec describing a list of GObject.Object

Return type:

GObject.ParamSpec

Gladeui.propert_get_insensitive_tooltip(property)
Parameters:

property (Gladeui.Property) –

Return type:

str

Gladeui.property_def_get_default_from_spec(spec)
Parameters:

spec (GObject.ParamSpec) –

Return type:

GObject.Value

Gladeui.property_def_make_flags_from_string(type, string)
Parameters:
Return type:

int

Gladeui.property_def_set_weights(properties, parent)
Parameters:

This function assigns “weight” to each property in its natural order staring from 1. If parent is 0 weight will be set for every Gladeui.PropertyDef in the list. This function will not override weight if it is already set (weight >= 0.0)

Gladeui.property_def_update_from_node(node, object_type, property_def_ref, domain)
Parameters:
Returns:

True on success. property_def_ref is set to None if the property has Disabled=”True".

property_def_ref:

a pointer to the property class

Return type:

(bool, property_def_ref: Gladeui.PropertyDef or None)

Updates the property_def_ref with the contents of the node in the xml file. Only the values found in the xml file are overridden.

Gladeui.register_displayable_value(type, value, domain, string)
Parameters:
Gladeui.register_translated_value(type, value, string)
Parameters:
Gladeui.setup_log_handlers()

Sets up a log handler to manage all GLib.LogLevelFlags.LEVEL_MASK errors of domain: GLib, GLib-GObject.Object, Gtk, Gdk, and domainless.

Gladeui.standard_boolean_spec()
Returns:

a GObject.ParamSpec describing a boolean

Return type:

GObject.ParamSpec

Gladeui.standard_float_spec()
Returns:

a GObject.ParamSpec describing a float

Return type:

GObject.ParamSpec

Gladeui.standard_gdkcolor_spec()
Returns:

a GObject.ParamSpec describing a Gdk.Color

Return type:

GObject.ParamSpec

Gladeui.standard_int_spec()
Returns:

a GObject.ParamSpec describing an int

Return type:

GObject.ParamSpec

Gladeui.standard_objects_spec()
Returns:

a GObject.ParamSpec describing a list of GObject.Object

Return type:

GObject.ParamSpec

This was developed for the purpose of holding a list of ‘targets’ in an Atk.Relation (we are setting it up as a property)

Gladeui.standard_pixbuf_spec()
Returns:

a GObject.ParamSpec describing a GdkPixbuf.Pixbuf

Return type:

GObject.ParamSpec

Gladeui.standard_stock_append_prefix(prefix)
Parameters:

prefix (str) –

Gladeui.standard_stock_image_spec()
Returns:

a GObject.ParamSpec describing a list of builtin stock image

Return type:

GObject.ParamSpec

Gladeui.standard_stock_spec()
Returns:

a GObject.ParamSpec describing a list of builtin stock item

Return type:

GObject.ParamSpec

Gladeui.standard_string_spec()
Returns:

a GObject.ParamSpec describing a string

Return type:

GObject.ParamSpec

Gladeui.standard_strv_spec()
Returns:

a GObject.ParamSpec describing an array of strings

Return type:

GObject.ParamSpec

Gladeui.standard_uint_spec()
Returns:

a GObject.ParamSpec describing an uint

Return type:

GObject.ParamSpec

Gladeui.type_has_displayable_values(type)
Parameters:

type (GObject.GType) –

Return type:

bool

Gladeui.util_canonical_path(path)
Parameters:

path (str) – any path that may contain “..” or “.” components

Returns:

an absolute path to the specified file or directory that contains no “..” or “.” components (this does not call readlink like realpath() does).

Return type:

str

Gladeui.util_check_and_warn_scrollable(parent, child_adaptor, parent_widget)
Parameters:
Return type:

bool

Gladeui.util_compare_stock_labels(a, b)
Parameters:
Returns:

negative value if a < b; zero if a = b; positive value if a > b

Return type:

int

This is a GLib.CompareFunc that compares the labels of two stock items, ignoring any ‘_’ characters. It isn’t particularly efficient.

Gladeui.util_container_get_all_children(container)
Parameters:

container (Gtk.Container) – a Gtk.Container

Returns:

a GLib.List giving the contents of container

Return type:

[Gtk.Widget]

Use this to itterate over all children in a Gtk.Container, as it used _forall() instead of _foreach() (and the GTK+ version of this function is simply not exposed).

Gladeui.util_count_placeholders(parent)
Parameters:

parent (Gladeui.Widget) – a Gladeui.Widget

Returns:

the amount of Gladeui.Placeholders parented by parent

Return type:

int

Gladeui.util_duplicate_underscores(name)
Parameters:

name (str) – a string

Returns:

a newly allocated string

Return type:

str

Duplicates name, but the copy has two underscores in place of any single underscore in the original.

Gladeui.util_file_dialog_new(title, project, parent, action)
Parameters:
Returns:

a “glade file” file chooser dialog. The caller is responsible for showing the dialog

Return type:

Gtk.Widget

Gladeui.util_file_is_writeable(path)
Parameters:

path (str) – the path to the file

Returns:

True if file is writeable

Return type:

bool

Checks whether the file at path is writeable

Gladeui.util_filename_to_icon_name(value)
Parameters:

value (str) –

Return type:

str

Gladeui.util_find_iter_by_widget(model, findme, column)
Parameters:
Returns:

a newly allocated Gtk.TreeIter from model corresponding to findme which should be freed with Gtk.TreeIter.free()

Return type:

Gtk.TreeIter

Looks through model for the Gtk.TreeIter corresponding to findme under column.

Gladeui.util_get_devhelp_icon(size)
Parameters:

size (Gtk.IconSize) – the preferred icon size

Returns:

a Gtk.Image

Return type:

Gtk.Widget

Creates an image displaying the devhelp icon.

Gladeui.util_get_file_mtime(filename)
Parameters:

filename (str) – A filename

Raises:

GLib.Error

Returns:

The mtime of the file, or %0 if the file attributes could not be read.

Return type:

int

Gets the UTC modification time of file filename.

Gladeui.util_get_placeholder_from_pointer(container)
Parameters:

container (Gtk.Container) – a Gtk.Container

Returns:

a Gtk.Widget

Return type:

Gtk.Widget

Gladeui.util_get_type_from_name(name, have_func)
Parameters:
  • name (str) – the name of the GObject.GType - like ‘Gtk.Widget' or a “get-type” function.

  • have_func (bool) – function-name flag – true if the name is a “get-type” function.

Returns:

the new GObject.GType

Return type:

GObject.GType

Returns the type using the “get type” function name based on name. If the have_func flag is true,`name` is used directly, otherwise the get-type function is contrived from name then used.

Gladeui.util_have_devhelp()
Returns:

whether the devhelp module is loaded

Return type:

bool

Gladeui.util_icon_name_to_filename(value)
Parameters:

value (str) –

Return type:

str

Gladeui.util_object_is_loading(object)
Parameters:

object (GObject.Object) – A GObject.Object

Returns:

Whether the object’s project is being loaded or not.

Return type:

bool

Gladeui.util_read_prop_name(str)
Parameters:

str (str) – a string

Return type:

str

Return a usable version of a property identifier as found in a freshly parserd #GladeInterface

Gladeui.util_remove_scroll_events(widget)
Parameters:

widget (Gtk.Widget) –

Gladeui.util_replace(str, a, b)
Parameters:

Replaces each occurrence of the character a in str to b.

Gladeui.util_search_devhelp(book, page, search)
Parameters:
  • book (str) –

  • page (str) –

  • search (str) –

Gladeui.util_url_show(url)
Parameters:

url (str) – An URL to display

Returns:

True if a web browser was successfully launched, or False

Return type:

bool

Portable function for showing an URL url in a web browser.

Gladeui.utils_boolean_from_string(string)
Parameters:

string (str) – the string to convert

Returns:

True if there was an error on the conversion, False otherwise.

value:

return location

Return type:

(bool, value: bool)

Parse a boolean value

Gladeui.utils_cairo_draw_line(cr, color, x1, y1, x2, y2)
Parameters:
Gladeui.utils_cairo_draw_rectangle(cr, color, filled, x, y, width, height)
Parameters:
Gladeui.utils_enum_string_from_value(enum_type, value)
Parameters:
Return type:

str

Gladeui.utils_enum_string_from_value_displayable(flags_type, value)
Parameters:
Return type:

str

Gladeui.utils_enum_value_from_string(enum_type, strval)
Parameters:
Return type:

int

Gladeui.utils_flags_string_from_value(enum_type, value)
Parameters:
Return type:

str

Gladeui.utils_flags_string_from_value_displayable(flags_type, value)
Parameters:
Return type:

str

Gladeui.utils_flags_value_from_string(enum_type, strval)
Parameters:
Return type:

int

Gladeui.utils_get_pointer(widget, window, device, x, y)
Parameters:
  • widget (Gtk.Widget) – The widget to get the mouse position relative for

  • window (Gdk.Window) – The window of the current event, or None

  • device (Gdk.Device) – The device, if not specified, the current event will be expected to have a device.

  • x (int) – The location to store the mouse pointer X position

  • y (int) – The location to store the mouse pointer Y position

Get’s the pointer position relative to widget, while window and device are not absolutely needed, they should be passed wherever possible.

Gladeui.utils_get_pspec_from_funcname(funcname)
Parameters:

funcname (str) – the symbol name of a function to generate a GObject.ParamSpec

Returns:

A GObject.ParamSpec created by the delegate function specified by funcname

Return type:

GObject.ParamSpec or None

Gladeui.utils_hijack_key_press(win, event, user_data)
Parameters:
Returns:

whether the event was handled

Return type:

int

This function is meant to be attached to key-press-event of a toplevel, it simply allows the window contents to treat key events /before/ accelerator keys come into play (this way widgets dont get deleted when cutting text in an entry etc.). Creates a liststore suitable for comboboxes and such to chose from a variety of types.

Gladeui.utils_liststore_from_enum_type(enum_type, include_empty)
Parameters:
Returns:

A new Gtk.ListStore

Return type:

Gtk.ListStore

Creates a liststore suitable for comboboxes and such to chose from a variety of types.

Gladeui.utils_pointer_mode_render_icon(mode, size)
Parameters:
Returns:

the rendered GdkPixbuf.Pixbuf

Return type:

GdkPixbuf.Pixbuf

Render an icon representing the pointer mode. Best view with sizes bigger than Gtk.IconSize.LARGE_TOOLBAR.

Gladeui.utils_replace_home_dir_with_tilde(path)
Parameters:

path (str) –

Return type:

str

Gladeui.utils_string_from_value(value)
Parameters:

value (GObject.Value) – a GObject.Value to convert

Returns:

A newly allocated string

Return type:

str

Serializes GObject.Value into a string (using glade conversion routines)

Gladeui.utils_value_from_string(type, string, project)
Parameters:
Returns:

A newly allocated and set GObject.Value

Return type:

GObject.Value

Allocates and sets a GObject.Value of type type set to string (using glade conversion routines)

Gladeui.xml_dump_from_context(context)
Parameters:

context (Gladeui.XmlContext) – a Gladeui.XmlContext

Returns:

the XML string, free the allocated memory with GLib.free() after use

Return type:

str

Dump the XML string from the context.

Gladeui.xml_get_boolean(node, name, _default)
Parameters:
Return type:

bool

Gladeui.xml_get_content(node_in)
Parameters:

node_in (Gladeui.XmlNode) – a Gladeui.XmlNode

Returns:

A newly allocated string

Return type:

str

Gets a string containing the content of node_in.

Gladeui.xml_get_property_boolean(node_in, name, _default)
Parameters:
Return type:

bool

Gladeui.xml_get_property_double(node_in, name, _default)
Parameters:
Return type:

float

Gladeui.xml_get_property_int(node_in, name, _default)
Parameters:
Return type:

int

Gladeui.xml_get_property_string(node_in, name)
Parameters:
Return type:

str

Gladeui.xml_get_property_string_required(node_in, name, xtra)
Parameters:
Return type:

str

Gladeui.xml_get_property_targetable_versions(node_in, name)
Parameters:
Returns:

a list of Gladeui.TargetableVersion

Return type:

[Gladeui.TargetableVersion]

Get the list of targetable versions for a property

Gladeui.xml_get_property_version(node_in, name, major, minor)
Parameters:
Return type:

bool

Gladeui.xml_get_value_int(node_in, name, val)
Parameters:
Returns:

True if the node is found, False otherwise

Return type:

bool

Gets an integer value for a node either carried as an attribute or as the content of a child.

Gladeui.xml_get_value_int_required(node, name, val)
Parameters:
Returns:

False if name is not in node

Return type:

bool

This is a wrapper around Gladeui.xml_get_value_int(), only it emits a g_warning() if node did not contain the requested tag

Gladeui.xml_get_value_string(node, name)
Parameters:
Return type:

str

Gladeui.xml_get_value_string_required(node, name, xtra_info)
Parameters:
Return type:

str

Gladeui.xml_load_sym_from_node(node_in, module, tagname, sym_location)
Parameters:
Return type:

bool

Gladeui.xml_search_child(node, name)
Parameters:
Return type:

Gladeui.XmlNode

Gladeui.xml_search_child_required(tree, name)
Parameters:
Returns:

the requested Gladeui.XmlNode

Return type:

Gladeui.XmlNode or None

just a small wrapper around Gladeui.xml_search_child that displays an error if the child was not found

Gladeui.xml_set_content(node_in, content)
Parameters:

Sets the content of node to content.

Gladeui.xml_set_value(node_in, name, val)
Parameters:

Sets the property name in node_in to val