-
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 uint 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 GDK_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). The parser is fairly
liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>". Key names
are parsed using keyval_from_name. For character keys the name is
not the symbol, but the lowercase name, e.g. one would use "<Ctrl>minus" instead of "<Ctrl>-".
-
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 GDK_a keyval plus CONTROL_MASK
is valid - this is a "Ctrl+a" accelerator. But, you can't, for instance, use the GDK_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 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 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 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)
and the dest can accept, or NONE
-
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)
-
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)
Tells the widget to emit ::drag-motion and ::drag-leave events regardless of
the targets and the MOTION flag.
-
public void drag_dest_unset (Widget widget)
-
public void drag_finish (DragContext context, bool success, bool del, uint32 time_)
-
public void drag_get_data (Widget widget, DragContext context, Atom target, uint32 time_)
-
public weak Widget drag_get_source_widget (DragContext context)
Determines the source widget for a drag.
-
public void drag_highlight (Widget widget)
-
public void drag_set_icon_default (DragContext context)
Sets the icon for a particular drag to the default icon.
-
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_pixmap (DragContext context, Colormap colormap, Pixmap pixmap, Bitmap mask, int hot_x, int hot_y)
Sets pixmap as the icon for a given drag. GTK+ retains references for the arguments, and
will release them when they are no longer needed. In general,
drag_set_icon_pixbuf will be more convenient to use.
-
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_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 (Widget widget, Colormap colormap, Pixmap pixmap, Bitmap mask)
Sets the icon that will be used for drags from a particular widget from a pixmap/mask. GTK+ retains
references for the arguments, and will release them when they are no longer needed. Use
drag_source_set_icon_pixbuf instead.
-
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, Drawable drawable, Rectangle area, Rectangle location, bool is_primary, TextDirection direction, bool draw_arrow)
Draws a text caret on drawable at location. This is not a style function but
merely a convenience function for drawing the standard cursor shape.
-
public bool events_pending ()
-
public weak GC gc_get (int depth, Colormap colormap, GCValues values, GCValuesMask values_mask)
-
public void gc_release (GC gc)
-
public Event get_current_event ()
Obtains a copy of the event currently being processed by GTK+. For example, if you get a "clicked"
signal from Button, the current event will be the
EventButton that triggered the "clicked" signal. The returned event
must be freed with gdk_event_free. If there is no current event, the function returns 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 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 OptionGroup get_option_group (bool open_default_display)
Returns a OptionGroup for the
commandline arguments recognized by GTK+ and GDK. You should add this group to your
OptionContext with
add_group, if you are using
parse to parse your commandline arguments.
-
public void grab_add (Widget widget)
-
public weak Widget grab_get_current ()
Queries the current grab of the default window group.
-
public void grab_remove (Widget 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 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 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 Type identifier_get_type ()
-
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 void init_add (Function function)
-
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 GUI 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)
-
public void key_snooper_remove (uint snooper_handler_id)
-
public void main ()
-
public void main_do_event (Event event)
-
public bool main_iteration ()
-
public bool main_iteration_do (bool blocking)
-
public uint main_level ()
-
public void main_quit ()
-
public void paint_arrow (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, 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 window using the given parameters.
arrow_type determines the direction of the arrow.
-
public void paint_box (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a box on window with the given parameters.
-
public void paint_box_gap (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, 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 window using the given style and state and shadow type, leaving a gap in
one side.
-
public void paint_check (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a check button indicator in the given rectangle on window with the given
parameters.
-
public void paint_diamond (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, 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, Window window, StateType state_type, Rectangle? area, 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, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, 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, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a flat box on window with the given parameters.
-
public void paint_focus (Style style, Window window, StateType state_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a focus indicator around the given rectangle on window using the given style.
-
public void paint_handle (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height, Orientation orientation)
-
public void paint_hline (Style style, Window window, StateType state_type, Rectangle? area, Widget? widget, string? detail, int x1, int x2, int y)
Draws a horizontal line from (@x1, y) to (@x2, y) in window
using the given style and state.
-
public void paint_layout (Style style, Window window, StateType state_type, bool use_text, Rectangle? area, Widget? widget, string? detail, int x, int y, Layout layout)
Draws a layout on window using the given parameters.
-
public void paint_option (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a radio button indicator in the given rectangle on window with the given
parameters.
-
public void paint_polygon (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, Point[] points, bool fill)
Draws a polygon on window with the given parameters.
-
public void paint_resize_grip (Style style, Window window, StateType state_type, Rectangle? area, Widget? widget, string? detail, WindowEdge edge, int x, int y, int width, int height)
Draws a resize grip in the given rectangle on window using the given parameters.
-
public void paint_shadow (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height)
Draws a shadow around the given rectangle in window using the given style and state and
shadow type.
-
public void paint_shadow_gap (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, 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 window using the given style and state and
shadow type, leaving a gap in one side.
-
public void paint_slider (Style style, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, Widget? widget, string? detail, int x, int y, int width, int height, Orientation orientation)
Draws a slider in the given rectangle on window using the given style and orientation.
-
public void paint_spinner (Style style, Window window, StateType state_type, Rectangle area, 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, Window window, StateType state_type, ShadowType shadow_type, Rectangle? area, 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 window
using the given parameters.
-
public void paint_vline (Style style, Window window, StateType state_type, Rectangle? area, Widget? widget, string? detail, int y1_, int y2_, int x)
Draws a vertical line from (@x, y1_) to (@x, y2_) in window
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.
Events received by GTK+ from GDK normally begin in main_do_event. Depending on
the type of event, existence of modal dialogs, grabs, etc., the event may be propagated; if so, this function is used.
propagate_event calls gtk_widget_event on each widget it decides
to send the event to. So gtk_widget_event is the lowest-level function; it simply emits the "event" and possibly an
event-specific signal on a widget. propagate_event is a bit higher-level, and
main_do_event is the highest level.
-
public uint quit_add (uint main_level, Function function)
-
public void quit_add_destroy (uint main_level, Object object)
-
public void quit_remove (uint quit_handler_id)
-
public void quit_remove_by_data (void* data)
-
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 ()
-
public void rc_parse (string filename)
-
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)
-
public void rc_parse_string (string rc_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 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 bool selection_clear (Widget widget, EventSelection event)
-
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 unowned string set_locale ()
Initializes internationalization support for GTK+. init
automatically does this, so there is typically no point in calling this function.
-
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 it's 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
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 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.