-
public void add_client_message_filter (Atom message_type, FilterFunc func)
-
public void add_option_entries_libgtk_only (OptionGroup group)
Appends gdk option entries to the passed in option group. This is not public API and must not be used
by applications.
-
public void beep ()
Emits a short beep on the default display.
-
public Context cairo_create (Drawable drawable)
Creates a Cairo context for drawing to drawable.
-
public void cairo_rectangle (Context cr, Rectangle rectangle)
Adds the given rectangle to the current path of cr.
-
public void cairo_region (Context cr, Region region)
Adds the given region to the current path of cr.
-
public void cairo_reset_clip (Context cr, Drawable drawable)
Resets the clip region for a Cairo context created by
cairo_create.
-
public void cairo_set_source_color (Context cr, Color color)
Sets the specified Color as the source color of cr
.
-
public void cairo_set_source_pixbuf (Context cr, Pixbuf pixbuf, double pixbuf_x, double pixbuf_y)
Sets the given pixbuf as the source pattern for the Cairo context. The pattern has an extend mode of
NONE and is aligned so that the origin of pixbuf is
pixbuf_x, pixbuf_y
-
public void cairo_set_source_pixmap (Context cr, Pixmap pixmap, double pixmap_x, double pixmap_y)
Sets the given pixmap as the source pattern for the Cairo context. The pattern has an extend mode of
NONE and is aligned so that the origin of pixmap is
pixmap_x, pixmap_y
-
public int colors_alloc (Colormap colormap, bool contiguous, ulong planes, int nplanes, ulong pixels, int npixels)
Allocates colors from a colormap. This function is obsolete. See
alloc_colors. For full documentation of the fields, see the Xlib
documentation for XAllocColorCells.
-
public void colors_free (Colormap colormap, ulong pixels, int npixels, ulong planes)
-
public unowned List<Device> devices_list ()
Returns the list of available input devices for the default display. The list is statically allocated
and should not be freed.
-
public void drag_abort (DragContext context, uint32 time_)
Aborts a drag without dropping.
-
public weak DragContext drag_begin (Window window, List<Atom> targets)
Starts a drag and creates a new drag context for it.
-
public void drag_drop (DragContext context, uint32 time_)
Drops on the current destination.
-
public bool drag_drop_succeeded (DragContext context)
Returns whether the dropped data has been successfully transferred. This function is intended to be
used while handling a DROP_FINISHED event, its return value is
meaningless at other times.
-
public void drag_find_window (DragContext context, Window drag_window, int x_root, int y_root, out Window dest_window, DragProtocol protocol)
Finds the destination window and DND protocol to use at the given pointer position.
-
public void drag_find_window_for_screen (DragContext context, Window drag_window, Screen screen, int x_root, int y_root, out Window dest_window, DragProtocol protocol)
Finds the destination window and DND protocol to use at the given pointer position.
-
public NativeWindow drag_get_protocol (NativeWindow xid, DragProtocol protocol)
Finds out the DND protocol supported by a window.
-
public NativeWindow drag_get_protocol_for_display (Display display, NativeWindow xid, DragProtocol protocol)
Finds out the DND protocol supported by a window.
-
public Atom drag_get_selection (DragContext context)
Returns the selection atom for the current source window.
-
public bool drag_motion (DragContext context, Window dest_window, DragProtocol protocol, int x_root, int y_root, DragAction suggested_action, DragAction possible_actions, uint32 time_)
Updates the drag context when the pointer moves or the set of actions changes.
-
public void drag_status (DragContext context, DragAction action, uint32 time_)
Selects one of the actions offered by the drag source.
-
public void draw_arc (Drawable drawable, GC gc, bool filled, int x, int y, int width, int height, int angle1, int angle2)
Draws an arc or a filled 'pie slice'. The arc is defined by the bounding rectangle of the entire
ellipse, and the start and end angles of the part of the ellipse to be drawn.
-
public void draw_drawable (Drawable drawable, GC gc, Drawable src, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Copies the width x height region of src at coordinates (@xsrc,
ysrc) to coordinates (@xdest, ydest) in drawable. width and/or height
may be given as -1, in which case the entire src drawable will be copied.
-
public void draw_glyphs (Drawable drawable, GC gc, Font font, int x, int y, GlyphString glyphs)
This is a low-level function; 99% of text rendering should be done using
draw_layout instead.
-
public void draw_glyphs_transformed (Drawable drawable, GC gc, Matrix matrix, Font font, int x, int y, GlyphString glyphs)
Renders a GlyphString onto a drawable,
possibly transforming the layed-out coordinates through a transformation matrix. Note that the transformation matrix for font
is not changed, so to produce correct rendering results, the font must have been loaded using a
Context with an identical transformation matrix to that passed in to this
function.
-
public void draw_gray_image (Drawable drawable, GC gc, int x, int y, int width, int height, RgbDither dith, uchar[] buf, int rowstride)
-
public void draw_image (Drawable drawable, GC gc, Image image, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
Draws a Image onto a drawable. The depth of the
Image must match the depth of the Drawable.
-
public void draw_indexed_image (Drawable drawable, GC gc, int x, int y, int width, int height, RgbDither dith, uchar[] buf, int rowstride, RgbCmap cmap)
-
public void draw_layout (Drawable drawable, GC gc, int x, int y, Layout layout)
Render a Layout onto a GDK drawable
-
public void draw_layout_line (Drawable drawable, GC gc, int x, int y, LayoutLine line)
-
public void draw_layout_line_with_colors (Drawable drawable, GC gc, int x, int y, LayoutLine line, Color foreground, Color background)
Render a LayoutLine onto a
Drawable, overriding the layout's normal colors with foreground and/or
background. foreground and background need not be allocated.
-
public void draw_layout_with_colors (Drawable drawable, GC gc, int x, int y, Layout layout, Color foreground, Color background)
Render a Layout onto a
Drawable, overriding the layout's normal colors with foreground and/or
background. foreground and background need not be allocated.
-
public void draw_line (Drawable drawable, GC gc, int x1_, int y1_, int x2_, int y2_)
Draws a line, using the foreground color and other attributes of the
GC.
-
public void draw_lines (Drawable drawable, GC gc, Point[] points)
Draws a series of lines connecting the given points. The way in which joins between lines are draw is
determined by the CapStyle value in the GC.
This can be set with set_line_attributes.
-
public void draw_pixbuf (Drawable drawable, GC gc, Pixbuf pixbuf, int src_x, int src_y, int dest_x, int dest_y, int width, int height, RgbDither dither, int x_dither, int y_dither)
Renders a rectangular portion of a pixbuf to a drawable. The destination drawable must have a
colormap. All windows have a colormap, however, pixmaps only have colormap by default if they were created with a non-%NULL window
argument. Otherwise a colormap must be set on them with set_colormap
.
-
public void draw_point (Drawable drawable, GC gc, int x, int y)
Draws a point, using the foreground color and other attributes of the
GC.
-
public void draw_points (Drawable drawable, GC gc, Point[] points)
Draws a number of points, using the foreground color and other attributes of the
GC.
-
public void draw_polygon (Drawable drawable, GC gc, bool filled, Point[] points)
Draws an outlined or filled polygon.
-
public void draw_rectangle (Drawable drawable, GC gc, bool filled, int x, int y, int width, int height)
Draws a rectangular outline or filled rectangle, using the foreground color and other attributes of
the GC.
-
public void draw_rgb_32_image (Drawable drawable, GC gc, int x, int y, int width, int height, RgbDither dith, uchar[] buf, int rowstride)
-
public void draw_rgb_32_image_dithalign (Drawable drawable, GC gc, int x, int y, int width, int height, RgbDither dith, uchar[] buf, int rowstride, int xdith, int ydith)
-
public void draw_rgb_image (Drawable drawable, GC gc, int x, int y, int width, int height, RgbDither dith, uchar[] rgb_buf, int rowstride)
-
public void draw_rgb_image_dithalign (Drawable drawable, GC gc, int x, int y, int width, int height, RgbDither dith, uchar[] rgb_buf, int rowstride, int xdith, int ydith)
-
public void draw_segments (Drawable drawable, GC gc, Segment[] segs)
Draws a number of unconnected lines.
-
public void draw_text (Drawable drawable, Font font, GC gc, int x, int y, string text, int text_length)
Draws a number of characters in the given font or fontset.
-
public void draw_text_wc (Drawable drawable, Font font, GC gc, int x, int y, WChar text, int text_length)
Draws a number of wide characters using the given font of fontset. If the font is a 1-byte font, the
string is converted into 1-byte characters (discarding the high bytes) before output.
-
public void draw_trapezoids (Drawable drawable, GC gc, Trapezoid[] trapezoids)
Draws a set of anti-aliased trapezoids. The trapezoids are combined using saturation addition, then
drawn over the background as a set. This is low level functionality used internally to implement rotated underlines and backgrouds
when rendering a PangoLayout and is likely not useful for applications.
-
public void drop_finish (DragContext context, bool success, uint32 time_)
Ends the drag operation after a drop.
-
public void drop_reply (DragContext context, bool ok, uint32 time_)
Accepts or rejects a drop.
-
public int error_trap_pop ()
-
public void error_trap_push ()
-
public bool events_pending ()
-
public void flush ()
-
public weak Font fontset_load_for_display (Display display, string fontset_name)
-
public void free_compound_text (uchar[] ctext)
-
public void free_text_list (string list)
-
public weak Window get_default_root_window ()
Obtains the root window (parent all other windows are inside) for the default display and screen.
-
public unowned string get_display ()
-
public unowned string get_display_arg_name ()
Gets the display name specified in the command line arguments passed to
init or parse_args, if any.
-
public unowned string get_program_class ()
-
public bool get_show_events ()
Gets whether event debugging output is enabled.
-
public void init (ref string[] argv)
-
public bool init_check (ref string[] argv)
Initialize the library for use.
-
public void input_set_extension_events (Window window, int mask, ExtensionMode mode)
-
public GrabStatus keyboard_grab (Window window, bool owner_events, uint32 time_)
-
public void keyboard_ungrab (uint32 time_)
Ungrabs the keyboard on the default display, if it is grabbed by this application.
-
public void keyval_convert_case (uint symbol, uint lower, uint upper)
Obtains the upper- and lower-case versions of the keyval symbol. Examples of keyvals are
GDK_a, GDK_Enter, GDK_F1, etc.
-
public uint keyval_from_name (string keyval_name)
Converts a key name to a key value.
-
public bool keyval_is_lower (uint keyval)
-
public bool keyval_is_upper (uint keyval)
-
public unowned string keyval_name (uint keyval)
Converts a key value into a symbolic name.
-
public uint keyval_to_lower (uint keyval)
-
public uint32 keyval_to_unicode (uint keyval)
Convert from a GDK key symbol to the corresponding ISO10646 (Unicode) character.
-
public uint keyval_to_upper (uint keyval)
-
public List<weak Visual> list_visuals ()
Lists the available visuals for the default screen. (See
list_visuals) A visual describes a hardware image data format. For
example, a visual might support 24-bit color, or 8-bit color, and might expect pixels to be in a certain format.
-
public void notify_startup_complete ()
Indicates to the GUI environment that the application has finished loading. If the applications opens
windows, this function is normally called after opening the application's initial set of windows.
-
public void notify_startup_complete_with_id (string startup_id)
Indicates to the GUI environment that the application has finished loading, using a given identifier.
-
public weak Window? offscreen_window_get_embedder (Window window)
Gets the window that window is embedded in.
-
public weak Pixmap? offscreen_window_get_pixmap (Window window)
Gets the offscreen pixmap that an offscreen window renders into. If you need to keep this around over
window resizes, you need to add a reference to it.
-
public void offscreen_window_set_embedder (Window window, Window embedder)
Sets window to be embedded in embedder.
-
public weak Context pango_context_get ()
Creates a Context for the default GDK screen.
-
public weak Context pango_context_get_for_screen (Screen screen)
-
public unowned Region pango_layout_get_clip_region (Layout layout, int x_origin, int y_origin, int index_ranges, int n_ranges)
Obtains a clip region which contains the areas where the given ranges of text would be drawn.
x_origin and y_origin are the same position you would pass to
draw_layout_line. index_ranges should contain ranges of bytes in
the layout's text.
-
public unowned Region pango_layout_line_get_clip_region (LayoutLine line, int x_origin, int y_origin, int index_ranges, int n_ranges)
Obtains a clip region which contains the areas where the given ranges of text would be drawn.
x_origin and y_origin are the same position you would pass to
draw_layout_line. index_ranges should contain ranges of bytes in
the layout's text. The clip region will include space to the left or right of the line (to the layout bounding box) if you have
indexes above or below the indexes contained inside the line. This is to draw the selection all the way to the side of the layout.
However, the clip region is in line coordinates, not layout coordinates.
-
public void parse_args (int argc, string argv)
Parse command line arguments, and store for future use by calls to
open.
-
public weak Pixbuf pixbuf_get_from_drawable (Pixbuf? dest, Drawable src, Colormap? cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
Transfers image data from a Drawable and converts it to
an RGB(A) representation inside a Pixbuf. In other words, copies image
data from a server-side drawable to a client-side RGB(A) buffer. This allows you to efficiently read individual pixels on the client
side.
-
public weak Pixbuf pixbuf_get_from_image (Pixbuf? dest, Image src, Colormap? cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
-
public void pixbuf_render_pixmap_and_mask (Pixbuf pixbuf, out Pixmap pixmap_return, out Bitmap mask_return, int alpha_threshold)
Creates a pixmap and a mask bitmap which are returned in the pixmap_return and
mask_return arguments, respectively, and renders a pixbuf and its corresponding thresholded alpha mask to them. This is
merely a convenience function; applications that need to render pixbufs with dither offsets or to given drawables should use
draw_pixbuf and
pixbuf_render_threshold_alpha.
-
public void pixbuf_render_pixmap_and_mask_for_colormap (Pixbuf pixbuf, Colormap colormap, out Pixmap pixmap_return, out Bitmap mask_return, int alpha_threshold)
Creates a pixmap and a mask bitmap which are returned in the pixmap_return and
mask_return arguments, respectively, and renders a pixbuf and its corresponding tresholded alpha mask to them. This is
merely a convenience function; applications that need to render pixbufs with dither offsets or to given drawables should use
draw_pixbuf, and
pixbuf_render_threshold_alpha.
-
public void pixbuf_render_threshold_alpha (Pixbuf pixbuf, Bitmap bitmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_threshold)
Takes the opacity values in a rectangular portion of a pixbuf and thresholds them to produce a
bi-level alpha mask that can be used as a clipping mask for a drawable.
-
public GrabStatus pointer_grab (Window window, bool owner_events, EventMask event_mask, Window? confine_to, Cursor? cursor, uint32 time_)
-
public bool pointer_grab_info_libgtk_only (Display display, out Window grab_window, bool owner_events)
Determines information about the current pointer grab. This is not public API and must not be used by
applications.
-
public bool pointer_is_grabbed ()
Returns true if the pointer on the default display is currently grabbed by this
application.
-
public void pointer_ungrab (uint32 time_)
Ungrabs the pointer on the default display, if it is grabbed by this application.
-
public void pre_parse_libgtk_only ()
-
public void property_change (Window window, Atom property, Atom type, int format, PropMode mode, uchar[] data, int nelements)
-
public void property_delete (Window window, Atom property)
-
public bool property_get (Window window, Atom property, Atom type, ulong offset, ulong length, int pdelete, out Atom actual_property_type, out int actual_format, out uchar[] data)
-
public void query_depths (int depths, int count)
This function returns the available bit depths for the default screen. It's equivalent to listing the
visuals (gdk_list_visuals()) and then looking at the depth field in each visual, removing duplicates.
-
public void query_visual_types (out VisualType visual_types, int count)
This function returns the available visual types for the default screen. It's equivalent to listing
the visuals (gdk_list_visuals()) and then looking at the type field in each visual, removing duplicates.
-
public bool rgb_colormap_ditherable (Colormap cmap)
-
public bool rgb_ditherable ()
-
public void rgb_find_color (Colormap colormap, ref Color color)
colormap should be the colormap for the graphics context and drawable you're using to draw. If you're drawing to a
GtkWidget, call gtk_widget_get_colormap.
-
public weak Colormap rgb_get_colormap ()
Get the preferred colormap for rendering image data. Not a very useful function; historically, GDK
could only render RGB image data to one colormap and visual, but in the current version it can render to any colormap and visual. So
there's no need to call this function.
-
public weak Visual rgb_get_visual ()
Gets a "preferred visual" chosen by GdkRGB for rendering image data on the default screen. In previous
versions of GDK, this was the only visual GdkRGB could use for rendering. In current versions, it's simply the visual GdkRGB would
have chosen as the optimal one in those previous versions. GdkRGB can now render to drawables with any visual.
-
public void rgb_set_install (bool install)
-
public void rgb_set_min_colors (int min_colors)
-
public void rgb_set_verbose (bool verbose)
-
public void selection_convert (Window requestor, Atom selection, Atom target, uint32 time_)
-
public weak Window selection_owner_get (Atom selection)
-
public weak Window selection_owner_get_for_display (Display display, Atom selection)
-
public bool selection_owner_set (Window owner, Atom selection, uint32 time_, bool send_event)
-
public bool selection_owner_set_for_display (Display display, Window owner, Atom selection, uint32 time_, bool send_event)
-
public int selection_property_get (Window requestor, uchar[] data, out Atom prop_type, int prop_format)
-
public void selection_send_notify (NativeWindow requestor, Atom selection, Atom target, Atom property, uint32 time_)
-
public void selection_send_notify_for_display (Display display, NativeWindow requestor, Atom selection, Atom target, Atom property, uint32 time_)
-
public void set_double_click_time (uint msec)
-
public unowned string set_locale ()
-
public unowned PointerHooks set_pointer_hooks (PointerHooks new_hooks)
This function allows for hooking into the operation of getting the current location of the pointer.
This is only useful for such low-level tools as an event recorder. Applications should never have any reason to use this facility.
-
public void set_program_class (string program_class)
-
public void set_show_events (bool show_events)
Sets whether a trace of received events is output. Note that GTK+ must be compiled with debugging
(that is, configured using the --enable-debug option) to use this option.
-
public void set_sm_client_id (string sm_client_id)
Sets the SM_CLIENT_ID property on the application's leader window so that the window manager
can save the application's state using the X11R6 ICCCM session management protocol.
-
public bool setting_get (string name, Value value)
Obtains a desktop-wide setting, such as the double-click time, for the default screen. See
get_setting.
-
public bool spawn_command_line_on_screen (Screen screen, string command_line) throws Error
Like
spawn_command_line_async, except the child process is spawned in such an environment that on calling
open it would be returned a
Display with screen as the default screen.
-
public bool spawn_on_screen (Screen screen, string? working_directory, string[] argv, string[]? envp, SpawnFlags flags, SpawnChildSetupFunc? child_setup, out int child_pid) throws Error
Like spawn_async, except the
child process is spawned in such an environment that on calling open it
would be returned a Display with screen as the default screen.
-
public bool spawn_on_screen_with_pipes (Screen screen, string? working_directory, string[] argv, string[] envp, SpawnFlags flags, SpawnChildSetupFunc? child_setup, out int child_pid, out int standard_input, out int standard_output, out int standard_error) throws Error
Like
spawn_async_with_pipes, except the child process is spawned in such an environment that on calling
open it would be returned a
Display with screen as the default screen.
-
public int string_to_compound_text (string str, out Atom encoding, int format, uchar[] ctext, int length)
-
public int string_to_compound_text_for_display (Display display, string str, out Atom encoding, int format, uchar[] ctext, int length)
Convert a string from the encoding of the current locale into a form suitable for storing in a window
property.
-
public void test_render_sync (Window window)
This function retrieves a pixel from window to force the windowing system to carry out
any pending rendering commands. This function is intended to be used to syncronize with rendering pipelines, to benchmark windowing
system rendering operations.
-
public bool test_simulate_button (Window window, int x, int y, uint button, ModifierType modifiers, EventType button_pressrelease)
This function is intended to be used in GTK+ test programs. It will warp the mouse pointer to the
given (@x,@y) corrdinates within window and simulate a button press or release event. Because the mouse pointer needs
to be warped to the target location, use of this function outside of test programs that run in their own virtual windowing system
(e.g. Xvfb) is not recommended.
-
public bool test_simulate_key (Window window, int x, int y, uint keyval, ModifierType modifiers, EventType key_pressrelease)
This function is intended to be used in GTK+ test programs. If (@x,@y) are > (-1,-1), it will warp
the mouse pointer to the given (@x,@y) corrdinates within window and simulate a key press or release event.
-
public int text_property_to_text_list (Atom encoding, int format, uchar[] text, int length, string list)
-
public int text_property_to_text_list_for_display (Display display, Atom encoding, int format, uchar[] text, int length, string list)
Convert a text string from the encoding as it is stored in a property into an array of strings in the
encoding of the current locale. (The elements of the array represent the nul-separated elements of the original text string.)
-
public int text_property_to_utf8_list (Atom encoding, int format, uchar[] text, int length, string list)
Convert a text property in the giving encoding to a list of UTF-8 strings.
-
public int text_property_to_utf8_list_for_display (Display display, Atom encoding, int format, uchar[] text, int length, string list)
Converts a text property in the given encoding to a list of UTF-8 strings.
-
public uint threads_add_idle (SourceFunc function)
-
public uint threads_add_idle_full (int priority, owned SourceFunc function)
Adds a function to be called whenever there are no higher priority events pending. If the function
returns false it is automatically removed from the list of event sources and will not be called again.
-
public uint threads_add_timeout (uint interval, SourceFunc function)
-
public uint threads_add_timeout_full (int priority, uint interval, owned SourceFunc function)
Sets a function to be called at regular intervals holding the GDK lock, with the given priority. The
function is called repeatedly until it returns false, at which point the timeout is automatically destroyed and the
function will not be called again. The notify function is called when the timeout is destroyed. The first call to the
function will be at the end of the first interval.
-
public uint threads_add_timeout_seconds (uint interval, SourceFunc function)
-
public uint threads_add_timeout_seconds_full (int priority, uint interval, owned SourceFunc function)
A variant of gdk_threads_add_timout_full with second-granularity. See
add_seconds_full for a discussion of why it is a good
idea to use this function if you don't need finer granularity.
-
public void threads_enter ()
-
public void threads_init ()
Initializes GDK so that it can be used from multiple threads in conjunction with
threads_enter and threads_leave
. g_thread_init must be called previous to this function.
-
public void threads_leave ()
-
public void threads_set_lock_functions (Callback enter_fn, Callback leave_fn)
Allows the application to replace the standard method that GDK uses to protect its data structures.
Normally, GDK creates a single Mutex that is locked by
threads_enter, and released by
threads_leave; using this function an application provides, instead, a function enter_fn that is called by
threads_enter and a function leave_fn that is called by
threads_leave.
-
public uint unicode_to_keyval (uint32 wc)
Convert from a ISO10646 character to a key symbol.
-
public bool utf8_to_compound_text (string str, out Atom encoding, int format, uchar[] ctext, int length)
Convert from UTF-8 to compound text.
-
public bool utf8_to_compound_text_for_display (Display display, string str, out Atom encoding, int format, uchar[] ctext, int length)
Converts from UTF-8 to compound text.
-
public unowned string utf8_to_string_target (string str)
Converts an UTF-8 string into the best possible representation as a STRING. The representation of
characters not in STRING is not specified; it may be as pseudo-escape sequences \x{ABCD}, or it may be in some other form of
approximation.