]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdktypes.h
Merge branch 'master' into broadway2
[~andy/gtk] / gdk / gdktypes.h
index 4a18bd1bb55024039636f1939bcb9417385fab78..d655ff97da4964106e167ab5c935f27cc2e8a034 100644 (file)
@@ -8,7 +8,7 @@
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * itself, but also occasionally when compiling programs that use GDK
  * (or GTK). One such setting is what windowing API backend is in use.
  */
-#include <gdkconfig.h>
+#include <gdk/gdkconfig.h>
 
 /* some common magic values */
+
+/**
+ * GDK_CURRENT_TIME:
+ *
+ * Represents the current time, and can be used anywhere a time is expected.
+ */
 #define GDK_CURRENT_TIME     0L
 
 /**
@@ -63,7 +69,7 @@ G_BEGIN_DECLS
 
 /* Type definitions for the basic structures.
  */
-typedef struct _GdkPoint             GdkPoint;
+typedef struct _GdkPoint              GdkPoint;
 
 /**
  * GdkRectangle:
@@ -71,11 +77,31 @@ typedef struct _GdkPoint          GdkPoint;
  * Defines the position and size of a rectangle. It is identical to
  * #cairo_rectangle_int_t.
  */
-typedef cairo_rectangle_int_t        GdkRectangle;
+typedef cairo_rectangle_int_t         GdkRectangle;
 
+/**
+ * GdkAtom:
+ *
+ * An opaque type representing a string as an index into a table
+ * of strings on the X server.
+ */
 typedef struct _GdkAtom            *GdkAtom;
 
+/**
+ * GDK_ATOM_TO_POINTER:
+ * @atom: a #GdkAtom.
+ *
+ * Converts a #GdkAtom into a pointer type.
+ */
 #define GDK_ATOM_TO_POINTER(atom) (atom)
+
+/**
+ * GDK_POINTER_TO_ATOM:
+ * @ptr: a pointer containing a #GdkAtom.
+ *
+ * Extracts a #GdkAtom from a pointer. The #GdkAtom must have been
+ * stored in the pointer with GDK_ATOM_TO_POINTER().
+ */
 #define GDK_POINTER_TO_ATOM(ptr)  ((GdkAtom)(ptr))
 
 #ifdef GDK_NATIVE_WINDOW_POINTER
@@ -85,31 +111,42 @@ typedef struct _GdkAtom            *GdkAtom;
 #endif
 
 #define _GDK_MAKE_ATOM(val) ((GdkAtom)GUINT_TO_POINTER(val))
+
+/**
+ * GDK_NONE:
+ *
+ * A null value for #GdkAtom, used in a similar way as
+ * <literal>None</literal> in the Xlib API.
+ */
 #define GDK_NONE            _GDK_MAKE_ATOM (0)
 
+/**
+ * GdkNativeWindow:
+ *
+ * Used to represent native windows (<type>Window</type>s for the X11
+ * backend, <type>HWND</type>s for Win32).
+ */
 #ifdef GDK_NATIVE_WINDOW_POINTER
 typedef gpointer GdkNativeWindow;
 #else
 typedef guint32 GdkNativeWindow;
 #endif
-/* Forward declarations of commonly used types
- */
-typedef struct _GdkColor             GdkColor;
+
+/* Forward declarations of commonly used types */
+typedef struct _GdkColor              GdkColor;
 typedef struct _GdkRGBA               GdkRGBA;
-typedef struct _GdkCursor            GdkCursor;
+typedef struct _GdkCursor             GdkCursor;
 typedef struct _GdkVisual             GdkVisual;
+typedef struct _GdkDevice             GdkDevice;
+typedef struct _GdkDragContext        GdkDragContext;
 
