Commit ff61948d authored by Tadej Borovšak's avatar Tadej Borovšak Committed by Javier Jardon
Browse files

Move documentation to inline comments: GdkWindow

Use examples/gdk to store documentation code examples.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=618498

Signed-off-by: Javier Jardon's avatarJavier Jardón <jjardon@gnome.org>
parent 47dd78a7
This diff is collapsed.
#include <gtk/gtk.h>
/* The expose event handler for the event box.
*
* This function simply draws a transparency onto a widget on the area
* for which it receives expose events. This is intended to give the
* event box a "transparent" background.
*
* In order for this to work properly, the widget must have an RGBA
* colourmap. The widget should also be set as app-paintable since it
* doesn't make sense for GTK+ to draw a background if we are drawing it
* (and because GTK+ might actually replace our transparency with its
* default background colour).
*/
static gboolean
transparent_expose (GtkWidget *widget,
GdkEventExpose *event)
{
cairo_t *cr;
cr = gdk_cairo_create (widget->window);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
gdk_cairo_region (cr, event->region);
cairo_fill (cr);
cairo_destroy (cr);
return FALSE;
}
/* The expose event handler for the window.
*
* This function performs the actual compositing of the event box onto
* the already-existing background of the window at 50% normal opacity.
*
* In this case we do not want app-paintable to be set on the widget
* since we want it to draw its own (red) background. Because of this,
* however, we must ensure that we use g_signal_connect_after so that
* this handler is called after the red has been drawn. If it was
* called before then GTK would just blindly paint over our work.
*
* Note: if the child window has children, then you need a cairo 1.6
* feature to make this work correctly.
*/
static gboolean
window_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
GdkRegion *region;
GtkWidget *child;
cairo_t *cr;
/* get our child (in this case, the event box) */
child = gtk_bin_get_child (GTK_BIN (widget));
/* create a cairo context to draw to the window */
cr = gdk_cairo_create (widget->window);
/* the source data is the (composited) event box */
gdk_cairo_set_source_pixmap (cr, child->window,
child->allocation.x,
child->allocation.y);
/* draw no more than our expose event intersects our child */
region = gdk_region_rectangle (&child->allocation);
gdk_region_intersect (region, event->region);
gdk_cairo_region (cr, region);
cairo_clip (cr);
/* composite, with a 50% opacity */
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_paint_with_alpha (cr, 0.5);
/* we're done */
cairo_destroy (cr);
return FALSE;
}
int
main (int argc, char **argv)
{
GtkWidget *window, *event, *button;
GdkScreen *screen;
GdkColormap *rgba;
GdkColor red;
gtk_init (&argc, &argv);
/* Make the widgets */
button = gtk_button_new_with_label ("A Button");
event = gtk_event_box_new ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* Put a red background on the window */
gdk_color_parse ("red", &red);
gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &red);
/* Set the colourmap for the event box.
* Must be done before the event box is realised.
*/
screen = gtk_widget_get_screen (event);
rgba = gdk_screen_get_rgba_colormap (screen);
gtk_widget_set_colormap (event, rgba);
/* Set our event box to have a fully-transparent background
* drawn on it. Currently there is no way to simply tell GTK+
* that "transparency" is the background colour for a widget.
*/
gtk_widget_set_app_paintable (GTK_WIDGET (event), TRUE);
g_signal_connect (event, "expose-event",
G_CALLBACK (transparent_expose), NULL);
/* Put them inside one another */
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_container_add (GTK_CONTAINER (window), event);
gtk_container_add (GTK_CONTAINER (event), button);
/* Realise and show everything */
gtk_widget_show_all (window);
/* Set the event box GdkWindow to be composited.
* Obviously must be performed after event box is realised.
*/
gdk_window_set_composited (event->window, TRUE);
/* Set up the compositing handler.
* Note that we do _after_ so that the normal (red) background is drawn
* by gtk before our compositing occurs.
*/
g_signal_connect_after (window, "expose-event",
G_CALLBACK (window_expose_event), NULL);
gtk_main ();
return 0;
}
...@@ -72,10 +72,25 @@ typedef void (*GdkEventFunc) (GdkEvent *event, ...@@ -72,10 +72,25 @@ typedef void (*GdkEventFunc) (GdkEvent *event,
/* Event filtering */ /* Event filtering */
/**
* GdkXEvent:
*
* Used to represent native events (<type>XEvent</type>s for the X11
* backend, <type>MSG</type>s for Win32).
*/
typedef void GdkXEvent; /* Can be cast to window system specific typedef void GdkXEvent; /* Can be cast to window system specific
* even type, XEvent on X11, MSG on Win32. * even type, XEvent on X11, MSG on Win32.
*/ */
/**
* GdkFilterReturn:
* @GDK_FILTER_CONTINUE: event not handled, continue processing.
* @GDK_FILTER_TRANSLATE: native event translated into a GDK event and stored
* in the <literal>event</literal> structure that was passed in.
* @GDK_FILTER_REMOVE: event handled, terminate processing.
*
* Specifies the result of applying a #GdkFilterFunc to a native event.
*/
typedef enum { typedef enum {
GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */ GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */
GDK_FILTER_TRANSLATE, /* Native event translated into a GDK event and GDK_FILTER_TRANSLATE, /* Native event translated into a GDK event and
...@@ -84,6 +99,23 @@ typedef enum { ...@@ -84,6 +99,23 @@ typedef enum {
GDK_FILTER_REMOVE /* Terminate processing, removing event */ GDK_FILTER_REMOVE /* Terminate processing, removing event */
} GdkFilterReturn; } GdkFilterReturn;
/**
* GdkFilterFunc:
* @xevent: the native event to filter.
* @event: the GDK event to which the X event will be translated.
* @data: user data set when the filter was installed.
*
* Specifies the type of function used to filter native events before they are
* converted to GDK events.
*
* When a filter is called, @event is unpopulated, except for
* <literal>event->window</literal>. The filter may translate the native
* event to a GDK event and store the result in @event, or handle it without
* translation. If the filter translates the event and processing should
* continue, it should return %GDK_FILTER_TRANSLATE.
*
* Returns: a #GdkFilterReturn value.
*/
typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent, typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
GdkEvent *event, GdkEvent *event,
gpointer data); gpointer data);
......
...@@ -56,6 +56,13 @@ ...@@ -56,6 +56,13 @@
/* some common magic values */ /* some common magic values */
#define GDK_CURRENT_TIME 0L #define GDK_CURRENT_TIME 0L
/**
* GDK_PARENT_RELATIVE:
*
* A special value for #GdkPixmap variables, indicating that the background
* pixmap for a window should be inherited from the parent window.
*/
#define GDK_PARENT_RELATIVE 1L #define GDK_PARENT_RELATIVE 1L
...@@ -111,6 +118,15 @@ typedef struct _GdkVisual GdkVisual; ...@@ -111,6 +118,15 @@ typedef struct _GdkVisual GdkVisual;
typedef struct _GdkDrawable GdkDrawable; typedef struct _GdkDrawable GdkDrawable;
typedef struct _GdkDrawable GdkBitmap; typedef struct _GdkDrawable GdkBitmap;
typedef struct _GdkDrawable GdkPixmap; typedef struct _GdkDrawable GdkPixmap;
/**
* GdkWindow:
*
* An opaque structure representing an onscreen drawable. Pointers to structures
* of type #GdkPixmap, #GdkBitmap, and #GdkWindow can often be used
* interchangeably. The type #GdkDrawable refers generically to any of these
* types.
*/
typedef struct _GdkDrawable GdkWindow; typedef struct _GdkDrawable GdkWindow;
typedef struct _GdkDisplay GdkDisplay; typedef struct _GdkDisplay GdkDisplay;
typedef struct _GdkScreen GdkScreen; typedef struct _GdkScreen GdkScreen;
...@@ -123,6 +139,45 @@ typedef enum ...@@ -123,6 +139,45 @@ typedef enum
/* Types of modifiers. /* Types of modifiers.
*/ */
/**
* GdkModifierType:
* @GDK_SHIFT_MASK: the Shift key.
* @GDK_LOCK_MASK: a Lock key (depending on the modifier mapping of the
* X server this may either be CapsLock or ShiftLock).
* @GDK_CONTROL_MASK: the Control key.
* @GDK_MOD1_MASK: the fourth modifier key (it depends on the modifier
* mapping of the X server which key is interpreted as this modifier, but
* normally it is the Alt key).
* @GDK_MOD2_MASK: the fifth modifier key (it depends on the modifier
* mapping of the X server which key is interpreted as this modifier).
* @GDK_MOD3_MASK: the sixth modifier key (it depends on the modifier
* mapping of the X server which key is interpreted as this modifier).
* @GDK_MOD4_MASK: the seventh modifier key (it depends on the modifier
* mapping of the X server which key is interpreted as this modifier).
* @GDK_MOD5_MASK: the eighth modifier key (it depends on the modifier
* mapping of the X server which key is interpreted as this modifier).
* @GDK_BUTTON1_MASK: the first mouse button.
* @GDK_BUTTON2_MASK: the second mouse button.
* @GDK_BUTTON3_MASK: the third mouse button.
* @GDK_BUTTON4_MASK: the fourth mouse button.
* @GDK_BUTTON5_MASK: the fifth mouse button.
* @GDK_SUPER_MASK: the Super modifier. Since 2.10
* @GDK_HYPER_MASK: the Hyper modifier. Since 2.10
* @GDK_META_MASK: the Meta modifier. Since 2.10
* @GDK_RELEASE_MASK: not used in GDK itself. GTK+ uses it to differentiate
* between (keyval, modifiers) pairs from key press and release events.
* @GDK_MODIFIER_MASK: a mask covering all modifier types.
*
* A set of bit-flags to indicate the state of modifier keys and mouse buttons
* in various event types. Typical modifier keys are Shift, Control, Meta,
* Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
*
* Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.
*
* Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped
* to Mod2 - Mod5, and indicates this by setting %GDK_SUPER_MASK,
* %GDK_HYPER_MASK or %GDK_META_MASK in the state field of key events.
*/
typedef enum typedef enum
{ {
GDK_SHIFT_MASK = 1 << 0, GDK_SHIFT_MASK = 1 << 0,
......
...@@ -25,6 +25,69 @@ ...@@ -25,6 +25,69 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
/**
* SECTION:windows
* @Short_description: Onscreen display areas in the target window system
* @Title: Windows
*
* A #GdkWindow is a rectangular region on the screen. It's a low-level object,
* used to implement high-level objects such as #GtkWidget and #GtkWindow on the
* GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think
* of as a "window" with a titlebar and so on; a #GtkWindow may contain many
* #GdkWindow<!-- -->s. For example, each #GtkButton has a #GdkWindow associated
* with it.
*
* <refsect2 id="COMPOSITED-WINDOWS">
* <title>Composited Windows</title>
* <para>
* Normally, the windowing system takes care of rendering the contents of a
* child window onto its parent window. This mechanism can be intercepted by
* calling gdk_window_set_composited() on the child window. For a
* <firstterm>composited</firstterm> window it is the responsibility of the
* application to render the window contents at the right spot.
* </para>
* <example id="composited-window-example">
* <title>Composited windows</title>
* <programlisting>
* <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/gdk/composited-window-example.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>
* </programlisting></example>
* <para>
* In the example <xref linkend="composited-window-example"/>, a button is
* placed inside of an event box inside of a window. The event box is set as
* composited and therefore is no longer automatically drawn to the screen.
*
* When the contents of the event box change, an expose event is generated on
* it's parent window (which, in this case, belongs to the toplevel #GtkWindow).
* The expose handler for this widget is responsible for merging the changes
* back on the screen in the way that it wishes.
*
* In our case, we merge the contents with a 50% transparency. We also set the
* background colour of the window to red. The effect is that the background
* shows through the button.
* </para>
* </refsect2>
* <refsect2 id="OFFSCREEN-WINDOWS">
* <title>Offscreen Windows</title>
* <para>
* Offscreen windows are more general than composited windows, since they allow
* not only to modify the rendering of the child window onto its parent, but
* also to apply coordinate transformations.
*
* To integrate an offscreen window into a window hierarchy, one has to call
* gdk_offscreen_window_set_embedder() and handle a number of signals. The
* #GdkWindow::pick-embedded-child signal on the embedder window is used to
* select an offscreen child at given coordinates, and the
* #GdkWindow::to-embedder and #GdkWindow::from-embedder signals on the
* offscreen window are used to translate coordinates between the embedder and
* the offscreen window.
*
* For rendering an offscreen window onto its embedder, the contents of the
* offscreen window are available as a pixmap, via
* gdk_offscreen_window_get_pixmap().
* </para>
* </refsect2>
*/
#include "config.h" #include "config.h"
#include "gdkwindow.h" #include "gdkwindow.h"
#include "gdkwindowimpl.h" #include "gdkwindowimpl.h"
......
...@@ -42,14 +42,16 @@ typedef struct _GdkWindowAttr GdkWindowAttr; ...@@ -42,14 +42,16 @@ typedef struct _GdkWindowAttr GdkWindowAttr;
typedef struct _GdkPointerHooks GdkPointerHooks; typedef struct _GdkPointerHooks GdkPointerHooks;
typedef struct _GdkWindowRedirect GdkWindowRedirect; typedef struct _GdkWindowRedirect GdkWindowRedirect;
/* Classes of windows. /**
* InputOutput: Almost every window should be of this type. Such windows * GdkWindowClass:
* receive events and are also displayed on screen. * @GDK_INPUT_OUTPUT: window for graphics and events
* InputOnly: Used only in special circumstances when events need to be * @GDK_INPUT_ONLY: window for events only
* stolen from another window or windows. Input only windows *
* have no visible output, so they are handy for placing over * @GDK_INPUT_OUTPUT windows are the standard kind of window you might expect.
* top of a group of windows in order to grab the events (or * Such windows receive events and are also displayed on screen.
* filter the events) from those windows. * @GDK_INPUT_ONLY windows are invisible; they are usually placed above other
* windows in order to trap or filter the events. You can't draw on
* @GDK_INPUT_ONLY windows.
*/ */
typedef enum typedef enum
{ {
...@@ -57,18 +59,20 @@ typedef enum ...@@ -57,18 +59,20 @@ typedef enum
GDK_INPUT_ONLY GDK_INPUT_ONLY
} GdkWindowClass; } GdkWindowClass;
/* Types of windows. /**
* Root: There is only 1 root window and it is initialized * GdkWindowType:
* at startup. Creating a window of type GDK_WINDOW_ROOT * @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire
* is an error. * screen, and is created by the window system
* Toplevel: Windows which interact with the window manager. * @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow)
* Child: Windows which are children of some other type of window. * @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry)
* (Any other type of window). Most windows are child windows. * @GDK_WINDOW_DIALOG: useless/deprecated compatibility type
* Dialog: A special kind of toplevel window which interacts with * @GDK_WINDOW_TEMP: override redirect temporary window (used to implement
* the window manager slightly differently than a regular * #GtkMenu)
* toplevel window. Dialog windows should be used for any * @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
* transient window. * @GDK_WINDOW_OFFSCREEN: offscreen window (see
* Foreign: A window that actually belongs to another application * <xref linkend="OFFSCREEN-WINDOWS"/>). Since 2.18
*
* Describes the kind of window.
*/ */
typedef enum typedef enum
{ {
...@@ -81,13 +85,24 @@ typedef enum ...@@ -81,13 +85,24 @@ typedef enum
GDK_WINDOW_OFFSCREEN GDK_WINDOW_OFFSCREEN
} GdkWindowType; } GdkWindowType;
/* Window attribute mask values. /**
* GDK_WA_TITLE: The "title" field is valid. * GdkWindowAttributesType:
* GDK_WA_X: The "x" field is valid. * @GDK_WA_TITLE: Honor the title field
* GDK_WA_Y: The "y" field is valid. * @GDK_WA_X: Honor the X coordinate field
* GDK_WA_CURSOR: The "cursor" field is valid. * @GDK_WA_Y: Honor the Y coordinate field
* GDK_WA_COLORMAP: The "colormap" field is valid. * @GDK_WA_CURSOR: Honor the cursor field
* GDK_WA_VISUAL: The "visual" field is valid. * @GDK_WA_COLORMAP: Honor the colormap field
* @GDK_WA_VISUAL: Honor the visual field
* @GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields
* @GDK_WA_NOREDIR: Honor the override_redirect field
* @GDK_WA_TYPE_HINT: Honor the type_hint field
*
* Used to indicate which fields in the #GdkWindowAttr struct should be honored.
* For example, if you filled in the "cursor" and "x" fields of #GdkWindowAttr,
* pass "@GDK_WA_X | @GDK_WA_CURSOR" to gdk_window_new(). Fields in
* #GdkWindowAttr not covered by a bit in this enum are required; for example,
* the @width/@height, @wclass, and @window_type fields are required, they have
* no corresponding flag in #GdkWindowAttributesType.
*/ */
typedef enum typedef enum
{ {
...@@ -104,6 +119,29 @@ typedef enum ...@@ -104,6 +119,29 @@ typedef enum
/* Size restriction enumeration. /* Size restriction enumeration.
*/ */
/**
* GdkWindowHints:
* @GDK_HINT_POS: indicates that the program has positioned the window
* @GDK_HINT_MIN_SIZE: min size fields are set
* @GDK_HINT_MAX_SIZE: max size fields are set
* @GDK_HINT_BASE_SIZE: base size fields are set
* @GDK_HINT_ASPECT: aspect ratio fields are set
* @GDK_HINT_RESIZE_INC: resize increment fields are set
* @GDK_HINT_WIN_GRAVITY: window gravity field is set
* @GDK_HINT_USER_POS: indicates that the window's position was explicitly set
* by the user
* @GDK_HINT_USER_SIZE: indicates that the window's size was explicitly set by
* the user
*
* Used to indicate which fields of a #GdkGeometry struct should be paid
* attention to. Also, the presence/absence of @GDK_HINT_POS,
* @GDK_HINT_USER_POS, and @GDK_HINT_USER_SIZE is significant, though they don't
* directly refer to #GdkGeometry fields. @GDK_HINT_USER_POS will be set
* automatically by #GtkWindow if you call gtk_window_move().
* @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE should be set if the user
* specified a size/position using a --geometry command-line argument;
* gtk_window_parse_geometry() automatically sets these flags.
*/
typedef enum typedef enum
{ {
GDK_HINT_POS = 1 << 0, GDK_HINT_POS = 1 << 0,
...@@ -118,17 +156,37 @@ typedef enum ...@@ -118,17 +156,37 @@ typedef enum
} GdkWindowHints; } GdkWindowHints;
/* Window type hints. /**
* These are hints for the window manager that indicate * GdkWindowTypeHint:
* what type of function the window has. The window manager * @GDK_WINDOW_TYPE_HINT_NORMAL: Normal toplevel window.
* can use this when determining decoration and behaviour * @GDK_WINDOW_TYPE_HINT_DIALOG: Dialog window.
* of the window. The hint must be set before mapping the * @GDK_WINDOW_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses
* window. * this hint only for torn-off menus, see #GtkTearoffMenuItem.
* @GDK_WINDOW_TYPE_HINT_TOOLBAR: Window used to implement toolbars.
* @GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: Window used to display a splash
* screen during application startup.
* @GDK_WINDOW_TYPE_HINT_UTILITY: Utility windows which are not detached
* toolbars or dialogs.
* @GDK_WINDOW_TYPE_HINT_DOCK: Used for creating dock or panel windows.
* @GDK_WINDOW_TYPE_HINT_DESKTOP: Used for creating the desktop background
* window.
* @GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar.
* @GDK_WINDOW_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar,
* e.g. a context menu.
* @GDK_WINDOW_TYPE_HINT_TOOLTIP: A tooltip.
* @GDK_WINDOW_TYPE_HINT_NOTIFICATION: A notification - typically a "bubble"
* that belongs to a status icon.
* @GDK_WINDOW_TYPE_HINT_COMBO: A popup from a combo box.
* @GDK_WINDOW_TYPE_HINT_DND: A window that is used to implement a DND cursor.
*
* These are hints for the window manager that indicate what type of function
* the window has. The window manager can use this when determining decoration
* and behaviour of the window. The hint must be set before mapping the window.
* *
* Normal: Normal toplevel window * See the
* Dialog: Dialog window * <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
* Menu: Window used to implement a menu. * Window Manager Hints</ulink> specification for more details about
* Toolbar: Window used to implement toolbars. * window types.
*/ */
typedef enum typedef enum
{ {
...@@ -153,6 +211,20 @@ typedef enum ...@@ -153,6 +211,20 @@ typedef enum
* of gdk_window_set_decorations/gdk_window_set_functions * of gdk_window_set_decorations/gdk_window_set_functions
* will need to change as well. * will need to change as well.
*/ */
/**
* GdkWMDecoration:
* @GDK_DECOR_ALL: all decorations should be applied.
* @GDK_DECOR_BORDER: a frame should be drawn around the window.
* @GDK_DECOR_RESIZEH: the frame should have resize handles.
* @GDK_DECOR_TITLE: a titlebar should be placed above the window.
* @GDK_DECOR_MENU: a button for opening a menu should be included.
* @GDK_DECOR_MINIMIZE: a minimize button should be included.
* @GDK_DECOR_MAXIMIZE: a maximize button should be included.
*
* These are hints originally defined by the Motif toolkit.
* The window manager can use them when determining how to decorate
* the window. The hint must be set before mapping the window.
*/
typedef enum typedef enum
{ {
GDK_DECOR_ALL = 1 << 0, GDK_DECOR_ALL = 1 << 0,
...@@ -164,6 +236,19 @@ typedef enum ...@@ -164,6 +236,19 @@ typedef enum
GDK_DECOR_MAXIMIZE = 1 << 6 GDK_DECOR_MAXIMIZE = 1 << 6
} GdkWMDecoration; } GdkWMDecoration;
/**
* GdkWMFunction:
* @GDK_FUNC_ALL: all functions should be offered.
* @GDK_FUNC_RESIZE: the window should be resizable.
* @GDK_FUNC_MOVE: the window should be movable.
* @GDK_FUNC_MINIMIZE: the window should be minimizable.
* @GDK_FUNC_MAXIMIZE: the window should be maximizable.
* @GDK_FUNC_CLOSE: the window should be closable.
*
* These are hints originally defined by the Motif toolkit. The window manager
* can use them when determining the functions to offer for the window. The
* hint must be set before mapping the window.
*/
typedef enum typedef enum
{ {
GDK_FUNC_ALL = 1 << 0, GDK_FUNC_ALL = 1 << 0,
...@@ -178,6 +263,26 @@ typedef enum ...@@ -178,6 +263,26 @@ typedef enum
* X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints() * X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints()
* will need fixing. * will need fixing.
*/ */
/**
* GdkGravity:
* @GDK_GRAVITY_NORTH_WEST: the reference point is at the top left corner.
* @GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge.
* @GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner.
* @GDK_GRAVITY_WEST: the reference point is at the middle of the left edge.
* @GDK_GRAVITY_CENTER: the reference point is at the center of the window.
* @GDK_GRAVITY_EAST: the reference point is at the middle of the right edge.
* @GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner.
* @GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge.
* @GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner.
* @GDK_GRAVITY_STATIC: the reference point is at the top left corner of the
* window itself, ignoring window manager decorations.
*
* Defines the reference point of a window and the meaning of coordinates
* passed to gtk_window_move(). See gtk_window_move() and the "implementation
* notes" section of the
* <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
* Window Manager Hints</ulink> specification for more details.
*/
typedef enum typedef enum
{ {
GDK_GRAVITY_NORTH_WEST = 1, GDK_GRAVITY_NORTH_WEST = 1,
...@@ -193,6 +298,19 @@ typedef enum ...@@ -193,6 +298,19 @@ typedef enum
} GdkGravity; } GdkGravity;
/**
* GdkWindowEdge:
* @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner.
* @GDK_WINDOW_EDGE_NORTH: the top edge.
* @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner.
* @GDK_WINDOW_EDGE_WEST: the left edge.
* @GDK_WINDOW_EDGE_EAST: the right edge.
* @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner.