]> Pileus Git - ~andy/gtk/blob - gtk/gtkwindow-decorate.c
queue a resize here; will temporarily slow down the widget a lot, until we
[~andy/gtk] / gtk / gtkwindow-decorate.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2001 Red Hat, Inc.
3  *
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.
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  * Lesser General Public License for more details.
13  *
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.
18  */
19
20 /* 
21  * Authors: Alexander Larsson <alexl@redhat.com>
22  */
23
24 #include "gtkprivate.h"
25 #include "gtksignal.h"
26 #include "gtkwindow.h"
27 #include "gtkmain.h"
28
29
30 #ifdef GDK_WINDOWING_FB
31 #define DECORATE_WINDOWS
32 #endif
33
34 #ifdef DECORATE_WINDOWS
35 #include "linux-fb/gdkfb.h"
36
37 typedef enum
38 {
39   GTK_WINDOW_REGION_TITLE,
40   GTK_WINDOW_REGION_CLOSE,
41   GTK_WINDOW_REGION_BR_RESIZE
42 } GtkWindowRegionType;
43
44 typedef struct _GtkWindowRegion GtkWindowRegion;
45 typedef struct _GtkWindowDecoration GtkWindowDecoration;
46
47 struct _GtkWindowRegion
48 {
49   GdkRectangle rect;
50   GtkWindowRegionType type;
51 };
52
53 typedef enum
54 {
55   RESIZE_TOP_LEFT,
56   RESIZE_TOP,
57   RESIZE_TOP_RIGHT,
58   RESIZE_RIGHT,
59   RESIZE_BOTTOM_RIGHT,
60   RESIZE_BOTTOM,
61   RESIZE_BOTTOM_LEFT,
62   RESIZE_LEFT,
63   RESIZE_NONE,
64 } GtkWindowResizeType;
65
66 struct _GtkWindowDecoration
67 {
68   gint n_regions;
69   GtkWindowRegion *regions;
70
71   gint last_x, last_y;
72   
73   PangoLayout *title_layout;
74
75   GtkWindowResizeType resize;
76   
77   gboolean moving : 1;
78   gboolean closing : 1;
79   gboolean decorated : 1;
80   gboolean real_inner_move : 1;
81   gboolean focused : 1;
82 };
83
84 #define DECORATION_BORDER_TOP 15
85 #define DECORATION_BORDER_LEFT 3
86 #define DECORATION_BORDER_RIGHT 3
87 #define DECORATION_BORDER_BOTTOM 3
88 #define DECORATION_BORDER_TOT_X (DECORATION_BORDER_LEFT + DECORATION_BORDER_RIGHT)
89 #define DECORATION_BORDER_TOT_Y (DECORATION_BORDER_TOP + DECORATION_BORDER_BOTTOM)
90 #define DECORATION_BUTTON_SIZE 9
91 #define DECORATION_BUTTON_Y_OFFSET 2
92 #define DECORATION_TITLE_FONT "Sans 9"
93
94 static void gtk_decorated_window_recalculate_regions      (GtkWindow      *window);
95 static GtkWindowRegionType gtk_decorated_window_region_type    (GtkWindow      *window,
96                                                  gint            x,
97                                                  gint            y);
98 static gint gtk_decorated_window_frame_event    (GtkWidget *widget,
99                                                  GdkEvent *event);
100 static gint gtk_decorated_window_button_press   (GtkWidget      *widget,
101                                                  GdkEventButton *event);
102 static gint gtk_decorated_window_button_release (GtkWidget      *widget,
103                                                  GdkEventButton *event);
104 static gint gtk_decorated_window_motion_notify  (GtkWidget      *widget,
105                                                  GdkEventMotion *event);
106 static void gtk_decorated_window_paint          (GtkWidget      *widget,
107                                                  GdkRectangle   *area);
108 static gint gtk_decorated_window_focus_change   (GtkWidget         *widget,
109                                                  GdkEventFocus     *event);
110 static void gtk_decorated_window_realize        (GtkWindow   *window);
111 static void gtk_decorated_window_unrealize      (GtkWindow   *window);
112
113 static void
114 gtk_decoration_free (GtkWindowDecoration *deco)
115 {
116   g_free (deco->regions);
117   deco->regions = NULL;
118   deco->n_regions = 0;
119
120   g_free (deco);
121 }
122
123 void
124 gtk_decorated_window_init (GtkWindow   *window)
125 {
126   GtkWindowDecoration *deco;
127
128   deco = g_new (GtkWindowDecoration, 1);
129
130   deco->n_regions = 0;
131   deco->regions = NULL;
132   deco->title_layout = NULL;
133   deco->resize = RESIZE_NONE;
134   deco->moving = FALSE;
135   deco->decorated = TRUE;
136   deco->closing = FALSE;
137   deco->real_inner_move = FALSE;
138  
139   g_object_set_data_full (G_OBJECT (window), "gtk-window-decoration", deco,
140                           (GDestroyNotify) gtk_decoration_free);
141   
142   gtk_window_set_has_frame (window, TRUE);
143
144   gtk_signal_connect (GTK_OBJECT (window),
145                       "frame_event",
146                       GTK_SIGNAL_FUNC (gtk_decorated_window_frame_event),
147                       window);
148   gtk_signal_connect (GTK_OBJECT (window),
149                       "focus_in_event",
150                       GTK_SIGNAL_FUNC (gtk_decorated_window_focus_change),
151                       window);
152   gtk_signal_connect (GTK_OBJECT (window),
153                       "focus_out_event",
154                       GTK_SIGNAL_FUNC (gtk_decorated_window_focus_change),
155                       window);
156   gtk_signal_connect (GTK_OBJECT (window),
157                       "realize",
158                       GTK_SIGNAL_FUNC (gtk_decorated_window_realize),
159                       window);
160   gtk_signal_connect (GTK_OBJECT (window),
161                       "unrealize",
162                       GTK_SIGNAL_FUNC (gtk_decorated_window_unrealize),
163                       window);
164 }
165
166 static inline GtkWindowDecoration *
167 get_decoration (GtkWindow *window)
168 {
169   return (GtkWindowDecoration *)g_object_get_data (G_OBJECT (window), "gtk-window-decoration");
170 }
171
172 void
173 gtk_decorated_window_set_title (GtkWindow   *window,
174                                 const gchar *title)
175 {
176   GtkWindowDecoration *deco = get_decoration (window);
177   
178   if (deco->title_layout)
179     pango_layout_set_text (deco->title_layout, title, -1);
180 }
181
182 void 
183 gtk_decorated_window_calculate_frame_size (GtkWindow *window)
184 {
185   GdkWMDecoration decorations;
186   GtkWindowDecoration *deco = get_decoration (window);
187   
188   if (gdk_window_get_decorations (GTK_WIDGET (window)->window,
189                                   &decorations))
190     {
191       if ((decorations & GDK_DECOR_BORDER) &&
192           (decorations & GDK_DECOR_TITLE))
193         deco->decorated = TRUE;
194       else
195         deco->decorated = FALSE;
196     }
197   else
198     deco->decorated = (window->type != GTK_WINDOW_POPUP);
199
200   if (deco->decorated)
201     gtk_window_set_frame_dimensions (window,
202                                      DECORATION_BORDER_LEFT,
203                                      DECORATION_BORDER_TOP,
204                                      DECORATION_BORDER_RIGHT,
205                                      DECORATION_BORDER_BOTTOM);
206   else
207     gtk_window_set_frame_dimensions (window, 0, 0, 0, 0);
208
209   gtk_decorated_window_recalculate_regions (window);
210 }
211
212 static gboolean
213 gtk_decorated_window_inner_change (GdkWindow *win,
214                                    gint x, gint y,
215                                    gint width, gint height,
216                                    gpointer user_data)
217 {
218   GtkWindow *window = (GtkWindow *)user_data;
219   GtkWidget *widget = GTK_WIDGET (window);
220   GtkWindowDecoration *deco = get_decoration (window);
221
222   if (deco->real_inner_move)
223     {
224       deco->real_inner_move = FALSE;
225       return FALSE;
226     }
227
228   deco->real_inner_move = TRUE;
229   gdk_window_move_resize (widget->window,
230                           window->frame_left, window->frame_top,
231                           width, height);
232
233   gdk_window_move_resize (window->frame,
234                           x - window->frame_left, y - window->frame_top,
235                           width + window->frame_left + window->frame_right,
236                           height + window->frame_top + window->frame_bottom);
237   return TRUE;
238 }
239
240 static void
241 gtk_decorated_window_inner_get_pos (GdkWindow *win,
242                                     gint *x, gint *y,
243                                     gpointer user_data)
244 {
245   GtkWindow *window = (GtkWindow *)user_data;
246
247   gdk_window_get_position (window->frame, x, y);
248   
249   *x += window->frame_left;
250   *y += window->frame_top;
251 }
252
253 static void
254 gtk_decorated_window_realize (GtkWindow   *window)
255 {
256   GtkWindowDecoration *deco = get_decoration (window);
257   GtkWidget *widget = GTK_WIDGET (window);
258   PangoFontDescription *font_desc;
259
260   deco->title_layout = gtk_widget_create_pango_layout (widget,
261                                                        (window->title)?window->title:"");
262
263   font_desc = pango_font_description_from_string(DECORATION_TITLE_FONT);
264   pango_layout_set_font_description (deco->title_layout, font_desc);
265   pango_font_description_free (font_desc);
266   
267   gdk_fb_window_set_child_handler (window->frame,
268                                    gtk_decorated_window_inner_change,
269                                    gtk_decorated_window_inner_get_pos,
270                                    window);
271
272   /* This is a huge hack to make frames have the same shape as
273      the window they wrap */
274   gdk_window_shape_combine_mask (window->frame, GDK_FB_USE_CHILD_SHAPE, 0, 0);
275 }
276
277
278 static void
279 gtk_decorated_window_unrealize (GtkWindow   *window)
280 {
281   GtkWindowDecoration *deco = get_decoration (window);
282
283   if (deco->title_layout)
284     {
285       g_object_unref (G_OBJECT (deco->title_layout));
286       deco->title_layout = NULL;
287     }
288 }
289
290 static gint
291 gtk_decorated_window_frame_event (GtkWidget *widget, GdkEvent *event)
292 {
293   GtkWindowDecoration *deco = get_decoration (GTK_WINDOW (widget));
294   GdkEventExpose *expose_event;
295
296   switch (event->type)
297     {
298     case GDK_EXPOSE:
299       expose_event = (GdkEventExpose *)event;
300       if (deco->decorated)
301         gtk_decorated_window_paint (widget, &expose_event->area);
302       return TRUE;
303       break;
304     case GDK_CONFIGURE:
305       gtk_decorated_window_recalculate_regions (GTK_WINDOW (widget));
306       break;
307     case GDK_MOTION_NOTIFY:
308       return gtk_decorated_window_motion_notify (widget, (GdkEventMotion *)event);
309       break;
310     case GDK_BUTTON_PRESS:
311       return gtk_decorated_window_button_press (widget, (GdkEventButton *)event);
312       break;
313     case GDK_BUTTON_RELEASE:
314       return gtk_decorated_window_button_release (widget, (GdkEventButton *)event);
315     default:
316       break;
317     }
318   return FALSE;
319 }
320
321 static gint
322 gtk_decorated_window_focus_change (GtkWidget         *widget,
323                                    GdkEventFocus     *event)
324 {
325   GtkWindow *window = GTK_WINDOW(widget);
326   GtkWindowDecoration *deco = get_decoration (window);
327   deco->focused = event->in;
328   gdk_window_invalidate_rect (window->frame, NULL, FALSE);
329   return FALSE;
330 }
331
332 static gint
333 gtk_decorated_window_motion_notify (GtkWidget       *widget,
334                                     GdkEventMotion  *event)
335 {
336   GtkWindow *window;
337   GtkWindowDecoration *deco;
338   GdkModifierType mask;
339   GdkWindow *win;
340   gint x, y;
341   gint win_x, win_y, win_w, win_h;
342   
343   window = GTK_WINDOW (widget);
344   deco = get_decoration (window);
345   
346   if (!deco->decorated)
347     return TRUE;
348   
349   win = widget->window;
350   gdk_window_get_pointer (window->frame, &x, &y, &mask);
351   
352   gdk_window_get_position (window->frame, &win_x, &win_y);
353   win_x += DECORATION_BORDER_LEFT;
354   win_y += DECORATION_BORDER_TOP;
355   
356   gdk_window_get_geometry (win, NULL, NULL, &win_w, &win_h, NULL);
357
358   if (deco->moving)
359     {
360       int dx, dy;
361       dx = x - deco->last_x;
362       dy = y - deco->last_y;
363
364       _gtk_window_reposition (window, win_x + dx, win_y + dy);
365     }
366
367   if (deco->resize != RESIZE_NONE)
368     {
369       int w, h;
370       
371       w = win_w;
372       h = win_h;
373       
374       switch(deco->resize) {
375       case RESIZE_BOTTOM_RIGHT:
376         w = x - DECORATION_BORDER_TOT_X;
377         h = y - DECORATION_BORDER_TOT_Y;
378         break;
379       case RESIZE_RIGHT:
380         w = x - DECORATION_BORDER_TOT_X;
381         break;
382       case RESIZE_BOTTOM:
383         h = y - DECORATION_BORDER_TOT_Y;
384         break;
385       case RESIZE_TOP_LEFT:
386       case RESIZE_TOP:
387       case RESIZE_TOP_RIGHT:
388       case RESIZE_BOTTOM_LEFT:
389       case RESIZE_LEFT:
390       default:
391         g_warning ("Resize mode %d not handled yet.\n", deco->resize);
392         break;
393       }
394       
395       if ((w > 0) && (h > 0))
396         {
397           _gtk_window_constrain_size (window, w,h, &w, &h);
398           
399           if ((w != win_w) || (h != win_h))
400             gdk_window_resize (widget->window, w, h);
401         }
402     }
403
404   return TRUE;
405 }
406
407 static GtkWindowRegionType
408 gtk_decorated_window_region_type (GtkWindow *window, gint x, gint y)
409 {
410   GtkWindowDecoration *deco = get_decoration (window);
411   int i;
412
413   for (i=0;i<deco->n_regions;i++)
414     {
415       if ((x > deco->regions[i].rect.x) &&
416           (x - deco->regions[i].rect.x < deco->regions[i].rect.width) &&
417           (y > deco->regions[i].rect.y) &&
418           (y - deco->regions[i].rect.y < deco->regions[i].rect.height))
419         return deco->regions[i].type;
420     }
421   return -1;
422 }
423
424 static gint
425 gtk_decorated_window_button_press (GtkWidget       *widget,
426                                    GdkEventButton  *event)
427 {
428   GtkWindow *window;
429   GtkWindowRegionType type;
430   GtkWindowDecoration *deco;
431   gint x, y; 
432
433   window = GTK_WINDOW (widget);
434   deco = get_decoration (window);
435
436   if (!deco->decorated)
437     return TRUE;
438
439   x = event->x;
440   y = event->y;
441   
442   type = gtk_decorated_window_region_type (window, x, y);
443
444   deco->last_x = x;
445   deco->last_y = y;
446
447   switch (type)
448     {
449     case GTK_WINDOW_REGION_TITLE:
450       if (event->state & GDK_BUTTON1_MASK)
451         deco->moving = TRUE;
452       break;
453     case GTK_WINDOW_REGION_CLOSE:
454       if (event->state & GDK_BUTTON1_MASK)
455         deco->closing = TRUE;
456       break;
457     case GTK_WINDOW_REGION_BR_RESIZE:
458       if (event->state & GDK_BUTTON1_MASK)
459         deco->resize = RESIZE_BOTTOM_RIGHT;
460       break;
461     default:
462       break;
463     }
464   
465   return TRUE;
466 }
467
468 static gint
469 gtk_decorated_window_button_release (GtkWidget      *widget,
470                                      GdkEventButton *event)
471 {
472   GtkWindow *window;
473   GtkWindowRegionType type;
474   GtkWindowDecoration *deco;
475       
476   window = GTK_WINDOW (widget);
477   deco = get_decoration (window);
478
479   if (deco->closing)
480     {
481       type = gtk_decorated_window_region_type (window, event->x, event->y);
482       if (type == GTK_WINDOW_REGION_CLOSE)
483         {
484           GdkEventAny event;
485
486           event.type = GDK_DELETE;
487           event.window = widget->window;
488           event.send_event = TRUE;
489
490             /* Synthesize delete_event */
491           g_object_ref (G_OBJECT (event.window));
492   
493           gtk_main_do_event ((GdkEvent*)&event);
494           
495           g_object_unref (G_OBJECT (event.window));
496         }
497     }
498   
499   deco->closing = FALSE;
500   deco->moving = FALSE;
501   deco->resize = RESIZE_NONE;
502   return TRUE;
503 }
504
505 static void
506 gtk_decorated_window_paint (GtkWidget    *widget,
507                             GdkRectangle *area)
508 {
509   GtkWindow *window = GTK_WINDOW (widget);
510   GtkWindowDecoration *deco = get_decoration (window);
511   gint x1, y1, x2, y2;
512   GtkStateType border_state;
513
514   if (deco->decorated)
515     {
516       GdkWindow *frame;
517       gint width, height;
518
519       frame = window->frame;
520       gdk_window_get_size (frame, &width, &height);
521
522       /* Top */
523       gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
524                           GTK_SHADOW_NONE, area, widget, "base",
525                           0, 0,
526                           width, DECORATION_BORDER_TOP);
527       /* Bottom */
528       gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
529                           GTK_SHADOW_NONE, area, widget, "base",
530                           0, height - DECORATION_BORDER_BOTTOM,
531                           width, DECORATION_BORDER_BOTTOM);
532       /* Left */
533       gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
534                           GTK_SHADOW_NONE, area, widget, "base",
535                           0, DECORATION_BORDER_TOP,
536                           DECORATION_BORDER_LEFT, height - DECORATION_BORDER_TOT_Y);
537       /* Right */
538       gtk_paint_flat_box (widget->style, frame, GTK_STATE_NORMAL,
539                           GTK_SHADOW_NONE, area, widget, "base",
540                           width - DECORATION_BORDER_RIGHT, DECORATION_BORDER_TOP,
541                           DECORATION_BORDER_RIGHT, height - DECORATION_BORDER_TOT_Y);
542       
543       /* Border: */
544       if (deco->focused)
545         border_state = GTK_STATE_SELECTED;
546       else 
547         border_state = GTK_STATE_PRELIGHT;
548
549       gtk_paint_box (widget->style, frame, border_state, 
550                      GTK_SHADOW_OUT, area, widget, "base",
551                      0, 0, width, height);
552       
553       gtk_paint_box (widget->style, frame, border_state, 
554                      GTK_SHADOW_IN, area, widget, "base",
555                      DECORATION_BORDER_LEFT - 2, DECORATION_BORDER_TOP - 2,
556                      width - (DECORATION_BORDER_LEFT + DECORATION_BORDER_RIGHT) + 3,
557                      height - (DECORATION_BORDER_TOP + DECORATION_BORDER_BOTTOM) + 3);
558       
559       /* Close button: */
560       
561       x1 = width - DECORATION_BORDER_LEFT - DECORATION_BUTTON_SIZE;
562       y1 = DECORATION_BUTTON_Y_OFFSET;
563       x2 = width - DECORATION_BORDER_LEFT;
564       y2 = DECORATION_BUTTON_Y_OFFSET + DECORATION_BUTTON_SIZE;
565
566       if (area)
567         gdk_gc_set_clip_rectangle (widget->style->bg_gc[widget->state], area);
568
569       gdk_draw_rectangle (frame, widget->style->bg_gc[widget->state], TRUE,
570                           x1, y1, x2 - x1, y2 - y1);
571
572       if (area)
573         gdk_gc_set_clip_rectangle (widget->style->bg_gc[widget->state], NULL);
574       
575       if (area)
576         gdk_gc_set_clip_rectangle (widget->style->black_gc, area);
577
578       gdk_draw_line (frame, widget->style->black_gc, x1, y1, x2-1, y2-1);
579
580       gdk_draw_line (frame, widget->style->black_gc, x1, y2-1, x2-1, y1);
581
582       if (area)
583         gdk_gc_set_clip_rectangle (widget->style->black_gc, NULL);
584       
585       
586
587       /* Title */
588       if (deco->title_layout)
589         {
590           if (area)
591             gdk_gc_set_clip_rectangle (widget->style->fg_gc [widget->state], area);
592
593           gdk_draw_layout (frame,
594                            widget->style->fg_gc [widget->state],
595                            DECORATION_BORDER_LEFT, 1,
596                            deco->title_layout);
597           if (area)
598             gdk_gc_set_clip_rectangle (widget->style->fg_gc [widget->state], NULL);
599         }
600       
601     }
602 }
603
604
605 static void
606 gtk_decorated_window_recalculate_regions (GtkWindow *window)
607 {
608   gint n_regions;
609   gint width, height;
610   GtkWindowRegion *region;
611   GtkWindowDecoration *deco = get_decoration (window);
612       
613   n_regions = 0;
614
615   if (!deco->decorated)
616     return;
617   
618   n_regions += 2; /* close, Title */
619   if (window->allow_shrink || window->allow_grow)
620     n_regions += 2;
621
622   if (deco->n_regions != n_regions)
623     {
624       g_free (deco->regions);
625       deco->regions = g_new (GtkWindowRegion, n_regions);
626       deco->n_regions = n_regions;
627     }
628
629   width = GTK_WIDGET (window)->allocation.width + DECORATION_BORDER_TOT_X;
630   height = GTK_WIDGET (window)->allocation.height + DECORATION_BORDER_TOT_Y;
631
632   region = deco->regions;
633
634   /* Close button */
635   region->rect.x = width - DECORATION_BORDER_LEFT - DECORATION_BUTTON_SIZE;
636   region->rect.y = 2;
637   region->rect.width = DECORATION_BUTTON_SIZE;
638   region->rect.height = DECORATION_BUTTON_SIZE;
639   region->type = GTK_WINDOW_REGION_CLOSE;
640   region++;
641     
642   /* title bar */
643   region->rect.x = 0;
644   region->rect.y = 0;
645   region->rect.width = width;
646   region->rect.height = DECORATION_BORDER_TOP;
647   region->type = GTK_WINDOW_REGION_TITLE;
648   region++;
649   
650   if (window->allow_shrink || window->allow_grow)
651     {
652       region->rect.x = width - (DECORATION_BORDER_RIGHT + 10);
653       region->rect.y = height - DECORATION_BORDER_BOTTOM;
654       region->rect.width = DECORATION_BORDER_RIGHT + 10;
655       region->rect.height = DECORATION_BORDER_BOTTOM;
656       region->type = GTK_WINDOW_REGION_BR_RESIZE;
657       region++;
658
659       region->rect.x = width - DECORATION_BORDER_RIGHT;
660       region->rect.y = height - (DECORATION_BORDER_BOTTOM + 10);
661       region->rect.width = DECORATION_BORDER_RIGHT;
662       region->rect.height = DECORATION_BORDER_BOTTOM + 10;
663       region->type = GTK_WINDOW_REGION_BR_RESIZE;
664       region++;
665     }
666 }
667
668 void
669 gtk_decorated_window_move_resize_window (GtkWindow   *window,
670                                          gint         x,
671                                          gint         y,
672                                          gint         width,
673                                          gint         height)
674 {
675   GtkWidget *widget = GTK_WIDGET (window);
676   GtkWindowDecoration *deco = get_decoration (window);
677   
678   deco->real_inner_move = TRUE;
679   gdk_window_move_resize (widget->window,
680                           x, y, width, height);
681 }
682 #else
683
684 void
685 gtk_decorated_window_init (GtkWindow  *window)
686 {
687 }
688
689 void 
690 gtk_decorated_window_calculate_frame_size (GtkWindow *window)
691 {
692 }
693
694 void
695 gtk_decorated_window_set_title (GtkWindow   *window,
696                                 const gchar *title)
697 {
698 }
699
700 void
701 gtk_decorated_window_move_resize_window (GtkWindow   *window,
702                                          gint         x,
703                                          gint         y,
704                                          gint         width,
705                                          gint         height)
706 {
707   gdk_window_move_resize (GTK_WIDGET (window)->window,
708                           x, y, width, height);
709 }
710 #endif
711
712
713