]> git.pld-linux.org Git - packages/gnome-panel.git/blob - gnome-panel-menu-stripe.patch
- updated to 2.6.1
[packages/gnome-panel.git] / gnome-panel-menu-stripe.patch
1 diff -urN aa/gnome-panel-2.6.0/gnome-panel/Makefile.am gnome-panel-2.6.0/gnome-panel/Makefile.am
2 --- aa/gnome-panel-2.6.0/gnome-panel/Makefile.am        2004-02-06 17:04:50.000000000 +0100
3 +++ gnome-panel-2.6.0/gnome-panel/Makefile.am   2004-03-27 00:29:00.520061944 +0100
4 @@ -80,6 +80,8 @@
5         panel-typebuiltins.h    \
6         panel-marshal.c         \
7         panel-marshal.h         \
8 +       panel-menu.c            \
9 +       panel-menu.h            \
10         main.c                  \
11         panel-widget.c          \
12         button-widget.c         \
13 diff -urN aa/gnome-panel-2.6.0/gnome-panel/menu.c gnome-panel-2.6.0/gnome-panel/menu.c
14 --- aa/gnome-panel-2.6.0/gnome-panel/menu.c     2004-03-09 11:08:47.000000000 +0100
15 +++ gnome-panel-2.6.0/gnome-panel/menu.c        2004-03-27 00:29:00.522061640 +0100
16 @@ -44,6 +44,7 @@
17  #include "menu-fentry.h"
18  #include "menu-util.h"
19  #include "menu-ditem.h"
20 +#include "panel-menu.h"
21  #include "panel-util.h"
22  #include "panel-gconf.h"
23  #include "panel.h"
24 @@ -67,6 +68,7 @@
25  #include "panel-lockdown.h"
26  
27  #undef MENU_DEBUG
28 +#define MENU_SNAP_LENGTH 10
29  
30  static char *gnome_folder = NULL;
31  
32 @@ -614,6 +616,9 @@
33         if (repo->orig_func != NULL) {
34                 repo->orig_func (menu, x, y, push_in, repo->orig_data);
35  
36 +               if (*x < MENU_SNAP_LENGTH)
37 +                 *x = 0;
38 +
39                 if (menu->parent_menu_item != NULL) {
40                         /* This is a submenu so behave submenuish */
41                         if (*x < monitor_basex ||
42 @@ -709,8 +714,8 @@
43         reload_image_menu_items ();
44  }
45  
46 -GtkWidget *
47 -panel_create_menu (void)
48 +static GtkWidget *
49 +panel_create_menu_of_type (GType menu_type)
50  {
51         GtkWidget       *retval;
52         static gboolean  registered_icon_theme_changer = FALSE;
53 @@ -722,8 +727,7 @@
54                                   G_CALLBACK (icon_theme_changed), NULL);
55         }
56         
57 -       retval = gtk_menu_new ();
58 -       
59 +       retval = g_object_new (menu_type, NULL);
60         panel_gconf_notify_add_while_alive ("/desktop/gnome/interface/menus_have_icons",
61                                             (GConfClientNotifyFunc) menus_have_icons_changed,
62                                             G_OBJECT (retval));
63 @@ -739,12 +743,18 @@
64         return retval;
65  }
66  
67 +GtkWidget *
68 +panel_create_menu (void)
69 +{
70 +        return panel_create_menu_of_type (gtk_menu_get_type());
71 +}
72 +
73  static GtkWidget *
74 -menu_new (void)
75 +menu_new_of_type (GType menu_type)
76  {
77         GtkWidget *retval;
78  
79 -       retval = panel_create_menu ();
80 +       retval = panel_create_menu_of_type (menu_type);
81  
82         g_signal_connect (
83                 retval, "show", G_CALLBACK (setup_menu_panel), NULL);
84 @@ -752,6 +762,13 @@
85         return retval;
86  }
87  
88 +static GtkWidget *
89 +menu_new (void)
90 +{
91 +       return menu_new_of_type (gtk_menu_get_type ());
92 +}
93 +
94 +
95  static void
96  icon_to_load_free (IconToLoad *icon)
97  {
98 @@ -3314,7 +3331,7 @@
99         }
100  
101         if (!root_menu)
102 -               root_menu = menu_new ();
103 +               root_menu = menu_new_of_type (panel_menu_get_type ());
104  
105         g_object_set_data (G_OBJECT (root_menu), "menu_panel", panel);
106  
107 diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.c gnome-panel-2.6.0/gnome-panel/panel-config-global.c
108 --- aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.c      2004-01-18 15:35:47.000000000 +0100
109 +++ gnome-panel-2.6.0/gnome-panel/panel-config-global.c 2004-03-27 00:29:00.523061488 +0100
110 @@ -45,6 +45,7 @@
111         guint               drawer_auto_close : 1;
112         guint               confirm_panel_remove : 1;
113         guint               highlight_when_over : 1;
114 +       guint               menu_stripe : 1;
115  } GlobalConfig;
116  
117  static GlobalConfig global_config = { 0, };
118 @@ -94,6 +95,13 @@
119  
120         return global_config.confirm_panel_remove;
121  }
122 +gboolean
123 +panel_global_config_get_menu_stripe (void)
124 +{
125 +       g_assert (global_config_initialised == TRUE);
126 +
127 +       return global_config.menu_stripe;
128 +}
129  
130  static void
131  panel_global_config_set_entry (GConfEntry *entry)
132 @@ -151,6 +159,11 @@
133         else if (strcmp (key, "highlight_launchers_on_mouseover") == 0)
134                 global_config.highlight_when_over =
135                         gconf_value_get_bool (value);
136 +
137 +  else if (strcmp (key, "show_menu_stripe") == 0)
138 +    global_config.menu_stripe =
139 +        gconf_value_get_bool (value);
140 +
141  }
142  
143  static void
144 diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.h gnome-panel-2.6.0/gnome-panel/panel-config-global.h
145 --- aa/gnome-panel-2.6.0/gnome-panel/panel-config-global.h      2004-01-18 15:32:28.000000000 +0100
146 +++ gnome-panel-2.6.0/gnome-panel/panel-config-global.h 2004-03-27 00:29:00.523061488 +0100
147 @@ -37,6 +37,7 @@
148  gboolean panel_global_config_get_drawer_auto_close    (void);
149  gboolean panel_global_config_get_tooltips_enabled     (void);
150  gboolean panel_global_config_get_confirm_panel_remove (void);
151 +gboolean panel_global_config_get_menu_stripe         (void);
152  
153  G_END_DECLS
154  
155 diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in
156 --- aa/gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in    2004-01-18 16:10:23.000000000 +0100
157 +++ gnome-panel-2.6.0/gnome-panel/panel-global.schemas.in       2004-03-27 00:29:00.588051608 +0100
158 @@ -93,6 +93,18 @@
159        </schema>
160  
161        <schema>
162 +        <key>/schemas/apps/panel/global/show_menu_stripe</key>
163 +        <applyto>/apps/panel/global/show_menu_stripe</applyto>
164 +        <owner>panel</owner>
165 +        <type>bool</type>
166 +        <default>true</default>
167 +        <locale name="C">
168 +          <short></short>
169 +          <long></long>
170 +        </locale>
171 +      </schema>
172 +
173 +      <schema>
174          <key>/schemas/apps/panel/global/enable_key_bindings</key>
175          <applyto>/apps/panel/global/enable_key_bindings</applyto>
176          <owner>panel</owner>
177 diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-menu.c gnome-panel-2.6.0/gnome-panel/panel-menu.c
178 --- aa/gnome-panel-2.6.0/gnome-panel/panel-menu.c       1970-01-01 01:00:00.000000000 +0100
179 +++ gnome-panel-2.6.0/gnome-panel/panel-menu.c  2004-03-27 00:49:47.929426896 +0100
180 @@ -0,0 +1,1082 @@
181 +/*
182 + * To set this up insert something like this in your ~/.gtkrc-2.0
183 + *
184 + * Copyright (C) 2002 Ximian, Inc. 
185 + * Copyright (C) 2001 Havoc Pennington
186 + * Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
187 + * Copyright (C) 2003 Marcin Krzy¿anowski
188 + * 
189 + * style "default"
190 + * {
191 + *   PanelMenu::default_side_image = "/tmp/stripelogo.png"
192 + *   PanelMenu::gradient_bg = true
193 + * }
194 + * class "PanelMenu" style "default"
195 + *
196 + * Authors:
197 + *       Thomas, Michael Meeks
198 + *       GtkMenu code by the GTK+ team
199 + *       Gradient code from WindowMaker by Dan Pascu and Alfredo Kojima, 
200 + *         by way of metacity by Havoc Pennington.
201 + *       Marcin Krzy¿anowski
202 + */
203 +#include <config.h>
204 +#include <string.h>
205 +#include <libgnome/gnome-macros.h>
206 +#include <libgnome/gnome-program.h>
207 +#include <libgnome/gnome-i18n.h>
208 +#include <gtk/gtkgc.h>
209 +#include <gtk/gtkimagemenuitem.h>
210 +#include <gtk/gtkseparatormenuitem.h>
211 +#include <gtk/gtkmenu.h>
212 +#include <gtk/gtkwidget.h>
213 +#include <gtk/gtkwindow.h>
214 +#include <gtk/gtkmain.h>
215 +#include <gdk/gdkwindow.h>
216 +#include <panel-menu.h>
217 +
218 +#include "panel-config-global.h"
219 +
220 +#define dprintf(a) g_warning a
221 +/*#define dprintf(a) G_STMT_START { (void) 0; } G_STMT_END*/
222 +
223 +GNOME_CLASS_BOILERPLATE (PanelMenu, panel_menu,
224 +                        GtkMenu, GTK_TYPE_MENU)
225 +
226 +
227 +
228 +static void
229 +panel_menu_size_request  (GtkWidget *widget,
230 +                         GtkRequisition *requisition)
231 +{
232 +       PanelMenu *pm = PANEL_MENU (widget);
233 +
234 +       GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
235 +
236 +       if (panel_global_config_get_menu_stripe () && pm->side_image != NULL)
237 +               requisition->width += gdk_pixbuf_get_width (pm->side_image)
238 +                      + gtk_widget_get_style (widget)->xthickness;
239 +}
240 +
241 +static GdkColor *
242 +get_light_stripe_color (PanelMenu *pm)
243 +{
244 +       GdkColor *color;
245 +       
246 +       gtk_widget_style_get (GTK_WIDGET (pm),
247 +                             "stripe-color-light", &color,
248 +                             NULL);
249 +
250 +       if (!color) {
251 +               color = gdk_color_copy (&GTK_WIDGET (pm)->style->bg[GTK_STATE_NORMAL]);
252 +       }
253 +       
254 +       return color;
255 +}
256 +
257 +static GdkColor *
258 +get_stripe_color (PanelMenu *pm)
259 +{
260 +       GdkColor *color;
261 +       
262 +       gtk_widget_style_get (GTK_WIDGET (pm),
263 +                             "stripe-color", &color,
264 +                             NULL);
265 +
266 +       if (!color) {
267 +               color = gdk_color_copy (&GTK_WIDGET (pm)->style->bg[GTK_STATE_SELECTED]);
268 +       }
269 +       
270 +       return color;
271 +}
272 +
273 +static GdkGC *
274 +get_stripe_gc (PanelMenu *pm) 
275 +{
276 +       GdkGCValues gc_values;
277 +       GdkGCValuesMask gc_values_mask;
278 +       GdkColor *color;
279 +       
280 +       color = get_stripe_color (pm);
281 +       gc_values.foreground = *color;
282 +       gdk_color_free (color);
283 +       gc_values_mask = GDK_GC_FOREGROUND;
284 +       
285 +       gdk_rgb_find_color (GTK_WIDGET (pm)->style->colormap, &gc_values.foreground);
286 +
287 +       return gtk_gc_get (GTK_WIDGET (pm)->style->depth,
288 +                          GTK_WIDGET (pm)->style->colormap,
289 +                          &gc_values, gc_values_mask);
290 +}
291 +
292 +static gboolean
293 +panel_menu_expose_event (GtkWidget      *widget,
294 +                        GdkEventExpose *event)
295 +{
296 +       GdkRectangle exposed;
297 +       GdkRectangle position;
298 +       GdkWindow   *window;
299 +       int bin_height;
300 +       GdkGC *stripe_gc;
301 +       PanelMenu *pm = PANEL_MENU (widget);
302 +
303 +       GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
304 +
305 +       if (!panel_global_config_get_menu_stripe () || !pm->side_image) {
306 +              return TRUE;
307 +       }
308 +       window = GTK_MENU (widget)->bin_window;
309 +
310 +       stripe_gc = get_stripe_gc (pm);
311 +
312 +       gdk_gc_set_clip_rectangle (stripe_gc, &event->area);       
313 +       gdk_draw_rectangle (window,
314 +                          stripe_gc,
315 +                          TRUE,
316 +                          widget->allocation.x,
317 +                          widget->allocation.y,
318 +                          gdk_pixbuf_get_width (pm->side_image),
319 +                          widget->allocation.height);
320 +       gdk_gc_set_clip_rectangle (stripe_gc, NULL);
321 +
322 +       bin_height = widget->allocation.height - 2 * (GTK_CONTAINER (widget)->border_width + widget->style->ythickness);
323 +
324 +       position = widget->allocation;
325 +       position.y += bin_height - gdk_pixbuf_get_height (pm->side_image);
326 +       position.width = gdk_pixbuf_get_width (pm->side_image);
327 +       position.height = gdk_pixbuf_get_height (pm->side_image);
328 +
329 +       if (widget->allocation.height >= gdk_pixbuf_get_height (pm->side_image)) {
330 +              if (gdk_rectangle_intersect (&event->area,
331 +                                           &position,
332 +                                           &exposed)) {
333 +                      gdk_pixbuf_render_to_drawable (
334 +                              pm->side_image, window,
335 +                              widget->style->black_gc,
336 +                              exposed.x - position.x,
337 +                              exposed.y - position.y,
338 +                              exposed.x, exposed.y,
339 +                              exposed.width, exposed.height,
340 +                              GDK_RGB_DITHER_NORMAL,
341 +                              exposed.x, exposed.y);
342 +              }
343 +       }
344 +               
345 +       position = widget->allocation;
346 +       if (position.height != gdk_pixbuf_get_height (pm->side_image)) {
347 +               position.width = gdk_pixbuf_get_width (pm->side_image);
348 +              if (position.height > gdk_pixbuf_get_height (pm->side_image)) {
349 +                      position.height = bin_height - gdk_pixbuf_get_height (pm->side_image);
350 +              } else {
351 +                      position.height = bin_height;
352 +              }
353 +              
354 +               if (pm->scaled_image && gdk_rectangle_intersect (&event->area,
355 +                                                               &position,
356 +                                                               &exposed)) {
357 +      
358 +                       gdk_pixbuf_render_to_drawable (
359 +                               pm->scaled_image, window,
360 +                               widget->style->black_gc,
361 +                               exposed.x - position.x,
362 +                               exposed.y - position.y,
363 +                               exposed.x, exposed.y,
364 +                               exposed.width, exposed.height,
365 +                               GDK_RGB_DITHER_NORMAL,
366 +                               exposed.x, exposed.y);
367 +               }
368 +       }
369 +
370 +       return TRUE;
371 +}
372 +
373 +/* begin metacity cut and paste */
374 +static void
375 +free_buffer (guchar *pixels, gpointer data)
376 +{
377 +  g_free (pixels);
378 +}
379 +
380 +static GdkPixbuf*
381 +blank_pixbuf (int width, int height, gboolean no_padding)
382 +{
383 +  guchar *buf;
384 +  int rowstride;
385 +
386 +  g_return_val_if_fail (width > 0, NULL);
387 +  g_return_val_if_fail (height > 0, NULL);
388 +
389 +  if (no_padding)
390 +    rowstride = width * 3;
391 +  else
392 +    /* Always align rows to 32-bit boundaries */  
393 +    rowstride = 4 * ((3 * width + 3) / 4);
394 +
395 +  buf = g_try_malloc (height * rowstride);
396 +  if (!buf)
397 +    return NULL;
398 +
399 +  return gdk_pixbuf_new_from_data (buf, GDK_COLORSPACE_RGB,
400 +                                   FALSE, 8,
401 +                                   width, height, rowstride,
402 +                                   free_buffer, NULL);
403 +}
404 +
405 +static GdkPixbuf*
406 +meta_gradient_create_vertical (int width, int height,
407 +                               const GdkColor *from,
408 +                               const GdkColor *to)
409 +{
410 +  int i, j;
411 +  long r, g, b, dr, dg, db;
412 +  GdkPixbuf *pixbuf;
413 +  unsigned char *ptr;
414 +  unsigned char rr, gg, bb;
415 +  int r0, g0, b0;
416 +  int rf, gf, bf;
417 +  int rowstride;
418 +  unsigned char *pixels;
419 +  
420 +  pixbuf = blank_pixbuf (width, height, FALSE);
421 +  if (pixbuf == NULL)
422 +    return NULL;
423 +    
424 +  pixels = gdk_pixbuf_get_pixels (pixbuf);
425 +  rowstride = gdk_pixbuf_get_rowstride (pixbuf);
426 +  
427 +  r0 = (guchar) (from->red / 256.0);
428 +  g0 = (guchar) (from->green / 256.0);
429 +  b0 = (guchar) (from->blue / 256.0);
430 +  rf = (guchar) (to->red / 256.0);
431 +  gf = (guchar) (to->green / 256.0);
432 +  bf = (guchar) (to->blue / 256.0);
433 +  
434 +  r = r0<<16;
435 +  g = g0<<16;
436 +  b = b0<<16;
437 +
438 +  dr = ((rf-r0)<<16)/(int)height;
439 +  dg = ((gf-g0)<<16)/(int)height;
440 +  db = ((bf-b0)<<16)/(int)height;
441 +
442 +  for (i=0; i<height; i++)
443 +    {
444 +      ptr = pixels + i * rowstride;
445 +      
446 +      rr = r>>16;
447 +      gg = g>>16;
448 +      bb = b>>16;
449 +      for (j=0; j<width/8; j++)
450 +        {
451 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
452 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
453 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
454 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
455 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
456 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
457 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
458 +          *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
459 +       }
460 +      switch (width%8)
461 +        {
462 +        case 7: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
463 +        case 6: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
464 +        case 5: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
465 +        case 4: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
466 +        case 3: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
467 +        case 2: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
468 +        case 1: *(ptr++) = rr; *(ptr++) = gg; *(ptr++) = bb;
469 +       }
470 +      r+=dr;
471 +      g+=dg;
472 +      b+=db;
473 +    }
474 +  return pixbuf;
475 +}
476 +
477 +/* end metacity cut and paste */
478 +
479 +/* begin gtkmenu.c cut and paste */
480 +#define MENU_SCROLL_STEP1 8
481 +#define MENU_SCROLL_STEP2 15
482 +#define MENU_SCROLL_ARROW_HEIGHT 16
483 +#define MENU_SCROLL_FAST_ZONE 8
484 +#define MENU_SCROLL_TIMEOUT1 50
485 +#define MENU_SCROLL_TIMEOUT2 50
486 +
487 +#define ATTACH_INFO_KEY "gtk-menu-child-attach-info-key"
488 +
489 +typedef struct _GtkMenuAttachData      GtkMenuAttachData;
490 +typedef struct _GtkMenuPrivate         GtkMenuPrivate;
491 +
492 +struct _GtkMenuAttachData
493 +{
494 +       GtkWidget *attach_widget;
495 +       GtkMenuDetachFunc detacher;
496 +};
497 +
498 +struct _GtkMenuPrivate 
499 +{
500 +  gboolean have_position;
501 +  gint x;
502 +  gint y;
503 +
504 +  /* info used for the table */
505 +  guint *heights;
506 +  gint heights_length;
507 +
508 +  gint monitor_num;
509 +
510 +       /* Cached layout information */
511 +       gboolean have_layout;
512 +       gint n_rows;
513 +       gint n_columns;
514 +};
515 +
516 +typedef struct
517 +{
518 +       gint left_attach;
519 +       gint right_attach;
520 +       gint top_attach;
521 +       gint bottom_attach;
522 +       gint effective_left_attach;
523 +       gint effective_right_attach;
524 +       gint effective_top_attach;
525 +       gint effective_bottom_attach;
526 +} AttachInfo;
527 +
528 +static void
529 +gtk_menu_free_private (gpointer data)
530 +{
531 +  GtkMenuPrivate *priv = (GtkMenuPrivate *)data;
532 +
533 +  g_free (priv->heights);
534 +
535 +  g_free (priv);
536 +}
537 +
538 +static GtkMenuPrivate *
539 +gtk_menu_get_private (GtkMenu *menu)
540 +{
541 +  GtkMenuPrivate *private;
542 +  static GQuark private_quark = 0;
543 +
544 +  if (!private_quark)
545 +    private_quark = g_quark_from_static_string ("gtk-menu-private");
546 +
547 +  private = g_object_get_qdata (G_OBJECT (menu), private_quark);
548 +
549 +  if (!private)
550 +    {
551 +      private = g_new0 (GtkMenuPrivate, 1);
552 +      private->have_position = FALSE;
553 +      
554 +      g_object_set_qdata_full (G_OBJECT (menu), private_quark,
555 +                              private, gtk_menu_free_private);
556 +    }
557 +
558 +  return private;
559 +}
560 +
561 +static void
562 +gtk_menu_remove_scroll_timeout (GtkMenu *menu)
563 +{
564 +  if (menu->timeout_id)
565 +    {
566 +      g_source_remove (menu->timeout_id);
567 +      menu->timeout_id = 0;
568 +    }
569 +}
570 +
571 +static void
572 +gtk_menu_stop_scrolling (GtkMenu *menu)
573 +{
574 +  gtk_menu_remove_scroll_timeout (menu);
575 +
576 +  menu->upper_arrow_prelight = FALSE;
577 +  menu->lower_arrow_prelight = FALSE;
578 +}
579 +
580 +static void
581 +gtk_menu_scroll_to (GtkMenu *menu,
582 +                   gint    offset)
583 +{
584 +  GtkWidget *widget;
585 +  gint x, y;
586 +  gint view_width, view_height;
587 +  gint border_width;
588 +  gboolean last_visible;
589 +  gint menu_height;
590 +  guint vertical_padding;
591 +
592 +  widget = GTK_WIDGET (menu);
593 +
594 +  if (menu->tearoff_active &&
595 +      menu->tearoff_adjustment &&
596 +      (menu->tearoff_adjustment->value != offset))
597 +    {
598 +      menu->tearoff_adjustment->value =
599 +       CLAMP (offset,
600 +              0, menu->tearoff_adjustment->upper - menu->tearoff_adjustment->page_size);
601 +      gtk_adjustment_value_changed (menu->tearoff_adjustment);
602 +    }
603 +  
604 +  /* Move/resize the viewport according to arrows: */
605 +  view_width = widget->allocation.width;
606 +  view_height = widget->allocation.height;
607 +
608 +  gtk_widget_style_get (GTK_WIDGET (menu),
609 +                       "vertical-padding", &vertical_padding,
610 +                       NULL);
611 +  
612 +  border_width = GTK_CONTAINER (menu)->border_width;
613 +  view_width -= (border_width + widget->style->xthickness) * 2;
614 +  view_height -= (border_width + widget->style->ythickness + vertical_padding) * 2;
615 +  menu_height = widget->requisition.height -
616 +      (border_width + widget->style->ythickness + vertical_padding) * 2;
617 +
618 +  x = border_width + widget->style->xthickness;
619 +  y = border_width + widget->style->ythickness + vertical_padding;
620 +
621 +  if (!menu->tearoff_active)
622 +    {
623 +      last_visible = menu->upper_arrow_visible;
624 +      menu->upper_arrow_visible = offset > 0;
625 +      
626 +      if (menu->upper_arrow_visible)
627 +       view_height -= MENU_SCROLL_ARROW_HEIGHT;
628 +      
629 +      if ( (last_visible != menu->upper_arrow_visible) &&
630 +          !menu->upper_arrow_visible)
631 +       {
632 +         menu->upper_arrow_prelight = FALSE;
633 +         
634 +         /* If we hid the upper arrow, possibly remove timeout */
635 +         if (menu->scroll_step < 0)
636 +           {
637 +             gtk_menu_stop_scrolling (menu);
638 +             gtk_widget_queue_draw (GTK_WIDGET (menu));
639 +           }
640 +       }
641 +
642 +      last_visible = menu->lower_arrow_visible;
643 +      menu->lower_arrow_visible = offset < menu_height - view_height;
644 +      
645 +      if (menu->lower_arrow_visible)
646 +       view_height -= MENU_SCROLL_ARROW_HEIGHT;
647 +      
648 +      if ( (last_visible != menu->lower_arrow_visible) &&
649 +          !menu->lower_arrow_visible)
650 +       {
651 +         menu->lower_arrow_prelight = FALSE;
652 +         
653 +         /* If we hid the lower arrow, possibly remove timeout */
654 +         if (menu->scroll_step > 0)
655 +           {
656 +             gtk_menu_stop_scrolling (menu);
657 +             gtk_widget_queue_draw (GTK_WIDGET (menu));
658 +           }
659 +       }
660 +      
661 +      if (menu->upper_arrow_visible)
662 +       y += MENU_SCROLL_ARROW_HEIGHT;
663 +    }
664 +
665 +  /* Scroll the menu: */
666 +  if (GTK_WIDGET_REALIZED (menu))
667 +    gdk_window_move (menu->bin_window, 0, -offset);
668 +
669 +  if (GTK_WIDGET_REALIZED (menu))
670 +    gdk_window_move_resize (menu->view_window,
671 +                           x,
672 +                           y,
673 +                           view_width,
674 +                           view_height);
675 +
676 +  menu->scroll_offset = offset;
677 +}
678 +
679 +static AttachInfo *
680 +get_attach_info (GtkWidget *child)
681 +{
682 +       GObject *object = G_OBJECT (child);
683 +       AttachInfo *ai = g_object_get_data (object, ATTACH_INFO_KEY);
684 +
685 +       if (!ai)
686 +       {
687 +               ai = g_new0 (AttachInfo, 1);
688 +               g_object_set_data_full (object, ATTACH_INFO_KEY, ai, g_free);
689 +       }
690 +
691 +       return ai;
692 +}
693 +
694 +static gboolean
695 +is_grid_attached (AttachInfo *ai)
696 +{
697 +       return (ai->left_attach >= 0 &&
698 +                       ai->right_attach >= 0 &&
699 +                       ai->top_attach >= 0 &&
700 +                       ai->bottom_attach >= 0);
701 +}
702 +
703 +static void
704 +menu_ensure_layout (GtkMenu *menu)
705 +{
706 +       GtkMenuPrivate *priv = gtk_menu_get_private (menu);
707 +
708 +       if (!priv->have_layout)
709 +       {
710 +               GtkMenuShell *menu_shell = GTK_MENU_SHELL (menu);
711 +               GList *l;
712 +               gchar *row_occupied;
713 +               gint current_row;
714 +               gint max_right_attach;
715 +               gint max_bottom_attach;
716 +
717 +               /* Find extents of gridded portion */
718 +               max_right_attach = 1;
719 +               max_bottom_attach = 0;
720 +
721 +               for (l = menu_shell->children; l; l = l->next)
722 +               {
723 +                       GtkWidget *child = l->data;
724 +                       AttachInfo *ai = get_attach_info (child);
725 +
726 +                       if (is_grid_attached (ai))
727 +                       {
728 +                               max_bottom_attach = MAX (max_bottom_attach, ai->bottom_attach);
729 +                               max_right_attach = MAX (max_right_attach, ai->right_attach);
730 +                       }
731 +               }
732 +
733 +               /* Find empty rows */
734 +               row_occupied = g_malloc0 (max_bottom_attach);
735 +
736 +               for (l = menu_shell->children; l; l = l->next)
737 +               {
738 +                       GtkWidget *child = l->data;
739 +                       AttachInfo *ai = get_attach_info (child);
740 +
741 +                       if (is_grid_attached (ai))
742 +                       {
743 +                               gint i;
744 +
745 +                               for (i = ai->top_attach; i < ai->bottom_attach; i++)
746 +                                       row_occupied[i] = TRUE;
747 +                       }
748 +               }
749 +
750 +               /* Lay non-grid-items out in those rows */
751 +               current_row = 0;
752 +               for (l = menu_shell->children; l; l = l->next)
753 +               {
754 +                       GtkWidget *child = l->data;
755 +                       AttachInfo *ai = get_attach_info (child);
756 +
757 +                       if (!is_grid_attached (ai))
758 +                       {
759 +                               while (current_row < max_bottom_attach && row_occupied[current_row])
760 +                                       current_row++;
761 +
762 +                               ai->effective_left_attach = 0;
763 +                               ai->effective_right_attach = max_right_attach;
764 +                               ai->effective_top_attach = current_row;
765 +                               ai->effective_bottom_attach = current_row + 1;
766 +
767 +                               current_row++;
768 +                       }
769 +                       else
770 +                       {
771 +                               ai->effective_left_attach = ai->left_attach;
772 +                               ai->effective_right_attach = ai->right_attach;
773 +                               ai->effective_top_attach = ai->top_attach;
774 +                               ai->effective_bottom_attach = ai->bottom_attach;
775 +                       }
776 +               }
777 +
778 +               g_free (row_occupied);
779 +
780 +               priv->n_rows = MAX (current_row, max_bottom_attach);
781 +               priv->n_columns = max_right_attach;
782 +               priv->have_layout = TRUE;
783 +       }
784 +}
785 +
786 +
787 +static gint
788 +gtk_menu_get_n_columns (GtkMenu *menu)
789 +{
790 +       GtkMenuPrivate *priv = gtk_menu_get_private (menu);
791 +
792 +       menu_ensure_layout (menu);
793 +
794 +       return priv->n_columns;
795 +}
796 +
797 +static gint
798 +gtk_menu_get_n_rows (GtkMenu *menu)
799 +{
800 +       GtkMenuPrivate *priv = gtk_menu_get_private (menu);
801 +
802 +       menu_ensure_layout (menu);
803 +
804 +       return priv->n_rows;
805 +}
806 +
807 +static void
808 +get_effective_child_attach (GtkWidget *child,
809 +               int       *l,
810 +               int       *r,
811 +               int       *t,
812 +               int       *b)
813 +{
814 +       GtkMenu *menu = GTK_MENU (child->parent);
815 +       AttachInfo *ai;
816 +
817 +       menu_ensure_layout (menu);
818 +
819 +       ai = get_attach_info (child);
820 +
821 +       if (l)
822 +               *l = ai->effective_left_attach;
823 +       if (r)
824 +               *r = ai->effective_right_attach;
825 +       if (t)
826 +               *t = ai->effective_top_attach;
827 +       if (b)
828 +               *b = ai->effective_bottom_attach;
829 +
830 +}
831 +
832 +static void
833 +gtk_menu_set_tearoff_hints (GtkMenu *menu,
834 +                           gint     width)
835 +{
836 +  GdkGeometry geometry_hints;
837 +  
838 +  if (!menu->tearoff_window)
839 +    return;
840 +
841 +  if (GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
842 +    {
843 +      gtk_widget_size_request (menu->tearoff_scrollbar, NULL);
844 +      width += menu->tearoff_scrollbar->requisition.width;
845 +    }
846 +
847 +  geometry_hints.min_width = width;
848 +  geometry_hints.max_width = width;
849 +    
850 +  geometry_hints.min_height = 0;
851 +  geometry_hints.max_height = GTK_WIDGET (menu)->requisition.height;
852 +
853 +  gtk_window_set_geometry_hints (GTK_WINDOW (menu->tearoff_window),
854 +                                NULL,
855 +                                &geometry_hints,
856 +                                GDK_HINT_MAX_SIZE|GDK_HINT_MIN_SIZE);
857 +}
858 +
859 +static void
860 +gtk_menu_size_allocate (GtkWidget     *widget,
861 +                       GtkAllocation *allocation)
862 +{
863 +  GtkMenu *menu;
864 +  GtkMenuShell *menu_shell;
865 +  GtkWidget *child;
866 +  GtkAllocation child_allocation;
867 +  GtkRequisition child_requisition;
868 +  GtkMenuPrivate *priv;
869 +  GList *children;
870 +  gint x, y;
871 +  gint width, height;
872 +  guint vertical_padding;
873 +  guint menu_stripe_width;
874 +
875 +  g_return_if_fail (GTK_IS_MENU (widget));
876 +  g_return_if_fail (allocation != NULL);
877 +  
878 +  menu = GTK_MENU (widget);
879 +  menu_shell = GTK_MENU_SHELL (widget);
880 +  priv = gtk_menu_get_private (menu);
881
882 +  widget->allocation = *allocation;
883 +  gtk_widget_get_child_requisition (GTK_WIDGET (menu), &child_requisition);
884 +
885 +  gtk_widget_style_get (GTK_WIDGET (menu),
886 +                       "vertical-padding", &vertical_padding,
887 +                       NULL);
888 +  
889 +  x = GTK_CONTAINER (menu)->border_width + widget->style->xthickness;
890 +  y = GTK_CONTAINER (menu)->border_width + widget->style->ythickness + vertical_padding;
891 +
892 +  width = MAX (1, allocation->width - x * 2);
893 +  height = MAX (1, allocation->height - y * 2);
894 +
895 +  child_requisition.width -= x * 2;
896 +  child_requisition.height -= y * 2;
897 +
898 +  if (menu_shell->active)
899 +    gtk_menu_scroll_to (menu, menu->scroll_offset);
900 +  
901 +  if (menu->upper_arrow_visible && !menu->tearoff_active)
902 +    {
903 +      y += MENU_SCROLL_ARROW_HEIGHT;
904 +      height -= MENU_SCROLL_ARROW_HEIGHT;
905 +    }
906 +  
907 +  if (menu->lower_arrow_visible && !menu->tearoff_active)
908 +    height -= MENU_SCROLL_ARROW_HEIGHT;
909 +  
910 +  if (GTK_WIDGET_REALIZED (widget))
911 +    {
912 +      gdk_window_move_resize (widget->window,
913 +                             allocation->x, allocation->y,
914 +                             allocation->width, allocation->height);
915 +
916 +      gdk_window_move_resize (menu->view_window,
917 +                             x,
918 +                             y,
919 +                             width,
920 +                             height);
921 +    }
922 +
923 +/* inserted for panel-menu.c */
924 +  if (panel_global_config_get_menu_stripe () && PANEL_MENU (widget)->side_image) {
925 +    menu_stripe_width = gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image) + gtk_widget_get_style (widget)->xthickness;
926 +  } else {
927 +    menu_stripe_width = 0;
928 +  }
929 +/* end panel-menu.c */
930 +
931 +  if (menu_shell->children)
932 +    {
933 +/* inserted for panel-menu.c */
934 +#if 0
935 +      gint base_width = width / gtk_menu_get_n_columns (menu);
936 +#else
937 +      gint base_width = (width - menu_stripe_width) / gtk_menu_get_n_columns (menu);
938 +#endif
939 +/* end panel-menu.c */
940 +
941 +      children = menu_shell->children;
942 +      while (children)
943 +       {
944 +         child = children->data;
945 +         children = children->next;
946 +
947 +         if (GTK_WIDGET_VISIBLE (child))
948 +           {
949 +              gint i;
950 +             guint l, r, t, b;
951 +
952 +              get_effective_child_attach (child, &l, &r, &t, &b);
953 +
954 +              if (gtk_widget_get_direction (GTK_WIDGET (menu)) == GTK_TEXT_DIR_RTL)
955 +                {
956 +                  guint tmp;
957 +                  tmp = gtk_menu_get_n_columns (menu) - l;
958 +                  l = gtk_menu_get_n_columns (menu) - r;
959 +                  r = tmp;
960 +                }
961 +
962 +              child_allocation.width = (r - l) * base_width;
963 +              child_allocation.height = 0;
964 +/* inserted for panel-menu.c */
965 +#if 0
966 +              child_allocation.x = l * base_width;
967 +#else
968 +              child_allocation.x = l * base_width + menu_stripe_width;
969 +#endif
970 +              child_allocation.y = 0;
971 +
972 +              for (i = 0; i < b; i++)
973 +                {
974 +                  if (i < t)
975 +                    child_allocation.y += priv->heights[i];
976 +                  else
977 +                    child_allocation.height += priv->heights[i];
978 +                }
979 +
980 +
981 +             gtk_menu_item_toggle_size_allocate (GTK_MENU_ITEM (child),
982 +                                                 menu->toggle_size);
983 +
984 +             gtk_widget_size_allocate (child, &child_allocation);
985 +
986 +#if 0
987 +
988 +/* inserted for panel-menu.c */
989 +             if (use_menu_stripe && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM)) 
990 +               {
991 +                 /* this is dumb, gtkmenuitem.c uses allocation.width as an absolute point */
992 +                 child_allocation.width += gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image);
993 +               }
994 +
995 +             gtk_widget_size_allocate (child, &child_allocation);
996 +
997 +             if (use_menu_stripe && g_type_is_a (G_OBJECT_TYPE (child), GTK_TYPE_SEPARATOR_MENU_ITEM)) 
998 +               {
999 +                 child_allocation.width -= gdk_pixbuf_get_width (PANEL_MENU (widget)->side_image);
1000 +               }
1001 +#endif
1002 +
1003 +             /* Hack to handle events on the stripe area */
1004 +             if (GTK_WIDGET_REALIZED (child) && l == 0) 
1005 +               { 
1006 +                 gdk_window_move_resize (GTK_MENU_ITEM (child)->event_window,
1007 +                                         0, child_allocation.y,
1008 +                                         child_allocation.width + child_allocation.x, 
1009 +                                         child_allocation.height);
1010 +               }
1011 +/* end panel-menu.c */
1012 +
1013 +             gtk_widget_queue_draw (child);
1014 +           }
1015 +       }
1016 +      
1017 +      /* Resize the item window */
1018 +      if (GTK_WIDGET_REALIZED (widget))
1019 +       {
1020 +          gint i;
1021 +          gint width, height;
1022 +
1023 +          height = 0;
1024 +          for (i = 0; i < gtk_menu_get_n_rows (menu); i++)
1025 +            height += priv->heights[i];
1026 +
1027 +/* inserted for panel-menu.c */
1028 +#if 0
1029 +          width = gtk_menu_get_n_columns (menu) * base_width;
1030 +#else
1031 +          width = gtk_menu_get_n_columns (menu) * base_width + menu_stripe_width;
1032 +#endif
1033 +/* end panel-menu.c */
1034 +
1035 +         gdk_window_resize (menu->bin_window, width, height);
1036 +       }
1037 +
1038 +      if (menu->tearoff_active)
1039 +       {
1040 +         if (allocation->height >= widget->requisition.height)
1041 +           {
1042 +             if (GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
1043 +               {
1044 +                 gtk_widget_hide (menu->tearoff_scrollbar);
1045 +                 gtk_menu_set_tearoff_hints (menu, allocation->width);
1046 +
1047 +                 gtk_menu_scroll_to (menu, 0);
1048 +               }
1049 +           }
1050 +         else
1051 +           {
1052 +             menu->tearoff_adjustment->upper = widget->requisition.height;
1053 +             menu->tearoff_adjustment->page_size = allocation->height;
1054 +             
1055 +             if (menu->tearoff_adjustment->value + menu->tearoff_adjustment->page_size >
1056 +                 menu->tearoff_adjustment->upper)
1057 +               {
1058 +                 gint value;
1059 +                 value = menu->tearoff_adjustment->upper - menu->tearoff_adjustment->page_size;
1060 +                 if (value < 0)
1061 +                   value = 0;
1062 +                 gtk_menu_scroll_to (menu, value);
1063 +               }
1064 +             
1065 +             gtk_adjustment_changed (menu->tearoff_adjustment);
1066 +             
1067 +             if (!GTK_WIDGET_VISIBLE (menu->tearoff_scrollbar))
1068 +               {
1069 +                 gtk_widget_show (menu->tearoff_scrollbar);
1070 +                 gtk_menu_set_tearoff_hints (menu, allocation->width);
1071 +               }
1072 +           }
1073 +       }
1074 +    }
1075 +/* inserted for panel-menu.c */
1076 +
1077 +  {
1078 +    PanelMenu *pm = PANEL_MENU (widget);
1079 +               
1080 +    gint scaled_height = height;
1081 +               
1082 +    if (pm->side_image && widget->allocation.height > gdk_pixbuf_get_height (pm->side_image)) 
1083 +      {
1084 +       scaled_height -= gdk_pixbuf_get_height (pm->side_image);
1085 +      }
1086 +    
1087 +    if (pm->side_image && widget->allocation.height < gdk_pixbuf_get_height (pm->side_image)) 
1088 +      {
1089 +       gint scaled_width = ((scaled_height * gdk_pixbuf_get_width (pm->side_image)) / gdk_pixbuf_get_height (pm->side_image));
1090 +
1091 +       if (pm->scaled_image)
1092 +               gdk_pixbuf_unref(pm->scaled_image);
1093 +
1094 +       pm->scaled_image = gdk_pixbuf_scale_simple (pm->side_image,
1095 +                                                   scaled_width,
1096 +                                                   scaled_height,
1097 +                                                   GDK_INTERP_BILINEAR); /* maybe HYPER ? */
1098 +       gdk_pixbuf_unref(pm->side_image);
1099 +       pm->side_image = pm->scaled_image;
1100 +      } 
1101 +    else 
1102 +      {
1103 +       gboolean draw_gradient;
1104 +       gtk_widget_style_get (GTK_WIDGET (pm),
1105 +                             "gradient_bg", &draw_gradient, 
1106 +                             NULL);
1107 +       
1108 +       if (pm->side_image && draw_gradient) 
1109 +         {
1110 +           GdkColor *stripe_color;
1111 +           GdkColor *light_color;
1112 +           
1113 +           stripe_color = get_stripe_color (pm);
1114 +           light_color = get_light_stripe_color (pm);
1115 +           pm->scaled_image = meta_gradient_create_vertical 
1116 +             (gdk_pixbuf_get_width (pm->side_image),
1117 +              scaled_height,
1118 +              light_color,
1119 +              stripe_color);
1120 +           gdk_color_free (light_color);
1121 +           gdk_color_free (stripe_color);
1122 +         }
1123 +      }
1124 +  }
1125 +/* end panel-menu.c */
1126 +}
1127 +
1128 +/* end gtkmenu cut and paste */
1129 +
1130 +static void
1131 +unload_images (PanelMenu *pm)
1132 +{
1133 +       if (pm->side_image) {
1134 +               g_object_unref (pm->side_image);
1135 +               pm->side_image = NULL;
1136 +       }
1137 +
1138 +       if (pm->scaled_image) {
1139 +               g_object_unref (pm->scaled_image);
1140 +               pm->scaled_image = NULL;
1141 +       }
1142 +}
1143 +
1144 +static GdkPixbuf *
1145 +get_stripe_image (PanelMenu *pm,
1146 +                 const char *name,
1147 +                 const char *default_filename)
1148 +{      
1149 +       GdkPixbuf *image = NULL;
1150 +       char *file_src;
1151 +       
1152 +       gtk_widget_style_get (GTK_WIDGET (pm), name, &file_src, NULL);
1153 +
1154 +       if (!file_src) {
1155 +               file_src = gnome_program_locate_file (NULL,
1156 +                                                     GNOME_FILE_DOMAIN_PIXMAP,
1157 +                                                     default_filename,
1158 +                                                     TRUE,
1159 +                                                     NULL);
1160 +       }
1161 +
1162 +       if (file_src) 
1163 +               image = gdk_pixbuf_new_from_file (file_src, NULL);
1164 +       
1165 +       g_free (file_src);
1166 +       
1167 +       return image;
1168 +}
1169 +
1170 +static void
1171 +load_images (PanelMenu *pm)
1172 +{
1173 +       GdkPixbuf *image;
1174 +
1175 +       unload_images (pm);
1176 +       
1177 +       pm->side_image = get_stripe_image (pm, "default_side_image",
1178 +                                 "pld-desktop-stripe.png");
1179 +}
1180 +
1181 +static void
1182 +panel_menu_style_set (GtkWidget *widget,
1183 +                     GtkStyle *old_style)
1184 +{
1185 +       load_images (PANEL_MENU (widget));
1186 +       GNOME_CALL_PARENT (GTK_WIDGET_CLASS, style_set, (widget, old_style));
1187 +}
1188 +
1189 +static void
1190 +panel_menu_destroy (GtkObject *object)
1191 +{
1192 +       PanelMenu *pm = PANEL_MENU (object);
1193 +       
1194 +       unload_images (pm);
1195 +       
1196 +       GNOME_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
1197 +}
1198 +
1199 +static void
1200 +panel_menu_finalize (GObject *object)
1201 +{
1202 +       GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
1203 +}
1204 +
1205 +static void
1206 +panel_menu_class_init (PanelMenuClass *klass)
1207 +{      
1208 +       GtkWidgetClass *widget_class = (GtkWidgetClass *) klass;
1209 +       GtkObjectClass *gtk_object_class = (GtkObjectClass *)klass;
1210 +       GObjectClass *object_class = (GObjectClass *) klass;
1211 +
1212 +       gtk_widget_class_install_style_property (
1213 +               widget_class,
1214 +               g_param_spec_string ("default_side_image",
1215 +                                    _("Default Side Image"),
1216 +                                    _("Filename of logo down the side of applications menu"),
1217 +                                    NULL,
1218 +                                    G_PARAM_READWRITE));
1219 +
1220 +       gtk_widget_class_install_style_property (
1221 +               widget_class,
1222 +               g_param_spec_boolean ("gradient_bg",
1223 +                                    _("Gradient Background"),
1224 +                                    _("Draw a gradient in the menu stripe"),
1225 +                                    FALSE,
1226 +                                    G_PARAM_READWRITE));
1227 +       gtk_widget_class_install_style_property (
1228 +              widget_class,
1229 +              g_param_spec_boxed ("stripe_color",
1230 +                                  _("Stripe Color"),
1231 +                                  _("Color of the panel menu stripe"),
1232 +                                  GDK_TYPE_COLOR,
1233 +                                  G_PARAM_READABLE));
1234 +
1235 +       gtk_widget_class_install_style_property (
1236 +              widget_class,
1237 +              g_param_spec_boxed ("stripe_color_light",
1238 +                                  _("Light Stripe Color"),
1239 +                                  _("Light color of the panel menu stripe, for gradients"),
1240 +                                  GDK_TYPE_COLOR,
1241 +                                  G_PARAM_READABLE));       
1242 +
1243 +       object_class->finalize = panel_menu_finalize;
1244 +       gtk_object_class->destroy = panel_menu_destroy;
1245 +       widget_class->size_request = panel_menu_size_request;
1246 +       widget_class->size_allocate = gtk_menu_size_allocate;
1247 +       widget_class->expose_event = panel_menu_expose_event;
1248 +       widget_class->style_set = panel_menu_style_set;
1249 +}
1250 +
1251 +static void
1252 +panel_menu_instance_init (PanelMenu *pm)
1253 +{
1254 +       gtk_widget_ensure_style (GTK_WIDGET (pm));
1255 +
1256 +       load_images (pm);
1257 +       
1258 +       gtk_widget_add_events (
1259 +               GTK_WIDGET (pm),
1260 +               GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
1261 +               GDK_POINTER_MOTION_MASK);
1262 +}
1263 diff -urN aa/gnome-panel-2.6.0/gnome-panel/panel-menu.h gnome-panel-2.6.0/gnome-panel/panel-menu.h
1264 --- aa/gnome-panel-2.6.0/gnome-panel/panel-menu.h       1970-01-01 01:00:00.000000000 +0100
1265 +++ gnome-panel-2.6.0/gnome-panel/panel-menu.h  2004-03-27 00:29:00.640043704 +0100
1266 @@ -0,0 +1,31 @@
1267 +#include <gtk/gtkmenu.h>
1268 +#include <gtk/gtkimage.h>
1269 +
1270 +typedef struct _PanelMenu PanelMenu;
1271 +typedef struct _PanelMenuClass PanelMenuClass;
1272 +
1273 +#define PANEL_MENU(obj) \
1274 +        GTK_CHECK_CAST (obj, panel_menu_get_type (), PanelMenu)
1275 +#define PANEL_MENU_CLASS(k) \
1276 +       GTK_CHECK_CLASS_CAST (k, panel_menu_get_type (), PanelMenuClass)
1277 +#define PANEL_IS_MENU(obj) \
1278 +       GTK_CHECK_TYPE (obj, panel_menu_get_type ())
1279 +
1280 +
1281 +struct _PanelMenu
1282 +{
1283 +       GtkMenu parent;
1284 +
1285 +       GdkPixbuf *side_image;
1286 +       GdkPixbuf *scaled_image;
1287 +
1288 +       GdkRegion *navigation_region;
1289 +};
1290 +
1291 +struct _PanelMenuClass
1292 +{
1293 +       GtkMenuClass parent_class;
1294 +};
1295 +
1296 +GType      panel_menu_get_type (void);
1297 +GtkWidget *panel_menu_evolve   (void);
This page took 0.147201 seconds and 3 git commands to generate.