1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team.
26 * GTK+ DirectFB backend
27 * Copyright (C) 2001-2002 convergence integrated media GmbH
28 * Copyright (C) 2002-2004 convergence GmbH
29 * Written by Denis Oliver Kropp <dok@convergence.de> and
30 * Sven Neumann <sven@convergence.de>
33 #ifndef __GDK_PRIVATE_DIRECTFB_H__
34 #define __GDK_PRIVATE_DIRECTFB_H__
36 //#include <gdk/gdk.h>
37 #include <gdk/gdkprivate.h>
38 #include "gdkinternals.h"
39 #include "gdkcursor.h"
40 #include "gdkdisplay-directfb.h"
45 #define GDK_TYPE_DRAWABLE_IMPL_DIRECTFB (gdk_drawable_impl_directfb_get_type ())
46 #define GDK_DRAWABLE_IMPL_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE_IMPL_DIRECTFB, GdkDrawableImplDirectFB))
47 #define GDK_IS_DRAWABLE_IMPL_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE_IMPL_DIRECTFB))
49 #define GDK_TYPE_WINDOW_IMPL_DIRECTFB (gdk_window_impl_directfb_get_type ())
50 #define GDK_WINDOW_IMPL_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_DIRECTFB, GdkWindowImplDirectFB))
51 #define GDK_IS_WINDOW_IMPL_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_DIRECTFB))
53 #define GDK_TYPE_PIXMAP_IMPL_DIRECTFB (gdk_pixmap_impl_directfb_get_type ())
54 #define GDK_PIXMAP_IMPL_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXMAP_IMPL_DIRECTFB, GdkPixmapImplDirectFB))
55 #define GDK_IS_PIXMAP_IMPL_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXMAP_IMPL_DIRECTFB))
58 typedef struct _GdkDrawableImplDirectFB GdkDrawableImplDirectFB;
59 typedef struct _GdkWindowImplDirectFB GdkWindowImplDirectFB;
60 typedef struct _GdkPixmapImplDirectFB GdkPixmapImplDirectFB;
63 struct _GdkDrawableImplDirectFB
65 GdkDrawable parent_object;
71 GdkRegion *paint_region;
79 GdkColormap *colormap;
81 IDirectFBSurface *surface;
82 DFBSurfacePixelFormat format;
83 cairo_surface_t * cairo_surface;
89 GdkDrawableClass parent_class;
90 } GdkDrawableImplDirectFBClass;
92 GType gdk_drawable_impl_directfb_get_type (void);
94 void _gdk_directfb_draw_rectangle (GdkDrawable *drawable,
102 void _gdk_directfb_update (GdkDrawableImplDirectFB *impl,
105 GdkEvent * gdk_directfb_event_make (GdkWindow *window,
113 struct _GdkPixmapImplDirectFB
115 GdkDrawableImplDirectFB parent_instance;
120 GdkDrawableImplDirectFBClass parent_class;
121 } GdkPixmapImplDirectFBClass;
123 GType gdk_pixmap_impl_directfb_get_type (void);
140 struct _GdkWindowImplDirectFB
142 GdkDrawableImplDirectFB drawable;
144 IDirectFBWindow *window;
149 GHashTable *properties;
153 GdkWindowTypeHint type_hint;
158 GdkDrawableImplDirectFBClass parent_class;
159 } GdkWindowImplDirectFBClass;
161 GType gdk_window_impl_directfb_get_type (void);
163 void gdk_directfb_window_send_crossing_events (GdkWindow *src,
165 GdkCrossingMode mode);
167 void _gdk_directfb_calc_abs (GdkWindow *window);
169 GdkWindow * gdk_directfb_window_find_toplevel (GdkWindow *window);
172 void gdk_directfb_window_id_table_insert (DFBWindowID dfb_id,
174 void gdk_directfb_window_id_table_remove (DFBWindowID dfb_id);
175 GdkWindow * gdk_directfb_window_id_table_lookup (DFBWindowID dfb_id);
184 IDirectFBSurface *shape;
190 DFBSurfacePixelFormat format;
195 IDirectFBSurface *surface;
199 #define GDK_TYPE_GC_DIRECTFB (gdk_gc_directfb_get_type ())
200 #define GDK_GC_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_DIRECTFB, GdkGCDirectFB))
201 #define GDK_IS_GC_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_DIRECTFB))
205 GdkGC parent_instance;
207 GdkRegion *clip_region;
209 GdkGCValuesMask values_mask;
215 GdkGCClass parent_class;
216 } GdkGCDirectFBClass;
218 GType gdk_gc_directfb_get_type (void);
220 GdkGC * _gdk_directfb_gc_new (GdkDrawable *drawable,
222 GdkGCValuesMask values_mask);
224 GdkImage* _gdk_directfb_copy_to_image (GdkDrawable *drawable,
233 void gdk_directfb_event_windows_add (GdkWindow *window);
235 GdkGrabStatus gdk_directfb_pointer_grab (GdkWindow *window,
237 GdkEventMask event_mask,
238 GdkWindow *confine_to,
241 gboolean implicit_grab);
242 void gdk_directfb_pointer_ungrab (guint32 time,
243 gboolean implicit_grab);
245 guint32 gdk_directfb_get_time (void);
247 GdkWindow * gdk_directfb_pointer_event_window (GdkWindow *window,
249 GdkWindow * gdk_directfb_keyboard_event_window (GdkWindow *window,
251 GdkWindow * gdk_directfb_other_event_window (GdkWindow *window,
253 void _gdk_selection_window_destroyed (GdkWindow *window);
255 void _gdk_directfb_move_resize_child (GdkWindow *window,
261 GdkWindow * gdk_directfb_child_at (GdkWindow *window,
265 GdkWindow * gdk_directfb_window_find_focus (void);
267 void gdk_directfb_change_focus (GdkWindow *new_focus_window);
269 void gdk_directfb_mouse_get_info (gint *x,
271 GdkModifierType *mask);
273 /**********************/
274 /* Global variables */
275 /**********************/
277 extern GdkDisplayDFB *_gdk_display;
279 /* Pointer grab info */
280 extern GdkWindow * _gdk_directfb_pointer_grab_window;
281 extern gboolean _gdk_directfb_pointer_grab_owner_events;
282 extern GdkWindow * _gdk_directfb_pointer_grab_confine;
283 extern GdkEventMask _gdk_directfb_pointer_grab_events;
284 extern GdkCursor * _gdk_directfb_pointer_grab_cursor;
286 /* Keyboard grab info */
287 extern GdkWindow * _gdk_directfb_keyboard_grab_window;
288 extern GdkEventMask _gdk_directfb_keyboard_grab_events;
289 extern gboolean _gdk_directfb_keyboard_grab_owner_events;
291 extern GdkScreen * _gdk_screen;
293 extern GdkAtom _gdk_selection_property;
296 IDirectFBPalette * gdk_directfb_colormap_get_palette (GdkColormap *colormap);
299 /* these are Linux-FB specific functions used for window decorations */
301 typedef gboolean (* GdkWindowChildChanged) (GdkWindow *window,
307 typedef void (* GdkWindowChildGetPos) (GdkWindow *window,
312 void gdk_fb_window_set_child_handler (GdkWindow *window,
313 GdkWindowChildChanged changed,
314 GdkWindowChildGetPos get_pos,
318 #endif /* __GDK_PRIVATE_DIRECTFB_H__ */