summaryrefslogtreecommitdiff
path: root/packages/gtk+
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2006-01-02 11:51:02 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-01-02 11:51:02 +0000
commitd3a7762c27e2e950dbe36e61fc167297e6b3c81b (patch)
tree9f0d924054d64b50e347f726d22951f0e881dbe7 /packages/gtk+
parent6e73566974c579e20485cd50aea9d696bfb65c56 (diff)
gtk+ 2.6.10: add patch to enable help support, courtesy Florian Boor
Diffstat (limited to 'packages/gtk+')
-rw-r--r--packages/gtk+/gtk+-2.6.10/help.patch158
-rw-r--r--packages/gtk+/gtk+_2.6.10.bb3
2 files changed, 160 insertions, 1 deletions
diff --git a/packages/gtk+/gtk+-2.6.10/help.patch b/packages/gtk+/gtk+-2.6.10/help.patch
new file mode 100644
index 0000000000..268b3dd9e2
--- /dev/null
+++ b/packages/gtk+/gtk+-2.6.10/help.patch
@@ -0,0 +1,158 @@
+diff -NaurBb gtk+-2.6.10.old/gtk/Makefile.am gtk+-2.6.10/gtk/Makefile.am
+--- gtk+-2.6.10.old/gtk/Makefile.am 2005-08-18 16:10:56.000000000 +0200
++++ gtk+-2.6.10/gtk/Makefile.am 2005-12-29 01:23:52.000000000 +0100
+@@ -520,6 +520,7 @@
+ gtkwidget.c \
+ gtkwindow-decorate.c \
+ gtkwindow.c \
++ gpe-what.c \
+ xembed.h
+
+ if OS_UNIX
+diff -NaurBb gtk+-2.6.10.old/gtk/gpe-what.c gtk+-2.6.10/gtk/gpe-what.c
+--- gtk+-2.6.10.old/gtk/gpe-what.c 1970-01-01 01:00:00.000000000 +0100
++++ gtk+-2.6.10/gtk/gpe-what.c 2005-12-29 00:59:26.000000000 +0100
+@@ -0,0 +1,130 @@
++/*
++ * Copyright (C) 2002, 2003 Philip Blundell <philb@gnu.org>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ */
++
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++
++#include <X11/Xlib.h>
++#include <X11/Xatom.h>
++
++#ifdef GDK_WINDOWING_X11
++#error X11 required
++#endif
++
++#include "gtkwidget.h"
++#include "gtktooltips.h"
++#include "x11/gdkx.h"
++#include "config.h"
++
++#include <libintl.h>
++
++#define _(x) dgettext(GETTEXT_PACKAGE, x)
++
++static GdkAtom help_atom;
++static gboolean gpe_what_initialised;
++
++static GSList *widgets;
++
++static void
++send_text (Display *dpy, Window w, char *text)
++{
++ Atom help_xatom = gdk_x11_atom_to_xatom (help_atom);
++
++ gdk_error_trap_push ();
++
++ XChangeProperty (dpy, w, help_xatom, XA_STRING, 8, PropModeReplace, text, strlen (text));
++
++ XFlush (dpy);
++
++ gdk_error_trap_pop ();
++}
++
++static GdkFilterReturn
++filter_func (GdkXEvent *xev, GdkEvent *ev, gpointer p)
++{
++ XClientMessageEvent *xc = (XClientMessageEvent *)xev;
++ GSList *list;
++ Window sender = xc->data.l[0];
++
++ for (list = widgets; list; list = list->next)
++ {
++ GtkWidget *widget = GTK_WIDGET (list->data);
++ int x = xc->data.l[1], y = xc->data.l[2];
++ int ax, ay;
++
++ if (!GTK_WIDGET_DRAWABLE (widget)) continue;
++
++ if (GTK_WIDGET_NO_WINDOW (widget))
++ {
++ ax = widget->allocation.x;
++ ay = widget->allocation.y;
++ }
++ else
++ {
++ ax = 0;
++ ay = 0;
++ }
++
++ if (widget->window == ev->any.window
++ && x >= ax && x < ax + widget->allocation.width
++ && y >= ay && y < ay + widget->allocation.height)
++ {
++ GtkTooltipsData *data = gtk_tooltips_data_get (widget);
++ if (data)
++ {
++ send_text (GDK_WINDOW_XDISPLAY (widget->window), sender,
++ data->tip_private ? data->tip_private : data->tip_text);
++ return GDK_FILTER_CONTINUE;
++ }
++ }
++ }
++
++ send_text (GDK_WINDOW_XDISPLAY (ev->any.window), sender, _("No help available."));
++
++ return GDK_FILTER_CONTINUE;
++}
++
++void
++gpe_what_mark_widget (GtkWidget *widget)
++{
++ if (!gpe_what_initialised)
++ {
++ help_atom = gdk_atom_intern ("_GPE_INTERACTIVE_HELP", FALSE);
++
++ gdk_add_client_message_filter (help_atom, filter_func, NULL);
++
++ gpe_what_initialised = TRUE;
++ }
++
++ if (widget->window)
++ {
++ widgets = g_slist_prepend (widgets, widget);
++
++ gdk_property_change (widget->window,
++ help_atom,
++ help_atom,
++ 8,
++ GDK_PROP_MODE_REPLACE,
++ NULL,
++ 0);
++ }
++ else
++ abort ();
++}
+diff -NaurBb gtk+-2.6.10.old/gtk/gtkwidget.c gtk+-2.6.10/gtk/gtkwidget.c
+--- gtk+-2.6.10.old/gtk/gtkwidget.c 2005-08-18 16:10:59.000000000 +0200
++++ gtk+-2.6.10/gtk/gtkwidget.c 2005-12-29 00:59:26.000000000 +0100
+@@ -2285,6 +2285,9 @@
+
+ g_signal_emit (widget, widget_signals[REALIZE], 0);
+
++ extern void gpe_what_mark_widget (GtkWidget *widget);
++ gpe_what_mark_widget (widget);
++
+ if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
+ {
+ shape_info = g_object_get_qdata (G_OBJECT (widget), quark_shape_info);
diff --git a/packages/gtk+/gtk+_2.6.10.bb b/packages/gtk+/gtk+_2.6.10.bb
index 2e81792799..eaf55f7f51 100644
--- a/packages/gtk+/gtk+_2.6.10.bb
+++ b/packages/gtk+/gtk+_2.6.10.bb
@@ -6,9 +6,10 @@ SECTION = "libs"
PRIORITY = "optional"
MAINTAINER = "Philip Blundell <pb@handhelds.org>"
DEPENDS = "glib-2.0 pango atk jpeg libpng xext libxcursor gtk-doc libgcrypt"
-PR = "r1"
+PR = "r2"
SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.6/gtk+-${PV}.tar.bz2 \
+ file://help.patch;patch=1 \
file://no-demos.patch;patch=1 \
file://no-xwc.patch;patch=1 \
file://automake-lossage.patch;patch=1 \