Commit 8dfa07101f94dd591b6722708478aea9270a6b76

  • avatar
  • Tristan Van Berkom <vantr @TheB…ly.local>
  • Mon Jun 29 20:57:28 CEST 2009
* configure.ac, gladeui/glade-app.c: Added --enable-mac-bundle configure option to
special case runtime path lookups to bundling builds.

* gladeui/glade-popup.[ch]: Added glade_popup_is_popup_event () to check the correct
GdkEventButton state for a context menu (in a platform independant way).

* gladeui/glade-base-editor.c, gladeui/glade-editor-property.c, gladeui/glade-palette-item.c,
gladeui/glade-placeholder.c, gladeui/glade-widget.c, gladeui/glade-inspector.c: Use new
popup function to detect whether to show a context menu or not (bug 587128).

* gladeui/glade-base-editor.c: Fixed crashes with editable treeview column types (bug 586715).
ChangeLog
(14 / 0)
  
12009-06-29 Tristan Van Berkom <tvb@gnome.org>
2
3 * configure.ac, gladeui/glade-app.c: Added --enable-mac-bundle configure option to
4 special case runtime path lookups to bundling builds.
5
6 * gladeui/glade-popup.[ch]: Added glade_popup_is_popup_event () to check the correct
7 GdkEventButton state for a context menu (in a platform independant way).
8
9 * gladeui/glade-base-editor.c, gladeui/glade-editor-property.c, gladeui/glade-palette-item.c,
10 gladeui/glade-placeholder.c, gladeui/glade-widget.c, gladeui/glade-inspector.c: Use new
11 popup function to detect whether to show a context menu or not (bug 587128).
12
13 * gladeui/glade-base-editor.c: Fixed crashes with editable treeview column types (bug 586715).
14
1152009-06-27 Tristan Van Berkom <tvb@gnome.org>
216
317 * plugins/gtk+/gtk+.xml.in, glade/gtk+/glade-gtk.c: Fixed GtkTextView crashes when
  
11
22common_defines = \
33 -DG_LOG_DOMAIN=\"GladeUI\" \
4 -DGLADE_PREFIX="\"$(prefix)\"" \
54 -DGLADE_DATADIR="\"$(pkgdatadir)\"" \
65 -DGLADE_LIBDIR="\"$(pkglibdir)\"" \
76 -DGLADE_CATALOGSDIR="\"$(pkgdatadir)/catalogs\""\
7575
7676libgladeui_1_la_CFLAGS = \
7777 $(GTK_CFLAGS) \
78 $(IGE_MAC_BUNDLE_FLAG) \
7879 $(IGE_MAC_CFLAGS) \
7980 $(WARN_CFLAGS) \
8081 $(AM_CFLAGS)
  