-typedef struct _GdkDrawable           GdkDrawable;
-
-/**
- * GdkWindow:
- *
- * An opaque structure representing an onscreen drawable.
- */
-typedef struct _GdkDrawable           GdkWindow;
-typedef struct _GdkDisplay           GdkDisplay;
-typedef struct _GdkScreen            GdkScreen;
+typedef struct _GdkDisplayManager     GdkDisplayManager;
+typedef struct _GdkDeviceManager      GdkDeviceManager;
+typedef struct _GdkDisplay            GdkDisplay;
+typedef struct _GdkScreen             GdkScreen;
+typedef struct _GdkWindow             GdkWindow;
+typedef struct _GdkKeymap             GdkKeymap;
+typedef struct _GdkAppLaunchContext   GdkAppLaunchContext;
 
 /**
  * GdkByteOrder:
@@ -173,13 +210,13 @@ typedef enum
 typedef enum
 {
   GDK_SHIFT_MASK    = 1 << 0,
-  GDK_LOCK_MASK            = 1 << 1,
+  GDK_LOCK_MASK     = 1 << 1,
   GDK_CONTROL_MASK  = 1 << 2,
-  GDK_MOD1_MASK            = 1 << 3,
-  GDK_MOD2_MASK            = 1 << 4,
-  GDK_MOD3_MASK            = 1 << 5,
-  GDK_MOD4_MASK            = 1 << 6,
-  GDK_MOD5_MASK            = 1 << 7,
+  GDK_MOD1_MASK     = 1 << 3,
+  GDK_MOD2_MASK     = 1 << 4,
+  GDK_MOD3_MASK     = 1 << 5,
+  GDK_MOD4_MASK     = 1 << 6,
+  GDK_MOD5_MASK     = 1 << 7,
   GDK_BUTTON1_MASK  = 1 << 8,
   GDK_BUTTON2_MASK  = 1 << 9,
   GDK_BUTTON3_MASK  = 1 << 10,
@@ -201,11 +238,11 @@ typedef enum
 
 typedef enum
 {
-  GDK_OK         = 0,
-  GDK_ERROR      = -1,
+  GDK_OK          = 0,
+  GDK_ERROR       = -1,
   GDK_ERROR_PARAM = -2,
   GDK_ERROR_FILE  = -3,
-  GDK_ERROR_MEM          = -4
+  GDK_ERROR_MEM   = -4
 } GdkStatus;
 
 /**
@@ -245,9 +282,46 @@ typedef enum
   GDK_OWNERSHIP_APPLICATION
 } GdkGrabOwnership;
 
-/* Event masks. (Used to select what types of events a window
- *  *  will receive).
- *   */
+/**
+ * GdkEventMask:
+ * @GDK_EXPOSURE_MASK: receive expose events
+ * @GDK_POINTER_MOTION_MASK: receive all pointer motion events
+ * @GDK_POINTER_MOTION_HINT_MASK: see the explanation above
+ * @GDK_BUTTON_MOTION_MASK: receive pointer motion events while any button is pressed
+ * @GDK_BUTTON1_MOTION_MASK: receive pointer motion events while 1 button is pressed
+ * @GDK_BUTTON2_MOTION_MASK: receive pointer motion events while 2 button is pressed
+ * @GDK_BUTTON3_MOTION_MASK: receive pointer motion events while 3 button is pressed
+ * @GDK_BUTTON_PRESS_MASK: receive button press events
+ * @GDK_BUTTON_RELEASE_MASK: receive button release events
+ * @GDK_KEY_PRESS_MASK: receive key press events
+ * @GDK_KEY_RELEASE_MASK: receive key release events
+ * @GDK_ENTER_NOTIFY_MASK: receive window enter events
+ * @GDK_LEAVE_NOTIFY_MASK: receive window leave events
+ * @GDK_FOCUS_CHANGE_MASK: receive focus change events
+ * @GDK_STRUCTURE_MASK: receive events about window configuration change
+ * @GDK_PROPERTY_CHANGE_MASK: receive property change events
+ * @GDK_VISIBILITY_NOTIFY_MASK: receive visibility change events
+ * @GDK_PROXIMITY_IN_MASK: receive proximity in events
+ * @GDK_PROXIMITY_OUT_MASK: receive proximity out events
+ * @GDK_SUBSTRUCTURE_MASK: receive events about window configuration changes of
+ *   child windows
+ * @GDK_SCROLL_MASK: receive scroll events
+ * @GDK_ALL_EVENTS_MASK: the combination of all the above event masks.
+ *
+ * A set of bit-flags to indicate which events a window is to receive.
+ * Most of these masks map onto one or more of the #GdkEventType event types
+ * above.
+ *
+ * %GDK_POINTER_MOTION_HINT_MASK is a special mask which is used to reduce the
+ * number of %GDK_MOTION_NOTIFY events received. Normally a %GDK_MOTION_NOTIFY
+ * event is received each time the mouse moves. However, if the application
+ * spends a lot of time processing the event (updating the display, for example),
+ * it can lag behind the position of the mouse. When using
+ * %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will be sent,
+ * some of which are marked as a hint (the is_hint member is %TRUE).
+ * To receive more motion events after a motion hint event, the application
+ * needs to asks for more, by calling gdk_event_request_motions().
+ */
 typedef enum
 {
   GDK_EXPOSURE_MASK             = 1 << 1,