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. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
28 * Private uninstalled header defining things local to X windowing code
31 #ifndef __GDK_PRIVATE_FB_H__
32 #define __GDK_PRIVATE_FB_H__
34 #include <gdk/gdkprivate.h>
37 #include "gdkregion-generic.h"
40 #include <freetype/freetype.h>
42 #define GDK_DRAWABLE_IMPL_FBDATA(win) ((GdkDrawableFBData *)((GdkWindowObject *)(win))->impl)
43 #define GDK_DRAWABLE_IMPL(win) ((GdkDrawable *)((GdkWindowObject *)(win))->impl)
44 #define GDK_WINDOW_IMPL_FBDATA(win) ((GdkWindowFBData *)((GdkWindowObject *)(win))->impl)
45 #define GDK_PIXMAP_IMPL_FBDATA(win) ((GdkPixmapFBData *)((GdkWindowObject *)(win))->impl)
46 #define GDK_DRAWABLE_FBDATA(win) ((GdkDrawableFBData *)(win))
47 #define GDK_PIXMAP_FBDATA(win) ((GdkPixmapFBData *)(win))
48 #define GDK_WINDOW_FBDATA(win) ((GdkWindowFBData *)(win))
49 #define GDK_FONT_FB(f) ((GdkFontPrivateFB *)(f))
50 #define GDK_CURSOR_FB(c) ((GdkCursorPrivateFB *)(c))
52 #define GDK_CHECK_IMPL(drawable) \
53 g_assert(G_OBJECT_TYPE(drawable) == _gdk_window_impl_get_type() || G_OBJECT_TYPE(drawable) == _gdk_pixmap_impl_get_type())
54 #define GDK_CHECK_INTF(drawable) \
55 g_assert(G_OBJECT_TYPE(drawable) == gdk_window_get_type() || G_OBJECT_TYPE(drawable) == gdk_pixmap_get_type())
57 typedef struct _GdkDrawableFBData GdkDrawableFBData;
58 typedef struct _GdkWindowFBData GdkWindowFBData;
59 typedef struct _GdkPixmapFBData GdkPixmapFBData;
60 #define GDK_DRAWABLE_PIXMAP (GDK_WINDOW_FOREIGN+1)
62 struct _GdkDrawableFBData
64 GdkDrawable parent_object;
70 gint abs_x, abs_y, lim_x, lim_y, llim_x, llim_y; /* computed values */
74 /* Due to excursions in gdk, this stuff has to be stored here
75 instead of in GdkDrawable where it belongs */
76 gint width, height, depth;
77 GdkColormap *colormap;
78 GdkWindowType window_type;
82 GdkDrawableClass base_class;
85 struct _GdkPixmapFBData
87 GdkDrawableFBData drawable_data;
91 GdkDrawableFBClass klass;
94 GType gdk_drawable_impl_fb_get_type (void) G_GNUC_CONST;
103 struct _GdkWindowFBData
105 GdkDrawableFBData drawable_data;
107 GHashTable *properties;
109 GdkEventMask event_mask;
111 gboolean realized : 1;
115 GdkDrawableFBClass base_class;
117 #define GDK_WINDOW_P(x) ((GdkWindowObject *)(x))
123 gpointer active_cmap;
125 struct fb_fix_screeninfo sinfo;
126 struct fb_var_screeninfo modeinfo;
127 int red_byte, green_byte, blue_byte; /* For truecolor */
132 } GdkVisualPrivateFB;
138 } GdkColormapPrivateFB;
142 GdkPixmap *cursor, *mask;
144 int mask_off_x, mask_off_y;
145 } GdkCursorPrivateFB;
154 void gdk_fb_font_init(void);
155 void gdk_fb_font_fini(void);
161 #define GDK_GC_FBDATA(x) ((GdkGCFBData *)(x))
162 #define GDK_GC_P(x) ((GdkGC *)(x))
165 GdkGC parent_instance;
167 GdkRegion *clip_region;
169 GdkGCValuesMask values_mask;
172 gushort dash_list_len;
177 GdkGCClass parent_class;
180 GType gdk_gc_fb_get_type (void) G_GNUC_CONST;
182 /* Routines from gdkgeometry-fb.c */
184 void _gdk_window_init_position (GdkWindow *window);
185 void _gdk_window_move_resize_child (GdkWindow *window,
190 void _gdk_window_process_expose (GdkWindow *window,
193 void gdk_window_invalidate_region_clear(GdkWindow *window, GdkRegion *region);
194 void gdk_window_invalidate_rect_clear(GdkWindow *window, GdkRectangle *rect);
195 GdkGC *_gdk_fb_gc_new(GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask values_mask);
197 GdkImage*_gdk_fb_get_image (GdkDrawable *drawable,
203 void gdk_fb_drawable_clear (GdkDrawable *drawable);
204 void gdk_fb_draw_drawable (GdkDrawable *drawable,
218 GdkRegion *real_clip_region;
220 guchar *mem, *clipmem;
223 guint rowstride, clip_rowstride;
224 int clipxoff, clipyoff;
226 gboolean draw_bg : 1;
227 gboolean copy_region : 1;
228 gboolean handle_cursor : 1;
229 } GdkFBDrawingContext;
231 void gdk_fb_drawing_context_init(GdkFBDrawingContext *dc, GdkDrawable *drawable,
232 GdkGC *gc, gboolean draw_bg, gboolean do_clipping);
233 void gdk_fb_drawing_context_finalize(GdkFBDrawingContext *dc);
235 void gdk_fb_draw_drawable_3 (GdkDrawable *drawable,
238 GdkFBDrawingContext *dc,
246 void gdk_fb_draw_drawable_2 (GdkDrawable *drawable,
256 gboolean do_clipping);
257 void gdk_fb_draw_rectangle (GdkDrawable *drawable,
264 void gdk_fb_fill_spans(GdkDrawable *real_drawable, GdkGC *gc, GdkRectangle *rects, int nrects);
265 GdkRegion *gdk_fb_clip_region(GdkDrawable *drawable, GdkGC *gc, gboolean do_clipping, gboolean do_children);
268 gdk_fb_pointer_grab (GdkWindow * window,
270 GdkEventMask event_mask,
271 GdkWindow * confine_to,
274 gboolean implicit_grab);
275 void gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab);
277 extern GdkWindow *_gdk_fb_pointer_grab_window, *_gdk_fb_pointer_grab_window_events, *_gdk_fb_keyboard_grab_window, *_gdk_fb_pointer_grab_confine;
278 extern GdkEventMask _gdk_fb_pointer_grab_events, _gdk_fb_keyboard_grab_events;
279 extern GdkCursor *_gdk_fb_pointer_grab_cursor;
280 extern GdkFBDisplay *gdk_display;
281 extern GdkDrawableClass _gdk_fb_drawable_class;
282 extern FILE *debug_out;
283 GdkEvent *gdk_event_make(GdkWindow *window, GdkEventType type, gboolean append_to_queue);
284 GdkEvent *gdk_event_make_2(GdkWindow *window, GdkEventType type, gboolean append_to_queue, gint button_press_num);
286 void gdk_fb_get_cursor_rect(GdkRectangle *rect);
287 gboolean gdk_fb_cursor_need_hide(GdkRectangle *rect);
288 gboolean gdk_fb_cursor_region_need_hide(GdkRegion *region);
289 void gdk_fb_cursor_unhide(void);
290 void gdk_fb_cursor_reset(void);
291 void gdk_fb_cursor_hide(void);
292 void gdk_fb_redraw_all(void);
294 void gdk_input_get_mouseinfo(gint *x, gint *y, GdkModifierType *mask);
295 void gdk_fb_window_visibility_crossing(GdkWindow *window, gboolean is_show, gboolean is_grab);
297 #define PANGO_TYPE_FB_FONT (pango_fb_font_get_type ())
298 #define PANGO_FB_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FB_FONT, PangoFBFont))
299 typedef struct _PangoFBFont PangoFBFont;
305 PangoFontDescription desc;
306 PangoCoverage *coverage;
307 GHashTable *glyph_info;
310 PangoRectangle extents[2];
315 GType pango_fb_font_get_type (void) G_GNUC_CONST;
316 gboolean pango_fb_has_glyph(PangoFont *font, PangoGlyph glyph);
317 PangoGlyph pango_fb_get_unknown_glyph(PangoFont *font);
318 PangoFBGlyphInfo *pango_fb_font_get_glyph_info(PangoFont *font, PangoGlyph glyph);
320 void gdk_fb_window_move_resize (GdkWindow *window,
325 gboolean send_expose_events);
327 extern void CM(void); /* Check for general mem corruption */
328 extern void RP(GdkDrawable *drawable); /* Same, for pixmaps */
330 #endif /* __GDK_PRIVATE_FB_H__ */