1 diff -urN aa/glabels-1.93.1/po/POTFILES.in glabels-1.93.1/po/POTFILES.in
2 --- aa/glabels-1.93.1/po/POTFILES.in 2003-12-14 07:04:59.000000000 +0100
3 +++ glabels-1.93.1/po/POTFILES.in 2003-12-28 23:24:52.434158696 +0100
8 -src/mygal/gtk-combo-box.c
9 -src/mygal/gtk-combo-box.h
10 +src/mygal/mygal-combo-box.c
11 +src/mygal/mygal-combo-box.h
12 src/mygal/widget-color-combo.c
13 src/mygal/widget-color-combo.h
15 diff -urN aa/glabels-1.93.1/src/Makefile.am glabels-1.93.1/src/Makefile.am
16 --- aa/glabels-1.93.1/src/Makefile.am 2003-12-06 03:35:56.000000000 +0100
17 +++ glabels-1.93.1/src/Makefile.am 2003-12-28 23:26:16.952309984 +0100
19 -DLIBDIR=\""$(libdir)"\" \
20 -DGLABELS_LOCALEDIR=\""$(datadir)/locale"\" \
21 -DGLABELS_UI_DIR=\""$(datadir)/glabels/ui/"\" \
22 - -DGLABELS_GLADE_DIR=\""$(datadir)/glabels/glade/"\" \
23 - -DG_DISABLE_DEPRECATED \
24 - -DGDK_DISABLE_DEPRECATED \
25 - -DGTK_DISABLE_DEPRECATED \
26 - -DGDK_PIXBUF_DISABLE_DEPRECATED \
27 - -DGNOME_DISABLE_DEPRECATED
28 + -DGLABELS_GLADE_DIR=\""$(datadir)/glabels/glade/"\"
30 glabels_LDFLAGS = -export-dynamic
32 diff -urN aa/glabels-1.93.1/src/mygal/Makefile.am glabels-1.93.1/src/mygal/Makefile.am
33 --- aa/glabels-1.93.1/src/mygal/Makefile.am 2003-07-27 06:07:19.000000000 +0200
34 +++ glabels-1.93.1/src/mygal/Makefile.am 2003-12-28 23:23:37.195596696 +0100
38 - -DG_DISABLE_DEPRECATED \
39 - -DGDK_DISABLE_DEPRECATED \
40 - -DGTK_DISABLE_DEPRECATED \
41 - -DGDK_PIXBUF_DISABLE_DEPRECATED \
42 - -DGNOME_DISABLE_DEPRECATED
45 noinst_LTLIBRARIES = libmygal.la
58 diff -urN aa/glabels-1.93.1/src/mygal/mygal-combo-box.c glabels-1.93.1/src/mygal/mygal-combo-box.c
59 --- aa/glabels-1.93.1/src/mygal/mygal-combo-box.c 1970-01-01 01:00:00.000000000 +0100
60 +++ glabels-1.93.1/src/mygal/mygal-combo-box.c 2003-12-28 23:21:51.273699272 +0100
62 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
64 + * mygal-combo-box.c - a customizable combobox
65 + * Copyright 2000, 2001, Ximian, Inc.
68 + * Miguel de Icaza (miguel@gnu.org)
69 + * Adrian E Feiguin (feiguin@ifir.edu.ar)
70 + * Paolo Molnaro (lupus@debian.org).
71 + * Jon K Hellan (hellan@acm.org)
73 + * Modified for gLabels by:
74 + * Jim Evins <evins@snaught.com>
76 + * This library is free software; you can redistribute it and/or
77 + * modify it under the terms of the GNU General Public
78 + * License, version 2, as published by the Free Software Foundation.
80 + * This library is distributed in the hope that it will be useful, but
81 + * WITHOUT ANY WARRANTY; without even the implied warranty of
82 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
83 + * General Public License for more details.
85 + * You should have received a copy of the GNU General Public
86 + * License along with this library; if not, write to the Free Software
87 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
92 +#include <gtk/gtkhbox.h>
93 +#include <gtk/gtktogglebutton.h>
94 +#include <gtk/gtkarrow.h>
95 +#include <gtk/gtkeventbox.h>
96 +#include <gtk/gtkmain.h>
97 +#include <gtk/gtksignal.h>
98 +#include <gtk/gtkwindow.h>
99 +#include <gtk/gtkframe.h>
100 +#include <gtk/gtkvbox.h>
101 +#include <gtk/gtktearoffmenuitem.h>
102 +#include <gdk/gdkkeysyms.h>
103 +#include "mygal-combo-box.h"
106 +#define PARENT_TYPE GTK_TYPE_HBOX
107 +static GObjectClass *mygal_combo_box_parent_class;
109 +static int gtk_combo_toggle_pressed (GtkToggleButton *tbutton,
110 + MygalComboBox *combo_box);
111 +static void gtk_combo_popup_tear_off (MygalComboBox *combo,
112 + gboolean set_position);
113 +static void gtk_combo_set_tearoff_state (MygalComboBox *combo,
114 + gboolean torn_off);
115 +static void gtk_combo_popup_reparent (GtkWidget *popup, GtkWidget *new_parent,
116 + gboolean unrealize);
117 +static gboolean cb_popup_delete (GtkWidget *w, GdkEventAny *event,
118 + MygalComboBox *combo);
119 +static void gtk_combo_tearoff_bg_copy (MygalComboBox *combo);
129 +static guint mygal_combo_box_signals [LAST_SIGNAL] = { 0, };
131 +struct _MygalComboBoxPrivate {
132 + GtkWidget *pop_down_widget;
133 + GtkWidget *display_widget;
136 + * Internal widgets used to implement the ComboBox
139 + GtkWidget *arrow_button;
141 + GtkWidget *toplevel; /* Popup's toplevel when not torn off */
142 + GtkWidget *tearoff_window; /* Popup's toplevel when torn off */
145 + GtkWidget *tearable; /* The tearoff "button" */
146 + GtkWidget *popup; /* Popup */
149 + * Closure for invoking the callbacks above
155 +mygal_combo_box_finalize (GObject *object)
157 + MygalComboBox *combo_box = MYGAL_COMBO_BOX (object);
159 + g_free (combo_box->priv);
161 + mygal_combo_box_parent_class->finalize (object);
165 +mygal_combo_box_destroy (GtkObject *object)
167 + GtkObjectClass *klass = (GtkObjectClass *)mygal_combo_box_parent_class;
168 + MygalComboBox *combo_box = MYGAL_COMBO_BOX (object);
170 + if (combo_box->priv->toplevel) {
171 + gtk_object_destroy (GTK_OBJECT (combo_box->priv->toplevel));
172 + combo_box->priv->toplevel = NULL;
175 + if (combo_box->priv->tearoff_window) {
176 + gtk_object_destroy (GTK_OBJECT (combo_box->priv->tearoff_window));
177 + combo_box->priv->tearoff_window = NULL;
180 + if (klass->destroy)
181 + klass->destroy (object);
185 +mygal_combo_box_mnemonic_activate (GtkWidget *w, gboolean group_cycling)
187 + MygalComboBox *combo_box = MYGAL_COMBO_BOX (w);
188 + gtk_toggle_button_set_active (
189 + GTK_TOGGLE_BUTTON (combo_box->priv->arrow_button), TRUE);
194 +mygal_combo_box_class_init (GObjectClass *object_class)
196 + GtkWidgetClass *widget_class = (GtkWidgetClass *)object_class;
197 + mygal_combo_box_parent_class = g_type_class_peek_parent (object_class);
199 + object_class->finalize = mygal_combo_box_finalize;
200 + widget_class->mnemonic_activate = mygal_combo_box_mnemonic_activate;
201 + ((GtkObjectClass *)object_class)->destroy = mygal_combo_box_destroy;
203 + mygal_combo_box_signals [POP_DOWN_WIDGET] = g_signal_new (
205 + G_OBJECT_CLASS_TYPE (object_class),
207 + G_STRUCT_OFFSET (MygalComboBoxClass, pop_down_widget),
209 + e_marshal_POINTER__NONE,
210 + G_TYPE_POINTER, 0, G_TYPE_NONE);
212 + mygal_combo_box_signals [POP_DOWN_DONE] = g_signal_new (
214 + G_OBJECT_CLASS_TYPE (object_class),
216 + G_STRUCT_OFFSET (MygalComboBoxClass, pop_down_done),
218 + e_marshal_BOOLEAN__OBJECT,
219 + G_TYPE_BOOLEAN, 1, G_TYPE_OBJECT);
221 + mygal_combo_box_signals [PRE_POP_DOWN] = g_signal_new (
223 + G_OBJECT_CLASS_TYPE (object_class),
225 + G_STRUCT_OFFSET (MygalComboBoxClass, pre_pop_down),
227 + e_marshal_NONE__NONE,
230 + mygal_combo_box_signals [POST_POP_HIDE] = g_signal_new (
232 + G_OBJECT_CLASS_TYPE (object_class),
234 + G_STRUCT_OFFSET (MygalComboBoxClass, post_pop_hide),
236 + e_marshal_NONE__NONE,
241 +deactivate_arrow (MygalComboBox *combo_box)
243 + GtkToggleButton *arrow;
245 + arrow = GTK_TOGGLE_BUTTON (combo_box->priv->arrow_button);
246 + g_signal_handlers_block_matched (arrow,
247 + G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
249 + gtk_combo_toggle_pressed, combo_box);
251 + gtk_toggle_button_set_active (arrow, FALSE);
253 + g_signal_handlers_unblock_matched (arrow,
254 + G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
256 + gtk_combo_toggle_pressed, combo_box);
260 + * mygal_combo_box_popup_hide_unconditional
261 + * @combo_box: Combo box
263 + * Hide popup, whether or not it is torn off.
266 +mygal_combo_box_popup_hide_unconditional (MygalComboBox *combo_box)
268 + gboolean popup_info_destroyed = FALSE;
270 + g_return_if_fail (combo_box != NULL);
271 + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
273 + gtk_widget_hide (combo_box->priv->toplevel);
274 + gtk_widget_hide (combo_box->priv->popup);
275 + if (combo_box->priv->torn_off) {
276 + GTK_TEAROFF_MENU_ITEM (combo_box->priv->tearable)->torn_off
278 + gtk_combo_set_tearoff_state (combo_box, FALSE);
281 + gtk_grab_remove (combo_box->priv->toplevel);
282 + gdk_pointer_ungrab (GDK_CURRENT_TIME);
284 + g_object_ref (combo_box->priv->pop_down_widget);
285 + g_signal_emit (combo_box,
286 + mygal_combo_box_signals [POP_DOWN_DONE], 0,
287 + combo_box->priv->pop_down_widget, &popup_info_destroyed);
289 + if (popup_info_destroyed){
290 + gtk_container_remove (
291 + GTK_CONTAINER (combo_box->priv->frame),
292 + combo_box->priv->pop_down_widget);
293 + combo_box->priv->pop_down_widget = NULL;
295 + g_object_unref (combo_box->priv->pop_down_widget);
296 + deactivate_arrow (combo_box);
298 + g_signal_emit (combo_box, mygal_combo_box_signals [POST_POP_HIDE], 0);
302 + * mygal_combo_box_popup_hide:
303 + * @combo_box: Combo box
305 + * Hide popup, but not when it is torn off.
306 + * This is the external interface - for subclasses and apps which expect a
307 + * regular combo which doesn't do tearoffs.
310 +mygal_combo_box_popup_hide (MygalComboBox *combo_box)
312 + if (!combo_box->priv->torn_off)
313 + mygal_combo_box_popup_hide_unconditional (combo_box);
314 + else if (GTK_WIDGET_VISIBLE (combo_box->priv->toplevel)) {
315 + /* Both popup and tearoff window present. Get rid of just
316 + the popup shell. */
317 + gtk_combo_popup_tear_off (combo_box, FALSE);
318 + deactivate_arrow (combo_box);
323 + * Find best location for displaying
326 +mygal_combo_box_get_pos (MygalComboBox *combo_box, int *x, int *y)
328 + GtkWidget *wcombo = GTK_WIDGET (combo_box);
331 + gdk_window_get_origin (wcombo->window, x, y);
332 + *y += wcombo->allocation.height + wcombo->allocation.y;
333 + *x += wcombo->allocation.x;
335 + ph = combo_box->priv->popup->allocation.height;
336 + pw = combo_box->priv->popup->allocation.width;
338 + if ((*y + ph) > gdk_screen_height ())
339 + *y = gdk_screen_height () - ph;
341 + if ((*x + pw) > gdk_screen_width ())
342 + *x = gdk_screen_width () - pw;
346 +mygal_combo_box_popup_display (MygalComboBox *combo_box)
350 + g_return_if_fail (combo_box != NULL);
351 + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
354 + * If we have no widget to display on the popdown,
357 + if (!combo_box->priv->pop_down_widget){
358 + GtkWidget *pw = NULL;
360 + g_signal_emit (combo_box,
361 + mygal_combo_box_signals [POP_DOWN_WIDGET], 0, &pw);
362 + g_assert (pw != NULL);
363 + combo_box->priv->pop_down_widget = pw;
364 + gtk_container_add (GTK_CONTAINER (combo_box->priv->frame), pw);
367 + g_signal_emit (combo_box, mygal_combo_box_signals [PRE_POP_DOWN], 0);
369 + if (combo_box->priv->torn_off) {
370 + /* To give the illusion that tearoff still displays the
371 + * popup, we copy the image in the popup window to the
372 + * background. Thus, it won't be blank after reparenting */
373 + gtk_combo_tearoff_bg_copy (combo_box);
375 + /* We force an unrealize here so that we don't trigger
376 + * redrawing/ clearing code - we just want to reveal our
379 + gtk_combo_popup_reparent (combo_box->priv->popup,
380 + combo_box->priv->toplevel, TRUE);
383 + mygal_combo_box_get_pos (combo_box, &x, &y);
385 + gtk_widget_set_uposition (combo_box->priv->toplevel, x, y);
386 + gtk_widget_realize (combo_box->priv->popup);
387 + gtk_widget_show (combo_box->priv->popup);
388 + gtk_widget_realize (combo_box->priv->toplevel);
389 + gtk_widget_show (combo_box->priv->toplevel);
391 + gtk_grab_add (combo_box->priv->toplevel);
392 + gdk_pointer_grab (combo_box->priv->toplevel->window, TRUE,
393 + GDK_BUTTON_PRESS_MASK |
394 + GDK_BUTTON_RELEASE_MASK |
395 + GDK_POINTER_MOTION_MASK,
396 + NULL, NULL, GDK_CURRENT_TIME);
400 +gtk_combo_toggle_pressed (GtkToggleButton *tbutton, MygalComboBox *combo_box)
402 + if (tbutton->active)
403 + mygal_combo_box_popup_display (combo_box);
405 + mygal_combo_box_popup_hide_unconditional (combo_box);
411 +mygal_combo_box_button_press (GtkWidget *widget, GdkEventButton *event, MygalComboBox *combo_box)
415 + child = gtk_get_event_widget ((GdkEvent *) event);
416 + if (child != widget){
418 + if (child == widget)
420 + child = child->parent;
424 + mygal_combo_box_popup_hide (combo_box);
429 + * mygal_combo_box_key_press
432 + * @combo_box: Combo box
434 + * Key press handler which dismisses popup on escape.
435 + * Popup is dismissed whether or not popup is torn off.
438 +mygal_combo_box_key_press (GtkWidget *widget, GdkEventKey *event,
439 + MygalComboBox *combo_box)
441 + if (event->keyval == GDK_Escape) {
442 + mygal_combo_box_popup_hide_unconditional (combo_box);
449 +cb_state_change (GtkWidget *widget, GtkStateType old_state, MygalComboBox *combo_box)
451 + GtkStateType const new_state = GTK_WIDGET_STATE(widget);
452 + gtk_widget_set_state (combo_box->priv->display_widget, new_state);
456 +mygal_combo_box_init (MygalComboBox *combo_box)
461 + combo_box->priv = g_new0 (MygalComboBoxPrivate, 1);
466 + combo_box->priv->arrow_button = gtk_toggle_button_new ();
467 + gtk_button_set_relief (GTK_BUTTON (combo_box->priv->arrow_button), GTK_RELIEF_NONE);
468 + GTK_WIDGET_UNSET_FLAGS (combo_box->priv->arrow_button, GTK_CAN_FOCUS);
470 + arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
471 + gtk_container_add (GTK_CONTAINER (combo_box->priv->arrow_button), arrow);
472 + gtk_box_pack_end (GTK_BOX (combo_box), combo_box->priv->arrow_button, FALSE, FALSE, 0);
473 + g_signal_connect (combo_box->priv->arrow_button, "toggled",
474 + G_CALLBACK (gtk_combo_toggle_pressed), combo_box);
475 + gtk_widget_show_all (combo_box->priv->arrow_button);
478 + * prelight the display widget when mousing over the arrow.
480 + g_signal_connect (combo_box->priv->arrow_button, "state-changed",
481 + G_CALLBACK (cb_state_change), combo_box);
484 + * The pop-down container
487 + combo_box->priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP);
488 + gtk_widget_ref (combo_box->priv->toplevel);
489 + gtk_object_sink (GTK_OBJECT (combo_box->priv->toplevel));
490 + gtk_window_set_policy (GTK_WINDOW (combo_box->priv->toplevel),
491 + FALSE, TRUE, FALSE);
493 + combo_box->priv->popup = gtk_event_box_new ();
494 + gtk_container_add (GTK_CONTAINER (combo_box->priv->toplevel),
495 + combo_box->priv->popup);
496 + gtk_widget_show (combo_box->priv->popup);
498 + gtk_widget_realize (combo_box->priv->popup);
499 + cursor = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
500 + gdk_window_set_cursor (combo_box->priv->popup->window, cursor);
501 + gdk_cursor_unref (cursor);
503 + combo_box->priv->torn_off = FALSE;
504 + combo_box->priv->tearoff_window = NULL;
506 + combo_box->priv->frame = gtk_frame_new (NULL);
507 + gtk_container_add (GTK_CONTAINER (combo_box->priv->popup),
508 + combo_box->priv->frame);
509 + gtk_frame_set_shadow_type (GTK_FRAME (combo_box->priv->frame), GTK_SHADOW_OUT);
511 + g_signal_connect (combo_box->priv->toplevel, "button_press_event",
512 + G_CALLBACK (mygal_combo_box_button_press), combo_box);
513 + g_signal_connect (combo_box->priv->toplevel, "key_press_event",
514 + G_CALLBACK (mygal_combo_box_key_press), combo_box);
517 +E_MAKE_TYPE (mygal_combo_box,
520 + mygal_combo_box_class_init,
521 + mygal_combo_box_init,
525 + * mygal_combo_box_set_display:
526 + * @combo_box: the Combo Box to modify
527 + * @display_widget: The widget to be displayed
529 + * Sets the displayed widget for the @combo_box to be @display_widget
532 +mygal_combo_box_set_display (MygalComboBox *combo_box, GtkWidget *display_widget)
534 + g_return_if_fail (combo_box != NULL);
535 + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
536 + g_return_if_fail (display_widget != NULL);
537 + g_return_if_fail (GTK_IS_WIDGET (display_widget));
539 + if (combo_box->priv->display_widget &&
540 + combo_box->priv->display_widget != display_widget)
541 + gtk_container_remove (GTK_CONTAINER (combo_box),
542 + combo_box->priv->display_widget);
544 + combo_box->priv->display_widget = display_widget;
546 + gtk_box_pack_start (GTK_BOX (combo_box), display_widget, TRUE, TRUE, 0);
550 +cb_tearable_enter_leave (GtkWidget *w, GdkEventCrossing *event, gpointer data)
552 + gboolean const flag = GPOINTER_TO_INT(data);
553 + gtk_widget_set_state (w, flag ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL);
558 + * gtk_combo_popup_tear_off
559 + * @combo: Combo box
560 + * @set_position: Set to position of popup shell if true
562 + * Tear off the popup
565 + * Gtk popup menus are toplevel windows, not dialogs. I think this is wrong,
566 + * and make the popups dialogs. But may be there should be a way to make
567 + * them toplevel. We can do this after creating:
568 + * GTK_WINDOW (tearoff)->type = GTK_WINDOW_TOPLEVEL;
571 +gtk_combo_popup_tear_off (MygalComboBox *combo, gboolean set_position)
575 + if (!combo->priv->tearoff_window) {
576 + GtkWidget *tearoff;
579 + /* FIXME: made this a toplevel, not a dialog ! */
580 + tearoff = gtk_window_new (GTK_WINDOW_TOPLEVEL);
581 + gtk_widget_ref (tearoff);
582 + gtk_object_sink (GTK_OBJECT (tearoff));
583 + combo->priv->tearoff_window = tearoff;
584 + gtk_widget_set_app_paintable (tearoff, TRUE);
585 + g_signal_connect (tearoff, "key_press_event",
586 + G_CALLBACK (mygal_combo_box_key_press),
588 + gtk_widget_realize (tearoff);
589 + title = g_object_get_data (G_OBJECT (combo),
590 + "gtk-combo-title");
592 + gdk_window_set_title (tearoff->window, title);
593 + gtk_window_set_policy (GTK_WINDOW (tearoff),
594 + FALSE, TRUE, FALSE);
595 + gtk_window_set_transient_for
596 + (GTK_WINDOW (tearoff),
597 + GTK_WINDOW (gtk_widget_get_toplevel
598 + GTK_WIDGET (combo)));
601 + if (GTK_WIDGET_VISIBLE (combo->priv->popup)) {
602 + gtk_widget_hide (combo->priv->toplevel);
604 + gtk_grab_remove (combo->priv->toplevel);
605 + gdk_pointer_ungrab (GDK_CURRENT_TIME);
608 + gtk_combo_popup_reparent (combo->priv->popup,
609 + combo->priv->tearoff_window, FALSE);
611 + /* It may have got confused about size */
612 + gtk_widget_queue_resize (GTK_WIDGET (combo->priv->popup));
614 + if (set_position) {
615 + mygal_combo_box_get_pos (combo, &x, &y);
616 + gtk_widget_set_uposition (combo->priv->tearoff_window, x, y);
618 + gtk_widget_show (GTK_WIDGET (combo->priv->popup));
619 + gtk_widget_show (combo->priv->tearoff_window);
624 + * gtk_combo_set_tearoff_state
625 + * @combo_box: Combo box
626 + * @torn_off: TRUE: Tear off. FALSE: Pop down and reattach
628 + * Set the tearoff state of the popup
630 + * Compare with gtk_menu_set_tearoff_state in gtk/gtkmenu.c
633 +gtk_combo_set_tearoff_state (MygalComboBox *combo,
636 + g_return_if_fail (combo != NULL);
637 + g_return_if_fail (GTK_IS_COMBO_BOX (combo));
639 + if (combo->priv->torn_off != torn_off) {
640 + combo->priv->torn_off = torn_off;
642 + if (combo->priv->torn_off) {
643 + gtk_combo_popup_tear_off (combo, TRUE);
644 + deactivate_arrow (combo);
646 + gtk_widget_hide (combo->priv->tearoff_window);
647 + gtk_combo_popup_reparent (combo->priv->popup,
648 + combo->priv->toplevel,
655 + * gtk_combo_tearoff_bg_copy
656 + * @combo_box: Combo box
658 + * Copy popup window image to the tearoff window.
661 +gtk_combo_tearoff_bg_copy (MygalComboBox *combo)
665 + GdkGCValues gc_values;
667 + GtkWidget *widget = combo->priv->popup;
669 + if (combo->priv->torn_off) {
670 + gc_values.subwindow_mode = GDK_INCLUDE_INFERIORS;
671 + gc = gdk_gc_new_with_values (widget->window,
672 + &gc_values, GDK_GC_SUBWINDOW);
674 + pixmap = gdk_pixmap_new (widget->window,
675 + widget->allocation.width,
676 + widget->allocation.height,
679 + gdk_draw_drawable (pixmap, gc,
681 + 0, 0, 0, 0, -1, -1);
684 + gtk_widget_set_usize (combo->priv->tearoff_window,
685 + widget->allocation.width,
686 + widget->allocation.height);
688 + gdk_window_set_back_pixmap
689 + (combo->priv->tearoff_window->window, pixmap, FALSE);
690 + gdk_drawable_unref (pixmap);
695 + * gtk_combo_popup_reparent
697 + * @new_parent: New parent
698 + * @unrealize: Unrealize popup if TRUE.
700 + * Reparent the popup, taking care of the refcounting
702 + * Compare with gtk_menu_reparent in gtk/gtkmenu.c
705 +gtk_combo_popup_reparent (GtkWidget *popup,
706 + GtkWidget *new_parent,
707 + gboolean unrealize)
709 + GtkObject *object = GTK_OBJECT (popup);
710 + gboolean was_floating = GTK_OBJECT_FLOATING (object);
712 + g_object_ref (object);
713 + gtk_object_sink (object);
716 + g_object_ref (object);
717 + gtk_container_remove (GTK_CONTAINER (popup->parent), popup);
718 + gtk_container_add (GTK_CONTAINER (new_parent), popup);
719 + g_object_unref (object);
722 + gtk_widget_reparent (GTK_WIDGET (popup), new_parent);
723 + gtk_widget_set_usize (new_parent, -1, -1);
726 + GTK_OBJECT_SET_FLAGS (object, GTK_FLOATING);
728 + g_object_unref (object);
732 + * cb_tearable_button_release
735 + * @combo: Combo box
737 + * Toggle tearoff state.
740 +cb_tearable_button_release (GtkWidget *w, GdkEventButton *event,
741 + MygalComboBox *combo)
743 + GtkTearoffMenuItem *tearable;
745 + g_return_val_if_fail (w != NULL, FALSE);
746 + g_return_val_if_fail (GTK_IS_TEAROFF_MENU_ITEM (w), FALSE);
748 + tearable = GTK_TEAROFF_MENU_ITEM (w);
749 + tearable->torn_off = !tearable->torn_off;
751 + if (!combo->priv->torn_off) {
752 + gboolean need_connect;
754 + need_connect = (!combo->priv->tearoff_window);
755 + gtk_combo_set_tearoff_state (combo, TRUE);
757 + g_signal_connect (combo->priv->tearoff_window,
759 + G_CALLBACK (cb_popup_delete),
762 + mygal_combo_box_popup_hide_unconditional (combo);
768 +cb_popup_delete (GtkWidget *w, GdkEventAny *event, MygalComboBox *combo)
770 + mygal_combo_box_popup_hide_unconditional (combo);
775 +mygal_combo_box_construct (MygalComboBox *combo_box, GtkWidget *display_widget, GtkWidget *pop_down_widget)
777 + GtkWidget *tearable;
780 + g_return_if_fail (combo_box != NULL);
781 + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
782 + g_return_if_fail (display_widget != NULL);
783 + g_return_if_fail (GTK_IS_WIDGET (display_widget));
785 + GTK_BOX (combo_box)->spacing = 0;
786 + GTK_BOX (combo_box)->homogeneous = FALSE;
788 + combo_box->priv->pop_down_widget = pop_down_widget;
789 + combo_box->priv->display_widget = NULL;
791 + vbox = gtk_vbox_new (FALSE, 5);
792 + tearable = gtk_tearoff_menu_item_new ();
793 + g_signal_connect (tearable, "enter-notify-event",
794 + G_CALLBACK (cb_tearable_enter_leave),
795 + GINT_TO_POINTER (TRUE));
796 + g_signal_connect (tearable, "leave-notify-event",
797 + G_CALLBACK (cb_tearable_enter_leave),
798 + GINT_TO_POINTER (FALSE));
799 + g_signal_connect (tearable, "button-release-event",
800 + G_CALLBACK (cb_tearable_button_release),
801 + (gpointer) combo_box);
802 + gtk_box_pack_start (GTK_BOX (vbox), tearable, FALSE, FALSE, 0);
803 + gtk_box_pack_start (GTK_BOX (vbox), pop_down_widget, TRUE, TRUE, 0);
804 + combo_box->priv->tearable = tearable;
809 + mygal_combo_box_set_display (combo_box, display_widget);
811 + gtk_container_add (GTK_CONTAINER (combo_box->priv->frame), vbox);
812 + gtk_widget_show_all (combo_box->priv->frame);
816 +mygal_combo_box_new (GtkWidget *display_widget, GtkWidget *optional_popdown)
818 + MygalComboBox *combo_box;
820 + g_return_val_if_fail (display_widget != NULL, NULL);
821 + g_return_val_if_fail (GTK_IS_WIDGET (display_widget), NULL);
823 + combo_box = g_object_new (MYGAL_COMBO_BOX_TYPE, NULL);
824 + mygal_combo_box_construct (combo_box, display_widget, optional_popdown);
825 + return GTK_WIDGET (combo_box);
829 +mygal_combo_box_set_arrow_relief (MygalComboBox *cc, GtkReliefStyle relief)
831 + g_return_if_fail (cc != NULL);
832 + g_return_if_fail (GTK_IS_COMBO_BOX (cc));
834 + gtk_button_set_relief (GTK_BUTTON (cc->priv->arrow_button), relief);
838 + * mygal_combo_box_set_title
839 + * @combo: Combo box
842 + * Set a title to display over the tearoff window.
846 + * This should really change the title even when the popup is already torn off.
847 + * I guess the tearoff window could attach a listener to title change or
848 + * something. But I don't think we need the functionality, so I didn't bother
852 +mygal_combo_box_set_title (MygalComboBox *combo,
853 + const gchar *title)
855 + g_return_if_fail (combo != NULL);
856 + g_return_if_fail (GTK_IS_COMBO_BOX (combo));
858 + g_object_set_data_full (G_OBJECT (combo), "gtk-combo-title",
859 + g_strdup (title), (GDestroyNotify) g_free);
863 + * mygal_combo_box_set_arrow_sensitive
864 + * @combo: Combo box
865 + * @sensitive: Sensitivity value
867 + * Toggle the sensitivity of the arrow button
871 +mygal_combo_box_set_arrow_sensitive (MygalComboBox *combo,
872 + gboolean sensitive)
874 + g_return_if_fail (combo != NULL);
876 + gtk_widget_set_sensitive (combo->priv->arrow_button, sensitive);
880 + * mygal_combo_box_set_tearable:
881 + * @combo: Combo box
882 + * @tearable: whether to allow the @combo to be tearable
884 + * controls whether the combo box's pop up widget can be torn off.
887 +mygal_combo_box_set_tearable (MygalComboBox *combo, gboolean tearable)
889 + g_return_if_fail (combo != NULL);
890 + g_return_if_fail (GTK_IS_COMBO_BOX (combo));
893 + gtk_widget_show (combo->priv->tearable);
895 + gtk_combo_set_tearoff_state (combo, FALSE);
896 + gtk_widget_hide (combo->priv->tearable);
900 diff -urN aa/glabels-1.93.1/src/mygal/mygal-combo-box.h glabels-1.93.1/src/mygal/mygal-combo-box.h
901 --- aa/glabels-1.93.1/src/mygal/mygal-combo-box.h 1970-01-01 01:00:00.000000000 +0100
902 +++ glabels-1.93.1/src/mygal/mygal-combo-box.h 2003-12-28 23:22:19.782365296 +0100
904 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
906 + * mygal-combo-box.h - a customizable combobox
907 + * Copyright 2000, 2001, Ximian, Inc.
910 + * Miguel de Icaza <miguel@ximian.com>
912 + * Modified for gLabels by:
913 + * Jim Evins <evins@snaught.com>
915 + * This library is free software; you can redistribute it and/or
916 + * modify it under the terms of the GNU General Public
917 + * License, version 2, as published by the Free Software Foundation.
919 + * This library is distributed in the hope that it will be useful, but
920 + * WITHOUT ANY WARRANTY; without even the implied warranty of
921 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
922 + * General Public License for more details.
924 + * You should have received a copy of the GNU General Public
925 + * License along with this library; if not, write to the Free Software
926 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
930 +#ifndef _MYGAL_COMBO_BOX_H_
931 +#define _MYGAL_COMBO_BOX_H_
933 +#include <gtk/gtkhbox.h>
937 +#endif /* __cplusplus */
939 +#define MYGAL_COMBO_BOX_TYPE (mygal_combo_box_get_type())
940 +#define MYGAL_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, mygal_combo_box_get_type (), MygalComboBox)
941 +#define MYGAL_COMBO_BOX_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, mygal_combo_box_get_type (), MygalComboBoxClass)
942 +#define GTK_IS_COMBO_BOX(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, mygal_combo_box_get_type ())
944 +typedef struct _MygalComboBox MygalComboBox;
945 +typedef struct _MygalComboBoxPrivate MygalComboBoxPrivate;
946 +typedef struct _MygalComboBoxClass MygalComboBoxClass;
948 +struct _MygalComboBox {
950 + MygalComboBoxPrivate *priv;
953 +struct _MygalComboBoxClass {
954 + GtkHBoxClass parent_class;
956 + GtkWidget *(*pop_down_widget) (MygalComboBox *cbox);
959 + * invoked when the popup has been hidden, if the signal
960 + * returns TRUE, it means it should be killed from the
962 + gboolean *(*pop_down_done) (MygalComboBox *cbox, GtkWidget *);
965 + * Notification signals.
967 + void (*pre_pop_down) (MygalComboBox *cbox);
968 + void (*post_pop_hide) (MygalComboBox *cbox);
971 +GtkType mygal_combo_box_get_type (void);
972 +void mygal_combo_box_construct (MygalComboBox *combo_box,
973 + GtkWidget *display_widget,
974 + GtkWidget *optional_pop_down_widget);
975 +void mygal_combo_box_get_pos (MygalComboBox *combo_box, int *x, int *y);
977 +GtkWidget *mygal_combo_box_new (GtkWidget *display_widget,
978 + GtkWidget *optional_pop_down_widget);
979 +void mygal_combo_box_popup_hide (MygalComboBox *combo_box);
981 +void mygal_combo_box_set_display (MygalComboBox *combo_box,
982 + GtkWidget *display_widget);
984 +void mygal_combo_box_set_title (MygalComboBox *combo,
985 + const gchar *title);
987 +void mygal_combo_box_set_tearable (MygalComboBox *combo,
988 + gboolean tearable);
989 +void mygal_combo_box_set_arrow_sensitive (MygalComboBox *combo,
990 + gboolean sensitive);
991 +void mygal_combo_box_set_arrow_relief (MygalComboBox *cc,
992 + GtkReliefStyle relief);
995 +#endif /* __cplusplus */
997 +#endif /* _MYGAL_COMBO_BOX_H_ */
999 diff -urN aa/glabels-1.93.1/src/mygal/widget-color-combo.c glabels-1.93.1/src/mygal/widget-color-combo.c
1000 --- aa/glabels-1.93.1/src/mygal/widget-color-combo.c 2003-12-16 02:08:49.000000000 +0100
1001 +++ glabels-1.93.1/src/mygal/widget-color-combo.c 2003-12-28 23:33:12.067202928 +0100
1004 static guint color_combo_signals [LAST_SIGNAL] = { 0, };
1006 -#define PARENT_TYPE GTK_COMBO_BOX_TYPE
1007 +#define PARENT_TYPE MYGAL_COMBO_BOX_TYPE
1008 static GObjectClass *color_combo_parent_class;
1010 #define make_color(CC,COL) (((COL) != NULL) ? (COL) : ((CC) ? ((CC)->default_color) : NULL))
1013 color_combo_signals [CHANGED], 0,
1014 color, is_custom, by_user, is_default);
1015 - gtk_combo_box_popup_hide (GTK_COMBO_BOX (cc));
1016 + mygal_combo_box_popup_hide (MYGAL_COMBO_BOX (cc));
1022 cb_cust_color_clicked (GtkWidget *widget, ColorCombo *cc)
1024 - gtk_combo_box_popup_hide (GTK_COMBO_BOX (cc));
1025 + mygal_combo_box_popup_hide (MYGAL_COMBO_BOX (cc));
1029 @@ -255,11 +255,11 @@
1031 gtk_widget_show_all (cc->preview_button);
1033 - gtk_combo_box_construct (GTK_COMBO_BOX (cc),
1034 + mygal_combo_box_construct (MYGAL_COMBO_BOX (cc),
1036 GTK_WIDGET (cc->palette));
1038 - gtk_combo_box_set_tearable (GTK_COMBO_BOX (cc), FALSE);
1039 + mygal_combo_box_set_tearable (MYGAL_COMBO_BOX (cc), FALSE);
1041 color = color_palette_get_current_color (cc->palette, NULL);
1042 color_combo_set_color_internal (cc, color);
1043 diff -urN aa/glabels-1.93.1/src/mygal/widget-color-combo.h glabels-1.93.1/src/mygal/widget-color-combo.h
1044 --- aa/glabels-1.93.1/src/mygal/widget-color-combo.h 2003-10-08 05:28:31.000000000 +0200
1045 +++ glabels-1.93.1/src/mygal/widget-color-combo.h 2003-12-28 23:18:42.952328472 +0100
1047 #define GNUMERIC_WIDGET_COLOR_COMBO_H
1049 #include <gtk/gtkwidget.h>
1050 -#include "gtk-combo-box.h"
1051 +#include "mygal-combo-box.h"
1052 #include "color-palette.h"
1056 typedef struct _ColorCombo {
1057 - GtkComboBox combo_box;
1058 + MygalComboBox combo_box;
1061 * GtkImage where we display
1066 - GtkComboBoxClass parent_class;
1067 + MygalComboBoxClass parent_class;
1069 /* Signals emited by this widget */
1070 void (* color_changed) (ColorCombo *color_combo, GdkColor *color,
1071 diff -urN aa/glabels-1.93.1/src/recent-files/Makefile.am glabels-1.93.1/src/recent-files/Makefile.am
1072 --- aa/glabels-1.93.1/src/recent-files/Makefile.am 2003-10-19 06:10:14.000000000 +0200
1073 +++ glabels-1.93.1/src/recent-files/Makefile.am 2003-12-28 23:27:00.186737352 +0100
1076 - $(GLABELS_CFLAGS) \
1077 - -DG_DISABLE_DEPRECATED \
1078 - -DGDK_DISABLE_DEPRECATED \
1079 - -DGTK_DISABLE_DEPRECATED \
1080 - -DGDK_PIXBUF_DISABLE_DEPRECATED \
1081 - -DGNOME_DISABLE_DEPRECATED
1085 egg-recent-model.c \