]> Pileus Git - ~andy/gtk/blob - gdk/linux-fb/gdkprivate-fb.h
Put it into CVS.
[~andy/gtk] / gdk / linux-fb / gdkprivate-fb.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library 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.
8  *
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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library 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.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-1999.  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/. 
25  */
26
27 /*
28  * Private uninstalled header defining things local to X windowing code
29  */
30
31 #ifndef __GDK_PRIVATE_FB_H__
32 #define __GDK_PRIVATE_FB_H__
33
34 #include <gdk/gdkprivate.h>
35 #include <gdk/gdk.h>
36 #include "gdkfb.h"
37 #include "gdkregion-generic.h"
38 #include <linux/fb.h>
39 #include <stdio.h>
40
41 #define GDK_DRAWABLE_FBDATA(win) ((GdkDrawableFBData *)(((GdkDrawablePrivate*)(win))->klass_data))
42 #define GDK_PIXMAP_FBDATA(win) ((GdkPixmapFBData *)(((GdkDrawablePrivate*)(win))->klass_data))
43 #define GDK_WINDOW_FBDATA(win) ((GdkWindowFBData *)(((GdkDrawablePrivate*)(win))->klass_data))
44 #define GDK_FONT_FB(f) ((GdkFontPrivateFB *)(f))
45 #define GDK_CURSOR_FB(c) ((GdkCursorPrivateFB *)(c))
46
47 typedef struct _GdkDrawableFBData GdkDrawableFBData;
48 typedef struct _GdkWindowFBData GdkWindowFBData;
49
50 struct _GdkDrawableFBData
51 {
52   guchar *mem;
53
54   gint abs_x, abs_y, lim_x, lim_y, llim_x, llim_y; /* computed values */
55
56   guint rowstride;
57 };
58
59 struct _GdkPixmapFBData
60 {
61   GdkDrawableFBData drawable_data;
62 };
63
64 typedef struct {
65   gulong length;
66   GdkAtom type;
67   gint format;
68   guchar data[1];
69 } GdkWindowProperty;
70
71 struct _GdkWindowFBData
72 {
73   GdkDrawableFBData drawable_data;
74   GdkCursor *cursor;
75   GHashTable *properties;
76
77   GdkEventMask event_mask;
78   gint level;
79   gboolean realized : 1;
80 };
81
82 struct _GdkFBDisplay
83 {
84   int fd;
85   guchar *fbmem;
86   gpointer active_cmap;
87   gulong mem_len;
88   struct fb_fix_screeninfo sinfo;
89   struct fb_var_screeninfo modeinfo;
90 };
91
92 typedef struct {
93   GdkVisual base;
94 } GdkVisualPrivateFB;
95
96 typedef struct {
97   GdkColormapPrivate base;
98
99   GHashTable *hash;
100   GdkColorInfo *info;
101   guint sync_tag;
102 } GdkColormapPrivateFB;
103
104 typedef struct {
105   GdkCursor base;
106   GdkPixmap *cursor, *mask;
107 } GdkCursorPrivateFB;
108
109 typedef struct {
110   GdkFontPrivate base;
111
112   int t1_font_id;
113   double size;
114   GSList *names;
115 } GdkFontPrivateFB;
116
117 typedef struct {
118   GdkImagePrivate base;
119 } GdkImagePrivateFB;
120
121 #define GDK_GC_FBDATA(x) ((GdkGCFBData *)((GdkGCPrivate *)x)->klass_data)
122 typedef struct {
123   GdkRegion *clip_region;
124   gchar *dash_list;
125   GdkGCValuesMask values_mask;
126   GdkGCValues values;
127   gint dash_offset;
128   gushort dash_list_len;
129   guchar depth, alu;
130 } GdkGCFBData;
131
132 GdkGC *       _gdk_fb_gc_new          (GdkDrawable     *drawable,
133                                        GdkGCValues     *values,
134                                        GdkGCValuesMask  values_mask);
135
136 /* Routines from gdkgeometry-fb.c */
137
138 void _gdk_window_init_position     (GdkWindow    *window);
139 void _gdk_window_move_resize_child (GdkWindow    *window,
140                                     gint          x,
141                                     gint          y,
142                                     gint          width,
143                                     gint          height);
144 void _gdk_window_process_expose    (GdkWindow    *window,
145                                     gulong        serial,
146                                     GdkRectangle *area);
147 GdkGC *_gdk_fb_gc_new(GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask values_mask);
148
149 void gdk_fb_drawable_clear(GdkDrawable *drawable);
150 void gdk_fb_draw_drawable  (GdkDrawable    *drawable,
151                             GdkGC          *gc,
152                             GdkPixmap      *src,
153                             gint            xsrc,
154                             gint            ysrc,
155                             gint            xdest,
156                             gint            ydest,
157                             gint            width,
158                             gint            height);
159 void gdk_fb_draw_drawable_2 (GdkDrawable *drawable,
160                              GdkGC       *gc,
161                              GdkPixmap   *src,
162                              gint         xsrc,
163                              gint         ysrc,
164                              gint         xdest,
165                              gint         ydest,
166                              gint         width,
167                              gint         height,
168                              gboolean     draw_bg,
169                              gboolean     do_clipping);
170 void gdk_fb_draw_rectangle (GdkDrawable    *drawable,
171                             GdkGC          *gc,
172                             gint            filled,
173                             gint            x,
174                             gint            y,
175                             gint            width,
176                             gint            height);
177 void gdk_fb_fill_spans(GdkDrawable *drawable, GdkGC *gc, GdkRectangle *rects, int nrects);
178
179 extern GdkWindow *_gdk_fb_pointer_grab_window, *_gdk_fb_keyboard_grab_window, *_gdk_fb_pointer_grab_confine;
180 extern GdkEventMask _gdk_fb_pointer_grab_events, _gdk_fb_keyboard_grab_events;
181 extern GdkCursor *_gdk_fb_pointer_grab_cursor;
182 extern GdkFBDisplay *gdk_display;
183 extern GdkDrawableClass _gdk_fb_drawable_class;
184 extern FILE *debug_out;
185 GdkEvent *gdk_event_make(GdkWindow *window, GdkEventType type, gboolean append_to_queue);
186
187 void gdk_fb_get_cursor_rect(GdkRectangle *rect);
188 void gdk_fb_cursor_unhide(void);
189 void gdk_fb_cursor_hide(void);
190 void gdk_fb_redraw_all(void);
191
192 void gdk_input_ps2_get_mouseinfo(gint *x, gint *y, GdkModifierType *mask);
193
194 #endif /* __GDK_PRIVATE_FB_H__ */