-
public bool accel_groups_activate (Object object, uint accel_key, ModifierType accel_mods)
Finds the first accelerator in any AccelGroup attached
to object that matches accel_key and accel_mods, and activates that accelerator.
-
public unowned SList<AccelGroup> accel_groups_from_object (Object object)
Gets a list of all accel groups which are attached to object.
-
public ModifierType accelerator_get_default_mod_mask ()
-
public unowned string accelerator_get_label (uint accelerator_key, ModifierType accelerator_mods)
Converts an accelerator keyval and modifier mask into a string which can be used to represent the
accelerator to the user.
-
public unowned string accelerator_name (uint accelerator_key, ModifierType accelerator_mods)
Converts an accelerator keyval and modifier mask into a string parseable by
accelerator_parse. For example, if you pass in
q and
CONTROL_MASK, this function returns "<Control
>q".
-
public void accelerator_parse (string accelerator, out uint accelerator_key, out ModifierType accelerator_mods)
Parses a string representing an accelerator. The format looks like "<Control>a" or "
<Shift><Alt>F1" or "<Release>z" (the last one is for key release).
-
public void accelerator_set_default_mod_mask (ModifierType default_mod_mask)
Sets the modifiers that will be considered significant for keyboard accelerators. The default mod mask
is CONTROL_MASK |
SHIFT_MASK |
MOD1_MASK |
SUPER_MASK |
HYPER_MASK |
META_MASK, that is, Control, Shift, Alt, Super, Hyper and
Meta. Other modifiers will by default be ignored by AccelGroup. You must include at
least the three modifiers Control, Shift and Alt in any value you pass to this function.
-
public bool accelerator_valid (uint keyval, ModifierType modifiers)
Determines whether a given keyval and modifier mask constitute a valid keyboard accelerator. For
example, the a keyval plus
CONTROL_MASK is valid - this is a "Ctrl+a"
accelerator. But, you can't, for instance, use the Control_L keyval
as an accelerator.
-
public bool alternative_dialog_button_order (Screen screen)
Returns true if dialogs are expected to use an alternative button order on the screen
screen. See set_alternative_button_order for
more details about alternative button order.
-
public bool bindings_activate (Object object, uint keyval, ModifierType modifiers)
Find a key binding matching keyval and modifiers and activate the binding on
object.
-
public bool bindings_activate_event (Object object, EventKey event)
Looks up key bindings for object to find one matching event, and if one was
found, activate it.
-
public bool cairo_should_draw_window (Context cr, Window window)
This function is supposed to be called in draw
implementations for widgets that support multiple windows. cr must be untransformed from invoking of the draw
function. This function will return true if the contents of the given window are supposed to be drawn and
false otherwise. Note that when the drawing was not initiated by the windowing system this function will return
true for all windows, so you need to draw the bottommost window first. Also, do not use "else if" statements to check which
window should be drawn.
-
public void cairo_transform_to_window (Context cr, Widget widget, Window window)
Transforms the given cairo context cr that from widget-relative coordinates
to window-relative coordinates. If the widget's window is not an ancestor of window, no
modification will be applied.
-
public unowned string check_version (uint required_major, uint required_minor, uint required_micro)
Checks that the GTK+ library in use is compatible with the given version. Generally you would pass in
the constants MAJOR_VERSION,
MINOR_VERSION, MICRO_VERSION
as the three arguments to this function; that produces a check that the library in use is compatible with the version of GTK+
the application or module was compiled against.
-
public void device_grab_add (Widget widget, Device device, bool block_others)
Adds a GTK+ grab on device, so all the events on device and its associated
pointer or keyboard (if any) are delivered to widget. If the block_others parameter is true,
any other devices will be unable to interact with widget during the grab.
-
public void device_grab_remove (Widget widget, Device device)
Removes a device grab from the given widget.
-
public void disable_setlocale ()
Prevents init,
init_check, init_with_args and
parse_args from automatically calling setlocale (LC_ALL, ""). You would want
to use this function if you wanted to set the locale for your program to something other than the user's locale, or if you wanted to
set different values for different locale categories.
-
public int distribute_natural_allocation (int extra_space, uint n_requested_sizes, RequestedSize sizes)
Distributes extra_space to child sizes by bringing smaller children up to
natural size first.
-
public weak DragContext drag_begin (Widget widget, TargetList targets, DragAction actions, int button, Event event)
Initiates a drag on the source side. The function only needs to be used when the application is
starting drags itself, and is not needed when drag_source_set is used.
-
public bool drag_check_threshold (Widget widget, int start_x, int start_y, int current_x, int current_y)
Checks to see if a mouse drag starting at (@start_x, start_y) and ending at (@current_x,
current_y) has passed the GTK+ drag threshold, and thus should trigger the beginning of a drag-and-drop operation.
-
public void drag_dest_add_image_targets (Widget widget)
-
public void drag_dest_add_text_targets (Widget widget)
Add the text targets supported by GtkSelection to the target list of the drag
destination. The targets are added with info = 0. If you need another value, use
add_text_targets and
drag_dest_set_target_list.
-
public void drag_dest_add_uri_targets (Widget widget)
Add the URI targets supported by GtkSelection to the target list of the drag destination.
The targets are added with info = 0. If you need another value, use
add_uri_targets and
drag_dest_set_target_list.
-
public Atom drag_dest_find_target (Widget widget, DragContext context, TargetList target_list)
Looks for a match between the supported targets of context and the dest_target_list
, returning the first matching target, otherwise returning NONE.
dest_target_list should usually be the return value from
drag_dest_get_target_list, but some widgets may have different valid targets for different parts of the widget; in that case,
they will have to implement a drag_motion handler that passes the correct target list to this function.
-
public weak TargetList drag_dest_get_target_list (Widget widget)
Returns the list of targets this widget can accept from drag-and-drop.
-
public bool drag_dest_get_track_motion (Widget widget)
Returns whether the widget has been configured to always emit
drag_motion signals.
-
public void drag_dest_set (Widget widget, DestDefaults flags, TargetEntry[] targets, DragAction actions)
Sets a widget as a potential drop destination, and adds default behaviors.
-
public void drag_dest_set_proxy (Widget widget, Window proxy_window, DragProtocol protocol, bool use_coordinates)
Sets this widget as a proxy for drops to another window.
-
public void drag_dest_set_target_list (Widget widget, TargetList target_list)
Sets the target types that this widget can accept from drag-and-drop. The widget must first be made
into a drag destination with drag_dest_set.
-
public void drag_dest_set_track_motion (Widget widget, bool track_motion)
-
public void drag_dest_unset (Widget widget)
Clears information about a drop destination set with
drag_dest_set. The widget will no longer receive notification of drags.
-
public void drag_finish (DragContext context, bool success, bool del, uint32 time_)
Informs the drag source that the drop is finished, and that the data of the drag will no longer be
required.
-
public void drag_get_data (Widget widget, DragContext context, Atom target, uint32 time_)
Gets the data associated with a drag. When the data is received or the retrieval fails, GTK+ will emit
a drag_data_received signal. Failure of the retrieval is indicated
by the length field of the selection_data signal parameter being negative. However, when
drag_get_data is called implicitely because the
DROP was set, then the widget will not receive notification of failed
drops.
-
public weak Widget drag_get_source_widget (DragContext context)
Determines the source widget for a drag.
-
public void drag_highlight (Widget widget)
Draws a highlight around a widget. This will attach handlers to
draw, so the highlight will continue to be displayed until
drag_unhighlight is called.
-
public void drag_set_icon_default (DragContext context)
Sets the icon for a particular drag to the default icon.
-
public void drag_set_icon_gicon (DragContext context, Icon icon, int hot_x, int hot_y)
Sets the icon for a given drag from the given icon. See the documentation for
drag_set_icon_name for more details about using icons in drag and drop.
-
public void drag_set_icon_name (DragContext context, string icon_name, int hot_x, int hot_y)
Sets the icon for a given drag from a named themed icon. See the docs for
IconTheme for more details. Note that the size of the icon depends on the icon theme
(the icon is loaded at the symbolic size DND), thus hot_x and
hot_y have to be used with care.
-
public void drag_set_icon_pixbuf (DragContext context, Pixbuf pixbuf, int hot_x, int hot_y)
Sets pixbuf as the icon for a given drag.
-
public void drag_set_icon_stock (DragContext context, string stock_id, int hot_x, int hot_y)
Sets the icon for a given drag from a stock ID.
-
public void drag_set_icon_surface (DragContext context, Surface surface)
Sets surface as the icon for a given drag. GTK+ retains references for the arguments, and
will release them when they are no longer needed.
-
public void drag_set_icon_widget (DragContext context, Widget widget, int hot_x, int hot_y)
Changes the icon for a widget to a given widget. GTK+ will not destroy the icon, so if you don't want
it to persist, you should connect to the "drag-end" signal and destroy it yourself.
-
public void drag_source_add_image_targets (Widget widget)
-
public void drag_source_add_text_targets (Widget widget)
-
public void drag_source_add_uri_targets (Widget widget)
-
public weak TargetList drag_source_get_target_list (Widget widget)
Gets the list of targets this widget can provide for drag-and-drop.
-
public void drag_source_set (Widget widget, ModifierType start_button_mask, TargetEntry[] targets, DragAction actions)
Sets up a widget so that GTK+ will start a drag operation when the user clicks and drags on the
widget. The widget must have a window.
-
public void drag_source_set_icon_gicon (Widget widget, Icon icon)
Sets the icon that will be used for drags from a particular source to icon. See the docs
for IconTheme for more details.
-
public void drag_source_set_icon_name (Widget widget, string icon_name)
Sets the icon that will be used for drags from a particular source to a themed icon. See the docs for
IconTheme for more details.
-
public void drag_source_set_icon_pixbuf (Widget widget, Pixbuf pixbuf)
Sets the icon that will be used for drags from a particular widget from a
Pixbuf. GTK+ retains a reference for pixbuf and will
release it when it is no longer needed.
-
public void drag_source_set_icon_stock (Widget widget, string stock_id)
Sets the icon that will be used for drags from a particular source to a stock icon.
-
public void drag_source_set_target_list (Widget widget, TargetList target_list)
Changes the target types that this widget offers for drag-and-drop. The widget must first be made into
a drag source with drag_source_set.
-
public void drag_source_unset (Widget widget)
-
public void drag_unhighlight (Widget widget)
-
public void draw_insertion_cursor (Widget widget, Context cr, Rectangle location, bool is_primary, TextDirection direction, bool draw_arrow)
Draws a text caret on cr at location. This is not a style function but
merely a convenience function for drawing the standard cursor shape.
-
public bool events_pending ()
Checks if any events are pending.
-
public uint get_binary_age ()
Returns the binary age as passed to libtool when building the GTK+ library the process is
running against. If libtool means nothing to you, don't worry about it.
-
public Event get_current_event ()
Obtains a copy of the event currently being processed by GTK+.
-
public weak Device get_current_event_device ()
If there is a current event and it has a device, return that device, otherwise return null
.
-
public bool get_current_event_state (out ModifierType state)
If there is a current event and it has a state field, place that state field in state and
return true, otherwise return false.
-
public uint32 get_current_event_time ()
If there is a current event and it has a timestamp, return that timestamp, otherwise return
CURRENT_TIME.
-
public uint get_debug_flags ()
Returns the GTK+ debug flags.
-
public unowned Language get_default_language ()
Returns the Language for the default language
currently in effect. (Note that this can change over the life of an application.) The default language is derived from the current
locale. It determines, for example, whether GTK+ uses the right-to-left or left-to-right text direction.
-
public weak Widget get_event_widget (Event event)
If event is null or the event was not associated with any widget, returns
null, otherwise returns the widget that received the event originally.
-
public uint get_interface_age ()
Returns the interface age as passed to libtool when building the GTK+ library the process
is running against. If libtool means nothing to you, don't worry about it.
-
public uint get_major_version ()
Returns the major version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 3.)
-
public uint get_micro_version ()
Returns the micro version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 5.)
-
public uint get_minor_version ()
Returns the minor version number of the GTK+ library. (e.g. in GTK+ version 3.1.5 this is 1.)
-
public OptionGroup get_option_group (bool open_default_display)
Returns a OptionGroup for the
commandline arguments recognized by GTK+ and GDK.
-
public void grab_add (Widget widget)
Makes widget the current grabbed widget.
-
public weak Widget grab_get_current ()
Queries the current grab of the default window group.
-
public void grab_remove (Widget widget)
Removes the grab from the given widget.
-
public IconSize icon_size_from_name (string name)
Looks up the icon size associated with name.
-
public unowned string icon_size_get_name (IconSize size)
Gets the canonical name of the given icon size. The returned string is statically allocated and should
not be freed.
-
public bool icon_size_lookup (IconSize size, out int width, out int height)
Obtains the pixel size of a semantic icon size, possibly modified by user preferences for the default
Settings. (See
icon_size_lookup_for_settings.) Normally size would be MENU
, BUTTON, etc. This function isn't normally needed,
render_icon_pixbuf is the usual way to get an icon for rendering,
then just look at the size of the rendered pixbuf. The rendered pixbuf may not even correspond to the width/height returned by
icon_size_lookup, because themes are free to render the pixbuf however they
like, including changing the usual size.
-
public bool icon_size_lookup_for_settings (Settings settings, IconSize size, out int width, out int height)
Obtains the pixel size of a semantic icon size, possibly modified by user preferences for a particular
Settings. Normally size would be
MENU, BUTTON, etc.
This function isn't normally needed, render_icon_pixbuf is the usual
way to get an icon for rendering, then just look at the size of the rendered pixbuf. The rendered pixbuf may not even correspond to
the width/height returned by icon_size_lookup, because themes are free to
render the pixbuf however they like, including changing the usual size.
-
public IconSize icon_size_register (string name, int width, int height)
Registers a new icon size, along the same lines as
MENU, etc. Returns the integer value for the size.
-
public void icon_size_register_alias (string alias, IconSize target)
Registers alias as another name for target. So calling
icon_size_from_name with alias as argument will return
target.
-
public void init (ref string[] argv)
Call this function before using any other GTK+ functions in your GUI applications. It will initialize
everything needed to operate the toolkit and parses some standard command line options.
-
public bool init_check (ref string[] argv)
This function does the same work as init with only a single
change: It does not terminate the program if the windowing system can't be initialized. Instead it returns false on
failure.
-
public bool init_with_args (ref string[] argv, string parameter_string, OptionEntry[] entries, string? translation_domain) throws Error
This function does the same work as init_check.
Additionally, it allows you to add your own commandline options, and it automatically generates nicely formatted --help
output. Note that your program will be terminated after writing out the help output.
-
public uint key_snooper_install (KeySnoopFunc snooper, void* func_data)
Installs a key snooper function, which will get called on all key events before delivering them
normally.
-
public void key_snooper_remove (uint snooper_handler_id)
Removes the key snooper function with the given id.
-
public void main ()
Runs the main loop until main_quit is called.
-
public void main_do_event (Event event)
-
public bool main_iteration ()
Runs a single iteration of the mainloop.
-
public bool main_iteration_do (bool blocking)
Runs a single iteration of the mainloop. If no events are available either return or block depending
on the value of blocking.
-
public uint main_level ()
Asks for the current nesting level of the main loop.
-
public void main_quit ()
Makes the innermost invocation of the main loop return when it regains control.
-
public void paint_arrow (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, ArrowType arrow_type, bool fill, int x, int y, int width, int height)
Draws an arrow in the given rectangle on cr using the given parameters. arrow_type
determines the direction of the arrow.
-
public void paint_box (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a box on cr with the given parameters.
-
public void paint_box_gap (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height, PositionType gap_side, int gap_x, int gap_width)
Draws a box in cr using the given style and state and shadow type, leaving a gap in one
side.
-
public void paint_check (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a check button indicator in the given rectangle on cr with the given parameters.
-
public void paint_diamond (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a diamond in the given rectangle on window using the given parameters.
-
public void paint_expander (Style style, Context cr, StateType state_type, Widget? widget, string? detail, int x, int y, ExpanderStyle expander_style)
Draws an expander as used in TreeView. x
and y specify the center the expander. The size of the expander is determined by the "expander-size" style property of
widget. (If widget is not specified or doesn't have an "expander-size" property, an unspecified default size will be
used, since the caller doesn't have sufficient information to position the expander, this is likely not useful.) The expander is
expander_size pixels tall in the collapsed position and expander_size pixels wide in the expanded position.
-
public void paint_extension (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height, PositionType gap_side)
Draws an extension, i.e. a notebook tab.
-
public void paint_flat_box (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a flat box on cr with the given parameters.
-
public void paint_focus (Style style, Context cr, StateType state_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a focus indicator around the given rectangle on cr using the given style.
-
public void paint_handle (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height, Orientation orientation)
-
public void paint_hline (Style style, Context cr, StateType state_type, Widget? widget, string? detail, int x1, int x2, int y)
Draws a horizontal line from (@x1, y) to (@x2, y) in cr using
the given style and state.
-
public void paint_layout (Style style, Context cr, StateType state_type, bool use_text, Widget? widget, string? detail, int x, int y, Layout layout)
Draws a layout on cr using the given parameters.
-
public void paint_option (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a radio button indicator in the given rectangle on cr with the given parameters.
-
public void paint_resize_grip (Style style, Context cr, StateType state_type, Widget? widget, string? detail, WindowEdge edge, int x, int y, int width, int height)
Draws a resize grip in the given rectangle on cr using the given parameters.
-
public void paint_shadow (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a shadow around the given rectangle in cr using the given style and state and
shadow type.
-
public void paint_shadow_gap (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height, PositionType gap_side, int gap_x, int gap_width)
Draws a shadow around the given rectangle in cr using the given style and state and
shadow type, leaving a gap in one side.
-
public void paint_slider (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height, Orientation orientation)
Draws a slider in the given rectangle on cr using the given style and orientation.
-
public void paint_spinner (Style style, Context cr, StateType state_type, Widget widget, string detail, uint step, int x, int y, int width, int height)
Draws a spinner on window using the given parameters.
-
public void paint_tab (Style style, Context cr, StateType state_type, ShadowType shadow_type, Widget? widget, string? detail, int x, int y, int width, int height)
Draws an option menu tab (i.e. the up and down pointing arrows) in the given rectangle on cr
using the given parameters.
-
public void paint_vline (Style style, Context cr, StateType state_type, Widget? widget, string? detail, int y1_, int y2_, int x)
Draws a vertical line from (@x, y1_) to (@x, y2_) in cr using
the given style and state.
-
public bool parse_args (int argc, string[] argv)
Parses command line arguments, and initializes global attributes of GTK+, but does not actually open a
connection to a display. (See open,
get_display_arg_name)
-
public Quark print_error_quark ()
-
public weak PageSetup print_run_page_setup_dialog (Window parent, PageSetup page_setup, PrintSettings settings)
Runs a page setup dialog, letting the user modify the values from page_setup. If the user
cancels the dialog, the returned PageSetup is identical to the passed in
page_setup, otherwise it contains the modifications done in the dialog.
-
public void print_run_page_setup_dialog_async (Window parent, PageSetup page_setup, PrintSettings settings, PageSetupDoneFunc done_cb, void* data)
Runs a page setup dialog, letting the user modify the values from page_setup.
-
public void propagate_event (Widget widget, Event event)
Sends an event to a widget, propagating the event to parent widgets if the event remains unhandled.
-
public void rc_add_default_file (string filename)
Adds a file to the list of files to be parsed at the end of
init.
-
public unowned string rc_find_module_in_path (string module_file)
Searches for a theme engine in the GTK+ search path. This function is not useful for applications and
should not be used.
-
public unowned string rc_find_pixmap_in_path (Settings settings, Scanner scanner, string pixmap_file)
Looks up a file in pixmap path for the specified Settings
. If the file is not found, it outputs a warning message using warning
and returns null.
-
public unowned string rc_get_default_files ()
Retrieves the current list of RC files that will be parsed at the end of
init.
-
public unowned string rc_get_im_module_file ()
Obtains the path to the IM modules file. See the documentation of the
GTK_IM_MODULE_FILE environment variable for more details.
-
public unowned string rc_get_im_module_path ()
Obtains the path in which to look for IM modules. See the documentation of the
GTK_PATH environment variable for more details about looking up modules. This function is useful solely
for utilities supplied with GTK+ and should not be used by applications under normal circumstances.
-
public unowned string rc_get_module_dir ()
Returns a directory in which GTK+ looks for theme engines. For full information about the search for
theme engines, see the docs for GTK_PATH in gtk-running.
-
public weak Style rc_get_style (Widget widget)
Finds all matching RC styles for a given widget, composites them together, and then creates a
Style representing the composite appearance. (GTK+ actually keeps a cache of previously
created styles, so a new style may not be created.)
-
public weak Style? rc_get_style_by_paths (Settings settings, string? widget_path, string? class_path, Type type)
Creates up a Style from styles defined in a RC file by
providing the raw components used in matching. This function may be useful when creating pseudo-widgets that should be themed like
widgets but don't actually have corresponding GTK+ widgets. An example of this would be items inside a GNOME canvas widget.
-
public unowned string rc_get_theme_dir ()
Returns the standard directory in which themes should be installed. (GTK+ does not actually use this
directory itself.)
-
public void rc_parse (string filename)
Parses a given resource file.
-
public uint rc_parse_color (Scanner scanner, Color color)
Parses a color in the format expected in a RC file.
-
public uint rc_parse_color_full (Scanner scanner, RcStyle style, Color color)
Parses a color in the format expected in a RC file. If style
is not null, it will be consulted to resolve references to symbolic colors.
-
public uint rc_parse_priority (Scanner scanner, PathPriorityType priority)
-
public uint rc_parse_state (Scanner scanner, StateType state)
Parses a StateType variable from the format expected in
a RC file.
-
public void rc_parse_string (string rc_string)
Parses resource information directly from a string.
-
public bool rc_reparse_all ()
If the modification time on any previously read file for the default
Settings has changed, discard all style information and then reread all previously
read RC files.
-
public bool rc_reparse_all_for_settings (Settings settings, bool force_load)
If the modification time on any previously read file for the given
Settings has changed, discard all style information and then reread all previously
read RC files.
-
public void rc_reset_styles (Settings settings)
This function recomputes the styles for all widgets that use a particular
Settings object. (There is one Settings
object per Screen, see
get_for_screen); It is useful when some global parameter has
changed that affects the appearance of all widgets, because when a widget gets a new style, it will both redraw and recompute any
cached information about its appearance. As an example, it is used when the default font size set by the operating system changes.
Note that this function doesn't affect widgets that have a style set explicitely on them with
set_style.
-
public unowned Scanner rc_scanner_new ()
-
public void rc_set_default_files (string filenames)
Sets the list of files that GTK+ will read at the end of init
.
-
public void render_activity (StyleContext context, Context cr, double x, double y, double width, double height)
Renders an activity area (Such as in Spinner or the fill
line in Range), the state ACTIVE
determines whether there is activity going on.
-
public void render_arrow (StyleContext context, Context cr, double angle, double x, double y, double size)
Renders an arrow pointing to angle.
-
public void render_background (StyleContext context, Context cr, double x, double y, double width, double height)
Renders the background of an element.
-
public void render_check (StyleContext context, Context cr, double x, double y, double width, double height)
-
public void render_expander (StyleContext context, Context cr, double x, double y, double width, double height)
Renders an expander (as used in TreeView and
Expander) in the area defined by x, y, width,
height. The state ACTIVE determines whether the expander is
collapsed or expanded.
-
public void render_extension (StyleContext context, Context cr, double x, double y, double width, double height, PositionType gap_side)
Renders a extension (as in a Notebook tab) in the
rectangle defined by x, y, width, height. The side where the extension connects
to is defined by gap_side.
-
public void render_focus (StyleContext context, Context cr, double x, double y, double width, double height)
Renders a focus indicator on the rectangle determined by x, y, width
, height.
-
public void render_frame (StyleContext context, Context cr, double x, double y, double width, double height)
Renders a frame around the rectangle defined by x, y, width,
height.
-
public void render_frame_gap (StyleContext context, Context cr, double x, double y, double width, double height, PositionType gap_side, double xy0_gap, double xy1_gap)
Renders a frame around the rectangle defined by (@x, y, width, height
), leaving a gap on one side. xy0_gap and xy1_gap will mean X coordinates for
TOP and BOTTOM
gap sides, and Y coordinates for LEFT and
RIGHT.
-
public void render_handle (StyleContext context, Context cr, double x, double y, double width, double height)
Renders a handle (as in HandleBox,
Paned and Window's resize grip), in the
rectangle determined by x, y, width, height.
-
public void render_icon (StyleContext context, Context cr, Pixbuf pixbuf, double x, double y)
Renders the icon in pixbuf at the specified x and y
coordinates.
-
public weak Pixbuf render_icon_pixbuf (StyleContext context, IconSource source, IconSize size)
Renders the icon specified by source at the given size, returning the result
in a pixbuf.
-
public void render_layout (StyleContext context, Context cr, double x, double y, Layout layout)
Renders layout on the coordinates x, y
-
public void render_line (StyleContext context, Context cr, double x0, double y0, double x1, double y1)
Renders a line from (x0, y0) to (x1, y1).
-
public void render_option (StyleContext context, Context cr, double x, double y, double width, double height)
Renders an option mark (as in a RadioButton), the
ACTIVE state will determine whether the option is on or off, and
INCONSISTENT whether it should be marked as undefined.
-
public void render_slider (StyleContext context, Context cr, double x, double y, double width, double height, Orientation orientation)
Renders a slider (as in Scale) in the rectangle defined by
x, y, width, height. orientation defines whether the slider is
vertical or horizontal.
-
public void rgb_to_hsv (double r, double g, double b, double h, double s, double v)
Converts a color from RGB space to HSV. Input values must be in the [0.0, 1.0] range; output values
will be in the same range.
-
public void selection_add_target (Widget widget, Atom selection, Atom target, uint info)
Appends a specified target to the list of supported targets for a given widget and selection.
-
public void selection_add_targets (Widget widget, Atom selection, TargetEntry[] targets, uint ntargets)
Prepends a table of targets to the list of supported targets for a given widget and selection.
-
public void selection_clear_targets (Widget widget, Atom selection)
Remove all targets registered for the given selection for the widget.
-
public bool selection_convert (Widget widget, Atom selection, Atom target, uint32 time_)
Requests the contents of a selection. When received, a "selection-received" signal will be generated.
-
public bool selection_owner_set (Widget widget, Atom selection, uint32 time_)
Claims ownership of a given selection for a particular widget, or, if widget is
null, release ownership of the selection.
-
public bool selection_owner_set_for_display (Display display, Widget widget, Atom selection, uint32 time_)
Claim ownership of a given selection for a particular widget, or, if widget is null
, release ownership of the selection.
-
public void selection_remove_all (Widget widget)
Removes all handlers and unsets ownership of all selections for a widget. Called when widget is being
destroyed. This function will not generally be called by applications.
-
public void set_debug_flags (uint flags)
Sets the GTK+ debug flags.
-
public void show_about_dialog (Window? parent, ...)
This is a convenience function for showing an application's about box. The constructed dialog is
associated with the parent window and reused for future invocations of this function.
-
public bool show_uri (Screen? screen, string uri, uint32 timestamp) throws Error
-
public void stock_add (StockItem[] items)
-
public void stock_add_static (StockItem[] items)
-
public SList<string> stock_list_ids ()
-
public void stock_set_translate_func (string domain, owned TranslateFunc func)
Sets a function to be used for translating the label of a stock item.
-
public void target_table_free (TargetEntry[] targets)
-
public TargetEntry[] target_table_new_from_list (TargetList list)
This function creates an TargetEntry array that
contains the same targets as the passed list. The returned table is newly allocated and should be freed using
target_table_free when no longer needed.
-
public bool targets_include_image (Atom[] targets, bool writable)
Determines if any of the targets in targets can be used to provide a
Pixbuf.
-
public bool targets_include_rich_text (Atom[] targets, TextBuffer buffer)
Determines if any of the targets in targets can be used to provide rich text.
-
public bool targets_include_text (Atom[] targets)
Determines if any of the targets in targets can be used to provide text.
-
public bool targets_include_uri (Atom[] targets)
Determines if any of the targets in targets can be used to provide an uri list.
-
public weak Widget test_create_simple_window (string window_title, string dialog_text)
Create a simple window with window title window_title and text contents dialog_text
. The window will quit any running main-loop when destroyed, and it will
automatically be destroyed upon test function teardown.
-
public weak Widget test_create_widget (Type widget_type, ...)
This function wraps new for
widget types. It'll automatically show all created non window widgets, also
ref_sink them (to keep them alive across a running test) and
set them up for destruction during the next test teardown phase.
-
public weak Widget test_display_button_window (string window_title, string dialog_text)
Create a window with window title window_title, text contents dialog_text,
and a number of buttons, according to the paired argument list given as @... parameters. Each button is created with a label
and a ::clicked signal handler that incremrents the integer stored in nump. The window will be
automatically shown with show_now after creation, so when this function
returns it has already been mapped, resized and positioned on screen. The window will quit any running
main-loop when destroyed, and it will automatically be destroyed upon test function
teardown.
-
public weak Widget test_find_label (Widget widget, string label_pattern)
This function will search widget and all its descendants for a GtkLabel widget with a
text string matching label_pattern. The label_pattern may contain asterisks '*' and question marks '?' as
placeholders, match is used for the matching. Note that locales
other than "C" tend to alter (translate" label strings, so this function is genrally only useful in test programs with predetermined
locales, see test_init for more details.
-
public weak Widget test_find_sibling (Widget base_widget, Type widget_type)
This function will search siblings of base_widget and siblings of its ancestors for all
widgets matching widget_type. Of the matching widgets, the one that is geometrically closest to base_widget
will be returned. The general purpose of this function is to find the most likely "action" widget, relative to another
labeling widget. Such as finding a button or text entry widget, given its corresponding label widget.
-
public weak Widget test_find_widget (Widget widget, string label_pattern, Type widget_type)
This function will search the descendants of widget for a widget of type
widget_type that has a label matching label_pattern next to it. This is most useful for automated GUI testing,
e.g. to find the "OK" button in a dialog and synthesize clicks on it. However see
test_find_label, test_find_sibling and
test_widget_click for possible caveats involving the search of such widgets
and synthesizing widget events.
-
public void test_init (int argcp, out string argvp)
This function is used to initialize a GTK+ test program.
-
public weak Type[] test_list_all_types (uint n_types)
-
public void test_register_all_types ()
Force registration of all core Gtk+ and Gdk object types. This allowes to refer to any of those object
types via from_name after calling this function.
-
public double test_slider_get_value (Widget widget)
Retrive the literal adjustment value for GtkRange based widgets and spin buttons. Note that the value
returned by this function is anything between the lower and upper bounds of the adjustment belonging to widget, and is
not a percentage as passed in to test_slider_set_perc.
-
public void test_slider_set_perc (Widget widget, double percentage)
This function will adjust the slider position of all GtkRange based widgets, such as scrollbars or
scales, it'll also adjust spin buttons. The adjustment value of these widgets is set to a value between the lower and upper limits,
according to the percentage argument.
-
public bool test_spin_button_click (SpinButton spinner, uint button, bool upwards)
This function will generate a button click in the upwards or downwards spin button arrow
areas, usually leading to an increase or decrease of spin button's value.
-
public unowned string test_text_get (Widget widget)
Retrive the text string of widget if it is a GtkLabel, GtkEditable (entry and text
widgets) or GtkTextView.
-
public void test_text_set (Widget widget, string str)
Set the text string of widget to string if it is a GtkLabel, GtkEditable
(entry and text widgets) or GtkTextView.
-
public bool test_widget_click (Widget widget, uint button, ModifierType modifiers)
This function will generate a button click (button press and button release event) in the
middle of the first GdkWindow found that belongs to widget. For GTK_NO_WINDOW widgets like GtkButton, this
will often be an input-only event window. For other widgets, this is usually widget->window. Certain caveats should be considered
when using this function, in particular because the mouse pointer is warped to the button click location, see
test_simulate_button for details.
-
public bool test_widget_send_key (Widget widget, uint keyval, ModifierType modifiers)
This function will generate keyboard press and release events in the middle of the first GdkWindow
found that belongs to widget. For GTK_NO_WINDOW widgets like GtkButton, this will often be an input-only
event window. For other widgets, this is usually widget->window. Certain caveats should be considered when using this function,
in particular because the mouse pointer is warped to the key press location, see
test_simulate_key for details.
-
public bool tree_get_row_drag_data (SelectionData selection_data, out TreeModel tree_model, out TreePath path)
Obtains a tree_model and path from selection data of target type
GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler. This function can only be used if
selection_data originates from the same process that's calling this function, because a pointer to the tree model is being
passed around. If you aren't in the same process, then you'll get memory corruption. In the
TreeDragDest drag_data_received handler, you can assume that selection data of
type GTK_TREE_MODEL_ROW is in from the current process. The returned path must be freed with gtk_tree_path_free
.
-
public bool tree_set_row_drag_data (SelectionData selection_data, TreeModel tree_model, TreePath path)
Sets selection data of target type GTK_TREE_MODEL_ROW. Normally used in a drag_data_get
handler.