diff options
author | Previdi Roberto <previdi.roberto@gmail.com> | 2009-04-28 10:51:39 +0000 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2009-05-19 09:54:07 +0200 |
commit | 04e583d2be81fd42f36bb79eb7b3d64ab8deaf99 (patch) | |
tree | 208f61574878674bb4c96e2589b5e4202ce0101e /recipes/gnome | |
parent | 26b65117eb91d94ec1d4e6546eeefa90f0be7090 (diff) |
zenity package
Please ignore my previous zenity patches. I collected all in one
single patch this time so it should be more handy to use.
The package zenity allows to use powerful graphic dialogs from the
shell or scripts without effort. I added some patches to build fine
(makefile.patch and no-gnome-doc.patch) and one patch to add a little
but handy feature, fingerscroll.patch. it add the capability to the
list dialogs of being scrolled dragging them with finger or pen (on
touchscreens) or mouse (on desktop).
The package has got some gnome dependencies (libgnomecanvas) and the
tar.bz2 get downloaded from the gnome ftp, but i used inherit
autotools because setting inherit gnome breaks the build for me.. i
don't know how but some /usr/include path sneak into the CFLAGS making
the cross compiler complain.
Please tell me if there is any problem or i forgot something..
Diffstat (limited to 'recipes/gnome')
-rw-r--r-- | recipes/gnome/zenity/fingerscroll.patch | 102 | ||||
-rw-r--r-- | recipes/gnome/zenity/makefile.patch | 13 | ||||
-rw-r--r-- | recipes/gnome/zenity/no-gnome-doc.patch | 69 |
3 files changed, 184 insertions, 0 deletions
diff --git a/recipes/gnome/zenity/fingerscroll.patch b/recipes/gnome/zenity/fingerscroll.patch new file mode 100644 index 0000000000..785d179f03 --- /dev/null +++ b/recipes/gnome/zenity/fingerscroll.patch @@ -0,0 +1,102 @@ +diff --git a/src/tree.c b/src/tree.c +index 6dd3f64..32e4826 100644 +--- a/src/tree.c ++++ b/src/tree.c +@@ -46,6 +46,9 @@ static gboolean zenity_tree_column_is_hidden (gint column_index); + static void zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data); + static void zenity_tree_row_activated (GtkTreeView *tree_view, GtkTreePath *tree_path, + GtkTreeViewColumn *tree_col, gpointer data); ++static void zenity_tree_drag_start (GtkWidget *widget, GdkEventButton *event, gpointer data); ++static void zenity_tree_drag (GtkWidget *widget, GdkEventMotion *event, gpointer data); ++static void zenity_tree_drag_stop (GtkWidget *widget, GdkEventButton *event, gpointer data); + + static gboolean + zenity_tree_dialog_untoggle (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +@@ -353,7 +356,12 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data) + if (!(tree_data->radiobox || tree_data->checkbox)) + g_signal_connect (G_OBJECT (tree_view), "row-activated", + G_CALLBACK (zenity_tree_row_activated), data); +- ++ ++ /* Connect drag-drop signals for finger scrolling */ ++ tree_data->is_scrolling=FALSE; ++ g_signal_connect (G_OBJECT (tree_view), "motion-notify-event", ++ G_CALLBACK (zenity_tree_drag), tree_data); ++ + /* Create an empty list store */ + model = g_object_new (GTK_TYPE_LIST_STORE, NULL); + +@@ -685,3 +693,56 @@ zenity_tree_extract_column_indexes (char *indexes, int n_columns) + + return result; + } ++void ++zenity_tree_drag_start (GtkWidget *widget, GdkEventButton *event, gpointer data) ++{ ++ ZenityTreeData *zen_data=data; ++ zen_data->is_scrolling=TRUE; ++ zen_data->start_scroll_x=event->x; ++ zen_data->start_scroll_y=event->y; ++ ++ GtkTreeView *tree_view=GTK_TREE_VIEW(widget); ++ zen_data->start_scroll_v_adjustment= ++ gtk_adjustment_get_value (gtk_tree_view_get_vadjustment(tree_view)); ++ zen_data->start_scroll_h_adjustment= ++ gtk_adjustment_get_value (gtk_tree_view_get_hadjustment(tree_view)); ++ zen_data->last_scroll_time=event->time; ++} ++ ++void ++zenity_tree_drag (GtkWidget *widget, GdkEventMotion *event, gpointer data) ++{ ++ ZenityTreeData *zen_data=data; ++ ++ if ((event->state & GDK_BUTTON1_MASK) && ++ (event->time-zen_data->last_scroll_time>50)) ++ { ++ if (!zen_data->is_scrolling) ++ zenity_tree_drag_start(widget,event,data) ; ++ ++ ++ gint dy=event->y-zen_data->start_scroll_y; ++ gint dx=event->x-zen_data->start_scroll_x; ++ ++ GtkTreeView *tree_view=GTK_TREE_VIEW(widget); ++ GtkAdjustment *vAdjustment = gtk_tree_view_get_vadjustment(tree_view); ++ GtkAdjustment *hAdjustment = gtk_tree_view_get_hadjustment(tree_view); ++ gtk_adjustment_set_value (vAdjustment, ++ CLAMP (zen_data->start_scroll_v_adjustment-dy, ++ vAdjustment->lower, ++ vAdjustment->upper - vAdjustment->page_size)); ++ gtk_adjustment_set_value (hAdjustment, ++ CLAMP (zen_data->start_scroll_h_adjustment-dx, ++ hAdjustment->lower, ++ hAdjustment->upper - hAdjustment->page_size)); ++ zen_data->last_scroll_time=event->time; ++ } ++ if (zen_data->is_scrolling && !(event->state & GDK_BUTTON1_MASK)) ++ zenity_tree_drag_stop(widget,event,data); ++} ++void ++zenity_tree_drag_stop (GtkWidget *widget, GdkEventButton *event, gpointer data) ++{ ++ ZenityTreeData *zen_data=data; ++ zen_data->is_scrolling=FALSE; ++} +diff --git a/src/zenity.h b/src/zenity.h +index ac6c4f8..d40d8df 100644 +--- a/src/zenity.h ++++ b/src/zenity.h +@@ -113,6 +113,12 @@ typedef struct { + gboolean editable; + gchar *print_column; + gchar *hide_column; ++ gint start_scroll_x; ++ gint start_scroll_y; ++ gdouble start_scroll_v_adjustment; ++ gdouble start_scroll_h_adjustment; ++ gboolean is_scrolling; ++ guint32 last_scroll_time; + const gchar **data; + } ZenityTreeData; + diff --git a/recipes/gnome/zenity/makefile.patch b/recipes/gnome/zenity/makefile.patch new file mode 100644 index 0000000000..9bdd5dd08e --- /dev/null +++ b/recipes/gnome/zenity/makefile.patch @@ -0,0 +1,13 @@ +diff -c -r patcher_original/zenity-2.20.1/src/Makefile.am zenity-2.20.1/src/Makefile.am +*** patcher_original/zenity-2.20.1/src/Makefile.am Mon Nov 26 22:57:40 2007 +--- zenity-2.20.1/src/Makefile.am Thu Apr 2 00:31:39 2009 +*************** +*** 21,27 **** + zenity.h + + zenity_CPPFLAGS = \ +- -I$(includedir) \ + -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ + -DZENITY_DATADIR=\""$(pkgdatadir)"\" \ + $(AM_CPPFLAGS) +--- 21,26 ---- diff --git a/recipes/gnome/zenity/no-gnome-doc.patch b/recipes/gnome/zenity/no-gnome-doc.patch new file mode 100644 index 0000000000..6b2e2bd4b8 --- /dev/null +++ b/recipes/gnome/zenity/no-gnome-doc.patch @@ -0,0 +1,69 @@ +*** patcher_original/zenity-2.20.1/configure.in 2007-11-26 22:57:45.000000000 +0100 +--- zenity-2.20.1/configure.in 2009-04-10 23:08:11.000000000 +0200 +*************** +*** 8,14 **** + AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip]) + + GNOME_COMMON_INIT +! GNOME_DOC_INIT + + AM_MAINTAINER_MODE + +--- 8,14 ---- + AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip]) + + GNOME_COMMON_INIT +! #GNOME_DOC_INIT + + AM_MAINTAINER_MODE + +*** patcher_original/zenity-2.20.1/Makefile.am 2007-11-26 22:57:45.000000000 +0100 +--- zenity-2.20.1/Makefile.am 2009-04-10 23:30:20.000000000 +0200 +*************** +*** 1,8 **** + SUBDIRS = \ + src \ + po \ +! data \ +! help + + EXTRA_DIST = \ + autogen.sh \ +--- 1,8 ---- + SUBDIRS = \ + src \ + po \ +! data +! # help + + EXTRA_DIST = \ + autogen.sh \ +*************** +*** 16,28 **** + ChangeLog \ + NEWS \ + README \ +! AUTHORS \ +! gnome-doc-utils.make + + DISTCLEANFILES = \ + intltool-extract \ + intltool-merge \ +! intltool-update \ +! gnome-doc-utils.make + + DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper +--- 16,28 ---- + ChangeLog \ + NEWS \ + README \ +! AUTHORS +! # gnome-doc-utils.make + + DISTCLEANFILES = \ + intltool-extract \ + intltool-merge \ +! intltool-update +! # gnome-doc-utils.make + + DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper |