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 *)((GdkWindowPrivate *)(win))->impl)
43 #define GDK_DRAWABLE_IMPL(win) ((GdkDrawable *)((GdkWindowPrivate *)(win))->impl)
44 #define GDK_WINDOW_IMPL_FBDATA(win) ((GdkWindowFBData *)((GdkWindowPrivate *)(win))->impl)
45 #define GDK_PIXMAP_IMPL_FBDATA(win) ((GdkPixmapFBData *)((GdkWindowPrivate *)(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 typedef GdkWindowObject GdkWindowPrivate;
61 #define GDK_DRAWABLE_PIXMAP (GDK_WINDOW_FOREIGN+1)
63 struct _GdkDrawableFBData
65 GdkDrawable parent_object;
71 gint abs_x, abs_y, lim_x, lim_y, llim_x, llim_y; /* computed values */
75 /* Due to excursions in gdk, this stuff has to be stored here instead of in GdkDrawable where it belongs */
76 gint width, height, depth;
77 GdkColormap *colormap;
78 GdkWindowType window_type;
82 GdkDrawableClass base_class;
85 #define GDK_DRAWABLE_P(x) ((GdkDrawableFBData *)(x))
87 struct _GdkPixmapFBData
89 GdkDrawableFBData drawable_data;
93 GdkDrawableFBClass klass;
96 GType gdk_drawable_impl_fb_get_type (void);
105 struct _GdkWindowFBData
107 GdkDrawableFBData drawable_data;
109 GHashTable *properties;
111 GdkEventMask event_mask;
113 gboolean realized : 1;
117 GdkDrawableFBClass base_class;
119 #define GDK_WINDOW_P(x) ((GdkWindowObject *)(x))
125 gpointer active_cmap;
127 struct fb_fix_screeninfo sinfo;
128 struct fb_var_screeninfo modeinfo;
129 int red_byte, green_byte, blue_byte; /* For truecolor */
134 } GdkVisualPrivateFB;
142 } GdkColormapPrivateFB;
145 GdkColormapClass base_class;
146 } GdkColormapFBClass;
150 GdkPixmap *cursor, *mask;
152 int mask_off_x, mask_off_y;
153 } GdkCursorPrivateFB;
162 void gdk_fb_font_init(void);
163 void gdk_fb_font_fini(void);
169 #define GDK_GC_FBDATA(x) ((GdkGCFBData *)(x))
170 #define GDK_GC_P(x) ((GdkGC *)(x))
173 GdkGC parent_instance;
175 GdkRegion *clip_region;
177 GdkGCValuesMask values_mask;
180 gushort dash_list_len;
185 GdkGCClass parent_class;
188 GType gdk_gc_fb_get_type (void);
190 GdkGC * _gdk_fb_gc_new (GdkDrawable *drawable,
192 GdkGCValuesMask values_mask);
195 /* Routines from gdkgeometry-fb.c */
197 void _gdk_window_init_position (GdkWindow *window);
198 void _gdk_window_move_resize_child (GdkWindow *window,
203 void _gdk_window_process_expose (GdkWindow *window,
206 void gdk_window_invalidate_region_clear(GdkWindow *window, GdkRegion *region);
207 void gdk_window_invalidate_rect_clear(GdkWindow *window, GdkRectangle *rect);
208 GdkGC *_gdk_fb_gc_new(GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask values_mask);
210 void gdk_fb_drawable_clear(GdkDrawable *drawable);
211 void gdk_fb_draw_drawable (GdkDrawable *drawable,
225 GdkRegion *real_clip_region;
227 guchar *mem, *clipmem;
230 guint rowstride, clip_rowstride;
231 int clipxoff, clipyoff;
233 gboolean draw_bg : 1;
234 gboolean copy_region : 1;
235 gboolean handle_cursor : 1;
236 } GdkFBDrawingContext;
238 void gdk_fb_drawing_context_init(GdkFBDrawingContext *dc, GdkDrawable *drawable,
239 GdkGC *gc, gboolean draw_bg, gboolean do_clipping);
240 void gdk_fb_drawing_context_finalize(GdkFBDrawingContext *dc);
242 void gdk_fb_draw_drawable_3 (GdkDrawable *drawable,
245 GdkFBDrawingContext *dc,
253 void gdk_fb_draw_drawable_2 (GdkDrawable *drawable,
263 gboolean do_clipping);
264 void gdk_fb_draw_rectangle (GdkDrawable *drawable,
271 void gdk_fb_fill_spans(GdkDrawable *real_drawable, GdkGC *gc, GdkRectangle *rects, int nrects);
272 GdkRegion *gdk_fb_clip_region(GdkDrawable *drawable, GdkGC *gc, gboolean do_clipping, gboolean do_children);
275 gdk_fb_pointer_grab (GdkWindow * window,
277 GdkEventMask event_mask,
278 GdkWindow * confine_to,
281 gboolean implicit_grab);
282 void gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab);
284 extern GdkWindow *_gdk_fb_pointer_grab_window, *_gdk_fb_pointer_grab_window_events, *_gdk_fb_keyboard_grab_window, *_gdk_fb_pointer_grab_confine;
285 extern GdkEventMask _gdk_fb_pointer_grab_events, _gdk_fb_keyboard_grab_events;
286 extern GdkCursor *_gdk_fb_pointer_grab_cursor;
287 extern GdkFBDisplay *gdk_display;
288 extern GdkDrawableClass _gdk_fb_drawable_class;
289 extern FILE *debug_out;
290 GdkEvent *gdk_event_make(GdkWindow *window, GdkEventType type, gboolean append_to_queue);
291 GdkEvent *gdk_event_make_2(GdkWindow *window, GdkEventType type, gboolean append_to_queue, gint button_press_num);
293 void gdk_fb_get_cursor_rect(GdkRectangle *rect);
294 gboolean gdk_fb_cursor_need_hide(GdkRectangle *rect);
295 gboolean gdk_fb_cursor_region_need_hide(GdkRegion *region);
296 void gdk_fb_cursor_unhide(void);
297 void gdk_fb_cursor_reset(void);
298 void gdk_fb_cursor_hide(void);
299 void gdk_fb_redraw_all(void);
301 void gdk_input_ps2_get_mouseinfo(gint *x, gint *y, GdkModifierType *mask);
302 void gdk_fb_window_visibility_crossing(GdkWindow *window, gboolean is_show, gboolean is_grab);
304 #define PANGO_TYPE_FB_FONT (pango_fb_font_get_type ())
305 #define PANGO_FB_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FB_FONT, PangoFBFont))
306 typedef struct _PangoFBFont PangoFBFont;
312 PangoFontDescription desc;
313 PangoCoverage *coverage;
314 GHashTable *glyph_info;
317 PangoRectangle extents[2];
322 GType pango_fb_font_get_type (void);
323 gboolean pango_fb_has_glyph(PangoFont *font, PangoGlyph glyph);
324 PangoGlyph pango_fb_get_unknown_glyph(PangoFont *font);
325 PangoFBGlyphInfo *pango_fb_font_get_glyph_info(PangoFont *font, PangoGlyph glyph);
327 void gdk_fb_window_move_resize (GdkWindow *window,
332 gboolean send_expose_events);
334 extern void CM(void); /* Check for general mem corruption */
335 extern void RP(GdkDrawable *drawable); /* Same, for pixmaps */
337 #endif /* __GDK_PRIVATE_FB_H__ */