366366static void
367367build_package_paths (void)
368368{
369#if defined (MAC_INTEGRATION) || defined (G_OS_WIN32)
369#if defined (G_OS_WIN32) || (defined (MAC_INTEGRATION) && defined (MAC_BUNDLE))
370370 gchar *prefix;
371371
372372# ifdef G_OS_WIN32
373373 prefix = g_win32_get_package_installation_directory_of_module (NULL);
374# else /* MAC_INTEGRATION */
374
375# else // defined (MAC_INTEGRATION) && defined (MAC_BUNDLE)
375376 IgeMacBundle *bundle = ige_mac_bundle_get_default ();
376377
377378 prefix = g_build_filename (ige_mac_bundle_get_path (bundle), "Contents", "Resources", NULL);
  
3434#include "glade-editor-property.h"
3535#include "glade-base-editor.h"
3636#include "glade-app.h"
37#include "glade-popup.h"
3738#include "glade-accumulators.h"
3839
3940#include <string.h>
738738 gchar *label;
739739 gchar *class_name;
740740
741 if ((model = get_children_model_for_type (editor, G_OBJECT_TYPE (widget->parent->object))) == NULL)
742 model = get_children_model_for_type (editor, G_OBJECT_TYPE (editor->priv->gcontainer->object));
741743
742 if ((model = get_children_model_for_child_type (editor, G_OBJECT_TYPE (widget->object))) == NULL)
743 return NULL;
744
744 g_assert (model);
745
745746 popup = gtk_menu_new ();
746747
747
748748 if (gtk_tree_model_get_iter_first (model, &iter))
749749 do
750750 {
814814 GtkTreePath *path;
815815 GtkWidget *popup;
816816
817 if (event->button == 3 ||
818 (event->button == 1 &&
819 ((event->state & GDK_MOD1_MASK) != 0 ||
820 (event->state & GDK_MOD2_MASK) != 0 ||
821 (event->state & GDK_MOD2_MASK) != 0)))
817 if (glade_popup_is_popup_event (event))
822818 {
823819 if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview),
824820 (gint) event->x, (gint) event->y, &path, NULL, NULL, NULL))
19601960 GtkWidget *label, *entry;
19611961 GtkTreeModel *child_class;
19621962 GtkCellRenderer *renderer;
1963 GObject *child = glade_widget_get_object (gchild);
1964
1963 GObject *parent, *child;
1964
19651965 g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
19661966 g_return_if_fail (GLADE_IS_WIDGET (gchild));
19671967 g_return_if_fail (GLADE_IS_WIDGET (gchild->parent));
19681968
1969 child_class = get_children_model_for_type (editor, G_OBJECT_TYPE (child));
1969 child = glade_widget_get_object (gchild);
1970 parent = glade_widget_get_object (gchild->parent);
1971
1972 child_class = get_children_model_for_type (editor, G_OBJECT_TYPE (parent));
19701973
19711974 /* Name */
19721975 label = gtk_label_new (_("Name :"));
19811981 g_signal_connect (entry, "focus-out-event", G_CALLBACK (glade_base_editor_name_focus_out), gchild);
19821982 glade_base_editor_table_attach (editor, label, entry);
19831983
1984 if (child_class)
1984 if (child_class && gtk_tree_model_iter_n_children (child_class, NULL) > 1)
19851985 {
19861986 /* Type */
19871987 label = gtk_label_new (_("Type :"));
  
234234 GdkEventButton *event,
235235 GladeEditorProperty *eprop)
236236{
237 if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
237 if (glade_popup_is_popup_event (event))
238238 {
239239 glade_popup_property_pop (eprop->property, event);
240240 return TRUE;
  
920920
921921 /* Give some kind of access in case of missing right button */
922922 if (event->window == gtk_tree_view_get_bin_window (view) &&
923 (event->button == 3 ||
924 (event->button == 1 &&
925 ((event->state & GDK_MOD1_MASK) != 0 ||
926 (event->state & GDK_MOD2_MASK) != 0 ||
927 (event->state & GDK_MOD2_MASK) != 0))))
923 glade_popup_is_popup_event (event))
928924 {
929925 if (gtk_tree_view_get_path_at_pos (view, (gint) event->x, (gint) event->y,
930926 &path, NULL,
  
337337glade_palette_item_button_press (GtkWidget *widget,
338338 GdkEventButton *event)
339339{
340 /* Give some kind of access in case of missing right button */
341 if (!event->type == GDK_BUTTON_PRESS &&
342 (event->button == 3 ||
343 (event->button == 1 &&
344 ((event->state & GDK_MOD1_MASK) != 0 ||
345 (event->state & GDK_MOD2_MASK) != 0 ||
346 (event->state & GDK_MOD2_MASK) != 0))))
340 if (glade_popup_is_popup_event (event))
347341 {
348342 GladePaletteItemPrivate *priv = GLADE_PALETTE_ITEM_GET_PRIVATE (widget);
349343
350344 glade_popup_palette_pop (priv->adaptor, event);
345 return TRUE;
351346 }
352347
353348 return GTK_WIDGET_CLASS (glade_palette_item_parent_class)->button_press_event (widget, event);
  
357357 }
358358 }
359359
360 /* Give some kind of access in case of missing right button */
361 if (!handled && event->type == GDK_BUTTON_PRESS &&
362 (event->button == 3 ||
363 (event->button == 1 &&
364 ((event->state & GDK_MOD1_MASK) != 0 ||
365 (event->state & GDK_MOD2_MASK) != 0 ||
366 (event->state & GDK_MOD2_MASK) != 0))))
360 if (!handled && glade_popup_is_popup_event (event))
367361 {
368362 glade_popup_placeholder_pop (placeholder, event);
369363 handled = TRUE;
  
1818 *
1919 * Authors:
2020 * Chema Celorio <chema@celorio.com>
21 * Tristan Van Berkom <tvb@gnome.org>
2122 */
2223
2324#ifdef HAVE_CONFIG_H
796796 }
797797 gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL,
798798 NULL, NULL, button, event_time);
799}
800
801gboolean
802glade_popup_is_popup_event (GdkEventButton *event)
803{
804 g_return_val_if_fail (event, FALSE);
805
806#ifdef MAC_INTEGRATION
807 return (event->type == GDK_BUTTON_PRESS && event->button == 1 && ((event->state & GDK_MOD1_MASK) != 0));
808#else
809 return (event->type == GDK_BUTTON_PRESS && event->button == 3);
810#endif
799811}
  
2727void glade_popup_property_pop (GladeProperty *property,
2828 GdkEventButton *event);
2929
30
31gboolean glade_popup_is_popup_event (GdkEventButton *event);
32
3033G_END_DECLS
3134
3235#endif /* __GLADE_POPUP_H__ */
  
905905 }
906906 g_list_free (read_properties);
907907
908
909908 /* Read in the signals */
910909 for (iter_node = glade_xml_node_get_children (node);
911910 iter_node; iter_node = glade_xml_node_next (iter_node))
  
335335 }
336336
337337 /* Give some kind of access in case of missing right button */
338 if (!handled &&
339 (event->button == 3 ||
340 (event->button == 1 &&
341 ((event->state & GDK_MOD1_MASK) != 0 ||
342 (event->state & GDK_MOD2_MASK) != 0 ||
343 (event->state & GDK_MOD2_MASK) != 0))))
338 if (!handled && glade_popup_is_popup_event (event))
344339 {
345340 glade_popup_widget_pop (gwidget, event, TRUE);
346341 handled = TRUE;