]> Pileus Git - ~andy/gtk/blob - gdk/TODO
Make gdkx.h the only installed header from gdk/x11. All structures in
[~andy/gtk] / gdk / TODO
1 General
2 =======
3
4 - gdk_pointer_grab() and gdk_keyboard_grab() are logically member
5   functions of GdkWindow.
6
7 X specific Functions that need to be moved out of the common header files
8 =========================================================================
9
10
11 Dir structure for ports
12 =======================
13
14 The directory structure here is:
15
16  gdk/
17  gdk/x11
18  gdk/win32
19  ...
20  
21 The gdk/ directory directly contains all public
22 header files (that are not specific to one 
23 windowing system).
24
25 There, in general should be no system dependency 
26
27 For each set of functionality, there are the following
28 files:
29
30  gdkwindow.h:        public header file
31  gdkwindow.c:        common implementation
32  x11/gdkwindow.i:    functionality specific to X11
33  win32/gdkwindow.i: functionality specific to win32
34
35 The gdkwindow.c file looks like:
36
37 ====
38 #include "gdkwindow.h"
39
40 #ifdef GDK_WINDOWING_X11
41 #include "x11/gdkwindow.i"
42 #elif defined(GDK_WINDOW_WIN32)
43 #include "win32/gdkwindow.i"
44  fo#endif
45
46 [ generic implementation bits ]
47 ====
48
49 x11/gdkwindow.i should only assume that gdkwindow.h has been
50 included and included all other dependencies explicitely.
51
52 The x11/ directory will contain:
53
54  .i files
55  .c files specific to X
56  .h files specific to X
57
58 And a Makefile.am that takes care of distributing the
59 files in the directory, and also for building any
60 X-specific utilities. (Such as the gxid daemon).
61
62
63 Port Status for Files
64 =====================
65
66 gdk
67
68  Much of the contents have been moved to x11/gtkmain.c. 
69  I've added a little argument-parsing abstraction.
70  (Currently called gdk_arg_context_*) that allows 
71  arguments from multiple places to be combined - that
72  probably needs to be either fixed up and moved into
73  GLib or replaced with some existing solution like
74  popt.
75
76 gdkcc
77
78  This will be removed for GTK+-1.4. Right now, it has been moved
79  completely into the x11/ directory to avoid having to port it.
80
81 gdkcolor
82
83  There are a few common utility functions, and the rest
84  is in the port-specific files.
85
86 gdkcursor
87
88  No shared code - completely port-specific.
89
90 gdkdnd
91
92  No shared code - completely arch-specific. It's possible that some
93  common code for handling GdkDragContext could exist, but the
94  GdkDragContextPrivate will be different on each port.
95
96 gdkdrawable
97
98  Pretty much done. GdkDrawable is completely virtualized.
99
100 gdkevents
101
102  There are a few common utility functions, and the rest
103  is in the port-specific files.
104
105 gdkfont
106
107  Pretty much done for now - gdkfont.c contains a number of functions
108  reimplemented as utility functions, and the rest is
109  ports-specific. It will be obsoleted by pango before 1.4.
110
111 gdkgc
112
113  GdkGC is virtualized to go along with GdkDrawable. There are
114  a couple of functions I punted on for now and moved into the
115  port-specific files - the clipmask functions (because gdkregion
116  is not finalized) and also gdk_gc_copy, which I'm not sure
117  I like enough to put into the vtable.
118
119 gdkim
120
121  All in the port-specific directories. The abstraction here probably
122  will be changed at some point to something more convenient and
123  more Unicode-based.
124
125 gdkimage
126
127  GdkImage is virtualized - all of the code except for ref/unref
128  is in the port-specific files.
129
130 gdkinput
131
132  Right now all the code is port-specific. It should be possible 
133  to share the code in gdkinputnone.c, but probably not worth it; 
134  I'd like to get rid of the gdk_input_vtable in X11 code - 
135  it doesn't make sense since you can't switch the type of input
136  on the fly.
137
138 gdkpixmap
139
140  All moved into the port-specific file for now. The xpm loader
141  should be changed to render with GdkRGB, and thus be 
142  windowing-system independent, but that requires
143  first making GdkRGB able to render onto any arbitrary visual.
144
145 gdkproperty
146
147  All port-specific. Possibly should be X-specific with a higher-level
148  clipboard API on top of it.
149
150 gdkregion
151
152  Right now punted to being port-specific, but that probably needs
153  to change with the virtualized drawables and GC's.
154
155 gdkrgb
156
157  With a few changes to debugging code, it was already port-independent.
158
159 gdkselection
160
161  Completely port specific. (In fact, really doesn't make sense
162  on anything other than X; a higher-level clipboard facility
163  should be provided somewhere, though.)
164
165 gdkvisual
166  
167  Completely port-specific. (The concepts are rather X-specific)
168
169 gdkwindow
170
171  The window-private data is split between windowing-system independent
172  parts and windowing system dependent parts. There are a few
173  functions in gdk/gdkwindow.c and the rest is moved off
174  into x11/gdkwindow-x11.c
175
176 Virtualization
177 ==============
178
179 The concept of virtualization is that calls to draw
180 on a drawable are dispatched through a function table.
181 This potentially allows for:
182
183  Postscript drawables
184  metafiles
185
186 It also provides a nice clean framework for multi-windowing
187 support - instead of reimplementing a whole bunch of function
188 calls, one provides an implementaiton for the vtables.
189
190 X works in this way internally - per-screen functions are
191 virtualized inside a screen structure, and drawing functions 
192 are virtualized inside the GC structure.
193
194 For the virtualization of drawing, clearly GdkDrawable needs
195 to be virtualized. Beyond that, one has to decide on
196 a case-by-case basis whether a particular structure is
197 drawing-mode independent (like GdkRectangle) or not.
198
199 The most important GDK structures that are involved drawing are:
200
201  GdkColor
202  GdkGC
203  GdkFont
204  GdkRegion
205
206 The whole font aspect of Gdk is going to get heavily
207 reworked with the introduction of "Pango".
208 GdkRegion almost certainly needs to be virtualized,
209 if you, way, want to do postscript drawables.
210
211 While doing so, the API of GdkRegion should be
212 changed so that the region operations take 3 parameters
213 instead of returning a newly created region.
214
215
216 Drawable operations:
217   destroy
218   create_gc
219   get_values
220   set_values
221   set_dashes
222   copy
223
224 GC Operations:
225   draw_point
226   draw_line
227   draw_rectangle
228   draw_arc
229   draw_polygon
230   draw_string
231   draw_text
232   draw_text_wc
233   draw_pixmap
234   draw_bitmap
235   draw_image
236   draw_points
237   draw_segments
238   draw_lines
239
240
241 Adding multi-screen, display support.
242 =====================================
243
244  The following functions need to have per-display variants:
245
246 void gdk_pointer_ungrab (guint32         time);
247 void gdk_keyboard_ungrab (guint32         time);
248 gint gdk_pointer_is_grabbed (void);
249
250 gint gdk_screen_width  (void);
251 gint gdk_screen_height (void);
252
253 gint gdk_screen_width_mm  (void);
254 gint gdk_screen_height_mm (void);
255
256 void gdk_beep (void);
257
258 gint          gdk_visual_get_best_depth      (void);
259 GdkVisualType gdk_visual_get_best_type       (void);
260 GdkVisual*    gdk_visual_get_system          (void);
261 GdkVisual*    gdk_visual_get_best            (void);
262 GdkVisual*    gdk_visual_get_best_with_depth (gint           depth);
263 GdkVisual*    gdk_visual_get_best_with_type  (GdkVisualType  visual_type);
264 GdkVisual*    gdk_visual_get_best_with_both  (gint           depth,
265                                               GdkVisualType  visual_type);
266
267 void gdk_query_depths       (gint           **depths,
268                              gint            *count);
269 void gdk_query_visual_types (GdkVisualType  **visual_types,
270                              gint            *count);
271
272 GList* gdk_list_visuals (void);
273
274 void gdk_add_client_message_filter (GdkAtom       message_type,
275                                     GdkFilterFunc func,
276                                     gpointer      data);
277
278 guint32         gdk_drag_get_protocol (guint32          xid,
279                                        GdkDragProtocol *protocol);
280
281 GdkCursor* gdk_cursor_new                (GdkCursorType   cursor_type);
282 GdkCursor* gdk_cursor_new_from_pixmap    (GdkPixmap       *source,
283                                           GdkPixmap       *mask,
284                                           GdkColor        *fg,
285                                           GdkColor        *bg,
286                                           gint             x,
287                                           gint             y);
288 GdkColormap* gdk_colormap_get_system       (void);
289 gint         gdk_colormap_get_system_size  (void);
290
291 GdkFont* gdk_font_load      (const gchar    *font_name);
292 GdkFont* gdk_fontset_load   (gchar          *fontset_name);
293
294 gint       gdk_selection_owner_set (GdkWindow    *owner,
295                                     GdkAtom       selection,
296                                     guint32       time,
297                                     gint          send_event);
298 GdkWindow* gdk_selection_owner_get (GdkAtom       selection);
299
300 void       gdk_selection_send_notify (guint32       requestor,
301                                       GdkAtom       selection,
302                                       GdkAtom       target,
303                                       GdkAtom       property,
304                                       guint32       time);
305 gint       gdk_text_property_to_text_list (GdkAtom encoding, gint format,
306                                            guchar *text, gint length,
307                                            gchar ***list);
308 void       gdk_free_text_list             (gchar **list);
309 gint       gdk_string_to_compound_text    (gchar *str,
310                                            GdkAtom *encoding, gint *format,
311                                            guchar **ctext, gint *length);
312 void       gdk_free_compound_text         (guchar *ctext);
313 GdkAtom gdk_atom_intern     (const gchar *atom_name,
314                              gint         only_if_exists);
315 gchar*  gdk_atom_name       (GdkAtom atom);
316 GList *gdk_input_list_devices               (void);
317 void gdk_input_set_source                   (guint32 deviceid,
318                                              GdkInputSource source);
319 gint gdk_input_set_mode                     (guint32 deviceid,
320                                              GdkInputMode mode);
321 void gdk_input_set_axes                     (guint32 deviceid,
322                                              GdkAxisUse *axes);
323 void gdk_input_set_key                      (guint32 deviceid,
324                                              guint   index,
325                                              guint   keyval,
326                                              GdkModifierType modifiers);
327 gint         gdk_im_ready          (void);
328 void         gdk_im_end            (void);
329 GdkIC*       gdk_ic_new            (GdkICAttr           *attr,
330                                     GdkICAttributesType mask);
331 GdkRegion*     gdk_region_new       (void);
332 void     gdk_event_send_clientmessage_toall (GdkEvent    *event);
333 gboolean gdk_event_send_client_message (GdkEvent    *event,
334                                         guint32      xid);
335
336  And maybe:
337
338 void      gdk_error_trap_push           (void);
339 gint      gdk_error_trap_pop            (void);