Creates a new #GdkAppLaunchContext.
a new #GdkAppLaunchContext
Sets the workspace on which applications will be launched when
using this context when running under a window manager that
supports multiple workspaces, as described in the
<ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
Window Manager Hints</ulink>.
When the workspace is not specified or @desktop is set to -1,
it is up to the window manager to pick one, typically it will
be the current workspace.
a #GdkAppLaunchContext
the number of a workspace, or -1
Sets the display on which applications will be launched when
using this context. See also gdk_app_launch_context_set_screen().
a #GdkAppLaunchContext
a #GdkDisplay
Sets the icon for applications that are launched with this
context.
Window Managers can use this information when displaying startup
notification.
See also gdk_app_launch_context_set_icon_name().
a #GdkAppLaunchContext
a #GIcon, or %NULL
Sets the icon for applications that are launched with this context.
The @icon_name will be interpreted in the same way as the Icon field
in desktop files. See also gdk_app_launch_context_set_icon().
If both @icon and @icon_name are set, the @icon_name takes priority.
If neither @icon or @icon_name is set, the icon is taken from either
the file that is passed to launched application or from the #GAppInfo
for the launched application itself.
a #GdkAppLaunchContext
an icon name, or %NULL
Sets the screen on which applications will be launched when
using this context. See also gdk_app_launch_context_set_display().
If both @screen and @display are set, the @screen takes priority.
If neither @screen or @display are set, the default screen and
display are used.
a #GdkAppLaunchContext
a #GdkScreen
Sets the timestamp of @context. The timestamp should ideally
be taken from the event that triggered the launch.
Window managers can use this information to avoid moving the
focus to the newly launched application when the user is busy
typing in another window. This is also known as 'focus stealing
prevention'.
a #GdkAppLaunchContext
a timestamp
Finds or creates an atom corresponding to a given string.
Note that this function is identical to gdk_atom_intern() except
that if a new #GdkAtom is created the string itself is used rather
than a copy. This saves memory, but can only be used if the string
will <emphasis>always</emphasis> exist. It can be used with statically
allocated strings in the main program, but not with statically
allocated memory in dynamically loaded modules, if you expect to
ever unload the module again (e.g. do not use this function in
GTK+ theme engines).
the atom corresponding to @atom_name
a static string
Makes a copy of a color structure. The result
must be freed using gdk_color_free().
a copy of @color.
a #GdkColor.
Compares two colors.
%TRUE if the two colors compare equal
a #GdkColor.
another #GdkColor.
Frees a color structure created with
gdk_color_copy().
a #GdkColor.
A hash function suitable for using for a hash
table that stores #GdkColor's.
The hash function applied to @colora
a #GdkColor.
Returns a textual specification of @color in the hexadecimal form
<literal>#rrrrggggbbbb</literal>, where <literal>r</literal>,
<literal>g</literal> and <literal>b</literal> are hex digits
representing the red, green and blue components respectively.
a newly-allocated text string
a #GdkColor
Allocates a single color from a colormap.
Use gdk_colormap_alloc_color() instead.
%TRUE if the allocation succeeded.
a #GdkColormap.
The color to allocate. On return, the
<structfield>pixel</structfield> field will be filled in.
Returns the black color for a given colormap. The resulting
value has already been allocated.
%TRUE if the allocation succeeded.
a #GdkColormap.
the location to store the color.
Changes the value of a color that has already
been allocated. If @colormap is not a private
colormap, then the color must have been allocated
using gdk_colormap_alloc_colors() with the
@writeable set to %TRUE.
%TRUE if the color was successfully changed.
a #GdkColormap.
a #GdkColor, with the color to change
in the <structfield>pixel</structfield> field,
and the new value in the remaining fields.
Parses a textual specification of a color and fill in the
<structfield>red</structfield>, <structfield>green</structfield>,
and <structfield>blue</structfield> fields of a #GdkColor
structure. The color is <emphasis>not</emphasis> allocated, you
must call gdk_colormap_alloc_color() yourself. The string can
either one of a large set of standard names. (Taken from the X11
<filename>rgb.txt</filename> file), or it can be a hex value in the
form '#rgb' '#rrggbb' '#rrrgggbbb' or
'#rrrrggggbbbb' where 'r', 'g' and 'b' are hex digits of the
red, green, and blue components of the color, respectively. (White
in the four forms is '#fff' '#ffffff' '#fffffffff' and
'#ffffffffffff')
%TRUE if the parsing succeeded.
the string specifying the color.
the #GdkColor to fill in
Returns the white color for a given colormap. The resulting
value has already allocated been allocated.
%TRUE if the allocation succeeded.
a #GdkColormap.
the location to store the color.
Creates a new colormap for the given visual.
the new #GdkColormap.
a #GdkVisual.
if %TRUE, the newly created colormap will be
a private colormap, and all colors in it will be
allocated for the applications use.
Gets the system's default colormap for the default screen. (See
gdk_colormap_get_system_for_screen ())
the default colormap.
Returns the size of the system's default colormap.
(See the description of struct #GdkColormap for an
explanation of the size of a colormap.)
the size of the system's default colormap.
Allocates a single color from a colormap.
%TRUE if the allocation succeeded.
a #GdkColormap.
the color to allocate. On return the
<structfield>pixel</structfield> field will be
filled in if allocation succeeds.
If %TRUE, the color is allocated writeable
(their values can later be changed using gdk_color_change()).
Writeable colors cannot be shared between applications.
If %TRUE, GDK will attempt to do matching against
existing colors if the color cannot be allocated as requested.
Allocates colors from a colormap.
The number of colors that were not successfully
allocated.
a #GdkColormap.
The color values to allocate. On return, the pixel
values for allocated colors will be filled in.
The number of colors in @colors.
If %TRUE, the colors are allocated writeable
(their values can later be changed using gdk_color_change()).
Writeable colors cannot be shared between applications.
If %TRUE, GDK will attempt to do matching against
existing colors if the colors cannot be allocated as requested.
An array of length @ncolors. On return, this
indicates whether the corresponding color in @colors was
successfully allocated or not.
Changes the value of the first @ncolors in a private colormap
to match the values in the <structfield>colors</structfield>
array in the colormap. This function is obsolete and
should not be used. See gdk_color_change().
a #GdkColormap.
the number of colors to change.
Frees previously allocated colors.
a #GdkColormap.
the colors to free.
the number of colors in @colors.
Gets the screen for which this colormap was created.
the screen for which this colormap was created.
a #GdkColormap
Returns the visual for which a given colormap was created.
the visual of the colormap.
a #GdkColormap.
Locates the RGB color in @colormap corresponding to the given
hardware pixel @pixel. @pixel must be a valid pixel in the
colormap; it's a programmer error to call this function with a
pixel which is not in the colormap. Hardware pixels are normally
obtained from gdk_colormap_alloc_colors(), or from a #GdkImage. (A
#GdkImage contains image data in hardware format, a #GdkPixbuf
contains image data in a canonical 24-bit RGB format.)
This function is rarely useful; it's used for example to
implement the eyedropper feature in #GtkColorSelection.
a #GdkColormap
pixel value in hardware display format
#GdkColor with red, green, blue fields initialized
Deprecated function; use g_object_ref() instead.
Use g_object_ref() instead.
the colormap
a #GdkColormap
Deprecated function; use g_object_unref() instead.
Use g_object_unref() instead.
a #GdkColormap
Creates a new cursor from the set of builtin cursors for the default display.
See gdk_cursor_new_for_display().
To make the cursor invisible, use %GDK_BLANK_CURSOR.
a new #GdkCursor
cursor to create
Creates a new cursor from the set of builtin cursors.
Some useful ones are:
<itemizedlist>
<listitem><para>
<inlinegraphic format="PNG" fileref="right_ptr.png"></inlinegraphic> #GDK_RIGHT_PTR (right-facing arrow)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="crosshair.png"></inlinegraphic> #GDK_CROSSHAIR (crosshair)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="xterm.png"></inlinegraphic> #GDK_XTERM (I-beam)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="watch.png"></inlinegraphic> #GDK_WATCH (busy)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="fleur.png"></inlinegraphic> #GDK_FLEUR (for moving objects)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="hand1.png"></inlinegraphic> #GDK_HAND1 (a right-pointing hand)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="hand2.png"></inlinegraphic> #GDK_HAND2 (a left-pointing hand)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="left_side.png"></inlinegraphic> #GDK_LEFT_SIDE (resize left side)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="right_side.png"></inlinegraphic> #GDK_RIGHT_SIDE (resize right side)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="top_left_corner.png"></inlinegraphic> #GDK_TOP_LEFT_CORNER (resize northwest corner)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="top_right_corner.png"></inlinegraphic> #GDK_TOP_RIGHT_CORNER (resize northeast corner)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="bottom_left_corner.png"></inlinegraphic> #GDK_BOTTOM_LEFT_CORNER (resize southwest corner)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="bottom_right_corner.png"></inlinegraphic> #GDK_BOTTOM_RIGHT_CORNER (resize southeast corner)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="top_side.png"></inlinegraphic> #GDK_TOP_SIDE (resize top side)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="bottom_side.png"></inlinegraphic> #GDK_BOTTOM_SIDE (resize bottom side)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="sb_h_double_arrow.png"></inlinegraphic> #GDK_SB_H_DOUBLE_ARROW (move vertical splitter)
</para></listitem>
<listitem><para>
<inlinegraphic format="PNG" fileref="sb_v_double_arrow.png"></inlinegraphic> #GDK_SB_V_DOUBLE_ARROW (move horizontal splitter)
</para></listitem>
<listitem><para>
#GDK_BLANK_CURSOR (Blank cursor). Since 2.16
</para></listitem>
</itemizedlist>
a new #GdkCursor
the #GdkDisplay for which the cursor will be created
cursor to create
Creates a new cursor by looking up @name in the current cursor
theme.
a new #GdkCursor, or %NULL if there is no cursor with
the given name
the #GdkDisplay for which the cursor will be created
the name of the cursor
Creates a new cursor from a pixbuf.
Not all GDK backends support RGBA cursors. If they are not
supported, a monochrome approximation will be displayed.
The functions gdk_display_supports_cursor_alpha() and
gdk_display_supports_cursor_color() can be used to determine
whether RGBA cursors are supported;
gdk_display_get_default_cursor_size() and
gdk_display_get_maximal_cursor_size() give information about
cursor sizes.
If @x or @y are <literal>-1</literal>, the pixbuf must have
options named "x_hot" and "y_hot", resp., containing
integer values between %0 and the width resp. height of
the pixbuf. (Since: 3.0)
On the X backend, support for RGBA cursors requires a
sufficently new version of the X Render extension.
a new #GdkCursor.
the #GdkDisplay for which the cursor will be created
the #GdkPixbuf containing the cursor image
the horizontal offset of the 'hotspot' of the cursor.
the vertical offset of the 'hotspot' of the cursor.
Creates a new cursor from a given pixmap and mask. Both the pixmap and mask
must have a depth of 1 (i.e. each pixel has only 2 values - on or off).
The standard cursor size is 16 by 16 pixels. You can create a bitmap
from inline data as in the below example.
<example><title>Creating a custom cursor</title>
<programlisting>
/<!-- -->* This data is in X bitmap format, and can be created with the 'bitmap'
utility. *<!-- -->/
#define cursor1_width 16
#define cursor1_height 16
static unsigned char cursor1_bits[] = {
0x80, 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x20,
0x82, 0x41, 0x41, 0x82, 0x41, 0x82, 0x82, 0x41, 0x04, 0x20, 0x08, 0x10,
0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01};
static unsigned char cursor1mask_bits[] = {
0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x8c, 0x31,
0xc6, 0x63, 0x63, 0xc6, 0x63, 0xc6, 0xc6, 0x63, 0x8c, 0x31, 0x18, 0x18,
0x30, 0x0c, 0x60, 0x06, 0xc0, 0x03, 0x80, 0x01};
GdkCursor *cursor;
GdkPixmap *source, *mask;
GdkColor fg = { 0, 65535, 0, 0 }; /<!-- -->* Red. *<!-- -->/
GdkColor bg = { 0, 0, 0, 65535 }; /<!-- -->* Blue. *<!-- -->/
source = gdk_bitmap_create_from_data (NULL, cursor1_bits,
cursor1_width, cursor1_height);
mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits,
cursor1_width, cursor1_height);
cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8);
g_object_unref (source);
g_object_unref (mask);
gdk_window_set_cursor (widget->window, cursor);
</programlisting>
</example>
a new #GdkCursor.
the pixmap specifying the cursor.
the pixmap specifying the mask, which must be the same size as
@source.
the foreground color, used for the bits in the source which are 1.
The color does not have to be allocated first.
the background color, used for the bits in the source which are 0.
The color does not have to be allocated first.
the horizontal offset of the 'hotspot' of the cursor.
the vertical offset of the 'hotspot' of the cursor.
Returns the cursor type for this cursor.
a #GdkCursorType
a #GdkCursor
Returns the display on which the #GdkCursor is defined.
the #GdkDisplay associated to @cursor
a #GdkCursor.
Returns a #GdkPixbuf with the image used to display the cursor.
Note that depending on the capabilities of the windowing system and
on the cursor, GDK may not be able to obtain the image data. In this
case, %NULL is returned.
a #GdkPixbuf representing @cursor, or %NULL
a #GdkCursor
Adds a reference to @cursor.
Same @cursor that was passed in
a #GdkCursor
Removes a reference from @cursor, deallocating the cursor
if no references remain.
a #GdkCursor
Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history().
an array of #GdkTimeCoord.
the length of the array.
Returns the core pointer device for the default display.
the core pointer device; this is owned by the
display and should not be freed.
Interprets an array of double as axis values for a given device,
and locates the value in the array for a given axis use.
%TRUE if the given axis use was found, otherwise %FALSE
a #GdkDevice
pointer to an array of axes
the use to look for
location to store the found value.
Returns the axis use for @index.
a #GdkAxisUse specifying how the axis is used.
a #GdkDevice.
the index of the axis.
Determines whether the pointer follows device motion.
%TRUE if the pointer follows device motion
a #GdkDevice
Obtains the motion history for a device; given a starting and
ending timestamp, return all events in the motion history for
the device in the given range of time. Some windowing systems
do not support motion history, in which case, %FALSE will
be returned. (This is not distinguishable from the case where
motion history is supported and no events were found.)
%TRUE if the windowing system supports motion history and
at least one event was found.
a #GdkDevice
the window with respect to which which the event coordinates will be reported
starting timestamp for range of events to return
ending timestamp for the range of events to return
location to store a newly-allocated array of #GdkTimeCoord, or %NULL
location to store the length of @events, or %NULL
If @index has a valid keyval, this function will
fill in @keyval and @modifiers with the keyval settings.
a #GdkDevice.
the index of the macro button to get.
return value for the keyval.
return value for modifiers.
Determines the mode of the device.
a #GdkInputSource
a #GdkDevice
Gets the number of axes of a device.
the number of axes of @device
a #GdkDevice.
Gets the number of keys of a device.
the number of keys of @device
a #GdkDevice.
Determines the name of the device.
a name
a #GdkDevice
Determines the type of the device.
a #GdkInputSource
a #GdkDevice
Gets the default #GdkDisplay. This is a convenience
function for
<literal>gdk_display_manager_get_default_display (gdk_display_manager_get ())</literal>.
a #GdkDisplay, or %NULL if there is no default
display.
Opens a display.
a #GdkDisplay, or %NULL if the display
could not be opened.
the name of the display to open
Opens the default display specified by command line arguments or
environment variables, sets it as the default display, and returns
it. gdk_parse_args must have been called first. If the default
display has previously been set, simply returns that. An internal
function that should not be used by applications.
the default display, if it could be opened,
otherwise %NULL.
Get the default #GdkScreen for @display.
the default #GdkScreen object for @display
a #GdkDisplay
Gets the number of screen managed by the @display.
number of screens.
a #GdkDisplay
Returns a screen object for one of the screens of the display.
the #GdkScreen object
a #GdkDisplay
the screen number
Emits a short beep on @display
a #GdkDisplay
Closes the connection to the windowing system for the given display,
and cleans up associated resources.
a #GdkDisplay
Flushes any requests queued for the windowing system; this happens automatically
when the main loop blocks waiting for new events, but if your application
is drawing without returning control to the main loop, you may need
to call this function explicitely. A common case where this function
needs to be called is when an application is executing drawing commands
from a thread other than the thread where the main loop is running.
This is most useful for X11. On windowing systems where requests are
handled synchronously, this function will do nothing.
a #GdkDisplay
Returns the core pointer device for the given display
the core pointer device; this is owned by the
display and should not be freed.
a #GdkDisplay
Returns the default size to use for cursors on @display.
the default cursor size.
a #GdkDisplay
Returns the default group leader window for all toplevel windows
on @display. This window is implicitly created by GDK.
See gdk_window_set_group().
The default group leader window for @display
a #GdkDisplay
Get the default #GdkScreen for @display.
the default #GdkScreen object for @display
a #GdkDisplay
Gets the next #GdkEvent to be processed for @display, fetching events from the
windowing system if necessary.
the next #GdkEvent to be processed, or %NULL if no events
are pending. The returned #GdkEvent should be freed with gdk_event_free().
a #GdkDisplay
Gets the maximal size to use for cursors on @display.
a #GdkDisplay
the return location for the maximal cursor width
the return location for the maximal cursor height
Gets the number of screen managed by the @display.
number of screens.
a #GdkDisplay
Gets the name of the display.
a string representing the display name. This string is owned
by GDK and should not be modified or freed.
a #GdkDisplay
Gets the current location of the pointer and the current modifier
mask for a given display.
a #GdkDisplay
location to store the screen that the
cursor is on, or %NULL.
location to store root window X coordinate of pointer, or %NULL.
location to store root window Y coordinate of pointer, or %NULL.
location to store current modifier mask, or %NULL
Returns a screen object for one of the screens of the display.
the #GdkScreen object
a #GdkDisplay
the screen number
Obtains the window underneath the mouse pointer, returning the location
of the pointer in that window in @win_x, @win_y for @screen. Returns %NULL
if the window under the mouse pointer is not known to GDK (for example,
belongs to another application).
the window under the mouse pointer, or %NULL
a #GdkDisplay
return location for x coordinate of the pointer location relative
to the window origin, or %NULL
return location for y coordinate of the pointer location relative
& to the window origin, or %NULL
Finds out if the display has been closed.
%TRUE if the display is closed.
a #GdkDisplay
Release any keyboard grab
a #GdkDisplay.
a timestap (e.g #GDK_CURRENT_TIME).
Returns the list of available input devices attached to @display.
The list is statically allocated and should not be freed.
a list of #GdkDevice
a #GdkDisplay
Gets a copy of the first #GdkEvent in the @display's event queue, without
removing the event from the queue. (Note that this function will
not get more events from the windowing system. It only checks the events
that have already been moved to the GDK event queue.)
a copy of the first #GdkEvent on the event queue, or %NULL
if no events are in the queue. The returned #GdkEvent should be freed with
gdk_event_free().
a #GdkDisplay
Test if the pointer is grabbed.
%TRUE if an active X pointer grab is in effect
a #GdkDisplay
Release any pointer grab.
a #GdkDisplay.
a timestap (e.g. %GDK_CURRENT_TIME).
Appends a copy of the given event onto the front of the event
queue for @display.
a #GdkDisplay
a #GdkEvent.
Request #GdkEventOwnerChange events for ownership changes
of the selection named by the given atom.
whether #GdkEventOwnerChange events will
be sent.
a #GdkDisplay
the #GdkAtom naming the selection for which
ownership change notification is requested
Sets the double click distance (two clicks within this distance
count as a double click and result in a #GDK_2BUTTON_PRESS event).
See also gdk_display_set_double_click_time().
Applications should <emphasis>not</emphasis> set this, it is a global
user-configured setting.
a #GdkDisplay
distance in pixels
Sets the double click time (two clicks within this time interval
count as a double click and result in a #GDK_2BUTTON_PRESS event).
Applications should <emphasis>not</emphasis> set this, it is a global
user-configured setting.
a #GdkDisplay
double click time in milliseconds (thousandths of a second)
This function allows for hooking into the operation
of getting the current location of the pointer on a particular
display. This is only useful for such low-level tools as an
event recorder. Applications should never have any
reason to use this facility.
This function will go away in GTK 3 for lack of use cases.
the previous pointer hook table
a #GdkDisplay
a table of pointers to functions for getting
quantities related to the current pointer position,
or %NULL to restore the default table.
Issues a request to the clipboard manager to store the
clipboard data. On X11, this is a special program that works
according to the freedesktop clipboard specification, available at
<ulink url="http://www.freedesktop.org/Standards/clipboard-manager-spec">
http://www.freedesktop.org/Standards/clipboard-manager-spec</ulink>.
a #GdkDisplay
a #GdkWindow belonging to the clipboard owner
a timestamp
an array of targets that should be saved, or %NULL
if all available targets should be saved.
length of the @targets array
Returns whether the speicifed display supports clipboard
persistance; i.e. if it's possible to store the clipboard data after an
application has quit. On X11 this checks if a clipboard daemon is
running.
%TRUE if the display supports clipboard persistance.
a #GdkDisplay
Returns %TRUE if gdk_window_set_composited() can be used
to redirect drawing on the window using compositing.
Currently this only works on X11 with XComposite and
XDamage extensions available.
%TRUE if windows may be composited.
a #GdkDisplay
Returns %TRUE if cursors can use an 8bit alpha channel
on @display. Otherwise, cursors are restricted to bilevel
alpha (i.e. a mask).
whether cursors can have alpha channels.
a #GdkDisplay
Returns %TRUE if multicolored cursors are supported
on @display. Otherwise, cursors have only a forground
and a background color.
whether cursors can have multiple colors.
a #GdkDisplay
Returns %TRUE if gdk_window_input_shape_combine_mask() can
be used to modify the input shape of windows on @display.
%TRUE if windows with modified input shape are supported
a #GdkDisplay
Returns whether #GdkEventOwnerChange events will be
sent when the owner of a selection changes.
whether #GdkEventOwnerChange events will
be sent.
a #GdkDisplay
Returns %TRUE if gdk_window_shape_combine_mask() can
be used to create shaped windows on @display.
%TRUE if shaped windows are supported
a #GdkDisplay
Flushes any requests queued for the windowing system and waits until all
requests have been handled. This is often used for making sure that the
display is synchronized with the current state of the program. Calling
gdk_display_sync() before gdk_error_trap_pop() makes sure that any errors
generated from earlier requests are handled before the error trap is
removed.
This is most useful for X11. On windowing systems where requests are
handled synchronously, this function will do nothing.
a #GdkDisplay
Warps the pointer of @display to the point @x,@y on
the screen @screen, unless the pointer is confined
to a window by a grab, in which case it will be moved
as far as allowed by the grab. Warping the pointer
creates events as if the user had moved the mouse
instantaneously to the destination.
Note that the pointer should normally be under the
control of the user. This function was added to cover
some rare use cases like keyboard navigation support
for the color picker in the #GtkColorSelectionDialog.
a #GdkDisplay
the screen of @display to warp the pointer to
the x coordinate of the destination
the y coordinate of the destination
The ::closed signal is emitted when the connection to the windowing
system for @display is closed.
%TRUE if the display was closed due to an error
number of screens.
a #GdkDisplay
the #GdkScreen object
a #GdkDisplay
the screen number
the default #GdkScreen object for @display
a #GdkDisplay
Gets the singleton #GdkDisplayManager object.
The global #GdkDisplayManager singleton; gdk_parse_pargs(),
gdk_init(), or gdk_init_check() must have been called first.
Gets the default #GdkDisplay.
a #GdkDisplay, or %NULL if there is no default
display.
a #GdkDisplayManager
List all currently open displays.
a newly allocated
#GSList of #GdkDisplay objects. Free this list with g_slist_free() when you
are done with it.
a #GdkDisplayManager
Sets @display as the default display.
a #GdkDisplayManager
a #GdkDisplay
The ::display_opened signal is emitted when a display is opened.
the opened display
Creates a new #GdkDragContext.
This function is not useful, you always
obtain drag contexts by gdk_drag_begin() or similar.
the newly created #GdkDragContext.
Determines the bitmask of actions proposed by the source if
gdk_drag_context_suggested_action() returns GDK_ACTION_ASK.
the #GdkDragAction flags
a #GdkDragContext
Returns the destination windw for the DND operation.
a #GdkWindow
a #GdkDragContext
Returns the drag protocol thats used by this context.
the drag protocol
a #GdkDragContext
Determines the action chosen by the drag destination.
a #GdkDragAction value
a #GdkDragContext
Returns the #GdkWindow where the DND operation started.
a #GdkWindow
a #GdkDragContext
Determines the suggested drag action of the context.
a #GdkDragAction value
a #GdkDragContext
Retrieves the list of targets of the context.
a #GList of targets
a #GdkDragContext
Deprecated function; use g_object_ref() instead.
Use g_object_ref() instead.
a #GdkDragContext.
Deprecated function; use g_object_unref() instead.
Use g_object_unref() instead.
a #GdkDragContext.
Computes the region of a drawable that potentially can be written
to by drawing primitives. This region will not take into account
the clip region for the GC, and may also not take into account
other factors such as if the window is obscured by other windows,
but no area outside of this region will be affected by drawing
primitives.
a #GdkRegion. This must be freed with gdk_region_destroy()
when you are done.
a #GdkDrawable
Gets the colormap for @drawable, if one is set; returns
%NULL otherwise.
the colormap, or %NULL
a #GdkDrawable
Obtains the bit depth of the drawable, that is, the number of bits
that make up a pixel in the drawable's visual. Examples are 8 bits
per pixel, 24 bits per pixel, etc.
number of bits per pixel
a #GdkDrawable
A #GdkImage stores client-side image data (pixels). In contrast,
#GdkPixmap and #GdkWindow are server-side
objects. gdk_drawable_get_image() obtains the pixels from a
server-side drawable as a client-side #GdkImage. The format of a
#GdkImage depends on the #GdkVisual of the current display, which
makes manipulating #GdkImage extremely difficult; therefore, in
most cases you should use gdk_pixbuf_get_from_drawable() instead of
this lower-level function. A #GdkPixbuf contains image data in a
canonicalized RGB format, rather than a display-dependent format.
Of course, there's a convenience vs. speed tradeoff here, so you'll
want to think about what makes sense for your application.
@x, @y, @width, and @height define the region of @drawable to
obtain as an image.
You would usually copy image data to the client side if you intend
to examine the values of individual pixels, for example to darken
an image or add a red tint. It would be prohibitively slow to
make a round-trip request to the windowing system for each pixel,
so instead you get all of them at once, modify them, then copy
them all back at once.
If the X server or other windowing system backend is on the local
machine, this function may use shared memory to avoid copying
the image data.
If the source drawable is a #GdkWindow and partially offscreen
or obscured, then the obscured portions of the returned image
will contain undefined data.
Use @drawable as the source and draw to a Cairo image
surface if you want to download contents to the client.
a #GdkImage containing the contents of @drawable
a #GdkDrawable
x coordinate on @drawable
y coordinate on @drawable
width of region to get
height or region to get
Gets the #GdkScreen associated with a #GdkDrawable.
Use gdk_window_get_screen() instead
the #GdkScreen associated with @drawable
a #GdkDrawable
Fills *@width and *@height with the size of @drawable.
@width or @height can be %NULL if you only want the other one.
On the X11 platform, if @drawable is a #GdkWindow, the returned
size is the size reported in the most-recently-processed configure
event, rather than the current size on the X server.
Use gdk_window_get_width() and gdk_window_get_height() for
#GdkWindows. Use gdk_pixmap_get_size() for #GdkPixmaps.
a #GdkDrawable
location to store drawable's width, or %NULL
location to store drawable's height, or %NULL
Computes the region of a drawable that is potentially visible.
This does not necessarily take into account if the window is
obscured by other windows, but no area outside of this region
is visible.
a #GdkRegion. This must be freed with gdk_region_destroy()
when you are done.
a #GdkDrawable
Gets the #GdkVisual describing the pixel format of @drawable.
Use gdk_window_get_visual()
a #GdkVisual
a #GdkDrawable
Sets the colormap associated with @drawable. Normally this will
happen automatically when the drawable is created; you only need to
use this function if the drawable-creating function did not have a
way to determine the colormap, and you then use drawable operations
that require a colormap. The colormap for all drawables and
graphics contexts you intend to use together should match. i.e.
when using a #GdkGC to draw to a drawable, or copying one drawable
to another, the colormaps should match.
a #GdkDrawable
Copies a portion of @drawable into the client side image structure
@image. If @image is %NULL, creates a new image of size @width x @height
and copies into that. See gdk_drawable_get_image() for further details.
Use @drawable as the source and draw to a Cairo image
surface if you want to download contents to the client.
@image, or a new a #GdkImage containing the contents
of @drawable
a #GdkDrawable
a #GdkDrawable, or %NULL if a new @image should be created.
x coordinate on @drawable
y coordinate on @drawable
x coordinate within @image. Must be 0 if @image is %NULL
y coordinate within @image. Must be 0 if @image is %NULL
width of region to get
height or region to get
Computes the region of a drawable that potentially can be written
to by drawing primitives. This region will not take into account
the clip region for the GC, and may also not take into account
other factors such as if the window is obscured by other windows,
but no area outside of this region will be affected by drawing
primitives.
a #GdkRegion. This must be freed with gdk_region_destroy()
when you are done.
a #GdkDrawable
Gets the colormap for @drawable, if one is set; returns
%NULL otherwise.
the colormap, or %NULL
a #GdkDrawable
Equivalent to g_object_get_data(); the #GObject variant should be
used instead.
the data stored at @key
a #GdkDrawable
name the data was stored under
Obtains the bit depth of the drawable, that is, the number of bits
that make up a pixel in the drawable's visual. Examples are 8 bits
per pixel, 24 bits per pixel, etc.
number of bits per pixel
a #GdkDrawable
Gets the #GdkDisplay associated with a #GdkDrawable.
Use gdk_window_get_display() instead
the #GdkDisplay associated with @drawable
a #GdkDrawable
A #GdkImage stores client-side image data (pixels). In contrast,
#GdkPixmap and #GdkWindow are server-side
objects. gdk_drawable_get_image() obtains the pixels from a
server-side drawable as a client-side #GdkImage. The format of a
#GdkImage depends on the #GdkVisual of the current display, which
makes manipulating #GdkImage extremely difficult; therefore, in
most cases you should use gdk_pixbuf_get_from_drawable() instead of
this lower-level function. A #GdkPixbuf contains image data in a
canonicalized RGB format, rather than a display-dependent format.
Of course, there's a convenience vs. speed tradeoff here, so you'll
want to think about what makes sense for your application.
@x, @y, @width, and @height define the region of @drawable to
obtain as an image.
You would usually copy image data to the client side if you intend
to examine the values of individual pixels, for example to darken
an image or add a red tint. It would be prohibitively slow to
make a round-trip request to the windowing system for each pixel,
so instead you get all of them at once, modify them, then copy
them all back at once.
If the X server or other windowing system backend is on the local
machine, this function may use shared memory to avoid copying
the image data.
If the source drawable is a #GdkWindow and partially offscreen
or obscured, then the obscured portions of the returned image
will contain undefined data.
Use @drawable as the source and draw to a Cairo image
surface if you want to download contents to the client.
a #GdkImage containing the contents of @drawable
a #GdkDrawable
x coordinate on @drawable
y coordinate on @drawable
width of region to get
height or region to get
Gets the #GdkScreen associated with a #GdkDrawable.
Use gdk_window_get_screen() instead
the #GdkScreen associated with @drawable
a #GdkDrawable
Fills *@width and *@height with the size of @drawable.
@width or @height can be %NULL if you only want the other one.
On the X11 platform, if @drawable is a #GdkWindow, the returned
size is the size reported in the most-recently-processed configure
event, rather than the current size on the X server.
Use gdk_window_get_width() and gdk_window_get_height() for
#GdkWindows. Use gdk_pixmap_get_size() for #GdkPixmaps.
a #GdkDrawable
location to store drawable's width, or %NULL
location to store drawable's height, or %NULL
Computes the region of a drawable that is potentially visible.
This does not necessarily take into account if the window is
obscured by other windows, but no area outside of this region
is visible.
a #GdkRegion. This must be freed with gdk_region_destroy()
when you are done.
a #GdkDrawable
Gets the #GdkVisual describing the pixel format of @drawable.
Use gdk_window_get_visual()
a #GdkVisual
a #GdkDrawable
Deprecated equivalent of calling g_object_ref() on @drawable.
(Drawables were not objects in previous versions of GDK.)
Use g_object_ref() instead.
the same @drawable passed in
a #GdkDrawable
Sets the colormap associated with @drawable. Normally this will
happen automatically when the drawable is created; you only need to
use this function if the drawable-creating function did not have a
way to determine the colormap, and you then use drawable operations
that require a colormap. The colormap for all drawables and
graphics contexts you intend to use together should match. i.e.
when using a #GdkGC to draw to a drawable, or copying one drawable
to another, the colormaps should match.
a #GdkDrawable
a #GdkColormap
This function is equivalent to g_object_set_data(),
the #GObject variant should be used instead.
a #GdkDrawable
name to store the data under
arbitrary data
function to free @data, or %NULL
Deprecated equivalent of calling g_object_unref() on @drawable.
Use g_object_unref() instead.
a #GdkDrawable
number of bits per pixel
a #GdkDrawable
a #GdkDrawable
location to store drawable's width, or %NULL
location to store drawable's height, or %NULL
a #GdkDrawable
the colormap, or %NULL
a #GdkDrawable
a #GdkVisual
a #GdkDrawable
the #GdkScreen associated with @drawable
a #GdkDrawable
a #GdkImage containing the contents of @drawable
a #GdkDrawable
x coordinate on @drawable
y coordinate on @drawable
width of region to get
height or region to get
a #GdkRegion. This must be freed with gdk_region_destroy()
when you are done.
a #GdkDrawable
a #GdkRegion. This must be freed with gdk_region_destroy()
when you are done.
a #GdkDrawable
Creates a new event of the given type. All fields are set to 0.
a newly-allocated #GdkEvent. The returned #GdkEvent
should be freed with gdk_event_free().
a #GdkEventType
Copies a #GdkEvent, copying or incrementing the reference count of the
resources associated with it (e.g. #GdkWindow's and strings).
a copy of @event. The returned #GdkEvent should be freed with
gdk_event_free().
a #GdkEvent
Frees a #GdkEvent, freeing or decrementing any resources associated with it.
Note that this function should only be called with events returned from
functions such as gdk_event_peek(), gdk_event_get(),
gdk_event_get_graphics_expose() and gdk_event_copy() and gdk_event_new().
a #GdkEvent.
Extract the axis value for a particular axis use from
an event structure.
%TRUE if the specified axis was found, otherwise %FALSE
a #GdkEvent
the axis use to look for
location to store the value found
Extract the event window relative x/y coordinates from an event.
%TRUE if the event delivered event window coordinates
a #GdkEvent
location to put event window x coordinate
location to put event window y coordinate
Extract the root window relative x/y coordinates from an event.
%TRUE if the event delivered root window coordinates
a #GdkEvent
location to put root window x coordinate
location to put root window y coordinate
Returns the screen for the event. The screen is
typically the screen for <literal>event->any.window</literal>, but
for events such as mouse events, it is the screen
where the pointer was when the event occurs -
that is, the screen which has the root window
to which <literal>event->motion.x_root</literal> and
<literal>event->motion.y_root</literal> are relative.
the screen for the event
a #GdkEvent
If the event contains a "state" field, puts that field in @state. Otherwise
stores an empty state (0). Returns %TRUE if there was a state field
in the event. @event may be %NULL, in which case it's treated
as if the event had no state field.
%TRUE if there was a state field in the event
a #GdkEvent or NULL
return location for state
Returns the time stamp from @event, if there is one; otherwise
returns #GDK_CURRENT_TIME. If @event is %NULL, returns #GDK_CURRENT_TIME.
time stamp field from @event
a #GdkEvent
Appends a copy of the given event onto the front of the event
queue for event->any.window's display, or the default event
queue if event->any.window is %NULL. See gdk_display_put_event().
a #GdkEvent.
Sends an X ClientMessage event to a given window (which must be
on the default #GdkDisplay.)
This could be used for communicating between different applications,
though the amount of data is limited to 20 bytes.
non-zero on success.
the #GdkEvent to send, which should be a #GdkEventClient.
the window to send the X ClientMessage event to.
Sends an X ClientMessage event to all toplevel windows on the default
#GdkScreen.
Toplevel windows are determined by checking for the WM_STATE property, as
described in the Inter-Client Communication Conventions Manual (ICCCM).
If no windows are found with the WM_STATE property set, the message is sent
to all children of the root window.
the #GdkEvent to send, which should be a #GdkEventClient.
Sets the screen for @event to @screen. The event must
have been allocated by GTK+, for instance, by
gdk_event_copy().
a #GdkEvent
a #GdkScreen
Checks all open displays for a #GdkEvent to process,to be processed
on, fetching events from the windowing system if necessary.
See gdk_display_get_event().
the next #GdkEvent to be processed, or %NULL if no events
are pending. The returned #GdkEvent should be freed with gdk_event_free().
Sets the function to call to handle all events from GDK.
Note that GTK+ uses this to install its own event handler, so it is
usually not useful for GTK+ applications. (Although an application
can call this function then call gtk_main_do_event() to pass
events to GTK+.)
the function to call to handle events from GDK.
user data to pass to the function.
the function to call when the handler function is removed, i.e. when
gdk_event_handler_set() is called with another event handler.
If there is an event waiting in the event queue of some open
display, returns a copy of it. See gdk_display_peek_event().
a copy of the first #GdkEvent on some event queue, or %NULL if no
events are in any queues. The returned #GdkEvent should be freed with
gdk_event_free().
Request more motion notifies if @event is a motion notify hint event.
This function should be used instead of gdk_window_get_pointer() to
request further motion notifies, because it also works for extension
events where motion notifies are provided for devices other than the
core pointer. Coordinate extraction, processing and requesting more
motion events from a %GDK_MOTION_NOTIFY event usually works like this:
|[
{
/* motion_event handler */
x = motion_event->x;
y = motion_event->y;
/* handle (x,y) motion */
gdk_event_request_motions (motion_event); /* handles is_hint events */
}
]|
a valid #GdkEvent
Increases the reference count of a font by one.
@font
a #GdkFont
Decreases the reference count of a font by one.
If the result is zero, destroys the font.
a #GdkFont
Load a #GdkFont based on a Pango font description. This font will
only be an approximation of the Pango font, and
internationalization will not be handled correctly. This function
should only be used for legacy code that cannot be easily converted
to use Pango. Using Pango directly will produce better results.
the newly loaded font, or %NULL if the font
cannot be loaded.
a #PangoFontDescription.
Loads a font.
The font may be newly loaded or looked up the font in a cache.
You should make no assumptions about the initial reference count.
a #GdkFont, or %NULL if the font could not be loaded.
a XLFD describing the font to load.
Create a new graphics context with default values.
Use Cairo for rendering.
the new graphics context.
a #GdkDrawable. The created GC must always be used
with drawables of the same depth as this one.
Create a new GC with the given initial values.
Use Cairo for rendering.
the new graphics context.
a #GdkDrawable. The created GC must always be used
with drawables of the same depth as this one.
a structure containing initial values for the GC.
a bit mask indicating which fields in @values
are set.
Retrieves the current values from a graphics context. Note that
only the pixel values of the @values->foreground and @values->background
are filled, use gdk_colormap_query_color() to obtain the rgb values
if you need them.
Use Cairo for rendering.
a #GdkGC.
the #GdkGCValues structure in which to store the results.
Sets the way dashed-lines are drawn. Lines will be
drawn with alternating on and off segments of the
lengths specified in @dash_list. The manner in
which the on and off segments are drawn is determined
by the @line_style value of the GC. (This can
be changed with gdk_gc_set_line_attributes().)
The @dash_offset defines the phase of the pattern,
specifying how many pixels into the dash-list the pattern
should actually begin.
Use cairo_set_dash() to set the dash in Cairo.
a #GdkGC.
the phase of the dash pattern.
an array of dash lengths.
the number of elements in @dash_list.
Sets attributes of a graphics context in bulk. For each flag set in
@values_mask, the corresponding field will be read from @values and
set as the new value for @gc. If you're only setting a few values
on @gc, calling individual "setter" functions is likely more
convenient.
Use Cairo for rendering.
a #GdkGC
struct containing the new values
Copy the set of values from one graphics context
onto another graphics context.
Use Cairo for drawing. cairo_save() and cairo_restore()
can be helpful in cases where you'd have copied a #GdkGC.
the destination graphics context.
the source graphics context.
Retrieves the colormap for a given GC, if it exists.
A GC will have a colormap if the drawable for which it was created
has a colormap, or if a colormap was set explicitely with
gdk_gc_set_colormap.
There is no replacement. Cairo handles colormaps
automatically, so there is no need to care about them.
the colormap of @gc, or %NULL if @gc doesn't have one.
a #GdkGC
Gets the #GdkScreen for which @gc was created
the #GdkScreen for @gc.
a #GdkGC.
Retrieves the current values from a graphics context. Note that
only the pixel values of the @values->foreground and @values->background
are filled, use gdk_colormap_query_color() to obtain the rgb values
if you need them.
Use Cairo for rendering.
a #GdkGC.
the #GdkGCValues structure in which to store the results.
Offset attributes such as the clip and tile-stipple origins
of the GC so that drawing at x - x_offset, y - y_offset with
the offset GC has the same effect as drawing at x, y with the original
GC.
There is no direct replacement, as this is just a
convenience function for gdk_gc_set_ts_origin and gdk_gc_set_clip_origin().
a #GdkGC
amount by which to offset the GC in the X direction
amount by which to offset the GC in the Y direction
Deprecated function; use g_object_ref() instead.
Use g_object_ref() instead.
the gc.
a #GdkGC
Sets the background color for a graphics context.
Note that this function uses @color->pixel, use
gdk_gc_set_rgb_bg_color() to specify the background
color as red, green, blue components.
Use gdk_cairo_set_source_color() to use a #GdkColor
as the source in Cairo. Note that if you want to draw a background and a
foreground in Cairo, you need to call drawing functions (like cairo_fill())
twice.
a #GdkGC.
the new background color.
Sets the clip mask for a graphics context from a bitmap.
The clip mask is interpreted relative to the clip
origin. (See gdk_gc_set_clip_origin()).
Use cairo_mask() instead.
the #GdkGC.
a bitmap.
Sets the origin of the clip mask. The coordinates are
interpreted relative to the upper-left corner of
the destination drawable of the current operation.
Use cairo_translate() before applying the clip path in
Cairo.
a #GdkGC.
the x-coordinate of the origin.
the y-coordinate of the origin.
Sets the clip mask for a graphics context from a
rectangle. The clip mask is interpreted relative to the clip
origin. (See gdk_gc_set_clip_origin()).
Use cairo_rectangle() and cairo_clip() in Cairo.
a #GdkGC.
the rectangle to clip to.
Sets the clip mask for a graphics context from a region structure.
The clip mask is interpreted relative to the clip origin. (See
gdk_gc_set_clip_origin()).
Use gdk_cairo_region() and cairo_clip() in Cairo.
a #GdkGC.
the #GdkRegion.
Sets the colormap for the GC to the given colormap. The depth
of the colormap's visual must match the depth of the drawable
for which the GC was created.
There is no replacement. Cairo handles colormaps
automatically, so there is no need to care about them.
a #GdkGC
a #GdkColormap
Sets the way dashed-lines are drawn. Lines will be
drawn with alternating on and off segments of the
lengths specified in @dash_list. The manner in
which the on and off segments are drawn is determined
by the @line_style value of the GC. (This can
be changed with gdk_gc_set_line_attributes().)
The @dash_offset defines the phase of the pattern,
specifying how many pixels into the dash-list the pattern
should actually begin.
Use cairo_set_dash() to set the dash in Cairo.
a #GdkGC.
the phase of the dash pattern.
an array of dash lengths.
the number of elements in @dash_list.
Sets whether copying non-visible portions of a drawable
using this graphics context generate exposure events
for the corresponding regions of the destination
drawable. (See gdk_draw_drawable()).
There is no replacement. If you need to control
exposures, you must use drawing operations of the underlying window
system or use gdk_window_invalidate_rect(). Cairo will never
generate exposures.
a #GdkGC.
if %TRUE, exposure events will be generated.
Set the fill mode for a graphics context.
You can achieve tiling in Cairo by using
cairo_pattern_set_extend() on the source. For stippling, see the
deprecation comments on gdk_gc_set_stipple().
a #GdkGC.
the new fill mode.
Sets the font for a graphics context. (Note that
all text-drawing functions in GDK take a @font
argument; the value set here is used when that
argument is %NULL.)
a #GdkGC.
the new font.
Sets the foreground color for a graphics context.
Note that this function uses @color->pixel, use
gdk_gc_set_rgb_fg_color() to specify the foreground
color as red, green, blue components.
Use gdk_cairo_set_source_color() to use a #GdkColor
as the source in Cairo.
a #GdkGC.
the new foreground color.
Determines how the current pixel values and the
pixel values being drawn are combined to produce
the final pixel values.
Use cairo_set_operator() with Cairo.
a #GdkGC.
the #GdkFunction to use
Sets various attributes of how lines are drawn. See
the corresponding members of #GdkGCValues for full
explanations of the arguments.
Use the Cairo functions cairo_set_line_width(),
cairo_set_line_join(), cairo_set_line_cap() and cairo_set_dash()
to affect the stroking behavior in Cairo. Keep in mind that the default
attributes of a #cairo_t are different from the default attributes of
a #GdkGC.
a #GdkGC.
the width of lines.
the dash-style for lines.
the manner in which the ends of lines are drawn.
the in which lines are joined together.
Set the background color of a GC using an unallocated color. The
pixel value for the color will be determined using GdkRGB. If the
colormap for the GC has not previously been initialized for GdkRGB,
then for pseudo-color colormaps (colormaps with a small modifiable
number of colors), a colorcube will be allocated in the colormap.
Calling this function for a GC without a colormap is an error.
Use gdk_cairo_set_source_color() instead.
a #GdkGC
an unallocated #GdkColor.
Set the foreground color of a GC using an unallocated color. The
pixel value for the color will be determined using GdkRGB. If the
colormap for the GC has not previously been initialized for GdkRGB,
then for pseudo-color colormaps (colormaps with a small modifiable
number of colors), a colorcube will be allocated in the colormap.
Calling this function for a GC without a colormap is an error.
Use gdk_cairo_set_source_color() instead.
a #GdkGC
an unallocated #GdkColor.
Set the stipple bitmap for a graphics context. The
stipple will only be used if the fill mode is
%GDK_STIPPLED or %GDK_OPAQUE_STIPPLED.
Stippling has no direct replacement in Cairo. If you
want to achieve an identical look, you can use the stipple bitmap as a
mask. Most likely, this involves rendering the source to an intermediate
surface using cairo_push_group() first, so that you can then use
cairo_mask() to achieve the stippled look.
a #GdkGC.
the new stipple bitmap.
Sets how drawing with this GC on a window will affect child
windows of that window.
There is no replacement. If you need to control
subwindows, you must use drawing operations of the underlying window
system manually. Cairo will always use %GDK_INCLUDE_INFERIORS on sources
and masks and %GDK_CLIP_BY_CHILDREN on targets.
a #GdkGC.
the subwindow mode.
Set a tile pixmap for a graphics context.
This will only be used if the fill mode
is %GDK_TILED.
The following code snippet sets a tiling #GdkPixmap
as the source in Cairo:
|[gdk_cairo_set_source_pixmap (cr, tile, ts_origin_x, ts_origin_y);
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);]|
a #GdkGC.
the new tile pixmap.
Set the origin when using tiles or stipples with
the GC. The tile or stipple will be aligned such
that the upper left corner of the tile or stipple
will coincide with this point.
You can set the origin for tiles and stipples in Cairo
by changing the source's matrix using cairo_pattern_set_matrix(). Or you
can specify it with gdk_cairo_set_source_pixmap() as shown in the example
for gdk_gc_set_tile().
a #GdkGC.
the x-coordinate of the origin.
the y-coordinate of the origin.
Sets attributes of a graphics context in bulk. For each flag set in
@values_mask, the corresponding field will be read from @values and
set as the new value for @gc. If you're only setting a few values
on @gc, calling individual "setter" functions is likely more
convenient.
Use Cairo for rendering.
a #GdkGC
struct containing the new values
mask indicating which struct fields are to be used
Decrement the reference count of @gc.
Use g_object_unref() instead.
a #GdkGC
a #GdkGC.
the #GdkGCValues structure in which to store the results.
a #GdkGC
struct containing the new values
a #GdkGC.
the phase of the dash pattern.
an array of dash lengths.
the number of elements in @dash_list.
This is a deprecated wrapper for gdk_drawable_get_image();
gdk_drawable_get_image() should be used instead. Or even better: in
most cases gdk_pixbuf_get_from_drawable() is the most convenient
choice.
a new #GdkImage or %NULL
a #GdkDrawable
x coordinate in @window
y coordinate in @window
width of area in @window
height of area in @window
Determines the number of bits per pixel of the image.
#GdkImage should not be used anymore.
the bits per pixel
a #GdkImage
Determines the byte order of the image.
#GdkImage should not be used anymore.
a #GdkVisual
a #GdkImage
Determines the number of bytes per line of the image.
#GdkImage should not be used anymore.
the bytes per line
a #GdkImage
Determines the number of bytes per pixel of the image.
#GdkImage should not be used anymore.
the bytes per pixel
a #GdkImage
Retrieves the colormap for a given image, if it exists. An image
will have a colormap if the drawable from which it was created has
a colormap, or if a colormap was set explicitely with
gdk_image_set_colormap().
#GdkImage should not be used anymore.
colormap for the image
a #GdkImage
Determines the depth of the image.
#GdkImage should not be used anymore.
the depth
a #GdkImage
Determines the height of the image.
#GdkImage should not be used anymore.
the height
a #GdkImage
Determines the type of a given image.
#GdkImage should not be used anymore.
the #GdkImageType of the image
a #GdkImage
Returns a pointer to the pixel data of the image.
#GdkImage should not be used anymore.
the pixel data of the image
a #GdkImage
Determines the visual that was used to create the image.
#GdkImage should not be used anymore.
a #GdkVisual
a #GdkImage
Determines the width of the image.
#GdkImage should not be used anymore.
the width
a #GdkImage
Deprecated function; use g_object_ref() instead.
Use g_object_ref() instead.
the image
a #GdkImage
Sets the colormap for the image to the given colormap. Normally
there's no need to use this function, images are created with the
correct colormap if you get the image from a drawable. If you
create the image from scratch, use the colormap of the drawable you
intend to render the image to.
#GdkImage should not be used anymore.
a #GdkImage
a #GdkColormap
Deprecated function; use g_object_unref() instead.
Use g_object_unref() instead.
a #GdkImage
Determines information about the current keyboard grab.
This is not public API and must not be used by applications.
%TRUE if this application currently has the
keyboard grabbed.
the display for which to get the grab information
location to store current grab window
location to store boolean indicating whether
the @owner_events flag to gdk_keyboard_grab() was %TRUE.
Returns the #GdkKeymap attached to the default display.
the #GdkKeymap attached to the default display.
Returns the #GdkKeymap attached to @display.
the #GdkKeymap attached to @display.
the #GdkDisplay.
Adds virtual modifiers (i.e. Super, Hyper and Meta) which correspond
to the real modifiers (i.e Mod2, Mod3, ...) in @modifiers.
are set in @state to their non-virtual counterparts (i.e. Mod2,
Mod3,...) and set the corresponding bits in @state.
GDK already does this before delivering key events, but for
compatibility reasons, it only sets the first virtual modifier
it finds, whereas this function sets all matching virtual modifiers.
This function is useful when matching key events against
accelerators.
a #GdkKeymap
pointer to the modifier mask to change
Returns whether the Caps Lock modifer is locked.
%TRUE if Caps Lock is on
a #GdkKeymap
Returns the direction of effective layout of the keymap.
Note that passing %NULL for @keymap is deprecated and will stop
to work in GTK+ 3.0. Use gdk_keymap_get_for_display() instead.
%PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL
if it can determine the direction. %PANGO_DIRECTION_NEUTRAL
otherwise.
a #GdkKeymap or %NULL to use the default keymap
Returns the keyvals bound to @hardware_keycode.
The Nth #GdkKeymapKey in @keys is bound to the Nth
keyval in @keyvals. Free the returned arrays with g_free().
When a keycode is pressed by the user, the keyval from
this list of entries is selected by considering the effective
keyboard group and level. See gdk_keymap_translate_keyboard_state().
Note that passing %NULL for @keymap is deprecated and will stop
to work in GTK+ 3.0. Use gdk_keymap_get_for_display() instead.
%TRUE if there were any entries
a #GdkKeymap or %NULL to use the default keymap
a keycode
return location for array of #GdkKeymapKey, or %NULL
return location for array of keyvals, or %NULL
length of @keys and @keyvals
Obtains a list of keycode/group/level combinations that will
generate @keyval. Groups and levels are two kinds of keyboard mode;
in general, the level determines whether the top or bottom symbol
on a key is used, and the group determines whether the left or
right symbol is used. On US keyboards, the shift key changes the
keyboard level, and there are no groups. A group switch key might
convert a keyboard between Hebrew to English modes, for example.
#GdkEventKey contains a %group field that indicates the active
keyboard group. The level is computed from the modifier mask.
The returned array should be freed
with g_free().
Note that passing %NULL for @keymap is deprecated and will stop
to work in GTK+ 3.0. Use gdk_keymap_get_for_display() instead.
%TRUE if keys were found and returned
a #GdkKeymap, or %NULL to use the default keymap
a keyval, such as %GDK_a, %GDK_Up, %GDK_Return, etc.
return location for an array of #GdkKeymapKey
return location for number of elements in returned array
Determines if keyboard layouts for both right-to-left and left-to-right
languages are in use.
Note that passing %NULL for @keymap is deprecated and will stop
to work in GTK+ 3.0. Use gdk_keymap_get_for_display() instead.
%TRUE if there are layouts in both directions, %FALSE otherwise
a #GdkKeymap or %NULL to use the default keymap
Looks up the keyval mapped to a keycode/group/level triplet.
If no keyval is bound to @key, returns 0. For normal user input,
you want to use gdk_keymap_translate_keyboard_state() instead of
this function, since the effective group/level may not be
the same as the current keyboard state.
Note that passing %NULL for @keymap is deprecated and will stop
to work in GTK+ 3.0. Use gdk_keymap_get_for_display() instead.
a keyval, or 0 if none was mapped to the given @key
a #GdkKeymap or %NULL to use the default keymap
a #GdkKeymapKey with keycode, group, and level initialized
Maps the virtual modifiers (i.e. Super, Hyper and Meta) which
are set in @state to their non-virtual counterparts (i.e. Mod2,
Mod3,...) and set the corresponding bits in @state.
This function is useful when matching key events against
accelerators.
%TRUE if no virtual modifiers were mapped to the
same non-virtual modifier. Note that %FALSE is also returned
if a virtual modifier is mapped to a non-virtual modifier that
was already set in @state.
a #GdkKeymap
pointer to the modifier state to map
Translates the contents of a #GdkEventKey into a keyval, effective
group, and level. Modifiers that affected the translation and
are thus unavailable for application use are returned in
@consumed_modifiers. See <xref linkend="key-group-explanation"/> for an explanation of
groups and levels. The @effective_group is the group that was
actually used for the translation; some keys such as Enter are not
affected by the active keyboard group. The @level is derived from
@state. For convenience, #GdkEventKey already contains the translated
keyval, so this function isn't as useful as you might think.
<note><para>
@consumed_modifiers gives modifiers that should be masked out
from @state when comparing this key press to a hot key. For
instance, on a US keyboard, the <literal>plus</literal>
symbol is shifted, so when comparing a key press to a
<literal><Control>plus</literal> accelerator <Shift> should
be masked out.
</para>
<informalexample><programlisting>
/* We want to ignore irrelevant modifiers like ScrollLock */
#define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)
gdk_keymap_translate_keyboard_state (keymap, event->hardware_keycode,
event->state, event->group,
&keyval, NULL, NULL, &consumed);
if (keyval == GDK_PLUS &&
(event->state & ~consumed & ALL_ACCELS_MASK) == GDK_CONTROL_MASK)
/* Control was pressed */
</programlisting></informalexample>
<para>
An older interpretation @consumed_modifiers was that it contained
all modifiers that might affect the translation of the key;
this allowed accelerators to be stored with irrelevant consumed
modifiers, by doing:</para>
<informalexample><programlisting>
/* XXX Don't do this XXX */
if (keyval == accel_keyval &&
(event->state & ~consumed & ALL_ACCELS_MASK) == (accel_mods & ~consumed))
/* Accelerator was pressed */
</programlisting></informalexample>
<para>
However, this did not work if multi-modifier combinations were
used in the keymap, since, for instance, <literal><Control></literal>
would be masked out even if only <literal><Control><Alt></literal>
was used in the keymap. To support this usage as well as well as
possible, all <emphasis>single modifier</emphasis> combinations
that could affect the key for any combination of modifiers will
be returned in @consumed_modifiers; multi-modifier combinations
are returned only when actually found in @state. When you store
accelerators, you should always store them with consumed modifiers
removed. Store <literal><Control>plus</literal>,
not <literal><Control><Shift>plus</literal>,
</para></note>
Note that passing %NULL for @keymap is deprecated and will stop
to work in GTK+ 3.0. Use gdk_keymap_get_for_display() instead.
%TRUE if there was a keyval bound to the keycode/state/group
a #GdkKeymap, or %NULL to use the default
a keycode
a modifier state
active keyboard group
return location for keyval, or %NULL
return location for effective group, or %NULL
return location for level, or %NULL
return location for modifiers that were used to
determine the group or level, or %NULL
The ::direction-changed signal gets emitted when the direction of
the keymap changes.
The ::keys-changed signal is emitted when the mapping represented by
@keymap changes.
The ::state-changed signal is emitted when the state of the
keyboard changes, e.g when Caps Lock is turned on or off.
See gdk_keymap_get_caps_lock_state().
Creates a new attribute specifying the color to emboss text with.
new #PangoAttribute
a GdkColor representing the color to emboss with
Creates a new attribute flagging a region as embossed or not.
new #PangoAttribute
if the region should be embossed
Creates a new attribute containing a stipple bitmap to be used when
rendering the text.
new #PangoAttribute
a bitmap to be set as stipple
#GdkPangoRenderer is a subclass of #PangoRenderer used for rendering
Pango objects into GDK drawables. The default renderer for a particular
screen is obtained with gdk_pango_renderer_get_default(); Pango
functions like pango_renderer_draw_layout() and
pango_renderer_draw_layout_line() are then used to draw objects with
the renderer.
In most simple cases, applications can just use gdk_draw_layout(), and
don't need to directly use #GdkPangoRenderer at all. Using the
#GdkPangoRenderer directly is most useful when working with a
transformation such as a rotation, because the Pango drawing functions
take user space coordinates (coordinates before the transformation)
instead of device coordinates.
In certain cases it can be useful to subclass #GdkPangoRenderer. Examples
of reasons to do this are to add handling of custom attributes by
overriding 'prepare_run' or to do custom drawing of embedded objects
by overriding 'draw_shape'.
Creates a new #PangoRenderer for @screen. Normally you can use the
results of gdk_pango_renderer_get_default() rather than creating a new
renderer.
a newly created #PangoRenderer. Free with g_object_unref().
a #GdkScreen
Gets the default #PangoRenderer for a screen. This default renderer
is shared by all users of the display, so properties such as the color
or transformation matrix set for the renderer may be overwritten
by functions such as gdk_draw_layout().
Before using the renderer, you need to call gdk_pango_renderer_set_drawable()
and gdk_pango_renderer_set_gc() to set the drawable and graphics context
to use for drawing.
the default #PangoRenderer for @screen. The
renderer is owned by GTK+ and will be kept around until the
screen is closed.
a #GdkScreen
Sets the drawable the renderer draws to.
a #GdkPangoRenderer
the new target drawable, or %NULL
Sets the GC the renderer draws with. Note that the GC must not be
modified until it is unset by calling the function again with
%NULL for the @gc parameter, since GDK may make internal copies
of the GC which won't be updated to follow changes to the
original GC.
a #GdkPangoRenderer
the new GC to use for drawing, or %NULL
Sets the color for a particular render part (foreground,
background, underline, etc.), overriding any attributes on the layouts
renderered with this renderer.
a #GdkPangoRenderer
the part to render to set the color of
the color to use, or %NULL to unset a previously
set override color.
Sets the stipple for one render part (foreground, background, underline,
etc.) Note that this is overwritten when iterating through the individual
styled runs of a #PangoLayout or #PangoLayoutLine. This function is thus
only useful when you call low level functions like pango_renderer_draw_glyphs()
directly, or in the 'prepare_run' virtual function of a subclass of
#GdkPangoRenderer.
a #GdkPangoRenderer
the part to render with the stipple
the new stipple value.
#GdkPangoRenderer is the class structure for #GdkPangoRenderer.
Wraps a native window for the default display in a #GdkPixmap.
This may fail if the pixmap has been destroyed.
For example in the X backend, a native pixmap handle is an Xlib
<type>XID</type>.
the newly-created #GdkPixmap wrapper for the
native pixmap or %NULL if the pixmap has been destroyed.
a native pixmap handle.
Wraps a native pixmap in a #GdkPixmap.
This may fail if the pixmap has been destroyed.
For example in the X backend, a native pixmap handle is an Xlib
<type>XID</type>.
the newly-created #GdkPixmap wrapper for the
native pixmap or %NULL if the pixmap has been destroyed.
The #GdkDisplay where @anid is located.
a native pixmap handle.
Wraps a native pixmap in a #GdkPixmap.
This may fail if the pixmap has been destroyed.
For example in the X backend, a native pixmap handle is an Xlib
<type>XID</type>.
This function is an alternative to gdk_pixmap_foreign_new_for_display()
for cases where the dimensions of the pixmap are known. For the X
backend, this avoids a roundtrip to the server.
the newly-created #GdkPixmap wrapper for the
native pixmap or %NULL if the pixmap has been destroyed.
a #GdkScreen
a native pixmap handle
the width of the pixmap identified by @anid
the height of the pixmap identified by @anid
the depth of the pixmap identified by @anid
Create a pixmap from a XPM file using a particular colormap.
Use a #GdkPixbuf instead. You can use
gdk_pixbuf_new_from_file() to create it.
If you must use a pixmap, use gdk_pixmap_new() to
create it and Cairo to draw the pixbuf onto it.
the #GdkPixmap.
a #GdkDrawable, used to determine default values
for the new pixmap. Can be %NULL if @colormap is given.
the #GdkColormap that the new pixmap will be use.
If omitted, the colormap for @window will be used.
a pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be %NULL,
in which case transparency will be ignored.
the color to be used for the pixels
that are transparent in the input file. Can be %NULL,
in which case a default color will be used.
the filename of a file containing XPM data.
Create a pixmap from data in XPM format using a particular
colormap.
Use a #GdkPixbuf instead. You can use
gdk_pixbuf_new_from_xpm_data() to create it.
If you must use a pixmap, use gdk_pixmap_new() to
create it and Cairo to draw the pixbuf onto it.
the #GdkPixmap.
a #GdkDrawable, used to determine default values
for the new pixmap. Can be %NULL if @colormap is given.
the #GdkColormap that the new pixmap will be use.
If omitted, the colormap for @window will be used.
a pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be %NULL,
in which case transparency will be ignored.
the color to be used for the pixels
that are transparent in the input file. Can be %NULL,
in which case a default color will be used.
Pointer to a string containing the XPM data.
Create a pixmap from a XPM file.
Use a #GdkPixbuf instead. You can use
gdk_pixbuf_new_from_file() to create it.
If you must use a pixmap, use gdk_pixmap_new() to
create it and Cairo to draw the pixbuf onto it.
the #GdkPixmap
a #GdkDrawable, used to determine default values
for the new pixmap.
a pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be %NULL,
in which case transparency will be ignored.
the color to be used for the pixels
that are transparent in the input file. Can be %NULL,
in which case a default color will be used.
the filename of a file containing XPM data.
Create a pixmap from data in XPM format.
Use a #GdkPixbuf instead. You can use
gdk_pixbuf_new_from_xpm_data() to create it.
If you must use a pixmap, use gdk_pixmap_new() to
create it and Cairo to draw the pixbuf onto it.
the #GdkPixmap.
a #GdkDrawable, used to determine default values
for the new pixmap.
Pointer to a place to store a bitmap representing
the transparency mask of the XPM file. Can be %NULL,
in which case transparency will be ignored.
This color will be used for the pixels
that are transparent in the input file. Can be %NULL
in which case a default color will be used.
Pointer to a string containing the XPM data.
Looks up the #GdkPixmap that wraps the given native pixmap handle.
For example in the X backend, a native pixmap handle is an Xlib
<type>XID</type>.
the #GdkPixmap wrapper for the native pixmap,
or %NULL if there is none.
a native pixmap handle.
Looks up the #GdkPixmap that wraps the given native pixmap handle.
For example in the X backend, a native pixmap handle is an Xlib
<type>XID</type>.
the #GdkPixmap wrapper for the native pixmap,
or %NULL if there is none.
the #GdkDisplay associated with @anid
a native pixmap handle.
This function is purely to make it possible to query the size of pixmaps
even when compiling without deprecated symbols and you must use pixmaps.
It is identical to gdk_drawable_get_size(), but for pixmaps.
a #GdkPixmap
location to store @pixmap's width, or %NULL
location to store @pixmap's height, or %NULL
Calculates the intersection of two rectangles. It is allowed for
@dest to be the same as either @src1 or @src2. If the rectangles
do not intersect, @dest's width and height is set to 0 and its x
and y values are undefined. If you are only interested in whether
the rectangles intersect, but not in the intersecting area itself,
pass %NULL for @dest.
%TRUE if the rectangles intersect.
a #GdkRectangle
a #GdkRectangle
return location for the
intersection of @src1 and @src2, or %NULL
Calculates the union of two rectangles.
The union of rectangles @src1 and @src2 is the smallest rectangle which
includes both @src1 and @src2 within it.
It is allowed for @dest to be the same as either @src1 or @src2.
a #GdkRectangle
a #GdkRectangle
return location for the union of @src1 and @src2
Copies @region, creating an identical new region.
a new region identical to @region
a #GdkRegion
Destroys a #GdkRegion.
a #GdkRegion
Finds out if the #GdkRegion is empty.
%TRUE if @region is empty.
a #GdkRegion
Finds out if the two regions are the same.
%TRUE if @region1 and @region2 are equal.
a #GdkRegion
a #GdkRegion
Obtains the smallest rectangle which includes the entire #GdkRegion.
a #GdkRegion
return location for the clipbox
Obtains the area covered by the region as a list of rectangles.
The array returned in @rectangles must be freed with g_free().
a #GdkRegion
return location for an array of rectangles
length of returned array
Sets the area of @source1 to the intersection of the areas of @source1
and @source2. The resulting area is the set of pixels contained in
both @source1 and @source2.
a #GdkRegion
another #GdkRegion
Moves a region the specified distance.
a #GdkRegion
the distance to move the region horizontally
the distance to move the region vertically
Finds out if a point is in a region.
%TRUE if the point is in @region.
a #GdkRegion
the x coordinate of a point
the y coordinate of a point
Finds out if a regions is the same as a rectangle.
Use gdk_region_new_rect() and gdk_region_equal() to
achieve the same effect.
%TRUE if @region and @rectangle are equal.
a #GdkRegion
a #GdkRectangle
Tests whether a rectangle is within a region.
%GDK_OVERLAP_RECTANGLE_IN, %GDK_OVERLAP_RECTANGLE_OUT, or
%GDK_OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside,
outside, or partly inside the #GdkRegion, respectively.
a #GdkRegion.
a #GdkRectangle.
Resizes a region by the specified amount.
Positive values shrink the region. Negative values expand it.
There is no replacement for this function.
a #GdkRegion
the number of pixels to shrink the region horizontally
the number of pixels to shrink the region vertically
Calls a function on each span in the intersection of @region and @spans.
There is no replacement.
a #GdkRegion
an array of #GdkSpans
the length of @spans
%TRUE if @spans is sorted wrt. the y coordinate
function to call on each span in the intersection
data to pass to @function
Subtracts the area of @source2 from the area @source1. The resulting
area is the set of pixels contained in @source1 but not in @source2.
a #GdkRegion
another #GdkRegion
Sets the area of @source1 to the union of the areas of @source1 and
@source2. The resulting area is the set of pixels contained in
either @source1 or @source2.
a #GdkRegion
a #GdkRegion
Sets the area of @region to the union of the areas of @region and
@rect. The resulting area is the set of pixels contained in
either @region or @rect.
a #GdkRegion.
a #GdkRectangle.
Sets the area of @source1 to the exclusive-OR of the areas of @source1
and @source2. The resulting area is the set of pixels contained in one
or the other of the two sources but not in both.
a #GdkRegion
another #GdkRegion
Creates a new empty #GdkRegion.
a new empty #GdkRegion
Creates a new #GdkRegion using the polygon defined by a
number of points.
There is no replacement. For working with paths, please
use Cairo.
a new #GdkRegion based on the given polygon
an array of #GdkPoint structs
the number of elements in the @points array
specifies which pixels are included in the region when the
polygon overlaps itself.
Creates a new region containing the area @rectangle.
a new region
a #GdkRectangle
Gets the default screen for the default display. (See
gdk_display_get_default ()).
a #GdkScreen, or %NULL if there is no default display.
Returns the height of the default screen in pixels.
the height of the default screen in pixels.
Returns the height of the default screen in millimeters.
Note that on many X servers this value will not be correct.
the height of the default screen in millimeters,
though it is not always correct.
Returns the width of the default screen in pixels.
the width of the default screen in pixels.
Returns the width of the default screen in millimeters.
Note that on many X servers this value will not be correct.
the width of the default screen in millimeters,
though it is not always correct.
Returns the screen's currently active window.
On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property
on the root window, as described in the <ulink
url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
Manager Hints</ulink>. If there is no currently currently active
window, or the window manager does not support the
_NET_ACTIVE_WINDOW hint, this function returns %NULL.
On other platforms, this function may return %NULL, depending on whether
it is implementable on that platform.
The returned window should be unrefed using g_object_unref() when
no longer needed.
the currently active window, or %NULL.
a #GdkScreen
Gets the default colormap for @screen.
the default #GdkColormap.
a #GdkScreen
Gets the display to which the @screen belongs.
the display to which @screen belongs
a #GdkScreen
Gets any options previously set with gdk_screen_set_font_options().
the current font options, or %NULL if no default
font options have been set.
a #GdkScreen
Gets the height of @screen in pixels
the height of @screen in pixels.
a #GdkScreen
Returns the height of @screen in millimeters.
Note that on some X servers this value will not be correct.
the heigth of @screen in millimeters.
a #GdkScreen
Returns the monitor number in which the point (@x,@y) is located.
the monitor number in which the point (@x,@y) lies, or
a monitor close to (@x,@y) if the point is not in any monitor.
a #GdkScreen.
the x coordinate in the virtual screen.
the y coordinate in the virtual screen.
Returns the number of the monitor in which the largest area of the
bounding rectangle of @window resides.
the monitor number in which most of @window is located,
or if @window does not intersect any monitors, a monitor,
close to @window.
a #GdkScreen.
a #GdkWindow
Retrieves the #GdkRectangle representing the size and position of
the individual monitor within the entire screen area.
Note that the size of the entire screen area can be retrieved via
gdk_screen_get_width() and gdk_screen_get_height().
a #GdkScreen
the monitor number, between 0 and gdk_screen_get_n_monitors (screen)
a #GdkRectangle to be filled with the monitor geometry
Gets the height in millimeters of the specified monitor.
the height of the monitor, or -1 if not available
a #GdkScreen
number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
Returns the output name of the specified monitor.
Usually something like VGA, DVI, or TV, not the actual
product name of the display device.
a newly-allocated string containing the name of the monitor,
or %NULL if the name cannot be determined
a #GdkScreen
number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
Gets the width in millimeters of the specified monitor, if available.
the width of the monitor, or -1 if not available
a #GdkScreen
number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
Returns the number of monitors which @screen consists of.
number of monitors which @screen consists of
a #GdkScreen
Gets the index of @screen among the screens in the display
to which it belongs. (See gdk_screen_get_display())
the index
a #GdkScreen
Gets the primary monitor for @screen. The primary monitor
is considered the monitor where the 'main desktop' lives.
While normal application windows typically allow the window
manager to place the windows, specialized desktop applications
such as panels should place themselves on the primary monitor.
If no primary monitor is configured by the user, the return value
will be 0, defaulting to the first monitor.
An integer index for the primary monitor, or 0 if none is configured.
a #GdkScreen.
Gets the resolution for font handling on the screen; see
gdk_screen_set_resolution() for full details.
the current resolution, or -1 if no resolution
has been set.
a #GdkScreen
Gets the preferred colormap for rendering image data on @screen.
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.
Use gdk_screen_get_system_colormap()
the preferred colormap
a #GdkScreen.
Gets a "preferred visual" chosen by GdkRGB for rendering image data
on @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.
Use gdk_screen_get_system_visual()
The #GdkVisual chosen by GdkRGB.
a #GdkScreen
Gets a colormap to use for creating windows or pixmaps with an
alpha channel. The windowing system on which GTK+ is running
may not support this capability, in which case %NULL will
be returned. Even if a non-%NULL value is returned, its
possible that the window's alpha channel won't be honored
when displaying the window on the screen: in particular, for
X an appropriate windowing manager and compositing manager
must be running to provide appropriate display.
This functionality is not implemented in the Windows backend.
For setting an overall opacity for a top-level window, see
gdk_window_set_opacity().
a colormap to use for windows with
an alpha channel or %NULL if the capability is not available.
a #GdkScreen.
Gets a visual to use for creating windows or pixmaps with an
alpha channel. See the docs for gdk_screen_get_rgba_colormap()
for caveats.
a visual to use for windows with an
alpha channel or %NULL if the capability is not available.
a #GdkScreen
Gets the root window of @screen.
the root window
a #GdkScreen
Gets the system's default colormap for @screen
the default colormap for @screen.
a #GdkScreen
Get the system's default visual for @screen.
This is the visual for the root window of the display.
The return value should not be freed.
the system visual
a #GdkScreen.
Obtains a list of all toplevel windows known to GDK on the screen @screen.
A toplevel window is a child of the root window (see
gdk_get_default_root_window()).
The returned list should be freed with g_list_free(), but
its elements need not be freed.
list of toplevel windows, free with g_list_free()
The #GdkScreen where the toplevels are located.
Gets the width of @screen in pixels
the width of @screen in pixels.
a #GdkScreen
Gets the width of @screen in millimeters.
Note that on some X servers this value will not be correct.
the width of @screen in millimeters.
a #GdkScreen
Returns a #GList of #GdkWindow<!-- -->s representing the current
window stack.
On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING
property on the root window, as described in the <ulink
url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
Manager Hints</ulink>. If the window manager does not support the
_NET_CLIENT_LIST_STACKING hint, this function returns %NULL.
On other platforms, this function may return %NULL, depending on whether
it is implementable on that platform.
The returned list is newly allocated and owns references to the
windows it contains, so it should be freed using g_list_free() and
its windows unrefed using g_object_unref() when no longer needed.
a list of #GdkWindow<!-- -->s for the current window stack,
or %NULL.
a #GdkScreen
Returns whether windows with an RGBA visual can reasonably
be expected to have their alpha channel drawn correctly on
the screen.
On X11 this function returns whether a compositing manager is
compositing @screen.
Whether windows with RGBA visuals can reasonably be
expected to have their alpha channels drawn correctly on the screen.
a #GdkScreen
Lists the available visuals for the specified @screen.
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.
Call g_list_free() on the return value when you're finished with it.
a list of visuals; the list must be freed, but not its contents
the relevant #GdkScreen.
Determines the name to pass to gdk_display_open() to get
a #GdkDisplay with this screen as the default screen.
a newly allocated string, free with g_free()
a #GdkScreen
Sets the default @colormap for @screen.
a #GdkScreen
a #GdkColormap
Sets the default font options for the screen. These
options will be set on any #PangoContext's newly created
with gdk_pango_context_get_for_screen(). Changing the
default set of font options does not affect contexts that
have already been created.
a #GdkScreen
a #cairo_font_options_t, or %NULL to unset any
previously set default font options.
Sets the resolution for font handling on the screen. This is a
scale factor between points specified in a #PangoFontDescription
and cairo units. The default value is 96, meaning that a 10 point
font will be 13 units high. (10 * 96. / 72. = 13.3).
a #GdkScreen
the resolution in "dots per inch". (Physical inches aren't actually
involved; the terminology is conventional.)
The ::composited-changed signal is emitted when the composited
status of the screen changes
The ::monitors-changed signal is emitted when the number, size
or position of the monitors attached to the screen change.
Only for X11 and OS X for now. A future implementation for Win32
may be a possibility.
The ::size-changed signal is emitted when the pixel width or
height of a screen changes.
Get the visual with the most available colors for the default
GDK screen. The return value should not be freed.
best visual
Get the best available depth for the default GDK screen. "Best"
means "largest," i.e. 32 preferred over 24 preferred over 8 bits
per pixel.
best available depth
Return the best available visual type for the default GDK screen.
best visual type
Combines gdk_visual_get_best_with_depth() and gdk_visual_get_best_with_type().
best visual with both @depth and
@visual_type, or %NULL if none
a bit depth
a visual type
Get the best visual with depth @depth for the default GDK screen.
Color visuals and visuals with mutable colormaps are preferred
over grayscale or fixed-colormap visuals. The return value should not
be freed. %NULL may be returned if no visual supports @depth.
best visual for the given depth
a bit depth
Get the best visual of the given @visual_type for the default GDK screen.
Visuals with higher color depths are considered better. The return value
should not be freed. %NULL may be returned if no visual has type
@visual_type.
best visual of the given type
a visual type
Get the system's default visual for the default GDK screen.
This is the visual for the root window of the display.
The return value should not be freed.
system visual
Returns the number of significant bits per red, green and blue value.
The number of significant bits per color value for @visual.
a #GdkVisual
Obtains values that are needed to calculate blue pixel values in TrueColor
and DirectColor. The "mask" is the significant bits within the pixel.
The "shift" is the number of bits left we must shift a primary for it
to be in position (according to the "mask"). Finally, "precision" refers
to how much precision the pixel value contains for a particular primary.
a #GdkVisual
A pointer to a #guint32 to be filled in, or %NULL.
A pointer to a #gint to be filled in, or %NULL.
A pointer to a #gint to be filled in, or %NULL.
Returns the byte order of this visual.
A #GdkByteOrder stating the byte order of @visual.
A #GdkVisual.
Returns the size of a colormap for this visual.
The size of a colormap that is suitable for @visual.
A #GdkVisual.
Returns the bit depth of this visual.
The bit depth of this visual.
A #GdkVisual.
Obtains values that are needed to calculate green pixel values in TrueColor
and DirectColor. The "mask" is the significant bits within the pixel.
The "shift" is the number of bits left we must shift a primary for it
to be in position (according to the "mask"). Finally, "precision" refers
to how much precision the pixel value contains for a particular primary.
a #GdkVisual
A pointer to a #guint32 to be filled in, or %NULL.
A pointer to a #gint to be filled in, or %NULL.
A pointer to a #gint to be filled in, or %NULL.
Obtains values that are needed to calculate red pixel values in TrueColor
and DirectColor. The "mask" is the significant bits within the pixel.
The "shift" is the number of bits left we must shift a primary for it
to be in position (according to the "mask"). Finally, "precision" refers
to how much precision the pixel value contains for a particular primary.
A #GdkVisual.
A pointer to a #guint32 to be filled in, or %NULL.
A pointer to a #gint to be filled in, or %NULL.
A pointer to a #gint to be filled in, or %NULL.
Gets the screen to which this visual belongs
the screen to which this visual belongs.
a #GdkVisual
Returns the type of visual this is (PseudoColor, TrueColor, etc).
A #GdkVisualType stating the type of @visual.
A #GdkVisual.
Adds an event filter to @window, allowing you to intercept events
before they reach GDK. This is a low-level operation and makes it
easy to break GDK and/or GTK+, so you have to know what you're
doing. Pass %NULL for @window to get all events for all windows,
instead of events for a specific window.
See gdk_display_add_client_message_filter() if you are interested
in X ClientMessage events.
a #GdkWindow
filter callback
data to pass to filter callback
Emits a short beep associated to @window in the appropriate
display, if supported. Otherwise, emits a short beep on
the display just as gdk_display_beep().
a toplevel #GdkWindow
Begins a window move operation (for a toplevel window). You might
use this function to implement a "window move grip," for
example. The function works best with window managers that support
the <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
Window Manager Hints</ulink>, but has a fallback implementation for
other window managers.
a toplevel #GdkWindow
the button being used to drag
root window X coordinate of mouse click that began the drag
root window Y coordinate of mouse click that began the drag
timestamp of mouse click that began the drag
A convenience wrapper around gdk_window_begin_paint_region() which
creates a rectangular region for you. See
gdk_window_begin_paint_region() for details.
a #GdkWindow
rectangle you intend to draw to
Indicates that you are beginning the process of redrawing @region.
A backing store (offscreen buffer) large enough to contain @region
will be created. The backing store will be initialized with the
background color or background pixmap for @window. Then, all
drawing operations performed on @window will be diverted to the
backing store. When you call gdk_window_end_paint(), the backing
store will be copied to @window, making it visible onscreen. Only
the part of @window contained in @region will be modified; that is,
drawing operations are clipped to @region.
The net result of all this is to remove flicker, because the user
sees the finished product appear all at once when you call
gdk_window_end_paint(). If you draw to @window directly without
calling gdk_window_begin_paint_region(), the user may see flicker
as individual drawing operations are performed in sequence. The
clipping and background-initializing features of
gdk_window_begin_paint_region() are conveniences for the
programmer, so you can avoid doing that work yourself.
When using GTK+, the widget system automatically places calls to
gdk_window_begin_paint_region() and gdk_window_end_paint() around
emissions of the expose_event signal. That is, if you're writing an
expose event handler, you can assume that the exposed area in
#GdkEventExpose has already been cleared to the window background,
is already set as the clip region, and already has a backing store.
Therefore in most cases, application code need not call
gdk_window_begin_paint_region(). (You can disable the automatic
calls around expose events on a widget-by-widget basis by calling
gtk_widget_set_double_buffered().)
If you call this function multiple times before calling the
matching gdk_window_end_paint(), the backing stores are pushed onto
a stack. gdk_window_end_paint() copies the topmost backing store
onscreen, subtracts the topmost region from all other regions in
the stack, and pops the stack. All drawing operations affect only
the topmost backing store in the stack. One matching call to
gdk_window_end_paint() is required for each call to
gdk_window_begin_paint_region().
a #GdkWindow
region you intend to draw to
Begins a window resize operation (for a toplevel window).
You might use this function to implement a "window resize grip," for
example; in fact #GtkStatusbar uses it. The function works best
with window managers that support the <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended Window Manager Hints</ulink>, but has a
fallback implementation for other window managers.
a toplevel #GdkWindow
the edge or corner from which the drag is started
the button being used to drag
root window X coordinate of mouse click that began the drag
root window Y coordinate of mouse click that began the drag
timestamp of mouse click that began the drag (use gdk_event_get_time())
Clears an entire @window to the background color or background pixmap.
a #GdkWindow
Clears an area of @window to the background color or background pixmap.
a #GdkWindow
x coordinate of rectangle to clear
y coordinate of rectangle to clear
width of rectangle to clear
height of rectangle to clear
Like gdk_window_clear_area(), but also generates an expose event for
the cleared area.
This function has a stupid name because it dates back to the mists
time, pre-GDK-1.0.
a #GdkWindow
x coordinate of rectangle to clear
y coordinate of rectangle to clear
width of rectangle to clear
height of rectangle to clear
Signal to the window system that the application has finished
handling Configure events it has received. Window Managers can
use this to better synchronize the frame repaint with the
application. GTK+ applications will automatically call this
function when appropriate.
This function can only be called if gdk_window_enable_synchronized_configure()
was called previously.
a toplevel #GdkWindow
Transforms window coordinates from a parent window to a child
window, where the parent window is the normal parent as returned by
gdk_window_get_parent() for normal windows, and the window's
embedder as returned by gdk_offscreen_window_get_embedder() for
offscreen windows.
For normal windows, calling this function is equivalent to subtracting
the return values of gdk_window_get_position() from the parent coordinates.
For offscreen windows however (which can be arbitrarily transformed),
this function calls the GdkWindow::from-embedder: signal to translate
the coordinates.
You should always use this function when writing generic code that
walks down a window hierarchy.
See also: gdk_window_coords_to_parent()
a child window
X coordinate in parent's coordinate system
Y coordinate in parent's coordinate system
return location for X coordinate in child's coordinate system
return location for Y coordinate in child's coordinate system
Transforms window coordinates from a child window to its parent
window, where the parent window is the normal parent as returned by
gdk_window_get_parent() for normal windows, and the window's
embedder as returned by gdk_offscreen_window_get_embedder() for
offscreen windows.
For normal windows, calling this function is equivalent to adding
the return values of gdk_window_get_position() to the child coordinates.
For offscreen windows however (which can be arbitrarily transformed),
this function calls the GdkWindow::to-embedder: signal to translate
the coordinates.
You should always use this function when writing generic code that
walks up a window hierarchy.
See also: gdk_window_coords_from_parent()
a child window
X coordinate in child's coordinate system
Y coordinate in child's coordinate system
return location for X coordinate
in parent's coordinate system, or %NULL
return location for Y coordinate
in parent's coordinate system, or %NULL
Create a new surface that is as compatible as possible with the
given @window. For example the new surface will have the same
fallback resolution and font options as @window. Generally, the new
surface will also use the same backend as @window, unless that is
not possible for some reason. The type of the returned surface may
be examined with cairo_surface_get_type().
Initially the surface contents are all 0 (transparent if contents
have transparency, black otherwise.)
a pointer to the newly allocated surface. The caller
owns the surface and should call cairo_surface_destroy() when done
with it.
This function always returns a valid pointer, but it will return a
pointer to a "nil" surface if @other is already in an error state
or any other error occurs.
window to make new surface similar to
the content for the new surface
width of the new surface
height of the new surface
Attempt to deiconify (unminimize) @window. On X11 the window manager may
choose to ignore the request to deiconify. When using GTK+,
use gtk_window_deiconify() instead of the #GdkWindow variant. Or better yet,
you probably want to use gtk_window_present(), which raises the window, focuses it,
unminimizes it, and puts it on the current desktop.
a toplevel #GdkWindow
Destroys the window system resources associated with @window and decrements @window's
reference count. The window system resources for all children of @window are also
destroyed, but the children's reference counts are not decremented.
Note that a window will not be destroyed automatically when its reference count
reaches zero. You must call this function yourself before that happens.
a #GdkWindow
Indicates that the application will cooperate with the window
system in synchronizing the window repaint with the window
manager during resizing operations. After an application calls
this function, it must call gdk_window_configure_finished() every
time it has finished all processing associated with a set of
Configure events. Toplevel GTK+ windows automatically use this
protocol.
On X, calling this function makes @window participate in the
_NET_WM_SYNC_REQUEST window manager protocol.
a toplevel #GdkWindow
Indicates that the backing store created by the most recent call to
gdk_window_begin_paint_region() should be copied onscreen and
deleted, leaving the next-most-recent backing store or no backing
store at all as the active paint region. See
gdk_window_begin_paint_region() for full details. It is an error to
call this function without a matching
gdk_window_begin_paint_region() first.
a #GdkWindow
Tries to ensure that there is a window-system native window for this
GdkWindow. This may fail in some situations, returning %FALSE.
Offscreen window and children of them can never have native windows.
Some backends may not support native child windows.
%TRUE if the window has a native window, %FALSE otherwise
a #GdkWindow
Flush all outstanding cached operations on a window, leaving the
window in a state which reflects all that has been drawn before.
Gdk uses multiple kinds of caching to get better performance and
nicer drawing. For instance, during exposes all paints to a window
using double buffered rendering are keep on a pixmap until the last
window has been exposed. It also delays window moves/scrolls until
as long as possible until next update to avoid tearing when moving
windows.
Normally this should be completely invisible to applications, as
we automatically flush the windows when required, but this might
be needed if you for instance mix direct native drawing with
gdk drawing. For Gtk widgets that don't use double buffering this
will be called automatically before sending the expose event.
a #GdkWindow
Sets keyboard focus to @window. In most cases, gtk_window_present()
should be used on a #GtkWindow, rather than calling this function.
a #GdkWindow
timestamp of the event triggering the window focus
Temporarily freezes a window and all its descendants such that it won't
receive expose events. The window will begin receiving expose events
again when gdk_window_thaw_toplevel_updates_libgtk_only() is called. If
gdk_window_freeze_toplevel_updates_libgtk_only()
has been called more than once,
gdk_window_thaw_toplevel_updates_libgtk_only() must be called
an equal number of times to begin processing exposes.
This function is not part of the GDK public API and is only
for use by GTK+.
a #GdkWindow
Temporarily freezes a window such that it won't receive expose
events. The window will begin receiving expose events again when
gdk_window_thaw_updates() is called. If gdk_window_freeze_updates()
has been called more than once, gdk_window_thaw_updates() must be called
an equal number of times to begin processing exposes.
a #GdkWindow
Moves the window into fullscreen mode. This means the
window covers the entire screen and is above any panels
or task bars.
If the window was already fullscreen, then this function does nothing.
On X11, asks the window manager to put @window in a fullscreen
state, if the window manager supports this operation. Not all
window managers support this, and some deliberately ignore it or
don't have a concept of "fullscreen"; so you can't rely on the
fullscreenification actually happening. But it will happen with
most standard window managers, and GDK makes a best effort to get
it to happen.
a toplevel #GdkWindow
This function informs GDK that the geometry of an embedded
offscreen window has changed. This is necessary for GDK to keep
track of which offscreen window the pointer is in.
an embedded offscreen #GdkWindow
Determines whether or not the desktop environment shuld be hinted that
the window does not want to receive input focus.
whether or not the window should receive input focus.
a toplevel #GdkWindow.
Gets the pattern used to clear the background on @window. If @window
does not have its own background and reuses the parent's, %NULL is
returned and you'll have to query it yourself.
The pattern to use for the background or
%NULL to use the parent's background.
a window
Gets the list of children of @window known to GDK.
This function only returns children created via GDK,
so for example it's useless when used with the root window;
it only returns windows an application created itself.
The returned list must be freed, but the elements in the
list need not be.
list of child windows inside @window
a #GdkWindow
Determines whether @window is composited.
See gdk_window_set_composited().
%TRUE if the window is composited.
a #GdkWindow
Retrieves a #GdkCursor pointer for the cursor currently set on the
specified #GdkWindow, or %NULL. If the return value is %NULL then
there is no custom cursor set on the specified window, and it is
using the cursor for its parent window.
a #GdkCursor, or %NULL. The returned
object is owned by the #GdkWindow and should not be unreferenced
directly. Use gdk_window_set_cursor() to unset the cursor of the
window
a #GdkWindow
Returns the decorations set on the GdkWindow with #gdk_window_set_decorations
TRUE if the window has decorations set, FALSE otherwise.
The toplevel #GdkWindow to get the decorations from
The window decorations will be written here
This gets the origin of a #GdkWindow relative to
an Enlightenment-window-manager desktop. As long as you don't
assume that the user's desktop/workspace covers the entire
root window (i.e. you don't assume that the desktop begins
at root window coordinate 0,0) this function is not necessary.
It's deprecated for that reason.
not meaningful
a toplevel #GdkWindow
return location for X coordinate
return location for Y coordinate
Gets the #GdkDisplay associated with a #GdkWindow.
the #GdkDisplay associated with @window
a #GdkWindow
Obtains the parent of @window, as known to GDK. Works like
gdk_window_get_parent() for normal windows, but returns the
window's embedder for offscreen windows.
See also: gdk_offscreen_window_get_embedder()
effective parent of @window
a #GdkWindow
Gets the toplevel window that's an ancestor of @window.
Works like gdk_window_get_toplevel(), but treats an offscreen window's
embedder as its parent, using gdk_window_get_effective_parent().
See also: gdk_offscreen_window_get_embedder()
the effective toplevel window containing @window
a #GdkWindow
Gets the event mask for @window. See gdk_window_set_events().
event mask for @window
a #GdkWindow
Determines whether or not the desktop environment should be hinted that the
window does not want to receive input focus when it is mapped.
whether or not the window wants to receive input focus when
it is mapped.
a toplevel #GdkWindow.
Obtains the bounding box of the window, including window manager
titlebar/borders if any. The frame position is given in root window
coordinates. To get the position of the window itself (rather than
the frame) in root window coordinates, use gdk_window_get_origin().
a toplevel #GdkWindow
rectangle to fill with bounding box of the window frame
Any of the return location arguments to this function may be %NULL,
if you aren't interested in getting the value of that field.
The X and Y coordinates returned are relative to the parent window
of @window, which for toplevels usually means relative to the
window decorations (titlebar, etc.) rather than relative to the
root window (screen-size background window).
On the X11 platform, the geometry is obtained from the X server,
so reflects the latest position of @window; this may be out-of-sync
with the position of @window delivered in the most-recently-processed
#GdkEventConfigure. gdk_window_get_position() in contrast gets the
position from the most recent configure event.
<note>
If @window is not a toplevel, it is <emphasis>much</emphasis> better
to call gdk_window_get_position() and gdk_drawable_get_size() instead,
because it avoids the roundtrip to the X server and because
gdk_drawable_get_size() supports the full 32-bit coordinate space,
whereas gdk_window_get_geometry() is restricted to the 16-bit
coordinates of X11.
</note>
a #GdkWindow
return location for X coordinate of window (relative to its parent)
return location for Y coordinate of window (relative to its parent)
return location for width of window
return location for height of window
return location for bit depth of window
Returns the group leader window for @window. See gdk_window_set_group().
the group leader window for @window
a toplevel #GdkWindow
Returns the height of the given @window.
On the X11 platform the returned size is the size reported in the
most-recently-processed configure event, rather than the current
size on the X server.
The height of @window
a #GdkWindow
If you bypass the GDK layer and use windowing system primitives to
draw directly onto a #GdkWindow, then you need to deal with two
details: there may be an offset between GDK coordinates and windowing
system coordinates, and GDK may have redirected drawing to a offscreen
pixmap as the result of a gdk_window_begin_paint_region() calls.
This function allows retrieving the information you need to compensate
for these effects.
This function exposes details of the GDK implementation, and is thus
likely to change in future releases of GDK.
a #GdkWindow
location to store the drawable to which drawing should be
done.
location to store the X offset between coordinates in @window,
and the underlying window system primitive coordinates for
*@real_drawable.
location to store the Y offset between coordinates in @window,
and the underlying window system primitive coordinates for
*@real_drawable.
Determines whether or not the window manager is hinted that @window
has modal behaviour.
whether or not the window has the modal hint set.
A toplevel #GdkWindow.
Obtains the position of a window in root window coordinates.
(Compare with gdk_window_get_position() and
gdk_window_get_geometry() which return the position of a window
relative to its parent window.)
not meaningful, ignore
a #GdkWindow
return location for X coordinate
return location for Y coordinate
Obtains the parent of @window, as known to GDK. Does not query the
X server; thus this returns the parent as passed to gdk_window_new(),
not the actual parent. This should never matter unless you're using
Xlib calls mixed with GDK calls on the X11 platform. It may also
matter for toplevel windows, because the window manager may choose
to reparent them.
Note that you should use gdk_window_get_effective_parent() when
writing generic code that walks up a window hierarchy, because
gdk_window_get_parent() will most likely not do what you expect if
there are offscreen windows in the hierarchy.
parent of @window
a #GdkWindow
Obtains the current pointer position and modifier state.
The position is given in coordinates relative to the upper left
corner of @window.
the window containing the pointer (as with
gdk_window_at_pointer()), or %NULL if the window containing the
pointer isn't known to GDK
a #GdkWindow
return location for X coordinate of pointer or %NULL to not
return the X coordinate
return location for Y coordinate of pointer or %NULL to not
return the Y coordinate
return location for modifier mask or %NULL to not return the
modifier mask
Obtains the position of the window as reported in the
most-recently-processed #GdkEventConfigure. Contrast with
gdk_window_get_geometry() which queries the X server for the
current window position, regardless of which events have been
received or processed.
The position coordinates are relative to the window's parent window.
a #GdkWindow
X coordinate of window
Y coordinate of window
Obtains the position of a window position in root
window coordinates. This is similar to
gdk_window_get_origin() but allows you go pass
in any position in the window, not just the origin.
a #GdkWindow
X coordinate in window
Y coordinate in window
return location for X coordinate
return location for Y coordinate
Obtains the top-left corner of the window manager frame in root
window coordinates.
a toplevel #GdkWindow
return location for X position of window frame
return location for Y position of window frame
Gets the #GdkScreen associated with a #GdkWindow.
the #GdkScreen associated with @window
a #GdkWindow
Gets the bitwise OR of the currently active window state flags,
from the #GdkWindowState enumeration.
window state bitfield
a #GdkWindow
Gets the toplevel window that's an ancestor of @window.
Any window type but %GDK_WINDOW_CHILD is considered a
toplevel window, as is a %GDK_WINDOW_CHILD window that
has a root window as parent.
Note that you should use gdk_window_get_effective_toplevel() when
you want to get to a window's toplevel as seen on screen, because
gdk_window_get_toplevel() will most likely not do what you expect
if there are offscreen windows in the hierarchy.
the toplevel window containing @window
a #GdkWindow
This function returns the type hint set for a window.
The type hint set for @window
A toplevel #GdkWindow
Transfers ownership of the update area from @window to the caller
of the function. That is, after calling this function, @window will
no longer have an invalid/dirty region; the update area is removed
from @window and handed to you. If a window has no update area,
gdk_window_get_update_area() returns %NULL. You are responsible for
calling gdk_region_destroy() on the returned region if it's non-%NULL.
the update area for @window
a #GdkWindow
Retrieves the user data for @window, which is normally the widget
that @window belongs to. See gdk_window_set_user_data().
a #GdkWindow
return location for user data
Gets the #GdkVisual describing the pixel format of @window.
a #GdkVisual
a #GdkWindow
Returns the width of the given @window.
On the X11 platform the returned size is the size reported in the
most-recently-processed configure event, rather than the current
size on the X server.
The width of @window
a #GdkWindow
Gets the type of the window. See #GdkWindowType.
type of window
a #GdkWindow
Checks whether the window has a native window or not. Note that
you can use gdk_window_ensure_native() if a native window is needed.
%TRUE if the %window has a native window, %FALSE otherwise.
a #GdkWindow
For toplevel windows, withdraws them, so they will no longer be
known to the window manager; for all windows, unmaps them, so
they won't be displayed. Normally done automatically as
part of gtk_widget_hide().
a #GdkWindow
Asks to iconify (minimize) @window. The window manager may choose
to ignore the request, but normally will honor it. Using
gtk_window_iconify() is preferred, if you have a #GtkWindow widget.
This function only makes sense when @window is a toplevel window.
a toplevel #GdkWindow
Like gdk_window_shape_combine_mask(), but the shape applies
only to event handling. Mouse events which happen while
the pointer position corresponds to an unset bit in the
mask will be passed on the window below @window.
An input shape is typically used with RGBA windows.
The alpha channel of the window defines which pixels are
invisible and allows for nicely antialiased borders,
and the input shape controls where the window is
"clickable".
On the X11 platform, this requires version 1.1 of the
shape extension.
On the Win32 platform, this functionality is not present and the
function does nothing.
a #GdkWindow
shape mask, or %NULL
X position of shape mask with respect to @window
Y position of shape mask with respect to @window
Like gdk_window_shape_combine_region(), but the shape applies
only to event handling. Mouse events which happen while
the pointer position corresponds to an unset bit in the
mask will be passed on the window below @window.
An input shape is typically used with RGBA windows.
The alpha channel of the window defines which pixels are
invisible and allows for nicely antialiased borders,
and the input shape controls where the window is
"clickable".
On the X11 platform, this requires version 1.1 of the
shape extension.
On the Win32 platform, this functionality is not present and the
function does nothing.
a #GdkWindow
region of window to be non-transparent
X position of @shape_region in @window coordinates
Y position of @shape_region in @window coordinates
Adds @region to the update area for @window. The update area is the
region that needs to be redrawn, or "dirty region." The call
gdk_window_process_updates() sends one or more expose events to the
window, which together cover the entire update area. An
application would normally redraw the contents of @window in
response to those expose events.
GDK will call gdk_window_process_all_updates() on your behalf
whenever your program returns to the main loop and becomes idle, so
normally there's no need to do that manually, you just need to
invalidate regions that you know should be redrawn.
The @child_func parameter controls whether the region of
each child window that intersects @region will also be invalidated.
Only children for which @child_func returns TRUE will have the area
invalidated.
a #GdkWindow
a #GdkRegion
function to use to decide if to recurse to a child,
%NULL means never recurse.
data passed to @child_func
A convenience wrapper around gdk_window_invalidate_region() which
invalidates a rectangular region. See
gdk_window_invalidate_region() for details.
a #GdkWindow
rectangle to invalidate or %NULL to invalidate the whole
window
whether to also invalidate child windows
Adds @region to the update area for @window. The update area is the
region that needs to be redrawn, or "dirty region." The call
gdk_window_process_updates() sends one or more expose events to the
window, which together cover the entire update area. An
application would normally redraw the contents of @window in
response to those expose events.
GDK will call gdk_window_process_all_updates() on your behalf
whenever your program returns to the main loop and becomes idle, so
normally there's no need to do that manually, you just need to
invalidate regions that you know should be redrawn.
The @invalidate_children parameter controls whether the region of
each child window that intersects @region will also be invalidated.
If %FALSE, then the update area for child windows will remain
unaffected. See gdk_window_invalidate_maybe_recurse if you need
fine grained control over which children are invalidated.
a #GdkWindow
a #GdkRegion
%TRUE to also invalidate child windows
Check to see if a window is destroyed..
%TRUE if the window is destroyed
a #GdkWindow
Determines whether or not the window is an input only window.
%TRUE if @window is input only
a toplevel #GdkWindow
Determines whether or not the window is shaped.
%TRUE if @window is shaped
a toplevel #GdkWindow
Check if the window and all ancestors of the window are
mapped. (This is not necessarily "viewable" in the X sense, since
we only check as far as we have GDK window parents, not to the root
window.)
%TRUE if the window is viewable
a #GdkWindow
Checks whether the window has been mapped (with gdk_window_show() or
gdk_window_show_unraised()).
%TRUE if the window is mapped
a #GdkWindow
Lowers @window to the bottom of the Z-order (stacking order), so that
other windows with the same parent window appear above @window.
This is true whether or not the other windows are visible.
If @window is a toplevel, the window manager may choose to deny the
request to move the window in the Z-order, gdk_window_lower() only
requests the restack, does not guarantee it.
Note that gdk_window_show() raises the window again, so don't call this
function before gdk_window_show(). (Try gdk_window_show_unraised().)
a #GdkWindow
Maximizes the window. If the window was already maximized, then
this function does nothing.
On X11, asks the window manager to maximize @window, if the window
manager supports this operation. Not all window managers support
this, and some deliberately ignore it or don't have a concept of
"maximized"; so you can't rely on the maximization actually
happening. But it will happen with most standard window managers,
and GDK makes a best effort to get it to happen.
On Windows, reliably maximizes the window.
a toplevel #GdkWindow
Merges the input shape masks for any child windows into the
input shape mask for @window. i.e. the union of all input masks
for @window and its children will become the new input mask
for @window. See gdk_window_input_shape_combine_mask().
This function is distinct from gdk_window_set_child_input_shapes()
because it includes @window's input shape mask in the set of
shapes to be merged.
a #GdkWindow
Merges the shape masks for any child windows into the
shape mask for @window. i.e. the union of all masks
for @window and its children will become the new mask
for @window. See gdk_window_shape_combine_mask().
This function is distinct from gdk_window_set_child_shapes()
because it includes @window's shape mask in the set of shapes to
be merged.
a #GdkWindow
Repositions a window relative to its parent window.
For toplevel windows, window managers may ignore or modify the move;
you should probably use gtk_window_move() on a #GtkWindow widget
anyway, instead of using GDK functions. For child windows,
the move will reliably succeed.
If you're also planning to resize the window, use gdk_window_move_resize()
to both move and resize simultaneously, for a nicer visual effect.
a #GdkWindow
X coordinate relative to window's parent
Y coordinate relative to window's parent
Move the part of @window indicated by @region by @dy pixels in the Y
direction and @dx pixels in the X direction. The portions of @region
that not covered by the new position of @region are invalidated.
Child windows are not moved.
a #GdkWindow
The #GdkRegion to move
Amount to move in the X direction
Amount to move in the Y direction
Equivalent to calling gdk_window_move() and gdk_window_resize(),
except that both operations are performed at once, avoiding strange
visual effects. (i.e. the user may be able to see the window first
move, then resize, if you don't use gdk_window_move_resize().)
a #GdkWindow
new X position relative to window's parent
new Y position relative to window's parent
new width
new height
Creates a new #GdkWindow using the attributes from
@attributes. See #GdkWindowAttr and #GdkWindowAttributesType for
more details. Note: to use this on displays other than the default
display, @parent must be specified.
the new #GdkWindow
a #GdkWindow, or %NULL to create the window as a child of
the default root window for the default display.
attributes of the new window
mask indicating which fields in @attributes are valid
Like gdk_window_get_children(), but does not copy the list of
children, so the list does not need to be freed.
a reference to the list of child windows in @window
a #GdkWindow
Sends one or more expose events to @window. The areas in each
expose event will cover the entire update area for the window (see
gdk_window_invalidate_region() for details). Normally GDK calls
gdk_window_process_all_updates() on your behalf, so there's no
need to call this function unless you want to force expose events
to be delivered immediately and synchronously (vs. the usual
case, where GDK delivers them in an idle handler). Occasionally
this is useful to produce nicer scrolling behavior, for example.
a #GdkWindow
whether to also process updates for child windows
Raises @window to the top of the Z-order (stacking order), so that
other windows with the same parent window appear below @window.
This is true whether or not the windows are visible.
If @window is a toplevel, the window manager may choose to deny the
request to move the window in the Z-order, gdk_window_raise() only
requests the restack, does not guarantee it.
a #GdkWindow
Redirects drawing into @window so that drawing to the
window in the rectangle specified by @src_x, @src_y,
@width and @height is also drawn into @drawable at
@dest_x, @dest_y.
Only drawing between gdk_window_begin_paint_region() or
gdk_window_begin_paint_rect() and gdk_window_end_paint() is
redirected.
Redirection is active until gdk_window_remove_redirection()
is called.
a #GdkWindow
a #GdkDrawable
x position in @window
y position in @window
x position in @drawable
y position in @drawable
width of redirection, or -1 to use the width of @window
height of redirection or -1 to use the height of @window
Remove a filter previously added with gdk_window_add_filter().
a #GdkWindow
previously-added filter function
user data for previously-added filter function
Removes any active redirection started by
gdk_window_redirect_to_drawable().
a #GdkWindow
Reparents @window into the given @new_parent. The window being
reparented will be unmapped as a side effect.
a #GdkWindow
new parent to move @window into
X location inside the new parent
Y location inside the new parent
Resizes @window; for toplevel windows, asks the window manager to resize
the window. The window manager may not allow the resize. When using GTK+,
use gtk_window_resize() instead of this low-level GDK function.
Windows may not be resized below 1x1.
If you're also planning to move the window, use gdk_window_move_resize()
to both move and resize simultaneously, for a nicer visual effect.
a #GdkWindow
new width of the window
new height of the window
Changes the position of @window in the Z-order (stacking order), so that
it is above @sibling (if @above is %TRUE) or below @sibling (if @above is
%FALSE).
If @sibling is %NULL, then this either raises (if @above is %TRUE) or
lowers the window.
If @window is a toplevel, the window manager may choose to deny the
request to move the window in the Z-order, gdk_window_restack() only
requests the restack, does not guarantee it.
a #GdkWindow
a #GdkWindow that is a sibling of @window, or %NULL
a boolean
Scroll the contents of @window, both pixels and children, by the
given amount. @window itself does not move. Portions of the window
that the scroll operation brings in from offscreen areas are
invalidated. The invalidated region may be bigger than what would
strictly be necessary.
For X11, a minimum area will be invalidated if the window has no
subwindows, or if the edges of the window's parent do not extend
beyond the edges of the window. In other cases, a multi-step process
is used to scroll the window which may produce temporary visual
artifacts and unnecessary invalidations.
a #GdkWindow
Amount to scroll in the X direction
Amount to scroll in the Y direction
Setting @accept_focus to %FALSE hints the desktop environment that the
window doesn't want to receive input focus.
On X, it is the responsibility of the window manager to interpret this
hint. ICCCM-compliant window manager usually respect it.
a toplevel #GdkWindow
%TRUE if the window should receive input focus
Sets the background pixmap of @window. May also be used to set a
background of "None" on @window, by setting a background pixmap
of %NULL.
A background pixmap will be tiled, positioning the first tile at
the origin of @window, or if @parent_relative is %TRUE, the tiling
will be done based on the origin of the parent window (useful to
align tiles in a parent with tiles in a child).
A background pixmap of %NULL means that the window will have no
background. A window with no background will never have its
background filled by the windowing system, instead the window will
contain whatever pixels were already in the corresponding area of
the display.
The windowing system will normally fill a window with its background
when the window is obscured then exposed, and when you call
gdk_window_clear().
a #GdkWindow
a #GdkPixmap, or %NULL
whether the tiling origin is at the origin of
@window's parent
Sets the background color of @window. (However, when using GTK+,
set the background of a widget with gtk_widget_modify_bg() - if
you're an application - or gtk_style_set_background() - if you're
implementing a custom widget.)
The @color must be allocated; gdk_rgb_find_color() is the best way
to allocate a color.
See also gdk_window_set_back_pixmap().
a #GdkWindow
an allocated #GdkColor
Sets the input shape mask of @window to the union of input shape masks
for all children of @window, ignoring the input shape mask of @window
itself. Contrast with gdk_window_merge_child_input_shapes() which includes
the input shape mask of @window in the masks to be merged.
a #GdkWindow
Sets the shape mask of @window to the union of shape masks
for all children of @window, ignoring the shape mask of @window
itself. Contrast with gdk_window_merge_child_shapes() which includes
the shape mask of @window in the masks to be merged.
a #GdkWindow
Sets a #GdkWindow as composited, or unsets it. Composited
windows do not automatically have their contents drawn to
the screen. Drawing is redirected to an offscreen buffer
and an expose event is emitted on the parent of the composited
window. It is the responsibility of the parent's expose handler
to manually merge the off-screen content onto the screen in
whatever way it sees fit. See <xref linkend="composited-window-example"/>
for an example.
It only makes sense for child windows to be composited; see
gdk_window_set_opacity() if you need translucent toplevel
windows.
An additional effect of this call is that the area of this
window is no longer clipped from regions marked for
invalidation on its parent. Draws done on the parent
window are also no longer clipped by the child.
This call is only supported on some systems (currently,
only X11 with new enough Xcomposite and Xdamage extensions).
You must call gdk_display_supports_composite() to check if
setting a window as composited is supported before
attempting to do so.
a #GdkWindow
%TRUE to set the window as composited
Sets the mouse pointer for a #GdkWindow. Use gdk_cursor_new_for_display()
or gdk_cursor_new_from_pixmap() to create the cursor. To make the cursor
invisible, use %GDK_BLANK_CURSOR. Passing %NULL for the @cursor argument
to gdk_window_set_cursor() means that @window will use the cursor of its
parent window. Most windows should use this default.
a #GdkWindow
a cursor
"Decorations" are the features the window manager adds to a toplevel #GdkWindow.
This function sets the traditional Motif window manager hints that tell the
window manager which decorations you would like your window to have.
Usually you should use gtk_window_set_decorated() on a #GtkWindow instead of
using the GDK function directly.
The @decorations argument is the logical OR of the fields in
the #GdkWMDecoration enumeration. If #GDK_DECOR_ALL is included in the
mask, the other bits indicate which decorations should be turned off.
If #GDK_DECOR_ALL is not included, then the other bits indicate
which decorations should be turned on.
Most window managers honor a decorations hint of 0 to disable all decorations,
but very few honor all possible combinations of bits.
a toplevel #GdkWindow
decoration hint mask
The event mask for a window determines which events will be reported
for that window. For example, an event mask including #GDK_BUTTON_PRESS_MASK
means the window should report button press events. The event mask
is the bitwise OR of values from the #GdkEventMask enumeration.
a #GdkWindow
event mask for @window
Setting @focus_on_map to %FALSE hints the desktop environment that the
window doesn't want to receive input focus when it is mapped.
focus_on_map should be turned off for windows that aren't triggered
interactively (such as popups from network activity).
On X, it is the responsibility of the window manager to interpret
this hint. Window managers following the freedesktop.org window
manager extension specification should respect it.
a toplevel #GdkWindow
%TRUE if the window should receive input focus when mapped
Sets hints about the window management functions to make available
via buttons on the window frame.
On the X backend, this function sets the traditional Motif window
manager hint for this purpose. However, few window managers do
anything reliable or interesting with this hint. Many ignore it
entirely.
The @functions argument is the logical OR of values from the
#GdkWMFunction enumeration. If the bitmask includes #GDK_FUNC_ALL,
then the other bits indicate which functions to disable; if
it doesn't include #GDK_FUNC_ALL, it indicates which functions to
enable.
a toplevel #GdkWindow
bitmask of operations to allow on @window
Sets the geometry hints for @window. Hints flagged in @geom_mask
are set, hints not flagged in @geom_mask are unset.
To unset all hints, use a @geom_mask of 0 and a @geometry of %NULL.
This function provides hints to the windowing system about
acceptable sizes for a toplevel window. The purpose of
this is to constrain user resizing, but the windowing system
will typically (but is not required to) also constrain the
current size of the window to the provided values and
constrain programatic resizing via gdk_window_resize() or
gdk_window_move_resize().
Note that on X11, this effect has no effect on windows
of type %GDK_WINDOW_TEMP or windows where override redirect
has been turned on via gdk_window_set_override_redirect()
since these windows are not resizable by the user.
Since you can't count on the windowing system doing the
constraints for programmatic resizes, you should generally
call gdk_window_constrain_size() yourself to determine
appropriate sizes.
a toplevel #GdkWindow
geometry hints
bitmask indicating fields of @geometry to pay attention to
Sets the group leader window for @window. By default,
GDK sets the group leader for all toplevel windows
to a global window implicitly created by GDK. With this function
you can override this default.
The group leader window allows the window manager to distinguish
all windows that belong to a single application. It may for example
allow users to minimize/unminimize all windows belonging to an
application at once. You should only set a non-default group window
if your application pretends to be multiple applications.
a toplevel #GdkWindow
group leader window, or %NULL to restore the default group leader window
This function is broken and useless and you should ignore it.
If using GTK+, use functions such as gtk_window_resize(), gtk_window_set_size_request(),
gtk_window_move(), gtk_window_parse_geometry(), and gtk_window_set_geometry_hints(),
depending on what you're trying to do.
If using GDK directly, use gdk_window_set_geometry_hints().
a #GdkWindow
ignored field, does not matter
ignored field, does not matter
minimum width hint
minimum height hint
max width hint
max height hint
logical OR of GDK_HINT_POS, GDK_HINT_MIN_SIZE, and/or GDK_HINT_MAX_SIZE
Sets the icon of @window as a pixmap or window. If using GTK+, investigate
gtk_window_set_default_icon_list() first, and then gtk_window_set_icon_list()
and gtk_window_set_icon(). If those don't meet your needs, look at
gdk_window_set_icon_list(). Only if all those are too high-level do you
want to fall back to gdk_window_set_icon().
a toplevel #GdkWindow
a #GdkWindow to use for the icon, or %NULL to unset
a #GdkPixmap to use as the icon, or %NULL to unset
a 1-bit pixmap (#GdkBitmap) to use as mask for @pixmap, or %NULL to have none
Sets a list of icons for the window. One of these will be used
to represent the window when it has been iconified. The icon is
usually shown in an icon box or some sort of task bar. Which icon
size is shown depends on the window manager. The window manager
can scale the icon but setting several size icons can give better
image quality since the window manager may only need to scale the
icon by a small amount or not at all.
The #GdkWindow toplevel window to set the icon of.
A list of pixbufs, of different sizes.
Windows may have a name used while minimized, distinct from the
name they display in their titlebar. Most of the time this is a bad
idea from a user interface standpoint. But you can set such a name
with this function, if you like.
After calling this with a non-%NULL @name, calls to gdk_window_set_title()
will not update the icon title.
Using %NULL for @name unsets the icon title; further calls to
gdk_window_set_title() will again update the icon title as well.
a toplevel #GdkWindow
name of window while iconified (minimized)
Set if @window must be kept above other windows. If the
window was already above, then this function does nothing.
On X11, asks the window manager to keep @window above, if the window
manager supports this operation. Not all window managers support
this, and some deliberately ignore it or don't have a concept of
"keep above"; so you can't rely on the window being kept above.
But it will happen with most standard window managers,
and GDK makes a best effort to get it to happen.
a toplevel #GdkWindow
whether to keep @window above other windows
Set if @window must be kept below other windows. If the
window was already below, then this function does nothing.
On X11, asks the window manager to keep @window below, if the window
manager supports this operation. Not all window managers support
this, and some deliberately ignore it or don't have a concept of
"keep below"; so you can't rely on the window being kept below.
But it will happen with most standard window managers,
and GDK makes a best effort to get it to happen.
a toplevel #GdkWindow
whether to keep @window below other windows
The application can use this hint to tell the window manager
that a certain window has modal behaviour. The window manager
can use this information to handle modal windows in a special
way.
You should only use this on windows for which you have
previously called gdk_window_set_transient_for()
A toplevel #GdkWindow
%TRUE if the window is modal, %FALSE otherwise.
Request the windowing system to make @window partially transparent,
with opacity 0 being fully transparent and 1 fully opaque. (Values
of the opacity parameter are clamped to the [0,1] range.)
On X11, this works only on X screens with a compositing manager
running.
For setting up per-pixel alpha, see gdk_screen_get_rgba_colormap().
For making non-toplevel windows translucent, see
gdk_window_set_composited().
a top-level #GdkWindow
opacity
An override redirect window is not under the control of the window manager.
This means it won't have a titlebar, won't be minimizable, etc. - it will
be entirely under the control of the application. The window manager
can't see the override redirect window at all.
Override redirect should only be used for short-lived temporary
windows, such as popup menus. #GtkMenu uses an override redirect
window in its implementation, for example.
a toplevel #GdkWindow
%TRUE if window should be override redirect
When using GTK+, typically you should use gtk_window_set_role() instead
of this low-level function.
The window manager and session manager use a window's role to
distinguish it from other kinds of window in the same application.
When an application is restarted after being saved in a previous
session, all windows with the same title and role are treated as
interchangeable. So if you have two windows with the same title
that should be distinguished for session management purposes, you
should set the role on those windows. It doesn't matter what string
you use for the role, as long as you have a different role for each
non-interchangeable kind of window.
a toplevel #GdkWindow
a string indicating its role
Toggles whether a window should appear in a pager (workspace
switcher, or other desktop utility program that displays a small
thumbnail representation of the windows on the desktop). If a
window's semantic type as specified with gdk_window_set_type_hint()
already fully describes the window, this function should
<emphasis>not</emphasis> be called in addition, instead you should
allow the window to be treated according to standard policy for
its semantic type.
a toplevel #GdkWindow
%TRUE to skip the pager
Toggles whether a window should appear in a task list or window
list. If a window's semantic type as specified with
gdk_window_set_type_hint() already fully describes the window, this
function should <emphasis>not</emphasis> be called in addition,
instead you should allow the window to be treated according to
standard policy for its semantic type.
a toplevel #GdkWindow
%TRUE to skip the taskbar
When using GTK+, typically you should use gtk_window_set_startup_id()
instead of this low-level function.
a toplevel #GdkWindow
a string with startup-notification identifier
Set the bit gravity of the given window to static, and flag it so
all children get static subwindow gravity. This is used if you are
implementing scary features that involve deep knowledge of the
windowing system. Don't worry about it unless you have to.
%TRUE if the server supports static gravity
a #GdkWindow
%TRUE to turn on static gravity
Sets the title of a toplevel window, to be displayed in the titlebar.
If you haven't explicitly set the icon name for the window
(using gdk_window_set_icon_name()), the icon name will be set to
@title as well. @title must be in UTF-8 encoding (as with all
user-readable strings in GDK/GTK+). @title may not be %NULL.
a toplevel #GdkWindow
title of @window
Indicates to the window manager that @window is a transient dialog
associated with the application window @parent. This allows the
window manager to do things like center @window on @parent and
keep @window above @parent.
See gtk_window_set_transient_for() if you're using #GtkWindow or
#GtkDialog.
a toplevel #GdkWindow
another toplevel #GdkWindow
The application can use this call to provide a hint to the window
manager about the functionality of a window. The window manager
can use this information when determining the decoration and behaviour
of the window.
The hint must be set before the window is mapped.
A toplevel #GdkWindow
A hint of the function this window will have
Toggles whether a window needs the user's
urgent attention.
a toplevel #GdkWindow
%TRUE if the window is urgent
For most purposes this function is deprecated in favor of
g_object_set_data(). However, for historical reasons GTK+ stores
the #GtkWidget that owns a #GdkWindow as user data on the
#GdkWindow. So, custom widget implementations should use
this function for that. If GTK+ receives an event for a #GdkWindow,
and the user data for the window is non-%NULL, GTK+ will assume the
user data is a #GtkWidget, and forward the event to that widget.
a #GdkWindow
user data
Applies a shape mask to @window. Pixels in @window corresponding to
set bits in the @mask will be visible; pixels in @window
corresponding to unset bits in the @mask will be transparent. This
gives a non-rectangular window.
If @mask is %NULL, the shape mask will be unset, and the @x/@y
parameters are not used.
On the X11 platform, this uses an X server extension which is
widely available on most common platforms, but not available on
very old X servers, and occasionally the implementation will be
buggy. On servers without the shape extension, this function
will do nothing.
This function works on both toplevel and child windows.
a #GdkWindow
shape mask
X position of shape mask with respect to @window
Y position of shape mask with respect to @window
Makes pixels in @window outside @shape_region be transparent,
so that the window may be nonrectangular. See also
gdk_window_shape_combine_mask() to use a bitmap as the mask.
If @shape_region is %NULL, the shape will be unset, so the whole
window will be opaque again. @offset_x and @offset_y are ignored
if @shape_region is %NULL.
On the X11 platform, this uses an X server extension which is
widely available on most common platforms, but not available on
very old X servers, and occasionally the implementation will be
buggy. On servers without the shape extension, this function
will do nothing.
This function works on both toplevel and child windows.
a #GdkWindow
region of window to be non-transparent
X position of @shape_region in @window coordinates
Y position of @shape_region in @window coordinates
Like gdk_window_show_unraised(), but also raises the window to the
top of the window stack (moves the window to the front of the
Z-order).
This function maps a window so it's visible onscreen. Its opposite
is gdk_window_hide().
When implementing a #GtkWidget, you should call this function on the widget's
#GdkWindow as part of the "map" method.
a #GdkWindow
Shows a #GdkWindow onscreen, but does not modify its stacking
order. In contrast, gdk_window_show() will raise the window
to the top of the window stack.
On the X11 platform, in Xlib terms, this function calls
XMapWindow() (it also updates some internal GDK state, which means
that you can't really use XMapWindow() directly on a GDK window).
a #GdkWindow
"Pins" a window such that it's on all workspaces and does not scroll
with viewports, for window managers that have scrollable viewports.
(When using #GtkWindow, gtk_window_stick() may be more useful.)
On the X11 platform, this function depends on window manager
support, so may have no effect with many window managers. However,
GDK will do the best it can to convince the window manager to stick
the window. For window managers that don't support this operation,
there's nothing you can do to force it to happen.
a toplevel #GdkWindow
Thaws a window frozen with
gdk_window_freeze_toplevel_updates_libgtk_only().
This function is not part of the GDK public API and is only
for use by GTK+.
a #GdkWindow
Thaws a window frozen with gdk_window_freeze_updates().
a #GdkWindow
Moves the window out of fullscreen mode. If the window was not
fullscreen, does nothing.
On X11, asks the window manager to move @window out of the fullscreen
state, if the window manager supports this operation. Not all
window managers support this, and some deliberately ignore it or
don't have a concept of "fullscreen"; so you can't rely on the
unfullscreenification actually happening. But it will happen with
most standard window managers, and GDK makes a best effort to get
it to happen.
a toplevel #GdkWindow
Unmaximizes the window. If the window wasn't maximized, then this
function does nothing.
On X11, asks the window manager to unmaximize @window, if the
window manager supports this operation. Not all window managers
support this, and some deliberately ignore it or don't have a
concept of "maximized"; so you can't rely on the unmaximization
actually happening. But it will happen with most standard window
managers, and GDK makes a best effort to get it to happen.
On Windows, reliably unmaximizes the window.
a toplevel #GdkWindow
Reverse operation for gdk_window_stick(); see gdk_window_stick(),
and gtk_window_unstick().
a toplevel #GdkWindow
Withdraws a window (unmaps it and asks the window manager to forget about it).
This function is not really useful as gdk_window_hide() automatically
withdraws toplevel windows before hiding them.
a toplevel #GdkWindow
The mouse pointer for a #GdkWindow. See gdk_window_set_cursor() and
gdk_window_get_cursor() for details.
The ::from-embedder signal is emitted to translate coordinates
in the embedder of an offscreen window to the offscreen window.
See also #GtkWindow::to-embedder.
x coordinate in the embedder window
y coordinate in the embedder window
return location for the x
coordinate in the offscreen window
return location for the y
coordinate in the offscreen window
The ::pick-embedded-child signal is emitted to find an embedded
child at the given position.
the #GdkWindow of the embedded child at
@x, @y, or %NULL
x coordinate in the window
y coordinate in the window
The ::to-embedder signal is emitted to translate coordinates
in an offscreen window to its embedder.
See also #GtkWindow::from-embedder.
x coordinate in the offscreen window
y coordinate in the offscreen window
return location for the x
coordinate in the embedder window
return location for the y
coordinate in the embedder window
Appends gdk option entries to the passed in option group. This is
not public API and must not be used by applications.
An option group.
Emits a short beep on the default display.
Creates a Cairo context for drawing to @drawable.
<note><para>
Note that due to double-buffering, Cairo contexts created
in a GTK+ expose event handler cannot be cached and reused
between different expose events.
</para></note>
A newly created Cairo context. Free with
cairo_destroy() when you are done drawing.
a #GdkDrawable
Adds the given rectangle to the current path of @cr.
a #cairo_t
a #GdkRectangle
Adds the given region to the current path of @cr.
a #cairo_t
a #GdkRegion
Resets the clip region for a Cairo context created by gdk_cairo_create().
This resets the clip region to the "empty" state for the given drawable.
This is required for non-native windows since a direct call to
cairo_reset_clip() would unset the clip region inherited from the
drawable (i.e. the window clip region), and thus let you e.g.
draw outside your window.
This is rarely needed though, since most code just create a new cairo_t
using gdk_cairo_create() each time they want to draw something.
a #cairo_t
a #GdkDrawable
Sets the specified #GdkColor as the source color of @cr.
a #cairo_t
a #GdkColor
Sets the given pixbuf as the source pattern for the Cairo context.
The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y
a #Cairo context
a #GdkPixbuf
X coordinate of location to place upper left corner of @pixbuf
Y coordinate of location to place upper left corner of @pixbuf
Sets the given pixmap as the source pattern for the Cairo context.
The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
so that the origin of @pixmap is @pixmap_x, @pixmap_y
This function is being removed in GTK+ 3 (together
with #GdkPixmap). Instead, use gdk_cairo_set_source_window() where
appropriate.
a #Cairo context
a #GdkPixmap
X coordinate of location to place upper left corner of @pixmap
Y coordinate of location to place upper left corner of @pixmap
Sets the given window as the source pattern for the Cairo context.
The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
so that the origin of @window is @x, @y. The window contains all its
subwindows when rendering.
Note that the contents of @window are undefined outside of the
visible part of @window, so use this function with care.
a #Cairo context
a #GdkWindow
X coordinate of location to place upper left corner of @window
Y coordinate of location to place upper left corner of @window
Determines the total height of a given character.
This value is not generally useful, because you cannot
determine how this total height will be drawn in
relation to the baseline. See gdk_text_extents().
Use gdk_text_extents() instead.
the height of the character in pixels.
a #GdkFont
the character to measure.
Determines the distance from the origin to the rightmost
portion of a character when drawn. This is not the
correct value for determining the origin of the next
portion when drawing text in multiple pieces.
the right bearing of the character in pixels.
a #GdkFont
the character to measure.
Determines the width of a given character.
Use gdk_text_extents() instead.
the width of the character in pixels.
a #GdkFont
the character to measure.
Determines the width of a given wide character. (Encoded
in the wide-character encoding of the current locale).
the width of the character in pixels.
a #GdkFont
the character to measure.
Allocates a single color from a colormap.
Use gdk_colormap_alloc_color() instead.
%TRUE if the allocation succeeded.
a #GdkColormap.
The color to allocate. On return, the
<structfield>pixel</structfield> field will be filled in.
Returns the black color for a given colormap. The resulting
value has already been allocated.
%TRUE if the allocation succeeded.
a #GdkColormap.
the location to store the color.
Changes the value of a color that has already
been allocated. If @colormap is not a private
colormap, then the color must have been allocated
using gdk_colormap_alloc_colors() with the
@writeable set to %TRUE.
%TRUE if the color was successfully changed.
a #GdkColormap.
a #GdkColor, with the color to change
in the <structfield>pixel</structfield> field,
and the new value in the remaining fields.
Parses a textual specification of a color and fill in the
<structfield>red</structfield>, <structfield>green</structfield>,
and <structfield>blue</structfield> fields of a #GdkColor
structure. The color is <emphasis>not</emphasis> allocated, you
must call gdk_colormap_alloc_color() yourself. The string can
either one of a large set of standard names. (Taken from the X11
<filename>rgb.txt</filename> file), or it can be a hex value in the
form '#rgb' '#rrggbb' '#rrrgggbbb' or
'#rrrrggggbbbb' where 'r', 'g' and 'b' are hex digits of the
red, green, and blue components of the color, respectively. (White
in the four forms is '#fff' '#ffffff' '#fffffffff' and
'#ffffffffffff')
%TRUE if the parsing succeeded.
the string specifying the color.
the #GdkColor to fill in
Returns the white color for a given colormap. The resulting
value has already allocated been allocated.
%TRUE if the allocation succeeded.
a #GdkColormap.
the location to store the color.
Allocates colors from a colormap. This function
is obsolete. See gdk_colormap_alloc_colors().
For full documentation of the fields, see
the Xlib documentation for <function>XAllocColorCells()</function>.
%TRUE if the allocation was successful
a #GdkColormap.
if %TRUE, the colors should be allocated
in contiguous color cells.
an array in which to store the plane masks.
the number of planes to allocate. (Or zero,
to indicate that the color allocation should not be planar.)
an array into which to store allocated pixel values.
the number of pixels in each plane to allocate.
Frees colors allocated with gdk_colors_alloc(). This
function is obsolete. See gdk_colormap_free_colors().
a #GdkColormap.
the pixel values of the colors to free.
the number of values in @pixels.
the plane masks for all planes to free, OR'd together.
Changes the value of the first @ncolors colors in
a private colormap. This function is obsolete and
should not be used. See gdk_color_change().
a #GdkColormap.
the new color values.
the number of colors to change.
Returns the list of available input devices for the default display.
The list is statically allocated and should not be freed.
a list of #GdkDevice
Aborts a drag without dropping.
This function is called by the drag source.
a #GdkDragContext.
the timestamp for this operation.
Starts a drag and creates a new drag context for it.
This function is called by the drag source.
a newly created #GdkDragContext.
the source window for this drag.
the offered targets,
as list of #GdkAtom<!-- -->s
Drops on the current destination.
This function is called by the drag source.
a #GdkDragContext.
the timestamp for this operation.
Returns whether the dropped data has been successfully
transferred. This function is intended to be used while
handling a %GDK_DROP_FINISHED event, its return value is
meaningless at other times.
%TRUE if the drop was successful.
a #GdkDragContext
Finds the destination window and DND protocol to use at the
given pointer position.
This function is called by the drag source to obtain the
@dest_window and @protocol parameters for gdk_drag_motion().
Use gdk_drag_find_window_for_screen() instead.
a #GdkDragContext.
a window which may be at the pointer position, but
should be ignored, since it is put up by the drag source as an icon.
the x position of the pointer in root coordinates.
the y position of the pointer in root coordinates.
location to store the destination window in.
location to store the DND protocol in.
Finds the destination window and DND protocol to use at the
given pointer position.
This function is called by the drag source to obtain the
@dest_window and @protocol parameters for gdk_drag_motion().
a #GdkDragContext
a window which may be at the pointer position, but
should be ignored, since it is put up by the drag source as an icon.
the screen where the destination window is sought.
the x position of the pointer in root coordinates.
the y position of the pointer in root coordinates.
location to store the destination window in.
location to store the DND protocol in.
Finds out the DND protocol supported by a window.
Use gdk_drag_get_protocol_for_display() instead
the windowing system specific id for the window where
the drop should happen. This may be @xid or the id of a proxy
window, or zero if @xid doesn't support Drag and Drop.
the windowing system id of the destination window.
location where the supported DND protocol is returned.
Finds out the DND protocol supported by a window.
the windowing system id of the window where the drop should happen. This
may be @xid or the id of a proxy window, or zero if @xid doesn't
support Drag and Drop.
the #GdkDisplay where the destination window resides
the windowing system id of the destination window.
location where the supported DND protocol is returned.
Returns the selection atom for the current source window.
the selection atom.
a #GdkDragContext.
Updates the drag context when the pointer moves or the
set of actions changes.
This function is called by the drag source.
FIXME
a #GdkDragContext.
the new destination window, obtained by
gdk_drag_find_window().
the DND protocol in use, obtained by gdk_drag_find_window().
the x position of the pointer in root coordinates.
the y position of the pointer in root coordinates.
the suggested action.
the possible actions.
the timestamp for this operation.
Selects one of the actions offered by the drag source.
This function is called by the drag destination in response to
gdk_drag_motion() called by the drag source.
a #GdkDragContext.
the selected action which will be taken when a drop happens,
or 0 to indicate that a drop will not be accepted.
the timestamp for this operation.
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.
Use cairo_arc() and cairo_fill() or cairo_stroke()
instead. Note that arcs just like any drawing operation in Cairo are
antialiased unless you call cairo_set_antialias().
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
%TRUE if the arc should be filled, producing a 'pie slice'.
the x coordinate of the left edge of the bounding rectangle.
the y coordinate of the top edge of the bounding rectangle.
the width of the bounding rectangle.
the height of the bounding rectangle.
the start angle of the arc, relative to the 3 o'clock position,
counter-clockwise, in 1/64ths of a degree.
the end angle of the arc, relative to @angle1, in 1/64ths
of a degree.
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.
Most fields in @gc are not used for this operation, but notably the
clip mask or clip region will be honored.
The source and destination drawables must have the same visual and
colormap, or errors will result. (On X11, failure to match
visual/colormap results in a BadMatch error from the X server.)
A common cause of this problem is an attempt to draw a bitmap to
a color drawable. The way to draw a bitmap is to set the bitmap as
the stipple on the #GdkGC, set the fill mode to %GDK_STIPPLED, and
then draw the rectangle.
Use gdk_cairo_set_source_pixmap(), cairo_rectangle()
and cairo_fill() to draw pixmap on top of other drawables. Also keep
in mind that the limitations on allowed sources do not apply to Cairo.
a #GdkDrawable
a #GdkGC sharing the drawable's visual and colormap
the source #GdkDrawable, which may be the same as @drawable
X position in @src of rectangle to draw
Y position in @src of rectangle to draw
X position in @drawable where the rectangle should be drawn
Y position in @drawable where the rectangle should be drawn
width of rectangle to draw, or -1 for entire @src width
height of rectangle to draw, or -1 for entire @src height
This is a low-level function; 99% of text rendering should be done
using gdk_draw_layout() instead.
A glyph is a single image in a font. This function draws a sequence of
glyphs. To obtain a sequence of glyphs you have to understand a
lot about internationalized text handling, which you don't want to
understand; thus, use gdk_draw_layout() instead of this function,
gdk_draw_layout() handles the details.
Use pango_cairo_show_glyphs() instead.
a #GdkDrawable
a #GdkGC
font to be used
X coordinate of baseline origin
Y coordinate of baseline origin
the glyph string to draw
Renders a #PangoGlyphString 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 #PangoContext with an identical
transformation matrix to that passed in to this function.
See also gdk_draw_glyphs(), gdk_draw_layout().
Use pango_cairo_show_glyphs() instead.
a #GdkDrawable
a #GdkGC
a #PangoMatrix, or %NULL to use an identity transformation
the font in which to draw the string
the x position of the start of the string (in Pango
units in user space coordinates)
the y position of the baseline (in Pango units
in user space coordinates)
the glyph string to draw
Draws a #GdkImage onto a drawable.
The depth of the #GdkImage must match the depth of the #GdkDrawable.
Do not use #GdkImage anymore, instead use Cairo image
surfaces.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
the #GdkImage to draw.
the left edge of the source rectangle within @image.
the top of the source rectangle within @image.
the x coordinate of the destination within @drawable.
the y coordinate of the destination within @drawable.
the width of the area to be copied, or -1 to make the area
extend to the right edge of @image.
the height of the area to be copied, or -1 to make the area
extend to the bottom edge of @image.
Render a #PangoLayout onto a GDK drawable
If the layout's #PangoContext has a transformation matrix set, then
@x and @y specify the position of the top left corner of the
bounding box (in device space) of the transformed layout.
If you're using GTK+, the usual way to obtain a #PangoLayout
is gtk_widget_create_pango_layout().
the drawable on which to draw string
base graphics context to use
the X position of the left of the layout (in pixels)
the Y position of the top of the layout (in pixels)
a #PangoLayout
Render a #PangoLayoutLine onto an GDK drawable
If the layout's #PangoContext has a transformation matrix set, then
@x and @y specify the position of the left edge of the baseline
(left is in before-tranform user coordinates) in after-transform
device coordinates.
the drawable on which to draw the line
base graphics to use
the x position of start of string (in pixels)
the y position of baseline (in pixels)
a #PangoLayoutLine
Render a #PangoLayoutLine onto a #GdkDrawable, overriding the
layout's normal colors with @foreground and/or @background.
@foreground and @background need not be allocated.
If the layout's #PangoContext has a transformation matrix set, then
@x and @y specify the position of the left edge of the baseline
(left is in before-tranform user coordinates) in after-transform
device coordinates.
the drawable on which to draw the line
base graphics to use
the x position of start of string (in pixels)
the y position of baseline (in pixels)
a #PangoLayoutLine
foreground override color, or %NULL for none
background override color, or %NULL for none
Render a #PangoLayout onto a #GdkDrawable, overriding the
layout's normal colors with @foreground and/or @background.
@foreground and @background need not be allocated.
If the layout's #PangoContext has a transformation matrix set, then
@x and @y specify the position of the top left corner of the
bounding box (in device space) of the transformed layout.
If you're using GTK+, the ususal way to obtain a #PangoLayout
is gtk_widget_create_pango_layout().
the drawable on which to draw string
base graphics context to use
the X position of the left of the layout (in pixels)
the Y position of the top of the layout (in pixels)
a #PangoLayout
foreground override color, or %NULL for none
background override color, or %NULL for none
Draws a line, using the foreground color and other attributes of
the #GdkGC.
Use cairo_line_to() and cairo_stroke() instead.
Be aware that the default line width in Cairo is 2 pixels and that your
coordinates need to describe the center of the line. To draw a single
pixel wide pixel-aligned line, you would use:
|[cairo_set_line_width (cr, 1.0);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
cairo_move_to (cr, 0.5, 0.5);
cairo_line_to (cr, 9.5, 0.5);
cairo_stroke (cr);]|
See also <ulink url="http://cairographics.org/FAQ/#sharp_lines">the Cairo
FAQ</ulink> on this topic.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
the x coordinate of the start point.
the y coordinate of the start point.
the x coordinate of the end point.
the y coordinate of the end point.
Draws a series of lines connecting the given points.
The way in which joins between lines are draw is determined by the
#GdkCapStyle value in the #GdkGC. This can be set with
gdk_gc_set_line_attributes().
Use cairo_line_to() and cairo_stroke() instead. See the
documentation of gdk_draw_line() for notes on line drawing with Cairo.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
an array of #GdkPoint structures specifying the endpoints of the
the size of the @points array.
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
gdk_drawable_set_colormap().
On older X servers, rendering pixbufs with an alpha channel involves round
trips to the X server, and may be somewhat slow.
If GDK is built with the Sun mediaLib library, the gdk_draw_pixbuf
function is accelerated using mediaLib, which provides hardware
acceleration on Intel, AMD, and Sparc chipsets. If desired, mediaLib
support can be turned off by setting the GDK_DISABLE_MEDIALIB environment
variable.
Use gdk_cairo_set_source_pixbuf() and cairo_paint() or
cairo_rectangle() and cairo_fill() instead.
Destination drawable.
a #GdkGC, used for clipping, or %NULL
a #GdkPixbuf
Source X coordinate within pixbuf.
Source Y coordinates within pixbuf.
Destination X coordinate within drawable.
Destination Y coordinate within drawable.
Width of region to render, in pixels, or -1 to use pixbuf width.
Height of region to render, in pixels, or -1 to use pixbuf height.
Dithering mode for #GdkRGB.
X offset for dither.
Y offset for dither.
Draws a point, using the foreground color and other attributes of
the #GdkGC.
Use cairo_rectangle() and cairo_fill() or
cairo_move_to() and cairo_stroke() instead.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
the x coordinate of the point.
the y coordinate of the point.
Draws a number of points, using the foreground color and other
attributes of the #GdkGC.
Use @n_points calls to cairo_rectangle() and
cairo_fill() instead.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
an array of #GdkPoint structures.
the number of points to be drawn.
Draws an outlined or filled polygon.
Use cairo_line_to() or cairo_append_path() and
cairo_fill() or cairo_stroke() instead.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
%TRUE if the polygon should be filled. The polygon is closed
automatically, connecting the last point to the first point if
necessary.
an array of #GdkPoint structures specifying the points making
up the polygon.
the number of points.
Draws a rectangular outline or filled rectangle, using the foreground color
and other attributes of the #GdkGC.
A rectangle drawn filled is 1 pixel smaller in both dimensions than a
rectangle outlined. Calling
<literal>gdk_draw_rectangle (window, gc, TRUE, 0, 0, 20, 20)</literal>
results in a filled rectangle 20 pixels wide and 20 pixels high. Calling
<literal>gdk_draw_rectangle (window, gc, FALSE, 0, 0, 20, 20)</literal>
results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20),
and (20, 0), which makes it 21 pixels wide and 21 pixels high.
Use cairo_rectangle() and cairo_fill() or cairo_stroke()
instead. For stroking, the same caveats for converting code apply as for
gdk_draw_line().
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
%TRUE if the rectangle should be filled.
the x coordinate of the left edge of the rectangle.
the y coordinate of the top edge of the rectangle.
the width of the rectangle.
the height of the rectangle.
Like gdk_draw_rgb_32_image(), but allows you to specify the dither
offsets. See gdk_draw_rgb_image_dithalign() for more details.
Cairo handles colors automatically.
a #GdkDrawable
a #GdkGC
X coordinate on @drawable where image should go
Y coordinate on @drawable where image should go
width of area of image to draw
height of area of image to draw
dithering mode
RGB image data
rowstride of RGB image data
X dither offset
Y dither offset
Draws a number of unconnected lines.
Use cairo_move_to(), cairo_line_to() and cairo_stroke()
instead. See the documentation of gdk_draw_line() for notes on line drawing
with Cairo.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkGC.
an array of #GdkSegment structures specifying the start and
end points of the lines to be drawn.
the number of line segments to draw, i.e. the size of the
@segs array.
Draws a string of characters in the given font or fontset.
Use gdk_draw_layout() instead.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkFont.
a #GdkGC.
the x coordinate of the left edge of the text.
the y coordinate of the baseline of the text.
the string of characters to draw.
Draws a number of characters in the given font or fontset.
Use gdk_draw_layout() instead.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkFont.
a #GdkGC.
the x coordinate of the left edge of the text.
the y coordinate of the baseline of the text.
the characters to draw.
the number of characters of @text to draw.
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.
Use gdk_draw_layout() instead.
a #GdkDrawable (a #GdkWindow or a #GdkPixmap).
a #GdkFont.
a #GdkGC.
the x coordinate of the left edge of the text.
the y coordinate of the baseline of the text.
the wide characters to draw.
the number of characters to draw.
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.
Use Cairo path contruction functions and cairo_fill()
instead.
a #GdkDrawable
a #GdkGC
an array of #GdkTrapezoid structures
the number of trapezoids to draw
Ends the drag operation after a drop.
This function is called by the drag destination.
a #GtkDragContext.
%TRUE if the data was successfully received.
the timestamp for this operation.
Accepts or rejects a drop.
This function is called by the drag destination in response
to a drop initiated by the drag source.
a #GdkDragContext.
%TRUE if the drop is accepted.
the timestamp for this operation.
Checks all open displays for a #GdkEvent to process,to be processed
on, fetching events from the windowing system if necessary.
See gdk_display_get_event().
the next #GdkEvent to be processed, or %NULL if no events
are pending. The returned #GdkEvent should be freed with gdk_event_free().
Sets the function to call to handle all events from GDK.
Note that GTK+ uses this to install its own event handler, so it is
usually not useful for GTK+ applications. (Although an application
can call this function then call gtk_main_do_event() to pass
events to GTK+.)
the function to call to handle events from GDK.
user data to pass to the function.
the function to call when the handler function is removed, i.e. when
gdk_event_handler_set() is called with another event handler.
If there is an event waiting in the event queue of some open
display, returns a copy of it. See gdk_display_peek_event().
a copy of the first #GdkEvent on some event queue, or %NULL if no
events are in any queues. The returned #GdkEvent should be freed with
gdk_event_free().
Request more motion notifies if @event is a motion notify hint event.
This function should be used instead of gdk_window_get_pointer() to
request further motion notifies, because it also works for extension
events where motion notifies are provided for devices other than the
core pointer. Coordinate extraction, processing and requesting more
motion events from a %GDK_MOTION_NOTIFY event usually works like this:
|[
{
/* motion_event handler */
x = motion_event->x;
y = motion_event->y;
/* handle (x,y) motion */
gdk_event_request_motions (motion_event); /* handles is_hint events */
}
]|
a valid #GdkEvent
Load a #GdkFont based on a Pango font description. This font will
only be an approximation of the Pango font, and
internationalization will not be handled correctly. This function
should only be used for legacy code that cannot be easily converted
to use Pango. Using Pango directly will produce better results.
the newly loaded font, or %NULL if the font
cannot be loaded.
a #PangoFontDescription.
Loads a font.
The font may be newly loaded or looked up the font in a cache.
You should make no assumptions about the initial reference count.
a #GdkFont, or %NULL if the font could not be loaded.
a XLFD describing the font to load.
Obtains the root window (parent all other windows are inside)
for the default display and screen.
the default root window
Gets the display name specified in the command line arguments passed
to gdk_init() or gdk_parse_args(), if any.
the display name, if specified explicitely, otherwise %NULL
this string is owned by GTK+ and must not be modified or freed.
Gets whether event debugging output is enabled.
%TRUE if event debugging output is enabled.
Initialize the library for use.
Arguments:
"argc" is the number of arguments.
"argv" is an array of strings.
Results:
"argc" and "argv" are modified to reflect any arguments
which were not handled. (Such arguments should either
be handled by the application or dismissed). If initialization
fails, returns FALSE, otherwise TRUE.
Side effects:
The library is initialized.
--------------------------------------------------------------
Establish a callback when a condition becomes true on
a file descriptor.
Use g_io_add_watch() on a #GIOChannel
a tag that can later be used as an argument to
gdk_input_remove().
a file descriptor.
the condition.
the callback function.
callback data passed to @function.
Establish a callback when a condition becomes true on
a file descriptor.
Use g_io_add_watch_full() on a #GIOChannel
a tag that can later be used as an argument to
gdk_input_remove().
a file descriptor.
the condition.
the callback function.
callback data passed to @function.
callback function to call with @data when the input
handler is removed.
Determines information about the current keyboard grab.
This is not public API and must not be used by applications.
%TRUE if this application currently has the
keyboard grabbed.
the display for which to get the grab information
location to store current grab window
location to store boolean indicating whether
the @owner_events flag to gdk_keyboard_grab() was %TRUE.
Ungrabs the keyboard on the default display, if it is grabbed by this
application.
a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
timestamp is available.
Obtains the upper- and lower-case versions of the keyval @symbol.
Examples of keyvals are #GDK_a, #GDK_Enter, #GDK_F1, etc.
a keyval
return location for lowercase version of @symbol
return location for uppercase version of @symbol
Converts a key name to a key value.
The names are the same as those in the
<filename><gdk/gdkkeysyms.h></filename> header file
but without the leading "GDK_KEY_".
the corresponding key value, or %GDK_KEY_VoidSymbol
if the key name is not a valid key
a key name
Converts a key value into a symbolic name.
The names are the same as those in the
<filename><gdk/gdkkeysyms.h></filename> header file
but without the leading "GDK_KEY_".
a string containing the name of the key,
or %NULL if @keyval is not a valid key. The string should not be
modified.
a key value
Convert from a GDK key symbol to the corresponding ISO10646 (Unicode)
character.
the corresponding unicode character, or 0 if there
is no corresponding character.
a GDK key symbol
Lists the available visuals for the default screen.
(See gdk_screen_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.
Call g_list_free() on the return value when you're finished with it.
a list of visuals; the list must be freed, but not its contents
Converts a multi-byte string to a wide character string.
(The function name comes from an acronym of 'Multi-Byte String TO Wide
Character String').
the number of wide characters written into @dest, or -1 if
the conversion failed.
the space to place the converted wide character string into.
the multi-byte string to convert, which must be nul-terminated.
the maximum number of wide characters to place in @dest.
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.
GTK+ will call this function automatically after opening the first
#GtkWindow unless gtk_window_set_auto_startup_notification() is called
to disable that feature.
Indicates to the GUI environment that the application has finished
loading, using a given identifier.
GTK+ will call this function automatically for #GtkWindow with custom
startup-notification identifier unless
gtk_window_set_auto_startup_notification() is called to disable
that feature.
a startup-notification identifier, for which notification
process should be completed
Gets the window that @window is embedded in.
the embedding #GdkWindow, or %NULL if @window is not an
embedded offscreen window
a #GdkWindow
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.
The offscreen pixmap, or %NULL if not offscreen
a #GdkWindow
Sets @window to be embedded in @embedder.
To fully embed an offscreen window, in addition to calling this
function, it is also necessary to handle the #GdkWindow::pick-embedded-child
signal on the @embedder and the #GdkWindow::to-embedder and
#GdkWindow::from-embedder signals on @window.
a #GdkWindow
the #GdkWindow that @window gets embedded in
Creates a new attribute specifying the color to emboss text with.
new #PangoAttribute
a GdkColor representing the color to emboss with
Creates a new attribute flagging a region as embossed or not.
new #PangoAttribute
if the region should be embossed
Creates a new attribute containing a stipple bitmap to be used when
rendering the text.
new #PangoAttribute
a bitmap to be set as stipple
Creates a #PangoContext for the default GDK screen.
The context must be freed when you're finished with it.
When using GTK+, normally you should use gtk_widget_get_pango_context()
instead of this function, to get the appropriate context for
the widget you intend to render text onto.
The newly created context will have the default font options (see
#cairo_font_options_t) for the default screen; if these options
change it will not be updated. Using gtk_widget_get_pango_context()
is more convenient if you want to keep a context around and track
changes to the screen's font rendering settings.
a new #PangoContext for the default display
Creates a #PangoContext for @screen.
The context must be freed when you're finished with it.
When using GTK+, normally you should use gtk_widget_get_pango_context()
instead of this function, to get the appropriate context for
the widget you intend to render text onto.
The newly created context will have the default font options
(see #cairo_font_options_t) for the screen; if these options
change it will not be updated. Using gtk_widget_get_pango_context()
is more convenient if you want to keep a context around and track
changes to the screen's font rendering settings.
a new #PangoContext for @screen
the #GdkScreen for which the context is to be created.
This function used to set the colormap to be used for drawing with
@context. The colormap is now always derived from the graphics
context used for drawing, so calling this function is no longer
necessary.
a #PangoContext
a #GdkColormap
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 gdk_draw_layout_line(). @index_ranges should contain
ranges of bytes in the layout's text.
Note that the regions returned correspond to logical extents of the text
ranges, not ink extents. So the drawn layout may in fact touch areas out of
the clip region. The clip region is mainly useful for highlightling parts
of text, such as when text is selected.
a clip region containing the given ranges
a #PangoLayout
X pixel where you intend to draw the layout with this clip
Y pixel where you intend to draw the layout with this clip
array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes
number of ranges in @index_ranges, i.e. half the size of @index_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 gdk_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.
Note that the regions returned correspond to logical extents of the text
ranges, not ink extents. So the drawn line may in fact touch areas out of
the clip region. The clip region is mainly useful for highlightling parts
of text, such as when text is selected.
a clip region containing the given ranges
a #PangoLayoutLine
X pixel where you intend to draw the layout line with this clip
baseline pixel where you intend to draw the layout line with this clip
array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes
number of ranges in @index_ranges, i.e. half the size of @index_ranges
Parse command line arguments, and store for future
use by calls to gdk_display_open().
Any arguments used by GDK are removed from the array and @argc and @argv are
updated accordingly.
You shouldn't call this function explicitely if you are using
gtk_init(), gtk_init_check(), gdk_init(), or gdk_init_check().
the number of command line arguments.
the array of command line arguments.
Transfers image data from a #GdkDrawable and converts it to an RGB(A)
representation inside a #GdkPixbuf. 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.
If the drawable @src has no colormap (gdk_drawable_get_colormap()
returns %NULL), then a suitable colormap must be specified.
Typically a #GdkWindow or a pixmap created by passing a #GdkWindow
to gdk_pixmap_new() will already have a colormap associated with
it. If the drawable has a colormap, the @cmap argument will be
ignored. If the drawable is a bitmap (1 bit per pixel pixmap),
then a colormap is not required; pixels with a value of 1 are
assumed to be white, and pixels with a value of 0 are assumed to be
black. For taking screenshots, gdk_colormap_get_system() returns
the correct colormap to use.
If the specified destination pixbuf @dest is %NULL, then this
function will create an RGB pixbuf with 8 bits per channel and no
alpha, with the same size specified by the @width and @height
arguments. In this case, the @dest_x and @dest_y arguments must be
specified as 0. If the specified destination pixbuf is not %NULL
and it contains alpha information, then the filled pixels will be
set to full opacity (alpha = 255).
If the specified drawable is a pixmap, then the requested source
rectangle must be completely contained within the pixmap, otherwise
the function will return %NULL. For pixmaps only (not for windows)
passing -1 for width or height is allowed to mean the full width
or height of the pixmap.
If the specified drawable is a window, and the window is off the
screen, then there is no image data in the obscured/offscreen
regions to be placed in the pixbuf. The contents of portions of the
pixbuf corresponding to the offscreen region are undefined.
If the window you're obtaining data from is partially obscured by
other windows, then the contents of the pixbuf areas corresponding
to the obscured regions are undefined.
If the target drawable is not mapped (typically because it's
iconified/minimized or not on the current workspace), then %NULL
will be returned.
If memory can't be allocated for the return value, %NULL will be returned
instead.
(In short, there are several ways this function can fail, and if it fails
it returns %NULL; so check the return value.)
This function calls gdk_drawable_get_image() internally and
converts the resulting image to a #GdkPixbuf, so the
documentation for gdk_drawable_get_image() may also be relevant.
The same pixbuf as @dest if it was non-%NULL, or a newly-created
pixbuf with a reference count of 1 if no destination pixbuf was specified, or %NULL on error
Destination pixbuf, or %NULL if a new pixbuf should be created.
Source drawable.
A colormap if @src doesn't have one set.
Source X coordinate within drawable.
Source Y coordinate within drawable.
Destination X coordinate in pixbuf, or 0 if @dest is NULL.
Destination Y coordinate in pixbuf, or 0 if @dest is NULL.
Width in pixels of region to get.
Height in pixels of region to get.
Same as gdk_pixbuf_get_from_drawable() but gets the pixbuf from
an image.
@dest, newly-created pixbuf if @dest was %NULL, %NULL on error
Destination pixbuf, or %NULL if a new pixbuf should be created.
Source #GdkImage.
A colormap, or %NULL to use the one for @src
Source X coordinate within drawable.
Source Y coordinate within drawable.
Destination X coordinate in pixbuf, or 0 if @dest is NULL.
Destination Y coordinate in pixbuf, or 0 if @dest is NULL.
Width in pixels of region to get.
Height in pixels of region to get.
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 gdk_draw_pixbuf() and gdk_pixbuf_render_threshold_alpha().
The pixmap that is created is created for the colormap returned
by gdk_rgb_get_colormap(). You normally will want to instead use
the actual colormap for a widget, and use
gdk_pixbuf_render_pixmap_and_mask_for_colormap().
If the pixbuf does not have an alpha channel, then *@mask_return will be set
to %NULL.
A pixbuf.
Location to store a pointer to the created pixmap,
or %NULL if the pixmap is not needed.
Location to store a pointer to the created mask,
or %NULL if the mask is not needed.
Threshold value for opacity values.
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 gdk_draw_pixbuf(), and gdk_pixbuf_render_threshold_alpha().
The pixmap that is created uses the #GdkColormap specified by @colormap.
This colormap must match the colormap of the window where the pixmap
will eventually be used or an error will result.
If the pixbuf does not have an alpha channel, then *@mask_return will be set
to %NULL.
A pixbuf.
A #GdkColormap
Location to store a pointer to the created pixmap,
or %NULL if the pixmap is not needed.
Location to store a pointer to the created mask,
or %NULL if the mask is not needed.
Threshold value for opacity values.
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.
A pixbuf.
Bitmap where the bilevel mask will be painted to.
Source X coordinate.
source Y coordinate.
Destination X coordinate.
Destination Y coordinate.
Width of region to threshold, or -1 to use pixbuf width
Height of region to threshold, or -1 to use pixbuf height
Opacity values below this will be painted as zero; all
other values will be painted as one.
Renders a rectangular portion of a pixbuf to a drawable while using the
specified GC. This is done using GdkRGB, so the specified drawable must have
the GdkRGB visual and colormap. Note that this function will ignore the
opacity information for images with an alpha channel; the GC must already
have the clipping mask set if you want transparent regions to show through.
For an explanation of dither offsets, see the GdkRGB documentation. In
brief, the dither offset is important when re-rendering partial regions of an
image to a rendered version of the full image, or for when the offsets to a
base position change, as in scrolling. The dither matrix has to be shifted
for consistent visual results. If you do not have any of these cases, the
dither offsets can be both zero.
This function is obsolete. Use gdk_draw_pixbuf() instead.
A pixbuf.
Destination drawable.
GC used for rendering.
Source X coordinate within pixbuf.
Source Y coordinate within pixbuf.
Destination X coordinate within drawable.
Destination Y coordinate within drawable.
Width of region to render, in pixels, or -1 to use pixbuf width
Height of region to render, in pixels, or -1 to use pixbuf height
Dithering mode for GdkRGB.
X offset for dither.
Y offset for 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 gdk_drawable_set_colormap.
On older X servers, rendering pixbufs with an alpha channel involves round trips
to the X server, and may be somewhat slow.
This function is obsolete. Use gdk_draw_pixbuf() instead.
A pixbuf.
Destination drawable.
Source X coordinate within pixbuf.
Source Y coordinates within pixbuf.
Destination X coordinate within drawable.
Destination Y coordinate within drawable.
Width of region to render, in pixels, or -1 to use pixbuf width.
Height of region to render, in pixels, or -1 to use pixbuf height.
Ignored. Present for backwards compatibility.
Ignored. Present for backwards compatibility
Dithering mode for GdkRGB.
X offset for dither.
Y offset for dither.
Determines information about the current pointer grab.
This is not public API and must not be used by applications.
%TRUE if this application currently has the
pointer grabbed.
the #GdkDisplay for which to get the grab information
location to store current grab window
location to store boolean indicating whether
the @owner_events flag to gdk_pointer_grab() was %TRUE.
Returns %TRUE if the pointer on the default display is currently
grabbed by this application.
Note that this does not take the inmplicit pointer grab on button
presses into account.
%TRUE if the pointer is currently grabbed by this application.*
Ungrabs the pointer on the default display, if it is grabbed by this
application.
a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no
timestamp is available.
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.
The array returned by this function should not be freed.
return location for available depths
return location for number of available depths
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.
The array returned by this function should not be freed.
return location for the available visual types
return location for the number of available visual types
@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().
@color should have its %red, %green, and %blue fields initialized;
gdk_rgb_find_color() will fill in the %pixel field with the best
matching pixel from a color cube. The color is then ready to be
used for drawing, e.g. you can call gdk_gc_set_foreground() which
expects %pixel to be initialized.
In many cases, you can avoid this whole issue by calling
gdk_gc_set_rgb_fg_color() or gdk_gc_set_rgb_bg_color(), which
do not expect %pixel to be initialized in advance. If you use those
functions, there's no need for gdk_rgb_find_color().
Cairo handles colors automatically.
a #GdkColormap
a #GdkColor
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.
Use gdk_screen_get_system_colormap (gdk_screen_get_default ()) instead.
the preferred colormap
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.
Use gdk_visual_get_system_visual (gdk_screen_get_default ()) instead.
The #GdkVisual chosen by GdkRGB.
Determine the owner of the given selection.
Note that the return value may be owned by a different
process if a foreign window was previously created for that
window, but a new foreign window will never be created by this call.
if there is a selection owner for this window, and it is a
window known to the current process, the #GdkWindow that owns the
selection, otherwise %NULL.
a #GdkDisplay.
an atom indentifying a selection.
Sets the #GdkWindow @owner as the current owner of the selection @selection.
%TRUE if the selection owner was successfully changed to owner,
otherwise %FALSE.
the #GdkDisplay.
a #GdkWindow or %NULL to indicate that the owner for
the given should be unset.
an atom identifying a selection.
timestamp to use when setting the selection.
If this is older than the timestamp given last time the owner was
set for the given selection, the request will be ignored.
if %TRUE, and the new owner is different from the current
owner, the current owner will be sent a SelectionClear event.
Retrieves selection data that was stored by the selection
data in response to a call to gdk_selection_convert(). This function
will not be used by applications, who should use the #GtkClipboard
API instead.
the length of the retrieved data.
the window on which the data is stored
location to store a pointer to the retrieved data.
If the retrieval failed, %NULL we be stored here, otherwise, it
will be non-%NULL and the returned data should be freed with g_free()
when you are finished using it. The length of the
allocated memory is one more than the length
of the returned data, and the final byte will always
be zero, to ensure nul-termination of strings.
location to store the type of the property.
location to store the format of the property.
Send a response to SelectionRequest event.
the #GdkDisplay where @requestor is realized
window to which to deliver response.
selection that was requested.
target that was selected.
property in which the selection owner stored the data,
or %GDK_NONE to indicate that the request was rejected.
timestamp.
Set the double click time for the default display. See
gdk_display_set_double_click_time().
See also gdk_display_set_double_click_distance().
Applications should <emphasis>not</emphasis> set this, it is a
global user-configured setting.
double click time in milliseconds (thousandths of a second)
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.
This function is not multihead safe. For multihead operation,
see gdk_display_set_pointer_hooks().
This function will go away in GTK 3 for lack of use cases.
the previous pointer hook table
a table of pointers to functions for getting
quantities related to the current pointer position,
or %NULL to restore the default table.
Sets whether a trace of received events is output.
Note that GTK+ must be compiled with debugging (that is,
configured using the <option>--enable-debug</option> option)
to use this option.
%TRUE to output event debugging information.
Sets the <literal>SM_CLIENT_ID</literal> 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.
See the X Session Management Library documentation for more information on
session management and the Inter-Client Communication Conventions Manual
(ICCCM) for information on the <literal>WM_CLIENT_LEADER</literal> property.
(Both documents are part of the X Window System distribution.)
Use gdk_x11_set_sm_client_id() instead
the client id assigned by the session manager when the
connection was opened, or %NULL to remove the property.
Obtains a desktop-wide setting, such as the double-click time,
for the default screen. See gdk_screen_get_setting().
%TRUE if the setting existed and a value was stored
in @value, %FALSE otherwise.
the name of the setting.
location to store the value of the setting.
Like g_spawn_command_line_async(), except the child process is
spawned in such an environment that on calling gdk_display_open()
it would be returned a #GdkDisplay with @screen as the default
screen.
This is useful for applications which wish to launch an application
on a specific screen.
This function is being removed in 3.0. Use
either g_spawn_command_line_sync(), g_spawn_command_line_async() or
#GdkAppLaunchContext instead.
%TRUE on success, %FALSE if error is set.
a #GdkScreen
a command line
Like g_spawn_async(), except the child process is spawned in such
an environment that on calling gdk_display_open() it would be
returned a #GdkDisplay with @screen as the default screen.
This is useful for applications which wish to launch an application
on a specific screen.
This function is being removed in 3.0. Use
either g_spawn_sync(), g_spawn_async(), or #GdkAppLaunchContext instead.
%TRUE on success, %FALSE if error is set
a #GdkScreen
child's current working directory, or %NULL to
inherit parent's
child's argument vector
child's environment, or %NULL to inherit parent's
flags from #GSpawnFlags
function to run in the child just before exec()
user data for @child_setup
return location for child process ID, or %NULL
Like g_spawn_async_with_pipes(), except the child process is
spawned in such an environment that on calling gdk_display_open()
it would be returned a #GdkDisplay with @screen as the default
screen.
This is useful for applications which wish to launch an application
on a specific screen.
This function is being removed in 3.0. Use
either g_spawn_async_with_pipes() or #GdkAppLaunchContext instead.
%TRUE on success, %FALSE if an error was set
a #GdkScreen
child's current working directory, or %NULL to
inherit parent's
child's argument vector
child's environment, or %NULL to inherit parent's
flags from #GSpawnFlags
function to run in the child just before exec()
user data for @child_setup
return location for child process ID, or %NULL
return location for file descriptor to write to
child's stdin, or %NULL
return location for file descriptor to read child's
stdout, or %NULL
return location for file descriptor to read child's
stderr, or %NULL
Gets the metrics of a nul-terminated string.
a #GdkFont.
the nul-terminated string to measure.
the left bearing of the string.
the right bearing of the string.
the width of the string.
the ascent of the string.
the descent of the string.
Determines the total height of a given nul-terminated
string. This value is not generally useful, because you
cannot determine how this total height will be drawn in
relation to the baseline. See gdk_string_extents().
the height of the string in pixels.
a #GdkFont
the nul-terminated string to measure.
Determines the distance from the origin to the rightmost
portion of a nul-terminated string when drawn. This is not the
correct value for determining the origin of the next
portion when drawing text in multiple pieces.
See gdk_string_width().
the right bearing of the string in pixels.
a #GdkFont
the nul-terminated string to measure.
Convert a string from the encoding of the current
locale into a form suitable for storing in a window property.
Use gdk_x11_display_string_to_compound_text()
0 upon success, non-zero upon failure.
the #GdkDisplay where the encoding is defined.
a nul-terminated string.
location to store the encoding atom
(to be used as the type for the property).
location to store the format of the property
location to store newly allocated data for the property.
the length of @text, in bytes
Determines the width of a nul-terminated string.
(The distance from the origin of the string to the
point where the next string in a sequence of strings
should be drawn)
the width of the string in pixels.
a #GdkFont
the nul-terminated string to measure
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.
a mapped #GdkWindow
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.
Also, gtk_test_simulate_button() is a fairly low level function,
for most testing purposes, gtk_test_widget_click() is the right
function to call which will generate a button press event followed
by its accompanying button release event.
whether all actions neccessary for a button event simulation
were carried out successfully.
a #GdkWindow to simulate a button event for.
x coordinate within @window for the button event.
y coordinate within @window for the button event.
Number of the pointer button for the event, usually 1, 2 or 3.
Keyboard modifiers the event is setup with.
either %GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE
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.
When the mouse pointer is 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.
If (@x,@y) are passed as (-1,-1), the mouse pointer will not
be warped and @window origin will be used as mouse pointer
location for the event.
Also, gtk_test_simulate_key() is a fairly low level function,
for most testing purposes, gtk_test_widget_send_key() is the
right function to call which will generate a key press event
followed by its accompanying key release event.
whether all actions neccessary for a key event simulation
were carried out successfully.
a #GdkWindow to simulate a key event for.
x coordinate within @window for the key event.
y coordinate within @window for the key event.
A GDK keyboard value.
Keyboard modifiers the event is setup with.
either %GDK_KEY_PRESS or %GDK_KEY_RELEASE
Determines the total height of a given string.
This value is not generally useful, because you cannot
determine how this total height will be drawn in
relation to the baseline. See gdk_text_extents().
the height of the string in pixels.
a #GdkFont
the text to measure.
the length of the text in bytes.
Determines the distance from the origin to the rightmost
portion of a string when drawn. This is not the
correct value for determining the origin of the next
portion when drawing text in multiple pieces.
See gdk_text_width().
the right bearing of the string in pixels.
a #GdkFont
the text to measure.
the length of the text in bytes.
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.)
Use gdk_x11_display_text_property_to_text_list()
the number of strings stored in list, or 0,
if the conversion failed.
The #GdkDisplay where the encoding is defined.
an atom representing the encoding. The most
common values for this are STRING, or COMPOUND_TEXT.
This is value used as the type for the property.
the format of the property.
The text data.
The number of items to transform.
location to store a terminated array of strings in
the encoding of the current locale. This array should be
freed using gdk_free_text_list().
Convert a text property in the giving encoding to
a list of UTF-8 strings.
the number of strings in the resulting
list.
an atom representing the encoding of the text
the format of the property
the text to convert
the length of @text, in bytes
location to store the list of strings or %NULL. The
list should be freed with g_strfreev().
Converts a text property in the given encoding to
a list of UTF-8 strings.
the number of strings in the resulting
list.
a #GdkDisplay
an atom representing the encoding of the text
the format of the property
the text to convert
the length of @text, in bytes
location to store the list of strings or %NULL. The
list should be freed with g_strfreev().
A wrapper for the common usage of gdk_threads_add_idle_full()
assigning the default priority, #G_PRIORITY_DEFAULT_IDLE.
See gdk_threads_add_idle_full().
the ID (greater than 0) of the event source.
function to call
data to pass to @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.
This variant of g_idle_add_full() calls @function with the GDK lock
held. It can be thought of a MT-safe version for GTK+ widgets for the
following use case, where you have to worry about idle_callback()
running in thread A and accessing @self after it has been finalized
in thread B:
|[
static gboolean
idle_callback (gpointer data)
{
/* gdk_threads_enter(); would be needed for g_idle_add() */
SomeWidget *self = data;
/* do stuff with self */
self->idle_id = 0;
/* gdk_threads_leave(); would be needed for g_idle_add() */
return FALSE;
}
static void
some_widget_do_stuff_later (SomeWidget *self)
{
self->idle_id = gdk_threads_add_idle (idle_callback, self)
/* using g_idle_add() here would require thread protection in the callback */
}
static void
some_widget_finalize (GObject *object)
{
SomeWidget *self = SOME_WIDGET (object);
if (self->idle_id)
g_source_remove (self->idle_id);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
]|
the ID (greater than 0) of the event source.
the priority of the idle source. Typically this will be in the
range btweeen #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE
function to call
data to pass to @function
function to call when the idle is removed, or %NULL
A wrapper for the common usage of gdk_threads_add_timeout_full()
assigning the default priority, #G_PRIORITY_DEFAULT.
See gdk_threads_add_timeout_full().
the ID (greater than 0) of the event source.
the time between calls to the function, in milliseconds
(1/1000ths of a second)
function to call
data to pass to @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.
Note that timeout functions may be delayed, due to the processing of other
event sources. Thus they should not be relied on for precise timing.
After each call to the timeout function, the time of the next
timeout is recalculated based on the current time and the given interval
(it does not try to 'catch up' time lost in delays).
This variant of g_timeout_add_full() can be thought of a MT-safe version
for GTK+ widgets for the following use case:
|[
static gboolean timeout_callback (gpointer data)
{
SomeWidget *self = data;
/* do stuff with self */
self->timeout_id = 0;
return FALSE;
}
static void some_widget_do_stuff_later (SomeWidget *self)
{
self->timeout_id = g_timeout_add (timeout_callback, self)
}
static void some_widget_finalize (GObject *object)
{
SomeWidget *self = SOME_WIDGET (object);
if (self->timeout_id)
g_source_remove (self->timeout_id);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
]|
the ID (greater than 0) of the event source.
the priority of the timeout source. Typically this will be in the
range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE.
the time between calls to the function, in milliseconds
(1/1000ths of a second)
function to call
data to pass to @function
function to call when the timeout is removed, or %NULL
A wrapper for the common usage of gdk_threads_add_timeout_seconds_full()
assigning the default priority, #G_PRIORITY_DEFAULT.
For details, see gdk_threads_add_timeout_full().
the ID (greater than 0) of the event source.
the time between calls to the function, in seconds
function to call
data to pass to @function
A variant of gdk_threads_add_timout_full() with second-granularity.
See g_timeout_add_seconds_full() for a discussion of why it is
a good idea to use this function if you don't need finer granularity.
Return value: the ID (greater than 0) of the event source.
the priority of the timeout source. Typically this will be in the
range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE.
the time between calls to the function, in seconds
function to call
data to pass to @function
function to call when the timeout is removed, or %NULL
Initializes GDK so that it can be used from multiple threads
in conjunction with gdk_threads_enter() and gdk_threads_leave().
g_thread_init() must be called previous to this function.
This call must be made before any use of the main loop from
GTK+; to be safe, call it before gtk_init().
Allows the application to replace the standard method that
GDK uses to protect its data structures. Normally, GDK
creates a single #GMutex that is locked by gdk_threads_enter(),
and released by gdk_threads_leave(); using this function an
application provides, instead, a function @enter_fn that is
called by gdk_threads_enter() and a function @leave_fn that is
called by gdk_threads_leave().
The functions must provide at least same locking functionality
as the default implementation, but can also do extra application
specific processing.
As an example, consider an application that has its own recursive
lock that when held, holds the GTK+ lock as well. When GTK+ unlocks
the GTK+ lock when entering a recursive main loop, the application
must temporarily release its lock as well.
Most threaded GTK+ apps won't need to use this method.
This method must be called before gdk_threads_init(), and cannot
be called multiple times.
function called to guard GDK
function called to release the guard
Convert from a ISO10646 character to a key symbol.
the corresponding GDK key symbol, if one exists.
or, if there is no corresponding symbol,
wc | 0x01000000
a ISO10646 encoded character
Convert from UTF-8 to compound text.
%TRUE if the conversion succeeded, otherwise
false.
a UTF-8 string
location to store resulting encoding
location to store format of the result
location to store the data of the result
location to store the length of the data
stored in @ctext
Converts from UTF-8 to compound text.
Use gdk_x11_display_utf8_to_compound_text()
%TRUE if the conversion succeeded, otherwise
%FALSE.
a #GdkDisplay
a UTF-8 string
location to store resulting encoding
location to store format of the result
location to store the data of the result
location to store the length of the data
stored in @ctext
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.
the newly-allocated string, or %NULL if the
conversion failed. (It should not fail for
any properly formed UTF-8 string unless system
limits like memory or file descriptors are exceeded.)
a UTF-8 string
Converts a wide character string to a multi-byte string.
(The function name comes from an acronym of 'Wide Character String TO
Multi-Byte String').
the multi-byte string corresponding to @src, or %NULL if the
conversion failed. The returned string should be freed with g_free() when no
longer needed.
a wide character string.
Obtains the window underneath the mouse pointer, returning the
location of that window in @win_x, @win_y. Returns %NULL if the
window under the mouse pointer is not known to GDK (if the window
belongs to another application and a #GdkWindow hasn't been created
for it with gdk_window_foreign_new())
NOTE: For multihead-aware widgets or applications use
gdk_display_get_window_at_pointer() instead.
window under the mouse pointer
return location for origin of the window under the pointer
return location for origin of the window under the pointer
Constrains a desired width and height according to a
set of geometry hints (such as minimum and maximum size).
a #GdkGeometry structure
a mask indicating what portions of @geometry are set
desired width of window
desired height of the window
location to store resulting width
location to store resulting height
Wraps a native window for the default display in a #GdkWindow.
This may fail if the window has been destroyed.
For example in the X backend, a native window handle is an Xlib
<type>XID</type>.
the newly-created #GdkWindow wrapper for the
native window or %NULL if the window has been destroyed.
a native window handle.
Wraps a native window in a #GdkWindow.
This may fail if the window has been destroyed. If the window
was already known to GDK, a new reference to the existing
#GdkWindow is returned.
For example in the X backend, a native window handle is an Xlib
<type>XID</type>.
Use gdk_x11_window_foreign_new_for_display() or
equivalent backend-specific API instead
a #GdkWindow wrapper for the native window or
%NULL if the window has been destroyed. The wrapper will be
newly created, if one doesn't exist already.
the #GdkDisplay where the window handle comes from.
a native window handle.
Obtains a list of all toplevel windows known to GDK on the default
screen (see gdk_screen_get_toplevel_windows()).
A toplevel window is a child of the root window (see
gdk_get_default_root_window()).
The returned list should be freed with g_list_free(), but
its elements need not be freed.
Use gdk_screen_get_toplevel_windows() instead.
list of toplevel windows, free with g_list_free()
Looks up the #GdkWindow that wraps the given native window handle.
For example in the X backend, a native window handle is an Xlib
<type>XID</type>.
Use gdk_x11_window_lookup_for_display() or equivalent
backend-specific functionality instead
the #GdkWindow wrapper for the native window,
or %NULL if there is none.
a native window handle.
Looks up the #GdkWindow that wraps the given native window handle.
For example in the X backend, a native window handle is an Xlib
<type>XID</type>.
Use gdk_x11_window_lookup_for_display() instead
the #GdkWindow wrapper for the native window,
or %NULL if there is none.
the #GdkDisplay corresponding to the window handle
a native window handle.
Calls gdk_window_process_updates() for all windows (see #GdkWindow)
in the application.
With update debugging enabled, calls to
gdk_window_invalidate_region() clear the invalidated region of the
screen to a noticeable color, and GDK pauses for a short time
before sending exposes to windows during
gdk_window_process_updates(). The net effect is that you can see
the invalid region for each window and watch redraws as they
occur. This allows you to diagnose inefficiencies in your application.
In essence, because the GDK rendering model prevents all flicker,
if you are redrawing the same region 400 times you may never
notice, aside from noticing a speed problem. Enabling update
debugging causes GTK to flicker slowly and noticeably, so you can
see exactly what's being redrawn when, in what order.
The --gtk-debug=updates command line option passed to GTK+ programs
enables this debug option at application startup time. That's
usually more useful than calling gdk_window_set_debug_updates()
yourself, though you might want to use this function to enable
updates sometime after application startup time.
%TRUE to turn on update debugging