gdkprivate.h

Go to the documentation of this file.
00001 /* GDK - The GIMP Drawing Kit
00002  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 /*
00021  * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
00022  * file for a list of people on the GTK+ Team.  See the ChangeLog
00023  * files for a list of changes.  These files are distributed with
00024  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
00025  */
00026 
00027 #ifndef __GDK_PRIVATE_H__
00028 #define __GDK_PRIVATE_H__
00029 
00030 #include <gdk/gdktypes.h>
00031 #include <gdk/gdkevents.h>
00032 #include <gdk/gdkfont.h>
00033 #include <gdk/gdkgc.h>
00034 #include <gdk/gdkim.h>
00035 #include <gdk/gdkimage.h>
00036 #include <gdk/gdkregion.h>
00037 #include <gdk/gdkvisual.h>
00038 #include <gdk/gdkwindow.h>
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif                          /* __cplusplus */
00043 
00044 #define GDK_DRAWABLE_TYPE(d) (((GdkDrawablePrivate *)d)->window_type)
00045 #define GDK_IS_WINDOW(d) (GDK_DRAWABLE_TYPE(d) <= GDK_WINDOW_TEMP || \
00046                           GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
00047 #define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
00048 #define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
00049 
00050 #define gdk_window_lookup(xid)     ((GdkWindow*) gdk_xid_table_lookup (xid))
00051 #define gdk_pixmap_lookup(xid)     ((GdkPixmap*) gdk_xid_table_lookup (xid))
00052 #define gdk_font_lookup(xid)       ((GdkFont*) gdk_xid_table_lookup (xid))
00053 
00054    typedef struct _GdkDrawablePrivate GdkDrawablePrivate;
00055 /* typedef struct _GdkDrawablePrivate     GdkPixmapPrivate; */
00056    typedef struct _GdkWindowPrivate GdkWindowPrivate;
00057    typedef struct _GdkImageClass GdkImageClass;
00058    typedef struct _GdkImagePrivate GdkImagePrivate;
00059    typedef struct _GdkGCPrivate GdkGCPrivate;
00060    typedef struct _GdkColormapPrivate GdkColormapPrivate;
00061    typedef struct _GdkColorInfo GdkColorInfo;
00062    typedef struct _GdkFontPrivate GdkFontPrivate;
00063    typedef struct _GdkEventFilter GdkEventFilter;
00064    typedef struct _GdkClientFilter GdkClientFilter;
00065 
00066    struct _GdkDrawablePrivate {
00067       GdkDrawable drawable;
00068       GdkDrawableClass *klass;
00069       gpointer klass_data;
00070 
00071       guint8 window_type;
00072       guint ref_count;
00073 
00074       guint16 width;
00075       guint16 height;
00076 
00077       GdkColormap *colormap;
00078 
00079       guint destroyed:2;
00080    };
00081 
00082    struct _GdkWindowPrivate {
00083       GdkDrawablePrivate drawable;
00084 
00085       GdkWindow *parent;
00086       gint16 x;
00087       gint16 y;
00088       guint8 resize_count;
00089       guint mapped:1;
00090       guint guffaw_gravity:1;
00091 
00092       gint extension_events;
00093 
00094       GList *filters;
00095       GList *children;
00096    };
00097 
00098    struct _GdkImageClass {
00099       void (*destroy) (GdkImage * image);
00100       void (*image_put) (GdkImage * image,
00101                          GdkDrawable * window,
00102                          GdkGC * gc,
00103                          gint xsrc,
00104                          gint ysrc,
00105                          gint xdest, gint ydest, gint width, gint height);
00106    };
00107 
00108    struct _GdkImagePrivate {
00109       GdkImage image;
00110 
00111       guint ref_count;
00112       GdkImageClass *klass;
00113    };
00114 
00115    struct _GdkFontPrivate {
00116       GdkFont font;
00117       guint ref_count;
00118    };
00119 
00120    struct _GdkGCPrivate {
00121       guint ref_count;
00122       GdkGCClass *klass;
00123       gpointer klass_data;
00124    };
00125 
00126    typedef enum {
00127       GDK_COLOR_WRITEABLE = 1 << 0
00128    } GdkColorInfoFlags;
00129 
00130    struct _GdkColorInfo {
00131       GdkColorInfoFlags flags;
00132       guint ref_count;
00133    };
00134 
00135    struct _GdkColormapPrivate {
00136       GdkColormap colormap;
00137       GdkVisual *visual;
00138 
00139       guint ref_count;
00140    };
00141 
00142    struct _GdkEventFilter {
00143       GdkFilterFunc function;
00144       gpointer data;
00145    };
00146 
00147    struct _GdkClientFilter {
00148       GdkAtom type;
00149       GdkFilterFunc function;
00150       gpointer data;
00151    };
00152 
00153    typedef enum {
00154       GDK_ARG_STRING,
00155       GDK_ARG_INT,
00156       GDK_ARG_BOOL,
00157       GDK_ARG_NOBOOL,
00158       GDK_ARG_CALLBACK
00159    } GdkArgType;
00160 
00161 
00162    typedef struct _GdkArgContext GdkArgContext;
00163    typedef struct _GdkArgDesc GdkArgDesc;
00164 
00165    typedef void (*GdkArgFunc) (const char *name, const char *arg,
00166                                gpointer data);
00167 
00168    struct _GdkArgContext {
00169       GPtrArray *tables;
00170       gpointer cb_data;
00171    };
00172 
00173    struct _GdkArgDesc {
00174       const char *name;
00175       GdkArgType type;
00176       gpointer location;
00177       GdkArgFunc callback;
00178    };
00179 
00180 
00181    typedef enum {
00182       GDK_DEBUG_MISC = 1 << 0,
00183       GDK_DEBUG_EVENTS = 1 << 1,
00184       GDK_DEBUG_DND = 1 << 2,
00185       GDK_DEBUG_COLOR_CONTEXT = 1 << 3,
00186       GDK_DEBUG_XIM = 1 << 4
00187    } GdkDebugFlag;
00188 
00189    void gdk_event_button_generate(GdkEvent * event);
00190 
00191 /* FIFO's for event queue, and for events put back using
00192  * gdk_event_put().
00193  */
00194    extern GList *gdk_queued_events;
00195    extern GList *gdk_queued_tail;
00196 
00197    extern GdkEventFunc gdk_event_func;  /* Callback for events */
00198    extern gpointer gdk_event_data;
00199    extern GDestroyNotify gdk_event_notify;
00200 
00201    GdkEvent *gdk_event_new(void);
00202 
00203    void gdk_events_init(void);
00204    void gdk_events_queue(void);
00205    GdkEvent *gdk_event_unqueue(void);
00206 
00207    GList *gdk_event_queue_find_first(void);
00208    void gdk_event_queue_remove_link(GList * node);
00209    void gdk_event_queue_append(GdkEvent * event);
00210 
00211    void gdk_window_init(void);
00212    void gdk_visual_init(void);
00213    void gdk_dnd_init(void);
00214 
00215    void gdk_image_init(void);
00216    void gdk_image_exit(void);
00217 
00218    void gdk_input_init(void);
00219    void gdk_input_exit(void);
00220 
00221    void gdk_windowing_exit(void);
00222 
00223    void gdk_window_add_colormap_windows(GdkWindow * window);
00224    void gdk_window_destroy_notify(GdkWindow * window);
00225 
00226 /* If you pass x = y = -1, it queries the pointer
00227    to find out where it currently is.
00228    If you pass x = y = -2, it does anything necessary
00229    to know that the drag is ending.
00230 */
00231    void gdk_dnd_display_drag_cursor(gint x,
00232                                     gint y,
00233                                     gboolean drag_ok,
00234                                     gboolean change_made);
00235 
00236    extern gint gdk_debug_level;
00237    extern gboolean gdk_show_events;
00238    extern gint gdk_screen;
00239    GDKVAR GdkWindow *gdk_parent_root;
00240    GDKVAR gint gdk_error_code;
00241    GDKVAR gint gdk_error_warnings;
00242    extern GList *gdk_default_filters;
00243 
00244    GdkWindow *_gdk_window_alloc(void);
00245 
00246 /* Font/string functions implemented in module-specific code */
00247    gint _gdk_font_strlen(GdkFont * font, const char *str);
00248    void _gdk_font_destroy(GdkFont * font);
00249 
00250    void _gdk_colormap_real_destroy(GdkColormap * colormap);
00251 
00252    void _gdk_cursor_destroy(GdkCursor * cursor);
00253 
00254 /* Initialization */
00255 
00256    extern GdkArgDesc _gdk_windowing_args[];
00257    gboolean _gdk_windowing_init_check(int argc, char **argv);
00258 
00259 #ifdef USE_XIM
00260 /* XIM support */
00261    gint gdk_im_open(void);
00262    void gdk_im_close(void);
00263    void gdk_ic_cleanup(void);
00264 #endif                          /* USE_XIM */
00265 
00266 /* Debugging support */
00267 
00268 #ifdef G_ENABLE_DEBUG
00269 
00270 #define GDK_NOTE(type,action)                G_STMT_START { \
00271     if (gdk_debug_flags & GDK_DEBUG_##type)                 \
00272        { action; };                          } G_STMT_END
00273 
00274 #else                           /* !G_ENABLE_DEBUG */
00275 
00276 #define GDK_NOTE(type,action)
00277 
00278 #endif                          /* G_ENABLE_DEBUG */
00279 
00280    GDKVAR guint gdk_debug_flags;
00281 
00282 
00283 #ifdef __cplusplus
00284 }
00285 #endif                          /* __cplusplus */
00286 #endif                          /* __GDK_PRIVATE_H__ */

Generated on Tue Jul 5 14:14:38 2011 for ROOT_528-00b_version by  doxygen 1.5.1