Add gtk+, avahi, dbus-0.34 (.36 coming soon) and dependencies. Fix x11-common breakage.

git-svn-id: https://svn.o-hand.com/repos/poky@13 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Richard Purdie 2005-09-02 11:50:01 +00:00
parent 7755d9d194
commit 95efeafc86
164 changed files with 30609 additions and 3 deletions

View File

@ -47,8 +47,8 @@ include conf/distro/preferred-opie-versions.inc
# GPE
#
PREFERRED_PROVIDERS += "virtual/xserver:xserver-kdrive"
#PREFERRED_PROVIDER_x11 = "diet-x11"
PREFERRED_PROVIDER_x11 = "x11"
PREFERRED_PROVIDER_x11 = "diet-x11"
#PREFERRED_PROVIDER_x11 = "x11"
include conf/distro/preferred-gpe-versions-2.7.inc
#

View File

@ -0,0 +1,21 @@
DEPENDS = "glib-2.0 gtk-doc"
DESCRIPTION = "An accessibility toolkit for GNOME."
SECTION = "x11/libs"
PRIORITY = "optional"
MAINTAINER = "Philip Blundell <pb@handhelds.org>"
LICENSE = "LGPL"
SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.8/atk-${PV}.tar.bz2"
inherit autotools pkgconfig
EXTRA_OECONF = "--disable-glibtest"
CFLAGS_append = " -I${STAGING_INCDIR}/glib-2.0 \
-I${STAGING_INCDIR}/glib-2.0/glib \
-I${STAGING_INCDIR}/glib-2.0/gobject"
do_stage () {
oe_libinstall -so -C atk libatk-1.0 ${STAGING_LIBDIR}
autotools_stage_includes
}

View File

@ -0,0 +1,47 @@
DESCRIPTION = "Avahi implements the DNS-SD over Multicast DNS"
HOMEPAGE = "http://www.freedesktop.org/Software/Avahi"
LICENCE= "GPL"
DEPENDS = "expat libdaemon dbus-0.34"
RRECOMMENDS = "libnss-mdns"
SECTION = "net"
PRIORITY = "optional"
SRC_URI = "http://www.freedesktop.org/~lennart/avahi-${PV}.tar.gz"
# file://no-strict-ansi.patch;patch=1"
PACKAGES = "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-dev avahi-doc"
FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
FILES_libavahi-core= "${libdir}/libavahi-core.so.*"
FILES_avahi-daemon = "${sbindir}/avahi-daemon \
${sysconfdir}/avahi/avahi-daemon.conf \
${sysconfdir}/avahi/services \
${sysconfdir}/dbus-1 \
${sysconfdir}/init.d/avahi-daemon \
${datadir}/avahi/introspection/*.introspect \
${datadir}/avahi/avahi-service.dtd"
FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
${sysconfdir}/avahi/avahi-dnsconfd.action \
${sysconfdir}/init.d/avahi-dnsconfd"
FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
EXTRA_OECONF = "--with-distro=debian --disable-gtk --disable-python"
inherit autotools
inherit update-rc.d
INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
pkg_postinst_avahi-daemon () {
grep avahi /etc/passwd || adduser --disabled-password --system --home /var/run/avahi-daemon avahi
}
pkg_postrm_avahi-daemon () {
deluser avahi || true
}

View File

@ -0,0 +1,16 @@
include dbus_${PV}.inc
SRC_URI_EXTRA=""
inherit native
S = "${WORKDIR}/dbus-${PV}"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/dbus"
DEPENDS = "glib-2.0-native"
do_stage() {
install -d ${STAGING_DATADIR}/dbus
install -m 0644 tools/dbus-bus-introspect.xml ${STAGING_DATADIR}/dbus
install -m 0644 tools/dbus-glib-bindings.h ${STAGING_DATADIR}/dbus
}

View File

@ -0,0 +1,308 @@
diff -ur dbus-0.23/ChangeLog dbus-0.23.1/ChangeLog
--- dbus-0.23/ChangeLog 2005-01-13 00:48:43.000000000 +0200
+++ dbus-0.23.1/ChangeLog 2005-02-11 20:25:48.000000000 +0200
@@ -1,3 +1,33 @@
+2005-02-11 Joe Shaw <joeshaw@novell.com>
+
+ * NEWS: Update for 0.23.1
+
+ * configure.in: Release 0.23.1
+
+2005-02-10 Joe Shaw <joeshaw@novell.com>
+
+ * dbus/dbus-connection.c
+ (_dbus_connection_queue_received_message_link,
+ _dbus_connection_message_sent): Add the path to
+ the verbose output.
+ (_dbus_connection_send_preallocated_and_unlock): Added. Calls
+ _dbus_connection_send_preallocated_unlocked(), updated the
+ dispatch status, and unlocks. Fixes a bug where certain
+ situations (like a broken pipe) could cause a Disconnect message
+ to not be sent, tricking the bus into thinking a service was still
+ there when the process had quit.
+ (_dbus_connection_send_preallocated): Call
+ _dbus_connection_send_preallocated_and_unlock().
+ (_dbus_connection_send_and_unlock): Added. Calls
+ _dbus_connection_send_preallocated_and_unlock().
+ (dbus_connection_send): Call _dbus_connection_send_and_unlock().
+ (dbus_connection_send_with_reply): Update the dispatch status and
+ unlock.
+
+ * mono/Service.cs (~Service): Added. Removes the filter so that
+ we don't get unmanaged code calling back into a GCed delegate.
+ (RemoveFilter); Added.
+
2005-01-12 Joe Shaw <joeshaw@novell.com>
* NEWS: Update for 0.23.
diff -ur dbus-0.23/NEWS dbus-0.23.1/NEWS
--- dbus-0.23/NEWS 2005-01-13 00:20:40.000000000 +0200
+++ dbus-0.23.1/NEWS 2005-02-11 20:25:16.000000000 +0200
@@ -1,3 +1,11 @@
+D-BUS 0.23.1 (11 Feb 2005)
+===
+- fix a bug in which the bus daemon wouldn't recognize that a service
+ owner quit
+- fix a bug in the mono bindings that would cause unmanaged code to
+ call back into a delegate that had been garbage collected and
+ crashed.
+
D-BUS 0.23 (11 Jan 2005)
===
diff -ur dbus-0.23/configure dbus-0.23.1/configure
--- dbus-0.23/configure 2005-01-13 00:21:25.000000000 +0200
+++ dbus-0.23.1/configure 2005-02-11 19:53:33.000000000 +0200
@@ -1826,7 +1826,7 @@
# Define the identity of the package.
PACKAGE=dbus
- VERSION=0.23
+ VERSION=0.23.1
cat >>confdefs.h <<_ACEOF
diff -ur dbus-0.23/configure.in dbus-0.23.1/configure.in
--- dbus-0.23/configure.in 2005-01-13 00:20:40.000000000 +0200
+++ dbus-0.23.1/configure.in 2005-02-11 19:53:09.000000000 +0200
@@ -3,7 +3,7 @@
AC_INIT(dbus/dbus.h)
-AM_INIT_AUTOMAKE(dbus, 0.23)
+AM_INIT_AUTOMAKE(dbus, 0.23.1)
AM_CONFIG_HEADER(config.h)
diff -ur dbus-0.23/dbus/dbus-connection.c dbus-0.23.1/dbus/dbus-connection.c
--- dbus-0.23/dbus/dbus-connection.c 2005-01-11 21:31:56.000000000 +0200
+++ dbus-0.23.1/dbus/dbus-connection.c 2005-02-11 19:52:47.000000000 +0200
@@ -358,9 +358,10 @@
_dbus_connection_wakeup_mainloop (connection);
- _dbus_verbose ("Message %p (%d %s %s '%s') added to incoming queue %p, %d incoming\n",
+ _dbus_verbose ("Message %p (%d %s %s %s '%s') added to incoming queue %p, %d incoming\n",
message,
dbus_message_get_type (message),
+ dbus_message_get_path (message),
dbus_message_get_interface (message) ?
dbus_message_get_interface (message) :
"no interface",
@@ -473,9 +474,10 @@
connection->n_outgoing -= 1;
- _dbus_verbose ("Message %p (%d %s %s '%s') removed from outgoing queue %p, %d left to send\n",
+ _dbus_verbose ("Message %p (%d %s %s %s '%s') removed from outgoing queue %p, %d left to send\n",
message,
dbus_message_get_type (message),
+ dbus_message_get_path (message),
dbus_message_get_interface (message) ?
dbus_message_get_interface (message) :
"no interface",
@@ -1572,9 +1574,10 @@
}
#endif
- _dbus_verbose ("Message %p (%d %s %s '%s') added to outgoing queue %p, %d pending to send\n",
+ _dbus_verbose ("Message %p (%d %s %s %s '%s') added to outgoing queue %p, %d pending to send\n",
message,
dbus_message_get_type (message),
+ dbus_message_get_path (message),
dbus_message_get_interface (message) ?
dbus_message_get_interface (message) :
"no interface",
@@ -1606,12 +1609,30 @@
_dbus_connection_do_iteration (connection,
DBUS_ITERATION_DO_WRITING,
-1);
-
+
/* If stuff is still queued up, be sure we wake up the main loop */
if (connection->n_outgoing > 0)
_dbus_connection_wakeup_mainloop (connection);
}
+static void
+_dbus_connection_send_preallocated_and_unlock (DBusConnection *connection,
+ DBusPreallocatedSend *preallocated,
+ DBusMessage *message,
+ dbus_uint32_t *client_serial)
+{
+ DBusDispatchStatus status;
+
+ _dbus_connection_send_preallocated_unlocked (connection,
+ preallocated,
+ message, client_serial);
+
+ status = _dbus_connection_get_dispatch_status_unlocked (connection);
+
+ /* this calls out to user code */
+ _dbus_connection_update_dispatch_status_and_unlock (connection, status);
+}
+
/**
* Sends a message using preallocated resources. This function cannot fail.
* It works identically to dbus_connection_send() in other respects.
@@ -1642,10 +1663,9 @@
dbus_message_get_member (message) != NULL));
CONNECTION_LOCK (connection);
- _dbus_connection_send_preallocated_unlocked (connection,
- preallocated,
- message, client_serial);
- CONNECTION_UNLOCK (connection);
+ _dbus_connection_send_preallocated_and_unlock (connection,
+ preallocated,
+ message, client_serial);
}
static dbus_bool_t
@@ -1670,6 +1690,27 @@
return TRUE;
}
+static dbus_bool_t
+_dbus_connection_send_and_unlock (DBusConnection *connection,
+ DBusMessage *message,
+ dbus_uint32_t *client_serial)
+{
+ DBusPreallocatedSend *preallocated;
+
+ _dbus_assert (connection != NULL);
+ _dbus_assert (message != NULL);
+
+ preallocated = _dbus_connection_preallocate_send_unlocked (connection);
+ if (preallocated == NULL)
+ return FALSE;
+
+ _dbus_connection_send_preallocated_and_unlock (connection,
+ preallocated,
+ message,
+ client_serial);
+ return TRUE;
+}
+
/**
* Adds a message to the outgoing message queue. Does not block to
* write the message to the network; that happens asynchronously. To
@@ -1698,14 +1739,9 @@
CONNECTION_LOCK (connection);
- if (!_dbus_connection_send_unlocked (connection, message, client_serial))
- {
- CONNECTION_UNLOCK (connection);
- return FALSE;
- }
-
- CONNECTION_UNLOCK (connection);
- return TRUE;
+ return _dbus_connection_send_and_unlock (connection,
+ message,
+ client_serial);
}
static dbus_bool_t
@@ -1784,6 +1820,7 @@
DBusMessage *reply;
DBusList *reply_link;
dbus_int32_t serial = -1;
+ DBusDispatchStatus status;
_dbus_return_val_if_fail (connection != NULL, FALSE);
_dbus_return_val_if_fail (message != NULL, FALSE);
@@ -1845,8 +1882,11 @@
else
dbus_pending_call_unref (pending);
- CONNECTION_UNLOCK (connection);
-
+ status = _dbus_connection_get_dispatch_status_unlocked (connection);
+
+ /* this calls out to user code */
+ _dbus_connection_update_dispatch_status_and_unlock (connection, status);
+
return TRUE;
error:
@@ -2256,9 +2296,10 @@
link = _dbus_list_pop_first_link (&connection->incoming_messages);
connection->n_incoming -= 1;
- _dbus_verbose ("Message %p (%d %s %s '%s') removed from incoming queue %p, %d incoming\n",
+ _dbus_verbose ("Message %p (%d %s %s %s '%s') removed from incoming queue %p, %d incoming\n",
link->data,
dbus_message_get_type (link->data),
+ dbus_message_get_path (link->data),
dbus_message_get_interface (link->data) ?
dbus_message_get_interface (link->data) :
"no interface",
diff -ur dbus-0.23/mono/Service.cs dbus-0.23.1/mono/Service.cs
--- dbus-0.23/mono/Service.cs 2004-08-31 06:59:14.000000000 +0300
+++ dbus-0.23.1/mono/Service.cs 2005-02-11 19:52:47.000000000 +0200
@@ -23,6 +23,9 @@
private static AssemblyBuilder proxyAssembly;
private ModuleBuilder module = null;
+ // Add a match for signals. FIXME: Can we filter the service?
+ private const string MatchRule = "type='signal'";
+
internal Service(string name, Connection connection)
{
this.name = name;
@@ -47,6 +50,12 @@
this.local = true;
}
+ ~Service ()
+ {
+ if (this.filterCalled != null)
+ RemoveFilter ();
+ }
+
public static bool Exists(Connection connection, string name)
{
Error error = new Error();
@@ -113,9 +122,17 @@
IntPtr.Zero))
throw new OutOfMemoryException();
- // Add a match for signals. FIXME: Can we filter the service?
- string rule = "type='signal'";
- dbus_bus_add_match(connection.RawConnection, rule, IntPtr.Zero);
+ dbus_bus_add_match(connection.RawConnection, MatchRule, IntPtr.Zero);
+ }
+
+ private void RemoveFilter()
+ {
+ dbus_connection_remove_filter (Connection.RawConnection,
+ this.filterCalled,
+ IntPtr.Zero);
+ this.filterCalled = null;
+
+ dbus_bus_remove_match (connection.RawConnection, MatchRule, IntPtr.Zero);
}
private int Service_FilterCalled(IntPtr rawConnection,
@@ -200,9 +217,19 @@
IntPtr freeData);
[DllImport("dbus-1")]
+ private extern static void dbus_connection_remove_filter(IntPtr rawConnection,
+ DBusHandleMessageFunction filter,
+ IntPtr userData);
+
+ [DllImport("dbus-1")]
private extern static void dbus_bus_add_match(IntPtr rawConnection,
string rule,
IntPtr erro);
+ [DllImport("dbus-1")]
+ private extern static void dbus_bus_remove_match(IntPtr rawConnection,
+ string rule,
+ IntPtr erro);
+
}
}

View File

@ -0,0 +1,17 @@
Only in /home/kihamala/svn/dbus/bus: .svn
diff -ur bus/session.conf.in /home/kihamala/svn/dbus/bus/session.conf.in
--- bus/session.conf.in 2004-10-25 21:48:58.000000000 +0300
+++ /home/kihamala/svn/dbus/bus/session.conf.in 2005-02-15 11:03:26.000000000 +0200
@@ -8,9 +8,10 @@
<!-- Our well-known bus type, don't change this -->
<type>session</type>
- <listen>unix:tmpdir=@DBUS_SESSION_SOCKET_DIR@</listen>
+ <listen>unix:path=/tmp/session_bus_socket</listen>
- <servicedir>@EXPANDED_DATADIR@/dbus-1/services</servicedir>
+ <servicedir>@EXPANDED_LIBDIR@/dbus-1.0/services</servicedir>
+ <!-- <servicedir>/var/lib/install/usr/lib/dbus-1.0/services</servicedir> -->
<policy context="default">
<!-- Allow everything to be sent -->

View File

@ -0,0 +1,15 @@
#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#
--- dbus-0.20/configure.in~cross
+++ dbus-0.20/configure.in
@@ -466,6 +466,7 @@
exit (0);
]])],
[have_abstract_sockets=yes],
+ [have_abstract_sockets=no],
[have_abstract_sockets=no])
AC_LANG_POP(C)
AC_MSG_RESULT($have_abstract_sockets)

View File

@ -0,0 +1,86 @@
#! /bin/sh
# -*- coding: utf-8 -*-
# Debian init.d script for D-BUS
# Copyright © 2003 Colin Walters <walters@debian.org>
set -e
DAEMON=/usr/bin/dbus-daemon-1
NAME=dbus-1
DAEMONUSER=messagebus
PIDDIR=/var/run/dbus
PIDFILE=$PIDDIR/pid
DESC="system message bus"
EVENTDIR=/etc/dbus-1/event.d
test -x $DAEMON || exit 0
# Source defaults file; edit that file to configure this script.
ENABLED=1
PARAMS=""
if [ -e /etc/default/dbus-1 ]; then
. /etc/default/dbus-1
fi
test "$ENABLED" != "0" || exit 0
start_it_up()
{
if [ ! -d $PIDDIR ]; then
mkdir -p $PIDDIR
chown $DAEMONUSER $PIDDIR
chgrp $DAEMONUSER $PIDDIR
fi
if [ -e $PIDFILE ]; then
PIDDIR=/proc/$(cat $PIDFILE)
if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
echo "$DESC already started; not starting."
else
echo "Removing stale PID file $PIDFILE."
rm -f $PIDFILE
fi
fi
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
echo "$NAME."
if [ -d $EVENTDIR ]; then
run-parts --arg=start $EVENTDIR
fi
}
shut_it_down()
{
if [ -d $EVENTDIR ]; then
run-parts --reverse --arg=stop $EVENTDIR
fi
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--user $DAEMONUSER
# We no longer include these arguments so that start-stop-daemon
# can do its job even given that we may have been upgraded.
# We rely on the pidfile being sanely managed
# --exec $DAEMON -- --system $PARAMS
echo "$NAME."
rm -f $PIDFILE
}
case "$1" in
start)
start_it_up
;;
stop)
shut_it_down
;;
restart|force-reload)
shut_it_down
sleep 1
start_it_up
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,150 @@
diff -urN dbus-0.22.orig/tools/dbus-monitor.1 dbus-0.22/tools/dbus-monitor.1
--- dbus-0.22.orig/tools/dbus-monitor.1 2004-10-10 20:47:19.906823680 +1000
+++ dbus-0.22/tools/dbus-monitor.1 2004-10-10 20:47:27.791625008 +1000
@@ -9,6 +9,7 @@
.PP
.B dbus-monitor
[\-\-system | \-\-session]
+[watch expressions]
.SH DESCRIPTION
@@ -25,6 +26,11 @@
monitor the system or session buses respectively. If neither is
specified, \fIdbus-monitor\fP monitors the session bus.
+.PP
+In order to get \fIdbus-monitor\fP to see the messages you are interested
+in, you should specify a set of watch expressions as you would expect to
+be passed to the \fIdbus_bus_add_watch\fP function.
+
.PP
The message bus configuration may keep \fIdbus-monitor\fP from seeing
all messages, especially if you run the monitor as a non-root user.
@@ -37,6 +43,15 @@
.I "--session"
Monitor the session message bus. (This is the default.)
+.SH EXAMPLE
+Here is an example of using dbus-monitor to watch for the gnome typing
+monitor to say things
+.nf
+
+ dbus-monitor "type='signal',sender='org.gnome.TypingMonitor',interface='org.gnome.TypingMonitor'"
+
+.fi
+
.SH AUTHOR
dbus-monitor was written by Philip Blundell.
--- dbus-0.22-1ubuntu1/tools/dbus-monitor.c 2004-08-10 13:03:37.000000000 +1000
+++ dbus-0.22/tools/dbus-monitor.c 2004-10-10 21:38:08.532362152 +1000
@@ -45,7 +45,7 @@
static void
usage (char *name, int ecode)
{
- fprintf (stderr, "Usage: %s [--system | --session]\n", name);
+ fprintf (stderr, "Usage: %s [--system | --session] [watch expressions]\n", name);
exit (ecode);
}
@@ -56,8 +56,8 @@
DBusError error;
DBusBusType type = DBUS_BUS_SESSION;
GMainLoop *loop;
- int i;
-
+ int i = 0, j = 0, numFilters = 0;
+ char **filters = NULL;
for (i = 1; i < argc; i++)
{
char *arg = argv[i];
@@ -69,14 +69,18 @@
else if (!strcmp (arg, "--help"))
usage (argv[0], 0);
else if (!strcmp (arg, "--"))
- break;
+ continue;
else if (arg[0] == '-')
usage (argv[0], 1);
+ else {
+ numFilters++;
+ filters = (char **)realloc(filters, numFilters * sizeof(char *));
+ filters[j] = (char *)malloc((strlen(arg) + 1) * sizeof(char *));
+ snprintf(filters[j], strlen(arg) + 1, "%s", arg);
+ j++;
+ }
}
- if (argc > 2)
- usage (argv[0], 1);
-
loop = g_main_loop_new (NULL, FALSE);
dbus_error_init (&error);
@@ -92,26 +102,45 @@
dbus_connection_setup_with_g_main (connection, NULL);
- dbus_bus_add_match (connection,
- "type='signal'",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
- dbus_bus_add_match (connection,
- "type='method_call'",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
- dbus_bus_add_match (connection,
- "type='method_return'",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
- dbus_bus_add_match (connection,
- "type='error'",
- &error);
- if (dbus_error_is_set (&error))
- goto lose;
+ if (numFilters)
+ {
+ for (i = 0; i < j; i++)
+ {
+ dbus_bus_add_match (connection, filters[i], &error);
+ if (dbus_error_is_set (&error))
+ {
+ fprintf (stderr, "Failed to setup match \"%s\": %s\n",
+ filters[i], error.message);
+ dbus_error_free (&error);
+ exit (1);
+ }
+ free(filters[i]);
+ }
+ }
+ else
+ {
+ dbus_bus_add_match (connection,
+ "type='signal'",
+ &error);
+ if (dbus_error_is_set (&error))
+ goto lose;
+ dbus_bus_add_match (connection,
+ "type='method_call'",
+ &error);
+ if (dbus_error_is_set (&error))
+ goto lose;
+ dbus_bus_add_match (connection,
+ "type='method_return'",
+ &error);
+ if (dbus_error_is_set (&error))
+ goto lose;
+ dbus_bus_add_match (connection,
+ "type='error'",
+ &error);
+ if (dbus_error_is_set (&error))
+ goto lose;
+ }
+
if (!dbus_connection_add_filter (connection, filter_func, NULL, NULL)) {
fprintf (stderr, "Couldn't add filter!\n");
exit (1);

View File

@ -0,0 +1,23 @@
--- dbus-0.20-virgin-patches/bus/config-parser.c 2003-10-14 21:30:21.000000000 +0100
+++ dbus-0.20/bus/config-parser.c 2004-02-10 00:40:05.000000000 +0000
@@ -1710,8 +1710,18 @@
{
if (!include_file (parser, &full_path, TRUE, error))
{
- _dbus_string_free (&full_path);
- goto failed;
+ /* Debian patch to skip malformed /etc/dbus-1/system.d entries */
+ /*
+ * _dbus_string_free (&full_path);
+ * goto failed;
+ */
+ if (dbus_error_is_set (error))
+ {
+ _dbus_warn("\nEncountered error '%s' while parsing '%s'\n",
+ error->message,
+ _dbus_string_get_const_data(&full_path));
+ dbus_error_free (error);
+ }
}
}

View File

@ -0,0 +1,399 @@
Index: dbus-send.1
===================================================================
--- tools/dbus-send.1 (revision 691)
+++ tools/dbus-send.1 (working copy)
@@ -36,8 +36,8 @@
specified. Following arguments, if any, are the message contents
(message arguments). These are given as a type name, a colon, and
then the value of the argument. The possible type names are: string,
-int32, uint32, double, byte, boolean. (D-BUS supports more types than
-these, but \fIdbus-send\fP currently does not.)
+int32, uint32, double, byte, boolean, array. (D-BUS supports more types
+than these, but \fIdbus-send\fP currently does not.)
.PP
Here is an example invocation:
@@ -46,7 +46,8 @@
dbus-send \-\-dest='org.freedesktop.ExampleService' \\
/org/freedesktop/sample/object/name \\
org.freedesktop.ExampleInterface.ExampleMethod \\
- int32:47 string:'hello world' double:65.32
+ int32:47 string:'hello world' double:65.32 \\
+ array:byte[0,1,2]
.fi
Index: dbus-print-message.c
===================================================================
--- tools/dbus-print-message.c (revision 691)
+++ tools/dbus-print-message.c (working copy)
@@ -39,6 +39,78 @@
}
}
+static void
+iterate (DBusMessageIter* iter, int entry_type)
+{
+ do
+ {
+ char *str;
+ dbus_uint32_t uint32;
+ dbus_int32_t int32;
+ double d;
+ unsigned char byte;
+ dbus_bool_t boolean;
+ int type = dbus_message_iter_get_arg_type (iter);
+
+ DBusMessageIter array_iter;
+ int array_type = DBUS_TYPE_INVALID;
+
+ if (type == DBUS_TYPE_INVALID)
+ {
+ if (entry_type == DBUS_TYPE_INVALID)
+ break;
+ else
+ type == entry_type;
+ }
+
+ switch (type)
+ {
+ case DBUS_TYPE_STRING:
+ str = dbus_message_iter_get_string (iter);
+ printf ("string:%s\n", str);
+ break;
+
+ case DBUS_TYPE_INT32:
+ int32 = dbus_message_iter_get_int32 (iter);
+ printf ("int32:%d\n", int32);
+ break;
+
+ case DBUS_TYPE_UINT32:
+ uint32 = dbus_message_iter_get_uint32 (iter);
+ printf ("int32:%u\n", uint32);
+ break;
+
+ case DBUS_TYPE_DOUBLE:
+ d = dbus_message_iter_get_double (iter);
+ printf ("double:%f\n", d);
+ break;
+
+ case DBUS_TYPE_BYTE:
+ byte = dbus_message_iter_get_byte (iter);
+ printf ("byte:%d\n", byte);
+ break;
+
+ case DBUS_TYPE_BOOLEAN:
+ boolean = dbus_message_iter_get_boolean (iter);
+ printf ("boolean:%s\n", boolean ? "true" : "false");
+ break;
+
+ case DBUS_TYPE_ARRAY:
+ dbus_message_iter_init_array_iterator (iter,
+ &array_iter,
+ &array_type);
+ printf ("array[\n");
+ iterate (&array_iter, array_type);
+ printf ("]\n");
+ break;
+
+ default:
+ printf ("(unknown arg type %d)\n", type);
+ break;
+ }
+ } while (dbus_message_iter_next (iter));
+}
+
void
print_message (DBusMessage *message)
{
@@ -81,55 +153,6 @@
dbus_message_iter_init (message, &iter);
- do
- {
- int type = dbus_message_iter_get_arg_type (&iter);
- char *str;
- dbus_uint32_t uint32;
- dbus_int32_t int32;
- double d;
- unsigned char byte;
- dbus_bool_t boolean;
-
- if (type == DBUS_TYPE_INVALID)
- break;
-
- switch (type)
- {
- case DBUS_TYPE_STRING:
- str = dbus_message_iter_get_string (&iter);
- printf ("string:%s\n", str);
- break;
-
- case DBUS_TYPE_INT32:
- int32 = dbus_message_iter_get_int32 (&iter);
- printf ("int32:%d\n", int32);
- break;
-
- case DBUS_TYPE_UINT32:
- uint32 = dbus_message_iter_get_uint32 (&iter);
- printf ("int32:%u\n", uint32);
- break;
-
- case DBUS_TYPE_DOUBLE:
- d = dbus_message_iter_get_double (&iter);
- printf ("double:%f\n", d);
- break;
-
- case DBUS_TYPE_BYTE:
- byte = dbus_message_iter_get_byte (&iter);
- printf ("byte:%d\n", byte);
- break;
-
- case DBUS_TYPE_BOOLEAN:
- boolean = dbus_message_iter_get_boolean (&iter);
- printf ("boolean:%s\n", boolean ? "true" : "false");
- break;
-
- default:
- printf ("(unknown arg type %d)\n", type);
- break;
- }
- } while (dbus_message_iter_next (&iter));
+ iterate (&iter, DBUS_TYPE_INVALID);
}
Index: dbus-send.c
===================================================================
--- tools/dbus-send.c (revision 691)
+++ tools/dbus-send.c (working copy)
@@ -34,6 +34,146 @@
exit (ecode);
}
+
+static int
+get_type (char **argv, char *arg)
+{
+ int type;
+
+ if (arg[0] == 0 || !strcmp (arg, "string"))
+ type = DBUS_TYPE_STRING;
+ else if (!strcmp (arg, "int32"))
+ type = DBUS_TYPE_INT32;
+ else if (!strcmp (arg, "uint32"))
+ type = DBUS_TYPE_UINT32;
+ else if (!strcmp (arg, "double"))
+ type = DBUS_TYPE_DOUBLE;
+ else if (!strcmp (arg, "byte"))
+ type = DBUS_TYPE_BYTE;
+ else if (!strcmp (arg, "boolean"))
+ type = DBUS_TYPE_BOOLEAN;
+ else if (!strcmp (arg, "array"))
+ type = DBUS_TYPE_ARRAY;
+ else
+ {
+ fprintf (stderr, "%s: Unknown type \"%s\"\n", argv[0], arg);
+ exit (1);
+ }
+
+ return type;
+}
+
+
+static void
+append (char **argv, char *arg, char *c, DBusMessageIter *iter)
+{
+ int type, atype = 0;
+ dbus_uint32_t uint32;
+ dbus_int32_t int32;
+ double d;
+ unsigned char byte;
+ DBusMessageIter array_iter;
+ int end_found = 0;
+ char *next;
+
+ /* FIXME - we are ignoring OOM returns on all these functions */
+
+ type = get_type(argv, arg);
+ if (type == DBUS_TYPE_ARRAY)
+ {
+ arg = c;
+ c = strchr (c, '[');
+ if (c == NULL)
+ {
+ fprintf (stderr, "%s: Data item \"%s\" is badly formed\n", argv[0], arg);
+ exit (1);
+ }
+
+ if (strchr(c, ']') == NULL)
+ {
+ fprintf (stderr, "%s: Data item \"%s\" is badly formed\n", argv[0], arg);
+ exit (1);
+ }
+
+ *(c++) = 0;
+
+ atype = get_type(argv, arg);
+ }
+
+
+ switch (type)
+ {
+ case DBUS_TYPE_BYTE:
+ byte = strtoul (c, NULL, 0);
+ dbus_message_iter_append_byte (iter, byte);
+ break;
+
+ case DBUS_TYPE_DOUBLE:
+ d = strtod (c, NULL);
+ dbus_message_iter_append_double (iter, d);
+ break;
+
+ case DBUS_TYPE_INT32:
+ int32 = strtol (c, NULL, 0);
+ dbus_message_iter_append_int32 (iter, int32);
+ break;
+
+ case DBUS_TYPE_UINT32:
+ uint32 = strtoul (c, NULL, 0);
+ dbus_message_iter_append_uint32 (iter, uint32);
+ break;
+
+ case DBUS_TYPE_STRING:
+ dbus_message_iter_append_string (iter, c);
+ break;
+
+ case DBUS_TYPE_BOOLEAN:
+ if (strcmp(c, "true") == 0)
+ dbus_message_iter_append_boolean (iter, TRUE);
+ else if (strcmp(c, "false") == 0)
+ dbus_message_iter_append_boolean (iter, FALSE);
+ else
+ {
+ fprintf (stderr, "%s: Expected \"true\" or \"false\" instead of \"%s\"\n", argv[0], c);
+ exit (1);
+ }
+ break;
+
+ case DBUS_TYPE_ARRAY:
+ /* Decompose parameters and put it as array */
+ dbus_message_iter_append_array(iter, &array_iter, atype);
+
+ while(!end_found)
+ {
+ next = strchr(c, ',');
+ if (next == NULL)
+ {
+ next = strchr(c, ']');
+
+ if (next != NULL)
+ next[0] = 0;
+ else
+ break;
+
+ end_found = 1;
+ }
+ else
+ {
+ next[0] = 0;
+ next++;
+ }
+
+ append (argv, arg, c, &array_iter);
+ c = next;
+ }
+ break;
+
+ default:
+ fprintf (stderr, "%s: Unsupported data type\n", argv[0]);
+ exit (1);
+ }
+}
+
int
main (int argc, char *argv[])
{
@@ -174,12 +314,7 @@
{
char *arg;
char *c;
- int type;
- dbus_uint32_t uint32;
- dbus_int32_t int32;
- double d;
- unsigned char byte;
-
+
type = DBUS_TYPE_INVALID;
arg = argv[i++];
c = strchr (arg, ':');
@@ -192,67 +327,7 @@
*(c++) = 0;
- if (arg[0] == 0 || !strcmp (arg, "string"))
- type = DBUS_TYPE_STRING;
- else if (!strcmp (arg, "int32"))
- type = DBUS_TYPE_INT32;
- else if (!strcmp (arg, "uint32"))
- type = DBUS_TYPE_UINT32;
- else if (!strcmp (arg, "double"))
- type = DBUS_TYPE_DOUBLE;
- else if (!strcmp (arg, "byte"))
- type = DBUS_TYPE_BYTE;
- else if (!strcmp (arg, "boolean"))
- type = DBUS_TYPE_BOOLEAN;
- else
- {
- fprintf (stderr, "%s: Unknown type \"%s\"\n", argv[0], arg);
- exit (1);
- }
-
- /* FIXME - we are ignoring OOM returns on all these functions */
- switch (type)
- {
- case DBUS_TYPE_BYTE:
- byte = strtoul (c, NULL, 0);
- dbus_message_iter_append_byte (&iter, byte);
- break;
-
- case DBUS_TYPE_DOUBLE:
- d = strtod (c, NULL);
- dbus_message_iter_append_double (&iter, d);
- break;
-
- case DBUS_TYPE_INT32:
- int32 = strtol (c, NULL, 0);
- dbus_message_iter_append_int32 (&iter, int32);
- break;
-
- case DBUS_TYPE_UINT32:
- uint32 = strtoul (c, NULL, 0);
- dbus_message_iter_append_uint32 (&iter, uint32);
- break;
-
- case DBUS_TYPE_STRING:
- dbus_message_iter_append_string (&iter, c);
- break;
-
- case DBUS_TYPE_BOOLEAN:
- if (strcmp(c, "true") == 0)
- dbus_message_iter_append_boolean (&iter, TRUE);
- else if (strcmp(c, "false") == 0)
- dbus_message_iter_append_boolean (&iter, FALSE);
- else
- {
- fprintf (stderr, "%s: Expected \"true\" or \"false\" instead of \"%s\"\n", argv[0], c);
- exit (1);
- }
- break;
-
- default:
- fprintf (stderr, "%s: Unsupported data type\n", argv[0]);
- exit (1);
- }
+ append (argv, arg, c, &iter);
}
if (print_reply)

View File

@ -0,0 +1,164 @@
Index: dbus-0.23/configure.in
===================================================================
--- dbus-0.23.orig/configure.in 2005-04-02 17:14:37.780040976 -0500
+++ dbus-0.23/configure.in 2005-04-02 17:14:38.024003888 -0500
@@ -22,6 +22,9 @@
AC_ISC_POSIX
AC_HEADER_STDC
+AM_GNU_GETTEXT_VERSION(0.11.5)
+AM_GNU_GETTEXT([external], [need-ngettext])
+
AC_ARG_ENABLE(qt, [ --enable-qt enable Qt-friendly client library],enable_qt=$enableval,enable_qt=auto)
AC_ARG_ENABLE(glib, [ --enable-glib enable GLib-friendly client library],enable_glib=$enableval,enable_glib=auto)
AC_ARG_ENABLE(gtk, [ --enable-gtk enable GTK-requiring executables],enable_gtk=$enableval,enable_gtk=auto)
Index: dbus-0.23/glib/Makefile.am
===================================================================
--- dbus-0.23.orig/glib/Makefile.am 2004-07-29 04:00:45.000000000 -0400
+++ dbus-0.23/glib/Makefile.am 2005-04-02 17:22:27.302662688 -0500
@@ -15,7 +15,7 @@
dbus-gvalue.c \
dbus-gvalue.h
-libdbus_glib_1_la_LIBADD= $(DBUS_GLIB_LIBS) $(top_builddir)/dbus/libdbus-1.la
+libdbus_glib_1_la_LIBADD= $(DBUS_GLIB_LIBS) $(LIBINTL) $(top_builddir)/dbus/libdbus-1.la
## don't export symbols that start with "_" (we use this
## convention for internal symbols)
libdbus_glib_1_la_LDFLAGS= -export-symbols-regex "^[^_].*"
Index: dbus-0.23/glib/dbus-glib-tool.c
===================================================================
--- dbus-0.23.orig/glib/dbus-glib-tool.c 2004-08-09 23:07:00.000000000 -0400
+++ dbus-0.23/glib/dbus-glib-tool.c 2005-04-02 17:14:38.024003888 -0500
@@ -26,8 +26,13 @@
#include "dbus-gparser.h"
#include "dbus-gutils.h"
#include <locale.h>
+
+#ifdef HAVE_GETTEXT
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
+#else
+#define _(x) x
+#endif
#define N_(x) x
#include <stdio.h>
#include <stdlib.h>
Index: dbus-0.23/glib/dbus-glib.c
===================================================================
--- dbus-0.23.orig/glib/dbus-glib.c 2004-08-09 23:07:00.000000000 -0400
+++ dbus-0.23/glib/dbus-glib.c 2005-04-02 17:14:38.024003888 -0500
@@ -27,8 +27,12 @@
#include "dbus-gtest.h"
#include "dbus-gutils.h"
+#ifdef HAVE_GETTEXT
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
+#else
+#define _(x) x
+#endif
#define N_(x) x
/**
Index: dbus-0.23/glib/dbus-gmain.c
===================================================================
--- dbus-0.23.orig/glib/dbus-gmain.c 2004-11-13 02:07:47.000000000 -0500
+++ dbus-0.23/glib/dbus-gmain.c 2005-04-02 17:14:38.025003736 -0500
@@ -27,8 +27,12 @@
#include "dbus-gtest.h"
#include "dbus-gutils.h"
+#ifdef HAVE_GETTEXT
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
+#else
+#define _(x) x
+#endif
#define N_(x) x
/**
Index: dbus-0.23/glib/dbus-gparser.c
===================================================================
--- dbus-0.23.orig/glib/dbus-gparser.c 2004-08-09 23:07:00.000000000 -0400
+++ dbus-0.23/glib/dbus-gparser.c 2005-04-02 17:14:38.025003736 -0500
@@ -20,12 +20,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
+#include <config.h>
#include "dbus-gparser.h"
#include "dbus-gidl.h"
#include <string.h>
+#ifdef HAVE_GETTEXT
#include <libintl.h>
#define _(x) gettext ((x))
+#else
+#define _(x) x
+#endif
#define N_(x) x
#ifndef DOXYGEN_SHOULD_SKIP_THIS
Index: dbus-0.23/tools/Makefile.am
===================================================================
--- dbus-0.23.orig/tools/Makefile.am 2004-04-21 17:29:07.000000000 -0400
+++ dbus-0.23/tools/Makefile.am 2005-04-02 17:22:00.712704976 -0500
@@ -37,8 +37,8 @@
dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la
dbus_monitor_LDADD= $(top_builddir)/glib/libdbus-glib-1.la
-dbus_launch_LDADD= $(DBUS_X_LIBS)
-dbus_viewer_LDADD= $(DBUS_GLIB_TOOL_LIBS) $(top_builddir)/glib/libdbus-gtool.la $(DBUS_GTK_LIBS)
+dbus_launch_LDADD= $(DBUS_X_LIBS) $(LIBINTL)
+dbus_viewer_LDADD= $(DBUS_GLIB_TOOL_LIBS) $(LIBINTL) $(top_builddir)/glib/libdbus-gtool.la $(DBUS_GTK_LIBS)
man_MANS = dbus-send.1 dbus-monitor.1 dbus-launch.1 dbus-cleanup-sockets.1
EXTRA_DIST = $(man_MANS)
Index: dbus-0.23/tools/dbus-launch.c
===================================================================
--- dbus-0.23.orig/tools/dbus-launch.c 2004-08-09 23:07:01.000000000 -0400
+++ dbus-0.23/tools/dbus-launch.c 2005-04-02 17:14:38.026003584 -0500
@@ -22,6 +22,8 @@
*/
#include <config.h>
#include <stdlib.h>
+#include <sys/time.h>
+#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
Index: dbus-0.23/tools/dbus-tree-view.c
===================================================================
--- dbus-0.23.orig/tools/dbus-tree-view.c 2004-08-09 23:07:01.000000000 -0400
+++ dbus-0.23/tools/dbus-tree-view.c 2005-04-02 17:14:38.026003584 -0500
@@ -24,8 +24,12 @@
#include <config.h>
#include "dbus-tree-view.h"
+#ifdef HAVE_GETTEXT
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
+#else
+#define _(x) x
+#endif
#define N_(x) x
enum
Index: dbus-0.23/tools/dbus-viewer.c
===================================================================
--- dbus-0.23.orig/tools/dbus-viewer.c 2004-08-09 23:07:01.000000000 -0400
+++ dbus-0.23/tools/dbus-viewer.c 2005-04-02 17:14:38.027003432 -0500
@@ -30,8 +30,12 @@
#include <glib/dbus-gparser.h>
#include <glib/dbus-gutils.h>
+#ifdef HAVE_GETTEXT
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
+#else
+#define _(x) x
+#endif
#define N_(x) x
typedef struct

View File

@ -0,0 +1,12 @@
--- dbus-0.34/tools/Makefile.am.old 2005-06-27 21:48:44.000000000 +0100
+++ dbus-0.34/tools/Makefile.am 2005-06-27 21:49:04.000000000 +0100
@@ -6,9 +6,6 @@
nodist_libdbus_glib_HEADERS = dbus-glib-bindings.h
libdbus_glibdir = $(includedir)/dbus-1.0/dbus
-dbus-glib-bindings.h: dbus-bus-introspect.xml $(top_builddir)/glib/dbus-binding-tool
- $(top_builddir)/glib/dbus-binding-tool --mode=glib-client --output=dbus-glib-bindings.h dbus-bus-introspect.xml
-
BUILT_SOURCES = dbus-glib-bindings.h dbus-bus-introspect.xml
else

View File

@ -0,0 +1,19 @@
--- dbus-0.34/tools/Makefile.am.old 2005-06-27 20:54:36.000000000 +0100
+++ dbus-0.34/tools/Makefile.am 2005-06-27 20:54:43.000000000 +0100
@@ -21,16 +21,6 @@
GTK_TOOLS=
endif
-if HAVE_GLIB
-noinst_PROGRAMS = print-introspect
-
-print_introspect_SOURCES = print-introspect.c
-print_introspect_LDADD = $(top_builddir)/glib/libdbus-glib-1.la
-
-dbus-bus-introspect.xml: $(top_builddir)/bus/dbus-daemon dbus-launch print-introspect $(top_builddir)/bus/dbus-daemon
- DBUS_TOP_BUILDDIR=$(top_builddir) $(srcdir)/run-with-tmp-session-bus.sh ./print-introspect org.freedesktop.DBus /org/freedesktop/DBus > dbus-bus-introspect.xml.tmp && mv dbus-bus-introspect.xml.tmp dbus-bus-introspect.xml
-endif
-
bin_PROGRAMS=dbus-send $(GLIB_TOOLS) dbus-launch dbus-cleanup-sockets $(GTK_TOOLS)
dbus_send_SOURCES= \

View File

@ -0,0 +1,17 @@
diff -ur dbus/dbus/dbus-spawn.c dbus.work/dbus/dbus-spawn.c
--- dbus/dbus/dbus-spawn.c 2005-03-14 14:25:02.849823496 +0200
+++ dbus.work/dbus/dbus-spawn.c 2005-03-14 14:34:43.947483224 +0200
@@ -1117,6 +1117,12 @@
}
else if (grandchild_pid == 0)
{
+ int p;
+ errno = 0;
+ p = getpriority(PRIO_PROCESS, 0);
+ if (!errno && p < 0) {
+ setpriority(PRIO_PROCESS, 0, 0);
+ }
do_exec (child_err_report_pipe[WRITE_END],
argv,
child_setup, user_data);
Only in dbus.work/dbus: dbus-spawn.c~

View File

@ -0,0 +1,30 @@
--- dbus-0.22/configure.in.orig 2004-08-13 00:57:16.000000000 +0200
+++ dbus-0.22/configure.in 2004-12-30 21:15:57.000000000 +0100
@@ -1047,15 +1048,18 @@
AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
#### Find socket directories
-if ! test -z "$TMPDIR" ; then
- DEFAULT_SOCKET_DIR=$TMPDIR
-elif ! test -z "$TEMP" ; then
- DEFAULT_SOCKET_DIR=$TEMP
-elif ! test -z "$TMP" ; then
- DEFAULT_SOCKET_DIR=$TMP
-else
- DEFAULT_SOCKET_DIR=/tmp
-fi
+#if ! test -z "$TMPDIR" ; then
+# DEFAULT_SOCKET_DIR=$TMPDIR
+#elif ! test -z "$TEMP" ; then
+# DEFAULT_SOCKET_DIR=$TEMP
+#elif ! test -z "$TMP" ; then
+# DEFAULT_SOCKET_DIR=$TMP
+#else
+# DEFAULT_SOCKET_DIR=/tmp
+#fi
+
+# checks disabled to avoid expanding this at build time
+DEFAULT_SOCKET_DIR=/tmp
if ! test -z "$with_test_socket_dir" ; then
TEST_SOCKET_DIR="$with_test_socket_dir"

View File

@ -0,0 +1,12 @@
Only in /home/kihamala/svn/dbus/tools: .svn
diff -ur tools/dbus-launch.c /home/kihamala/svn/dbus/tools/dbus-launch.c
--- tools/dbus-launch.c 2004-08-10 06:07:01.000000000 +0300
+++ /home/kihamala/svn/dbus/tools/dbus-launch.c 2005-02-09 17:59:05.000000000 +0200
@@ -20,6 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+#include <sys/select.h>
#include <config.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -0,0 +1,72 @@
DEFAULT_PREFERENCE = "-1"
SECTION = "base"
PR = "r1"
HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
DESCRIPTION = "message bus system for applications to talk to one another"
LICENSE = "GPL"
DEPENDS = "expat glib-2.0 virtual/libintl"
SRC_URI = "http://repository.maemo.org/pool/maemo/ossw/source/d/${PN}/${PN}_${PV}.tar.gz \
file://cross.patch;patch=1 \
file://tmpdir.patch;patch=1 \
file://gettext.patch;patch=1 \
file://0.23.1.diff;patch=1 \
file://dbus-monitor.patch;patch=1 \
file://dbussend.patch;patch=1;pnum=0 \
file://spawn-priority.diff;patch=1 \
file://config.diff;patch=1;pnum=0 \
file://dbus-quiesce-startup-errors.patch;patch=1 \
file://tools.diff;patch=1;pnum=0 \
file://dbus-1.init"
inherit autotools pkgconfig update-rc.d gettext
S = "${WORKDIR}/dbus-0.23.1"
INITSCRIPT_NAME = "dbus-1"
INITSCRIPT_PARAMS = "defaults"
CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
FILES_${PN} = "${bindir}/dbus-daemon-1 ${bindir}/dbus-launch ${bindir}/dbus-cleanup-sockets ${bindir}/dbus-send ${bindir}/dbus-monitor ${sysconfdir} ${datadir}/dbus-1/services ${libdir}/lib*.so.*"
FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
pkg_postinst_dbus() {
#!/bin/sh
# can't do adduser stuff offline
if [ "x$D" != "x" ]; then
exit 1
fi
MESSAGEUSER=messagebus
MESSAGEHOME=/var/run/dbus
mkdir -p $MESSAGEHOME || true
chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup "$MESSAGEUSER"
chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
}
EXTRA_OECONF = "--disable-qt --disable-gtk --disable-tests \
--disable-checks --disable-xml-docs --disable-doxygen-docs \
--with-xml=expat --without-x"
do_stage () {
oe_libinstall -so -C dbus libdbus-1 ${STAGING_LIBDIR}
oe_libinstall -so -C glib libdbus-glib-1 ${STAGING_LIBDIR}
autotools_stage_includes
mkdir -p ${STAGING_LIBDIR}/dbus-1.0/include/dbus/
install -m 0644 dbus/dbus-arch-deps.h ${STAGING_LIBDIR}/dbus-1.0/include/dbus/
}
do_install_append () {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
}
python populate_packages_prepend () {
if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
bb.data.setVar('PKG_dbus', 'dbus-1', d)
}

View File

@ -0,0 +1,14 @@
include dbus_${PV}.inc
DEPENDS = "expat glib-2.0 virtual/libintl dbus-native"
DEFAULT_PREFERENCE = "-1"
SRC_URI_EXTRA = "file://no-introspect.patch;patch=1 file://no-bindings.patch;patch=1"
FILES_${PN} += "${bindir}/dbus-daemon"
FILES_${PN}-dev += "${bindir}/dbus-binding-tool"
do_configure_prepend() {
install -m 0644 ${STAGING_DIR}/${BUILD_SYS}/share/dbus/dbus-bus-introspect.xml ${S}/tools/
install -m 0644 ${STAGING_DIR}/${BUILD_SYS}/share/dbus/dbus-glib-bindings.h ${S}/tools/
}

View File

@ -0,0 +1,65 @@
SECTION = "base"
PR = "r0"
HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
DESCRIPTION = "message bus system for applications to talk to one another"
LICENSE = "GPL"
DEPENDS = "expat glib-2.0 virtual/libintl"
DEFAULT_PREFERENCE = "-1"
SRC_URI = "http://freedesktop.org/software/dbus/releases/dbus-${PV}.tar.gz \
file://cross.patch;patch=1 \
file://tmpdir.patch;patch=1 \
file://dbus-1.init \
${SRC_URI_EXTRA}"
inherit autotools pkgconfig update-rc.d gettext
INITSCRIPT_NAME = "dbus-1"
INITSCRIPT_PARAMS = "defaults"
CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
FILES_${PN} = "${bindir}/dbus-daemon-1 ${bindir}/dbus-launch ${bindir}/dbus-cleanup-sockets ${bindir}/dbus-send ${bindir}/dbus-monitor ${sysconfdir} ${datadir}/dbus-1/services ${libdir}/lib*.so.*"
FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
pkg_postinst_dbus() {
#!/bin/sh
# can't do adduser stuff offline
if [ "x$D" != "x" ]; then
exit 1
fi
MESSAGEUSER=messagebus
MESSAGEHOME=/var/run/dbus
mkdir -p $MESSAGEHOME || true
chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup "$MESSAGEUSER"
chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
}
EXTRA_OECONF = "--disable-qt --disable-gtk --disable-tests \
--disable-checks --disable-xml-docs --disable-doxygen-docs \
--with-xml=expat --without-x"
do_stage () {
oe_libinstall -so -C dbus libdbus-1 ${STAGING_LIBDIR}
oe_libinstall -so -C glib libdbus-glib-1 ${STAGING_LIBDIR}
autotools_stage_includes
mkdir -p ${STAGING_LIBDIR}/dbus-1.0/include/dbus/
install -m 0644 dbus/dbus-arch-deps.h ${STAGING_LIBDIR}/dbus-1.0/include/dbus/
}
do_install_append () {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
}
python populate_packages_prepend () {
if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
bb.data.setVar('PKG_dbus', 'dbus-1', d)
}

View File

@ -0,0 +1,619 @@
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gtk+/configure.in,v
retrieving revision 1.419.2.4
diff -u -r1.419.2.4 configure.in
--- configure.in 8 Feb 2005 21:39:42 -0000 1.419.2.4
+++ configure.in 27 Feb 2005 13:10:16 -0000
@@ -1495,6 +1495,16 @@
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
+AC_ARG_ENABLE(display-migration,
+ [AC_HELP_STRING([--enable-display-migration],
+ [include support for GPE_CHANGE_DISPLAY protocol])],
+ enable_migration=yes, enable_migration=no)
+if test "$enable_migration" = "yes"; then
+ AC_DEFINE([ENABLE_MIGRATION], 1, [Define if display migration is enabled])
+ GTK_DEP_LIBS="$GTK_DEP_LIBS -lgcrypt"
+fi
+AM_CONDITIONAL(ENABLE_MIGRATION, test $enable_migration = "yes")
+
AC_SUBST(GTK_PACKAGES)
AC_SUBST(GTK_EXTRA_LIBS)
AC_SUBST(GTK_EXTRA_CFLAGS)
Index: gtk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/Makefile.am,v
retrieving revision 1.266.2.1
diff -u -r1.266.2.1 Makefile.am
--- gtk/Makefile.am 13 Jan 2005 15:18:21 -0000 1.266.2.1
+++ gtk/Makefile.am 27 Feb 2005 13:10:17 -0000
@@ -520,6 +520,10 @@
gtkwindow.c \
xembed.h
+if ENABLE_MIGRATION
+gtk_c_sources += gtkmigration.c
+endif
+
if OS_UNIX
gtk_private_h_sources += gtkfilesystemunix.h
gtk_c_sources += gtkfilesystemunix.c
Index: gtk/gtkmain.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmain.c,v
retrieving revision 1.255
diff -u -r1.255 gtkmain.c
--- gtk/gtkmain.c 27 Dec 2004 05:25:15 -0000 1.255
+++ gtk/gtkmain.c 27 Feb 2005 13:10:19 -0000
@@ -491,6 +491,10 @@
_gtk_accel_map_init ();
_gtk_rc_init ();
+#ifdef ENABLE_MIGRATION
+ gtk_migration_init ();
+#endif
+
/* Set the 'initialized' flag.
*/
gtk_initialized = TRUE;
Index: gtk/gtkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
retrieving revision 1.281.2.4
diff -u -r1.281.2.4 gtkwindow.c
--- gtk/gtkwindow.c 21 Feb 2005 04:21:49 -0000 1.281.2.4
+++ gtk/gtkwindow.c 27 Feb 2005 13:10:56 -0000
@@ -731,6 +731,8 @@
add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
}
+extern void gtk_migration_mark_window (GtkWidget *w);
+
static void
gtk_window_init (GtkWindow *window)
{
@@ -790,6 +792,10 @@
"event",
G_CALLBACK (gtk_window_event),
NULL);
+
+#ifdef ENABLE_MIGRATION
+ gtk_migration_mark_window (window);
+#endif
}
static void
--- /dev/null 2005-02-20 01:07:50.714416160 +0000
+++ gtk/gtkmigration.c 2005-02-27 15:05:04.052757352 +0000
@@ -0,0 +1,529 @@
+/*
+ * Copyright (C) 2003, 2005 Philip Blundell <philb@gnu.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <libintl.h>
+#include <string.h>
+#include <assert.h>
+
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+#include <gcrypt.h>
+
+#include "gtk.h"
+#include "gdk.h"
+#include "x11/gdkx.h"
+
+#define _(x) gettext(x)
+
+static GdkAtom string_gdkatom, display_change_gdkatom;
+static GdkAtom rsa_challenge_gdkatom;
+
+#define DISPLAY_CHANGE_SUCCESS 0
+#define DISPLAY_CHANGE_UNABLE_TO_CONNECT 1
+#define DISPLAY_CHANGE_NO_SUCH_SCREEN 2
+#define DISPLAY_CHANGE_AUTHENTICATION_BAD 3
+#define DISPLAY_CHANGE_INDETERMINATE_ERROR 4
+
+static gboolean no_auth;
+
+static GSList *all_widgets;
+
+static gboolean gtk_migration_initialised;
+
+#define CHALLENGE_LEN 64
+
+gchar *gtk_migration_auth_challenge_string;
+
+static unsigned char challenge_bytes[CHALLENGE_LEN];
+static unsigned long challenge_seq;
+
+#define hexbyte(x) ((x) >= 10 ? (x) + 'a' - 10 : (x) + '0')
+
+struct rsa_key
+{
+ gcry_mpi_t n, e, d, p, q, u;
+};
+
+static gcry_mpi_t
+mpi_from_sexp (gcry_sexp_t r, char *tag)
+{
+ gcry_sexp_t s = gcry_sexp_find_token (r, tag, 0);
+ return gcry_sexp_nth_mpi (s, 1, GCRYMPI_FMT_USG);
+}
+
+static char *
+hex_from_mpi (gcry_mpi_t m)
+{
+ char *buf;
+ gcry_mpi_aprint (GCRYMPI_FMT_HEX, (void *)&buf, NULL, m);
+ return buf;
+}
+
+static void
+gtk_migration_crypt_create_hash (char *display, char *challenge, size_t len, char *result)
+{
+ size_t dlen = strlen (display);
+ gchar *buf = g_malloc (dlen + 1 + len);
+ strcpy (buf, display);
+ memcpy (buf + dlen + 1, challenge, len);
+ gcry_md_hash_buffer (GCRY_MD_SHA1, result, buf, len + dlen + 1);
+ g_free (buf);
+}
+
+static int
+do_encode_md (const unsigned char *digest, size_t digestlen, int algo,
+ unsigned int nbits, gcry_mpi_t *r_val)
+{
+ int nframe = (nbits+7) / 8;
+ unsigned char *frame;
+ int i, n;
+ unsigned char asn[100];
+ size_t asnlen;
+
+ asnlen = sizeof(asn);
+ if (gcry_md_algo_info (algo, GCRYCTL_GET_ASNOID, asn, &asnlen))
+ return -1;
+
+ if (digestlen + asnlen + 4 > nframe )
+ return -1;
+
+ /* We encode the MD in this way:
+ *
+ * 0 1 PAD(n bytes) 0 ASN(asnlen bytes) MD(len bytes)
+ *
+ * PAD consists of FF bytes.
+ */
+ frame = g_malloc (nframe);
+ n = 0;
+ frame[n++] = 0;
+ frame[n++] = 1; /* block type */
+ i = nframe - digestlen - asnlen -3 ;
+ assert ( i > 1 );
+ memset ( frame+n, 0xff, i ); n += i;
+ frame[n++] = 0;
+ memcpy ( frame+n, asn, asnlen ); n += asnlen;
+ memcpy ( frame+n, digest, digestlen ); n += digestlen;
+ assert ( n == nframe );
+
+ gcry_mpi_scan (r_val, GCRYMPI_FMT_USG, frame, nframe, &nframe);
+ g_free (frame);
+ return 0;
+}
+
+static gboolean
+gtk_migration_crypt_check_signature (struct rsa_key *k, char *hash, char *sigbuf)
+{
+ gcry_mpi_t mpi, mpi2;
+ gcry_sexp_t data, sig, key;
+ int rc;
+
+ do_encode_md (hash, 20, GCRY_MD_SHA1, 1024, &mpi);
+
+ gcry_sexp_build (&data, NULL, "(data (value %m))", mpi);
+
+ gcry_mpi_release (mpi);
+
+ gcry_sexp_build (&key, NULL, "(public-key (rsa (n %m) (e %m)))", k->n, k->e);
+
+ if (gcry_mpi_scan (&mpi2, GCRYMPI_FMT_HEX, sigbuf, 0, NULL))
+ {
+ gcry_sexp_release (data);
+ return FALSE;
+ }
+
+ gcry_sexp_build (&sig, NULL, "(sig-val (rsa (s %m)))", mpi2);
+
+ rc = gcry_pk_verify (sig, data, key);
+
+ gcry_sexp_release (data);
+ gcry_sexp_release (key);
+ gcry_sexp_release (sig);
+ gcry_mpi_release (mpi2);
+
+ if (rc)
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+gtk_migration_auth_update_challenge (void)
+{
+ int i;
+ unsigned char *p;
+
+ if (gtk_migration_auth_challenge_string == NULL)
+ gtk_migration_auth_challenge_string = g_malloc ((CHALLENGE_LEN * 2) + 9);
+
+ p = gtk_migration_auth_challenge_string;
+
+ for (i = 0; i < CHALLENGE_LEN; i++)
+ {
+ *p++ = hexbyte (challenge_bytes[i] >> 4);
+ *p++ = hexbyte (challenge_bytes[i] & 15);
+ }
+
+ sprintf (p, "%08lx", challenge_seq++);
+}
+
+static void
+gtk_migration_auth_generate_challenge (void)
+{
+ gcry_randomize (challenge_bytes, sizeof (challenge_bytes), GCRY_STRONG_RANDOM);
+ gtk_migration_auth_update_challenge ();
+}
+
+static struct rsa_key *
+parse_pubkey (char *s)
+{
+ struct rsa_key *r;
+ gcry_mpi_t n, e;
+ gchar *sp;
+
+ sp = strtok (s, " \n");
+ gcry_mpi_scan (&e, GCRYMPI_FMT_HEX, sp, 0, NULL);
+ sp = strtok (NULL, " \n");
+ gcry_mpi_scan (&n, GCRYMPI_FMT_HEX, sp, 0, NULL);
+
+ r = g_malloc0 (sizeof (struct rsa_key));
+ r->e = e;
+ r->n = n;
+ return r;
+}
+
+static struct rsa_key *
+lookup_pubkey (u_int32_t id)
+{
+ const gchar *home_dir = g_get_home_dir ();
+ gchar *filename = g_strdup_printf ("%s/.gpe/migrate/public", home_dir);
+ FILE *fp = fopen (filename, "r");
+ struct rsa_key *r = NULL;
+
+ if (fp)
+ {
+ while (!feof (fp))
+ {
+ char buffer[4096];
+ if (fgets (buffer, 4096, fp))
+ {
+ char *p;
+ u_int32_t this_id = strtoul (buffer, &p, 16);
+ if (p != buffer && *p == ' ')
+ {
+#ifdef DEBUG
+ fprintf (stderr, "found id %x\n", this_id);
+#endif
+ if (this_id == id)
+ {
+ r = parse_pubkey (++p);
+ break;
+ }
+ }
+ }
+ }
+ fclose (fp);
+ }
+
+ g_free (filename);
+ return r;
+}
+
+static void
+free_pubkey (struct rsa_key *k)
+{
+ gcry_mpi_release (k->n);
+ gcry_mpi_release (k->e);
+
+ g_free (k);
+}
+
+static gboolean
+gtk_migration_auth_validate_request (char *display, char *data)
+{
+ u_int32_t key_id;
+ char *ep;
+ char *p;
+ struct rsa_key *k;
+ char hash[20];
+ gboolean rc;
+
+ p = strchr (data, ' ');
+ if (p == NULL)
+ return FALSE;
+ *p++ = 0;
+
+ key_id = strtoul (data, &ep, 16);
+ if (*ep)
+ return FALSE;
+
+ k = lookup_pubkey (key_id);
+ if (k == NULL)
+ return FALSE;
+
+ gtk_migration_crypt_create_hash (display, gtk_migration_auth_challenge_string,
+ strlen (gtk_migration_auth_challenge_string), hash);
+
+ rc = gtk_migration_crypt_check_signature (k, hash, p);
+
+ free_pubkey (k);
+
+ return rc;
+}
+
+static int
+do_change_display (GtkWidget *w, char *display_name)
+{
+ GdkDisplay *newdisplay;
+ guint screen_nr = 1;
+ guint i;
+
+ if (display_name[0] == 0)
+ return DISPLAY_CHANGE_INDETERMINATE_ERROR;
+
+ i = strlen (display_name) - 1;
+ while (i > 0 && isdigit (display_name[i]))
+ i--;
+
+ if (display_name[i] == '.')
+ {
+ screen_nr = atoi (display_name + i + 1);
+ display_name[i] = 0;
+ }
+
+ newdisplay = gdk_display_open (display_name);
+ if (newdisplay)
+ {
+ GdkScreen *screen = gdk_display_get_screen (newdisplay, screen_nr);
+ if (screen)
+ {
+ gtk_window_set_screen (GTK_WINDOW (w), screen);
+ gdk_display_manager_set_default_display (gdk_display_manager_get (),
+ newdisplay);
+ return DISPLAY_CHANGE_SUCCESS;
+ }
+ else
+ return DISPLAY_CHANGE_NO_SUCH_SCREEN;
+ }
+
+ return DISPLAY_CHANGE_UNABLE_TO_CONNECT;
+}
+
+static void
+set_challenge_on_window (GdkWindow *window)
+{
+ gdk_property_change (window, rsa_challenge_gdkatom, string_gdkatom,
+ 8, GDK_PROP_MODE_REPLACE, gtk_migration_auth_challenge_string,
+ strlen (gtk_migration_auth_challenge_string));
+}
+
+static void
+update_challenge_on_windows (void)
+{
+ GSList *i;
+
+ gtk_migration_auth_update_challenge ();
+
+ for (i = all_widgets; i; i = i->next)
+ {
+ GtkWidget *w = GTK_WIDGET (i->data);
+ if (w->window)
+ set_challenge_on_window (w->window);
+ }
+}
+
+static void
+reset_state (GdkWindow *window)
+{
+ gdk_property_change (window, display_change_gdkatom, string_gdkatom,
+ 8, GDK_PROP_MODE_REPLACE, NULL, 0);
+}
+
+static void
+generate_response (GdkDisplay *gdisplay, Display *dpy, Window window, int code)
+{
+ XClientMessageEvent ev;
+ Atom atom = gdk_x11_atom_to_xatom_for_display (gdisplay,
+ display_change_gdkatom);
+
+ memset (&ev, 0, sizeof (ev));
+
+ ev.type = ClientMessage;
+ ev.window = window;
+ ev.message_type = atom;
+ ev.format = 32;
+
+ ev.data.l[0] = window;
+ ev.data.l[1] = code;
+
+ XSendEvent (dpy, DefaultRootWindow (dpy), False, SubstructureNotifyMask, (XEvent *)&ev);
+}
+
+static int
+handle_request (GdkWindow *gwindow, char *prop)
+{
+ GtkWidget *widget;
+ char *target, *auth_method, *auth_data;
+ char *p;
+
+ target = prop;
+ auth_method = "NULL";
+ auth_data = NULL;
+
+ p = strchr (prop, ' ');
+ if (p)
+ {
+ *p = 0;
+ auth_method = ++p;
+
+ p = strchr (p, ' ');
+ if (p)
+ {
+ *p = 0;
+ auth_data = ++p;
+ }
+ }
+
+ if (no_auth == FALSE)
+ {
+ if (!strcasecmp (auth_method, "null"))
+ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
+ else if (!strcasecmp (auth_method, "rsa-sig"))
+ {
+ if (gtk_migration_auth_validate_request (target, auth_data) == FALSE)
+ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
+ }
+ else
+ return DISPLAY_CHANGE_AUTHENTICATION_BAD;
+ }
+
+ gdk_window_get_user_data (gwindow, (gpointer*) &widget);
+
+ if (widget)
+ return do_change_display (widget, target);
+
+ return DISPLAY_CHANGE_INDETERMINATE_ERROR;
+}
+
+static GdkFilterReturn
+filter_func (GdkXEvent *xevp, GdkEvent *ev, gpointer p)
+{
+ XPropertyEvent *xev = (XPropertyEvent *)xevp;
+
+ if (xev->type == PropertyNotify)
+ {
+ GdkDisplay *gdisplay;
+ Atom atom;
+
+ gdisplay = gdk_x11_lookup_xdisplay (xev->display);
+ if (gdisplay)
+ {
+ atom = gdk_x11_atom_to_xatom_for_display (gdisplay, display_change_gdkatom);
+
+ if (xev->atom == atom)
+ {
+ GdkWindow *gwindow;
+
+ gwindow = gdk_window_lookup_for_display (gdisplay, xev->window);
+
+ if (gwindow)
+ {
+ GdkAtom actual_type;
+ gint actual_format;
+ gint actual_length;
+ unsigned char *prop = NULL;
+
+ if (gdk_property_get (gwindow, display_change_gdkatom, string_gdkatom,
+ 0, G_MAXLONG, FALSE, &actual_type, &actual_format,
+ &actual_length, &prop))
+ {
+ if (actual_length != 0)
+ {
+ if (actual_type == string_gdkatom && actual_length > 8)
+ {
+ gchar *buf = g_malloc (actual_length + 1);
+ int rc;
+
+ memcpy (buf, prop, actual_length);
+ buf[actual_length] = 0;
+
+ rc = handle_request (gwindow, buf);
+
+ g_free (buf);
+ generate_response (gdisplay, xev->display, xev->window, rc);
+
+ if (rc == DISPLAY_CHANGE_SUCCESS)
+ update_challenge_on_windows ();
+ }
+
+ reset_state (gwindow);
+ }
+ }
+
+ if (prop)
+ g_free (prop);
+ }
+ }
+
+ return GDK_FILTER_REMOVE;
+ }
+ }
+
+ return GDK_FILTER_CONTINUE;
+}
+
+static void
+unrealize_window (GtkWidget *w)
+{
+ all_widgets = g_slist_remove (all_widgets, w);
+}
+
+void
+gtk_migration_mark_window (GtkWidget *w)
+{
+ if (! gtk_migration_initialised)
+ {
+ g_warning ("gtk_migration not initialised yet");
+ return;
+ }
+
+ if (GTK_WIDGET_REALIZED (w))
+ {
+ GdkWindow *window = w->window;
+
+ gdk_window_add_filter (window, filter_func, NULL);
+
+ reset_state (window);
+ set_challenge_on_window (window);
+
+ all_widgets = g_slist_append (all_widgets, w);
+
+ g_signal_connect (G_OBJECT (w), "unrealize", G_CALLBACK (unrealize_window), NULL);
+ }
+ else
+ g_signal_connect (G_OBJECT (w), "realize", G_CALLBACK (gtk_migration_mark_window), NULL);
+}
+
+void
+gtk_migration_init (void)
+{
+ if (getenv ("GPE_DISPLAY_MIGRATION_NO_AUTH") != NULL)
+ no_auth = TRUE;
+
+ string_gdkatom = gdk_atom_intern ("STRING", FALSE);
+ display_change_gdkatom = gdk_atom_intern ("_GPE_DISPLAY_CHANGE", FALSE);
+ rsa_challenge_gdkatom = gdk_atom_intern ("_GPE_DISPLAY_CHANGE_RSA_CHALLENGE", FALSE);
+
+ gtk_migration_auth_generate_challenge ();
+
+ gtk_migration_initialised = TRUE;
+}

View File

@ -0,0 +1,26 @@
diff -ruN gtk+-2.0.6.orig/configure gtk+-2.0.6/configure
--- gtk+-2.0.6.orig/configure 2002-08-31 03:49:07.000000000 +0900
+++ gtk+-2.0.6/configure 2002-08-31 03:52:45.000000000 +0900
@@ -7904,7 +7904,8 @@
if test "$os_win32" != yes; then
# libtool option to control which symbols are exported
# right now, symbols starting with _ are not exported
- LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[^_].*"'
+ # Disabled until -export-symbols-regex works (RH patch)
+ LIBTOOL_EXPORT_OPTIONS=
else
# We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
LIBTOOL_EXPORT_OPTIONS=
diff -ruN gtk+-2.0.6.orig/configure.in gtk+-2.0.6/configure.in
--- gtk+-2.0.6.orig/configure.in 2002-08-31 03:49:07.000000000 +0900
+++ gtk+-2.0.6/configure.in 2002-08-31 03:51:22.000000000 +0900
@@ -273,7 +273,8 @@
if test "$os_win32" != yes; then
# libtool option to control which symbols are exported
# right now, symbols starting with _ are not exported
- LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
+ # Disabled until -export-symbols-regex works (RH patch)
+ LIBTOOL_EXPORT_OPTIONS=
else
# We currently use .def files on Windows (for gdk-pixbuf, gdk and gtk)
LIBTOOL_EXPORT_OPTIONS=

View File

@ -0,0 +1,33 @@
diff -ruN gtk+-2.2.0.orig/modules/input/Makefile.am gtk+-2.2.0/modules/input/Makefile.am
--- gtk+-2.2.0.orig/modules/input/Makefile.am 2003-01-06 23:40:37.000000000 +0900
+++ gtk+-2.2.0/modules/input/Makefile.am 2003-01-06 23:46:35.000000000 +0900
@@ -118,7 +118,12 @@
im-viqr.la
gtk.immodules: Makefile.am $(module_LTLIBRARIES)
- $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules
+ @if $(RUN_QUERY_IMMODULES_TEST) ; then \
+ $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules ; \
+ else \
+ touch $@ ; \
+ fi
+
CLEANFILES = gtk.immodules
diff -ruN gtk+-2.2.0.orig/modules/input/Makefile.in gtk+-2.2.0/modules/input/Makefile.in
--- gtk+-2.2.0.orig/modules/input/Makefile.in 2003-01-06 23:39:08.000000000 +0900
+++ gtk+-2.2.0/modules/input/Makefile.in 2003-01-06 23:46:44.000000000 +0900
@@ -785,7 +785,11 @@
rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules
gtk.immodules: Makefile.am $(module_LTLIBRARIES)
- $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules
+ @if $(RUN_QUERY_IMMODULES_TEST) ; then \
+ $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules ; \
+ else \
+ touch $@ ; \
+ fi
@CROSS_COMPILING_FALSE@all-local: gtk.immodules
# Tell versions [3.59,3.63) of GNU make to not export all variables.

View File

@ -0,0 +1,18 @@
diff -Nur gtk+-2.4.9.orig/gdk-pixbuf/io-ico.c gtk+-2.4.9/gdk-pixbuf/io-ico.c
--- gtk+-2.4.9.orig/gdk-pixbuf/io-ico.c 2004-08-25 18:52:18.000000000 +0200
+++ gtk+-2.4.9/gdk-pixbuf/io-ico.c 2004-09-15 00:40:17.000000000 +0200
@@ -210,6 +210,14 @@
State->HeaderSize = 6 + IconCount*16;
+ if (State->HeaderSize < 0) {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Invalid header in icon"));
+ return;
+ }
+
if (State->HeaderSize>State->BytesInHeaderBuf) {
guchar *tmp=g_try_realloc(State->HeaderBuf,State->HeaderSize);
if (!tmp) {

View File

@ -0,0 +1,11 @@
--- gtk/updateiconcache.c.orig 2005-02-06 21:08:09.638762480 +0100
+++ gtk+-2.6.2/gtk/updateiconcache.c 2005-02-06 21:15:13.639304600 +0100
@@ -53,7 +53,7 @@
gchar *cache_path;
int retval;
- retval = g_stat (path, &path_stat);
+ retval = stat (path, &path_stat);
if (retval < 0)
{

View File

@ -0,0 +1,24 @@
--- gtk+-2.4.1/docs/tutorial/Makefile.am~ 2003-05-06 22:54:20.000000000 +0100
+++ gtk+-2.4.1/docs/tutorial/Makefile.am 2004-05-08 12:31:41.000000000 +0100
@@ -52,21 +52,5 @@
dist-hook: html
cp -Rp $(srcdir)/html $(distdir)
-else
-html:
- echo "***"
- echo "*** Warning: Tutorial not built"
- echo "***"
-
-pdf:
- echo "***"
- echo "*** Warning: Tutorial not built"
- echo "***"
-
-dist-hook:
- echo "***"
- echo "*** Warning: Tutorial not built"
- echo "*** DISTRIBUTION IS INCOMPLETE"
- echo "***"
endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
--- gtk+-2.6.4/configure.in 2005-03-30 15:05:06.000000000 +0300
+++ gtk+-2.6.4/configure.in 2005-03-30 15:07:36.000000000 +0300
@@ -202,6 +202,15 @@
[AC_HELP_STRING([--disable-visibility],
[don't use ELF visibility attributes])],,
[enable_visibility=yes])
+# modification for Device to disable keyboard shortcuts
+AC_ARG_ENABLE(shortcuts,
+ [AC_HELP_STRING([--disable-shortcuts],
+ [disable keyboard shortcuts])],,
+ [enable_shortcuts=yes])
+
+if test "x$enable_shortcuts" = "xno"; then
+ GTK_EXTRA_CFLAGS="$GTK_EXTRA_CFLAGS -DDISABLE_KEYBOARD_SHORTCUTS"
+fi;
AC_ARG_WITH(xinput,
[AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])])
@@ -418,7 +427,7 @@
# sure that both po/ and po-properties/ have .po files that correspond
# to your language. If you only add one to po/, the build will break
# in po-properties/.
-ALL_LINGUAS="af am ar az az_IR be bg bn br bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu ia id is it ja ko li lt lv mi mk ml mn mr ms nb ne nl nn no nso pa pl pt pt_BR ro ru rw sk sl sq sr sr@ije sr@Latn sv ta th tk tr uk uz uz@Latn vi wa xh yi zh_CN zh_TW"
+ALL_LINGUAS=""
AM_GLIB_GNU_GETTEXT
LIBS="$LIBS $INTLLIBS"
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
@@ -1283,6 +1292,17 @@
GDK_EXTRA_CFLAGS="`$PKG_CONFIG --cflags xfixes` $GDK_EXTRA_CFLAGS"
GDK_EXTRA_LIBS="`$PKG_CONFIG --libs xfixes` $GDK_EXTRA_LIBS"
fi
+
+ # Checks for XFixes extension
+
+ have_xfixes=false
+ PKG_CHECK_MODULES(XFIXES, xfixes, have_xfixes=true, :)
+
+ if $have_xfixes ; then
+ AC_DEFINE(HAVE_XFIXES, 1, Have the XFIXES X extension)
+ GDK_EXTRA_CFLAGS="`$PKG_CONFIG --cflags xfixes` $GDK_EXTRA_CFLAGS"
+ GDK_EXTRA_LIBS="`$PKG_CONFIG --libs xfixes` $GDK_EXTRA_LIBS"
+ fi
# Xshm checks
@@ -1492,7 +1512,6 @@
GTK_PACKAGES=atk
GTK_EXTRA_LIBS=
-GTK_EXTRA_CFLAGS=
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"

View File

@ -0,0 +1,11 @@
--- gtk+-2.4.3/gtk/gtktooltips.c.old 2004-07-04 18:52:04.000000000 +0100
+++ gtk+-2.4.3/gtk/gtktooltips.c 2004-07-04 18:52:08.000000000 +0100
@@ -118,7 +118,7 @@
tooltips->tips_data_list = NULL;
tooltips->delay = DEFAULT_DELAY;
- tooltips->enabled = TRUE;
+ tooltips->enabled = FALSE;
tooltips->timer_tag = 0;
tooltips->use_sticky_delay = FALSE;
tooltips->last_popdown.tv_sec = -1;

View File

@ -0,0 +1,38 @@
--- gtk+-2.6.4/gdk/x11/gdkwindow-x11.c 2005-01-25 20:51:36.000000000 +0200
+++ gtk+-2.6.4/gdk/x11/gdkwindow-x11.c 2005-04-06 16:19:35.350164320 +0300
@@ -1286,6 +1286,7 @@
GdkToplevelX11 *toplevel;
Atom atoms[7];
gint i;
+ gint propmode;
private = (GdkWindowObject*) window;
toplevel = _gdk_x11_window_get_toplevel (window);
@@ -1295,6 +1296,12 @@
update_wm_hints (window, TRUE);
+ /* If the window has _NET_WM_STATE key specified, use it as the property mode */
+ propmode = (gint)g_object_get_data (G_OBJECT (window), "_NET_WM_STATE");
+
+ if (!propmode)
+ propmode = PropModeReplace;
+
/* We set the spec hints regardless of whether the spec is supported,
* since it can't hurt and it's kind of expensive to check whether
* it's supported.
@@ -1366,10 +1373,11 @@
XChangeProperty (xdisplay,
xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
- XA_ATOM, 32, PropModeReplace,
+ XA_ATOM, 32, propmode,
(guchar*) atoms, i);
- }
- else
+ }
+ /* Don't delete the property, unless we are replacing it */
+ else if (propmode == PropModeReplace )
{
XDeleteProperty (xdisplay,
xwindow,

View File

@ -0,0 +1,236 @@
--- gtk+-2.4.1/gtk/gtkarrow.c 2004-03-13 09:51:13.000000000 +1100
+++ gtk+-2.4.1/gtk/gtkarrow.c 2004-05-26 14:52:17.000000000 +1000
@@ -29,7 +29,7 @@
#include "gtkarrow.h"
#include "gtkintl.h"
-#define MIN_ARROW_SIZE 15
+#define MIN_ARROW_SIZE 7
enum {
PROP_0,
@@ -53,6 +53,8 @@
guint prop_id,
GValue *value,
GParamSpec *pspec);
+static void gtk_arrow_size_request (GtkWidget *arrow,
+ GtkRequisition *requisition);
GType
gtk_arrow_get_type (void)
@@ -111,6 +113,7 @@
G_PARAM_READABLE | G_PARAM_WRITABLE));
widget_class->expose_event = gtk_arrow_expose;
+ widget_class->size_request = gtk_arrow_size_request;
}
static void
@@ -166,13 +169,18 @@
}
static void
+gtk_arrow_size_request (GtkWidget *arrow,
+ GtkRequisition *requisition)
+{
+ requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
+ requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+}
+
+static void
gtk_arrow_init (GtkArrow *arrow)
{
GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
- GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
- GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
-
arrow->arrow_type = GTK_ARROW_RIGHT;
arrow->shadow_type = GTK_SHADOW_OUT;
}
--- gtk+-2.4.1/gtk/gtkcalendar.c 2004-03-06 14:37:26.000000000 +1100
+++ gtk+-2.4.1/gtk/gtkcalendar.c 2004-05-26 14:58:57.000000000 +1000
@@ -340,6 +340,9 @@
static void gtk_calendar_select_and_focus_day (GtkCalendar *calendar,
guint day);
+static void gtk_calendar_do_select_day (GtkCalendar *calendar,
+ guint day);
+
static void gtk_calendar_paint_arrow (GtkWidget *widget,
guint arrow);
static void gtk_calendar_paint_day_num (GtkWidget *widget,
@@ -861,13 +864,13 @@
if (month_len < calendar->selected_day)
{
calendar->selected_day = 0;
- gtk_calendar_select_day (calendar, month_len);
+ gtk_calendar_do_select_day (calendar, month_len);
}
else
{
if (calendar->selected_day < 0)
calendar->selected_day = calendar->selected_day + 1 + month_length[leap (calendar->year)][calendar->month + 1];
- gtk_calendar_select_day (calendar, calendar->selected_day);
+ gtk_calendar_do_select_day (calendar, calendar->selected_day);
}
gtk_widget_queue_draw (GTK_WIDGET (calendar));
@@ -908,10 +911,10 @@
if (month_len < calendar->selected_day)
{
calendar->selected_day = 0;
- gtk_calendar_select_day (calendar, month_len);
+ gtk_calendar_do_select_day (calendar, month_len);
}
else
- gtk_calendar_select_day (calendar, calendar->selected_day);
+ gtk_calendar_do_select_day (calendar, calendar->selected_day);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
gtk_calendar_thaw (calendar);
@@ -939,10 +942,10 @@
if (month_len < calendar->selected_day)
{
calendar->selected_day = 0;
- gtk_calendar_select_day (calendar, month_len);
+ gtk_calendar_do_select_day (calendar, month_len);
}
else
- gtk_calendar_select_day (calendar, calendar->selected_day);
+ gtk_calendar_do_select_day (calendar, calendar->selected_day);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
gtk_calendar_thaw (calendar);
@@ -974,10 +977,10 @@
if (month_len < calendar->selected_day)
{
calendar->selected_day = 0;
- gtk_calendar_select_day (calendar, month_len);
+ gtk_calendar_do_select_day (calendar, month_len);
}
else
- gtk_calendar_select_day (calendar, calendar->selected_day);
+ gtk_calendar_do_select_day (calendar, calendar->selected_day);
gtk_widget_queue_draw (GTK_WIDGET (calendar));
gtk_calendar_thaw (calendar);
@@ -2480,9 +2483,9 @@
return TRUE;
}
-void
-gtk_calendar_select_day (GtkCalendar *calendar,
- guint day)
+static void
+gtk_calendar_do_select_day (GtkCalendar *calendar,
+ guint day)
{
g_return_if_fail (GTK_IS_CALENDAR (calendar));
g_return_if_fail (day <= 31);
@@ -2499,6 +2502,13 @@
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
gtk_calendar_paint_day_num (GTK_WIDGET (calendar), selected_day);
}
+}
+
+void
+gtk_calendar_select_day (GtkCalendar *calendar,
+ guint day)
+{
+ gtk_calendar_do_select_day (calendar, day);
calendar->selected_day = day;
--- gtk+-2.4.1/gtk/gtkentry.c 2004-04-22 08:08:08.000000000 +1000
+++ gtk+-2.4.1/gtk/gtkentry.c 2004-05-26 14:52:17.000000000 +1000
@@ -557,6 +557,15 @@
0.0,
G_PARAM_READABLE | G_PARAM_WRITABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("min_width",
+ _("Minimum width"),
+ _("Minimum width of the entry field"),
+ 0,
+ G_MAXINT,
+ MIN_ENTRY_WIDTH,
+ G_PARAM_READABLE));
+
signals[POPULATE_POPUP] =
g_signal_new ("populate_popup",
G_OBJECT_CLASS_TYPE (gobject_class),
@@ -1124,7 +1133,7 @@
{
GtkEntry *entry = GTK_ENTRY (widget);
PangoFontMetrics *metrics;
- gint xborder, yborder;
+ gint xborder, yborder, min_width;
PangoContext *context;
gtk_widget_ensure_style (widget);
@@ -1140,9 +1149,11 @@
xborder += INNER_BORDER;
yborder += INNER_BORDER;
-
+
+ gtk_widget_style_get (widget, "min_width", &min_width, NULL);
+
if (entry->width_chars < 0)
- requisition->width = MIN_ENTRY_WIDTH + xborder * 2;
+ requisition->width = min_width + xborder * 2;
else
{
gint char_width = pango_font_metrics_get_approximate_char_width (metrics);
--- gtk+-2.4.1/gtk/gtkrange.c 2004-03-06 14:38:08.000000000 +1100
+++ gtk+-2.4.1/gtk/gtkrange.c 2004-05-26 14:52:17.000000000 +1000
@@ -180,6 +180,7 @@
static GtkWidgetClass *parent_class = NULL;
static guint signals[LAST_SIGNAL];
+static GdkAtom recognize_protocols_atom, atom_atom;
GType
gtk_range_get_type (void)
@@ -220,6 +221,9 @@
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
+ recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE);
+ atom_atom = gdk_atom_intern ("ATOM", FALSE);
+
parent_class = g_type_class_peek_parent (class);
gobject_class->set_property = gtk_range_set_property;
@@ -815,6 +819,12 @@
&attributes, attributes_mask);
gdk_window_set_user_data (range->event_window, range);
+ gdk_property_change (range->event_window,
+ recognize_protocols_atom,
+ atom_atom,
+ 32, GDK_PROP_MODE_REPLACE,
+ NULL, 0);
+
widget->style = gtk_style_attach (widget->style, widget->window);
}
@@ -1186,7 +1196,7 @@
/* ignore presses when we're already doing something else. */
if (range->layout->grab_location != MOUSE_OUTSIDE)
- return FALSE;
+ return TRUE;
range->layout->mouse_x = event->x;
range->layout->mouse_y = event->y;
@@ -1364,7 +1374,7 @@
return TRUE;
}
- return FALSE;
+ return TRUE;
}
/**

View File

@ -0,0 +1,10 @@
--- gtk+-2.6.4/gtk/gtk.h 2004-09-27 21:37:33.000000000 +0300
+++ gtk+-2.6.4/gtk/gtk.h 2005-04-06 16:19:35.812094096 +0300
@@ -156,6 +156,7 @@
#include <gtk/gtktearoffmenuitem.h>
#include <gtk/gtktext.h>
#include <gtk/gtktextbuffer.h>
+#include <gtk/gtktextbufferserialize.h>
#include <gtk/gtktextview.h>
#include <gtk/gtktipsquery.h>
#include <gtk/gtktoggleaction.h>

View File

@ -0,0 +1,27 @@
--- gtk+-2.6.4/gtk/Makefile.am 2005-01-13 17:18:21.000000000 +0200
+++ gtk+-2.6.4/gtk/Makefile.am 2005-04-06 16:19:35.806095008 +0300
@@ -246,6 +246,7 @@
gtktearoffmenuitem.h \
gtktext.h \
gtktextbuffer.h \
+ gtktextbufferserialize.h\
gtktextchild.h \
gtktextdisplay.h \
gtktextiter.h \
@@ -387,6 +388,8 @@
gtkframe.c \
gtkgamma.c \
gtkgc.c \
+ gtkhashtable.c \
+ gtkhashtable.h \
gtkhandlebox.c \
gtkhbbox.c \
gtkhbox.c \
@@ -470,6 +473,7 @@
gtktext.c \
gtktextbtree.c \
gtktextbuffer.c \
+ gtktextbufferserialize.c\
gtktextchild.c \
gtktextdisplay.c \
gtktextiter.c \

View File

@ -0,0 +1,292 @@
--- gtk+-2.6.4/gtk/Makefile.in 2005-03-01 17:31:32.000000000 +0200
+++ gtk+-2.6.4/gtk/Makefile.in 2005-04-06 16:19:35.808094704 +0300
@@ -485,6 +485,7 @@
gtktearoffmenuitem.h \
gtktext.h \
gtktextbuffer.h \
+ gtktextbufferserialize.h\
gtktextchild.h \
gtktextdisplay.h \
gtktextiter.h \
@@ -629,6 +630,8 @@
gtkframe.c \
gtkgamma.c \
gtkgc.c \
+ gtkhashtable.c \
+ gtkhashtable.h \
gtkhandlebox.c \
gtkhbbox.c \
gtkhbox.c \
@@ -712,6 +715,7 @@
gtktext.c \
gtktextbtree.c \
gtktextbuffer.c \
+ gtktextbufferserialize.c\
gtktextchild.c \
gtktextdisplay.c \
gtktextiter.c \
@@ -927,14 +931,14 @@
gtkfilechooserdefault.c gtkfilechooserutils.c \
gtkfilechooserwidget.c gtkfilefilter.c gtkfilesel.c \
gtkfilesystem.c gtkfilesystemmodel.c gtkfixed.c gtkfontbutton.c \
- gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhandlebox.c \
- gtkhbbox.c gtkhbox.c gtkhpaned.c gtkhruler.c gtkhscale.c \
- gtkhscrollbar.c gtkhseparator.c gtkhsv.c gtkhsv.h \
- gtkiconfactory.c gtkiconcache.c gtkicontheme.c gtkiconview.c \
- gtkimage.c gtkimagemenuitem.c gtkimcontext.c \
- gtkimcontextsimple.c gtkimmodule.c gtkimmulticontext.c \
- gtkinputdialog.c gtkintl.h gtkinvisible.c gtkitem.c \
- gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \
+ gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhashtable.c \
+ gtkhashtable.h gtkhandlebox.c gtkhbbox.c gtkhbox.c gtkhpaned.c \
+ gtkhruler.c gtkhscale.c gtkhscrollbar.c gtkhseparator.c \
+ gtkhsv.c gtkhsv.h gtkiconfactory.c gtkiconcache.c \
+ gtkicontheme.c gtkiconview.c gtkimage.c gtkimagemenuitem.c \
+ gtkimcontext.c gtkimcontextsimple.c gtkimmodule.c \
+ gtkimmulticontext.c gtkinputdialog.c gtkintl.h gtkinvisible.c \
+ gtkitem.c gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \
gtklayout.c gtklist.c gtklistitem.c gtkliststore.c gtkmain.c \
gtkmarshal.c gtkmarshalers.c gtkmenu.c gtkmenubar.c \
gtkmenuitem.c gtkmenushell.c gtkmenutoolbutton.c \
@@ -949,21 +953,21 @@
gtkseparatortoolitem.c gtksettings.c gtksignal.c gtksizegroup.c \
gtkspinbutton.c gtkstatusbar.c gtkstock.c gtkstyle.c gtktable.c \
gtktearoffmenuitem.c gtktext.c gtktextbtree.c gtktextbuffer.c \
- gtktextchild.c gtktextdisplay.c gtktextiter.c \
- gtktextiterprivate.h gtktextlayout.c gtktextmark.c \
- gtktextmarkprivate.h gtktextsegment.c gtktexttag.c \
- gtktexttagtable.c gtktexttypes.c gtktextutil.c gtktextview.c \
- gtkthemes.c gtktipsquery.c gtktoggleaction.c gtktogglebutton.c \
- gtktoggletoolbutton.c gtktoolbar.c gtktoolbutton.c \
- gtktoolitem.c gtktooltips.c gtktree.c gtktreedatalist.c \
- gtktreednd.c gtktreeitem.c gtktreemodel.c gtktreemodelfilter.c \
- gtktreemodelsort.c gtktreeselection.c gtktreesortable.c \
- gtktreestore.c gtktreeview.c gtktreeviewcolumn.c \
- gtktypebuiltins.c gtktypeutils.c gtkuimanager.c gtkvbbox.c \
- gtkvbox.c gtkviewport.c gtkvpaned.c gtkvruler.c gtkvscale.c \
- gtkvscrollbar.c gtkvseparator.c gtkwidget.c \
- gtkwindow-decorate.c gtkwindow.c xembed.h gtkfilesystemunix.c \
- gtkfilesystemwin32.c
+ gtktextbufferserialize.c gtktextchild.c gtktextdisplay.c \
+ gtktextiter.c gtktextiterprivate.h gtktextlayout.c \
+ gtktextmark.c gtktextmarkprivate.h gtktextsegment.c \
+ gtktexttag.c gtktexttagtable.c gtktexttypes.c gtktextutil.c \
+ gtktextview.c gtkthemes.c gtktipsquery.c gtktoggleaction.c \
+ gtktogglebutton.c gtktoggletoolbutton.c gtktoolbar.c \
+ gtktoolbutton.c gtktoolitem.c gtktooltips.c gtktree.c \
+ gtktreedatalist.c gtktreednd.c gtktreeitem.c gtktreemodel.c \
+ gtktreemodelfilter.c gtktreemodelsort.c gtktreeselection.c \
+ gtktreesortable.c gtktreestore.c gtktreeview.c \
+ gtktreeviewcolumn.c gtktypebuiltins.c gtktypeutils.c \
+ gtkuimanager.c gtkvbbox.c gtkvbox.c gtkviewport.c gtkvpaned.c \
+ gtkvruler.c gtkvscale.c gtkvscrollbar.c gtkvseparator.c \
+ gtkwidget.c gtkwindow-decorate.c gtkwindow.c xembed.h \
+ gtkfilesystemunix.c gtkfilesystemwin32.c
@OS_UNIX_TRUE@am__objects_1 = gtkfilesystemunix.lo
@OS_WIN32_TRUE@am__objects_2 = gtkfilesystemwin32.lo
am__objects_3 = fnmatch.lo gtkaboutdialog.lo gtkaccelgroup.lo \
@@ -986,16 +990,16 @@
gtkfilechooserutils.lo gtkfilechooserwidget.lo gtkfilefilter.lo \
gtkfilesel.lo gtkfilesystem.lo gtkfilesystemmodel.lo \
gtkfixed.lo gtkfontbutton.lo gtkfontsel.lo gtkframe.lo \
- gtkgamma.lo gtkgc.lo gtkhandlebox.lo gtkhbbox.lo gtkhbox.lo \
- gtkhpaned.lo gtkhruler.lo gtkhscale.lo gtkhscrollbar.lo \
- gtkhseparator.lo gtkhsv.lo gtkiconfactory.lo gtkiconcache.lo \
- gtkicontheme.lo gtkiconview.lo gtkimage.lo gtkimagemenuitem.lo \
- gtkimcontext.lo gtkimcontextsimple.lo gtkimmodule.lo \
- gtkimmulticontext.lo gtkinputdialog.lo gtkinvisible.lo \
- gtkitem.lo gtkitemfactory.lo gtkkeyhash.lo gtklabel.lo \
- gtklayout.lo gtklist.lo gtklistitem.lo gtkliststore.lo \
- gtkmain.lo gtkmarshal.lo gtkmarshalers.lo gtkmenu.lo \
- gtkmenubar.lo gtkmenuitem.lo gtkmenushell.lo \
+ gtkgamma.lo gtkgc.lo gtkhashtable.lo gtkhandlebox.lo \
+ gtkhbbox.lo gtkhbox.lo gtkhpaned.lo gtkhruler.lo gtkhscale.lo \
+ gtkhscrollbar.lo gtkhseparator.lo gtkhsv.lo gtkiconfactory.lo \
+ gtkiconcache.lo gtkicontheme.lo gtkiconview.lo gtkimage.lo \
+ gtkimagemenuitem.lo gtkimcontext.lo gtkimcontextsimple.lo \
+ gtkimmodule.lo gtkimmulticontext.lo gtkinputdialog.lo \
+ gtkinvisible.lo gtkitem.lo gtkitemfactory.lo gtkkeyhash.lo \
+ gtklabel.lo gtklayout.lo gtklist.lo gtklistitem.lo \
+ gtkliststore.lo gtkmain.lo gtkmarshal.lo gtkmarshalers.lo \
+ gtkmenu.lo gtkmenubar.lo gtkmenuitem.lo gtkmenushell.lo \
gtkmenutoolbutton.lo gtkmessagedialog.lo gtkmisc.lo \
gtkmnemonichash.lo gtkmodules.lo gtknotebook.lo gtkobject.lo \
gtkoldeditable.lo gtkoptionmenu.lo gtkpaned.lo gtkpathbar.lo \
@@ -1007,14 +1011,15 @@
gtkseparatormenuitem.lo gtkseparatortoolitem.lo gtksettings.lo \
gtksignal.lo gtksizegroup.lo gtkspinbutton.lo gtkstatusbar.lo \
gtkstock.lo gtkstyle.lo gtktable.lo gtktearoffmenuitem.lo \
- gtktext.lo gtktextbtree.lo gtktextbuffer.lo gtktextchild.lo \
- gtktextdisplay.lo gtktextiter.lo gtktextlayout.lo \
- gtktextmark.lo gtktextsegment.lo gtktexttag.lo \
- gtktexttagtable.lo gtktexttypes.lo gtktextutil.lo \
- gtktextview.lo gtkthemes.lo gtktipsquery.lo gtktoggleaction.lo \
- gtktogglebutton.lo gtktoggletoolbutton.lo gtktoolbar.lo \
- gtktoolbutton.lo gtktoolitem.lo gtktooltips.lo gtktree.lo \
- gtktreedatalist.lo gtktreednd.lo gtktreeitem.lo gtktreemodel.lo \
+ gtktext.lo gtktextbtree.lo gtktextbuffer.lo \
+ gtktextbufferserialize.lo gtktextchild.lo gtktextdisplay.lo \
+ gtktextiter.lo gtktextlayout.lo gtktextmark.lo \
+ gtktextsegment.lo gtktexttag.lo gtktexttagtable.lo \
+ gtktexttypes.lo gtktextutil.lo gtktextview.lo gtkthemes.lo \
+ gtktipsquery.lo gtktoggleaction.lo gtktogglebutton.lo \
+ gtktoggletoolbutton.lo gtktoolbar.lo gtktoolbutton.lo \
+ gtktoolitem.lo gtktooltips.lo gtktree.lo gtktreedatalist.lo \
+ gtktreednd.lo gtktreeitem.lo gtktreemodel.lo \
gtktreemodelfilter.lo gtktreemodelsort.lo gtktreeselection.lo \
gtktreesortable.lo gtktreestore.lo gtktreeview.lo \
gtktreeviewcolumn.lo gtktypebuiltins.lo gtktypeutils.lo \
@@ -1042,14 +1047,14 @@
gtkfilechooserdefault.c gtkfilechooserutils.c \
gtkfilechooserwidget.c gtkfilefilter.c gtkfilesel.c \
gtkfilesystem.c gtkfilesystemmodel.c gtkfixed.c gtkfontbutton.c \
- gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhandlebox.c \
- gtkhbbox.c gtkhbox.c gtkhpaned.c gtkhruler.c gtkhscale.c \
- gtkhscrollbar.c gtkhseparator.c gtkhsv.c gtkhsv.h \
- gtkiconfactory.c gtkiconcache.c gtkicontheme.c gtkiconview.c \
- gtkimage.c gtkimagemenuitem.c gtkimcontext.c \
- gtkimcontextsimple.c gtkimmodule.c gtkimmulticontext.c \
- gtkinputdialog.c gtkintl.h gtkinvisible.c gtkitem.c \
- gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \
+ gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhashtable.c \
+ gtkhashtable.h gtkhandlebox.c gtkhbbox.c gtkhbox.c gtkhpaned.c \
+ gtkhruler.c gtkhscale.c gtkhscrollbar.c gtkhseparator.c \
+ gtkhsv.c gtkhsv.h gtkiconfactory.c gtkiconcache.c \
+ gtkicontheme.c gtkiconview.c gtkimage.c gtkimagemenuitem.c \
+ gtkimcontext.c gtkimcontextsimple.c gtkimmodule.c \
+ gtkimmulticontext.c gtkinputdialog.c gtkintl.h gtkinvisible.c \
+ gtkitem.c gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \
gtklayout.c gtklist.c gtklistitem.c gtkliststore.c gtkmain.c \
gtkmarshal.c gtkmarshalers.c gtkmenu.c gtkmenubar.c \
gtkmenuitem.c gtkmenushell.c gtkmenutoolbutton.c \
@@ -1064,21 +1069,21 @@
gtkseparatortoolitem.c gtksettings.c gtksignal.c gtksizegroup.c \
gtkspinbutton.c gtkstatusbar.c gtkstock.c gtkstyle.c gtktable.c \
gtktearoffmenuitem.c gtktext.c gtktextbtree.c gtktextbuffer.c \
- gtktextchild.c gtktextdisplay.c gtktextiter.c \
- gtktextiterprivate.h gtktextlayout.c gtktextmark.c \
- gtktextmarkprivate.h gtktextsegment.c gtktexttag.c \
- gtktexttagtable.c gtktexttypes.c gtktextutil.c gtktextview.c \
- gtkthemes.c gtktipsquery.c gtktoggleaction.c gtktogglebutton.c \
- gtktoggletoolbutton.c gtktoolbar.c gtktoolbutton.c \
- gtktoolitem.c gtktooltips.c gtktree.c gtktreedatalist.c \
- gtktreednd.c gtktreeitem.c gtktreemodel.c gtktreemodelfilter.c \
- gtktreemodelsort.c gtktreeselection.c gtktreesortable.c \
- gtktreestore.c gtktreeview.c gtktreeviewcolumn.c \
- gtktypebuiltins.c gtktypeutils.c gtkuimanager.c gtkvbbox.c \
- gtkvbox.c gtkviewport.c gtkvpaned.c gtkvruler.c gtkvscale.c \
- gtkvscrollbar.c gtkvseparator.c gtkwidget.c \
- gtkwindow-decorate.c gtkwindow.c xembed.h gtkfilesystemunix.c \
- gtkfilesystemwin32.c
+ gtktextbufferserialize.c gtktextchild.c gtktextdisplay.c \
+ gtktextiter.c gtktextiterprivate.h gtktextlayout.c \
+ gtktextmark.c gtktextmarkprivate.h gtktextsegment.c \
+ gtktexttag.c gtktexttagtable.c gtktexttypes.c gtktextutil.c \
+ gtktextview.c gtkthemes.c gtktipsquery.c gtktoggleaction.c \
+ gtktogglebutton.c gtktoggletoolbutton.c gtktoolbar.c \
+ gtktoolbutton.c gtktoolitem.c gtktooltips.c gtktree.c \
+ gtktreedatalist.c gtktreednd.c gtktreeitem.c gtktreemodel.c \
+ gtktreemodelfilter.c gtktreemodelsort.c gtktreeselection.c \
+ gtktreesortable.c gtktreestore.c gtktreeview.c \
+ gtktreeviewcolumn.c gtktypebuiltins.c gtktypeutils.c \
+ gtkuimanager.c gtkvbbox.c gtkvbox.c gtkviewport.c gtkvpaned.c \
+ gtkvruler.c gtkvscale.c gtkvscrollbar.c gtkvseparator.c \
+ gtkwidget.c gtkwindow-decorate.c gtkwindow.c xembed.h \
+ gtkfilesystemunix.c gtkfilesystemwin32.c
am_libgtk_win32_2_0_la_OBJECTS = $(am__objects_3)
libgtk_win32_2_0_la_OBJECTS = $(am_libgtk_win32_2_0_la_OBJECTS)
@OS_UNIX_TRUE@libgtk_x11_2_0_la_DEPENDENCIES = \
@@ -1106,14 +1111,14 @@
gtkfilechooserdefault.c gtkfilechooserutils.c \
gtkfilechooserwidget.c gtkfilefilter.c gtkfilesel.c \
gtkfilesystem.c gtkfilesystemmodel.c gtkfixed.c gtkfontbutton.c \
- gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhandlebox.c \
- gtkhbbox.c gtkhbox.c gtkhpaned.c gtkhruler.c gtkhscale.c \
- gtkhscrollbar.c gtkhseparator.c gtkhsv.c gtkhsv.h \
- gtkiconfactory.c gtkiconcache.c gtkicontheme.c gtkiconview.c \
- gtkimage.c gtkimagemenuitem.c gtkimcontext.c \
- gtkimcontextsimple.c gtkimmodule.c gtkimmulticontext.c \
- gtkinputdialog.c gtkintl.h gtkinvisible.c gtkitem.c \
- gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \
+ gtkfontsel.c gtkframe.c gtkgamma.c gtkgc.c gtkhashtable.c \
+ gtkhashtable.h gtkhandlebox.c gtkhbbox.c gtkhbox.c gtkhpaned.c \
+ gtkhruler.c gtkhscale.c gtkhscrollbar.c gtkhseparator.c \
+ gtkhsv.c gtkhsv.h gtkiconfactory.c gtkiconcache.c \
+ gtkicontheme.c gtkiconview.c gtkimage.c gtkimagemenuitem.c \
+ gtkimcontext.c gtkimcontextsimple.c gtkimmodule.c \
+ gtkimmulticontext.c gtkinputdialog.c gtkintl.h gtkinvisible.c \
+ gtkitem.c gtkitemfactory.c gtkkeyhash.c gtkkeyhash.h gtklabel.c \
gtklayout.c gtklist.c gtklistitem.c gtkliststore.c gtkmain.c \
gtkmarshal.c gtkmarshalers.c gtkmenu.c gtkmenubar.c \
gtkmenuitem.c gtkmenushell.c gtkmenutoolbutton.c \
@@ -1128,22 +1133,22 @@
gtkseparatortoolitem.c gtksettings.c gtksignal.c gtksizegroup.c \
gtkspinbutton.c gtkstatusbar.c gtkstock.c gtkstyle.c gtktable.c \
gtktearoffmenuitem.c gtktext.c gtktextbtree.c gtktextbuffer.c \
- gtktextchild.c gtktextdisplay.c gtktextiter.c \
- gtktextiterprivate.h gtktextlayout.c gtktextmark.c \
- gtktextmarkprivate.h gtktextsegment.c gtktexttag.c \
- gtktexttagtable.c gtktexttypes.c gtktextutil.c gtktextview.c \
- gtkthemes.c gtktipsquery.c gtktoggleaction.c gtktogglebutton.c \
- gtktoggletoolbutton.c gtktoolbar.c gtktoolbutton.c \
- gtktoolitem.c gtktooltips.c gtktree.c gtktreedatalist.c \
- gtktreednd.c gtktreeitem.c gtktreemodel.c gtktreemodelfilter.c \
- gtktreemodelsort.c gtktreeselection.c gtktreesortable.c \
- gtktreestore.c gtktreeview.c gtktreeviewcolumn.c \
- gtktypebuiltins.c gtktypeutils.c gtkuimanager.c gtkvbbox.c \
- gtkvbox.c gtkviewport.c gtkvpaned.c gtkvruler.c gtkvscale.c \
- gtkvscrollbar.c gtkvseparator.c gtkwidget.c \
- gtkwindow-decorate.c gtkwindow.c xembed.h gtkfilesystemunix.c \
- gtkfilesystemwin32.c gtkplug.c gtksocket.c gtkxembed.c \
- gtkxembed.h
+ gtktextbufferserialize.c gtktextchild.c gtktextdisplay.c \
+ gtktextiter.c gtktextiterprivate.h gtktextlayout.c \
+ gtktextmark.c gtktextmarkprivate.h gtktextsegment.c \
+ gtktexttag.c gtktexttagtable.c gtktexttypes.c gtktextutil.c \
+ gtktextview.c gtkthemes.c gtktipsquery.c gtktoggleaction.c \
+ gtktogglebutton.c gtktoggletoolbutton.c gtktoolbar.c \
+ gtktoolbutton.c gtktoolitem.c gtktooltips.c gtktree.c \
+ gtktreedatalist.c gtktreednd.c gtktreeitem.c gtktreemodel.c \
+ gtktreemodelfilter.c gtktreemodelsort.c gtktreeselection.c \
+ gtktreesortable.c gtktreestore.c gtktreeview.c \
+ gtktreeviewcolumn.c gtktypebuiltins.c gtktypeutils.c \
+ gtkuimanager.c gtkvbbox.c gtkvbox.c gtkviewport.c gtkvpaned.c \
+ gtkvruler.c gtkvscale.c gtkvscrollbar.c gtkvseparator.c \
+ gtkwidget.c gtkwindow-decorate.c gtkwindow.c xembed.h \
+ gtkfilesystemunix.c gtkfilesystemwin32.c gtkplug.c gtksocket.c \
+ gtkxembed.c gtkxembed.h
am__objects_4 = gtkplug.lo gtksocket.lo gtkxembed.lo
am_libgtk_x11_2_0_la_OBJECTS = $(am__objects_3) $(am__objects_4)
libgtk_x11_2_0_la_OBJECTS = $(am_libgtk_x11_2_0_la_OBJECTS)
@@ -1224,6 +1229,7 @@
@AMDEP_TRUE@ ./$(DEPDIR)/gtkfontsel.Plo ./$(DEPDIR)/gtkframe.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtkgamma.Plo ./$(DEPDIR)/gtkgc.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtkhandlebox.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/gtkhashtable.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtkhbbox.Plo ./$(DEPDIR)/gtkhbox.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtkhpaned.Plo ./$(DEPDIR)/gtkhruler.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtkhscale.Plo \
@@ -1292,6 +1298,7 @@
@AMDEP_TRUE@ ./$(DEPDIR)/gtktext.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtktextbtree.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtktextbuffer.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/gtktextbufferserialize.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtktextchild.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtktextdisplay.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/gtktextiter.Plo \
@@ -1524,6 +1531,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkgamma.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkgc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhandlebox.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhashtable.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhbbox.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhbox.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtkhpaned.Plo@am__quote@
@@ -1604,6 +1612,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktext.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextbtree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextbuffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextbufferserialize.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextchild.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextdisplay.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtktextiter.Plo@am__quote@

View File

@ -0,0 +1,17 @@
--- gtk+-2.6.4/gtk/gtkalias.h 2005-03-01 17:58:16.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkalias.h 2005-04-06 16:19:36.020062480 +0300
@@ -5782,6 +5782,14 @@
extern __typeof (gtk_menu_shell_select_item) gtk_menu_shell_select_item __attribute((alias("IA__gtk_menu_shell_select_item"), visibility("default")));
#define gtk_menu_shell_select_item IA__gtk_menu_shell_select_item
+extern __typeof (gtk_menu_shell_set_take_focus) IA__gtk_menu_shell_set_take_focus __attribute((visibility("hidden")));
+extern __typeof (gtk_menu_shell_set_take_focus) gtk_menu_shell_set_take_focus __attribute((alias("IA__gtk_menu_shell_set_take_focus"), visibility("default")));
+#define gtk_menu_shell_set_take_focus IA__gtk_menu_shell_set_take_focus
+
+extern __typeof (gtk_menu_shell_get_take_focus) IA__gtk_menu_shell_get_take_focus __attribute((visibility("hidden")));
+extern __typeof (gtk_menu_shell_get_take_focus) gtk_menu_shell_get_take_focus __attribute((alias("IA__gtk_menu_shell_get_take_focus"), visibility("default")));
+#define gtk_menu_shell_get_take_focus IA__gtk_menu_shell_get_take_focus
+
extern __typeof (gtk_menu_tool_button_get_menu) IA__gtk_menu_tool_button_get_menu __attribute((visibility("hidden")));
extern __typeof (gtk_menu_tool_button_get_menu) gtk_menu_tool_button_get_menu __attribute((alias("IA__gtk_menu_tool_button_get_menu"), visibility("default")));
#define gtk_menu_tool_button_get_menu IA__gtk_menu_tool_button_get_menu

View File

@ -0,0 +1,471 @@
--- gtk+-2.6.4/gtk/gtkbutton.c 2005-01-25 22:54:43.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkbutton.c 2005-04-06 16:19:36.249027672 +0300
@@ -24,6 +24,10 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list
+ * of changes.
+ */
+
#include <config.h>
#include <string.h>
#include "gtkalias.h"
@@ -38,8 +42,33 @@
#include "gtkiconfactory.h"
#include "gtkintl.h"
+/* Osso addition:
+ * Here are the details for each attach
+ * bitmask combination. */
+const gchar *osso_gtk_button_attach_details [OSSO_GTK_BUTTON_ATTACH_ENUM_END] =
+ { "osso_button",
+ "osso_button_n",
+ "osso_button_e",
+ "osso_button_ne",
+ "osso_button_s",
+ "osso_button_ns",
+ "osso_button_es",
+ "osso_button_nes",
+ "osso_button_w",
+ "osso_button_nw",
+ "osso_button_ew",
+ "osso_button_new",
+ "osso_button_sw",
+ "osso_button_nsw",
+ "osso_button_esw",
+ "osso_button_nesw",
+ };
+
#define CHILD_SPACING 1
+/* Take this away after font drawing is fixed */
+#define OSSO_FONT_HACK TRUE
+
static const GtkBorder default_default_border = { 1, 1, 1, 1 };
static const GtkBorder default_default_outside_border = { 0, 0, 0, 0 };
@@ -68,6 +97,9 @@
PROP_FOCUS_ON_CLICK,
PROP_XALIGN,
PROP_YALIGN,
+ PROP_DETAIL,
+ PROP_AUTOMATIC_DETAIL,
+ PROP_KEYBOARD_BUTTON
};
#define GTK_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_BUTTON, GtkButtonPrivate))
@@ -80,6 +112,10 @@
GtkWidget *image;
guint align_set : 1;
guint image_is_stock : 1;
+ gchar *detail;
+ gboolean automatic_detail;
+ gboolean keyboard_button;
+ GtkLabel *keyboard_label;
};
static void gtk_button_class_init (GtkButtonClass *klass);
@@ -231,6 +267,14 @@
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class,
+ PROP_KEYBOARD_BUTTON,
+ g_param_spec_boolean ("keyboard_button",
+ P_("Keyboard button"),
+ P_("If set, label foo"),
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (gobject_class,
PROP_USE_STOCK,
g_param_spec_boolean ("use_stock",
P_("Use stock"),
@@ -418,6 +462,77 @@
P_("Whether stock icons should be shown in buttons"),
TRUE,
G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("child_spacing",
+ _("Child spacing"),
+ _("Spacing between button edges and child."),
+ 0,
+ G_MAXINT,
+ CHILD_SPACING,
+ G_PARAM_READABLE));
+ /* Osso additions below */
+ g_object_class_install_property (gobject_class,
+ PROP_DETAIL,
+ g_param_spec_string ("detail",
+ P_("Detail"),
+ P_("The detail the button is drawn with."),
+ "buttondefault",
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class,
+ PROP_AUTOMATIC_DETAIL,
+ g_param_spec_boolean ("automatic_detail",
+ P_("Automatic Detail"),
+ P_("Whether setting detail is automatic based on GtkTable/GtkHButtonBox."),
+ TRUE,
+ G_PARAM_READWRITE));
+
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("child_offset_y",
+ _("Child Y Offset"),
+ _("Enable hack how many pixels to add/take away from GtkButton's child size allocation."),
+ G_MININT,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+
+ /* OSSO: This is used to find out whether
+ * button is a GtkTreeView column Listbox
+ * header or not */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("listboxheader",
+ P_( "Listbox header" ),
+ P_( "Listbox header ( FALSE / TRUE )" ),
+ FALSE,
+ G_PARAM_READABLE));
+
+ /* OSSO: Column Listbox header separator height */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("separator-height",
+ P_( "Separator height" ),
+ P_( "Listbox header separator height ( FALSE / TRUE )" ),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boxed ("padding",
+ P_("Padding"),
+ P_("Paddings around the button child"),
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("minimum_width",
+ P_("Minimum Width"),
+ P_("Minimum width of the button"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
g_type_class_add_private (gobject_class, sizeof (GtkButtonPrivate));
}
@@ -445,7 +560,14 @@
priv->xalign = 0.5;
priv->yalign = 0.5;
priv->align_set = 0;
+ priv->detail = g_strdup("buttondefault");
+ priv->automatic_detail = TRUE;
+ priv->keyboard_button = FALSE;
+ priv->keyboard_label = NULL;
priv->image_is_stock = TRUE;
+
+ g_object_set (G_OBJECT (button), "tap_and_hold_state",
+ GTK_STATE_ACTIVE, NULL);
}
static void
@@ -560,6 +682,18 @@
case PROP_YALIGN:
gtk_button_set_alignment (button, priv->xalign, g_value_get_float (value));
break;
+ case PROP_DETAIL:
+ if (priv->detail)
+ g_free (priv->detail);
+ priv->detail = g_strdup (g_value_get_string (value));
+ gtk_widget_queue_draw (GTK_WIDGET (button));
+ break;
+ case PROP_AUTOMATIC_DETAIL:
+ priv->automatic_detail = g_value_get_boolean (value);
+ break;
+ case PROP_KEYBOARD_BUTTON:
+ priv->keyboard_button = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -601,6 +735,15 @@
case PROP_YALIGN:
g_value_set_float (value, priv->yalign);
break;
+ case PROP_DETAIL:
+ g_value_set_string (value, priv->detail);
+ break;
+ case PROP_AUTOMATIC_DETAIL:
+ g_value_set_boolean (value, priv->automatic_detail);
+ break;
+ case PROP_KEYBOARD_BUTTON:
+ g_value_set_boolean (value, priv->keyboard_button);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -641,6 +784,26 @@
if (button->label_text == NULL)
return;
+ if (priv->keyboard_button)
+ {
+ if (priv->keyboard_label)
+ {
+ gtk_label_set_label (priv->keyboard_label, button->label_text);
+ }
+ else
+ {
+ GtkWidget *label = gtk_label_new (button->label_text);
+ priv->keyboard_label = GTK_LABEL (label);
+
+ if (priv->align_set)
+ gtk_misc_set_alignment (GTK_MISC (label),
+ priv->xalign, priv->yalign);
+ gtk_widget_show (priv->keyboard_label);
+ gtk_container_add (GTK_CONTAINER (button), label);
+ }
+ return;
+ }
+
if (GTK_BIN (button)->child)
{
if (priv->image && !priv->image_is_stock)
@@ -944,16 +1107,20 @@
GtkBorder default_border;
gint focus_width;
gint focus_pad;
+ gint child_spacing;
+ gint separator_height;
gtk_button_get_props (button, &default_border, NULL, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
+ "child-spacing", &child_spacing,
+ "separator-height", &separator_height,
NULL);
- requisition->width = (GTK_CONTAINER (widget)->border_width + CHILD_SPACING +
+ requisition->width = (GTK_CONTAINER (widget)->border_width + child_spacing +
GTK_WIDGET (widget)->style->xthickness) * 2;
- requisition->height = (GTK_CONTAINER (widget)->border_width + CHILD_SPACING +
+ requisition->height = (GTK_CONTAINER (widget)->border_width + child_spacing +
GTK_WIDGET (widget)->style->ythickness) * 2;
if (GTK_WIDGET_CAN_DEFAULT (widget))
@@ -965,15 +1132,35 @@
if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
{
GtkRequisition child_requisition;
+ GtkBorder *padding;
+ gint minimum_width;
gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition);
+ gtk_widget_style_get (widget,
+ "padding",
+ &padding,
+ "minimum_width",
+ &minimum_width,
+ NULL);
+
+ if ( padding )
+ {
+ requisition->width += padding->left + padding->right;
+ requisition->height += padding->top + padding->bottom;
+ }
+
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
+
+ if (requisition->width < minimum_width)
+ requisition->width = minimum_width;
}
requisition->width += 2 * (focus_width + focus_pad);
requisition->height += 2 * (focus_width + focus_pad);
+
+ requisition->height += separator_height;
}
static void
@@ -989,14 +1176,15 @@
GtkBorder default_border;
gint focus_width;
gint focus_pad;
+ gint child_spacing;
gtk_button_get_props (button, &default_border, NULL, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
+ "child-spacing", &child_spacing,
NULL);
-
-
+
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
@@ -1008,14 +1196,27 @@
if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
{
- child_allocation.x = widget->allocation.x + border_width + CHILD_SPACING + xthickness;
- child_allocation.y = widget->allocation.y + border_width + CHILD_SPACING + ythickness;
+ child_allocation.x = widget->allocation.x + border_width + child_spacing + xthickness;
+ child_allocation.y = widget->allocation.y + border_width + child_spacing + ythickness;
- child_allocation.width = MAX (1, widget->allocation.width - (CHILD_SPACING + xthickness) * 2 -
+ child_allocation.width = MAX (1, widget->allocation.width - (child_spacing + xthickness) * 2 -
border_width * 2);
- child_allocation.height = MAX (1, widget->allocation.height - (CHILD_SPACING + ythickness) * 2 -
+ child_allocation.height = MAX (1, widget->allocation.height - (child_spacing + ythickness) * 2 -
border_width * 2);
+#ifdef OSSO_FONT_HACK
+ {
+ gint child_offset_y;
+
+ gtk_widget_style_get (widget, "child_offset_y", &child_offset_y, NULL);
+
+ if( GTK_IS_LABEL(GTK_BIN (button)->child) )
+ {
+ child_allocation.y += child_offset_y;
+ }
+ }
+#endif
+
if (GTK_WIDGET_CAN_DEFAULT (button))
{
child_allocation.x += default_border.left;
@@ -1066,7 +1267,14 @@
gboolean interior_focus;
gint focus_width;
gint focus_pad;
-
+ gint separator_height;
+ gboolean listboxheader;
+ GtkButtonPrivate *priv;
+
+ g_return_if_fail (GTK_IS_BUTTON (button));
+
+ priv = GTK_BUTTON_GET_PRIVATE (button);
+
if (GTK_WIDGET_DRAWABLE (button))
{
widget = GTK_WIDGET (button);
@@ -1076,6 +1284,8 @@
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
+ "listboxheader", &listboxheader,
+ "separator-height", &separator_height,
NULL);
x = widget->allocation.x + border_width;
@@ -1083,13 +1293,55 @@
width = widget->allocation.width - border_width * 2;
height = widget->allocation.height - border_width * 2;
+ if (listboxheader)
+ {
+ /* this changes everything! */
+ PangoLayout *layout;
+ int layout_height;
+
+ /* construct layout - see get_layout in gtkcellrenderertext.c */
+ layout = gtk_widget_create_pango_layout (widget, /* use parent treeview instead? */
+ button->label_text);
+ pango_layout_set_width (layout, -1);
+ pango_layout_get_pixel_size (layout, NULL, &layout_height);
+
+ /* render text */
+ gtk_paint_layout (widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ TRUE,
+ area,
+ widget,
+ "listboxheader",
+ x,
+ y,
+ layout);
+
+ g_object_unref (layout);
+
+ /* draw separator */
+ gtk_paint_hline (widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ area,
+ widget,
+ "listboxseparator",
+ area->x - focus_width - focus_pad,
+ area->x + area->width + focus_width + focus_pad,
+ layout_height + separator_height * 2);
+ return;
+ }
+
if (GTK_WIDGET_HAS_DEFAULT (widget) &&
GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL)
{
- gtk_paint_box (widget->style, widget->window,
+ /* This comment is here because it's part of the
+ * normal GtkButton
+ */
+ /* gtk_paint_box (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
area, widget, "buttondefault",
- x, y, width, height);
+ x, y, width, height); */
x += default_border.left;
y += default_border.top;
@@ -1116,7 +1368,7 @@
GTK_WIDGET_STATE(widget) == GTK_STATE_PRELIGHT)
gtk_paint_box (widget->style, widget->window,
state_type,
- shadow_type, area, widget, "button",
+ shadow_type, area, widget, priv->detail,
x, y, width, height);
if (GTK_WIDGET_HAS_FOCUS (widget))
@@ -1151,10 +1403,14 @@
x += child_displacement_x;
y += child_displacement_y;
}
-
+ /* Comment exists, because it is part of normal GtkButton
gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
area, widget, "button",
x, y, width, height);
+ */
+ gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+ area, widget, priv->detail,
+ x, y, width, height);
}
}
}
@@ -1786,5 +2042,13 @@
return priv->image;
}
-
-
+void osso_gtk_button_set_detail_from_attach_flags (GtkButton *button,OssoGtkButtonAttachFlags flags)
+{
+ g_return_if_fail (GTK_IS_BUTTON (button));
+ g_object_set (G_OBJECT (button),
+ "automatic_detail",
+ FALSE,
+ "detail",
+ osso_gtk_button_attach_details[flags],
+ NULL);
+}

View File

@ -0,0 +1,23 @@
--- gtk+-2.6.4/gtk/gtkbutton.h 2004-11-15 22:56:28.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkbutton.h 2005-04-06 16:19:36.264025392 +0300
@@ -134,6 +134,20 @@
const gchar *main_detail,
const gchar *default_detail);
+/* Osso addition : Button attach flags */
+typedef enum {
+ OSSO_GTK_BUTTON_ATTACH_NORTH = 1 << 0,
+ OSSO_GTK_BUTTON_ATTACH_EAST = 1 << 1,
+ OSSO_GTK_BUTTON_ATTACH_SOUTH = 1 << 2,
+ OSSO_GTK_BUTTON_ATTACH_WEST = 1 << 3,
+ OSSO_GTK_BUTTON_ATTACH_ENUM_END = 1 << 4
+} OssoGtkButtonAttachFlags;
+
+extern const gchar *osso_gtk_button_attach_details [OSSO_GTK_BUTTON_ATTACH_ENUM_END];
+
+void osso_gtk_button_set_detail_from_attach_flags (GtkButton *button,
+ OssoGtkButtonAttachFlags flags);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
--- gtk+-2.6.4/gtk/gtkcalendar.h 2003-05-08 03:25:48.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkcalendar.h 2005-04-06 16:19:36.267024936 +0300
@@ -111,6 +111,9 @@
void (* next_month) (GtkCalendar *calendar);
void (* prev_year) (GtkCalendar *calendar);
void (* next_year) (GtkCalendar *calendar);
+ /* Hildon signals */
+ void (* erroneous_date) (GtkCalendar *calendar);
+ void (* selected_date) (GtkCalendar *calendar);
};

View File

@ -0,0 +1,66 @@
--- gtk+-2.6.4/gtk/gtkcellrenderertext.c 2005-01-09 19:32:25.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkcellrenderertext.c 2005-04-06 16:19:36.274023872 +0300
@@ -182,8 +182,8 @@
GTK_CELL_RENDERER (celltext)->xalign = 0.0;
GTK_CELL_RENDERER (celltext)->yalign = 0.5;
- GTK_CELL_RENDERER (celltext)->xpad = 2;
- GTK_CELL_RENDERER (celltext)->ypad = 2;
+ GTK_CELL_RENDERER (celltext)->xpad = 0;
+ GTK_CELL_RENDERER (celltext)->ypad = 0;
celltext->fixed_height_rows = -1;
celltext->font = pango_font_description_new ();
@@ -1429,7 +1429,7 @@
/* The minimum size for ellipsized labels is ~ 3 chars */
if (width)
{
- if (priv->ellipsize || priv->width_chars > 0)
+ /*if (priv->ellipsize || priv->width_chars > 0)
{
PangoContext *context;
PangoFontMetrics *metrics;
@@ -1444,9 +1444,9 @@
*width += (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3));
}
else
- {
+ {*/
*width = GTK_CELL_RENDERER (celltext)->xpad * 2 + rect.width;
- }
+ /*} */
}
if (cell_area)
@@ -1501,6 +1501,7 @@
gint x_offset;
gint y_offset;
GtkCellRendererTextPrivate *priv;
+ PangoRectangle logical_rect;
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
@@ -1521,7 +1522,7 @@
else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT &&
GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT)
{
- state = GTK_STATE_PRELIGHT;
+ state = GTK_STATE_NORMAL;
}
else
{
@@ -1559,6 +1560,14 @@
g_object_unref (gc);
}
+ /* Dirty Hildon hack to force ellipsation */
+ pango_layout_get_extents (layout, NULL, &logical_rect);
+ if (PANGO_PIXELS (logical_rect.width) > MIN (background_area->width, expose_area->width))
+ {
+ priv->ellipsize = PANGO_ELLIPSIZE_END;
+ priv->ellipsize_set = TRUE;
+ }
+
if (priv->ellipsize)
pango_layout_set_width (layout,
(cell_area->width - x_offset - 2 * cell->xpad) * PANGO_SCALE);

View File

@ -0,0 +1,11 @@
--- gtk+-2.6.4/gtk/gtkcellrenderertoggle.c 2004-08-09 19:59:51.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkcellrenderertoggle.c 2005-04-06 16:19:36.274023872 +0300
@@ -71,7 +71,7 @@
PROP_INCONSISTENT
};
-#define TOGGLE_WIDTH 12
+#define TOGGLE_WIDTH 26
static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };

View File

@ -0,0 +1,19 @@
--- gtk+-2.6.4/gtk/gtkcellview.c 2004-12-15 18:27:30.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkcellview.c 2005-04-06 16:19:36.275023720 +0300
@@ -82,7 +82,6 @@
GValue *value);
static GtkCellViewCellInfo *gtk_cell_view_get_cell_info (GtkCellView *cellview,
GtkCellRenderer *renderer);
-static void gtk_cell_view_set_cell_data (GtkCellView *cell_view);
static void gtk_cell_view_cell_layout_pack_start (GtkCellLayout *layout,
@@ -536,7 +535,7 @@
return NULL;
}
-static void
+void
gtk_cell_view_set_cell_data (GtkCellView *cell_view)
{
GList *i;

View File

@ -0,0 +1,10 @@
--- gtk+-2.6.4/gtk/gtkcellview.h 2004-12-15 18:27:30.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkcellview.h 2005-04-06 16:19:36.317017336 +0300
@@ -67,6 +67,7 @@
void gtk_cell_view_set_background_color (GtkCellView *cell_view,
const GdkColor *color);
+void gtk_cell_view_set_cell_data (GtkCellView *cellview);
GList *gtk_cell_view_get_cell_renderers (GtkCellView *cell_view);
G_END_DECLS

View File

@ -0,0 +1,520 @@
--- gtk+-2.6.4/gtk/gtkcheckbutton.c 2004-08-09 19:59:51.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkcheckbutton.c 2005-04-06 16:19:36.317017336 +0300
@@ -31,27 +31,44 @@
#include "gtklabel.h"
-#define INDICATOR_SIZE 13
+#define INDICATOR_SIZE 24
#define INDICATOR_SPACING 2
+/* maJiK numbers for indicator */
+#define INDICATOR_SIDE_PADDING 5
+#define FOCUS_TOP_PADDING 7
+#define FOCUS_DOWN_PADDING 1
+
+/* spacing to take account of the 1 pixel
+ transparency of the widgetfocus.png
+*/
+#define HILDON_SPACING 1
+
+#define TOGGLE_ON_CLICK "toggle-on-click"
-static void gtk_check_button_class_init (GtkCheckButtonClass *klass);
-static void gtk_check_button_init (GtkCheckButton *check_button);
-static void gtk_check_button_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-static void gtk_check_button_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
-static gint gtk_check_button_expose (GtkWidget *widget,
- GdkEventExpose *event);
-static void gtk_check_button_paint (GtkWidget *widget,
- GdkRectangle *area);
-static void gtk_check_button_draw_indicator (GtkCheckButton *check_button,
- GdkRectangle *area);
-static void gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
- GdkRectangle *area);
+static void gtk_check_button_class_init (GtkCheckButtonClass *klass);
+static void gtk_check_button_init (GtkCheckButton *check_button);
+static void gtk_check_button_size_request (GtkWidget *widget,
+ GtkRequisition *requisition);
+static void gtk_check_button_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation);
+static gint gtk_check_button_expose (GtkWidget *widget,
+ GdkEventExpose *event);
+static void gtk_check_button_paint (GtkWidget *widget,
+ GdkRectangle *area);
+static void gtk_check_button_draw_indicator (GtkCheckButton *check_button,
+ GdkRectangle *area);
+static void gtk_real_check_button_draw_indicator
+ (GtkCheckButton *check_button,
+ GdkRectangle *area);
-static GtkToggleButtonClass *parent_class = NULL;
+static void gtk_check_button_calc_indicator_size( GtkCheckButton *button,
+ GdkRectangle *rect );
+
+static void gtk_check_button_clicked (GtkButton *button);
+static void gtk_check_button_update_state (GtkButton *button);
+static GtkToggleButtonClass *parent_class = NULL;
GType
gtk_check_button_get_type (void)
@@ -85,32 +102,36 @@
gtk_check_button_class_init (GtkCheckButtonClass *class)
{
GtkWidgetClass *widget_class;
-
+ GtkButtonClass *button_class;
+
widget_class = (GtkWidgetClass*) class;
+ button_class = (GtkButtonClass*) class;
parent_class = g_type_class_peek_parent (class);
widget_class->size_request = gtk_check_button_size_request;
widget_class->size_allocate = gtk_check_button_size_allocate;
widget_class->expose_event = gtk_check_button_expose;
+ button_class->clicked = gtk_check_button_clicked;
+
class->draw_indicator = gtk_real_check_button_draw_indicator;
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("indicator_size",
- P_("Indicator Size"),
- P_("Size of check or radio indicator"),
- 0,
- G_MAXINT,
- INDICATOR_SIZE,
- G_PARAM_READABLE));
+ P_("Indicator Size"),
+ P_("Size of check or radio indicator"),
+ 0,
+ G_MAXINT,
+ INDICATOR_SIZE,
+ G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("indicator_spacing",
- P_("Indicator Spacing"),
- P_("Spacing around check or radio indicator"),
- 0,
- G_MAXINT,
- INDICATOR_SPACING,
- G_PARAM_READABLE));
+ P_("Indicator Spacing"),
+ P_("Spacing around check or radio indicator"),
+ 0,
+ G_MAXINT,
+ INDICATOR_SPACING,
+ G_PARAM_READABLE));
}
static void
@@ -148,7 +169,8 @@
GtkWidget*
gtk_check_button_new_with_mnemonic (const gchar *label)
{
- return g_object_new (GTK_TYPE_CHECK_BUTTON, "label", label, "use_underline", TRUE, NULL);
+ return g_object_new (GTK_TYPE_CHECK_BUTTON, "label", label,
+ "use_underline", TRUE, NULL);
}
@@ -163,39 +185,70 @@
if (GTK_WIDGET_DRAWABLE (widget))
{
- gint border_width;
- gint interior_focus;
- gint focus_width;
- gint focus_pad;
-
+ gint border_width = 0;
+ gint interior_focus = 0;
+ gint focus_width = 0;
+ gint focus_pad = 0;
+ gint indicator_size = 0;
+ gint indicator_spacing = 0;
+
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
+ "indicator-size", &indicator_size,
+ "indicator-spacing", &indicator_spacing,
NULL);
-
- gtk_check_button_draw_indicator (check_button, area);
border_width = GTK_CONTAINER (widget)->border_width;
+
+ /* Hildon: change the focus so that it draws around the entire
+ * widget - including both the indicator *and* the label
+ */
if (GTK_WIDGET_HAS_FOCUS (widget))
{
GtkWidget *child = GTK_BIN (widget)->child;
+ int w = indicator_size + 2 * indicator_spacing +
+ 2 * (focus_width + focus_pad);
+ int h = indicator_size + 2 * indicator_spacing +
+ 2 * (focus_width + focus_pad) + 2 * HILDON_SPACING
+ - FOCUS_TOP_PADDING;
+ int x = widget->allocation.x;
+ int y = widget->allocation.y + (widget->allocation.height - h)/2
+ + FOCUS_DOWN_PADDING;
+
+ if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL)
+ x = widget->allocation.x + widget->allocation.width -
+ (2 * HILDON_SPACING) - (indicator_size + 2) -
+ (indicator_spacing + 2);
+
if (interior_focus && child && GTK_WIDGET_VISIBLE (child))
- gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
- NULL, widget, "checkbutton",
- child->allocation.x - focus_width - focus_pad,
- child->allocation.y - focus_width - focus_pad,
- child->allocation.width + 2 * (focus_width + focus_pad),
- child->allocation.height + 2 * (focus_width + focus_pad));
+ {
+ if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL)
+ {
+ /* Move the "x" to the left, and enlarge the width,
+ both accounting for the child
+ */
+ x += - child->allocation.width - HILDON_SPACING -
+ (widget->style->xthickness);
+ w += child->allocation.width + HILDON_SPACING +
+ (widget->style->xthickness);
+ } else {
+ w = child->allocation.x + child->allocation.width +
+ 2 * widget->style->xthickness - x;
+ }
+
+ gtk_paint_focus (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget),
+ NULL, widget, "checkbutton", x, y, w, h);
+ }
else
- gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
- NULL, widget, "checkbutton",
- border_width + widget->allocation.x,
- border_width + widget->allocation.y,
- widget->allocation.width - 2 * border_width,
- widget->allocation.height - 2 * border_width);
+ gtk_paint_focus (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget),
+ NULL, widget, "checkbutton", x, y, w, h);
}
+ gtk_check_button_draw_indicator (check_button, area);
}
}
@@ -205,10 +258,10 @@
gint *indicator_spacing)
{
GtkWidget *widget = GTK_WIDGET (check_button);
-
+
if (indicator_size)
gtk_widget_style_get (widget, "indicator_size", indicator_size, NULL);
-
+
if (indicator_spacing)
gtk_widget_style_get (widget, "indicator_spacing", indicator_spacing, NULL);
}
@@ -233,7 +286,7 @@
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
-
+
requisition->width = border_width * 2;
requisition->height = border_width * 2;
@@ -246,15 +299,19 @@
GtkRequisition child_requisition;
gtk_widget_size_request (child, &child_requisition);
-
- requisition->width += child_requisition.width + indicator_spacing;
+
+ requisition->width += child_requisition.width +
+ 2 * widget->style->xthickness;
requisition->height += child_requisition.height;
+ requisition->width += 2 * widget->style->xthickness;
}
- requisition->width += (indicator_size + indicator_spacing * 2 + 2 * (focus_width + focus_pad));
+ requisition->width += (indicator_size + indicator_spacing * 2 +
+ 2 * (focus_width + focus_pad));
temp = indicator_size + indicator_spacing * 2;
- requisition->height = MAX (requisition->height, temp) + 2 * (focus_width + focus_pad);
+ requisition->height = MAX (requisition->height, temp) +
+ 2 * (focus_width + focus_pad);
}
else
(* GTK_WIDGET_CLASS (parent_class)->size_request) (widget, requisition);
@@ -280,45 +337,59 @@
gint focus_width;
gint focus_pad;
- _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
+ _gtk_check_button_get_props (check_button,
+ &indicator_size, &indicator_spacing);
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
-
+
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (button->event_window,
allocation->x, allocation->y,
allocation->width, allocation->height);
- if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
+ if (GTK_BIN (button)->child &&
+ GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
{
GtkRequisition child_requisition;
gint border_width = GTK_CONTAINER (widget)->border_width;
-
- gtk_widget_get_child_requisition (GTK_BIN (button)->child, &child_requisition);
+
+ gtk_widget_get_child_requisition (GTK_BIN (button)->child,
+ &child_requisition);
- child_allocation.width = MIN (child_requisition.width,
+ child_allocation.width = MIN (
+ child_requisition.width,
allocation->width -
- ((border_width + focus_width + focus_pad) * 2
- + indicator_size + indicator_spacing * 3));
- child_allocation.width = MAX (child_allocation.width, 1);
+ ((border_width + focus_width +
+ focus_pad) * 2
+ - 2 * widget->style->xthickness +
+ indicator_size +
+ indicator_spacing * 2 ) );
+ child_allocation.width = MAX (child_allocation.width, 1);
+
child_allocation.height = MIN (child_requisition.height,
- allocation->height - (border_width + focus_width + focus_pad) * 2);
+ allocation->height -
+ (border_width + focus_width +
+ focus_pad) * 2);
child_allocation.height = MAX (child_allocation.height, 1);
- child_allocation.x = (border_width + indicator_size + indicator_spacing * 3 +
- widget->allocation.x + focus_width + focus_pad);
+ child_allocation.x = (border_width + indicator_size +
+ indicator_spacing * 2 +
+ widget->style->xthickness +
+ widget->allocation.x +
+ focus_width + focus_pad);
child_allocation.y = widget->allocation.y +
- (allocation->height - child_allocation.height) / 2;
-
+ (allocation->height - child_allocation.height) / 2;
+
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- child_allocation.x = allocation->x + allocation->width
- - (child_allocation.x - allocation->x + child_allocation.width);
+ child_allocation.x = allocation->x + allocation->width -
+ (child_allocation.x - allocation->x + child_allocation.width);
- gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation);
+ gtk_widget_size_allocate (GTK_BIN (button)->child,
+ &child_allocation);
}
}
else
@@ -375,45 +446,33 @@
GdkRectangle *area)
{
GtkWidget *widget;
- GtkWidget *child;
GtkButton *button;
GtkToggleButton *toggle_button;
GtkStateType state_type;
GtkShadowType shadow_type;
- gint x, y;
- gint indicator_size;
- gint indicator_spacing;
- gint focus_width;
- gint focus_pad;
- gboolean interior_focus;
+
+ GdkRectangle indicator = {0, 0, 0, 0};
if (GTK_WIDGET_DRAWABLE (check_button))
{
widget = GTK_WIDGET (check_button);
button = GTK_BUTTON (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);
-
- gtk_widget_style_get (widget, "interior_focus", &interior_focus,
- "focus-line-width", &focus_width,
- "focus-padding", &focus_pad, NULL);
-
- _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
-
- x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
- y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
-
- child = GTK_BIN (check_button)->child;
- if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child)))
- x += focus_width + focus_pad;
-
+ gtk_check_button_calc_indicator_size( check_button, &indicator );
+
+ /* move indicator to root coordinates */
+ indicator.x += widget->allocation.x;
+ indicator.y += widget->allocation.y;
+
if (toggle_button->inconsistent)
shadow_type = GTK_SHADOW_ETCHED_IN;
else if (toggle_button->active)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;
-
- if (button->activate_timeout || (button->button_down && button->in_button))
+
+ if (button->activate_timeout ||
+ (button->button_down && button->in_button))
state_type = GTK_STATE_ACTIVE;
else if (button->in_button)
state_type = GTK_STATE_PRELIGHT;
@@ -422,32 +481,107 @@
else
state_type = GTK_STATE_NORMAL;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x);
+ /* Hildon change. We want to draw active image always when we have
+ * focus. */
+ if (GTK_WIDGET_HAS_FOCUS (widget))
+ state_type = GTK_STATE_ACTIVE;
- if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_PRELIGHT)
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
{
- GdkRectangle restrict_area;
- GdkRectangle new_area;
-
- restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
- restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
- restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width);
- restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width);
+ indicator.x = widget->allocation.x + widget->allocation.width
+ - (indicator.width + indicator.x - widget->allocation.x);
- if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
- {
- gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_PRELIGHT,
- GTK_SHADOW_ETCHED_OUT,
- area, widget, "checkbutton",
- new_area.x, new_area.y,
- new_area.width, new_area.height);
- }
}
gtk_paint_check (widget->style, widget->window,
state_type, shadow_type,
area, widget, "checkbutton",
- x, y, indicator_size, indicator_size);
+ indicator.x, indicator.y,
+ indicator.width, indicator.height);
+ }
+}
+
+
+/* calculates the size and position of the indicator
+ * relative to the origin of the check button.
+ */
+static void gtk_check_button_calc_indicator_size( GtkCheckButton *button,
+ GdkRectangle *rect )
+{
+ gint indicator_size;
+ gint indicator_spacing;
+ gint focus_width;
+ gint focus_pad;
+ gboolean interior_focus;
+ GtkWidget *child;
+ GtkWidget *widget = GTK_WIDGET(button);
+
+
+ gtk_widget_style_get (widget, "interior_focus", &interior_focus,
+ "focus-line-width", &focus_width,
+ "focus-padding", &focus_pad,
+ "indicator-size", &indicator_size,
+ "indicator-spacing", &indicator_spacing,
+ NULL
+ );
+
+
+ /* HILDON: We want the indicator to be positioned according to the spec.
+ *
+ * NOTE: INDICATOR_SIDE_PADDING and INDICATOR_TOP_PADDING
+ * are maJiKal numbers that make the indicator to be drawn
+ * to correct coordinates, 1337 \o/
+ */
+ rect->x = INDICATOR_SIDE_PADDING;
+ rect->y = ( widget->allocation.height - indicator_size ) / 2;
+
+ /* Hildon: we always add space for the focus */
+ rect->x += focus_width + focus_pad;
+
+ child = GTK_BIN (widget)->child;
+ if (interior_focus && child && GTK_WIDGET_VISIBLE (child))
+ {
+ rect->y += HILDON_SPACING;
}
+
+ rect->width = indicator_size;
+ rect->height = indicator_size;
}
+
+static void
+gtk_check_button_clicked (GtkButton *button)
+{
+ GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
+
+ toggle_button->active = !toggle_button->active;
+ gtk_toggle_button_toggled (toggle_button);
+
+ gtk_check_button_update_state (button);
+
+ g_object_notify (G_OBJECT (toggle_button), "active");
+}
+
+static void
+gtk_check_button_update_state (GtkButton *button)
+{
+ GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
+ gboolean depressed;
+ GtkStateType new_state;
+
+ if (toggle_button->inconsistent)
+ depressed = FALSE;
+ else if (button->in_button && button->button_down)
+ depressed = TRUE;
+ else
+ depressed = toggle_button->active;
+
+ if (button->in_button &&
+ (!button->button_down || toggle_button->draw_indicator))
+ new_state = GTK_STATE_PRELIGHT;
+ else
+ new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL;
+
+ _gtk_button_set_depressed (button, depressed);
+ gtk_widget_set_state (GTK_WIDGET (toggle_button), new_state);
+}
+

View File

@ -0,0 +1,950 @@
--- gtk+-2.6.4/gtk/gtkcombobox.c 2005-02-25 21:11:08.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkcombobox.c 2005-04-06 16:19:36.406003808 +0300
@@ -17,6 +17,10 @@
* Boston, MA 02111-1307, USA.
*/
+/*
+ * Modified for Nokia Oyj during 2002-2004.
+ */
+
#include <config.h>
#include "gtkalias.h"
#include "gtkcombobox.h"
@@ -39,6 +43,8 @@
#include "gtktreeselection.h"
#include "gtkvseparator.h"
#include "gtkwindow.h"
+#include "gtkcomboboxentry.h"
+#include "gtktoolbar.h"
#include <gdk/gdkkeysyms.h>
@@ -52,6 +58,13 @@
#include "gtktreeprivate.h"
+#define HILDON_MAX_WIDTH 406
+#define HILDON_MAX_HEIGHT 305
+#define HILDON_MAX_ITEMS 8
+/* this is also defined in gtkmenu.c and should be replaced with
+ a style property */
+#define MENU_SCROLL_ARROW_HEIGHT 20
+
/* WELCOME, to THE house of evil code */
typedef struct _ComboCellInfo ComboCellInfo;
@@ -119,6 +132,9 @@
GtkTreeViewRowSeparatorFunc row_separator_func;
gpointer row_separator_data;
GtkDestroyNotify row_separator_destroy;
+
+ /* Hildon hack: state of our style property */
+ gboolean autodimmed_button;
};
/* While debugging this evil code, I have learned that
@@ -201,6 +217,7 @@
#define BONUS_PADDING 4
#define SCROLL_TIME 100
+#define HILDON_PADDING 25
/* common */
static void gtk_combo_box_class_init (GtkComboBoxClass *klass);
@@ -273,6 +290,14 @@
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
+static gboolean gtk_combo_box_focus_in (GtkWidget *widget,
+ GdkEventFocus *event);
+static gint gtk_combo_box_focus (GtkWidget *widget,
+ GtkDirectionType dir);
+static void gtk_combo_box_child_focus_in (GtkWidget *widget,
+ GdkEventFocus *event);
+static void gtk_combo_box_child_focus_out (GtkWidget *widget,
+ GdkEventFocus *event);
static gboolean gtk_combo_box_expose_event (GtkWidget *widget,
GdkEventExpose *event);
static gboolean gtk_combo_box_scroll_event (GtkWidget *widget,
@@ -285,6 +310,12 @@
static void gtk_combo_box_check_appearance (GtkComboBox *combo_box);
+/* <Hildon addition> */
+extern void gtk_grab_combo_box_entry_focus (GtkComboBoxEntry *entry_box);
+
+static void gtk_combo_box_grab_focus (GtkWidget *focus_widget);
+/* </hildon addition> */
+
/* listening to the model */
static void gtk_combo_box_model_row_inserted (GtkTreeModel *model,
GtkTreePath *path,
@@ -424,6 +455,9 @@
static void gtk_combo_box_start_editing (GtkCellEditable *cell_editable,
GdkEvent *event);
+static void gtk_combo_box_menu_position_above (GtkMenu *menu, gint *x,
+ gint *y, gboolean *push_in,
+ gpointer user_data);
GType
gtk_combo_box_get_type (void)
@@ -479,6 +513,25 @@
return combo_box_type;
}
+/* Hildon addition: Check if the button needs to be dimmed */
+static void hildon_check_autodim(GtkComboBox *combo_box)
+{
+ GtkWidget *widget;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ widget = combo_box->priv->button;
+ model = combo_box->priv->model;
+
+ if (combo_box->priv->autodimmed_button && widget != NULL)
+ {
+ if (model && gtk_tree_model_get_iter_first(model, &iter))
+ gtk_widget_set_sensitive(widget, TRUE);
+ else
+ gtk_widget_set_sensitive(widget, FALSE);
+ }
+}
+
/* common */
static void
gtk_combo_box_class_init (GtkComboBoxClass *klass)
@@ -504,6 +557,11 @@
widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate;
widget_class->style_set = gtk_combo_box_style_set;
widget_class->state_changed = gtk_combo_box_state_changed;
+
+ /* Hildon addition */
+ widget_class->grab_focus = gtk_combo_box_grab_focus;
+ widget_class->focus_in_event = gtk_combo_box_focus_in;
+ widget_class->focus = gtk_combo_box_focus;
gtk_object_class = (GtkObjectClass *)klass;
gtk_object_class->destroy = gtk_combo_box_destroy;
@@ -687,6 +745,41 @@
FALSE,
G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("hildonlike",
+ _("Size request"),
+ _("Size allocate"),
+ FALSE,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("arrow-height",
+ P_("Arrow height for option menu"),
+ P_("Sets arrow height"),
+ 0,
+ G_MAXINT,
+ 28,
+ G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("arrow-width",
+ P_("Arrow width for option menu"),
+ P_("Sets arrow width"),
+ 0,
+ G_MAXINT,
+ 26,
+ G_PARAM_READWRITE));
+
+
+ /* Hildon hack: style property for enabling the autodimming hack */
+ gtk_widget_class_install_style_property (
+ widget_class,
+ g_param_spec_boolean ("autodimmed_button",
+ _("Autodimmed button"),
+ _("Automatically dims the button if the list is empty"),
+ FALSE,
+ G_PARAM_READABLE));
+
g_type_class_add_private (object_class, sizeof (GtkComboBoxPrivate));
}
@@ -731,6 +824,11 @@
combo_box->priv->editing_canceled = FALSE;
combo_box->priv->auto_scroll = FALSE;
combo_box->priv->focus_on_click = TRUE;
+
+ /* Hildon hack: default value for our style property if it is queried before
+ * the style is set */
+ combo_box->priv->autodimmed_button = FALSE;
+ GTK_WIDGET_SET_FLAGS ( combo_box, GTK_CAN_FOCUS );
}
static void
@@ -911,7 +1009,19 @@
{
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
+ /* Hildon hack: read the state of our style property */
+ gtk_widget_style_get (GTK_WIDGET(combo_box),
+ "autodimmed_button", &(combo_box->priv->autodimmed_button), NULL);
+
gtk_combo_box_check_appearance (combo_box);
+
+ /* Hildon hack: handle the dimmed state of the button in regards whether
+ * the list is empty or not. This has to be done here because
+ * in the callback functions of GtkTreeModel the button widget
+ * may have not yet been set. However, we repeat this stuff in
+ * those functions, because later the button will be set and
+ * we want to update our state. */
+ hildon_check_autodim(combo_box);
if (combo_box->priv->tree_view && combo_box->priv->cell_view)
gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view),
@@ -922,10 +1032,17 @@
gtk_combo_box_button_toggled (GtkWidget *widget,
gpointer data)
{
+ gboolean hildonlike;
GtkComboBox *combo_box = GTK_COMBO_BOX (data);
+
+ gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
+ if (hildonlike) {
+ gtk_combo_box_grab_focus(GTK_WIDGET(combo_box));
+ }
+
if (!combo_box->priv->popup_in_progress)
gtk_combo_box_popup (combo_box);
}
@@ -1103,7 +1220,7 @@
{
gtk_container_remove (GTK_CONTAINER (combo_box->priv->popup_frame),
combo_box->priv->popup_widget);
- g_object_unref (combo_box->priv->popup_widget);
+ g_object_unref (G_OBJECT (combo_box->priv->popup_widget));
combo_box->priv->popup_widget = NULL;
}
@@ -1175,7 +1292,7 @@
popup);
gtk_widget_show (popup);
- g_object_ref (popup);
+ g_object_ref (G_OBJECT (popup));
combo_box->priv->popup_widget = popup;
}
}
@@ -1250,9 +1367,13 @@
GtkRequisition requisition;
GList *children;
gint screen_width;
+ gint screen_height;
gint menu_xpos;
gint menu_ypos;
- gint menu_width;
+ gint menu_width, menu_height;
+ gint counter = 0;
+ gint scroll_offset = 0;
+ gint max_items = 0;
g_return_if_fail (GTK_IS_COMBO_BOX (user_data));
@@ -1261,6 +1382,7 @@
gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
menu_width = requisition.width;
+ menu_height = requisition.height;
active = gtk_menu_get_active (GTK_MENU (combo_box->priv->popup_widget));
gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
@@ -1275,6 +1397,11 @@
}
children = GTK_MENU_SHELL (combo_box->priv->popup_widget)->children;
+ child = children->data;
+ gtk_widget_get_child_requisition (child, &requisition);
+ max_items = (HILDON_MAX_HEIGHT-2*MENU_SCROLL_ARROW_HEIGHT)/requisition.height;
+ max_items -= 1;
+
while (children)
{
child = children->data;
@@ -1284,27 +1411,119 @@
if (GTK_WIDGET_VISIBLE (child))
{
- gtk_widget_get_child_requisition (child, &requisition);
- menu_ypos -= requisition.height;
+ if (counter < max_items - 2)
+ menu_ypos -= requisition.height;
+ if (counter > max_items - 3)
+ scroll_offset += requisition.height;
}
-
+
+ counter++;
children = children->next;
}
+ gtk_widget_get_child_requisition (GTK_WIDGET(menu), &requisition);
+ if ( requisition.height >= HILDON_MAX_HEIGHT )
+ menu_ypos -= MENU_SCROLL_ARROW_HEIGHT;
+
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
menu_xpos = menu_xpos + widget->allocation.width - menu_width;
+ {
+ gint menu_xpad, menu_ypad;
+ gtk_widget_style_get (GTK_WIDGET (menu),
+ "horizontal-padding", &menu_xpad,
+ "vertical-padding", &menu_ypad,
+ NULL);
+ menu_xpos -= menu_xpad - 3;
+ menu_ypos -= menu_ypad - 1;
+ }
+
/* Clamp the position on screen */
screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
+ screen_height = gdk_screen_get_height (gtk_widget_get_screen (widget));
if (menu_xpos < 0)
menu_xpos = 0;
else if ((menu_xpos + menu_width) > screen_width)
menu_xpos -= ((menu_xpos + menu_width) - screen_width);
+ if (menu_ypos + menu_height > screen_height)
+ {
+ menu_ypos = screen_height - menu_height;
+ }
+ if (menu_ypos < 0)
+ {
+ menu_ypos = 0;
+ }
+
+ GTK_MENU(combo_box->priv->popup_widget)->scroll_offset = scroll_offset;
+
*x = menu_xpos;
*y = menu_ypos;
+ *push_in = FALSE;
+}
+
+static void
+gtk_combo_box_menu_position_above (GtkMenu *menu,
+ gint *x,
+ gint *y,
+ gboolean *push_in,
+ gpointer user_data)
+{
+ /*
+ * This function positiones the menu above widgets.
+ * This is a modified version of the position function
+ * gtk_combo_box_position_over.
+ * NB: This is only used when gtkcombobox is in toolbar!
+ */
+
+ GtkWidget *child;
+ GtkRequisition requisition;
+ GList *children;
+ gint screen_width;
+ gint menu_xpos;
+ gint menu_ypos;
+ gint gx,gy;
+ gint menu_width;
+ GtkWidget *widget;
+
+ widget = GTK_WIDGET(user_data);
+
+ gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
+ menu_width = requisition.width;
+
+ gdk_window_get_position(GDK_WINDOW(widget->window), &gx, &gy);
+ gtk_widget_translate_coordinates (widget, gtk_widget_get_toplevel(widget),
+ gx, gy, &menu_xpos, &menu_ypos);
+
+ menu_ypos -= GTK_WIDGET(menu)->style->ythickness * 2;
+ menu_ypos -= GTK_WIDGET(widget)->style->ythickness * 2;
+
+ menu_ypos -= widget->allocation.height;
+
+ children = GTK_MENU_SHELL (menu)->children;
+ while (children) {
+ child = children->data;
+ if (GTK_WIDGET_VISIBLE (child)){
+ gtk_widget_get_child_requisition (child, &requisition);
+ menu_ypos -= requisition.height;
+ }
+ children = children->next;
+ }
+
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ menu_xpos = menu_xpos + widget->allocation.width - menu_width;
+
+ screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
+
+ if (menu_xpos < 0)
+ menu_xpos = 0;
+ else if ((menu_xpos + menu_width) > screen_width)
+ menu_xpos -= ((menu_xpos + menu_width) - screen_width);
+
+ *x = menu_xpos;
+ *y = menu_ypos;
*push_in = TRUE;
}
@@ -1318,21 +1537,44 @@
GtkComboBox *combo_box;
GtkWidget *menu_item;
+ gboolean hildonlike;
+
combo_box = GTK_COMBO_BOX (user_data);
- if (combo_box->priv->wrap_width > 0 || combo_box->priv->cell_view == NULL)
- gtk_combo_box_menu_position_below (menu, x, y, push_in, user_data);
- else
+ gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL);
+
+ if (!(combo_box->priv->wrap_width > 0 || combo_box->priv->cell_view == NULL))
{
/* FIXME handle nested menus better */
menu_item = gtk_menu_get_active (GTK_MENU (combo_box->priv->popup_widget));
if (menu_item)
gtk_menu_shell_select_item (GTK_MENU_SHELL (combo_box->priv->popup_widget),
menu_item);
+ }
- gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data);
+ if (hildonlike)
+ {
+ /* HILDON: we check if combobox is in a toolbar */
+ gboolean in_toolbar = gtk_widget_get_ancestor(GTK_WIDGET(combo_box), GTK_TYPE_TOOLBAR) != NULL;
+ if (in_toolbar)
+ {
+ /*due to limits in combo's sizes we use position_over here also*/
+ gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data);
+ return;
+ }
}
+ if (combo_box->priv->wrap_width > 0 || combo_box->priv->cell_view == NULL)
+/*
+ * Changed because we always want the combo box position to be over
+ * the combo box, unless it's in toolbar.
+ *
+ gtk_combo_box_menu_position_below (menu, x, y, push_in, user_data);
+*/
+ gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data);
+ else
+ gtk_combo_box_menu_position_over (menu, x, y, push_in, user_data);
+
}
static void
@@ -1430,7 +1672,7 @@
list = cells;
while (list)
{
- g_object_get (list->data, "sensitive", &sensitive, NULL);
+ g_object_get (G_OBJECT (list->data), "sensitive", &sensitive, NULL);
if (sensitive)
break;
@@ -1469,7 +1711,7 @@
list = cells;
while (list)
{
- g_object_get (list->data, "sensitive", &sensitive, NULL);
+ g_object_get (G_OBJECT (list->data), "sensitive", &sensitive, NULL);
if (sensitive)
break;
@@ -1516,8 +1758,8 @@
if (menu != combo_box->priv->popup_widget && child == children)
{
separator = GTK_WIDGET (child->next->data);
- g_object_set (item, "visible", sensitive, NULL);
- g_object_set (separator, "visible", sensitive, NULL);
+ g_object_set (G_OBJECT (item), "visible", sensitive, NULL);
+ g_object_set (G_OBJECT (separator), "visible", sensitive, NULL);
}
else
gtk_widget_set_sensitive (item, sensitive);
@@ -1543,16 +1785,19 @@
if (gtk_tree_row_reference_valid (combo_box->priv->active_row))
{
path = gtk_tree_row_reference_get_path (combo_box->priv->active_row);
- active_item = gtk_tree_path_get_indices (path)[0];
- gtk_tree_path_free (path);
-
- if (combo_box->priv->add_tearoffs)
- active_item++;
+ if (path)
+ {
+ active_item = gtk_tree_path_get_indices (path)[0];
+ gtk_tree_path_free (path);
+
+ if (combo_box->priv->add_tearoffs)
+ active_item++;
+ }
}
/* FIXME handle nested menus better */
- gtk_menu_set_active (GTK_MENU (combo_box->priv->popup_widget), active_item);
-
+ gtk_menu_set_active (GTK_MENU (combo_box->priv->popup_widget), active_item);
+
if (combo_box->priv->wrap_width == 0)
{
width = GTK_WIDGET (combo_box)->allocation.width;
@@ -1684,6 +1929,7 @@
{
gint padding;
GtkRequisition req;
+ gboolean hildonlike;
if (combo_box->priv->cell_view)
gtk_widget_style_get (combo_box->priv->cell_view,
@@ -1691,9 +1937,17 @@
NULL);
else
padding = 0;
+
+ gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike,
+ NULL);
/* add some pixels for good measure */
- padding += BONUS_PADDING;
+ /* Hildon: we need more padding because our theming
+ * Not elegent way to do it anyway ... */
+ if (hildonlike)
+ padding += HILDON_PADDING;
+ else
+ padding += BONUS_PADDING;
if (combo_box->priv->cell_view)
gtk_cell_view_get_size_of_row (GTK_CELL_VIEW (combo_box->priv->cell_view),
@@ -1709,6 +1963,7 @@
{
GtkTreeIter iter;
GtkTreePath *path;
+ gboolean hildonlike;
if (!combo_box->priv->model ||
!gtk_tree_model_get_iter_first (combo_box->priv->model, &iter))
@@ -1717,6 +1972,7 @@
combo_box->priv->width = 0;
path = gtk_tree_path_new_from_indices (0, -1);
+ gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL);
do
{
@@ -1727,8 +1983,11 @@
path, &req);
else
req.width = 0;
+ /* Hildon: we need more padding because our theming
+ * Not elegent way to do it anyway ... */
- combo_box->priv->width = MAX (combo_box->priv->width, req.width);
+ combo_box->priv->width = MAX (combo_box->priv->width,
+ req.width + (hildonlike == 1) ? HILDON_PADDING : 0 );
gtk_tree_path_next (path);
}
@@ -1744,10 +2003,19 @@
gint width, height;
gint focus_width, focus_pad;
GtkRequisition bin_req;
+ gboolean hildonlike;
+ gint arrow_width;
+ gint arrow_height;
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
gtk_combo_box_check_appearance (combo_box);
+
+ /* get hildonlike style property */
+ gtk_widget_style_get (widget, "hildonlike",
+ &hildonlike, "arrow-width",
+ &arrow_width, "arrow-height",
+ &arrow_height, NULL);
/* common */
gtk_widget_size_request (GTK_BIN (widget)->child, &bin_req);
@@ -1829,6 +2097,13 @@
requisition->height = MAX (requisition->height, button_req.height);
requisition->width += button_req.width;
}
+
+ requisition->width = MIN (requisition->width, HILDON_MAX_WIDTH);
+
+ /* HILDON quick fix: height forced to be 28px as specified by Hildon specs. */
+ if (hildonlike)
+ if (requisition->height > arrow_height)
+ requisition->height = arrow_height;
}
static void
@@ -1839,17 +2114,32 @@
gint focus_width, focus_pad;
GtkAllocation child;
GtkRequisition req;
+ GtkRequisition child_req;
gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
+ gboolean hildonlike;
+ gint arrow_width;
+ gint arrow_height;
gtk_combo_box_check_appearance (combo_box);
- widget->allocation = *allocation;
-
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
+ "hildonlike", &hildonlike,
+ "arrow-width", &arrow_width,
+ "arrow-height", &arrow_height,
NULL);
+ /* HILDON: set height to fixed value */
+ if (hildonlike)
+ if (allocation->height > arrow_height)
+ {
+ allocation->y += (allocation->height - arrow_height) / 2;
+ allocation->height = arrow_height;
+ }
+
+ widget->allocation = *allocation;
+
if (!combo_box->priv->tree_view)
{
if (combo_box->priv->cell_view)
@@ -1909,7 +2199,16 @@
child.width = child.x;
child.x = allocation->x
+ border_width + xthickness + focus_width + focus_pad;
- child.width -= child.x;
+ child.width -= child.x + xthickness;
+ }
+
+ if (hildonlike)
+ {
+ gtk_widget_size_request(GTK_BIN(widget)->child, &child_req);
+ child.y += (child.height - child_req.height) / 2;
+ child.height = child_req.height;
+ gtk_widget_hide(combo_box->priv->separator);
+ gtk_widget_hide(combo_box->priv->arrow);
}
child.width = MAX (1, child.width);
@@ -1928,6 +2227,11 @@
child.height = allocation->height;
child.width = MAX (1, child.width);
child.height = MAX (1, child.height);
+
+ /* HILDON quick fix */
+ if (hildonlike)
+ child.width = arrow_width;
+
gtk_widget_size_allocate (combo_box->priv->button, &child);
if (is_rtl)
@@ -1938,6 +2242,13 @@
child.width = allocation->width - req.width;
child.width = MAX (1, child.width);
child.height = MAX (1, child.height);
+
+ if (hildonlike)
+ {
+ gtk_widget_size_request(GTK_BIN(widget)->child, &child_req);
+ child.y += (child.height - child_req.height) / 2;
+ child.height = child_req.height;
+ }
gtk_widget_size_allocate (GTK_BIN (widget)->child, &child);
}
}
@@ -1990,6 +2301,11 @@
GTK_WIDGET (combo_box->priv->cell_view_frame)->style->ythickness);
}
}
+
+ gtk_widget_size_request(GTK_BIN(widget)->child, &child_req);
+
+ child.y += (child.height - child_req.height) / 2;
+ child.height = child_req.height;
child.width = MAX (1, child.width);
child.height = MAX (1, child.height);
@@ -2036,6 +2352,8 @@
gtk_cell_view_set_displayed_row (GTK_CELL_VIEW (combo_box->priv->cell_view), NULL);
}
+
+
static void
gtk_combo_box_forall (GtkContainer *container,
gboolean include_internals,
@@ -2057,6 +2375,46 @@
}
static gboolean
+gtk_combo_box_focus_in (GtkWidget *widget,
+ GdkEventFocus *event)
+{
+ g_return_val_if_fail( widget, FALSE );
+
+ if ( !GTK_CONTAINER( widget )->focus_child )
+ {
+ gtk_combo_box_grab_focus ( GTK_WIDGET(widget) );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gint
+gtk_combo_box_focus (GtkWidget *widget,
+ GtkDirectionType dir)
+{
+ g_return_val_if_fail (widget, FALSE);
+ if (GTK_WIDGET_HAS_FOCUS(widget)||GTK_CONTAINER(widget)->focus_child)
+ return FALSE;
+
+ gtk_widget_grab_focus (widget);
+ return TRUE;
+}
+
+static void
+gtk_combo_box_child_focus_in (GtkWidget * widget,
+ GdkEventFocus *event)
+{
+ gtk_widget_event( widget, (GdkEvent*)event );
+}
+
+static void
+gtk_combo_box_child_focus_out (GtkWidget * widget,
+ GdkEventFocus *event)
+{
+ gtk_widget_event( widget, (GdkEvent*)event );
+}
+
+static gboolean
gtk_combo_box_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
@@ -2357,11 +2715,13 @@
gboolean add_children)
{
GtkWidget *menu;
+ gboolean hildonlike;
+
+ gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike", &hildonlike, NULL);
if (combo_box->priv->cell_view)
{
combo_box->priv->button = gtk_toggle_button_new ();
-
g_signal_connect (combo_box->priv->button, "toggled",
G_CALLBACK (gtk_combo_box_button_toggled), combo_box);
g_signal_connect_after (combo_box->priv->button,
@@ -2400,6 +2760,9 @@
gtk_widget_show_all (combo_box->priv->button);
}
+ g_signal_connect_swapped (combo_box->priv->button, "focus_in_event", G_CALLBACK (gtk_combo_box_child_focus_in), combo_box);
+ g_signal_connect_swapped (combo_box->priv->button, "focus_out_event", G_CALLBACK (gtk_combo_box_child_focus_out), combo_box);
+
g_signal_connect (combo_box->priv->button, "button_press_event",
G_CALLBACK (gtk_combo_box_menu_button_press),
combo_box);
@@ -2749,6 +3112,9 @@
{
GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
+ /* Hildon hack: sets the popup button sensitive if we have items in the list */
+ hildon_check_autodim(combo_box);
+
gtk_tree_row_reference_inserted (G_OBJECT (user_data), path);
if (combo_box->priv->tree_view)
@@ -2783,7 +3149,10 @@
if (combo_box->priv->tree_view)
gtk_combo_box_list_popup_resize (combo_box);
else
- gtk_combo_box_menu_row_deleted (model, path, user_data);
+ gtk_combo_box_menu_row_deleted (model, path, user_data);
+
+ /* Hildon hack: dim the popup button in case item count reaches 0 */
+ hildon_check_autodim(combo_box);
}
static void
@@ -3458,10 +3827,46 @@
gboolean found;
GtkTreeIter iter;
GtkTreeIter new_iter;
+ gboolean hildonlike;
+ gint index = gtk_combo_box_get_active (combo_box);
+ gint new_index;
+ gint items = 0;
if (combo_box->priv->model == NULL)
return FALSE;
+ items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
+
+ gtk_widget_style_get (GTK_WIDGET (combo_box), "hildonlike",
+ &hildonlike, NULL);
+
+ /* Hildon select key */
+ if (hildonlike)
+ {
+ if (event->keyval == GDK_KP_Enter || event->keyval == GDK_Return)
+ {
+ gtk_combo_box_popup (combo_box);
+ return TRUE;
+ }
+ else if (event->keyval == GDK_Left && items != 0)
+ {
+ new_index = (index == 0) ? items - 1 : index - 1;
+ gtk_combo_box_set_active (combo_box, new_index);
+ return TRUE;
+ }
+ else if (event->keyval == GDK_Right && items != 0)
+ {
+ new_index = (index == items - 1) ? 0 : index + 1;
+ gtk_combo_box_set_active (combo_box, new_index);
+ return TRUE;
+ }
+ else if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
+ || (event->keyval == GDK_Up || event->keyval == GDK_KP_Up))
+ {
+ return FALSE;
+ }
+ }
+
if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down) &&
state == GDK_MOD1_MASK)
{
@@ -3714,7 +4119,7 @@
combo_box = GTK_COMBO_BOX (layout);
- g_object_ref (cell);
+ g_object_ref (G_OBJECT (cell));
gtk_object_sink (GTK_OBJECT (cell));
info = g_new0 (ComboCellInfo, 1);
@@ -3771,7 +4176,7 @@
combo_box = GTK_COMBO_BOX (layout);
- g_object_ref (cell);
+ g_object_ref (G_OBJECT (cell));
gtk_object_sink (GTK_OBJECT (cell));
info = g_new0 (ComboCellInfo, 1);
@@ -3833,7 +4238,7 @@
ComboCellInfo *info = (ComboCellInfo *)i->data;
gtk_combo_box_cell_layout_clear_attributes (layout, info->cell);
- g_object_unref (info->cell);
+ g_object_unref (G_OBJECT (info->cell));
g_free (info);
i->data = NULL;
}
@@ -3922,7 +4327,7 @@
if (GTK_IS_MENU_ITEM (parent) &&
gtk_menu_item_get_submenu (GTK_MENU_ITEM (parent)))
- g_object_set (cell, "sensitive", TRUE, NULL);
+ g_object_set (G_OBJECT (cell), "sensitive", TRUE, NULL);
}
@@ -4137,7 +4542,7 @@
GtkWidget *
gtk_combo_box_new (void)
{
- return g_object_new (GTK_TYPE_COMBO_BOX, NULL);
+ return GTK_WIDGET (g_object_new (GTK_TYPE_COMBO_BOX, NULL));
}
/**
@@ -4157,7 +4562,9 @@
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
- combo_box = g_object_new (GTK_TYPE_COMBO_BOX, "model", model, NULL);
+ combo_box = GTK_COMBO_BOX (g_object_new (GTK_TYPE_COMBO_BOX,
+ "model", model,
+ NULL));
return GTK_WIDGET (combo_box);
}
@@ -4512,6 +4919,7 @@
if (!model)
{
gtk_combo_box_unset_model (combo_box);
+ hildon_check_autodim(combo_box);
return;
}
@@ -4524,7 +4932,7 @@
gtk_combo_box_unset_model (combo_box);
combo_box->priv->model = model;
- g_object_ref (combo_box->priv->model);
+ g_object_ref (G_OBJECT (combo_box->priv->model));
combo_box->priv->inserted_id =
g_signal_connect (combo_box->priv->model, "row_inserted",
@@ -4561,6 +4969,8 @@
if (combo_box->priv->cell_view)
gtk_cell_view_set_model (GTK_CELL_VIEW (combo_box->priv->cell_view),
combo_box->priv->model);
+
+ hildon_check_autodim(combo_box);
}
/**
@@ -5140,3 +5550,33 @@
return combo->priv->focus_on_click;
}
+/* Hildon addition:
+ * This is added, because we need to be able grab focus for our widget.
+ * Focus grabbing can happen it two ways: If we are using combobox entry
+ * we grab entry widget focus, otherwise togglebutton focus
+ */
+static void gtk_combo_box_grab_focus (GtkWidget *focus_widget)
+{
+ GtkComboBox *combo_box;
+ GtkComboBoxEntry *combo_entry;
+ gboolean hildonlike;
+
+ combo_box = GTK_COMBO_BOX (focus_widget);
+
+ gtk_widget_style_get (focus_widget, "hildonlike",
+ &hildonlike, NULL);
+
+ if (hildonlike)
+ {
+ /* Are we in entry mode ? */
+ if ( GTK_IS_COMBO_BOX_ENTRY(combo_box))
+ {
+ combo_entry = GTK_COMBO_BOX_ENTRY (combo_box);
+ gtk_grab_combo_box_entry_focus (combo_entry);
+ }
+ else
+ {
+ gtk_widget_grab_focus (combo_box->priv->button);
+ }
+ }
+}

View File

@ -0,0 +1,24 @@
--- gtk+-2.6.4/gtk/gtkcomboboxentry.c 2004-11-20 01:18:37.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkcomboboxentry.c 2005-04-06 16:19:36.407003656 +0300
@@ -55,6 +55,8 @@
gpointer user_data);
static gboolean gtk_combo_box_entry_mnemonic_activate (GtkWidget *entry,
gboolean group_cycling);
+/*static void gtk_grab_combo_box_entry_focus (GtkComboBoxEntry *entry_box);*/
+
static void has_frame_changed (GtkComboBoxEntry *entry_box,
GParamSpec *pspec,
gpointer data);
@@ -382,3 +384,12 @@
return entry_box;
}
+
+/* Hildon: this is added because we need to grab focus from caption control
+ * to ComboBox entry.
+ */
+void
+gtk_grab_combo_box_entry_focus (GtkComboBoxEntry *entry_box)
+{
+ gtk_widget_grab_focus (entry_box->priv->entry);
+}

View File

@ -0,0 +1,284 @@
--- gtk+-2.6.4/gtk/gtkcontainer.c 2005-03-01 08:28:55.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkcontainer.c 2005-04-06 16:19:36.410003200 +0300
@@ -37,10 +37,13 @@
#include "gtkwindow.h"
#include "gtkintl.h"
#include "gtktoolbar.h"
+#include "gtkmenu.h"
+#include "gtkentry.h"
+#include "gtktextview.h"
+#include "gtkwidget.h"
#include <gobject/gobjectnotifyqueue.c>
#include <gobject/gvaluecollector.h>
-
enum {
ADD,
REMOVE,
@@ -56,6 +59,19 @@
PROP_CHILD
};
+enum {
+ FOCUS_MOVE_OK,
+ FOCUS_MOVE_OK_NO_MOVE,
+ FOCUS_MOVE_FAIL_NO_TEXT
+};
+
+typedef struct
+{
+ GtkWidget *menu;
+ void *func;
+ GtkWidgetTapAndHoldFlags flags;
+} GtkContainerTAH;
+
#define PARAM_SPEC_PARAM_ID(pspec) ((pspec)->param_id)
#define PARAM_SPEC_SET_PARAM_ID(pspec, id) ((pspec)->param_id = (id))
@@ -87,6 +103,9 @@
static gboolean gtk_container_focus_move (GtkContainer *container,
GList *children,
GtkDirectionType direction);
+static gint gtk_container_focus_move_with_tab (GtkContainer *container,
+ GtkDirectionType direction,
+ GtkWidget **fallback);
static void gtk_container_children_callback (GtkWidget *widget,
gpointer client_data);
static void gtk_container_show_all (GtkWidget *widget);
@@ -95,10 +114,14 @@
GdkEventExpose *event);
static void gtk_container_map (GtkWidget *widget);
static void gtk_container_unmap (GtkWidget *widget);
-
+static void gtk_container_tap_and_hold_setup (GtkWidget *widget,
+ GtkWidget *menu, GtkCallback func, GtkWidgetTapAndHoldFlags flags);
static gchar* gtk_container_child_default_composite_name (GtkContainer *container,
GtkWidget *child);
+static void gtk_container_tap_and_hold_setup_forall( GtkWidget *widget,
+ GtkContainerTAH *tah );
+static void gtk_container_grab_focus( GtkWidget *focus_widget );
/* --- variables --- */
static const gchar vadjustment_key[] = "gtk-vadjustment";
@@ -190,7 +213,9 @@
widget_class->map = gtk_container_map;
widget_class->unmap = gtk_container_unmap;
widget_class->focus = gtk_container_focus;
-
+ widget_class->tap_and_hold_setup = gtk_container_tap_and_hold_setup;
+ widget_class->grab_focus = gtk_container_grab_focus;
+
class->add = gtk_container_add_unimplemented;
class->remove = gtk_container_remove_unimplemented;
class->check_resize = gtk_container_real_check_resize;
@@ -2011,6 +2036,24 @@
GtkWidget *focus_child;
GtkWidget *child;
+ /*
+ * If there's an item focus already and tab was pressed, only go thru
+ * GtkEntries and GtkTextviews. Do _not_ jump from last widget to the first
+ * one and vice verca.
+ */
+ if ((direction == GTK_DIR_TAB_FORWARD || direction == GTK_DIR_TAB_BACKWARD) &&
+ container->focus_child != NULL)
+ {
+ GtkWidget *fallback;
+ fallback = NULL;
+ if (gtk_container_focus_move_with_tab (container, direction, &fallback)
+ != FOCUS_MOVE_FAIL_NO_TEXT)
+ return TRUE;
+
+ if (fallback && gtk_widget_child_focus (fallback, direction))
+ return TRUE;
+ }
+
focus_child = container->focus_child;
while (children)
@@ -2019,7 +2062,7 @@
children = children->next;
if (!child)
- continue;
+ continue;
if (focus_child)
{
@@ -2027,8 +2070,8 @@
{
focus_child = NULL;
- if (gtk_widget_child_focus (child, direction))
- return TRUE;
+ if (gtk_widget_child_focus (child, direction))
+ return TRUE;
}
}
else if (GTK_WIDGET_DRAWABLE (child) &&
@@ -2042,6 +2085,105 @@
return FALSE;
}
+static gint
+gtk_container_focus_move_with_tab (GtkContainer *container,
+ GtkDirectionType direction,
+ GtkWidget **fallback)
+{
+ GList *children, *sorted_children;
+ GtkWidget *child;
+ GtkWidget *focus_child;
+ gboolean found_text;
+ gint ret;
+
+ found_text = FALSE;
+ focus_child = container->focus_child;
+
+ /* This part is copied from gtk_container_focus() */
+ if (container->has_focus_chain)
+ children = g_list_copy (get_focus_chain (container));
+ else
+ children = gtk_container_get_all_children (container);
+
+ if (container->has_focus_chain &&
+ (direction == GTK_DIR_TAB_FORWARD ||
+ direction == GTK_DIR_TAB_BACKWARD))
+ {
+ sorted_children = g_list_copy (children);
+
+ if (direction == GTK_DIR_TAB_BACKWARD)
+ sorted_children = g_list_reverse (sorted_children);
+ }
+ else
+ sorted_children = _gtk_container_focus_sort (container, children,
+ direction, NULL);
+ g_list_free(children);
+ children = sorted_children;
+
+ while (children)
+ {
+ child = children->data;
+ children = children->next;
+
+ if (!child)
+ continue;
+
+ if (GTK_IS_ENTRY (child) || GTK_IS_TEXT_VIEW (child))
+ found_text = TRUE;
+
+ if (focus_child)
+ {
+ if (child == focus_child)
+ {
+ focus_child = NULL;
+ if (GTK_IS_CONTAINER (child))
+ {
+ ret = gtk_container_focus_move_with_tab (GTK_CONTAINER (child),
+ direction,
+ fallback);
+ if (ret == FOCUS_MOVE_OK)
+ {
+ g_list_free (sorted_children);
+ return FOCUS_MOVE_OK;
+ }
+ else if (ret == FOCUS_MOVE_OK_NO_MOVE)
+ found_text = TRUE;
+ }
+ }
+ }
+ else if (GTK_WIDGET_DRAWABLE (child) &&
+ gtk_widget_is_ancestor (child, GTK_WIDGET (container)))
+ {
+ if (GTK_IS_ENTRY (child) || GTK_IS_TEXT_VIEW (child))
+ {
+ if (gtk_widget_child_focus (child, direction))
+ {
+ g_list_free (sorted_children);
+ return FOCUS_MOVE_OK;
+ }
+ }
+ else if (GTK_IS_CONTAINER (child))
+ {
+ ret = gtk_container_focus_move_with_tab (GTK_CONTAINER (child),
+ direction,
+ fallback);
+ if (ret == FOCUS_MOVE_OK)
+ {
+ g_list_free (sorted_children);
+ return FOCUS_MOVE_OK;
+ }
+ else if (ret == FOCUS_MOVE_OK_NO_MOVE)
+ found_text = TRUE;
+ }
+ if (GTK_WIDGET_CAN_FOCUS (child) && *fallback == NULL)
+ *fallback = child;
+ }
+ }
+
+ g_list_free (sorted_children);
+
+ return found_text ? FOCUS_MOVE_OK_NO_MOVE : FOCUS_MOVE_FAIL_NO_TEXT;
+}
static void
gtk_container_children_callback (GtkWidget *widget,
@@ -2463,3 +2605,58 @@
gdk_event_free (child_event);
}
}
+
+static void gtk_container_tap_and_hold_setup_forall( GtkWidget *widget,
+ GtkContainerTAH *tah )
+{
+ gtk_widget_tap_and_hold_setup( widget, tah->menu, tah->func,
+ tah->flags );
+}
+
+static void gtk_container_tap_and_hold_setup( GtkWidget *widget,
+ GtkWidget *menu, GtkCallback func, GtkWidgetTapAndHoldFlags flags )
+{
+ GtkContainerTAH tah;
+ g_return_if_fail( GTK_IS_WIDGET(widget));
+ g_return_if_fail( menu == NULL || GTK_IS_MENU(menu) );
+ tah.menu = menu;
+ tah.func = func;
+ tah.flags = flags;
+ if (flags & GTK_TAP_AND_HOLD_NO_INTERNALS)
+ gtk_container_foreach( GTK_CONTAINER(widget),
+ (GtkCallback)gtk_container_tap_and_hold_setup_forall, &tah );
+ else
+ gtk_container_forall( GTK_CONTAINER(widget),
+ (GtkCallback)gtk_container_tap_and_hold_setup_forall, &tah );
+ parent_class->tap_and_hold_setup (widget, menu, func, flags);
+}
+
+static void gtk_container_grab_focus( GtkWidget *focus_widget )
+{
+ if( GTK_WIDGET_CAN_FOCUS(focus_widget) )
+ parent_class->grab_focus( focus_widget );
+ else
+ {
+ GList *first = NULL;
+ GList *children = NULL;
+ GtkWidget *old_focus = NULL;
+ GtkWidget *toplevel = NULL;
+
+ toplevel = gtk_widget_get_toplevel( focus_widget );
+ if( !GTK_IS_WINDOW(toplevel) )
+ return;
+
+ old_focus = GTK_WINDOW(toplevel)->focus_widget;
+ first = gtk_container_get_all_children(
+ GTK_CONTAINER(focus_widget) );
+ children = g_list_last( first );
+
+ while( children && GTK_WINDOW(toplevel)->focus_widget == old_focus )
+ {
+ gtk_widget_grab_focus( GTK_WIDGET(children->data) );
+ children = children->prev;
+ }
+ g_list_free( first );
+ }
+}
+

View File

@ -0,0 +1,451 @@
--- gtk+-2.6.4/gtk/gtkdialog.c 2005-01-20 21:52:15.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkdialog.c 2005-04-06 16:19:36.416002288 +0300
@@ -24,6 +24,9 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2002-2003. See CHANGES file for list
+ * of changes.
+ */
#include <config.h>
#include "gtkalias.h"
#include "gtkbutton.h"
@@ -37,11 +40,14 @@
#include "gtkmain.h"
#include "gtkintl.h"
#include "gtkbindings.h"
+#include "gtkalignment.h"
#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_DIALOG, GtkDialogPrivate))
typedef struct {
guint ignore_separator : 1;
+ GtkWidget *first;
+ GtkWidget *last;
} GtkDialogPrivate;
typedef struct _ResponseData ResponseData;
@@ -77,7 +83,18 @@
static void gtk_dialog_close (GtkDialog *dialog);
static ResponseData* get_response_data (GtkWidget *widget,
- gboolean create);
+ gboolean create);
+
+static gboolean gtk_dialog_handle_focus (GtkWidget *widget,
+ GtkDirectionType dir,
+ gpointer user_data);
+
+static gboolean gtk_dialog_move_to_next_active_button (GList *iter,
+ gboolean forward);
+
+static GtkWidget *gtk_dialog_get_first_sensitive (GList *list);
+static GtkWidget *gtk_dialog_get_last_sensitive (GList *list);
+
enum {
PROP_0,
@@ -195,6 +212,23 @@
5,
G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("extended_left_border",
+ _("Content area extra left border"),
+ _("Width of extra left border around the main dialog area"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("extended_right_border",
+ _("Content area extra right border"),
+ _("Width of extra right border around the main dialog area"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+
binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
@@ -205,9 +239,15 @@
update_spacings (GtkDialog *dialog)
{
GtkWidget *widget;
+ GtkWidget *hbox;
+ GtkWidget *left_padding;
+ GtkWidget *right_padding;
gint content_area_border;
gint button_spacing;
gint action_area_border;
+
+ gint extended_left_border;
+ gint extended_right_border;
widget = GTK_WIDGET (dialog);
@@ -218,6 +258,10 @@
&button_spacing,
"action_area_border",
&action_area_border,
+ "extended_left_border",
+ &extended_left_border,
+ "extended_right_border",
+ &extended_right_border,
NULL);
gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox),
@@ -226,12 +270,36 @@
button_spacing);
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area),
action_area_border);
+
+ if ((extended_left_border == 0) && (extended_right_border == 0))
+ /* no extended borders, so we are done */
+ return;
+
+ /* extended borders are in use, so reconstruct dialog */
+ hbox = gtk_hbox_new(FALSE, 0);
+ left_padding = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
+ right_padding = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
+ gtk_widget_set_size_request(left_padding, extended_left_border, 0);
+ gtk_widget_set_size_request(right_padding, extended_right_border, 0);
+
+ gtk_widget_ref(dialog->vbox);
+ gtk_container_remove(GTK_CONTAINER(dialog), dialog->vbox);
+ gtk_container_add(GTK_CONTAINER(hbox), left_padding);
+ gtk_container_add(GTK_CONTAINER(hbox), dialog->vbox);
+ gtk_container_add(GTK_CONTAINER(hbox), right_padding);
+ gtk_container_add(GTK_CONTAINER(dialog), hbox);
+ gtk_widget_unref(dialog->vbox);
+
+ gtk_widget_show(left_padding);
+ gtk_widget_show(right_padding);
+ gtk_widget_show(hbox);
}
static void
gtk_dialog_init (GtkDialog *dialog)
{
GtkDialogPrivate *priv;
+ GtkWidget *alignment;
priv = GET_PRIVATE (dialog);
priv->ignore_separator = FALSE;
@@ -250,14 +318,23 @@
gtk_container_add (GTK_CONTAINER (dialog), dialog->vbox);
gtk_widget_show (dialog->vbox);
+ /* Hildon : Here we add an alignment widget to gtk because
+ * we want that the dialog buttons are all centered. */
+ alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
+ gtk_box_pack_end (GTK_BOX (dialog->vbox), alignment, FALSE, TRUE, 0);
+
dialog->action_area = gtk_hbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area),
GTK_BUTTONBOX_END);
- gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area,
- FALSE, TRUE, 0);
+ /* we need add-signal to allocate correct area for childs */
+ gtk_container_add (GTK_CONTAINER (alignment), dialog->action_area);
+ /* gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area,
+ FALSE, TRUE, 0); */
+
gtk_widget_show (dialog->action_area);
+ gtk_widget_show (alignment);
dialog->separator = gtk_hseparator_new ();
gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->separator, FALSE, TRUE, 0);
@@ -616,9 +693,15 @@
else
g_warning ("Only 'activatable' widgets can be packed into the action area of a GtkDialog");
+ gtk_container_add(GTK_CONTAINER(dialog->action_area), child);
+/*
gtk_box_pack_end (GTK_BOX (dialog->action_area),
child,
FALSE, TRUE, 0);
+*/
+
+ g_signal_connect (child, "focus",
+ (GCallback)gtk_dialog_handle_focus, (gpointer)dialog);
if (response_id == GTK_RESPONSE_HELP)
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (dialog->action_area), child, TRUE);
@@ -637,7 +720,7 @@
* you don't need it.
*
* Return value: the button widget that was added
- **/
+ **/ /*ROK*/
GtkWidget*
gtk_dialog_add_button (GtkDialog *dialog,
const gchar *button_text,
@@ -653,7 +736,10 @@
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_show (button);
-
+
+ g_signal_connect (button, "focus",
+ (GCallback)gtk_dialog_handle_focus,
+ (gpointer)dialog);
gtk_dialog_add_action_widget (dialog,
button,
response_id);
@@ -990,6 +1076,8 @@
gulong unmap_handler;
gulong destroy_handler;
gulong delete_handler;
+ GtkDialogPrivate *priv;
+ GList *list = NULL;
g_return_val_if_fail (GTK_IS_DIALOG (dialog), -1);
@@ -1001,6 +1089,27 @@
if (!GTK_WIDGET_VISIBLE (dialog))
gtk_widget_show (GTK_WIDGET (dialog));
+
+ priv = GET_PRIVATE (dialog);
+ list = gtk_container_get_children (GTK_CONTAINER (dialog->vbox));
+ priv->first = gtk_dialog_get_first_sensitive (list);
+ priv->last = gtk_dialog_get_last_sensitive (list);
+
+ if (priv->first)
+ {
+ g_signal_connect (priv->first, "focus",
+ (GCallback)gtk_dialog_handle_focus,
+ (gpointer)dialog);
+ }
+
+ if (priv->last)
+ {
+ g_signal_connect (priv->last, "focus",
+ (GCallback)gtk_dialog_handle_focus,
+ (gpointer)dialog);
+ }
+
+ g_list_free (list);
response_handler =
g_signal_connect (dialog,
@@ -1236,4 +1345,215 @@
gtk_box_reorder_child (GTK_BOX (dialog->action_area), child, position);
}
}
+static gboolean
+gtk_dialog_handle_focus (GtkWidget *widget,
+ GtkDirectionType dir,
+ gpointer user_data)
+ {
+ GtkDialog *dialog = NULL;
+ GList *list = NULL;
+ GList *iter = NULL;
+ gint i = 0;
+ gint list_length = 0;
+ gboolean ret_val = FALSE;
+ GtkDialogPrivate *priv;
+
+ dialog = GTK_DIALOG(user_data);
+ list = gtk_container_get_children (GTK_CONTAINER(
+ GTK_DIALOG(user_data)->action_area));
+ iter = list;
+ priv = GET_PRIVATE (dialog);
+
+ if (GTK_WIDGET_HAS_FOCUS (widget))
+ if (widget == priv->first)
+ {
+ if (dir == GTK_DIR_UP)
+ {
+ ret_val = gtk_dialog_move_to_next_active_button (g_list_last (list),
+ FALSE);
+ }
+ else if (dir == GTK_DIR_DOWN && priv->first == priv->last)
+ ret_val = gtk_dialog_move_to_next_active_button (list, TRUE);
+ else if (dir == GTK_DIR_DOWN)
+ {
+ }
+ }
+ else if (widget == priv->last)
+ {
+ if (dir == GTK_DIR_DOWN)
+ {
+ ret_val = gtk_dialog_move_to_next_active_button (list, TRUE);
+ }
+ else if (dir == GTK_DIR_UP)
+ {
+ }
+ }
+ else
+ {
+ list_length = g_list_length(list);
+ while (iter != NULL)
+ {
+ ++i;
+ if (iter->data == widget)
+ {
+ switch (dir) {
+ case GTK_DIR_UP:
+ /* If in the first item -> the default works like it should */
+
+ if (i > 1)
+ {
+ /* If not in the first button, but in the first active
+ * button, the default should do, else handle movement
+ * by yourself
+ */
+ ret_val = gtk_dialog_move_to_next_active_button (
+ g_list_previous (iter),
+ FALSE);
+ }
+ else
+ {
+ /* gtk_widget_grab_focus (priv->last);*/
+ g_signal_emit_by_name (dialog, "move-focus",
+ GTK_DIR_TAB_BACKWARD);
+ ret_val = TRUE;
+ }
+ break;
+
+ /* If in the last item:jump to top, else select previous button */
+ case GTK_DIR_DOWN:
+ if (i < list_length)
+ {
+ ret_val = gtk_dialog_move_to_next_active_button (
+ g_list_next (iter),
+ TRUE);
+ if (!ret_val)
+ {
+ g_signal_emit_by_name (dialog, "move-focus",
+ GTK_DIR_TAB_FORWARD);
+ ret_val = TRUE;
+ }
+ }
+ else
+ {
+ g_signal_emit_by_name (dialog, "move-focus",
+ GTK_DIR_TAB_FORWARD);
+ ret_val = TRUE;
+ }
+ break;
+
+ case GTK_DIR_TAB_BACKWARD:
+ case GTK_DIR_TAB_FORWARD:
+ case GTK_DIR_LEFT:
+ case GTK_DIR_RIGHT:
+ default:
+ break;
+ }
+ break;
+ }
+ iter = g_list_next(iter);
+ }
+ }
+
+ g_list_free (list);
+
+ return ret_val;
+ }
+static gboolean
+gtk_dialog_move_to_next_active_button (GList *iter, gboolean forward)
+{
+ gboolean active;
+ gboolean visible;
+
+ while (iter)
+ {
+ g_object_get (G_OBJECT (iter->data), "sensitive", &active, NULL);
+ g_object_get (G_OBJECT (iter->data), "visible", &visible, NULL);
+ if (active && visible)
+ {
+ gtk_widget_grab_focus (GTK_WIDGET (iter->data));
+ return TRUE;
+ }
+
+ if (forward)
+ iter = g_list_next (iter);
+ else
+ iter = g_list_previous (iter);
+ }
+
+ return FALSE;
+}
+static GtkWidget*
+gtk_dialog_get_first_sensitive (GList *list)
+{
+ GList *sublist = NULL;
+ GList *iter = NULL;
+ GtkWidget *widget = NULL;
+ gboolean active;
+ gboolean visible;
+ while (list)
+ {
+ widget = GTK_WIDGET (list->data);
+ if (GTK_IS_CONTAINER (widget))
+ {
+ sublist = gtk_container_get_children (GTK_CONTAINER(widget));
+ widget = gtk_dialog_get_first_sensitive (sublist);
+ g_list_free (sublist);
+ sublist = NULL;
+
+ if (widget)
+ return widget;
+ }
+ else
+ {
+ g_object_get (G_OBJECT (widget), "sensitive", &active, NULL);
+ g_object_get (G_OBJECT (widget), "visible", &visible, NULL);
+ if (active && visible && GTK_WIDGET_CAN_FOCUS (widget))
+ return widget;
+ }
+
+ list = g_list_next (list);
+ }
+
+ return NULL;
+}
+
+static GtkWidget*
+gtk_dialog_get_last_sensitive (GList *list)
+{
+ GList *sublist = NULL;
+ GtkWidget *widget = NULL;
+ gboolean active;
+ gboolean visible;
+
+ list = g_list_last (list);
+ if (list && list->prev != NULL)
+ list = g_list_previous (list);
+
+ while (list)
+ {
+ widget = GTK_WIDGET (list->data);
+ if (GTK_IS_CONTAINER (widget))
+ {
+ sublist = gtk_container_get_children (GTK_CONTAINER(widget));
+ widget = gtk_dialog_get_last_sensitive (sublist);
+ g_list_free (sublist);
+ sublist = NULL;
+
+ if (widget)
+ return widget;
+ }
+ else
+ {
+ g_object_get (G_OBJECT (widget), "sensitive", &active, NULL);
+ g_object_get (G_OBJECT (widget), "visible", &visible, NULL);
+ if (active && visible && GTK_WIDGET_CAN_FOCUS (widget))
+ return widget;
+ }
+
+ list = g_list_previous (list);
+ }
+
+ return NULL;
+}
+

View File

@ -0,0 +1,12 @@
--- gtk+-2.6.4/gtk/gtkdnd.c 2005-02-01 20:07:40.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkdnd.c 2005-04-06 16:19:36.432999704 +0300
@@ -2145,6 +2145,9 @@
g_signal_connect (widget, "button_press_event",
G_CALLBACK (gtk_drag_source_event_cb),
site);
+ g_signal_connect (widget, "button_release_event",
+ G_CALLBACK (gtk_drag_source_event_cb),
+ site);
g_signal_connect (widget, "motion_notify_event",
G_CALLBACK (gtk_drag_source_event_cb),
site);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
--- gtk+-2.6.4/gtk/gtkenums.h 2003-07-18 21:52:02.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkenums.h 2005-04-06 16:19:36.500989368 +0300
@@ -133,7 +133,11 @@
GTK_ICON_SIZE_LARGE_TOOLBAR,
GTK_ICON_SIZE_BUTTON,
GTK_ICON_SIZE_DND,
- GTK_ICON_SIZE_DIALOG
+ GTK_ICON_SIZE_DIALOG,
+ HILDON_ICON_SIZE_26,
+ HILDON_ICON_SIZE_40,
+ HILDON_ICON_SIZE_50,
+ HILDON_ICON_SIZE_64
} GtkIconSize;
#ifndef GTK_DISABLE_DEPRECATED

View File

@ -0,0 +1,12 @@
--- gtk+-2.6.4/gtk/gtkfilesystem.c 2004-09-13 19:00:00.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkfilesystem.c 2005-04-06 16:19:36.518986632 +0300
@@ -1147,4 +1147,9 @@
return fs;
}
+/* In Hildon we need to publish the previous symbol */
+GtkFileSystem *hildon_gtk_file_system_create(const char *file_system_name)
+{
+ return _gtk_file_system_create (file_system_name);
+}

View File

@ -0,0 +1,12 @@
--- gtk+-2.6.4/gtk/gtkfilesystem.h 2005-01-03 01:15:21.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkfilesystem.h 2005-04-06 16:19:36.518986632 +0300
@@ -364,6 +364,9 @@
GtkFileSystem *_gtk_file_system_create (const char *file_system_name);
+/* In Hildon we need to publish the previous symbol */
+GtkFileSystem *hildon_gtk_file_system_create(const char *file_system_name);
+
G_END_DECLS
#endif /* __GTK_FILE_SYSTEM_H__ */

View File

@ -0,0 +1,82 @@
--- gtk+-2.6.4/gtk/gtkframe.c 2004-08-17 22:10:24.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkframe.c 2005-04-06 16:19:36.583976752 +0300
@@ -24,6 +24,10 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2002-2003. See CHANGES file for list
+ * of changes.
+ */
+
#include <config.h>
#include <string.h>
#include "gtkalias.h"
@@ -33,6 +37,7 @@
#define LABEL_PAD 1
#define LABEL_SIDE_PAD 2
+#define FRAME_BORDER_WIDTH 3
enum {
PROP_0,
@@ -172,6 +177,14 @@
P_("A widget to display in place of the usual frame label"),
GTK_TYPE_WIDGET,
G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+ /* draw hildonlike frame */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("hildonlike",
+ _("hildonlike looks"),
+ _("Draw frame, 1/0"),
+ FALSE,
+ G_PARAM_READABLE));
widget_class->expose_event = gtk_frame_expose;
widget_class->size_request = gtk_frame_size_request;
@@ -276,7 +289,7 @@
GtkWidget*
gtk_frame_new (const gchar *label)
{
- return g_object_new (GTK_TYPE_FRAME, "label", label, NULL);
+ return g_object_new (GTK_TYPE_FRAME, "label", label, "border-width", FRAME_BORDER_WIDTH, NULL);
}
static void
@@ -533,6 +546,9 @@
{
GtkFrame *frame;
gint x, y, width, height;
+ gboolean hildonlike;
+
+ gtk_widget_style_get ( widget, "hildonlike", &hildonlike, NULL );
if (GTK_WIDGET_DRAWABLE (widget))
{
@@ -543,7 +559,16 @@
width = frame->child_allocation.width + 2 * widget->style->xthickness;
height = frame->child_allocation.height + 2 * widget->style->ythickness;
- if (frame->label_widget)
+ if (hildonlike) {
+ /* draw hildon application borders */
+ gtk_paint_box (widget->style,
+ widget->window,
+ GTK_WIDGET_STATE( widget ),
+ GTK_SHADOW_OUT,
+ NULL, widget, "frame",
+ x, y, width, height);
+ }
+ else if (frame->label_widget)
{
GtkRequisition child_requisition;
gfloat xalign;
@@ -586,7 +611,7 @@
{
if (GTK_WIDGET_DRAWABLE (widget))
{
- gtk_frame_paint (widget, &event->area);
+ gtk_frame_paint (widget, &event->area);
(* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
}

View File

@ -0,0 +1,102 @@
--- gtk+-2.6.4/gtk/gtkhashtable.c 1970-01-01 02:00:00.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkhashtable.c 2005-04-06 16:19:36.596974776 +0300
@@ -0,0 +1,99 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2005 Nokia
+ * Author: Jorn Baayen <jbaayen@gnome.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 <config.h>
+#include "gtkhashtable.h"
+
+static gpointer parent_class = NULL;
+
+static void _gtk_hash_table_init (GtkHashTable *hash_table);
+static void _gtk_hash_table_class_init (GtkHashTableClass *klass);
+static void _gtk_hash_table_finalize (GObject *object);
+
+GType
+_gtk_hash_table_get_type (void)
+{
+ static GType hash_table_type = 0;
+
+ if (!hash_table_type)
+ {
+ static const GTypeInfo hash_table_info =
+ {
+ sizeof (GtkHashTableClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) _gtk_hash_table_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkHashTable),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) _gtk_hash_table_init,
+ };
+
+ hash_table_type =
+ g_type_register_static (G_TYPE_OBJECT, "GtkHashTable",
+ &hash_table_info, 0);
+ }
+
+ return hash_table_type;
+}
+
+static void
+_gtk_hash_table_init (GtkHashTable *hash_table)
+{
+ hash_table->hash = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, g_free);
+}
+
+static void
+_gtk_hash_table_class_init (GtkHashTableClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = _gtk_hash_table_finalize;
+}
+
+static void
+_gtk_hash_table_finalize (GObject *object)
+{
+ GtkHashTable *hash_table = GTK_HASH_TABLE (object);
+
+ g_hash_table_destroy (hash_table->hash);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+/**
+ * _gtk_hash_table_new:
+ *
+ * Creates a new #GtkHashTable. This is a #GHashTable wrapped in a GObject,
+ * thereby supporting refcounting.
+ *
+ * Return value: a new #GtkHashTable
+ **/
+GtkHashTable*
+_gtk_hash_table_new (void)
+{
+ return g_object_new (GTK_TYPE_HASH_TABLE, NULL);
+}
+
+

View File

@ -0,0 +1,64 @@
--- gtk+-2.6.4/gtk/gtkhashtable.h 1970-01-01 02:00:00.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkhashtable.h 2005-04-06 16:19:36.606973256 +0300
@@ -0,0 +1,61 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2005 Nokia
+ * Author: Jorn Baayen <jbaayen@gnome.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.
+ */
+
+#ifndef __GTK_HASH_TABLE_H__
+#define __GTK_HASH_TABLE_H__
+
+#include <glib-object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct _GtkHashTable GtkHashTable;
+typedef struct _GtkHashTableClass GtkHashTableClass;
+
+#define GTK_TYPE_HASH_TABLE (_gtk_hash_table_get_type ())
+#define GTK_HASH_TABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_HASH_TABLE, GtkHashTable))
+#define GTK_HASH_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HASH_TABLE, GtkHashTableClass))
+#define GTK_IS_HASH_TABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_HASH_TABLE))
+#define GTK_IS_HASH_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HASH_TABLE))
+#define GTK_HASH_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HASH_TABLE, GtkHashTableClass))
+
+struct _GtkHashTable
+{
+ GObject parent_instance;
+
+ GHashTable *hash;
+};
+
+struct _GtkHashTableClass
+{
+ GObjectClass parent_class;
+};
+
+GType _gtk_hash_table_get_type (void) G_GNUC_CONST;
+GtkHashTable* _gtk_hash_table_new (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GTK_HASH_TABLE_H__ */
+
+

View File

@ -0,0 +1,344 @@
--- gtk+-2.6.4/gtk/gtkhbbox.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkhbbox.c 2005-04-06 16:19:36.644967480 +0300
@@ -24,10 +24,20 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list
+ * of changes.
+ */
+
+/* Hildon : Button spacing according to the spec. */
+#define HILDON_BUTTON_SPACING 5
+/* Selecting hetefogenous mode for a childlayout */
+#define GTK_BUTTONBOX_HETEROGENOUS 6
+
#include <config.h>
#include "gtkalias.h"
#include "gtkhbbox.h"
-
+/* Hildon : We need this to mess with buttons graphics. */
+#include "gtkbutton.h"
static void gtk_hbutton_box_class_init (GtkHButtonBoxClass *klass);
static void gtk_hbutton_box_init (GtkHButtonBox *box);
@@ -36,6 +46,15 @@
static void gtk_hbutton_box_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
+static void osso_gtk_hbutton_child_showhide_handler (GtkWidget *widget,
+ gpointer user_data);
+static void osso_gtk_hbutton_box_remove_child_signal_handlers (GtkHButtonBox *hbbox,
+ GtkWidget *removed_widget,
+ gpointer data);
+static void osso_gtk_hbutton_box_find_button_detail (GtkHButtonBox *hbbox,
+ GtkWidget *addremovewidget,
+ gpointer data);
+
static gint default_spacing = 30;
static gint default_layout_style = GTK_BUTTONBOX_EDGE;
@@ -76,12 +95,23 @@
widget_class->size_request = gtk_hbutton_box_size_request;
widget_class->size_allocate = gtk_hbutton_box_size_allocate;
+
+ /* HILDON:
+ * Name buttons only if hildon like style property is set
+ */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean
+ ( "hildonlike",
+ "hildonlike looks",
+ "Name buttons, 1/0",
+ FALSE,
+ G_PARAM_READABLE) );
}
static void
gtk_hbutton_box_init (GtkHButtonBox *hbutton_box)
{
- /* button_box_init has done everything allready */
+ /* button_box_init has done everything allready */
}
GtkWidget*
@@ -91,6 +121,24 @@
hbutton_box = g_object_new (GTK_TYPE_HBUTTON_BOX, NULL);
+ /* Attach signal handler for 'hildonizing' buttons.
+ * gtk_hbutton_box_hildonize_buttons will check the name
+ * and if it is something we're interested in i.e.
+ *
+ * hildon_dialogbuttons
+ * hildon_viewbuttons
+ *
+ * it will do the hildonizing
+ */
+ g_signal_connect_after (G_OBJECT (hbutton_box), "remove",
+ G_CALLBACK (osso_gtk_hbutton_box_remove_child_signal_handlers),
+ NULL);
+ g_signal_connect_after( G_OBJECT( hbutton_box ), "add",
+ G_CALLBACK( osso_gtk_hbutton_box_find_button_detail ),
+ NULL );
+ g_signal_connect_after( G_OBJECT( hbutton_box ), "remove",
+ G_CALLBACK( osso_gtk_hbutton_box_find_button_detail ),
+ NULL );
return GTK_WIDGET (hbutton_box);
}
@@ -145,6 +193,11 @@
gint child_height;
gint spacing;
GtkButtonBoxStyle layout;
+ gint child_xpad=0;
+ GtkBoxChild *child_req;
+ GList *children_req;
+ GtkRequisition treq;
+
box = GTK_BOX (widget);
bbox = GTK_BUTTON_BOX (widget);
@@ -159,6 +212,12 @@
&child_width,
&child_height);
+ /* should GTK_BUTTONBOX_HETEROGENOUS add into the GtkButtonBoxStyle
+ enum struct
+ */
+ if( !box->homogeneous )
+ layout = GTK_BUTTONBOX_HETEROGENOUS;
+
if (nvis_children == 0)
{
requisition->width = 0;
@@ -177,11 +236,36 @@
case GTK_BUTTONBOX_END:
requisition->width = nvis_children*child_width + ((nvis_children-1)*spacing);
break;
+ case GTK_BUTTONBOX_HETEROGENOUS:
+ children_req = GTK_BOX (box)->children;
+ child_req = children_req->data;
+ requisition->width = 0;
+
+ while (children_req)
+ {
+ child_req = children_req->data;
+ children_req = children_req->next;
+
+ if (GTK_WIDGET_VISIBLE (child_req->widget))
+ {
+ gtk_widget_get_child_requisition( child_req->widget,
+ &(treq) );
+ requisition->width += treq.width;
+
+ gtk_widget_style_get(widget,
+ "child-internal-pad-x",
+ &(child_xpad), NULL);
+ requisition->width += (child_xpad*2);
+ }
+ }
+ requisition->width += ((nvis_children-1)*spacing);
+
+ break;
default:
g_assert_not_reached();
break;
}
-
+
requisition->height = child_height;
}
@@ -227,6 +311,10 @@
&child_height);
widget->allocation = *allocation;
width = allocation->width - GTK_CONTAINER (box)->border_width*2;
+
+ if( !base_box->homogeneous )
+ layout = GTK_BUTTONBOX_HETEROGENOUS;
+
switch (layout)
{
case GTK_BUTTONBOX_SPREAD:
@@ -264,6 +352,39 @@
- GTK_CONTAINER (box)->border_width;
secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
break;
+ case GTK_BUTTONBOX_HETEROGENOUS:
+ {
+ gint sumwidth = 0;
+ GtkBoxChild *child_h;
+ GList *children_h = GTK_BOX (box)->children;
+ /* heterogenous sized childs onto center */
+ childspacing = spacing;
+ child_h = children_h->data;
+
+ while (children_h )
+ {
+ if ( g_list_length (children_h) == 0 ) break;
+
+ child_h = children_h->data;
+ children_h = children_h->next;
+
+ if (GTK_WIDGET_VISIBLE (child_h->widget))
+ {
+ gint child_xpad = 0;
+ GtkRequisition treq;
+ gtk_widget_get_child_requisition( child_h->widget, &(treq) );
+ sumwidth += treq.width;
+
+ gtk_widget_style_get(widget,
+ "child-internal-pad-x",
+ &(child_xpad), NULL);
+ sumwidth += (child_xpad*2);
+ }
+ }
+ x = secondary_x = allocation->x +
+ ( (allocation->width - sumwidth - (spacing * (nvis_children - 1)))/2 );
+ break;
+ }
default:
g_assert_not_reached();
break;
@@ -282,10 +403,33 @@
if (GTK_WIDGET_VISIBLE (child->widget))
{
- child_allocation.width = child_width;
child_allocation.height = child_height;
child_allocation.y = y;
+ if(layout != GTK_BUTTONBOX_HETEROGENOUS)
+ {
+ child_allocation.width = child_width;
+ }
+ else /* if layout will be hetergenous */
+ {
+ gint child_hwidth = 0;
+ GtkRequisition treq;
+ gint child_xpad = 0;
+
+ gtk_widget_get_child_requisition( child->widget, &(treq) );
+ child_hwidth += treq.width;
+
+ gtk_widget_style_get(widget,
+ "child-internal-pad-x",
+ &child_xpad, NULL);
+ child_hwidth += (child_xpad*2);
+
+ child_allocation.width = child_hwidth;
+ childspace = child_hwidth + childspacing;
+
+ }
+
+ /* calculate the horizontal location */
if (child->is_secondary)
{
child_allocation.x = secondary_x;
@@ -304,4 +448,104 @@
}
}
}
+
+/* Function to wrap "hide" and "show" signals to call
+ * osso_gtk_hbutton_box_find_button_detail -function.*/
+static void osso_gtk_hbutton_child_showhide_handler (GtkWidget *widget,
+ gpointer user_data)
+{
+ osso_gtk_hbutton_box_find_button_detail (widget, GTK_WIDGET (user_data), NULL);
+}
+/* Function to remove "show"&"hide" signal handlers
+ * from a child when it's removed. */
+static void osso_gtk_hbutton_box_remove_child_signal_handlers (GtkHButtonBox *hbbox,
+ GtkWidget *removed_widget,
+ gpointer data)
+{
+ g_signal_handlers_disconnect_by_func (G_OBJECT (removed_widget), osso_gtk_hbutton_box_find_button_detail, hbbox);
+}
+
+/* Signal handler called when we have to set
+ * painting detail values for buttons in this
+ * gtk_horizontal_button_box.
+ */
+static void osso_gtk_hbutton_box_find_button_detail (GtkHButtonBox *hbbox,
+ GtkWidget *addremovewidget,
+ gpointer data)
+{
+ GList *child;
+ gint visible_buttons = 0;
+ gint secondary_buttons = 0;
+ GtkWidget *leftmost_button = NULL;
+ GtkWidget *rightmost_button = NULL;
+
+ for( child = GTK_BOX (hbbox)->children ; child ; child = child->next )
+ {
+ GtkBoxChild *box_child = child->data;
+ GtkWidget *child_widget = box_child->widget;
+ gulong signal_handler = g_signal_handler_find ( G_OBJECT( child_widget ),
+ G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL,
+ G_CALLBACK (osso_gtk_hbutton_child_showhide_handler),
+ NULL);
+
+ if (signal_handler == 0)
+ {
+ g_signal_connect_object ( G_OBJECT( child_widget ),
+ "hide",
+ G_CALLBACK ( osso_gtk_hbutton_child_showhide_handler ),
+ hbbox, G_CONNECT_SWAPPED);
+ g_signal_connect_object ( G_OBJECT( child_widget ),
+ "show",
+ G_CALLBACK ( osso_gtk_hbutton_child_showhide_handler ),
+ hbbox, G_CONNECT_SWAPPED);
+ }
+
+ if ((GTK_WIDGET_VISIBLE (child_widget)) &&
+ (GTK_IS_BUTTON (child_widget)))
+ visible_buttons++;
+ else
+ continue;
+
+ if (leftmost_button == NULL)
+ leftmost_button = child_widget;
+
+ if (secondary_buttons == 0)
+ rightmost_button = child_widget;
+ else
+ if (box_child->is_secondary)
+ {
+ rightmost_button = child_widget;
+ secondary_buttons++;
+ }
+
+ if (box_child->is_secondary)
+ rightmost_button = child_widget;
+ }
+
+ if (visible_buttons == 0)
+ return;
+
+ for( child = GTK_BOX (hbbox)->children ; child ; child = child->next )
+ {
+ GtkBoxChild *box_child = child->data;
+ GtkWidget *child_widget = box_child->widget;
+ OssoGtkButtonAttachFlags attachflags = OSSO_GTK_BUTTON_ATTACH_NORTH | OSSO_GTK_BUTTON_ATTACH_SOUTH;
+ gboolean automatic_detail;
+
+ if (!((GTK_WIDGET_VISIBLE (child_widget)) &&
+ (GTK_IS_BUTTON (child_widget))))
+ continue;
+
+ if (child_widget == leftmost_button)
+ attachflags |= OSSO_GTK_BUTTON_ATTACH_WEST;
+
+ if (child_widget == rightmost_button)
+ attachflags |= OSSO_GTK_BUTTON_ATTACH_EAST;
+
+ g_object_get (G_OBJECT (child_widget), "automatic_detail", &automatic_detail, NULL);
+ if (automatic_detail == TRUE)
+ g_object_set (G_OBJECT (child_widget), "detail", osso_gtk_button_attach_details[attachflags], NULL);
+ }
+}

View File

@ -0,0 +1,40 @@
--- gtk+-2.6.4/gtk/gtkhseparator.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkhseparator.c 2005-04-06 16:19:36.667963984 +0300
@@ -91,13 +91,29 @@
gtk_hseparator_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- if (GTK_WIDGET_DRAWABLE (widget))
- gtk_paint_hline (widget->style, widget->window, GTK_WIDGET_STATE (widget),
- &event->area, widget, "hseparator",
- widget->allocation.x,
- widget->allocation.x + widget->allocation.width - 1,
- widget->allocation.y + (widget->allocation.height -
- widget->style->ythickness) / 2);
+ gboolean hildonlike_drawing = FALSE;
+ gtk_widget_style_get ( widget, "hildonlike-drawing", &hildonlike_drawing, NULL );
- return FALSE;
+ if (GTK_WIDGET_DRAWABLE (widget))
+ {
+ if(hildonlike_drawing)
+ gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE, &event->area, widget, "hseparator",
+ widget->allocation.x,
+ widget->allocation.y + (widget->allocation.height -
+ widget->style->ythickness) / 2,
+ widget->allocation.width - 1,
+ widget->style->ythickness);
+ else
+ gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL,
+ &event->area, widget, "hseparator",
+ widget->allocation.x,
+ widget->allocation.x + widget->allocation.width - 1,
+ widget->allocation.y + (widget->allocation.height -
+ widget->style->ythickness) / 2);
+ }
+
+
+
+ return FALSE;
}

View File

@ -0,0 +1,69 @@
--- gtk+-2.6.4/gtk/gtkiconfactory.c 2005-01-03 16:44:33.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkiconfactory.c 2005-04-06 16:19:36.804943160 +0300
@@ -813,7 +813,7 @@
{
if (icon_sizes == NULL)
{
-#define NUM_BUILTIN_SIZES 7
+#define NUM_BUILTIN_SIZES 11
gint i;
icon_aliases = g_hash_table_new (g_str_hash, g_str_equal);
@@ -863,7 +863,27 @@
icon_sizes[GTK_ICON_SIZE_DIALOG].width = 48;
icon_sizes[GTK_ICON_SIZE_DIALOG].height = 48;
- g_assert ((GTK_ICON_SIZE_DIALOG + 1) == NUM_BUILTIN_SIZES);
+ icon_sizes[HILDON_ICON_SIZE_26].size = HILDON_ICON_SIZE_26;
+ icon_sizes[HILDON_ICON_SIZE_26].name = "hildon-26";
+ icon_sizes[HILDON_ICON_SIZE_26].width = 26;
+ icon_sizes[HILDON_ICON_SIZE_26].height = 26;
+
+ icon_sizes[HILDON_ICON_SIZE_40].size = HILDON_ICON_SIZE_40;
+ icon_sizes[HILDON_ICON_SIZE_40].name = "hildon-40";
+ icon_sizes[HILDON_ICON_SIZE_40].width = 40;
+ icon_sizes[HILDON_ICON_SIZE_40].height = 40;
+
+ icon_sizes[HILDON_ICON_SIZE_50].size = HILDON_ICON_SIZE_50;
+ icon_sizes[HILDON_ICON_SIZE_50].name = "hildon-50";
+ icon_sizes[HILDON_ICON_SIZE_50].width = 50;
+ icon_sizes[HILDON_ICON_SIZE_50].height = 50;
+
+ icon_sizes[HILDON_ICON_SIZE_64].size = HILDON_ICON_SIZE_64;
+ icon_sizes[HILDON_ICON_SIZE_64].name = "hildon-64";
+ icon_sizes[HILDON_ICON_SIZE_64].width = 54;
+ icon_sizes[HILDON_ICON_SIZE_64].height = 64;
+
+ g_assert ((HILDON_ICON_SIZE_64 + 1) == NUM_BUILTIN_SIZES);
/* Alias everything to itself. */
i = 1; /* skip invalid size */
@@ -1658,7 +1678,7 @@
gint width, height, pixel_size;
gint *sizes, *s, dist;
GError *error = NULL;
-
+
if (widget && gtk_widget_has_screen (widget))
screen = gtk_widget_get_screen (widget);
else if (style && style->colormap)
@@ -1734,8 +1754,10 @@
tmp_source.type = GTK_ICON_SOURCE_PIXBUF;
tmp_source.source.pixbuf = tmp_pixbuf;
+ /* Hildon: no scaling allowed for Hildon icons */
pixbuf = gtk_style_render_icon (style, &tmp_source,
- direction, state, -1,
+ direction, state,
+ (size < HILDON_ICON_SIZE_26) ? -1 : size,
widget, detail);
if (!pixbuf)
@@ -1818,7 +1840,6 @@
{
/* This icon can be used for any direction/state/size */
static GtkIconSource fallback_source = GTK_ICON_SOURCE_INIT (TRUE, TRUE, TRUE);
-
if (fallback_source.type == GTK_ICON_SOURCE_EMPTY)
{
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_inline (-1, stock_missing_image_24, FALSE, NULL);

View File

@ -0,0 +1,48 @@
--- gtk+-2.6.4/gtk/gtkicontheme.c 2005-03-01 17:24:48.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkicontheme.c 2005-04-06 16:19:36.807942704 +0300
@@ -64,7 +64,8 @@
ICON_SUFFIX_XPM = 1 << 0,
ICON_SUFFIX_SVG = 1 << 1,
ICON_SUFFIX_PNG = 1 << 2,
- HAS_ICON_FILE = 1 << 3
+ HAS_ICON_FILE = 1 << 3,
+ ICON_SUFFIX_ANI = 1 << 4
} IconSuffix;
@@ -1743,6 +1744,8 @@
return ".svg";
case ICON_SUFFIX_PNG:
return ".png";
+ case ICON_SUFFIX_ANI:
+ return ".ani";
default:
g_assert_not_reached();
}
@@ -1760,6 +1763,8 @@
retval = ICON_SUFFIX_SVG;
else if (g_str_has_suffix (name, ".xpm"))
retval = ICON_SUFFIX_XPM;
+ else if (g_str_has_suffix (name, ".ani"))
+ retval = ICON_SUFFIX_ANI;
else
retval = ICON_SUFFIX_NONE;
@@ -1776,6 +1781,8 @@
return ICON_SUFFIX_SVG;
else if ((suffix & ICON_SUFFIX_XPM) != 0)
return ICON_SUFFIX_XPM;
+ else if ((suffix & ICON_SUFFIX_ANI) != 0)
+ return ICON_SUFFIX_ANI;
else
return ICON_SUFFIX_NONE;
}
@@ -2558,7 +2565,7 @@
icon_info->pixbuf = gdk_pixbuf_scale_simple (source_pixbuf,
0.5 + image_width * icon_info->scale,
0.5 + image_height * icon_info->scale,
- GDK_INTERP_BILINEAR);
+ GDK_INTERP_NEAREST);
g_object_unref (source_pixbuf);
}

View File

@ -0,0 +1,52 @@
--- gtk+-2.6.4/gtk/gtkimcontext.c 2004-09-26 07:23:56.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkimcontext.c 2005-04-06 16:19:36.814941640 +0300
@@ -360,6 +360,44 @@
}
/**
+ * gtk_im_context_show:
+ * @context: a #GtkIMContext
+ *
+ * Notify the input method that widget thinks the actual
+ * input method show be opened.
+ **/
+void
+gtk_im_context_show (GtkIMContext *context)
+{
+ GtkIMContextClass *klass;
+
+ g_return_if_fail (GTK_IS_IM_CONTEXT (context));
+
+ klass = GTK_IM_CONTEXT_GET_CLASS (context);
+ if (klass->show)
+ klass->show (context);
+}
+
+/**
+ * gtk_im_context_hide:
+ * @context: a #GtkIMContext
+ *
+ * Notify the input method that widget thinks the actual
+ * input method show be closed.
+ **/
+void
+gtk_im_context_hide (GtkIMContext *context)
+{
+ GtkIMContextClass *klass;
+
+ g_return_if_fail (GTK_IS_IM_CONTEXT (context));
+
+ klass = GTK_IM_CONTEXT_GET_CLASS (context);
+ if (klass->hide)
+ klass->hide (context);
+}
+
+/**
* gtk_im_context_reset:
* @context: a #GtkIMContext
*
@@ -553,4 +591,3 @@
return result;
}
-

View File

@ -0,0 +1,29 @@
--- gtk+-2.6.4/gtk/gtkimcontext.h 2002-10-11 01:18:36.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkimcontext.h 2005-04-06 16:19:36.815941488 +0300
@@ -85,14 +85,15 @@
gboolean (*get_surrounding) (GtkIMContext *context,
gchar **text,
gint *cursor_index);
+ void (*show) (GtkIMContext *context);
+ void (*hide) (GtkIMContext *context);
+
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
- void (*_gtk_reserved5) (void);
- void (*_gtk_reserved6) (void);
};
GType gtk_im_context_get_type (void) G_GNUC_CONST;
@@ -122,6 +123,8 @@
gboolean gtk_im_context_delete_surrounding (GtkIMContext *context,
gint offset,
gint n_chars);
+void gtk_im_context_show (GtkIMContext *context);
+void gtk_im_context_hide (GtkIMContext *context);
#ifdef __cplusplus
}

View File

@ -0,0 +1,155 @@
--- gtk+-2.6.4/gtk/gtkimmulticontext.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkimmulticontext.c 2005-04-06 16:19:36.818941032 +0300
@@ -59,6 +59,8 @@
static void gtk_im_multicontext_focus_in (GtkIMContext *context);
static void gtk_im_multicontext_focus_out (GtkIMContext *context);
static void gtk_im_multicontext_reset (GtkIMContext *context);
+static void gtk_im_multicontext_show (GtkIMContext *context);
+static void gtk_im_multicontext_hide (GtkIMContext *context);
static void gtk_im_multicontext_set_cursor_location (GtkIMContext *context,
GdkRectangle *area);
static void gtk_im_multicontext_set_use_preedit (GtkIMContext *context,
@@ -118,6 +120,67 @@
return im_multicontext_type;
}
+static GtkIMContext *
+gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext);
+
+enum {
+ PROP_INPUT_MODE = 1,
+ PROP_AUTOCAP,
+ PROP_VISIBILITY,
+ PROP_USE_SHOW_HIDE
+};
+
+static void gtk_im_multicontext_set_property(GObject * object,
+ guint property_id,
+ const GValue * value,
+ GParamSpec * pspec)
+{
+ GtkIMContext *slave = gtk_im_multicontext_get_slave (GTK_IM_MULTICONTEXT(object));
+
+ GParamSpec *param_spec = g_object_class_find_property
+ (G_OBJECT_GET_CLASS(slave),
+ pspec->name);
+
+ if(param_spec != NULL)
+ g_object_set_property(G_OBJECT(slave), pspec->name, value);
+}
+
+static void gtk_im_multicontext_get_property(GObject * object,
+ guint property_id,
+ GValue * value,
+ GParamSpec * pspec)
+{
+ GtkIMContext *slave = gtk_im_multicontext_get_slave (GTK_IM_MULTICONTEXT(object));
+ GParamSpec *param_spec = g_object_class_find_property
+ (G_OBJECT_GET_CLASS(slave),
+ pspec->name);
+
+ if(param_spec != NULL)
+ g_object_get_property(G_OBJECT(slave), pspec->name, value);
+ else
+ {
+ switch (property_id)
+ {
+ case PROP_INPUT_MODE:
+ /* return 0 */
+ g_value_set_int(value, 0);
+ break;
+ case PROP_AUTOCAP:
+ /* return FALSE */
+ g_value_set_boolean(value, FALSE);
+ break;
+ case PROP_VISIBILITY:
+ /* return TRUE */
+ g_value_set_boolean(value, TRUE);
+ break;
+ case PROP_USE_SHOW_HIDE:
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+ }
+}
+
static void
gtk_im_multicontext_class_init (GtkIMMulticontextClass *class)
{
@@ -132,12 +195,38 @@
im_context_class->focus_in = gtk_im_multicontext_focus_in;
im_context_class->focus_out = gtk_im_multicontext_focus_out;
im_context_class->reset = gtk_im_multicontext_reset;
+ im_context_class->show = gtk_im_multicontext_show;
+ im_context_class->hide = gtk_im_multicontext_hide;
im_context_class->set_cursor_location = gtk_im_multicontext_set_cursor_location;
im_context_class->set_use_preedit = gtk_im_multicontext_set_use_preedit;
im_context_class->set_surrounding = gtk_im_multicontext_set_surrounding;
im_context_class->get_surrounding = gtk_im_multicontext_get_surrounding;
gobject_class->finalize = gtk_im_multicontext_finalize;
+
+ gobject_class->set_property = gtk_im_multicontext_set_property;
+ gobject_class->get_property = gtk_im_multicontext_get_property;
+
+ g_object_class_install_property(gobject_class, PROP_INPUT_MODE,
+ g_param_spec_int("input-mode", "Input mode",
+ "Specifies the set of allowed characters",
+ 0, 9, 0, /* We don't move symbolic definitions here. See hildon-input-mode.h */
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property(gobject_class, PROP_AUTOCAP,
+ g_param_spec_boolean("autocap", "Autocap",
+ "Whether the client wants the first character in a sentense to be automatic upper case",
+ FALSE, G_PARAM_READWRITE));
+
+ g_object_class_install_property(gobject_class, PROP_VISIBILITY,
+ g_param_spec_boolean("visibility", "Visibility",
+ "FALSE displays the \"invisible char\"instead of the actual text (password mode)",
+ TRUE, G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+ g_object_class_install_property(gobject_class, PROP_VISIBILITY,
+ g_param_spec_boolean("use-show-hide", "Use show/hide functions",
+ "Use show/hide functions to show/hide IM instead of focus_in/focus_out",
+ FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE));
}
static void
@@ -567,3 +656,36 @@
g_free (contexts);
}
+static void
+gtk_im_multicontext_show (GtkIMContext *context)
+{
+ GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
+ GtkIMContext *slave;
+
+ /* If the global context type is different from the context we were
+ * using before, get rid of the old slave and create a new one
+ * for the new global context type.
+ */
+ if (!multicontext->context_id ||
+ strcmp (global_context_id, multicontext->context_id) != 0)
+ gtk_im_multicontext_set_slave (multicontext, NULL, FALSE);
+
+ slave = gtk_im_multicontext_get_slave (multicontext);
+
+ multicontext->priv->focus_in = TRUE;
+
+ if (slave)
+ gtk_im_context_show (slave);
+}
+
+static void
+gtk_im_multicontext_hide (GtkIMContext *context)
+{
+ GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
+ GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
+
+ multicontext->priv->focus_in = FALSE;
+
+ if (slave)
+ gtk_im_context_hide (slave);
+}

View File

@ -0,0 +1,10 @@
--- gtk+-2.4.3/gtk/gtklabel.c~ 2004-06-11 13:50:34.000000000 +0100
+++ gtk+-2.4.3/gtk/gtklabel.c 2004-07-05 13:33:57.000000000 +0100
@@ -1623,6 +1623,7 @@
/* We have to clear the layout, fonts etc. may have changed */
gtk_label_clear_layout (label);
+ gtk_widget_queue_resize (GTK_WIDGET (label));
}
static void

View File

@ -0,0 +1,390 @@
--- gtk+-2.6.4/gtk/gtklabel.c 2005-02-28 06:32:03.000000000 +0200
+++ gtk+-2.6.4/gtk/gtklabel.c 2005-04-06 16:19:36.878931912 +0300
@@ -23,6 +23,11 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+
+/* Modified for Nokia Oyj during 2004. See CHANGES file for list
+ * of changes.
+ */
+
#include <config.h>
#include <math.h>
#include <string.h>
@@ -52,6 +57,7 @@
guint single_line_mode : 1;
guint have_transform : 1;
gdouble angle;
+ gboolean request_full_width;
}
GtkLabelPrivate;
@@ -75,6 +81,9 @@
LAST_SIGNAL
};
+/* Hildon mod.
+ A property PROP_TRANSLATABLE has been added here. If new Gtk+
+ versions add items here, the compability will break. */
enum {
PROP_0,
PROP_LABEL,
@@ -89,6 +98,7 @@
PROP_MNEMONIC_WIDGET,
PROP_CURSOR_POSITION,
PROP_SELECTION_BOUND,
+ PROP_TRANSLATABLE,
PROP_ELLIPSIZE,
PROP_WIDTH_CHARS,
PROP_SINGLE_LINE_MODE,
@@ -96,6 +106,12 @@
PROP_MAX_WIDTH_CHARS
};
+/* Hildon mod. A few keys. These are used to store data for label
+ * without changing the private structures. */
+#define LABEL_KEY_TRANSLATABLE "label_translatable"
+#define LABEL_KEY_TRANSLATABLETEXT "label_translatabletext"
+#define LABEL_KEY_ORIGINAL_LAYOUT "label_original_layout"
+
static guint signals[LAST_SIGNAL] = { 0 };
static void gtk_label_class_init (GtkLabelClass *klass);
@@ -149,7 +165,7 @@
static void gtk_label_set_uline_text_internal (GtkLabel *label,
const gchar *str);
static void gtk_label_set_pattern_internal (GtkLabel *label,
- const gchar *pattern);
+ const gchar *pattern);
static void set_markup (GtkLabel *label,
const gchar *str,
gboolean with_uline);
@@ -516,6 +532,24 @@
G_MAXINT,
-1,
G_PARAM_READWRITE));
+ /* Hildon mod. Add property for a widget - whether it supports run-time
+ + locale change. Please note that this functionality is not yet
+ + completed and may change. */
+ g_object_class_install_property (gobject_class,
+ PROP_TRANSLATABLE,
+ g_param_spec_boolean ("translatable",
+ _("Is translatable"),
+ _("Whether label should be translatable."),
+ FALSE,
+ G_PARAM_READWRITE));
+
+ /* Hildonlike class property */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("hildonlike",
+ _("hildonlike looks"),
+ _("Changes wrapping etc behaviour, 1/0"),
+ FALSE,
+ G_PARAM_READABLE));
/*
* Key bindings
*/
@@ -650,6 +684,10 @@
case PROP_MAX_WIDTH_CHARS:
gtk_label_set_max_width_chars (label, g_value_get_int (value));
break;
+/* Hildon add. */
+ case PROP_TRANSLATABLE:
+ gtk_label_set_translatable (label, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -730,6 +768,10 @@
case PROP_MAX_WIDTH_CHARS:
g_value_set_int (value, gtk_label_get_max_width_chars (label));
break;
+/* Hildon mod. */
+ case PROP_TRANSLATABLE:
+ g_value_set_boolean (value, gtk_label_get_translatable (label));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -748,6 +790,7 @@
priv->width_chars = -1;
priv->angle = 0.0;
priv->max_width_chars = -1;
+ priv->request_full_width = FALSE;
label->label = NULL;
label->jtype = GTK_JUSTIFY_LEFT;
@@ -766,6 +809,15 @@
label->mnemonic_window = NULL;
gtk_label_set_text (label, "");
+
+/* Hildon Addition. */
+
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE, FALSE);
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT, NULL);
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT, NULL);
+
+/* /Hildon Addition. */
+
}
/**
@@ -822,7 +874,7 @@
if (str && *str)
gtk_label_set_text_with_mnemonic (label, str);
-
+
return GTK_WIDGET (label);
}
@@ -1257,7 +1309,7 @@
GError *error = NULL;
PangoAttrList *attrs = NULL;
gunichar accel_char = 0;
-
+
if (!pango_parse_markup (str,
-1,
with_uline ? '_' : 0,
@@ -1340,12 +1392,14 @@
g_return_if_fail (GTK_IS_LABEL (label));
last_keyval = label->mnemonic_keyval;
+
gtk_label_set_label_internal (label, g_strdup (str ? str : ""));
gtk_label_set_use_markup_internal (label, TRUE);
gtk_label_set_use_underline_internal (label, TRUE);
-
gtk_label_recalculate (label);
+
gtk_label_setup_mnemonic (label, last_keyval);
+
}
/**
@@ -1409,7 +1463,7 @@
static void
gtk_label_set_pattern_internal (GtkLabel *label,
- const gchar *pattern)
+ const gchar *pattern)
{
PangoAttrList *attrs;
g_return_if_fail (GTK_IS_LABEL (label));
@@ -1421,7 +1475,16 @@
if (label->effective_attrs)
pango_attr_list_unref (label->effective_attrs);
+/* Following will disable undercores from
+ keyboard shortcuts if DISABLE_KEYBOARD_SHORTCUTS
+ is enabled during compile time
+ */
+#ifndef DISABLE_KEYBOARD_SHORTCUTS
label->effective_attrs = attrs;
+#else
+ pango_attr_list_unref (attrs);
+#endif /* DISABLE_KEYBOARD_SHORTCUTS */
+
}
void
@@ -1742,8 +1805,13 @@
{
PangoLayout *layout;
GtkStyle *style = GTK_WIDGET (label)->style;
-
+
+ gboolean hildonlike;
LabelWrapWidth *wrap_width = g_object_get_data (G_OBJECT (style), "gtk-label-wrap-width");
+
+ /* Hildon: get hildonlike property */
+ gtk_widget_style_get (GTK_WIDGET (label), "hildonlike", &hildonlike, NULL);
+
if (!wrap_width)
{
wrap_width = g_new0 (LabelWrapWidth, 1);
@@ -1763,7 +1831,12 @@
"This long string gives a good enough length for any line to have.");
pango_layout_get_size (layout, &wrap_width->width, NULL);
g_object_unref (layout);
-
+ /* A hildon mod for "fixing line wrapping". Remember to remove this
+ when GtkLabel will implement width for height size negotiation.*/
+ if (hildonlike)
+ {
+ wrap_width->width = wrap_width->width * 1.25;
+ }
return wrap_width->width;
}
@@ -1774,8 +1847,12 @@
PangoRectangle logical_rect;
gint rwidth, rheight;
gboolean rtl;
+ gboolean hildonlike;
widget = GTK_WIDGET (label);
+
+ /* Hildon: get hildonlike property */
+ gtk_widget_style_get (widget, "hildonlike", &hildonlike, NULL);
rtl = gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL;
rwidth = label->misc.xpad * 2;
@@ -1864,8 +1941,18 @@
wrap_width = get_label_wrap_width (label);
width = MIN (width, wrap_width);
- width = MIN (width,
+
+ if (!hildonlike)
+ {
+ width = MIN (width,
PANGO_SCALE * (gdk_screen_get_width (screen) + 1) / 2);
+ }
+ else
+ {
+ width = MIN (width,
+ PANGO_SCALE * (gdk_screen_get_width (screen) + 1));
+ }
+
pango_layout_set_width (label->layout, width);
pango_layout_get_extents (label->layout, NULL, &logical_rect);
@@ -1910,6 +1997,7 @@
else /* !label->wrap */
pango_layout_set_width (label->layout, -1);
}
+
}
/* Gets the bounds of a layout in device coordinates. Note cut-and-paste
@@ -2017,7 +2105,8 @@
priv->width_chars > 0 || priv->max_width_chars > 0) &&
aux_info && aux_info->width > 0)
width += aux_info->width;
- else if (label->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0)
+ else if ((label->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0) &&
+ !priv->request_full_width)
{
PangoContext *context;
PangoFontMetrics *metrics;
@@ -2081,11 +2170,24 @@
GtkAllocation *allocation)
{
GtkLabel *label;
+ GtkRequisition req;
+ GtkLabelPrivate *priv;
label = GTK_LABEL (widget);
+ priv = GTK_LABEL_GET_PRIVATE (label);
(* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
+ gtk_widget_get_child_requisition (widget, &req);
+
+ if (allocation->width < req.width && !label->wrap)
+ {
+ gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
+ priv->request_full_width = TRUE;
+ }
+ else
+ priv->request_full_width = FALSE;
+
if (label->ellipsize)
{
if (label->layout)
@@ -2479,7 +2581,7 @@
}
*dest = 0;
*pattern_dest = 0;
-
+
gtk_label_set_text_internal (label, new_str);
gtk_label_set_pattern_internal (label, pattern);
@@ -2541,13 +2643,11 @@
last_keyval = label->mnemonic_keyval;
g_object_freeze_notify (G_OBJECT (label));
-
gtk_label_set_label_internal (label, g_strdup (str ? str : ""));
gtk_label_set_use_markup_internal (label, FALSE);
gtk_label_set_use_underline_internal (label, TRUE);
-
- gtk_label_recalculate (label);
+ gtk_label_recalculate (label);
gtk_label_setup_mnemonic (label, last_keyval);
g_object_thaw_notify (G_OBJECT (label));
@@ -3948,3 +4048,67 @@
popup_position_func, label,
0, gtk_get_current_event_time ());
}
+
+/* Hildon mod.
+ * Functions for run-time locale changing. Beware though that this
+ functionality is not yet completed. Therefore it's suggested
+ that these functions shouldn't be used yet outside testing. */
+
+void gtk_label_set_translatable (GtkLabel *label, gboolean newstatus)
+{
+ if (newstatus == gtk_label_get_translatable (label)) return;
+
+ if (newstatus == TRUE)
+ {
+ if (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT) != NULL)
+ g_free (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT));
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT, g_strdup (label->label));
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE, (void*) TRUE);
+ if (label->text != NULL)
+ g_free (label->text);
+ if (label->label != NULL)
+ g_free (label->label);
+ label->text = g_strdup(_(g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT)));
+ label->label = g_strdup(_(g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT)));
+ }
+ else
+ {
+ if (label->text != NULL)
+ g_free (label->text);
+ if (label->label != NULL)
+ g_free (label->label);
+ label->text = g_strdup (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT));
+ label->label = g_strdup (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT));
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE, FALSE);
+ if (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT) != NULL)
+ g_free (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT));
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT, NULL);
+ }
+ gtk_label_recalculate (label);
+}
+
+gboolean gtk_label_get_translatable (GtkLabel *label)
+{
+ return (gboolean) (g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLE));
+}
+
+
+void gtk_label_retranslate (GtkLabel *label)
+{
+ g_object_freeze_notify (G_OBJECT (label));
+ if (gtk_label_get_translatable (label) == TRUE)
+ {
+ if (label->label != NULL)
+ g_free (label->label);
+ label->label = g_strdup(gettext(g_object_get_data (G_OBJECT (label), LABEL_KEY_TRANSLATABLETEXT)));
+ }
+ if (g_object_get_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT)) g_object_unref (g_object_get_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT));
+ g_object_set_data (G_OBJECT (label), LABEL_KEY_ORIGINAL_LAYOUT, NULL);
+ g_object_notify (G_OBJECT (label), "label");
+ gtk_label_recalculate (label);
+ g_object_thaw_notify (G_OBJECT (label));
+ gtk_label_set_text (label, label->label);
+}
+
+/* End of hildon mods for run-time locale change. */
+

View File

@ -0,0 +1,29 @@
--- gtk+-2.6.4/gtk/gtklabel.h 2004-12-13 08:34:54.000000000 +0200
+++ gtk+-2.6.4/gtk/gtklabel.h 2005-04-06 16:19:36.889930240 +0300
@@ -23,6 +23,10 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2004. See CHANGES file for list
+ * of changes.
+ */
+
#ifndef __GTK_LABEL_H__
#define __GTK_LABEL_H__
@@ -165,6 +169,15 @@
gboolean single_line_mode);
gboolean gtk_label_get_single_line_mode (GtkLabel *label);
+/* Additional Hildon functions for run-time locale change */
+
+void gtk_label_set_translatable (GtkLabel *label, gboolean newstatus);
+gboolean gtk_label_get_translatable (GtkLabel *label);
+
+void gtk_label_retranslate (GtkLabel *label);
+
+/* ----- */
+
#ifndef GTK_DISABLE_DEPRECATED
#define gtk_label_set gtk_label_set_text

View File

@ -0,0 +1,35 @@
--- gtk+-2.6.4/gtk/gtkmain.c 2004-12-27 07:25:15.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmain.c 2005-04-06 16:19:36.897929024 +0300
@@ -68,6 +68,7 @@
#include "gtkwindow.h"
#include "gtkprivate.h"
#include "gtkdebug.h"
+#include "gtkwidget.h"
/* Private type definitions
*/
@@ -1297,6 +1298,15 @@
{
grab_widget = event_widget;
}
+
+ /* Hildon: insensitive press handling is moved here */
+ if (event->type == GDK_BUTTON_PRESS)
+ {
+ if (!GTK_WIDGET_IS_SENSITIVE (event_widget))
+ {
+ gtk_widget_insensitive_press(event_widget);
+ }
+ }
/* Not all events get sent to the grabbing widget.
* The delete, destroy, expose, focus change and resize
@@ -2090,7 +2100,7 @@
handled_event = FALSE;
g_object_ref (widget);
-
+
if ((event->type == GDK_KEY_PRESS) ||
(event->type == GDK_KEY_RELEASE))
{

View File

@ -0,0 +1,266 @@
--- gtk+-2.6.4/gtk/gtkmarshal.c 2005-03-01 17:58:15.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmarshal.c 2005-04-06 16:19:36.898928872 +0300
@@ -48,7 +48,7 @@
#endif /* !G_ENABLE_DEBUG */
-/* BOOL:NONE (./gtkmarshal.list:1) */
+/* BOOL:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:1) */
void
gtk_marshal_BOOLEAN__VOID (GClosure *closure,
GValue *return_value,
@@ -85,7 +85,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOL:POINTER (./gtkmarshal.list:2) */
+/* BOOL:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:2) */
void
gtk_marshal_BOOLEAN__POINTER (GClosure *closure,
GValue *return_value,
@@ -124,7 +124,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOL:POINTER,POINTER,INT,INT (./gtkmarshal.list:3) */
+/* BOOL:POINTER,POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:3) */
void
gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT (GClosure *closure,
GValue *return_value,
@@ -169,7 +169,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOL:POINTER,INT,INT (./gtkmarshal.list:4) */
+/* BOOL:POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:4) */
void
gtk_marshal_BOOLEAN__POINTER_INT_INT (GClosure *closure,
GValue *return_value,
@@ -212,7 +212,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOL:POINTER,INT,INT,UINT (./gtkmarshal.list:5) */
+/* BOOL:POINTER,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:5) */
void
gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT (GClosure *closure,
GValue *return_value,
@@ -257,7 +257,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOL:POINTER,STRING,STRING,POINTER (./gtkmarshal.list:6) */
+/* BOOL:POINTER,STRING,STRING,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:6) */
void
gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER (GClosure *closure,
GValue *return_value,
@@ -302,7 +302,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* ENUM:ENUM (./gtkmarshal.list:7) */
+/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:7) */
void
gtk_marshal_ENUM__ENUM (GClosure *closure,
GValue *return_value,
@@ -341,7 +341,7 @@
g_value_set_enum (return_value, v_return);
}
-/* INT:POINTER (./gtkmarshal.list:8) */
+/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:8) */
void
gtk_marshal_INT__POINTER (GClosure *closure,
GValue *return_value,
@@ -380,7 +380,7 @@
g_value_set_int (return_value, v_return);
}
-/* INT:POINTER,CHAR,CHAR (./gtkmarshal.list:9) */
+/* INT:POINTER,CHAR,CHAR (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:9) */
void
gtk_marshal_INT__POINTER_CHAR_CHAR (GClosure *closure,
GValue *return_value,
@@ -423,13 +423,13 @@
g_value_set_int (return_value, v_return);
}
-/* NONE:BOOL (./gtkmarshal.list:10) */
+/* NONE:BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:10) */
-/* NONE:BOXED (./gtkmarshal.list:11) */
+/* NONE:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:11) */
-/* NONE:ENUM (./gtkmarshal.list:12) */
+/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:12) */
-/* NONE:ENUM,FLOAT (./gtkmarshal.list:13) */
+/* NONE:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:13) */
void
gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure,
GValue *return_value,
@@ -466,7 +466,7 @@
data2);
}
-/* NONE:ENUM,FLOAT,BOOL (./gtkmarshal.list:14) */
+/* NONE:ENUM,FLOAT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:14) */
void
gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -505,9 +505,9 @@
data2);
}
-/* NONE:INT (./gtkmarshal.list:15) */
+/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:15) */
-/* NONE:INT,INT (./gtkmarshal.list:16) */
+/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:16) */
void
gtk_marshal_VOID__INT_INT (GClosure *closure,
GValue *return_value,
@@ -544,7 +544,7 @@
data2);
}
-/* NONE:INT,INT,POINTER (./gtkmarshal.list:17) */
+/* NONE:INT,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:17) */
void
gtk_marshal_VOID__INT_INT_POINTER (GClosure *closure,
GValue *return_value,
@@ -583,13 +583,13 @@
data2);
}
-/* NONE:NONE (./gtkmarshal.list:18) */
+/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:18) */
-/* NONE:OBJECT (./gtkmarshal.list:19) */
+/* NONE:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:19) */
-/* NONE:POINTER (./gtkmarshal.list:20) */
+/* NONE:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:20) */
-/* NONE:POINTER,INT (./gtkmarshal.list:21) */
+/* NONE:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:21) */
void
gtk_marshal_VOID__POINTER_INT (GClosure *closure,
GValue *return_value,
@@ -626,7 +626,7 @@
data2);
}
-/* NONE:POINTER,POINTER (./gtkmarshal.list:22) */
+/* NONE:POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:22) */
void
gtk_marshal_VOID__POINTER_POINTER (GClosure *closure,
GValue *return_value,
@@ -663,7 +663,7 @@
data2);
}
-/* NONE:POINTER,POINTER,POINTER (./gtkmarshal.list:23) */
+/* NONE:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:23) */
void
gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure,
GValue *return_value,
@@ -702,7 +702,7 @@
data2);
}
-/* NONE:POINTER,STRING,STRING (./gtkmarshal.list:24) */
+/* NONE:POINTER,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:24) */
void
gtk_marshal_VOID__POINTER_STRING_STRING (GClosure *closure,
GValue *return_value,
@@ -741,7 +741,7 @@
data2);
}
-/* NONE:POINTER,UINT (./gtkmarshal.list:25) */
+/* NONE:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:25) */
void
gtk_marshal_VOID__POINTER_UINT (GClosure *closure,
GValue *return_value,
@@ -778,7 +778,7 @@
data2);
}
-/* NONE:POINTER,UINT,ENUM (./gtkmarshal.list:26) */
+/* NONE:POINTER,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:26) */
void
gtk_marshal_VOID__POINTER_UINT_ENUM (GClosure *closure,
GValue *return_value,
@@ -817,7 +817,7 @@
data2);
}
-/* NONE:POINTER,POINTER,UINT,UINT (./gtkmarshal.list:27) */
+/* NONE:POINTER,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:27) */
void
gtk_marshal_VOID__POINTER_POINTER_UINT_UINT (GClosure *closure,
GValue *return_value,
@@ -858,7 +858,7 @@
data2);
}
-/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (./gtkmarshal.list:28) */
+/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:28) */
void
gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT (GClosure *closure,
GValue *return_value,
@@ -903,7 +903,7 @@
data2);
}
-/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:29) */
+/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:29) */
void
gtk_marshal_VOID__POINTER_UINT_UINT (GClosure *closure,
GValue *return_value,
@@ -942,11 +942,11 @@
data2);
}
-/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:30) */
+/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:30) */
-/* NONE:STRING (./gtkmarshal.list:31) */
+/* NONE:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:31) */
-/* NONE:STRING,INT,POINTER (./gtkmarshal.list:32) */
+/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:32) */
void
gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure,
GValue *return_value,
@@ -985,9 +985,9 @@
data2);
}
-/* NONE:UINT (./gtkmarshal.list:33) */
+/* NONE:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:33) */
-/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (./gtkmarshal.list:34) */
+/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:34) */
void
gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER (GClosure *closure,
GValue *return_value,
@@ -1032,7 +1032,7 @@
data2);
}
-/* NONE:UINT,POINTER,UINT,UINT,ENUM (./gtkmarshal.list:35) */
+/* NONE:UINT,POINTER,UINT,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:35) */
void
gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM (GClosure *closure,
GValue *return_value,
@@ -1075,7 +1075,7 @@
data2);
}
-/* NONE:UINT,STRING (./gtkmarshal.list:36) */
+/* NONE:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:36) */
void
gtk_marshal_VOID__UINT_STRING (GClosure *closure,
GValue *return_value,

View File

@ -0,0 +1,284 @@
--- gtk+-2.6.4/gtk/gtkmarshal.h 2005-03-01 17:58:16.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmarshal.h 2005-04-06 16:19:36.899928720 +0300
@@ -7,7 +7,7 @@
G_BEGIN_DECLS
-/* BOOL:NONE (./gtkmarshal.list:1) */
+/* BOOL:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:1) */
extern void gtk_marshal_BOOLEAN__VOID (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -16,7 +16,7 @@
gpointer marshal_data);
#define gtk_marshal_BOOL__NONE gtk_marshal_BOOLEAN__VOID
-/* BOOL:POINTER (./gtkmarshal.list:2) */
+/* BOOL:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:2) */
extern void gtk_marshal_BOOLEAN__POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -25,7 +25,7 @@
gpointer marshal_data);
#define gtk_marshal_BOOL__POINTER gtk_marshal_BOOLEAN__POINTER
-/* BOOL:POINTER,POINTER,INT,INT (./gtkmarshal.list:3) */
+/* BOOL:POINTER,POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:3) */
extern void gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -34,7 +34,7 @@
gpointer marshal_data);
#define gtk_marshal_BOOL__POINTER_POINTER_INT_INT gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT
-/* BOOL:POINTER,INT,INT (./gtkmarshal.list:4) */
+/* BOOL:POINTER,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:4) */
extern void gtk_marshal_BOOLEAN__POINTER_INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -43,7 +43,7 @@
gpointer marshal_data);
#define gtk_marshal_BOOL__POINTER_INT_INT gtk_marshal_BOOLEAN__POINTER_INT_INT
-/* BOOL:POINTER,INT,INT,UINT (./gtkmarshal.list:5) */
+/* BOOL:POINTER,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:5) */
extern void gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -52,7 +52,7 @@
gpointer marshal_data);
#define gtk_marshal_BOOL__POINTER_INT_INT_UINT gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT
-/* BOOL:POINTER,STRING,STRING,POINTER (./gtkmarshal.list:6) */
+/* BOOL:POINTER,STRING,STRING,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:6) */
extern void gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -61,7 +61,7 @@
gpointer marshal_data);
#define gtk_marshal_BOOL__POINTER_STRING_STRING_POINTER gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER
-/* ENUM:ENUM (./gtkmarshal.list:7) */
+/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:7) */
extern void gtk_marshal_ENUM__ENUM (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -69,7 +69,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* INT:POINTER (./gtkmarshal.list:8) */
+/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:8) */
extern void gtk_marshal_INT__POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -77,7 +77,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* INT:POINTER,CHAR,CHAR (./gtkmarshal.list:9) */
+/* INT:POINTER,CHAR,CHAR (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:9) */
extern void gtk_marshal_INT__POINTER_CHAR_CHAR (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -85,19 +85,19 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* NONE:BOOL (./gtkmarshal.list:10) */
+/* NONE:BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:10) */
#define gtk_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN
#define gtk_marshal_NONE__BOOL gtk_marshal_VOID__BOOLEAN
-/* NONE:BOXED (./gtkmarshal.list:11) */
+/* NONE:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:11) */
#define gtk_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED
#define gtk_marshal_NONE__BOXED gtk_marshal_VOID__BOXED
-/* NONE:ENUM (./gtkmarshal.list:12) */
+/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:12) */
#define gtk_marshal_VOID__ENUM g_cclosure_marshal_VOID__ENUM
#define gtk_marshal_NONE__ENUM gtk_marshal_VOID__ENUM
-/* NONE:ENUM,FLOAT (./gtkmarshal.list:13) */
+/* NONE:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:13) */
extern void gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -106,7 +106,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__ENUM_FLOAT gtk_marshal_VOID__ENUM_FLOAT
-/* NONE:ENUM,FLOAT,BOOL (./gtkmarshal.list:14) */
+/* NONE:ENUM,FLOAT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:14) */
extern void gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -115,11 +115,11 @@
gpointer marshal_data);
#define gtk_marshal_NONE__ENUM_FLOAT_BOOL gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN
-/* NONE:INT (./gtkmarshal.list:15) */
+/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:15) */
#define gtk_marshal_VOID__INT g_cclosure_marshal_VOID__INT
#define gtk_marshal_NONE__INT gtk_marshal_VOID__INT
-/* NONE:INT,INT (./gtkmarshal.list:16) */
+/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:16) */
extern void gtk_marshal_VOID__INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -128,7 +128,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__INT_INT gtk_marshal_VOID__INT_INT
-/* NONE:INT,INT,POINTER (./gtkmarshal.list:17) */
+/* NONE:INT,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:17) */
extern void gtk_marshal_VOID__INT_INT_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -137,19 +137,19 @@
gpointer marshal_data);
#define gtk_marshal_NONE__INT_INT_POINTER gtk_marshal_VOID__INT_INT_POINTER
-/* NONE:NONE (./gtkmarshal.list:18) */
+/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:18) */
#define gtk_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID
#define gtk_marshal_NONE__NONE gtk_marshal_VOID__VOID
-/* NONE:OBJECT (./gtkmarshal.list:19) */
+/* NONE:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:19) */
#define gtk_marshal_VOID__OBJECT g_cclosure_marshal_VOID__OBJECT
#define gtk_marshal_NONE__OBJECT gtk_marshal_VOID__OBJECT
-/* NONE:POINTER (./gtkmarshal.list:20) */
+/* NONE:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:20) */
#define gtk_marshal_VOID__POINTER g_cclosure_marshal_VOID__POINTER
#define gtk_marshal_NONE__POINTER gtk_marshal_VOID__POINTER
-/* NONE:POINTER,INT (./gtkmarshal.list:21) */
+/* NONE:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:21) */
extern void gtk_marshal_VOID__POINTER_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -158,7 +158,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_INT gtk_marshal_VOID__POINTER_INT
-/* NONE:POINTER,POINTER (./gtkmarshal.list:22) */
+/* NONE:POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:22) */
extern void gtk_marshal_VOID__POINTER_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -167,7 +167,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_POINTER gtk_marshal_VOID__POINTER_POINTER
-/* NONE:POINTER,POINTER,POINTER (./gtkmarshal.list:23) */
+/* NONE:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:23) */
extern void gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -176,7 +176,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_POINTER_POINTER gtk_marshal_VOID__POINTER_POINTER_POINTER
-/* NONE:POINTER,STRING,STRING (./gtkmarshal.list:24) */
+/* NONE:POINTER,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:24) */
extern void gtk_marshal_VOID__POINTER_STRING_STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -185,7 +185,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_STRING_STRING gtk_marshal_VOID__POINTER_STRING_STRING
-/* NONE:POINTER,UINT (./gtkmarshal.list:25) */
+/* NONE:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:25) */
extern void gtk_marshal_VOID__POINTER_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -194,7 +194,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_UINT gtk_marshal_VOID__POINTER_UINT
-/* NONE:POINTER,UINT,ENUM (./gtkmarshal.list:26) */
+/* NONE:POINTER,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:26) */
extern void gtk_marshal_VOID__POINTER_UINT_ENUM (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -203,7 +203,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_UINT_ENUM gtk_marshal_VOID__POINTER_UINT_ENUM
-/* NONE:POINTER,POINTER,UINT,UINT (./gtkmarshal.list:27) */
+/* NONE:POINTER,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:27) */
extern void gtk_marshal_VOID__POINTER_POINTER_UINT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -212,7 +212,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_POINTER_UINT_UINT gtk_marshal_VOID__POINTER_POINTER_UINT_UINT
-/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (./gtkmarshal.list:28) */
+/* NONE:POINTER,INT,INT,POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:28) */
extern void gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -221,7 +221,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_INT_INT_POINTER_UINT_UINT gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT
-/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:29) */
+/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:29) */
extern void gtk_marshal_VOID__POINTER_UINT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -230,13 +230,13 @@
gpointer marshal_data);
#define gtk_marshal_NONE__POINTER_UINT_UINT gtk_marshal_VOID__POINTER_UINT_UINT
-/* NONE:POINTER,UINT,UINT (./gtkmarshal.list:30) */
+/* NONE:POINTER,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:30) */
-/* NONE:STRING (./gtkmarshal.list:31) */
+/* NONE:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:31) */
#define gtk_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING
#define gtk_marshal_NONE__STRING gtk_marshal_VOID__STRING
-/* NONE:STRING,INT,POINTER (./gtkmarshal.list:32) */
+/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:32) */
extern void gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -245,11 +245,11 @@
gpointer marshal_data);
#define gtk_marshal_NONE__STRING_INT_POINTER gtk_marshal_VOID__STRING_INT_POINTER
-/* NONE:UINT (./gtkmarshal.list:33) */
+/* NONE:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:33) */
#define gtk_marshal_VOID__UINT g_cclosure_marshal_VOID__UINT
#define gtk_marshal_NONE__UINT gtk_marshal_VOID__UINT
-/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (./gtkmarshal.list:34) */
+/* NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:34) */
extern void gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -258,7 +258,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__UINT_POINTER_UINT_ENUM_ENUM_POINTER gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER
-/* NONE:UINT,POINTER,UINT,UINT,ENUM (./gtkmarshal.list:35) */
+/* NONE:UINT,POINTER,UINT,UINT,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:35) */
extern void gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -267,7 +267,7 @@
gpointer marshal_data);
#define gtk_marshal_NONE__UINT_POINTER_UINT_UINT_ENUM gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM
-/* NONE:UINT,STRING (./gtkmarshal.list:36) */
+/* NONE:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshal.list:36) */
extern void gtk_marshal_VOID__UINT_STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,

View File

@ -0,0 +1,606 @@
--- gtk+-2.6.4/gtk/gtkmarshalers.c 2005-03-01 17:58:15.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmarshalers.c 2005-04-06 16:19:36.902928264 +0300
@@ -48,7 +48,7 @@
#endif /* !G_ENABLE_DEBUG */
-/* BOOLEAN:BOXED (./gtkmarshalers.list:24) */
+/* BOOLEAN:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:24) */
void
_gtk_marshal_BOOLEAN__BOXED (GClosure *closure,
GValue *return_value,
@@ -87,7 +87,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:BOXED,BOXED (./gtkmarshalers.list:25) */
+/* BOOLEAN:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:25) */
void
_gtk_marshal_BOOLEAN__BOXED_BOXED (GClosure *closure,
GValue *return_value,
@@ -128,7 +128,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:ENUM (./gtkmarshalers.list:26) */
+/* BOOLEAN:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:26) */
void
_gtk_marshal_BOOLEAN__ENUM (GClosure *closure,
GValue *return_value,
@@ -167,7 +167,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:ENUM,DOUBLE (./gtkmarshalers.list:27) */
+/* BOOLEAN:ENUM,DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:27) */
void
_gtk_marshal_BOOLEAN__ENUM_DOUBLE (GClosure *closure,
GValue *return_value,
@@ -208,7 +208,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:ENUM,INT (./gtkmarshalers.list:28) */
+/* BOOLEAN:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:28) */
void
_gtk_marshal_BOOLEAN__ENUM_INT (GClosure *closure,
GValue *return_value,
@@ -249,7 +249,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:OBJECT,UINT,FLAGS (./gtkmarshalers.list:29) */
+/* BOOLEAN:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:29) */
void
_gtk_marshal_BOOLEAN__OBJECT_UINT_FLAGS (GClosure *closure,
GValue *return_value,
@@ -292,7 +292,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:OBJECT,INT,INT,UINT (./gtkmarshalers.list:30) */
+/* BOOLEAN:OBJECT,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:30) */
void
_gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT (GClosure *closure,
GValue *return_value,
@@ -337,7 +337,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:OBJECT,STRING,STRING,BOXED (./gtkmarshalers.list:31) */
+/* BOOLEAN:OBJECT,STRING,STRING,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:31) */
void
_gtk_marshal_BOOLEAN__OBJECT_STRING_STRING_BOXED (GClosure *closure,
GValue *return_value,
@@ -382,7 +382,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:OBJECT,BOXED (./gtkmarshalers.list:32) */
+/* BOOLEAN:OBJECT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:32) */
void
_gtk_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure,
GValue *return_value,
@@ -423,7 +423,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:OBJECT,BOXED,BOXED (./gtkmarshalers.list:33) */
+/* BOOLEAN:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:33) */
void
_gtk_marshal_BOOLEAN__OBJECT_BOXED_BOXED (GClosure *closure,
GValue *return_value,
@@ -466,7 +466,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:OBJECT,STRING,STRING (./gtkmarshalers.list:34) */
+/* BOOLEAN:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:34) */
void
_gtk_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure *closure,
GValue *return_value,
@@ -509,7 +509,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:INT,INT (./gtkmarshalers.list:35) */
+/* BOOLEAN:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:35) */
void
_gtk_marshal_BOOLEAN__INT_INT (GClosure *closure,
GValue *return_value,
@@ -550,7 +550,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:INT,INT,INT (./gtkmarshalers.list:36) */
+/* BOOLEAN:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:36) */
void
_gtk_marshal_BOOLEAN__INT_INT_INT (GClosure *closure,
GValue *return_value,
@@ -593,7 +593,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:UINT (./gtkmarshalers.list:37) */
+/* BOOLEAN:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:37) */
void
_gtk_marshal_BOOLEAN__UINT (GClosure *closure,
GValue *return_value,
@@ -632,7 +632,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:VOID (./gtkmarshalers.list:38) */
+/* BOOLEAN:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:38) */
void
_gtk_marshal_BOOLEAN__VOID (GClosure *closure,
GValue *return_value,
@@ -669,7 +669,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:BOOLEAN (./gtkmarshalers.list:39) */
+/* BOOLEAN:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:39) */
void
_gtk_marshal_BOOLEAN__BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -708,9 +708,9 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:NONE (./gtkmarshalers.list:40) */
+/* BOOLEAN:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:40) */
-/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:41) */
+/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:41) */
void
_gtk_marshal_BOOLEAN__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -753,7 +753,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* BOOLEAN:STRING (./gtkmarshalers.list:42) */
+/* BOOLEAN:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:42) */
void
_gtk_marshal_BOOLEAN__STRING (GClosure *closure,
GValue *return_value,
@@ -792,7 +792,7 @@
g_value_set_boolean (return_value, v_return);
}
-/* ENUM:ENUM (./gtkmarshalers.list:43) */
+/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:43) */
void
_gtk_marshal_ENUM__ENUM (GClosure *closure,
GValue *return_value,
@@ -831,7 +831,7 @@
g_value_set_enum (return_value, v_return);
}
-/* INT:POINTER (./gtkmarshalers.list:44) */
+/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:44) */
void
_gtk_marshal_INT__POINTER (GClosure *closure,
GValue *return_value,
@@ -870,13 +870,13 @@
g_value_set_int (return_value, v_return);
}
-/* NONE:BOOLEAN (./gtkmarshalers.list:45) */
+/* NONE:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:45) */
-/* NONE:ENUM (./gtkmarshalers.list:46) */
+/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:46) */
-/* NONE:INT (./gtkmarshalers.list:47) */
+/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:47) */
-/* NONE:INT,BOOL (./gtkmarshalers.list:48) */
+/* NONE:INT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:48) */
void
_gtk_marshal_VOID__INT_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -913,7 +913,7 @@
data2);
}
-/* NONE:INT,INT (./gtkmarshalers.list:49) */
+/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:49) */
void
_gtk_marshal_VOID__INT_INT (GClosure *closure,
GValue *return_value,
@@ -950,9 +950,9 @@
data2);
}
-/* NONE:NONE (./gtkmarshalers.list:50) */
+/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:50) */
-/* NONE:STRING,INT,POINTER (./gtkmarshalers.list:51) */
+/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:51) */
void
_gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure,
GValue *return_value,
@@ -991,7 +991,7 @@
data2);
}
-/* STRING:DOUBLE (./gtkmarshalers.list:52) */
+/* STRING:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:52) */
void
_gtk_marshal_STRING__DOUBLE (GClosure *closure,
GValue *return_value,
@@ -1030,11 +1030,11 @@
g_value_take_string (return_value, v_return);
}
-/* VOID:DOUBLE (./gtkmarshalers.list:53) */
+/* VOID:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:53) */
-/* VOID:BOOLEAN (./gtkmarshalers.list:54) */
+/* VOID:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:54) */
-/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:55) */
+/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:55) */
void
_gtk_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -1073,9 +1073,9 @@
data2);
}
-/* VOID:BOXED (./gtkmarshalers.list:56) */
+/* VOID:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:56) */
-/* VOID:BOXED,BOXED (./gtkmarshalers.list:57) */
+/* VOID:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:57) */
void
_gtk_marshal_VOID__BOXED_BOXED (GClosure *closure,
GValue *return_value,
@@ -1112,7 +1112,7 @@
data2);
}
-/* VOID:BOXED,BOXED,POINTER (./gtkmarshalers.list:58) */
+/* VOID:BOXED,BOXED,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:58) */
void
_gtk_marshal_VOID__BOXED_BOXED_POINTER (GClosure *closure,
GValue *return_value,
@@ -1151,7 +1151,7 @@
data2);
}
-/* VOID:BOXED,OBJECT (./gtkmarshalers.list:59) */
+/* VOID:BOXED,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:59) */
void
_gtk_marshal_VOID__BOXED_OBJECT (GClosure *closure,
GValue *return_value,
@@ -1188,7 +1188,7 @@
data2);
}
-/* VOID:BOXED,STRING,INT (./gtkmarshalers.list:60) */
+/* VOID:BOXED,STRING,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:60) */
void
_gtk_marshal_VOID__BOXED_STRING_INT (GClosure *closure,
GValue *return_value,
@@ -1227,7 +1227,7 @@
data2);
}
-/* VOID:BOXED,UINT (./gtkmarshalers.list:61) */
+/* VOID:BOXED,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:61) */
void
_gtk_marshal_VOID__BOXED_UINT (GClosure *closure,
GValue *return_value,
@@ -1264,7 +1264,7 @@
data2);
}
-/* VOID:BOXED,UINT,FLAGS (./gtkmarshalers.list:62) */
+/* VOID:BOXED,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:62) */
void
_gtk_marshal_VOID__BOXED_UINT_FLAGS (GClosure *closure,
GValue *return_value,
@@ -1303,7 +1303,7 @@
data2);
}
-/* VOID:BOXED,UINT,UINT (./gtkmarshalers.list:63) */
+/* VOID:BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:63) */
void
_gtk_marshal_VOID__BOXED_UINT_UINT (GClosure *closure,
GValue *return_value,
@@ -1342,9 +1342,9 @@
data2);
}
-/* VOID:ENUM (./gtkmarshalers.list:64) */
+/* VOID:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:64) */
-/* VOID:ENUM,BOOLEAN (./gtkmarshalers.list:65) */
+/* VOID:ENUM,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:65) */
void
_gtk_marshal_VOID__ENUM_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -1381,7 +1381,7 @@
data2);
}
-/* VOID:ENUM,ENUM (./gtkmarshalers.list:66) */
+/* VOID:ENUM,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:66) */
void
_gtk_marshal_VOID__ENUM_ENUM (GClosure *closure,
GValue *return_value,
@@ -1418,7 +1418,7 @@
data2);
}
-/* VOID:ENUM,FLOAT (./gtkmarshalers.list:67) */
+/* VOID:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:67) */
void
_gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure,
GValue *return_value,
@@ -1455,7 +1455,7 @@
data2);
}
-/* VOID:ENUM,FLOAT,BOOLEAN (./gtkmarshalers.list:68) */
+/* VOID:ENUM,FLOAT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:68) */
void
_gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -1494,7 +1494,7 @@
data2);
}
-/* VOID:ENUM,INT (./gtkmarshalers.list:69) */
+/* VOID:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:69) */
void
_gtk_marshal_VOID__ENUM_INT (GClosure *closure,
GValue *return_value,
@@ -1531,7 +1531,7 @@
data2);
}
-/* VOID:ENUM,INT,BOOLEAN (./gtkmarshalers.list:70) */
+/* VOID:ENUM,INT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:70) */
void
_gtk_marshal_VOID__ENUM_INT_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -1570,11 +1570,11 @@
data2);
}
-/* VOID:INT (./gtkmarshalers.list:71) */
+/* VOID:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:71) */
-/* VOID:INT,INT (./gtkmarshalers.list:72) */
+/* VOID:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:72) */
-/* VOID:INT,INT,BOXED (./gtkmarshalers.list:73) */
+/* VOID:INT,INT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:73) */
void
_gtk_marshal_VOID__INT_INT_BOXED (GClosure *closure,
GValue *return_value,
@@ -1613,7 +1613,7 @@
data2);
}
-/* VOID:INT,INT,INT (./gtkmarshalers.list:74) */
+/* VOID:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:74) */
void
_gtk_marshal_VOID__INT_INT_INT (GClosure *closure,
GValue *return_value,
@@ -1652,9 +1652,9 @@
data2);
}
-/* VOID:OBJECT (./gtkmarshalers.list:75) */
+/* VOID:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:75) */
-/* VOID:OBJECT,BOOLEAN (./gtkmarshalers.list:76) */
+/* VOID:OBJECT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:76) */
void
_gtk_marshal_VOID__OBJECT_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -1691,7 +1691,7 @@
data2);
}
-/* VOID:OBJECT,BOXED,BOXED (./gtkmarshalers.list:77) */
+/* VOID:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:77) */
void
_gtk_marshal_VOID__OBJECT_BOXED_BOXED (GClosure *closure,
GValue *return_value,
@@ -1730,7 +1730,7 @@
data2);
}
-/* VOID:OBJECT,BOXED,UINT,UINT (./gtkmarshalers.list:78) */
+/* VOID:OBJECT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:78) */
void
_gtk_marshal_VOID__OBJECT_BOXED_UINT_UINT (GClosure *closure,
GValue *return_value,
@@ -1771,7 +1771,7 @@
data2);
}
-/* VOID:OBJECT,INT,INT (./gtkmarshalers.list:79) */
+/* VOID:OBJECT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:79) */
void
_gtk_marshal_VOID__OBJECT_INT_INT (GClosure *closure,
GValue *return_value,
@@ -1810,7 +1810,7 @@
data2);
}
-/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (./gtkmarshalers.list:80) */
+/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:80) */
void
_gtk_marshal_VOID__OBJECT_INT_INT_BOXED_UINT_UINT (GClosure *closure,
GValue *return_value,
@@ -1855,7 +1855,7 @@
data2);
}
-/* VOID:OBJECT,OBJECT (./gtkmarshalers.list:81) */
+/* VOID:OBJECT,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:81) */
void
_gtk_marshal_VOID__OBJECT_OBJECT (GClosure *closure,
GValue *return_value,
@@ -1892,7 +1892,7 @@
data2);
}
-/* VOID:OBJECT,STRING (./gtkmarshalers.list:82) */
+/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:82) */
void
_gtk_marshal_VOID__OBJECT_STRING (GClosure *closure,
GValue *return_value,
@@ -1929,7 +1929,7 @@
data2);
}
-/* VOID:OBJECT,STRING,STRING (./gtkmarshalers.list:83) */
+/* VOID:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:83) */
void
_gtk_marshal_VOID__OBJECT_STRING_STRING (GClosure *closure,
GValue *return_value,
@@ -1968,7 +1968,7 @@
data2);
}
-/* VOID:OBJECT,UINT (./gtkmarshalers.list:84) */
+/* VOID:OBJECT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:84) */
void
_gtk_marshal_VOID__OBJECT_UINT (GClosure *closure,
GValue *return_value,
@@ -2005,7 +2005,7 @@
data2);
}
-/* VOID:OBJECT,UINT,FLAGS (./gtkmarshalers.list:85) */
+/* VOID:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:85) */
void
_gtk_marshal_VOID__OBJECT_UINT_FLAGS (GClosure *closure,
GValue *return_value,
@@ -2044,11 +2044,11 @@
data2);
}
-/* VOID:OBJECT,STRING (./gtkmarshalers.list:86) */
+/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:86) */
-/* VOID:POINTER (./gtkmarshalers.list:87) */
+/* VOID:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:87) */
-/* VOID:POINTER,INT (./gtkmarshalers.list:88) */
+/* VOID:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:88) */
void
_gtk_marshal_VOID__POINTER_INT (GClosure *closure,
GValue *return_value,
@@ -2085,7 +2085,7 @@
data2);
}
-/* VOID:POINTER,BOOLEAN (./gtkmarshalers.list:89) */
+/* VOID:POINTER,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:89) */
void
_gtk_marshal_VOID__POINTER_BOOLEAN (GClosure *closure,
GValue *return_value,
@@ -2122,7 +2122,7 @@
data2);
}
-/* VOID:POINTER,POINTER,POINTER (./gtkmarshalers.list:90) */
+/* VOID:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:90) */
void
_gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure,
GValue *return_value,
@@ -2161,7 +2161,7 @@
data2);
}
-/* VOID:POINTER,UINT (./gtkmarshalers.list:91) */
+/* VOID:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:91) */
void
_gtk_marshal_VOID__POINTER_UINT (GClosure *closure,
GValue *return_value,
@@ -2198,9 +2198,9 @@
data2);
}
-/* VOID:STRING (./gtkmarshalers.list:92) */
+/* VOID:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:92) */
-/* VOID:STRING,STRING (./gtkmarshalers.list:93) */
+/* VOID:STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:93) */
void
_gtk_marshal_VOID__STRING_STRING (GClosure *closure,
GValue *return_value,
@@ -2237,9 +2237,9 @@
data2);
}
-/* VOID:STRING,INT,POINTER (./gtkmarshalers.list:94) */
+/* VOID:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:94) */
-/* VOID:STRING,UINT,FLAGS (./gtkmarshalers.list:95) */
+/* VOID:STRING,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:95) */
void
_gtk_marshal_VOID__STRING_UINT_FLAGS (GClosure *closure,
GValue *return_value,
@@ -2278,7 +2278,7 @@
data2);
}
-/* VOID:UINT,FLAGS,BOXED (./gtkmarshalers.list:96) */
+/* VOID:UINT,FLAGS,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:96) */
void
_gtk_marshal_VOID__UINT_FLAGS_BOXED (GClosure *closure,
GValue *return_value,
@@ -2317,7 +2317,7 @@
data2);
}
-/* VOID:UINT,UINT (./gtkmarshalers.list:97) */
+/* VOID:UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:97) */
void
_gtk_marshal_VOID__UINT_UINT (GClosure *closure,
GValue *return_value,
@@ -2354,7 +2354,7 @@
data2);
}
-/* VOID:UINT,STRING (./gtkmarshalers.list:98) */
+/* VOID:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:98) */
void
_gtk_marshal_VOID__UINT_STRING (GClosure *closure,
GValue *return_value,
@@ -2391,7 +2391,7 @@
data2);
}
-/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (./gtkmarshalers.list:99) */
+/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:99) */
void
_gtk_marshal_VOID__UINT_BOXED_UINT_FLAGS_FLAGS (GClosure *closure,
GValue *return_value,
@@ -2434,7 +2434,7 @@
data2);
}
-/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (./gtkmarshalers.list:100) */
+/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:100) */
void
_gtk_marshal_VOID__UINT_OBJECT_UINT_FLAGS_FLAGS (GClosure *closure,
GValue *return_value,
@@ -2477,5 +2477,5 @@
data2);
}
-/* VOID:VOID (./gtkmarshalers.list:101) */
+/* VOID:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:101) */

View File

@ -0,0 +1,622 @@
--- gtk+-2.6.4/gtk/gtkmarshalers.h 2005-03-01 17:58:15.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmarshalers.h 2005-04-06 16:19:36.903928112 +0300
@@ -6,7 +6,7 @@
G_BEGIN_DECLS
-/* BOOLEAN:BOXED (./gtkmarshalers.list:24) */
+/* BOOLEAN:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:24) */
extern void _gtk_marshal_BOOLEAN__BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -14,7 +14,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:BOXED,BOXED (./gtkmarshalers.list:25) */
+/* BOOLEAN:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:25) */
extern void _gtk_marshal_BOOLEAN__BOXED_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -22,7 +22,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:ENUM (./gtkmarshalers.list:26) */
+/* BOOLEAN:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:26) */
extern void _gtk_marshal_BOOLEAN__ENUM (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -30,7 +30,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:ENUM,DOUBLE (./gtkmarshalers.list:27) */
+/* BOOLEAN:ENUM,DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:27) */
extern void _gtk_marshal_BOOLEAN__ENUM_DOUBLE (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -38,7 +38,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:ENUM,INT (./gtkmarshalers.list:28) */
+/* BOOLEAN:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:28) */
extern void _gtk_marshal_BOOLEAN__ENUM_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -46,7 +46,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:OBJECT,UINT,FLAGS (./gtkmarshalers.list:29) */
+/* BOOLEAN:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:29) */
extern void _gtk_marshal_BOOLEAN__OBJECT_UINT_FLAGS (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -54,7 +54,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:OBJECT,INT,INT,UINT (./gtkmarshalers.list:30) */
+/* BOOLEAN:OBJECT,INT,INT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:30) */
extern void _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -62,7 +62,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:OBJECT,STRING,STRING,BOXED (./gtkmarshalers.list:31) */
+/* BOOLEAN:OBJECT,STRING,STRING,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:31) */
extern void _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -70,7 +70,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:OBJECT,BOXED (./gtkmarshalers.list:32) */
+/* BOOLEAN:OBJECT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:32) */
extern void _gtk_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -78,7 +78,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:OBJECT,BOXED,BOXED (./gtkmarshalers.list:33) */
+/* BOOLEAN:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:33) */
extern void _gtk_marshal_BOOLEAN__OBJECT_BOXED_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -86,7 +86,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:OBJECT,STRING,STRING (./gtkmarshalers.list:34) */
+/* BOOLEAN:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:34) */
extern void _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -94,7 +94,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:INT,INT (./gtkmarshalers.list:35) */
+/* BOOLEAN:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:35) */
extern void _gtk_marshal_BOOLEAN__INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -102,7 +102,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:INT,INT,INT (./gtkmarshalers.list:36) */
+/* BOOLEAN:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:36) */
extern void _gtk_marshal_BOOLEAN__INT_INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -110,7 +110,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:UINT (./gtkmarshalers.list:37) */
+/* BOOLEAN:UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:37) */
extern void _gtk_marshal_BOOLEAN__UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -118,7 +118,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:VOID (./gtkmarshalers.list:38) */
+/* BOOLEAN:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:38) */
extern void _gtk_marshal_BOOLEAN__VOID (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -126,7 +126,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:BOOLEAN (./gtkmarshalers.list:39) */
+/* BOOLEAN:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:39) */
extern void _gtk_marshal_BOOLEAN__BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -134,10 +134,10 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:NONE (./gtkmarshalers.list:40) */
+/* BOOLEAN:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:40) */
#define _gtk_marshal_BOOLEAN__NONE _gtk_marshal_BOOLEAN__VOID
-/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:41) */
+/* BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:41) */
extern void _gtk_marshal_BOOLEAN__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -145,7 +145,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* BOOLEAN:STRING (./gtkmarshalers.list:42) */
+/* BOOLEAN:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:42) */
extern void _gtk_marshal_BOOLEAN__STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -153,7 +153,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* ENUM:ENUM (./gtkmarshalers.list:43) */
+/* ENUM:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:43) */
extern void _gtk_marshal_ENUM__ENUM (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -161,7 +161,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* INT:POINTER (./gtkmarshalers.list:44) */
+/* INT:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:44) */
extern void _gtk_marshal_INT__POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -169,19 +169,19 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* NONE:BOOLEAN (./gtkmarshalers.list:45) */
+/* NONE:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:45) */
#define _gtk_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN
#define _gtk_marshal_NONE__BOOLEAN _gtk_marshal_VOID__BOOLEAN
-/* NONE:ENUM (./gtkmarshalers.list:46) */
+/* NONE:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:46) */
#define _gtk_marshal_VOID__ENUM g_cclosure_marshal_VOID__ENUM
#define _gtk_marshal_NONE__ENUM _gtk_marshal_VOID__ENUM
-/* NONE:INT (./gtkmarshalers.list:47) */
+/* NONE:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:47) */
#define _gtk_marshal_VOID__INT g_cclosure_marshal_VOID__INT
#define _gtk_marshal_NONE__INT _gtk_marshal_VOID__INT
-/* NONE:INT,BOOL (./gtkmarshalers.list:48) */
+/* NONE:INT,BOOL (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:48) */
extern void _gtk_marshal_VOID__INT_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -190,7 +190,7 @@
gpointer marshal_data);
#define _gtk_marshal_NONE__INT_BOOL _gtk_marshal_VOID__INT_BOOLEAN
-/* NONE:INT,INT (./gtkmarshalers.list:49) */
+/* NONE:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:49) */
extern void _gtk_marshal_VOID__INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -199,11 +199,11 @@
gpointer marshal_data);
#define _gtk_marshal_NONE__INT_INT _gtk_marshal_VOID__INT_INT
-/* NONE:NONE (./gtkmarshalers.list:50) */
+/* NONE:NONE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:50) */
#define _gtk_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID
#define _gtk_marshal_NONE__NONE _gtk_marshal_VOID__VOID
-/* NONE:STRING,INT,POINTER (./gtkmarshalers.list:51) */
+/* NONE:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:51) */
extern void _gtk_marshal_VOID__STRING_INT_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -212,7 +212,7 @@
gpointer marshal_data);
#define _gtk_marshal_NONE__STRING_INT_POINTER _gtk_marshal_VOID__STRING_INT_POINTER
-/* STRING:DOUBLE (./gtkmarshalers.list:52) */
+/* STRING:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:52) */
extern void _gtk_marshal_STRING__DOUBLE (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -220,12 +220,12 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:DOUBLE (./gtkmarshalers.list:53) */
+/* VOID:DOUBLE (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:53) */
#define _gtk_marshal_VOID__DOUBLE g_cclosure_marshal_VOID__DOUBLE
-/* VOID:BOOLEAN (./gtkmarshalers.list:54) */
+/* VOID:BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:54) */
-/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (./gtkmarshalers.list:55) */
+/* VOID:BOOLEAN,BOOLEAN,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:55) */
extern void _gtk_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -233,10 +233,10 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:BOXED (./gtkmarshalers.list:56) */
+/* VOID:BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:56) */
#define _gtk_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED
-/* VOID:BOXED,BOXED (./gtkmarshalers.list:57) */
+/* VOID:BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:57) */
extern void _gtk_marshal_VOID__BOXED_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -244,7 +244,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:BOXED,BOXED,POINTER (./gtkmarshalers.list:58) */
+/* VOID:BOXED,BOXED,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:58) */
extern void _gtk_marshal_VOID__BOXED_BOXED_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -252,7 +252,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:BOXED,OBJECT (./gtkmarshalers.list:59) */
+/* VOID:BOXED,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:59) */
extern void _gtk_marshal_VOID__BOXED_OBJECT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -260,7 +260,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:BOXED,STRING,INT (./gtkmarshalers.list:60) */
+/* VOID:BOXED,STRING,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:60) */
extern void _gtk_marshal_VOID__BOXED_STRING_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -268,7 +268,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:BOXED,UINT (./gtkmarshalers.list:61) */
+/* VOID:BOXED,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:61) */
extern void _gtk_marshal_VOID__BOXED_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -276,7 +276,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:BOXED,UINT,FLAGS (./gtkmarshalers.list:62) */
+/* VOID:BOXED,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:62) */
extern void _gtk_marshal_VOID__BOXED_UINT_FLAGS (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -284,7 +284,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:BOXED,UINT,UINT (./gtkmarshalers.list:63) */
+/* VOID:BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:63) */
extern void _gtk_marshal_VOID__BOXED_UINT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -292,9 +292,9 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:ENUM (./gtkmarshalers.list:64) */
+/* VOID:ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:64) */
-/* VOID:ENUM,BOOLEAN (./gtkmarshalers.list:65) */
+/* VOID:ENUM,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:65) */
extern void _gtk_marshal_VOID__ENUM_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -302,7 +302,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:ENUM,ENUM (./gtkmarshalers.list:66) */
+/* VOID:ENUM,ENUM (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:66) */
extern void _gtk_marshal_VOID__ENUM_ENUM (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -310,7 +310,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:ENUM,FLOAT (./gtkmarshalers.list:67) */
+/* VOID:ENUM,FLOAT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:67) */
extern void _gtk_marshal_VOID__ENUM_FLOAT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -318,7 +318,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:ENUM,FLOAT,BOOLEAN (./gtkmarshalers.list:68) */
+/* VOID:ENUM,FLOAT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:68) */
extern void _gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -326,7 +326,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:ENUM,INT (./gtkmarshalers.list:69) */
+/* VOID:ENUM,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:69) */
extern void _gtk_marshal_VOID__ENUM_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -334,7 +334,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:ENUM,INT,BOOLEAN (./gtkmarshalers.list:70) */
+/* VOID:ENUM,INT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:70) */
extern void _gtk_marshal_VOID__ENUM_INT_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -342,11 +342,11 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:INT (./gtkmarshalers.list:71) */
+/* VOID:INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:71) */
-/* VOID:INT,INT (./gtkmarshalers.list:72) */
+/* VOID:INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:72) */
-/* VOID:INT,INT,BOXED (./gtkmarshalers.list:73) */
+/* VOID:INT,INT,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:73) */
extern void _gtk_marshal_VOID__INT_INT_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -354,7 +354,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:INT,INT,INT (./gtkmarshalers.list:74) */
+/* VOID:INT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:74) */
extern void _gtk_marshal_VOID__INT_INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -362,10 +362,10 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT (./gtkmarshalers.list:75) */
+/* VOID:OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:75) */
#define _gtk_marshal_VOID__OBJECT g_cclosure_marshal_VOID__OBJECT
-/* VOID:OBJECT,BOOLEAN (./gtkmarshalers.list:76) */
+/* VOID:OBJECT,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:76) */
extern void _gtk_marshal_VOID__OBJECT_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -373,7 +373,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,BOXED,BOXED (./gtkmarshalers.list:77) */
+/* VOID:OBJECT,BOXED,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:77) */
extern void _gtk_marshal_VOID__OBJECT_BOXED_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -381,7 +381,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,BOXED,UINT,UINT (./gtkmarshalers.list:78) */
+/* VOID:OBJECT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:78) */
extern void _gtk_marshal_VOID__OBJECT_BOXED_UINT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -389,7 +389,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,INT,INT (./gtkmarshalers.list:79) */
+/* VOID:OBJECT,INT,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:79) */
extern void _gtk_marshal_VOID__OBJECT_INT_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -397,7 +397,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (./gtkmarshalers.list:80) */
+/* VOID:OBJECT,INT,INT,BOXED,UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:80) */
extern void _gtk_marshal_VOID__OBJECT_INT_INT_BOXED_UINT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -405,7 +405,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,OBJECT (./gtkmarshalers.list:81) */
+/* VOID:OBJECT,OBJECT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:81) */
extern void _gtk_marshal_VOID__OBJECT_OBJECT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -413,7 +413,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,STRING (./gtkmarshalers.list:82) */
+/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:82) */
extern void _gtk_marshal_VOID__OBJECT_STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -421,7 +421,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,STRING,STRING (./gtkmarshalers.list:83) */
+/* VOID:OBJECT,STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:83) */
extern void _gtk_marshal_VOID__OBJECT_STRING_STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -429,7 +429,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,UINT (./gtkmarshalers.list:84) */
+/* VOID:OBJECT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:84) */
extern void _gtk_marshal_VOID__OBJECT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -437,7 +437,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,UINT,FLAGS (./gtkmarshalers.list:85) */
+/* VOID:OBJECT,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:85) */
extern void _gtk_marshal_VOID__OBJECT_UINT_FLAGS (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -445,12 +445,12 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:OBJECT,STRING (./gtkmarshalers.list:86) */
+/* VOID:OBJECT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:86) */
-/* VOID:POINTER (./gtkmarshalers.list:87) */
+/* VOID:POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:87) */
#define _gtk_marshal_VOID__POINTER g_cclosure_marshal_VOID__POINTER
-/* VOID:POINTER,INT (./gtkmarshalers.list:88) */
+/* VOID:POINTER,INT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:88) */
extern void _gtk_marshal_VOID__POINTER_INT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -458,7 +458,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:POINTER,BOOLEAN (./gtkmarshalers.list:89) */
+/* VOID:POINTER,BOOLEAN (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:89) */
extern void _gtk_marshal_VOID__POINTER_BOOLEAN (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -466,7 +466,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:POINTER,POINTER,POINTER (./gtkmarshalers.list:90) */
+/* VOID:POINTER,POINTER,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:90) */
extern void _gtk_marshal_VOID__POINTER_POINTER_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -474,7 +474,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:POINTER,UINT (./gtkmarshalers.list:91) */
+/* VOID:POINTER,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:91) */
extern void _gtk_marshal_VOID__POINTER_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -482,10 +482,10 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:STRING (./gtkmarshalers.list:92) */
+/* VOID:STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:92) */
#define _gtk_marshal_VOID__STRING g_cclosure_marshal_VOID__STRING
-/* VOID:STRING,STRING (./gtkmarshalers.list:93) */
+/* VOID:STRING,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:93) */
extern void _gtk_marshal_VOID__STRING_STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -493,9 +493,9 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:STRING,INT,POINTER (./gtkmarshalers.list:94) */
+/* VOID:STRING,INT,POINTER (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:94) */
-/* VOID:STRING,UINT,FLAGS (./gtkmarshalers.list:95) */
+/* VOID:STRING,UINT,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:95) */
extern void _gtk_marshal_VOID__STRING_UINT_FLAGS (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -503,7 +503,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:UINT,FLAGS,BOXED (./gtkmarshalers.list:96) */
+/* VOID:UINT,FLAGS,BOXED (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:96) */
extern void _gtk_marshal_VOID__UINT_FLAGS_BOXED (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -511,7 +511,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:UINT,UINT (./gtkmarshalers.list:97) */
+/* VOID:UINT,UINT (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:97) */
extern void _gtk_marshal_VOID__UINT_UINT (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -519,7 +519,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:UINT,STRING (./gtkmarshalers.list:98) */
+/* VOID:UINT,STRING (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:98) */
extern void _gtk_marshal_VOID__UINT_STRING (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -527,7 +527,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (./gtkmarshalers.list:99) */
+/* VOID:UINT,BOXED,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:99) */
extern void _gtk_marshal_VOID__UINT_BOXED_UINT_FLAGS_FLAGS (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -535,7 +535,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (./gtkmarshalers.list:100) */
+/* VOID:UINT,OBJECT,UINT,FLAGS,FLAGS (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:100) */
extern void _gtk_marshal_VOID__UINT_OBJECT_UINT_FLAGS_FLAGS (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -543,7 +543,7 @@
gpointer invocation_hint,
gpointer marshal_data);
-/* VOID:VOID (./gtkmarshalers.list:101) */
+/* VOID:VOID (/home/jlehto/teema4/3rdparty/gtk+2.0-2.6/gtk/gtkmarshalers.list:101) */
G_END_DECLS

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
--- gtk+-2.6.4/gtk/gtkmenu.h 2004-05-06 10:35:26.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkmenu.h 2005-04-06 16:19:36.943922032 +0300
@@ -200,6 +200,9 @@
gint monitor_num);
GList* gtk_menu_get_for_attach_widget (GtkWidget *widget);
+/* Private functions */
+void _gtk_menu_enable_context_menu_behavior (GtkMenu *menu);
+
#ifndef GTK_DISABLE_DEPRECATED
#define gtk_menu_append(menu,child) gtk_menu_shell_append ((GtkMenuShell *)(menu),(child))
#define gtk_menu_prepend(menu,child) gtk_menu_shell_prepend ((GtkMenuShell *)(menu),(child))

View File

@ -0,0 +1,457 @@
--- gtk+-2.6.4/gtk/gtkmenuitem.c 2004-12-28 09:39:31.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmenuitem.c 2005-04-06 16:19:36.973917472 +0300
@@ -24,6 +24,10 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2002-2003. See CHANGES file for list
+ * of changes.
+ */
+
#define GTK_MENU_INTERNALS
#include <config.h>
@@ -38,6 +42,9 @@
#include "gtkmenuitem.h"
#include "gtkseparatormenuitem.h"
+#define HILDON_HEIGHT_INCREMENT 1
+#define HILDON_ARROW_SPACE 6
+
#define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_CLASS (GTK_OBJECT (w)->klass)
enum {
@@ -95,6 +102,8 @@
guint signal_id);
+static void _gtk_menu_item_activate_submenus (GtkMenuItem *item);
+
static GtkItemClass *parent_class;
static guint menu_item_signals[LAST_SIGNAL] = { 0 };
@@ -158,7 +167,9 @@
item_class->select = gtk_real_menu_item_select;
item_class->deselect = gtk_real_menu_item_deselect;
- klass->activate = NULL;
+ /* Hildon addition : Added this to catch the
+ * activation of meuuitems with submenus. */
+ klass->activate = _gtk_menu_item_activate_submenus;
klass->activate_item = gtk_real_menu_item_activate_item;
klass->toggle_size_request = gtk_real_menu_item_toggle_size_request;
klass->toggle_size_allocate = gtk_real_menu_item_toggle_size_allocate;
@@ -239,6 +250,16 @@
G_MAXINT,
10,
G_PARAM_READABLE));
+
+ /* Hildon modification - allow themeing of separator height */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("separator_height",
+ "Separator height",
+ "Draw a separator graphics with height of x pixels.",
+ 0,
+ G_MAXINT,
+ 5,
+ G_PARAM_READABLE));
}
static void
@@ -415,6 +436,13 @@
g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
gtk_item_select (GTK_ITEM (menu_item));
+ /* HILDON MOD. This is required as changed focus isn't drawn automatically
+ * and drawing it must be requested. */
+ if ((GTK_WIDGET(menu_item)->parent) && GTK_IS_MENU (GTK_WIDGET(menu_item)->parent))
+ {
+ GtkMenu *menu = GTK_MENU (GTK_WIDGET(menu_item)->parent);
+ if (menu->parent_menu_item) gtk_widget_queue_draw(GTK_WIDGET(menu->parent_menu_item));
+ }
}
void
@@ -423,6 +451,13 @@
g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
gtk_item_deselect (GTK_ITEM (menu_item));
+ /* HILDON MOD. This is required as changed focus isn't drawn automatically
+ * and drawing it must be requested. */
+ if ((GTK_WIDGET(menu_item)->parent) && GTK_IS_MENU (GTK_WIDGET(menu_item)->parent))
+ {
+ GtkMenu *menu = GTK_MENU (GTK_WIDGET(menu_item)->parent);
+ if (menu->parent_menu_item) gtk_widget_queue_draw(GTK_WIDGET(menu->parent_menu_item));
+ }
}
void
@@ -531,7 +566,7 @@
"arrow_spacing", &arrow_spacing,
NULL);
- requisition->width += child_requisition.height;
+ requisition->width += child_requisition.height + HILDON_ARROW_SPACE;
requisition->width += arrow_spacing;
requisition->width = MAX (requisition->width, get_minimum_width (widget));
@@ -543,6 +578,12 @@
requisition->height += 4;
}
+ /* We get correct focus size if we make the widget a bit bigger.
+ * (If the increment would be big, we should probably adjust the text
+ * position aswell.)
+ */
+ requisition->height += HILDON_HEIGHT_INCREMENT;
+
accel_width = 0;
gtk_container_foreach (GTK_CONTAINER (menu_item),
gtk_menu_item_accel_width_foreach,
@@ -596,7 +637,8 @@
{
if (direction == GTK_TEXT_DIR_RTL)
child_allocation.x += child_requisition.height;
- child_allocation.width -= child_requisition.height;
+ /* HILDON Modification. */
+ child_allocation.width -= child_requisition.height + HILDON_ARROW_SPACE;
}
if (child_allocation.width < 1)
@@ -688,6 +730,7 @@
GtkShadowType shadow_type, selected_shadow_type;
gint width, height;
gint x, y;
+
gint border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_DRAWABLE (widget))
@@ -704,10 +747,56 @@
if ((state_type == GTK_STATE_PRELIGHT) &&
(GTK_BIN (menu_item)->child))
{
+ gint focus_x = x;
+ gint focus_width = width;
gtk_widget_style_get (widget,
"selected_shadow_type", &selected_shadow_type,
NULL);
- gtk_paint_box (widget->style,
+
+ if (menu_item->submenu && menu_item->show_submenu_indicator)
+ {
+ GtkRequisition child_requisition;
+ gint arrow_size;
+ /* gint arrow_extent; */
+ gtk_widget_get_child_requisition (GTK_BIN (menu_item)->child,
+ &child_requisition);
+
+ arrow_size = child_requisition.height - 2 * widget->style->ythickness;
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) {
+ focus_width = x + width - arrow_size - 2 - HILDON_ARROW_SPACE;
+ }
+ else {
+ focus_x = x + arrow_size + 2 + HILDON_ARROW_SPACE;
+ }
+ }
+
+ /*
+ * Hildon modification:
+ * This draws different focus depending on if it's the toplevel
+ * focused menu item. All items that have submenus that in turn
+ * have an item selected will be drawn with SELECTED - state focus.
+ * If this isn't the case, PRELIGHT - state focus is used. */
+ if (menu_item->submenu)
+ {
+ GtkMenuItem *msi;
+ msi = GTK_MENU_ITEM(GTK_MENU_SHELL(&((GTK_MENU(menu_item->submenu))->menu_shell))->active_menu_item);
+ if ((msi == NULL) || (GTK_WIDGET (msi)->state == 0))
+ gtk_paint_box (widget->style,
+ widget->window,
+ GTK_STATE_PRELIGHT,
+ selected_shadow_type,
+ area, widget, "menuitem",
+ focus_x, y, focus_width, height);
+ else
+ gtk_paint_box (widget->style,
+ widget->window,
+ GTK_STATE_SELECTED,
+ selected_shadow_type,
+ area, widget, "menuitem",
+ focus_x, y, focus_width, height);
+ }
+ else
+ gtk_paint_box (widget->style,
widget->window,
GTK_STATE_PRELIGHT,
selected_shadow_type,
@@ -747,8 +836,12 @@
arrow_extent = arrow_size * 0.8;
shadow_type = GTK_SHADOW_OUT;
- if (state_type == GTK_STATE_PRELIGHT)
- shadow_type = GTK_SHADOW_IN;
+ /*Hildon: only show the pressed arrow if the submenu is visible*/
+ if (state_type == GTK_STATE_PRELIGHT
+ && GTK_WIDGET_VISIBLE( menu_item->submenu))
+ {
+ shadow_type = GTK_SHADOW_IN;
+ }
if (direction == GTK_TEXT_DIR_LTR)
{
@@ -763,6 +856,9 @@
arrow_y = y + (height - arrow_extent) / 2;
+/* HILDON modification to correct focus drawing with submenu arrow */
+ arrow_x = arrow_x - 4;
+
gtk_paint_arrow (widget->style, widget->window,
state_type, shadow_type,
area, widget, "menuitem",
@@ -772,18 +868,20 @@
}
else if (!GTK_BIN (menu_item)->child)
{
- guint horizontal_padding;
+ guint horizontal_padding, separator_height;
gtk_widget_style_get (widget,
"horizontal_padding", &horizontal_padding,
+ "separator_height", &separator_height,
NULL);
- gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL,
- area, widget, "menuitem",
- widget->allocation.x + horizontal_padding + widget->style->xthickness,
- widget->allocation.x + widget->allocation.width - horizontal_padding - widget->style->xthickness - 1,
- widget->allocation.y + (widget->allocation.height -
- widget->style->ythickness) / 2);
+ /* themable menuitem for menu separators */
+ gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ area, widget, "separator",
+ widget->allocation.x + horizontal_padding + widget->style->xthickness,
+ widget->allocation.y + (widget->allocation.height - widget->style->ythickness) / 2,
+ widget->allocation.x + widget->allocation.width - horizontal_padding - widget->style->xthickness - 1,
+ separator_height);
}
}
}
@@ -839,6 +937,7 @@
(!GTK_WIDGET_MAPPED (menu_item->submenu) ||
GTK_MENU (menu_item->submenu)->tearoff_active))
{
+ GdkEvent *event = gtk_get_current_event ();
gint popup_delay;
if (menu_item->timer)
@@ -851,26 +950,40 @@
popup_delay = get_popup_delay (menu_item);
if (popup_delay > 0)
- {
- GdkEvent *event = gtk_get_current_event ();
-
- menu_item->timer = g_timeout_add (popup_delay,
- gtk_menu_item_select_timeout,
- menu_item);
- if (event &&
- event->type != GDK_BUTTON_PRESS &&
- event->type != GDK_ENTER_NOTIFY)
- menu_item->timer_from_keypress = TRUE;
- else
- menu_item->timer_from_keypress = FALSE;
-
- if (event)
- gdk_event_free (event);
- }
+ {
+ /* OK, Here comes the contender for the 2003 Ugly Award
+ * The popup delay is set small enough to be unnoticable, but high enough to not
+ * notice the flickering which occurs when we close all the deepest menu's Gtk+ helpfully
+ * expands but are not needed
+ * This does not fix the mouse navigation yet (bug 18) but should take care of 442
+ * NOTE: test the delay factor on different CPU speeds
+ */
+ popup_delay = 3;
+ /* Hildon: Disabling the automatic opening of submenus. */
+
+ if (event &&
+ event->type != GDK_BUTTON_PRESS &&
+ event->type != GDK_ENTER_NOTIFY &&
+ event->type != GDK_MOTION_NOTIFY) /*hildon: for some reason, the event is sometimes this and not enter!*/
+ menu_item->timer_from_keypress = TRUE;
+ else if (event)
+ {
+ /* mouse/pen events */
+ /* here is a problem -- when a menu item with sub menus gets a mouse event,
+ another event is generated for the submenu (and further its submenu etc.)
+ This leads to a behaviour which does not comply to the hildon spec. */
+ menu_item->timer_from_keypress = FALSE;
+ }
+ else /* does this really happen? */
+ menu_item->timer_from_keypress = FALSE;
+ }
else
- _gtk_menu_item_popup_submenu (GTK_WIDGET (menu_item));
+ _gtk_menu_item_popup_submenu (menu_item);
+
+ if (event)
+ gdk_event_free (event);
}
-
+
gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_PRELIGHT);
gtk_widget_queue_draw (GTK_WIDGET (menu_item));
}
@@ -878,25 +991,16 @@
static void
gtk_real_menu_item_deselect (GtkItem *item)
{
- GtkMenuItem *menu_item;
+ GtkWidget *menu_item;
g_return_if_fail (GTK_IS_MENU_ITEM (item));
- menu_item = GTK_MENU_ITEM (item);
+ menu_item = GTK_WIDGET (item);
- if (menu_item->submenu)
- {
- if (menu_item->timer)
- {
- g_source_remove (menu_item->timer);
- menu_item->timer = 0;
- }
- else
- gtk_menu_popdown (GTK_MENU (menu_item->submenu));
- }
+ _gtk_menu_item_popdown_submenu (menu_item);
- gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_NORMAL);
- gtk_widget_queue_draw (GTK_WIDGET (menu_item));
+ gtk_widget_set_state (menu_item, GTK_STATE_NORMAL);
+ gtk_widget_queue_draw (menu_item);
}
static gboolean
@@ -941,10 +1045,7 @@
_gtk_menu_shell_activate (menu_shell);
gtk_menu_shell_select_item (GTK_MENU_SHELL (widget->parent), widget);
- _gtk_menu_item_popup_submenu (widget);
-
- gtk_menu_shell_select_first (GTK_MENU_SHELL (menu_item->submenu), TRUE);
- submenu = GTK_MENU_SHELL (menu_item->submenu);
+ /* Hildon mod: automatic submenu opening has been removed */
}
}
}
@@ -983,7 +1084,7 @@
{
_gtk_menu_item_popup_submenu (GTK_WIDGET (menu_item));
if (menu_item->timer_from_keypress && menu_item->submenu)
- GTK_MENU_SHELL (menu_item->submenu)->ignore_enter = TRUE;
+ GTK_MENU_SHELL (menu_item->submenu)->ignore_enter = TRUE;
}
GDK_THREADS_LEAVE ();
@@ -1002,7 +1103,16 @@
g_source_remove (menu_item->timer);
menu_item->timer = 0;
+ /* HILDON MOD. This is required as changed submenu arrow isn't drawn automatically
+ * and drawing it must be requested. */
+ gtk_widget_queue_draw (widget);
+
if (GTK_WIDGET_IS_SENSITIVE (menu_item->submenu))
+ {
+ gboolean take_focus;
+ take_focus = gtk_menu_shell_get_take_focus (GTK_MENU_SHELL (widget->parent));
+ gtk_menu_shell_set_take_focus (GTK_MENU_SHELL (menu_item->submenu),take_focus);
+
gtk_menu_popup (GTK_MENU (menu_item->submenu),
widget->parent,
widget,
@@ -1010,6 +1120,28 @@
menu_item,
GTK_MENU_SHELL (widget->parent)->button,
0);
+ }
+}
+
+void
+_gtk_menu_item_popdown_submenu (GtkWidget *widget)
+{
+ GtkMenuItem *menu_item;
+
+ menu_item = GTK_MENU_ITEM (widget);
+
+ if (menu_item->submenu)
+ {
+ if (menu_item->timer)
+ {
+ g_source_remove (menu_item->timer);
+ menu_item->timer = 0;
+ }
+ else
+ gtk_menu_popdown (GTK_MENU (menu_item->submenu));
+ }
+
+ gtk_widget_queue_draw (widget);
}
static void
@@ -1092,14 +1224,17 @@
tx += widget->allocation.width - twidth;
}
+/* HILDON modifications
+ * Here we make the submenu of an menubar appear under the menubar.
+ * The only exception is when the resulting menu would be under 100 pixels
+ * high. In that case, the menu is made 100 pixels high.
+ */
if ((ty + widget->allocation.height + theight) <= monitor.y + monitor.height)
ty += widget->allocation.height;
- else if ((ty - theight) >= monitor.y)
- ty -= theight;
- else if (monitor.y + monitor.height - (ty + widget->allocation.height) > ty)
+ else if ((ty + widget->allocation.height) < monitor.y + monitor.height - 120)
ty += widget->allocation.height;
else
- ty -= theight;
+ ty = monitor.y + monitor.height - 120;
break;
case GTK_LEFT_RIGHT:
@@ -1404,3 +1539,30 @@
return TRUE;
}
+
+/* Hildon modification :
+ * This function exists only for opening submenus on
+ * activation. */
+static void
+_gtk_menu_item_activate_submenus (GtkMenuItem *item)
+{
+ GdkEvent *event;
+
+ g_return_if_fail (GTK_IS_MENU_ITEM (item));
+
+ if (!GTK_IS_MENU (item->submenu) ||
+ GTK_WIDGET_VISIBLE (item->submenu))
+ return;
+
+ event = gtk_get_current_event ();
+ _gtk_menu_item_popup_submenu (item);
+
+ /* We don't want to select first item if the submenu
+ * is opened with mouse release because the selection
+ * would move straigh back under the cursor. */
+ if ((event == NULL) || (event->type != GDK_BUTTON_RELEASE))
+ gtk_menu_shell_select_first (GTK_MENU_SHELL (item->submenu), TRUE);
+
+ if (event)
+ gdk_event_free (event);
+}

View File

@ -0,0 +1,10 @@
--- gtk+-2.6.4/gtk/gtkmenuitem.h 2004-12-15 18:27:30.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmenuitem.h 2005-04-06 16:19:36.983915952 +0300
@@ -122,6 +122,7 @@
gboolean group_changed);
gboolean _gtk_menu_item_is_selectable (GtkWidget *menu_item);
void _gtk_menu_item_popup_submenu (GtkWidget *menu_item);
+void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item);
#ifndef GTK_DISABLE_DEPRECATED
#define gtk_menu_item_right_justify(menu_item) gtk_menu_item_set_right_justified ((menu_item), TRUE)

View File

@ -0,0 +1,490 @@
--- gtk+-2.6.4/gtk/gtkmenushell.c 2005-02-09 18:46:54.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmenushell.c 2005-04-06 16:19:36.999913520 +0300
@@ -39,6 +39,8 @@
#include "gtkmnemonichash.h"
#include "gtktearoffmenuitem.h"
#include "gtkwindow.h"
+#include "gtkprivate.h"
+#include "gtkintl.h"
#define MENU_SHELL_TIMEOUT 500
@@ -52,6 +54,11 @@
LAST_SIGNAL
};
+enum {
+ PROP_0,
+ PROP_TAKE_FOCUS
+};
+
typedef void (*GtkMenuShellSignal1) (GtkObject *object,
GtkMenuDirectionType arg1,
gpointer data);
@@ -122,10 +129,20 @@
{
GtkMnemonicHash *mnemonic_hash;
GtkKeyHash *key_hash;
+ gboolean activated_submenu;
+ gboolean take_focus;
};
static void gtk_menu_shell_class_init (GtkMenuShellClass *klass);
static void gtk_menu_shell_init (GtkMenuShell *menu_shell);
+static void gtk_menu_shell_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gtk_menu_shell_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
static void gtk_menu_shell_realize (GtkWidget *widget);
static void gtk_menu_shell_finalize (GObject *object);
static gint gtk_menu_shell_button_press (GtkWidget *widget,
@@ -176,7 +193,6 @@
static GtkContainerClass *parent_class = NULL;
static guint menu_shell_signals[LAST_SIGNAL] = { 0 };
-
GType
gtk_menu_shell_get_type (void)
{
@@ -220,6 +236,8 @@
container_class = (GtkContainerClass*) klass;
parent_class = g_type_class_peek_parent (klass);
+ object_class->set_property = gtk_menu_shell_set_property;
+ object_class->get_property = gtk_menu_shell_get_property;
object_class->finalize = gtk_menu_shell_finalize;
@@ -299,9 +317,15 @@
binding_set = gtk_binding_set_by_class (klass);
+/* Hildon : The following binding is commented out
+ * because we want the Escape key to only exit the
+ * currently opened submenu. Therefore, the handling
+ * of esc-key will be moved to gtkmenuitem.c */
+/*
gtk_binding_entry_add_signal (binding_set,
GDK_Escape, 0,
"cancel", 0);
+*/
gtk_binding_entry_add_signal (binding_set,
GDK_Return, 0,
"activate_current", 1,
@@ -330,7 +354,23 @@
GDK_F10, GDK_SHIFT_MASK,
"cycle_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
-
+ /**
+ * GtkMenuShell:take-focus:
+ *
+ * A boolean that determines whether the menu and its submenus grab the
+ * keyboard focus. See gtk_menu_shell_set_take_focus() and
+ * gtk_menu_shell_get_take_focus().
+ *
+ * Since: 2.8
+ **/
+ g_object_class_install_property (object_class,
+ PROP_TAKE_FOCUS,
+ g_param_spec_boolean ("take-focus",
+ P_("Take Focus"),
+ P_("A boolean that determines whether the menu grabs the keyboard focus"),
+ TRUE,
+ G_PARAM_READWRITE));
+
g_type_class_add_private (object_class, sizeof (GtkMenuShellPrivate));
}
@@ -356,6 +396,46 @@
priv->mnemonic_hash = NULL;
priv->key_hash = NULL;
+ priv->take_focus = TRUE;
+ priv->activated_submenu = FALSE;
+}
+
+static void
+gtk_menu_shell_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
+
+ switch (prop_id)
+ {
+ case PROP_TAKE_FOCUS:
+ gtk_menu_shell_set_take_focus (menu_shell, g_value_get_boolean (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gtk_menu_shell_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GtkMenuShell *menu_shell = GTK_MENU_SHELL (object);
+
+ switch (prop_id)
+ {
+ case PROP_TAKE_FOCUS:
+ g_value_set_boolean (value, gtk_menu_shell_get_take_focus (menu_shell));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
static void
@@ -470,6 +550,7 @@
gtk_menu_shell_button_press (GtkWidget *widget,
GdkEventButton *event)
{
+ GtkMenuShellPrivate *priv;
GtkMenuShell *menu_shell;
GtkWidget *menu_item;
@@ -479,7 +560,22 @@
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
+ priv = GTK_MENU_SHELL_GET_PRIVATE (widget);
+
menu_shell = GTK_MENU_SHELL (widget);
+ menu_item = gtk_menu_shell_get_item (menu_shell, (GdkEvent*) event);
+
+ if (menu_shell->active && menu_item &&
+ (menu_shell->active_menu_item == menu_item) &&
+ _gtk_menu_item_is_selectable (menu_item) &&
+ GTK_MENU_ITEM (menu_item)->submenu != NULL &&
+ !GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu))
+ {
+ /* Hildon : We want to be able to activate submenu items. */
+ gtk_menu_shell_activate_item (menu_shell, menu_item, FALSE);
+
+ priv->activated_submenu = TRUE;
+ }
if (menu_shell->parent_menu_shell)
{
@@ -491,30 +587,29 @@
menu_shell->button = event->button;
- menu_item = gtk_menu_shell_get_item (menu_shell, (GdkEvent *)event);
-
if (menu_item && _gtk_menu_item_is_selectable (menu_item))
- {
- if ((menu_item->parent == widget) &&
- (menu_item != menu_shell->active_menu_item))
- {
- if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
- {
- menu_shell->activate_time = event->time;
- }
+ {
+
+ if ((menu_item->parent == widget) &&
+ (menu_item != menu_shell->active_menu_item))
+ {
+ if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
+ {
+ menu_shell->activate_time = event->time;
+ }
- gtk_menu_shell_select_item (menu_shell, menu_item);
- }
- }
+ gtk_menu_shell_select_item (menu_shell, menu_item);
+ }
+ }
}
else
{
widget = gtk_get_event_widget ((GdkEvent*) event);
if (widget == GTK_WIDGET (menu_shell))
- {
- gtk_menu_shell_deactivate (menu_shell);
- g_signal_emit (menu_shell, menu_shell_signals[SELECTION_DONE], 0);
- }
+ {
+ gtk_menu_shell_deactivate (menu_shell);
+ g_signal_emit (menu_shell, menu_shell_signals[SELECTION_DONE], 0);
+ }
}
return TRUE;
@@ -524,13 +619,20 @@
gtk_menu_shell_button_release (GtkWidget *widget,
GdkEventButton *event)
{
+ GtkMenuShellPrivate *priv;
GtkMenuShell *menu_shell;
GtkWidget *menu_item;
gint deactivate;
+ gboolean activated_submenu;
g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
+ priv = GTK_MENU_SHELL_GET_PRIVATE (widget);
+
+ activated_submenu = priv->activated_submenu;
+ priv->activated_submenu = FALSE;
+
menu_shell = GTK_MENU_SHELL (widget);
if (menu_shell->active)
{
@@ -556,11 +658,11 @@
gtk_menu_shell_activate_item (menu_shell, menu_item, TRUE);
return TRUE;
}
- else if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement != GTK_TOP_BOTTOM)
- {
- gtk_menu_item_select (GTK_MENU_ITEM (menu_item));
- return TRUE;
- }
+ else if (!activated_submenu)
+ {
+ /* popdown the submenu if we didn't pop it up in this click */
+ _gtk_menu_item_popdown_submenu (menu_item);
+ }
}
else if (menu_item &&
!_gtk_menu_item_is_selectable (menu_item) &&
@@ -630,12 +732,14 @@
gtk_menu_shell_enter_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
+ GtkMenuShellPrivate *priv;
GtkMenuShell *menu_shell;
GtkWidget *menu_item;
g_return_val_if_fail (GTK_IS_MENU_SHELL (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
+ priv = GTK_MENU_SHELL_GET_PRIVATE (widget);
menu_shell = GTK_MENU_SHELL (widget);
if (menu_shell->active)
@@ -658,6 +762,17 @@
(GTK_WIDGET_STATE (menu_item) != GTK_STATE_PRELIGHT))
{
gtk_menu_shell_select_item (menu_shell, menu_item);
+
+ /* If the pen is down, and there is a submenu that is not
+ * yet visible, activate it */
+ if ((event->state & GDK_BUTTON1_MASK) &&
+ GTK_MENU_ITEM (menu_item)->submenu != NULL &&
+ !GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu))
+ {
+ gtk_menu_shell_activate_item (menu_shell, menu_item, FALSE);
+
+ priv->activated_submenu = TRUE;
+ }
}
}
else if (menu_shell->parent_menu_shell)
@@ -887,8 +1002,14 @@
/* This allows the bizarre radio buttons-with-submenus-display-history
* behavior
*/
+ /* Hildon modification. We probably won't have those
+ * bizarre radio buttons-with-submenus so we don't
+ * need this. Also, this functionality interferes with
+ * other functionality. */
+/*
if (GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu)
gtk_widget_activate (menu_shell->active_menu_item);
+*/
}
void
@@ -919,7 +1040,9 @@
g_object_ref (menu_shell);
- if (deactivate)
+ /* We don't want to deactivate if we're activating
+ * a submenu item. */
+ if ((deactivate) && (GTK_MENU_ITEM (menu_item)->submenu == NULL))
{
GtkMenuShell *parent_menu_shell = menu_shell;
@@ -965,29 +1088,30 @@
if (distance > 0)
{
+ /*Hildon: selection no longer wraps around at the
+ *bottom of the menu*/
+
node = node->next;
- while (node != start_node &&
- (!node || !_gtk_menu_item_is_selectable (node->data)))
+ while (node && node != start_node &&
+ !_gtk_menu_item_is_selectable (node->data))
{
- if (!node)
- node = menu_shell->children;
- else
node = node->next;
}
}
else
{
+ /*Hildon: selection no longer wraps around at the top
+ *of the menu*/
+
node = node->prev;
- while (node != start_node &&
- (!node || !_gtk_menu_item_is_selectable (node->data)))
+ while (node && node != start_node &&
+ !_gtk_menu_item_is_selectable (node->data))
{
- if (!node)
- node = g_list_last (menu_shell->children);
- else
node = node->prev;
}
}
+ /*note: gtk_menu_shell_select_item won't select non-selectable items*/
if (node)
gtk_menu_shell_select_item (menu_shell, node->data);
}
@@ -1119,6 +1243,16 @@
switch (direction)
{
case GTK_MENU_DIR_PARENT:
+
+ if(!parent_menu_shell || GTK_IS_MENU_BAR(parent_menu_shell))
+ break;
+
+ /* hildon-modification - menu should be closed when returning from submenu.
+ * WARNING: This function is from GtkMenu, which normally
+ * shouldn't be called from GtkMenuShell, but currently
+ * there are no better alternatives. */
+ gtk_menu_popdown (GTK_MENU (menu_shell));
+
if (parent_menu_shell)
{
if (GTK_MENU_SHELL_GET_CLASS (parent_menu_shell)->submenu_placement ==
@@ -1151,10 +1285,14 @@
_gtk_menu_item_is_selectable (menu_shell->active_menu_item) &&
GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu)
{
+ /* Hildon-modification -- submenu is not opened automatically but needs to be explicitly opened*/
+ g_signal_emit (G_OBJECT (menu_shell), menu_shell_signals[ACTIVATE_CURRENT], 0, (gint) FALSE);
+
if (gtk_menu_shell_select_submenu_first (menu_shell))
break;
}
+#if 0
/* Try to find a menu running the opposite direction */
while (parent_menu_shell &&
(GTK_MENU_SHELL_GET_CLASS (parent_menu_shell)->submenu_placement ==
@@ -1173,6 +1311,7 @@
gtk_menu_shell_move_selected (parent_menu_shell, 1);
gtk_menu_shell_select_submenu_first (parent_menu_shell);
}
+#endif
break;
case GTK_MENU_DIR_PREV:
@@ -1197,8 +1336,8 @@
gtk_real_menu_shell_activate_current (GtkMenuShell *menu_shell,
gboolean force_hide)
{
- if (menu_shell->active_menu_item &&
- _gtk_menu_item_is_selectable (menu_shell->active_menu_item))
+ if (menu_shell->active_menu_item)/* &&
+ _gtk_menu_item_is_selectable (menu_shell->active_menu_item)) */
{
if (GTK_MENU_ITEM (menu_shell->active_menu_item)->submenu == NULL)
@@ -1390,4 +1529,73 @@
keyval, target);
gtk_menu_shell_reset_key_hash (menu_shell);
}
+/**
+ * gtk_menu_shell_get_take_focus:
+ * @menu: a #GtkMenuShell
+ *
+ * @returns: %TRUE if the menu_shell will take the keyboard focus on popup.
+ *
+ * Since: 2.8
+ **/
+gboolean
+gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell)
+{
+ GtkMenuShellPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_MENU_SHELL (menu_shell), FALSE);
+
+ priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
+
+ return priv->take_focus;
+}
+
+/**
+ * gtk_menu_shell_set_take_focus:
+ * @menu: a #GtkMenuShell
+ * @take_focus: %TRUE if the menu_shell should take the keyboard focus on popup.
+ *
+ * If @take_focus is %TRUE (the default) the menu will take the keyboard focus
+ * so that it will receive all keyboard events which is needed to enable
+ * keyboard navigation in menus.
+ *
+ * Setting @take_focus to %FALSE is useful only for special applications
+ * like virtual keyboard implementations which should not take keyboard
+ * focus.
+ *
+ * The @take_focus state of a menu or menu bar is automatically propagated
+ * to submenus whenever a submenu is popped up, so you don't have to worry
+ * about recursively setting it for your entire menu hierarchy. Only when
+ * programmatically picking a submenu and popping it up manually, the
+ * @take_focus property of the submenu needs to be set explicitely.
+ *
+ * Note that setting it to %FALSE has side-effects:
+ *
+ * If the focus is in some other app, it keeps the focus and keynav in
+ * the menu doesn't work. Consequently, keynav on the menu will only
+ * work if the focus is on some toplevel owned by the onscreen keyboard.
+ *
+ * To avoid confusing the user, menus with @take_focus set to %FALSE
+ * should not display mnemonics or accelerators, since it cannot be
+ * guaranteed that they will work.
+ *
+ * See also gdk_keyboard_grab()
+ *
+ * Since: 2.8
+ **/
+void
+gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
+ gboolean take_focus)
+{
+ GtkMenuShellPrivate *priv;
+
+ g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
+
+ priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell);
+
+ if (priv->take_focus != take_focus)
+ {
+ priv->take_focus = take_focus;
+ g_object_notify (G_OBJECT (menu_shell), "take-focus");
+ }
+}

View File

@ -0,0 +1,12 @@
--- gtk+-2.6.4/gtk/gtkmenushell.h 2004-12-11 00:09:22.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkmenushell.h 2005-04-06 16:19:36.999913520 +0300
@@ -124,6 +124,9 @@
void _gtk_menu_shell_remove_mnemonic (GtkMenuShell *menu_shell,
guint keyval,
GtkWidget *target);
+gboolean gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell);
+void gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
+ gboolean take_focus);
#ifdef __cplusplus
}

View File

@ -0,0 +1,831 @@
--- gtk+-2.6.4/gtk/gtknotebook.c 2004-09-27 06:43:55.000000000 +0300
+++ gtk+-2.6.4/gtk/gtknotebook.c 2005-04-06 16:19:37.033908352 +0300
@@ -40,10 +40,10 @@
#define TAB_OVERLAP 2
#define TAB_CURVATURE 1
-#define ARROW_SIZE 12
+#define ARROW_WIDTH 20
+#define ARROW_HEIGHT 27
#define ARROW_SPACING 0
-#define NOTEBOOK_INIT_SCROLL_DELAY (200)
-#define NOTEBOOK_SCROLL_DELAY (100)
+#define LABEL_PADDING 0
enum {
@@ -57,7 +57,9 @@
enum {
STEP_PREV,
- STEP_NEXT
+ STEP_NEXT,
+ STEP_PREV_CYCLE,
+ STEP_NEXT_CYCLE
};
typedef enum
@@ -216,7 +218,7 @@
GList *list,
gboolean destroying);
static void gtk_notebook_update_labels (GtkNotebook *notebook);
-static gint gtk_notebook_timer (GtkNotebook *notebook);
+static gint gtk_notebook_timer (GtkNotebook *notebook );
static gint gtk_notebook_page_compare (gconstpointer a,
gconstpointer b);
static GList* gtk_notebook_find_child (GtkNotebook *notebook,
@@ -458,7 +460,7 @@
g_param_spec_boolean ("scrollable",
P_("Scrollable"),
P_("If TRUE, scroll arrows are added if there are too many tabs to fit"),
- FALSE,
+ TRUE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ENABLE_POPUP,
@@ -584,6 +586,75 @@
G_PARAM_READABLE));
+ /* Hildon: for adding paddings to the inner borders of the visible page */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("inner_left_border",
+ _("Inner left border of the visible page"),
+ _("Width of inner left border of the visible page"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("inner_right_border",
+ _("Inner right border of the visible page"),
+ _("Width of inner right border of the visible page"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+
+ /* Hildon: previously hardcoded constants ARROW_WIDTH, ARROW_HEIGHT,
+ ARROW_SPACING, TAB_OVERLAP and TAB_CURVATURE are now style properties */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("arrow-width",
+ _("Arrow width"),
+ _("Scroll arrow width"),
+ 0,
+ G_MAXINT,
+ ARROW_WIDTH,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("arrow-height",
+ _("Arrow height"),
+ _("Scroll arrow height"),
+ 0,
+ G_MAXINT,
+ ARROW_HEIGHT,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("arrow-spacing",
+ _("Arrow spacing"),
+ _("Scroll arrow spacing"),
+ 0,
+ G_MAXINT,
+ ARROW_SPACING,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("tab-overlap",
+ _("Tab overlap"),
+ _("Tab overlap"),
+ 0,
+ G_MAXINT,
+ TAB_OVERLAP,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("tab-curvature",
+ _("Tab curvature"),
+ _("Tab curvature"),
+ 0,
+ G_MAXINT,
+ TAB_CURVATURE,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("label-padding",
+ _("Label padding"),
+ _("Label padding"),
+ 0,
+ G_MAXINT,
+ LABEL_PADDING,
+ G_PARAM_READABLE));
+
notebook_signals[SWITCH_PAGE] =
g_signal_new ("switch_page",
G_TYPE_FROM_CLASS (gobject_class),
@@ -705,11 +776,10 @@
notebook->show_tabs = TRUE;
notebook->show_border = TRUE;
notebook->tab_pos = GTK_POS_TOP;
- notebook->scrollable = FALSE;
+ notebook->scrollable = TRUE;
notebook->in_child = 0;
notebook->click_child = 0;
notebook->button = 0;
- notebook->need_timer = 0;
notebook->child_has_focus = FALSE;
notebook->have_visible_child = FALSE;
notebook->focus_out = FALSE;
@@ -1189,9 +1259,18 @@
GtkRequisition child_requisition;
gboolean switch_page = FALSE;
gint vis_pages;
- gint focus_width;
+ gint focus_width, label_padding;
+ gint arrow_width, arrow_height, arrow_spacing, tab_overlap, tab_curvature;
- gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
+ gtk_widget_style_get (widget,
+ "focus-line-width", &focus_width,
+ "arrow-width", &arrow_width,
+ "arrow-height", &arrow_height,
+ "arrow-spacing", &arrow_spacing,
+ "tab-overlap", &tab_overlap,
+ "tab-curvature", &tab_curvature,
+ "label-padding", &label_padding,
+ NULL);
widget->requisition.width = 0;
widget->requisition.height = 0;
@@ -1229,6 +1308,22 @@
{
widget->requisition.width += widget->style->xthickness * 2;
widget->requisition.height += widget->style->ythickness * 2;
+
+ /* Hildon kludge: inner border paddings */
+ if (notebook->children && notebook->show_border)
+ {
+ gint inner_left_border, inner_right_border;
+
+ gtk_widget_style_get (widget,
+ "inner_left_border",
+ &inner_left_border,
+ "inner_right_border",
+ &inner_right_border,
+ NULL);
+
+ widget->requisition.width += inner_left_border + inner_right_border;
+ }
+
if (notebook->show_tabs)
{
@@ -1249,6 +1344,7 @@
gtk_widget_size_request (page->tab_label,
&child_requisition);
+ child_requisition.width += 2 * label_padding;
page->requisition.width =
child_requisition.width +
@@ -1292,10 +1388,10 @@
if (notebook->scrollable && vis_pages > 1 &&
widget->requisition.width < tab_width)
- tab_height = MAX (tab_height, ARROW_SIZE);
+ tab_height = MAX (tab_height, arrow_height);
- padding = 2 * (TAB_CURVATURE + focus_width +
- notebook->tab_hborder) - TAB_OVERLAP;
+ padding = 2 * (tab_curvature + focus_width +
+ notebook->tab_hborder) - tab_overlap;
tab_max += padding;
while (children)
{
@@ -1316,15 +1412,15 @@
if (notebook->scrollable && vis_pages > 1 &&
widget->requisition.width < tab_width)
- tab_width = tab_max + 2 * (ARROW_SIZE + ARROW_SPACING);
+ tab_width = tab_max + 2 * (arrow_width + arrow_spacing);
if (notebook->homogeneous && !notebook->scrollable)
widget->requisition.width = MAX (widget->requisition.width,
vis_pages * tab_max +
- TAB_OVERLAP);
+ tab_overlap);
else
widget->requisition.width = MAX (widget->requisition.width,
- tab_width + TAB_OVERLAP);
+ tab_width + tab_overlap);
widget->requisition.height += tab_height;
break;
@@ -1335,10 +1431,10 @@
if (notebook->scrollable && vis_pages > 1 &&
widget->requisition.height < tab_height)
- tab_width = MAX (tab_width, ARROW_SPACING + 2 * ARROW_SIZE);
+ tab_width = MAX (tab_width, arrow_spacing + 2 * arrow_width);
- padding = 2 * (TAB_CURVATURE + focus_width +
- notebook->tab_vborder) - TAB_OVERLAP;
+ padding = 2 * (tab_curvature + focus_width +
+ notebook->tab_vborder) - tab_overlap;
tab_max += padding;
while (children)
@@ -1361,24 +1457,24 @@
if (notebook->scrollable && vis_pages > 1 &&
widget->requisition.height < tab_height)
- tab_height = tab_max + ARROW_SIZE + ARROW_SPACING;
+ tab_height = tab_max + arrow_height + arrow_spacing;
widget->requisition.width += tab_width;
if (notebook->homogeneous && !notebook->scrollable)
widget->requisition.height =
MAX (widget->requisition.height,
- vis_pages * tab_max + TAB_OVERLAP);
+ vis_pages * tab_max + tab_overlap);
else
widget->requisition.height =
MAX (widget->requisition.height,
- tab_height + TAB_OVERLAP);
+ tab_height + tab_overlap);
if (!notebook->homogeneous || notebook->scrollable)
vis_pages = 1;
widget->requisition.height = MAX (widget->requisition.height,
vis_pages * tab_max +
- TAB_OVERLAP);
+ tab_overlap);
break;
}
}
@@ -1499,7 +1595,26 @@
}
}
+ /* Hildon kludge: inner border paddings */
+ if (notebook->show_border)
+ {
+ gint inner_left_border, inner_right_border;
+
+ gtk_widget_style_get (widget,
+ "inner_left_border",
+ &inner_left_border,
+ "inner_right_border",
+ &inner_right_border,
+ NULL);
+
+ child_allocation.x += inner_left_border;
+ child_allocation.width -= inner_left_border + inner_right_border;
+ if (child_allocation.width < 0)
+ child_allocation.width = 0;
+ }
+
children = notebook->children;
+
while (children)
{
page = children->data;
@@ -1580,11 +1695,18 @@
GdkRectangle event_window_pos;
gboolean before = ARROW_IS_BEFORE (arrow);
gboolean left = ARROW_IS_LEFT (arrow);
+ gint arrow_width, arrow_height, arrow_spacing;
+
+ gtk_widget_style_get (GTK_WIDGET(notebook),
+ "arrow-width", &arrow_width,
+ "arrow-height", &arrow_height,
+ "arrow-spacing", &arrow_spacing,
+ NULL);
if (gtk_notebook_get_event_window_position (notebook, &event_window_pos))
{
- rectangle->width = ARROW_SIZE;
- rectangle->height = ARROW_SIZE;
+ rectangle->width = arrow_width;
+ rectangle->height = arrow_height;
switch (notebook->tab_pos)
{
@@ -1602,6 +1724,8 @@
rectangle->y += event_window_pos.height - rectangle->height;
break;
case GTK_POS_TOP:
+ arrow_spacing = - arrow_spacing;
+ /* Fall through */
case GTK_POS_BOTTOM:
if (before)
{
@@ -1617,7 +1741,11 @@
else
rectangle->x = event_window_pos.x + event_window_pos.width - 2 * rectangle->width;
}
- rectangle->y = event_window_pos.y + (event_window_pos.height - rectangle->height) / 2;
+ rectangle->y = event_window_pos.y;
+ if (arrow_spacing > 0)
+ rectangle->y += arrow_spacing;
+ else
+ rectangle->y += (event_window_pos.height - rectangle->height) / 2;
break;
}
}
@@ -1696,6 +1824,10 @@
gboolean is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
gboolean left = (ARROW_IS_LEFT (arrow) && !is_rtl) ||
(!ARROW_IS_LEFT (arrow) && is_rtl);
+ GtkSettings *settings = gtk_settings_get_default ();
+ guint timeout;
+
+ g_object_get (settings, "gtk-initial-timeout", &timeout, NULL);
if (!GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
@@ -1706,14 +1838,14 @@
if (event->button == 1)
{
gtk_notebook_do_arrow (notebook, arrow);
-
+
if (!notebook->timer)
- {
- notebook->timer = g_timeout_add (NOTEBOOK_INIT_SCROLL_DELAY,
- (GSourceFunc) gtk_notebook_timer,
- (gpointer) notebook);
- notebook->need_timer = TRUE;
- }
+ {
+ notebook->timer = g_timeout_add (timeout,
+ (GSourceFunc) gtk_notebook_timer,
+ (gpointer) notebook);
+ notebook->need_timer = TRUE;
+ }
}
else if (event->button == 2)
gtk_notebook_page_select (notebook, TRUE);
@@ -1862,7 +1994,7 @@
static void
stop_scrolling (GtkNotebook *notebook)
{
- if (notebook->timer)
+ if (notebook->timer)
{
g_source_remove (notebook->timer);
notebook->timer = 0;
@@ -2343,9 +2475,9 @@
*/
return focus_child_in (notebook, GTK_DIR_TAB_FORWARD);
case GTK_DIR_LEFT:
- return focus_tabs_move (notebook, direction, STEP_PREV);
+ return focus_tabs_move (notebook, direction, STEP_PREV_CYCLE);
case GTK_DIR_RIGHT:
- return focus_tabs_move (notebook, direction, STEP_NEXT);
+ return focus_tabs_move (notebook, direction, STEP_NEXT_CYCLE);
}
}
else /* Focus was not on widget */
@@ -2481,7 +2613,6 @@
* gtk_notebook_redraw_tabs
* gtk_notebook_real_remove
* gtk_notebook_update_labels
- * gtk_notebook_timer
* gtk_notebook_page_compare
* gtk_notebook_real_page_position
* gtk_notebook_search_page
@@ -2574,22 +2705,27 @@
gtk_notebook_timer (GtkNotebook *notebook)
{
gboolean retval = FALSE;
+ guint timeout;
+ GtkSettings *settings;
GDK_THREADS_ENTER ();
+ settings = gtk_settings_get_default ();
+ g_object_get (settings, "gtk-update-timeout", &timeout, NULL);
+
if (notebook->timer)
{
gtk_notebook_do_arrow (notebook, notebook->click_child);
- if (notebook->need_timer)
- {
- notebook->need_timer = FALSE;
- notebook->timer = g_timeout_add (NOTEBOOK_SCROLL_DELAY,
- (GSourceFunc) gtk_notebook_timer,
- (gpointer) notebook);
- }
+ if (notebook->need_timer)
+ {
+ notebook->need_timer = FALSE;
+ notebook->timer = g_timeout_add (timeout,
+ (GSourceFunc) gtk_notebook_timer,
+ (gpointer) notebook);
+ }
else
- retval = TRUE;
+ retval = TRUE;
}
GDK_THREADS_LEAVE ();
@@ -2781,10 +2917,12 @@
switch (direction)
{
case STEP_PREV:
+ case STEP_PREV_CYCLE:
flag = GTK_PACK_END;
break;
case STEP_NEXT:
+ case STEP_NEXT_CYCLE:
flag = GTK_PACK_START;
break;
}
@@ -2827,6 +2965,37 @@
old_list = list;
list = list->prev;
}
+
+ /* Hildon hack: keyboard navigation should cycle around */
+ if (direction == STEP_PREV_CYCLE)
+ {
+ /* find and return the last (visible) page */
+ list = g_list_last (notebook->children);
+ if (!find_visible)
+ return list;
+ while (list)
+ {
+ page = list->data;
+ if (GTK_WIDGET_VISIBLE (page->child))
+ return list;
+ list = list->prev;
+ }
+ }
+ if (direction == STEP_NEXT_CYCLE)
+ {
+ /* find and return the first (visible) page */
+ list = g_list_first (notebook->children);
+ if (!find_visible)
+ return list;
+ while (list)
+ {
+ page = list->data;
+ if (GTK_WIDGET_VISIBLE (page->child))
+ return list;
+ list = list->next;
+ }
+ }
+
return NULL;
}
@@ -2850,6 +3019,7 @@
gint gap_x = 0, gap_width = 0, step = STEP_PREV;
gboolean is_rtl;
gint tab_pos;
+ gboolean paint_box_gap = FALSE;
g_return_if_fail (GTK_IS_NOTEBOOK (widget));
g_return_if_fail (area != NULL);
@@ -2933,15 +3103,37 @@
step = STEP_PREV;
break;
}
- gtk_paint_box_gap (widget->style, widget->window,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- area, widget, "notebook",
- x, y, width, height,
- tab_pos, gap_x, gap_width);
+
+ /* hildon hack to postpone painting until it
+ is known if scroll arrows will be drawn */
+ paint_box_gap = TRUE;
}
+ /* first, figure out if arrows should be drawn */
showarrow = FALSE;
children = gtk_notebook_search_page (notebook, NULL, step, TRUE);
+ while (children && !showarrow)
+ {
+ page = children->data;
+ children = gtk_notebook_search_page (notebook, children,
+ step, TRUE);
+ if (!GTK_WIDGET_MAPPED (page->tab_label))
+ showarrow = TRUE;
+ }
+
+ /* then draw content area frame */
+ if (paint_box_gap)
+ gtk_paint_box_gap (widget->style, widget->window,
+ GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ area, widget,
+ (showarrow && notebook->scrollable)
+ ? "notebook_show_arrow"
+ : "notebook",
+ x, y, width, height,
+ tab_pos, gap_x, gap_width);
+
+ /* and finally draw tabs */
+ children = gtk_notebook_search_page (notebook, NULL, step, TRUE);
while (children)
{
page = children->data;
@@ -3069,10 +3261,15 @@
GdkRectangle arrow_rect;
GtkArrowType arrow;
gboolean is_rtl, left;
+ gint arrow_width, arrow_height;
gtk_notebook_get_arrow_rect (notebook, &arrow_rect, nbarrow);
widget = GTK_WIDGET (notebook);
+ gtk_widget_style_get (widget,
+ "arrow-width", &arrow_width,
+ "arrow-height", &arrow_height,
+ NULL);
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
left = (ARROW_IS_LEFT (nbarrow) && !is_rtl) ||
@@ -3112,7 +3309,7 @@
gtk_paint_arrow (widget->style, widget->window, state_type,
shadow_type, NULL, widget, "notebook",
arrow, TRUE, arrow_rect.x, arrow_rect.y,
- ARROW_SIZE, ARROW_SIZE);
+ arrow_width, arrow_height);
}
}
@@ -3143,13 +3340,25 @@
gboolean is_rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL &&
(tab_pos == GTK_POS_TOP || tab_pos == GTK_POS_BOTTOM));
gint memo_x;
+ gboolean truncate = FALSE;
+ gint arrow_width, arrow_height, arrow_spacing, tab_overlap;
+ gint total_width, ideal_tab_width, n_expanding_tabs;
if (!notebook->show_tabs || !notebook->children || !notebook->cur_page)
return;
+ gtk_widget_style_get (widget,
+ "arrow-width", &arrow_width,
+ "arrow-height", &arrow_height,
+ "arrow-spacing", &arrow_spacing,
+ "tab-overlap", &tab_overlap,
+ NULL);
+
child_allocation.x = widget->allocation.x + container->border_width;
child_allocation.y = widget->allocation.y + container->border_width;
+ total_width = allocation->width - 2 * container->border_width - tab_overlap;
+
switch (tab_pos)
{
case GTK_POS_BOTTOM:
@@ -3198,27 +3407,26 @@
if (GTK_WIDGET_VISIBLE (page->child))
tab_space += page->requisition.width;
}
- if (tab_space >
- allocation->width - 2 * container->border_width - TAB_OVERLAP)
+ if (tab_space > total_width)
{
showarrow = TRUE;
page = focus_tab->data;
- tab_space = allocation->width - TAB_OVERLAP -
+ tab_space = allocation->width - tab_overlap -
page->requisition.width - 2 * container->border_width;
if (notebook->has_after_previous)
- tab_space -= ARROW_SPACING + ARROW_SIZE;
+ tab_space -= arrow_spacing + arrow_width;
if (notebook->has_after_next)
- tab_space -= ARROW_SPACING + ARROW_SIZE;
+ tab_space -= arrow_spacing + arrow_width;
if (notebook->has_before_previous)
{
- tab_space -= ARROW_SPACING + ARROW_SIZE;
- child_allocation.x += ARROW_SPACING + ARROW_SIZE;
+ tab_space -= arrow_spacing + arrow_width;
+ child_allocation.x += arrow_spacing + arrow_width;
}
if (notebook->has_before_next)
{
- tab_space -= ARROW_SPACING + ARROW_SIZE;
- child_allocation.x += ARROW_SPACING + ARROW_SIZE;
+ tab_space -= arrow_spacing + arrow_width;
+ child_allocation.x += arrow_spacing + arrow_width;
}
}
break;
@@ -3233,19 +3441,19 @@
tab_space += page->requisition.height;
}
if (tab_space >
- (allocation->height - 2 * container->border_width - TAB_OVERLAP))
+ (allocation->height - 2 * container->border_width - tab_overlap))
{
showarrow = TRUE;
page = focus_tab->data;
tab_space = allocation->height
- - TAB_OVERLAP - 2 * container->border_width
+ - tab_overlap - 2 * container->border_width
- page->requisition.height;
if (notebook->has_after_previous || notebook->has_after_next)
- tab_space -= ARROW_SPACING + ARROW_SIZE;
+ tab_space -= arrow_spacing + arrow_height;
if (notebook->has_before_previous || notebook->has_before_next)
{
- tab_space -= ARROW_SPACING + ARROW_SIZE;
- child_allocation.y += ARROW_SPACING + ARROW_SIZE;
+ tab_space -= arrow_spacing + arrow_height;
+ child_allocation.y += arrow_spacing + arrow_height;
}
}
break;
@@ -3257,6 +3465,10 @@
notebook->first_tab = focus_tab;
last_child = gtk_notebook_search_page (notebook, focus_tab,
STEP_NEXT, TRUE);
+
+ /* Hildon: there is only one visible tab label
+ and it doesn't fit unless it is truncated */
+ truncate = TRUE;
}
else
{
@@ -3413,7 +3625,7 @@
}
tab_space -= allocation->height;
}
- tab_space += 2 * container->border_width + TAB_OVERLAP;
+ tab_space += 2 * container->border_width + tab_overlap;
tab_space *= -1;
notebook->first_tab = gtk_notebook_search_page (notebook, NULL,
STEP_NEXT, TRUE);
@@ -3432,12 +3644,29 @@
if (showarrow)
{
if (notebook->has_after_previous)
- child_allocation.x -= ARROW_SPACING + ARROW_SIZE;
+ child_allocation.x -= arrow_spacing + arrow_width;
if (notebook->has_after_next)
- child_allocation.x -= ARROW_SPACING + ARROW_SIZE;
+ child_allocation.x -= arrow_spacing + arrow_width;
}
}
+ ideal_tab_width = (total_width / n);
+ n_expanding_tabs = 0;
+
+ while (children)
+ {
+ if (children == last_child)
+ break;
+
+ page = children->data;
+ children = gtk_notebook_search_page (notebook, children, STEP_NEXT,TRUE);
+
+ if (page->requisition.width <= ideal_tab_width)
+ n_expanding_tabs++;
+ }
+
+ children = notebook->first_tab;
+
while (children)
{
if (children == last_child)
@@ -3452,9 +3681,11 @@
children = gtk_notebook_search_page (notebook, children, STEP_NEXT,TRUE);
delta = 0;
- if (n && (showarrow || page->expand || notebook->homogeneous))
+
+ if (n && (showarrow || page->expand || notebook->homogeneous) &&
+ (page->requisition.width <= ideal_tab_width))
{
- new_fill = (tab_space * i++) / n;
+ new_fill = (tab_space * i++) / n_expanding_tabs;
delta = new_fill - old_fill;
old_fill = new_fill;
}
@@ -3463,15 +3694,18 @@
{
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
+ if (truncate)
+ delta *= -1;
+
child_allocation.width = (page->requisition.width +
- TAB_OVERLAP + delta);
+ tab_overlap + delta);
if (is_rtl)
child_allocation.x -= child_allocation.width;
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
child_allocation.height = (page->requisition.height +
- TAB_OVERLAP + delta);
+ tab_overlap + delta);
break;
}
@@ -3482,13 +3716,13 @@
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
if (!is_rtl)
- child_allocation.x += child_allocation.width - TAB_OVERLAP;
+ child_allocation.x += child_allocation.width - tab_overlap;
else
- child_allocation.x += TAB_OVERLAP;
+ child_allocation.x += tab_overlap;
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
- child_allocation.y += child_allocation.height - TAB_OVERLAP;
+ child_allocation.y += child_allocation.height - tab_overlap;
break;
}
@@ -3538,14 +3772,14 @@
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
child_allocation.width = (page->requisition.width +
- TAB_OVERLAP + delta);
+ tab_overlap + delta);
if (!is_rtl)
child_allocation.x -= child_allocation.width;
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
child_allocation.height = (page->requisition.height +
- TAB_OVERLAP + delta);
+ tab_overlap + delta);
child_allocation.y -= child_allocation.height;
break;
}
@@ -3557,13 +3791,13 @@
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
if (!is_rtl)
- child_allocation.x += TAB_OVERLAP;
+ child_allocation.x += tab_overlap;
else
- child_allocation.x += child_allocation.width - TAB_OVERLAP;
+ child_allocation.x += child_allocation.width - tab_overlap;
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
- child_allocation.y += TAB_OVERLAP;
+ child_allocation.y += tab_overlap;
break;
}
@@ -3589,8 +3823,12 @@
gint padding;
gint focus_width;
gint tab_pos = get_effective_tab_pos (notebook);
+ gint tab_curvature;
- gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
+ gtk_widget_style_get (widget,
+ "focus-line-width", &focus_width,
+ "tab-curvature", &tab_curvature,
+ NULL);
xthickness = widget->style->xthickness;
ythickness = widget->style->ythickness;
@@ -3621,7 +3859,7 @@
{
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
- padding = TAB_CURVATURE + focus_width + notebook->tab_hborder;
+ padding = tab_curvature + focus_width + notebook->tab_hborder;
if (page->fill)
{
child_allocation.x = (xthickness + focus_width +
@@ -3646,7 +3884,7 @@
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
- padding = TAB_CURVATURE + focus_width + notebook->tab_vborder;
+ padding = tab_curvature + focus_width + notebook->tab_vborder;
if (page->fill)
{
child_allocation.y = ythickness + padding;
@@ -4340,7 +4578,7 @@
}
page->tab_label = tab_label;
page->menu_label = menu_label;
- page->expand = FALSE;
+ page->expand = TRUE;
page->fill = TRUE;
page->pack = GTK_PACK_START;
@@ -5046,6 +5284,7 @@
{
page->default_tab = FALSE;
page->tab_label = tab_label;
+
gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
}
else

View File

@ -0,0 +1,20 @@
--- gtk+-2.6.4/gtk/gtkprogress.c 2004-10-28 18:00:04.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkprogress.c 2005-04-06 16:19:37.066903336 +0300
@@ -371,6 +371,17 @@
widget->allocation.width,
widget->allocation.height,
-1);
+
+ /* OSSO addition : clear the pixmap first or transparent images
+ * painted on top of it may look stupid when it's blended against
+ * random memory.*/
+ gtk_paint_flat_box (widget->style,
+ progress->offscreen_pixmap,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_NONE,
+ NULL, widget, NULL,
+ 0, 0, widget->allocation.width, widget->allocation.height);
+
GTK_PROGRESS_GET_CLASS (progress)->paint (progress);
}
}

View File

@ -0,0 +1,141 @@
--- gtk+-2.6.4/gtk/gtkprogressbar.c 2005-01-09 19:32:25.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkprogressbar.c 2005-04-06 16:19:37.112896344 +0300
@@ -40,11 +40,18 @@
#define MIN_HORIZONTAL_BAR_WIDTH 150
-#define MIN_HORIZONTAL_BAR_HEIGHT 20
+#define MIN_HORIZONTAL_BAR_HEIGHT 30 /* OSSO mod. was 20 */
#define MIN_VERTICAL_BAR_WIDTH 22
#define MIN_VERTICAL_BAR_HEIGHT 80
#define MAX_TEXT_LENGTH 80
-#define TEXT_SPACING 2
+#define DEFAULT_TEXT_SPACING 2 /* OSSO mod. Changed from
+ * TEXT_SPACING. Now controlled
+ * by "text-spacing" style
+ * property */
+#define DEFAULT_WIDTH_INCREMENT 3
+#define DEFAULT_HEIGHT_INCREMENT 3
+#define DEFAULT_TEXT_XNUDGE 1
+#define DEFAULT_TEXT_YNUDGE 1
enum {
PROP_0,
@@ -245,6 +252,51 @@
PANGO_ELLIPSIZE_NONE,
G_PARAM_READWRITE));
+ /* OSSO addition. */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("text-spacing",
+ "Text Spacing",
+ "The amount of pixels between the trough and text.",
+ G_MININT,
+ G_MAXINT,
+ DEFAULT_TEXT_SPACING,
+ G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("width-increment",
+ "width Increment",
+ "The amount of pixels to add to the width size request.",
+ G_MININT,
+ G_MAXINT,
+ DEFAULT_WIDTH_INCREMENT,
+ G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("height-increment",
+ "Height Increment",
+ "The amount of pixels to add to the height size request.",
+ G_MININT,
+ G_MAXINT,
+ DEFAULT_WIDTH_INCREMENT,
+ G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("text-xnudge",
+ "Text XNudge",
+ "Amount of pixels to move the text x position.",
+ G_MININT,
+ G_MAXINT,
+ DEFAULT_TEXT_XNUDGE,
+ G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("text-ynudge",
+ "Text YNudge",
+ "Amount of pixels to move the text y position.",
+ G_MININT,
+ G_MAXINT,
+ DEFAULT_TEXT_YNUDGE,
+ G_PARAM_READWRITE));
}
static void
@@ -364,7 +416,9 @@
{
GtkWidget *pbar;
- pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR, NULL);
+ pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR,
+ "text-xalign", 0.0, /* OSSO addition. */
+ NULL);
return pbar;
}
@@ -494,15 +548,23 @@
PangoRectangle logical_rect;
PangoLayout *layout;
gint width, height;
+ gint text_spacing;
+ gint width_increment, height_increment;
g_return_if_fail (GTK_IS_PROGRESS_BAR (widget));
g_return_if_fail (requisition != NULL);
+
+ gtk_widget_style_get (widget,
+ "text-spacing", &text_spacing,
+ "width-increment", &width_increment,
+ "height-increment", &height_increment,
+ NULL);
progress = GTK_PROGRESS (widget);
pbar = GTK_PROGRESS_BAR (widget);
- width = 2 * widget->style->xthickness + 3 + 2 * TEXT_SPACING;
- height = 2 * widget->style->ythickness + 3 + 2 * TEXT_SPACING;
+ width = 2 * widget->style->xthickness + width_increment + 2 * text_spacing;
+ height = 2 * widget->style->ythickness + height_increment + 2 * text_spacing;
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
@@ -780,6 +842,13 @@
PangoRectangle logical_rect;
GdkRectangle prelight_clip, normal_clip;
+ gint text_xnudge, text_ynudge;
+
+ gtk_widget_style_get (widget,
+ "text-xnudge", &text_xnudge,
+ "text-ynudge", &text_ynudge,
+ NULL);
+
buf = gtk_progress_get_current_text (progress);
layout = gtk_widget_create_pango_layout (widget, buf);
@@ -789,12 +858,12 @@
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
- x = widget->style->xthickness + 1 +
+ x = widget->style->xthickness + text_xnudge +
(widget->allocation.width - 2 * widget->style->xthickness -
2 - logical_rect.width)
* progress->x_align;
- y = widget->style->ythickness + 1 +
+ y = widget->style->ythickness + text_ynudge +
(widget->allocation.height - 2 * widget->style->ythickness -
2 - logical_rect.height)
* progress->y_align;

View File

@ -0,0 +1,244 @@
--- gtk+-2.6.4/gtk/gtkradiobutton.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkradiobutton.c 2005-04-06 16:19:37.126894216 +0300
@@ -31,6 +31,7 @@
#include "gtkradiobutton.h"
#include "gtkintl.h"
+#define TOGGLE_ON_CLICK "toggle-on-click"
enum {
PROP_0,
@@ -506,6 +507,9 @@
{
tmp_list = tmp_list->next;
+ if( !tmp_list )
+ return FALSE;
+
while (tmp_list)
{
GtkWidget *child = tmp_list->data;
@@ -543,7 +547,10 @@
if (new_focus)
{
gtk_widget_grab_focus (new_focus);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
+
+ /* arrow keys select the button ? CHECK THIS!!
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
+ */
}
return TRUE;
@@ -579,7 +586,7 @@
GtkToggleButton *toggle_button;
GtkRadioButton *radio_button;
GtkToggleButton *tmp_button;
- GtkStateType new_state;
+ GtkStateType new_state = GTK_WIDGET_STATE( button );
GSList *tmp_list;
gint toggled;
gboolean depressed;
@@ -591,52 +598,54 @@
g_object_ref (GTK_WIDGET (button));
if (toggle_button->active)
- {
- tmp_button = NULL;
- tmp_list = radio_button->group;
-
- while (tmp_list)
- {
- tmp_button = tmp_list->data;
- tmp_list = tmp_list->next;
+ {
+ tmp_button = NULL;
+ tmp_list = radio_button->group;
- if (tmp_button->active && tmp_button != toggle_button)
- break;
+ while (tmp_list)
+ {
+ tmp_button = tmp_list->data;
+ tmp_list = tmp_list->next;
+
+ if (tmp_button->active && tmp_button != toggle_button)
+ break;
- tmp_button = NULL;
- }
+ tmp_button = NULL;
+ }
- if (!tmp_button)
- {
- new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
+ if (!tmp_button)
+ {
+ new_state = (button->in_button ?
+ GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
+ }
+ else
+ {
+ toggled = TRUE;
+ toggle_button->active = !toggle_button->active;
+ new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL);
+ }
}
else
{
toggled = TRUE;
toggle_button->active = !toggle_button->active;
- new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL);
- }
- }
- else
- {
- toggled = TRUE;
- toggle_button->active = !toggle_button->active;
- tmp_list = radio_button->group;
- while (tmp_list)
- {
- tmp_button = tmp_list->data;
- tmp_list = tmp_list->next;
-
- if (tmp_button->active && (tmp_button != toggle_button))
+ tmp_list = radio_button->group;
+ while (tmp_list)
{
- gtk_button_clicked (GTK_BUTTON (tmp_button));
- break;
+ tmp_button = tmp_list->data;
+ tmp_list = tmp_list->next;
+
+ if (tmp_button->active && (tmp_button != toggle_button))
+ {
+ gtk_button_clicked (GTK_BUTTON (tmp_button));
+ break;
+ }
}
+
+ new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
}
- new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
- }
if (toggle_button->inconsistent)
depressed = FALSE;
@@ -663,7 +672,6 @@
GdkRectangle *area)
{
GtkWidget *widget;
- GtkWidget *child;
GtkButton *button;
GtkToggleButton *toggle_button;
GtkStateType state_type;
@@ -686,54 +694,80 @@
"focus-padding", &focus_pad,
NULL);
- _gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
-
- x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
- y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
-
- child = GTK_BIN (check_button)->child;
- if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child)))
- x += focus_width + focus_pad;
+ _gtk_check_button_get_props (check_button,
+ &indicator_size, &indicator_spacing);
+ x = widget->allocation.x + indicator_spacing +
+ GTK_CONTAINER (widget)->border_width;
+ y = widget->allocation.y + (widget->allocation.height -
+ indicator_size + focus_width +
+ focus_pad) / 2;
+
+ /* Hildon - always add space for the padding
+ */
+ x += focus_width + focus_pad;
+
if (toggle_button->inconsistent)
- shadow_type = GTK_SHADOW_ETCHED_IN;
+ shadow_type = GTK_SHADOW_ETCHED_IN;
+
else if (toggle_button->active)
- shadow_type = GTK_SHADOW_IN;
+ shadow_type = GTK_SHADOW_IN;
+
else
- shadow_type = GTK_SHADOW_OUT;
+ shadow_type = GTK_SHADOW_OUT;
+
+ if (button->activate_timeout ||
+ (button->button_down && button->in_button) )
+ state_type = GTK_STATE_ACTIVE;
- if (button->activate_timeout || (button->button_down && button->in_button))
- state_type = GTK_STATE_ACTIVE;
else if (button->in_button)
- state_type = GTK_STATE_PRELIGHT;
+ state_type = GTK_STATE_PRELIGHT;
+
else if (!GTK_WIDGET_IS_SENSITIVE (widget))
state_type = GTK_STATE_INSENSITIVE;
+
else
- state_type = GTK_STATE_NORMAL;
+ state_type = GTK_STATE_NORMAL;
+ /* Hildon change. We want to draw active image always when we have
+ * focus. */
+ if (GTK_WIDGET_HAS_FOCUS (widget))
+ state_type = GTK_STATE_ACTIVE;
+
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- x = widget->allocation.x + widget->allocation.width - (indicator_size + x - widget->allocation.x);
-
+ {
+ x = widget->allocation.x + widget->allocation.width -
+ (indicator_size + x - widget->allocation.x);
+ }
+ /* Well, commenting this out fixes bug #280,
+ without apparent side effects.
+ *
if (GTK_WIDGET_STATE (toggle_button) == GTK_STATE_PRELIGHT)
{
GdkRectangle restrict_area;
GdkRectangle new_area;
- restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
- restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
- restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width);
- restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width);
+ restrict_area.x = widget->allocation.x +
+ GTK_CONTAINER (widget)->border_width;
+ restrict_area.y = widget->allocation.y +
+ GTK_CONTAINER (widget)->border_width;
+ restrict_area.width = widget->allocation.width -
+ (2 * GTK_CONTAINER (widget)->border_width);
+ restrict_area.height = widget->allocation.height -
+ (2 * GTK_CONTAINER (widget)->border_width);
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
{
- gtk_paint_flat_box (widget->style, widget->window, GTK_STATE_PRELIGHT,
- GTK_SHADOW_ETCHED_OUT,
- area, widget, "checkbutton",
- new_area.x, new_area.y,
- new_area.width, new_area.height);
+ gtk_paint_flat_box (widget->style, widget->window,
+ GTK_STATE_PRELIGHT,
+ GTK_SHADOW_ETCHED_OUT,
+ area, widget, "checkbutton",
+ new_area.x, new_area.y,
+ new_area.width, new_area.height);
}
}
+ */
gtk_paint_option (widget->style, widget->window,
state_type, shadow_type,
area, widget, "radiobutton",

View File

@ -0,0 +1,845 @@
--- gtk+-2.6.4/gtk/gtkrange.c 2004-11-10 05:20:11.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkrange.c 2005-04-06 16:19:37.788793592 +0300
@@ -25,6 +25,10 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list
+ * of changes.
+ */
+
#include <config.h>
#include <stdio.h>
#include <math.h>
@@ -44,7 +48,10 @@
PROP_0,
PROP_UPDATE_POLICY,
PROP_ADJUSTMENT,
- PROP_INVERTED
+ PROP_INVERTED,
+ PROP_STREAM_INDICATOR,
+ PROP_MINIMUM_VISIBLE_BARS,
+ PROP_STREAM_POSITION
};
enum {
@@ -88,8 +95,20 @@
/* "grabbed" mouse location, OUTSIDE for no grab */
MouseLocation grab_location;
gint grab_button; /* 0 if none */
+
+ /* OSSO hack: stream trough split position */
+ gint stream_pixel_position;
+ gint minimum_visible_bars;
};
+#define OSSO_GTK_RANGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_RANGE, OssoGtkRangePrivate))
+typedef struct _OssoGtkRangePrivate OssoGtkRangePrivate;
+
+struct _OssoGtkRangePrivate
+{
+ gboolean stream_indicator;
+ gdouble stream_position;
+};
static void gtk_range_class_init (GtkRangeClass *klass);
static void gtk_range_init (GtkRange *range);
@@ -135,6 +154,7 @@
gint mouse_x,
gint mouse_y);
+static gint osso_gtk_range_focus_out (GtkWidget *widget, GdkEventFocus *event);
/* Range methods */
@@ -247,6 +267,9 @@
widget_class->state_changed = gtk_range_state_changed;
widget_class->style_set = gtk_range_style_set;
+ /* OSSO addition (see bug #1653) */
+ widget_class->focus_out_event = osso_gtk_range_focus_out;
+
class->move_slider = gtk_range_move_slider;
class->change_value = gtk_range_real_change_value;
@@ -344,6 +367,34 @@
FALSE,
G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_STREAM_INDICATOR,
+ g_param_spec_boolean ("stream_indicator",
+ P_("Stream Indicator"),
+ P_("Whether to display a stream indicator graphics on trough."),
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (gobject_class,
+ PROP_MINIMUM_VISIBLE_BARS,
+ g_param_spec_int ("minimum_visible_bars",
+ P_("Minimum visible bars"),
+ P_("The minimum number of visible bars in a HildonControlBar"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class,
+ PROP_STREAM_POSITION,
+ g_param_spec_double ("stream_position",
+ P_("Stream Position"),
+ P_("The position of the streaming."),
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("slider_width",
P_("Slider Width"),
@@ -392,6 +443,52 @@
G_MAXINT,
0,
G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("hildonlike",
+ _("hildonlike"),
+ _("Change focus out behaviour, 1/0"),
+ FALSE,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("two_part_trough",
+ _("Two-part trough"),
+ _("Allow different trough graphics on different sides of the slider, 1/0"),
+ FALSE,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("stream_indicator_padding",
+ P_("Stream Indicator Padding"),
+ P_("How many pixels smallerthan the trough the stream indicator is drawn from both ends ."),
+ 0,
+ G_MAXINT,
+ 1,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("autodimmed_steppers",
+ _("Autodimmed steppers"),
+ _("Automatically dim steppers when maximum or minimum value has been reached"),
+ FALSE,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("arrow_paint_box_layout",
+ _("Arrow paint box layout"),
+ _("Allows to use images instead of normal arrows."),
+ FALSE,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("draw_trough_under_steppers",
+ _("Draw trough under steppers"),
+ _("Whether to draw trought for full length of range or exclude the steppers and spacing"),
+ TRUE,
+ G_PARAM_READABLE));
+
+ g_type_class_add_private (gobject_class, sizeof (OssoGtkRangePrivate));
}
static void
@@ -415,6 +512,15 @@
case PROP_INVERTED:
gtk_range_set_inverted (range, g_value_get_boolean (value));
break;
+ case PROP_STREAM_INDICATOR:
+ osso_gtk_range_set_stream_indicator (range, g_value_get_boolean (value));
+ break;
+ case PROP_STREAM_POSITION:
+ osso_gtk_range_set_stream_position (range, g_value_get_double (value));
+ break;
+ case PROP_MINIMUM_VISIBLE_BARS:
+ range->layout->minimum_visible_bars = g_value_get_int(value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -442,6 +548,15 @@
case PROP_INVERTED:
g_value_set_boolean (value, range->inverted);
break;
+ case PROP_STREAM_INDICATOR:
+ g_value_set_boolean (value, osso_gtk_range_get_stream_indicator (range));
+ break;
+ case PROP_STREAM_POSITION:
+ g_value_set_double (value, osso_gtk_range_get_stream_indicator (range));
+ break;
+ case PROP_MINIMUM_VISIBLE_BARS:
+ g_value_set_int (value, range->layout->minimum_visible_bars);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -451,6 +566,7 @@
static void
gtk_range_init (GtkRange *range)
{
+ OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
GTK_WIDGET_SET_FLAGS (range, GTK_NO_WINDOW);
range->adjustment = NULL;
@@ -471,6 +587,9 @@
range->layout->grab_location = MOUSE_OUTSIDE;
range->layout->grab_button = 0;
range->timer = NULL;
+
+ priv->stream_indicator = FALSE;
+ priv->stream_position = 0.0;
}
/**
@@ -584,7 +703,10 @@
g_signal_connect (adjustment, "changed",
G_CALLBACK (gtk_range_adjustment_changed),
range);
- g_signal_connect (adjustment, "value_changed",
+ /* OSSO modification : Changed for controlbar.
+ * There we intercept this signal and put forth
+ * our own, with modified parameters. */
+ g_signal_connect_after (adjustment, "value_changed",
G_CALLBACK (gtk_range_adjustment_value_changed),
range);
@@ -677,16 +799,21 @@
gdouble max)
{
gdouble value;
+ OssoGtkRangePrivate *priv;
g_return_if_fail (GTK_IS_RANGE (range));
g_return_if_fail (min < max);
+ priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+
range->adjustment->lower = min;
range->adjustment->upper = max;
value = CLAMP (range->adjustment->value,
range->adjustment->lower,
(range->adjustment->upper - range->adjustment->page_size));
+ if (priv->stream_indicator && value > priv->stream_position)
+ value = (gdouble)priv->stream_position;
gtk_adjustment_set_value (range->adjustment, value);
gtk_adjustment_changed (range->adjustment);
@@ -707,10 +834,16 @@
gtk_range_set_value (GtkRange *range,
gdouble value)
{
+ OssoGtkRangePrivate *priv;
+
g_return_if_fail (GTK_IS_RANGE (range));
+ priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+
value = CLAMP (value, range->adjustment->lower,
(range->adjustment->upper - range->adjustment->page_size));
+ if (priv->stream_indicator && value > priv->stream_position)
+ value = (gdouble)priv->stream_position;
gtk_adjustment_set_value (range->adjustment, value);
}
@@ -913,6 +1046,10 @@
gint arrow_width;
gint arrow_height;
+ /* OSSO modification: state of our style properties */
+ gboolean autodimmed_steppers = FALSE;
+ gboolean arrow_paint_box_layout = FALSE;
+
/* More to get the right clip region than for efficiency */
if (!gdk_rectangle_intersect (area, rect, &intersection))
return;
@@ -929,6 +1066,37 @@
else
state_type = GTK_STATE_NORMAL;
+ /* OSSO modification : read all of our style properties needed in this func */
+ gtk_widget_style_get (widget,
+ "autodimmed_steppers", &autodimmed_steppers,
+ "arrow_paint_box_layout", &arrow_paint_box_layout,
+ NULL);
+
+ /* OSSO modification : dim the stepper if maximum or minimum value has been reached */
+ if (autodimmed_steppers)
+ {
+ OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+ if (((!range->inverted && (arrow_type == GTK_ARROW_DOWN ||
+ arrow_type == GTK_ARROW_RIGHT)) ||
+ (range->inverted && (arrow_type == GTK_ARROW_UP ||
+ arrow_type == GTK_ARROW_LEFT))) &&
+ range->adjustment->value >=
+ (priv->stream_indicator
+ ? priv->stream_position
+ : range->adjustment->upper - range->adjustment->page_size))
+ {
+ state_type = GTK_STATE_INSENSITIVE;
+ }
+ else if (((!range->inverted && (arrow_type == GTK_ARROW_UP ||
+ arrow_type == GTK_ARROW_LEFT)) ||
+ (range->inverted && (arrow_type == GTK_ARROW_DOWN ||
+ arrow_type == GTK_ARROW_RIGHT))) &&
+ range->adjustment->value <= range->adjustment->lower)
+ {
+ state_type = GTK_STATE_INSENSITIVE;
+ }
+ }
+
if (clicked)
shadow_type = GTK_SHADOW_IN;
else
@@ -944,10 +1112,20 @@
rect->width,
rect->height);
- arrow_width = rect->width / 2;
- arrow_height = rect->height / 2;
- arrow_x = widget->allocation.x + rect->x + (rect->width - arrow_width) / 2;
- arrow_y = widget->allocation.y + rect->y + (rect->height - arrow_height) / 2;
+ if (arrow_paint_box_layout)
+ {
+ arrow_width = rect->width;
+ arrow_height = rect->height;
+ arrow_x = widget->allocation.x + rect->x;
+ arrow_y = widget->allocation.y + rect->y;
+ }
+ else
+ {
+ arrow_width = rect->width / 2;
+ arrow_height = rect->height / 2;
+ arrow_x = widget->allocation.x + rect->x + (rect->width - arrow_width) / 2;
+ arrow_y = widget->allocation.y + rect->y + (rect->height - arrow_height) / 2;
+ }
if (clicked)
{
@@ -982,8 +1160,11 @@
GdkRectangle area;
gint focus_line_width = 0;
gint focus_padding = 0;
+ OssoGtkRangePrivate *priv;
range = GTK_RANGE (widget);
+
+ priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
if (GTK_WIDGET_CAN_FOCUS (range))
{
@@ -1011,18 +1192,118 @@
if (gdk_rectangle_intersect (&expose_area, &range->range_rect,
&area))
{
+ gint x = widget->allocation.x + range->range_rect.x + focus_line_width + focus_padding;
+ gint y = widget->allocation.y + range->range_rect.y + focus_line_width + focus_padding;
+ gint width = range->range_rect.width - 2 * (focus_line_width + focus_padding);
+ gint height = range->range_rect.height - 2 * (focus_line_width + focus_padding);
+ gint *virtual_position, *virtual_size;
+ gboolean two_part_trough = 0;
+ gint stepper_size = 0;
+ gint stepper_spacing = 0;
+ gboolean draw_trough_under_steppers = TRUE;
+
area.x += widget->allocation.x;
area.y += widget->allocation.y;
+
+ gtk_widget_style_get (GTK_WIDGET (range),
+ "two_part_trough", &two_part_trough,
+ "stepper_size", &stepper_size,
+ "stepper_spacing", &stepper_spacing,
+ "draw_trough_under_steppers", &draw_trough_under_steppers,
+ NULL);
+
+ if (range->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ virtual_position = &x;
+ virtual_size = &width;
+ }
+ else
+ {
+ virtual_position = &y;
+ virtual_size = &height;
+ }
+
+ if (draw_trough_under_steppers == FALSE)
+ {
+ *virtual_position += stepper_size + stepper_spacing;
+ *virtual_size -= 2 * (stepper_size + stepper_spacing);
+ }
- gtk_paint_box (widget->style,
- widget->window,
- sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
- GTK_SHADOW_IN,
- &area, GTK_WIDGET(range), "trough",
- widget->allocation.x + range->range_rect.x + focus_line_width + focus_padding,
- widget->allocation.y + range->range_rect.y + focus_line_width + focus_padding,
- range->range_rect.width - 2 * (focus_line_width + focus_padding),
- range->range_rect.height - 2 * (focus_line_width + focus_padding));
+ if (two_part_trough == FALSE)
+ {
+ gtk_paint_box (widget->style,
+ widget->window,
+ sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
+ GTK_SHADOW_IN,
+ &area, GTK_WIDGET(range), "trough",
+ x, y,
+ width, height);
+ }
+ else
+ {
+ gint trough_change_pos_x = width;
+ gint trough_change_pos_y = height;
+
+ if (range->orientation == GTK_ORIENTATION_HORIZONTAL)
+ trough_change_pos_x = range->layout->slider.x + (range->layout->slider.width / 2) - stepper_size - stepper_spacing;
+ else
+ trough_change_pos_y = range->layout->slider.y + (range->layout->slider.height / 2) - stepper_size - stepper_spacing;
+
+ gtk_paint_box (widget->style,
+ widget->window,
+ sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
+ GTK_SHADOW_IN,
+ &area, GTK_WIDGET(range), "trough_northwest",
+ x, y,
+ trough_change_pos_x, trough_change_pos_y);
+
+ if (range->orientation == GTK_ORIENTATION_HORIZONTAL)
+ trough_change_pos_y = 0;
+ else
+ trough_change_pos_x = 0;
+
+ gtk_paint_box (widget->style,
+ widget->window,
+ sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
+ GTK_SHADOW_IN,
+ &area, GTK_WIDGET(range), "trough_southeast",
+ x + trough_change_pos_x, y + trough_change_pos_y,
+ width - trough_change_pos_x, height - trough_change_pos_y);
+ }
+
+ /* Stream indicator drawing does not support inverted state. */
+ if (priv->stream_indicator)
+ {
+ gchar *used_detail;
+ gint stream_start_pos_x = 0;
+ gint stream_start_pos_y = 0;
+ gint stream_width = width;
+ gint stream_height = height;
+
+ if (range->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ stream_start_pos_x = range->layout->slider.x;
+ stream_width = range->layout->stream_pixel_position - stream_start_pos_x;
+ }
+ else
+ {
+ stream_start_pos_y = range->layout->slider.y;
+ stream_height = range->layout->stream_pixel_position - stream_start_pos_y;
+ }
+
+ if (priv->stream_position == range->adjustment->upper)
+ used_detail = "trough_stream_complete";
+ else
+ used_detail = "trough_stream";
+
+ gtk_paint_box (widget->style,
+ widget->window,
+ sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
+ GTK_SHADOW_IN,
+ &area, GTK_WIDGET(range), used_detail,
+ widget->allocation.x + stream_start_pos_x, widget->allocation.y + stream_start_pos_y,
+ stream_width, stream_height);
+ }
if (sensitive &&
@@ -1189,19 +1470,41 @@
{
gdouble frac;
gdouble value;
-
- if (range->orientation == GTK_ORIENTATION_VERTICAL)
+ gint stepper_spacing = 0;
+ gint minimum_visible_blocks = 0;
+ gint magic_value = 0;
+
+ g_object_get(range, "minimum_visible_bars", &minimum_visible_blocks, NULL);
+
+ g_print("coord = %d\n", coord);
+ gtk_widget_style_get (GTK_WIDGET (range),
+ "stepper_spacing", &stepper_spacing,
+ NULL);
+
+ if (range->orientation == GTK_ORIENTATION_VERTICAL) {
+ if (minimum_visible_blocks > 0)
+ magic_value = ((range->layout->trough.height -(2*stepper_spacing)) / (range->adjustment->upper - range->adjustment->lower + 1)) * minimum_visible_blocks;
if (range->layout->trough.height == range->layout->slider.height)
frac = 1.0;
else
- frac = ((coord - range->layout->trough.y) /
- (gdouble) (range->layout->trough.height - range->layout->slider.height));
- else
+ frac = ((coord - range->layout->trough.y - magic_value - stepper_spacing) /
+ (gdouble) (range->layout->trough.height - magic_value - range->layout->slider.height - (2 * stepper_spacing)));
+ }
+ else {
+ if (minimum_visible_blocks > 0)
+ magic_value = ((range->layout->trough.width -(2*stepper_spacing)) / (range->adjustment->upper - range->adjustment->lower + 1)) * minimum_visible_blocks;
if (range->layout->trough.width == range->layout->slider.width)
frac = 1.0;
else
- frac = ((coord - range->layout->trough.x) /
- (gdouble) (range->layout->trough.width - range->layout->slider.width));
+ frac = ((coord - range->layout->trough.x - magic_value - stepper_spacing) /
+ (gdouble) (range->layout->trough.width - magic_value - range->layout->slider.width - (2 * stepper_spacing)));
+ }
+
+ if (frac < 0.0)
+ frac = 0.0;
+ else
+ if (frac > 1.0)
+ frac = 1.0;
if (should_invert (range))
frac = 1.0 - frac;
@@ -1242,6 +1545,8 @@
range->orientation == GTK_ORIENTATION_VERTICAL ?
event->y : event->x);
+ g_print("button_press: calling coord_to_value with %d, click value = %d\n", event->x, click_value);
+
range->trough_click_forward = click_value > range->adjustment->value;
range_grab_add (range, MOUSE_TROUGH, event->button);
@@ -1286,7 +1591,9 @@
* On button 2 press, we warp the slider to mouse position,
* then begin the slider drag.
*/
- if (event->button == 2)
+ /* OSSO modification : We want this to be
+ * the default behaviour. */
+ if (range->layout->mouse_location == MOUSE_TROUGH)
{
gdouble slider_low_value, slider_high_value, new_value;
@@ -1299,7 +1606,10 @@
range->orientation == GTK_ORIENTATION_VERTICAL ?
event->y - range->layout->slider.height :
event->x - range->layout->slider.width);
-
+
+ g_print("calling coord_to_value with %d\n", event->x);
+ g_print("calling coord_to_value with %d\n", range->orientation == GTK_ORIENTATION_VERTICAL? event->y-range->layout->slider.height:event->x-range->layout->slider.width);
+
/* compute new value for warped slider */
new_value = slider_low_value + (slider_high_value - slider_low_value) / 2;
@@ -1353,8 +1663,10 @@
else
delta = mouse_x - range->slide_initial_coordinate;
+ delta += -4;
c = range->slide_initial_slider_position + delta;
+ g_print("delta = %d, calling coord_to_value with %d + delta = %d\n", delta, range->slide_initial_slider_position, c);
new_value = coord_to_value (range, c);
g_signal_emit (range, signals[CHANGE_VALUE], 0, GTK_SCROLL_JUMP, new_value,
@@ -1395,9 +1707,12 @@
if (range->layout->grab_button == event->button)
{
+ /* OSSO modification : Commented out.
+ * Not sure about the reason unfortunately. */
+/*
if (range->layout->grab_location == MOUSE_SLIDER)
update_slider_position (range, range->layout->mouse_x, range->layout->mouse_y);
-
+*/
stop_scrolling (range);
return TRUE;
@@ -2026,6 +2341,7 @@
GdkRectangle range_rect;
GtkRangeLayout *layout;
GtkWidget *widget;
+ gint minimum_visible_bars = 0;
if (!range->need_recalc)
return;
@@ -2047,6 +2363,8 @@
&slider_width, &stepper_size, &trough_border, &stepper_spacing,
NULL, NULL);
+ g_object_get(range, "minimum_visible_bars", &minimum_visible_bars, NULL);
+
gtk_range_calc_request (range,
slider_width, stepper_size, trough_border, stepper_spacing,
&range_rect, &border, &n_steppers, &slider_length);
@@ -2167,10 +2485,13 @@
/* Compute slider position/length */
{
gint y, bottom, top, height;
-
- top = layout->trough.y + stepper_spacing;
- bottom = layout->trough.y + layout->trough.height - stepper_spacing;
-
+ gint magic_value;
+
+ magic_value = (layout->trough.height / (range->adjustment->upper - range->adjustment->lower + 1));
+
+ top = layout->trough.y + stepper_spacing + (minimum_visible_bars * magic_value);
+ bottom = layout->trough.y + layout->trough.height - stepper_spacing;
+
/* slider height is the fraction (page_size /
* total_adjustment_range) times the trough height in pixels
*/
@@ -2307,8 +2628,11 @@
/* Compute slider position/length */
{
gint x, left, right, width;
+ gint magic_value;
+
+ magic_value = (layout->trough.width / (range->adjustment->upper - range->adjustment->lower + 1));
- left = layout->trough.x + stepper_spacing;
+ left = layout->trough.x + stepper_spacing + (minimum_visible_bars * magic_value);
right = layout->trough.x + layout->trough.width - stepper_spacing;
/* slider width is the fraction (page_size /
@@ -2340,6 +2664,32 @@
layout->slider.x = x;
layout->slider.width = width;
+
+ /* Hildon modification : Calculate the x point of streaming
+ * indicator.
+ */
+ {
+ gint stream_indicator_padding = 0;
+ OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+ gtk_widget_style_get (widget,
+ "stream_indicator_padding", &stream_indicator_padding,
+ NULL);
+
+ if (priv->stream_indicator == TRUE)
+ {
+ if (range->adjustment->upper - range->adjustment->lower != 0)
+ layout->stream_pixel_position =
+ (right - left - (2 * stream_indicator_padding)) *
+ ((priv->stream_position - range->adjustment->lower) /
+ (range->adjustment->upper - range->adjustment->lower)) +
+ left + stream_indicator_padding;
+ else
+ layout->stream_pixel_position = left + stream_indicator_padding;
+
+ if (layout->stream_pixel_position < left + stream_indicator_padding)
+ layout->stream_pixel_position = left + stream_indicator_padding;
+ }
+ }
/* These are publically exported */
range->slider_start = layout->slider.x;
@@ -2382,12 +2732,17 @@
GtkScrollType scroll,
gdouble value)
{
+ OssoGtkRangePrivate *priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+
/* potentially adjust the bounds _before we clamp */
g_signal_emit (range, signals[ADJUST_BOUNDS], 0, value);
value = CLAMP (value, range->adjustment->lower,
(range->adjustment->upper - range->adjustment->page_size));
+ if (priv->stream_indicator && value > priv->stream_position)
+ value = (gdouble)priv->stream_position;
+
if (range->round_digits >= 0)
{
gdouble power;
@@ -2465,11 +2820,16 @@
initial_timeout (gpointer data)
{
GtkRange *range;
+ GtkSettings *settings;
+ guint timeout = SCROLL_LATER_DELAY;
+
+ settings = gtk_settings_get_default ();
+ g_object_get (settings, "gtk-update-timeout", &timeout, NULL);
GDK_THREADS_ENTER ();
range = GTK_RANGE (data);
range->timer->timeout_id =
- g_timeout_add (SCROLL_LATER_DELAY,
+ g_timeout_add (/*SCROLL_LATER_DELAY*/timeout,
second_timeout,
range);
GDK_THREADS_LEAVE ();
@@ -2482,13 +2842,19 @@
gtk_range_add_step_timer (GtkRange *range,
GtkScrollType step)
{
+ GtkSettings *settings;
+ guint timeout = SCROLL_INITIAL_DELAY;
+
g_return_if_fail (range->timer == NULL);
g_return_if_fail (step != GTK_SCROLL_NONE);
+ settings = gtk_settings_get_default ();
+ g_object_get (settings, "gtk-initial-timeout", &timeout, NULL);
+
range->timer = g_new (GtkRangeStepTimer, 1);
range->timer->timeout_id =
- g_timeout_add (SCROLL_INITIAL_DELAY,
+ g_timeout_add (/*SCROLL_INITIAL_DELAY*/timeout,
initial_timeout,
range);
range->timer->step = step;
@@ -2528,9 +2894,15 @@
static void
gtk_range_reset_update_timer (GtkRange *range)
{
+ /*GtkSettings *settings;
+ guint timeout = UPDATE_DELAY;
+
+ settings = gtk_settings_get_default ();
+ g_object_get (settings, "gtk-update-timeout", &timeout, NULL);*/
+
gtk_range_remove_update_timer (range);
- range->update_timeout_id = g_timeout_add (UPDATE_DELAY,
+ range->update_timeout_id = g_timeout_add (/*timeout*/UPDATE_DELAY,
update_timeout,
range);
}
@@ -2544,3 +2916,116 @@
range->update_timeout_id = 0;
}
}
+
+/**
+ * osso_gtk_range_set_stream_indicator:
+ * @range: A GtkRange
+ * @stream_indicator: Whether stream indicator graphics is shown and restricts slider.
+ *
+ * Sets whether a graphical stream indicator
+ * is show on the trough and the slider is restricted
+ * to streamed area.
+ **/
+void
+osso_gtk_range_set_stream_indicator (GtkRange *range, gboolean stream_indicator)
+{
+ OssoGtkRangePrivate *priv;
+
+ g_return_if_fail (GTK_IS_RANGE (range));
+
+ priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+
+ if (stream_indicator == priv->stream_indicator)
+ return;
+
+ priv->stream_indicator = stream_indicator;
+ g_signal_emit_by_name (G_OBJECT (range), "value_changed", NULL);
+}
+
+/**
+ * osso_gtk_range_get_stream_indicator:
+ * @range: A GtkRange
+ *
+ * Return value: Whether GtkRange displays an
+ * stream indicator graphics and slider is restricted
+ * to streamed area
+ **/
+gboolean
+osso_gtk_range_get_stream_indicator (GtkRange *range)
+{
+ OssoGtkRangePrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
+
+ priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+
+ return priv->stream_indicator;
+}
+
+/**
+ * osso_gtk_range_set_stream_position:
+ * @range : A GtkRange
+ * @position : The new position of the stream indicator
+ *
+ * Sets the new position of the stream indicator.
+ * It is automatically clamped between lower and upper.
+ * Note that you need to enable stream_indicator
+ * before any stream-functionality is active.
+ **/
+void
+osso_gtk_range_set_stream_position (GtkRange *range,
+ gdouble position)
+{
+ OssoGtkRangePrivate *priv;
+ gdouble new_pos;
+
+ g_return_if_fail (GTK_IS_RANGE (range));
+
+ new_pos = CLAMP (position,
+ range->adjustment->lower,
+ range->adjustment->upper);
+ priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+
+ priv->stream_position = new_pos;
+ /* Reset the value to clamp it with the stream_position. */
+ if (priv->stream_indicator == TRUE)
+ gtk_range_set_value (range, gtk_range_get_value (range));
+
+ g_object_notify (G_OBJECT (range), "stream_position");
+}
+/**
+ * osso_gtk_range_get_stream_position:
+ * @range : A GtkRange
+ *
+ * Return value: The current position of the stream
+ * indicator. Note that this value is undefined
+ * when stream indicator is not enabled.
+ **/
+gdouble
+osso_gtk_range_get_stream_position (GtkRange *range)
+{
+ OssoGtkRangePrivate *priv;
+
+ g_return_if_fail (GTK_IS_RANGE (range));
+
+ priv = OSSO_GTK_RANGE_GET_PRIVATE (range);
+
+ return priv->stream_position;
+}
+
+/* OSSO addition : A function to ensure that
+ * scrolling stops if widget loses focus (example:
+ * dialog pops up) */
+static gint
+osso_gtk_range_focus_out (GtkWidget *widget, GdkEventFocus *event)
+{
+ gboolean hildonlike;
+
+ gtk_widget_style_get (widget, "hildonlike", &hildonlike, NULL);
+
+ if (hildonlike)
+ {
+ stop_scrolling (GTK_RANGE (widget));
+ }
+ return GTK_WIDGET_CLASS (parent_class)->focus_out_event (widget, event);
+}

View File

@ -0,0 +1,29 @@
--- gtk+-2.6.4/gtk/gtkrange.h 2004-08-27 05:54:12.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkrange.h 2005-04-06 16:19:37.798792072 +0300
@@ -24,6 +24,10 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
+/* Modified for Nokia Oyj during 2002-2005. See CHANGES file for list
+ * of changes.
+ */
+
#ifndef __GTK_RANGE_H__
#define __GTK_RANGE_H__
@@ -155,6 +159,15 @@
gdouble _gtk_range_get_wheel_delta (GtkRange *range,
GdkScrollDirection direction);
+/* OSSO additions for streaming indicator support. */
+void osso_gtk_range_set_stream_indicator (GtkRange *range,
+ gboolean stream_indicator);
+gboolean osso_gtk_range_get_stream_indicator (GtkRange *range);
+
+void osso_gtk_range_set_stream_position (GtkRange *range,
+ gdouble position);
+gdouble osso_gtk_range_get_stream_position (GtkRange *range);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -0,0 +1,48 @@
--- gtk+-2.6.4/gtk/gtkrbtree.c 2004-10-28 18:00:04.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkrbtree.c 2005-04-06 16:19:37.812789944 +0300
@@ -1378,18 +1378,18 @@
g_return_val_if_fail (node != NULL, NULL);
/* Case 1: the node's below us. */
- if (node->right != tree->nil)
+ if (node && node->right != tree->nil)
{
node = node->right;
- while (node->left != tree->nil)
+ while (node && node->left != tree->nil)
node = node->left;
return node;
}
/* Case 2: it's an ancestor */
- while (node->parent != tree->nil)
+ while (node && node->parent != tree->nil)
{
- if (node->parent->right == node)
+ if (node->parent && node->parent->right == node)
node = node->parent;
else
return (node->parent);
@@ -1407,18 +1407,18 @@
g_return_val_if_fail (node != NULL, NULL);
/* Case 1: the node's below us. */
- if (node->left != tree->nil)
+ if (node != NULL && node->left != tree->nil)
{
node = node->left;
- while (node->right != tree->nil)
+ while (node != NULL && node->right != tree->nil)
node = node->right;
return node;
}
/* Case 2: it's an ancestor */
- while (node->parent != tree->nil)
+ while (node != NULL && node->parent != tree->nil)
{
- if (node->parent->left == node)
+ if (node->parent && node->parent->left == node)
node = node->parent;
else
return (node->parent);

View File

@ -0,0 +1,581 @@
--- gtk+-2.6.4/gtk/gtkrc.c 2005-02-01 20:07:40.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkrc.c 2005-04-06 16:19:37.848784472 +0300
@@ -56,6 +56,7 @@
#include "gtkprivate.h"
#include "gtksettings.h"
#include "gtkwindow.h"
+#include "gtkhashtable.h"
#ifdef G_OS_WIN32
#include <io.h>
@@ -105,6 +106,14 @@
GtkStyle *default_style;
};
+#define GTK_RC_STYLE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_RC_STYLE, GtkRcStylePrivate))
+
+typedef struct _GtkRcStylePrivate GtkRcStylePrivate;
+
+struct _GtkRcStylePrivate {
+ GSList *logical_color_hashes;
+};
+
static GtkRcContext *gtk_rc_context_get (GtkSettings *settings);
static guint gtk_rc_style_hash (const gchar *name);
@@ -179,6 +188,13 @@
GScanner *scanner,
GtkRcStyle *rc_style,
GtkIconFactory *factory);
+static guint gtk_rc_parse_logical_color (GScanner *scanner,
+ GtkRcStyle *rc_style,
+ GtkHashTable *hash);
+static guint gtk_rc_parse_color_full (GScanner *scanner,
+ GdkColor *color,
+ GtkRcStyle *style);
+
static void gtk_rc_clear_hash_node (gpointer key,
gpointer data,
gpointer user_data);
@@ -277,7 +293,8 @@
{ "stock", GTK_RC_TOKEN_STOCK },
{ "im_module_file", GTK_RC_TOKEN_IM_MODULE_FILE },
{ "LTR", GTK_RC_TOKEN_LTR },
- { "RTL", GTK_RC_TOKEN_RTL }
+ { "RTL", GTK_RC_TOKEN_RTL },
+ { "logical_color", GTK_RC_TOKEN_LOGICAL_COLOR }
};
static GHashTable *realized_style_ht = NULL;
@@ -954,6 +971,7 @@
static void
gtk_rc_style_init (GtkRcStyle *style)
{
+ GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (style);
guint i;
style->name = NULL;
@@ -976,6 +994,7 @@
style->rc_style_lists = NULL;
style->icon_factories = NULL;
+ priv->logical_color_hashes = NULL;
}
static void
@@ -991,6 +1010,21 @@
klass->create_rc_style = gtk_rc_style_real_create_rc_style;
klass->merge = gtk_rc_style_real_merge;
klass->create_style = gtk_rc_style_real_create_style;
+
+ g_type_class_add_private (object_class, sizeof (GtkRcStylePrivate));
+}
+
+static void
+free_object_list (GSList *list)
+{
+ GSList *tmp_list = list;
+ while (tmp_list)
+ {
+ g_object_unref (tmp_list->data);
+ tmp_list = tmp_list->next;
+ }
+ g_slist_free (list);
+
}
static void
@@ -998,9 +1032,11 @@
{
GSList *tmp_list1, *tmp_list2;
GtkRcStyle *rc_style;
+ GtkRcStylePrivate *rc_priv;
gint i;
rc_style = GTK_RC_STYLE (object);
+ rc_priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
if (rc_style->name)
g_free (rc_style->name);
@@ -1059,13 +1095,8 @@
rc_style->rc_properties = NULL;
}
- tmp_list1 = rc_style->icon_factories;
- while (tmp_list1)
- {
- g_object_unref (tmp_list1->data);
- tmp_list1 = tmp_list1->next;
- }
- g_slist_free (rc_style->icon_factories);
+ free_object_list (rc_style->icon_factories);
+ free_object_list (rc_priv->logical_color_hashes);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -1125,6 +1156,14 @@
return g_object_new (G_OBJECT_TYPE (style), NULL);
}
+GSList *
+_gtk_rc_style_get_logical_color_hashes (GtkRcStyle *rc_style)
+{
+ GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
+
+ return priv->logical_color_hashes;
+}
+
static gint
gtk_rc_properties_cmp (gconstpointer bsearch_node1,
gconstpointer bsearch_node2)
@@ -1499,6 +1538,22 @@
context->rc_files = NULL;
gtk_rc_parse_default_files (context);
+/*Hildon- Swapped these sections of code, so the styles from the
+ XSettings theme are available when parsing with gtk_rc_context_parse_string*/
+ g_free (context->theme_name);
+ g_free (context->key_theme_name);
+
+ g_object_get (context->settings,
+ "gtk-theme-name", &context->theme_name,
+ "gtk-key-theme-name", &context->key_theme_name,
+ NULL);
+
+ if (context->theme_name && context->theme_name[0])
+ gtk_rc_parse_named (context, context->theme_name, NULL);
+ if (context->key_theme_name && context->key_theme_name[0])
+ gtk_rc_parse_named (context, context->key_theme_name, "key");
+
+/*****/
tmp_list = global_rc_files;
while (tmp_list)
@@ -1512,19 +1567,6 @@
tmp_list = tmp_list->next;
}
-
- g_free (context->theme_name);
- g_free (context->key_theme_name);
-
- g_object_get (context->settings,
- "gtk-theme-name", &context->theme_name,
- "gtk-key-theme-name", &context->key_theme_name,
- NULL);
-
- if (context->theme_name && context->theme_name[0])
- gtk_rc_parse_named (context, context->theme_name, NULL);
- if (context->key_theme_name && context->key_theme_name[0])
- gtk_rc_parse_named (context, context->key_theme_name, "key");
g_object_thaw_notify (G_OBJECT (context->settings));
@@ -1905,10 +1947,19 @@
{
GScanner *scanner;
guint i;
+ gchar *name_str;
gboolean done;
scanner = gtk_rc_scanner_new ();
+ if (input_name != NULL)
+ {
+ name_str = (gchar *) g_malloc(strlen(input_name) + 7);
+ sprintf(name_str, "%s.cache", input_name);
+ /*osso_g_scanner_cache_open (scanner, name_str);*/
+ g_free(name_str);
+ }
+
if (input_fd >= 0)
{
g_assert (input_string == NULL);
@@ -2062,6 +2113,29 @@
return style;
}
+static GSList *
+concat_object_lists (GSList *list_a, GSList *list_b)
+{
+ GSList *copy;
+
+ copy = g_slist_copy (list_b);
+ if (copy)
+ {
+ GSList *iter;
+
+ iter = copy;
+ while (iter != NULL)
+ {
+ g_object_ref (iter->data);
+ iter = g_slist_next (iter);
+ }
+
+ return g_slist_concat (list_a, copy);
+ }
+ else
+ return list_a;
+}
+
/* Reuses or frees rc_styles */
static GtkStyle *
gtk_rc_init_style (GtkRcContext *context,
@@ -2083,6 +2157,7 @@
GtkRcStyle *base_style = NULL;
GtkRcStyle *proto_style;
GtkRcStyleClass *proto_style_class;
+ GtkRcStylePrivate *proto_priv;
GSList *tmp_styles;
GType rc_style_type = GTK_TYPE_RC_STYLE;
@@ -2109,12 +2184,13 @@
proto_style_class = GTK_RC_STYLE_GET_CLASS (base_style);
proto_style = proto_style_class->create_rc_style (base_style);
+ proto_priv = GTK_RC_STYLE_GET_PRIVATE (proto_style);
tmp_styles = rc_styles;
while (tmp_styles)
{
GtkRcStyle *rc_style = tmp_styles->data;
- GSList *factories;
+ GtkRcStylePrivate *rc_priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
proto_style_class->merge (proto_style, rc_style);
@@ -2122,22 +2198,12 @@
if (!g_slist_find (rc_style->rc_style_lists, rc_styles))
rc_style->rc_style_lists = g_slist_prepend (rc_style->rc_style_lists, rc_styles);
- factories = g_slist_copy (rc_style->icon_factories);
- if (factories)
- {
- GSList *iter;
-
- iter = factories;
- while (iter != NULL)
- {
- g_object_ref (iter->data);
- iter = g_slist_next (iter);
- }
-
- proto_style->icon_factories = g_slist_concat (proto_style->icon_factories,
- factories);
-
- }
+ proto_style->icon_factories =
+ concat_object_lists (proto_style->icon_factories,
+ rc_style->icon_factories);
+ proto_priv->logical_color_hashes =
+ concat_object_lists (proto_priv->logical_color_hashes,
+ rc_priv->logical_color_hashes);
tmp_styles = tmp_styles->next;
}
@@ -2515,9 +2581,11 @@
GtkRcStyle *rc_style;
GtkRcStyle *orig_style;
GtkRcStyle *parent_style;
+ GtkRcStylePrivate *rc_priv = NULL;
guint token;
gint i;
GtkIconFactory *our_factory = NULL;
+ GtkHashTable *our_hash = NULL;
token = g_scanner_get_next_token (scanner);
if (token != GTK_RC_TOKEN_STYLE)
@@ -2533,12 +2601,6 @@
else
orig_style = NULL;
- /* If there's a list, its first member is always the factory belonging
- * to this RcStyle
- */
- if (rc_style && rc_style->icon_factories)
- our_factory = rc_style->icon_factories->data;
-
if (!rc_style)
{
rc_style = gtk_rc_style_new ();
@@ -2550,6 +2612,16 @@
for (i = 0; i < 5; i++)
rc_style->color_flags[i] = 0;
}
+
+ rc_priv = GTK_RC_STYLE_GET_PRIVATE (rc_style);
+
+ /* If there's a list, its first member is always the factory belonging
+ * to this RcStyle
+ */
+ if (rc_style->icon_factories)
+ our_factory = rc_style->icon_factories->data;
+ if (rc_priv->logical_color_hashes)
+ our_hash = rc_priv->logical_color_hashes->data;
token = g_scanner_peek_next_token (scanner);
if (token == G_TOKEN_EQUAL_SIGN)
@@ -2566,8 +2638,8 @@
parent_style = gtk_rc_style_find (context, scanner->value.v_string);
if (parent_style)
{
- GSList *factories;
-
+ GtkRcStylePrivate *parent_priv = GTK_RC_STYLE_GET_PRIVATE (parent_style);
+
for (i = 0; i < 5; i++)
{
rc_style->color_flags[i] = parent_style->color_flags[i];
@@ -2621,17 +2693,24 @@
rc_style->icon_factories = g_slist_prepend (rc_style->icon_factories,
our_factory);
}
-
- rc_style->icon_factories = g_slist_concat (rc_style->icon_factories,
- g_slist_copy (parent_style->icon_factories));
-
- factories = parent_style->icon_factories;
- while (factories != NULL)
+ rc_style->icon_factories = concat_object_lists (rc_style->icon_factories,
+ parent_style->icon_factories);
+ }
+
+ /* Also append parent's color hashes, adding a ref to them */
+ if (parent_priv->logical_color_hashes != NULL)
+ {
+ /* See comment above .. */
+ if (our_hash == NULL)
{
- g_object_ref (factories->data);
- factories = factories->next;
+ our_hash = _gtk_hash_table_new ();
+ rc_priv->logical_color_hashes = g_slist_prepend (rc_priv->logical_color_hashes,
+ our_hash);
}
- }
+
+ rc_priv->logical_color_hashes = concat_object_lists (rc_priv->logical_color_hashes,
+ parent_priv->logical_color_hashes);
+ }
}
}
@@ -2689,12 +2768,22 @@
}
token = gtk_rc_parse_stock (context, scanner, rc_style, our_factory);
break;
+ case GTK_RC_TOKEN_LOGICAL_COLOR:
+ if (our_hash == NULL)
+ {
+ our_hash = _gtk_hash_table_new ();
+ rc_priv->logical_color_hashes = g_slist_prepend (rc_priv->logical_color_hashes,
+ our_hash);
+ }
+ token = gtk_rc_parse_logical_color (scanner, rc_style, our_hash);
+ break;
case G_TOKEN_IDENTIFIER:
if (is_c_identifier (scanner->next_value.v_identifier) &&
scanner->next_value.v_identifier[0] >= 'A' &&
scanner->next_value.v_identifier[0] <= 'Z') /* match namespaced type names */
{
GtkRcProperty prop = { 0, 0, NULL, { 0, }, };
+ gchar *name;
g_scanner_get_next_token (scanner); /* eat type name */
prop.type_name = g_quark_from_string (scanner->value.v_identifier);
@@ -2712,8 +2801,10 @@
}
/* it's important that we do the same canonification as GParamSpecPool here */
- g_strcanon (scanner->value.v_identifier, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
- prop.property_name = g_quark_from_string (scanner->value.v_identifier);
+ name = g_strdup (scanner->value.v_identifier);
+ g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
+ prop.property_name = g_quark_from_string (name);
+ g_free (name);
token = gtk_rc_parse_assignment (scanner, &prop);
if (token == G_TOKEN_NONE)
@@ -2825,7 +2916,7 @@
return G_TOKEN_EQUAL_SIGN;
style->color_flags[state] |= GTK_RC_BG;
- return gtk_rc_parse_color (scanner, &style->bg[state]);
+ return gtk_rc_parse_color_full (scanner, &style->bg[state], style);
}
static guint
@@ -2848,7 +2939,7 @@
return G_TOKEN_EQUAL_SIGN;
style->color_flags[state] |= GTK_RC_FG;
- return gtk_rc_parse_color (scanner, &style->fg[state]);
+ return gtk_rc_parse_color_full (scanner, &style->fg[state], style);
}
static guint
@@ -2871,7 +2962,7 @@
return G_TOKEN_EQUAL_SIGN;
style->color_flags[state] |= GTK_RC_TEXT;
- return gtk_rc_parse_color (scanner, &style->text[state]);
+ return gtk_rc_parse_color_full (scanner, &style->text[state], style);
}
static guint
@@ -2894,7 +2985,7 @@
return G_TOKEN_EQUAL_SIGN;
style->color_flags[state] |= GTK_RC_BASE;
- return gtk_rc_parse_color (scanner, &style->base[state]);
+ return gtk_rc_parse_color_full (scanner, &style->base[state], style);
}
static guint
@@ -3345,11 +3436,45 @@
return G_TOKEN_NONE;
}
+static gboolean
+lookup_logical_color (GtkRcStyle *style,
+ const char *color_name,
+ GdkColor *color)
+{
+ GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (style);
+ GSList *iter;
+
+ iter = priv->logical_color_hashes;
+ while (iter != NULL)
+ {
+ GdkColor *match = g_hash_table_lookup (GTK_HASH_TABLE (iter->data)->hash,
+ color_name);
+ if (match)
+ {
+ color->red = match->red;
+ color->green = match->green;
+ color->blue = match->blue;
+ return TRUE;
+ }
+
+ iter = g_slist_next (iter);
+ }
+
+ return FALSE;
+}
guint
gtk_rc_parse_color (GScanner *scanner,
GdkColor *color)
{
+ return gtk_rc_parse_color_full (scanner, color, NULL);
+}
+
+static guint
+gtk_rc_parse_color_full (GScanner *scanner,
+ GdkColor *color,
+ GtkRcStyle *style)
+{
guint token;
g_return_val_if_fail (scanner != NULL, G_TOKEN_ERROR);
@@ -3407,11 +3532,14 @@
case G_TOKEN_STRING:
if (!gdk_color_parse (scanner->value.v_string, color))
{
- g_scanner_warn (scanner, "Invalid color constant '%s'",
- scanner->value.v_string);
- return G_TOKEN_STRING;
+ if (!(style && lookup_logical_color (style, scanner->value.v_string, color)))
+ {
+ g_scanner_warn (scanner, "Invalid color constant '%s'",
+ scanner->value.v_string);
+ return G_TOKEN_STRING;
+ }
}
- else
+
return G_TOKEN_NONE;
default:
@@ -3625,8 +3753,8 @@
}
static guint
-gtk_rc_parse_stock_id (GScanner *scanner,
- gchar **stock_id)
+gtk_rc_parse_hash_key (GScanner *scanner,
+ gchar **hash_key)
{
guint token;
@@ -3639,12 +3767,12 @@
if (token != G_TOKEN_STRING)
return G_TOKEN_STRING;
- *stock_id = g_strdup (scanner->value.v_string);
+ *hash_key = g_strdup (scanner->value.v_string);
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_RIGHT_BRACE)
{
- g_free (*stock_id);
+ g_free (*hash_key);
return G_TOKEN_RIGHT_BRACE;
}
@@ -3854,7 +3982,7 @@
if (token != GTK_RC_TOKEN_STOCK)
return GTK_RC_TOKEN_STOCK;
- token = gtk_rc_parse_stock_id (scanner, &stock_id);
+ token = gtk_rc_parse_hash_key (scanner, &stock_id);
if (token != G_TOKEN_NONE)
return token;
@@ -3965,3 +4093,46 @@
}
#endif
+
+static guint
+gtk_rc_parse_logical_color (GScanner *scanner,
+ GtkRcStyle *rc_style,
+ GtkHashTable *hash)
+{
+ gchar *color_id = NULL;
+ guint token;
+ GdkColor *color;
+
+ token = g_scanner_get_next_token (scanner);
+ if (token != GTK_RC_TOKEN_LOGICAL_COLOR)
+ return GTK_RC_TOKEN_LOGICAL_COLOR;
+
+ token = gtk_rc_parse_hash_key (scanner, &color_id);
+ if (token != G_TOKEN_NONE)
+ return token;
+
+ token = g_scanner_get_next_token (scanner);
+ if (token != G_TOKEN_EQUAL_SIGN)
+ {
+ g_free (color_id);
+ return G_TOKEN_EQUAL_SIGN;
+ }
+
+ color = g_new (GdkColor, 1);
+ token = gtk_rc_parse_color_full (scanner, color, rc_style);
+ if (token != G_TOKEN_NONE)
+ {
+ g_free (color_id);
+ g_free (color);
+ return token;
+ }
+
+ /* Because the hash is created with destroy functions,
+ * g_hash_table_insert will free any old values for us,
+ * if a mapping with the specified key already exists. */
+ g_hash_table_insert (hash->hash, color_id, color);
+
+ return G_TOKEN_NONE;
+}
+
+

View File

@ -0,0 +1,19 @@
--- gtk+-2.6.4/gtk/gtkrc.h 2004-12-12 23:09:13.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkrc.h 2005-04-06 16:19:37.866781736 +0300
@@ -211,6 +211,7 @@
GTK_RC_TOKEN_STOCK,
GTK_RC_TOKEN_LTR,
GTK_RC_TOKEN_RTL,
+ GTK_RC_TOKEN_LOGICAL_COLOR,
GTK_RC_TOKEN_LAST
} GtkRcTokenType;
@@ -241,6 +242,8 @@
const gchar* _gtk_rc_context_get_default_font_name (GtkSettings *settings);
+GSList *_gtk_rc_style_get_logical_color_hashes (GtkRcStyle *rc_style);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -0,0 +1,162 @@
--- gtk+-2.6.4/gtk/gtkscrolledwindow.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkscrolledwindow.c 2005-04-06 16:19:37.898776872 +0300
@@ -289,6 +289,13 @@
DEFAULT_SCROLLBAR_SPACING,
G_PARAM_READABLE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("scrollbar_dislocation",
+ P_("Scrollbar dislocation"),
+ P_("Flag for having scrollbar at the outer border or container padding instead of at the inner border"),
+ FALSE,
+ G_PARAM_READABLE));
+
signals[SCROLL_CHILD] =
g_signal_new ("scroll_child",
G_TYPE_FROM_CLASS (object_class),
@@ -1062,6 +1069,73 @@
}
}
+static gdouble
+gtk_scrolled_window_get_focus_movement (GtkScrolledWindow *scrolled_window)
+{
+ GtkWidget *focus_child;
+ GtkRange *range;
+ GtkAdjustment *adj;
+ gdouble value, new_value;
+ gint x, y;
+
+ focus_child = GTK_CONTAINER(scrolled_window)->focus_child;
+ if (focus_child == NULL)
+ return 0;
+
+ while (GTK_IS_CONTAINER (focus_child) &&
+ GTK_CONTAINER (focus_child)->focus_child)
+ {
+ focus_child = GTK_CONTAINER (focus_child)->focus_child;
+ }
+
+ range = GTK_RANGE (scrolled_window->vscrollbar);
+ adj = range->adjustment;
+ value = gtk_adjustment_get_value (adj);
+
+ gtk_widget_translate_coordinates (focus_child->parent,
+ GTK_WIDGET(scrolled_window),
+ focus_child->allocation.x,
+ focus_child->allocation.y, &x, &y);
+
+ if (y < 0)
+ {
+ /* scroll up */
+ new_value = value + y;
+ if (new_value < adj->lower)
+ new_value = adj->lower;
+ }
+ else if (y + focus_child->allocation.height > adj->page_size)
+ {
+ /* scroll down */
+ new_value = value + y + focus_child->allocation.height - adj->page_size;
+ if (new_value > adj->upper - adj->page_size)
+ new_value = adj->upper - adj->page_size;
+ }
+ else
+ {
+ new_value = value;
+ }
+
+ return new_value - value;
+}
+
+static void
+gtk_scrolled_window_scroll_to_focus (GtkScrolledWindow *scrolled_window)
+{
+ GtkAdjustment *adj;
+ gdouble diff;
+
+ diff = gtk_scrolled_window_get_focus_movement (scrolled_window);
+ if (diff != 0)
+ {
+ adj = GTK_RANGE (scrolled_window->vscrollbar)->adjustment;
+
+ gtk_adjustment_set_value (adj, gtk_adjustment_get_value (adj) + diff);
+ gtk_scrolled_window_set_vadjustment (scrolled_window,
+ GTK_ADJUSTMENT (adj));
+ }
+}
+
static void
gtk_scrolled_window_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -1071,17 +1145,32 @@
GtkAllocation relative_allocation;
GtkAllocation child_allocation;
gint scrollbar_spacing;
-
+ gboolean is_focus_visible, dislocate;
+ gint dislocation;
+
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget));
g_return_if_fail (allocation != NULL);
scrolled_window = GTK_SCROLLED_WINDOW (widget);
bin = GTK_BIN (scrolled_window);
+ is_focus_visible =
+ gtk_scrolled_window_get_focus_movement (scrolled_window) == 0;
+
scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
widget->allocation = *allocation;
+ /* See how much scrollbar needs be "dislocated" (to get it to the other
+ * edge of the border). Does not apply to all occasions. */
+ gtk_widget_style_get (GTK_WIDGET (scrolled_window),
+ "scrollbar_dislocation", &dislocate,
+ NULL);
+ if (dislocate)
+ dislocation = GTK_CONTAINER (scrolled_window)->border_width;
+ else
+ dislocation = 0;
+
if (scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
scrolled_window->hscrollbar_visible = TRUE;
else if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
@@ -1150,10 +1239,12 @@
child_allocation.y = (relative_allocation.y +
relative_allocation.height +
scrollbar_spacing +
+ dislocation +
(scrolled_window->shadow_type == GTK_SHADOW_NONE ?
0 : widget->style->ythickness));
else
- child_allocation.y = GTK_CONTAINER (scrolled_window)->border_width;
+ child_allocation.y = GTK_CONTAINER (scrolled_window)->border_width -
+ dislocation;
child_allocation.width = relative_allocation.width;
child_allocation.height = hscrollbar_requisition.height;
@@ -1189,10 +1280,12 @@
child_allocation.x = (relative_allocation.x +
relative_allocation.width +
scrollbar_spacing +
+ dislocation +
(scrolled_window->shadow_type == GTK_SHADOW_NONE ?
0 : widget->style->xthickness));
else
- child_allocation.x = GTK_CONTAINER (scrolled_window)->border_width;
+ child_allocation.x = GTK_CONTAINER (scrolled_window)->border_width -
+ dislocation;
child_allocation.y = relative_allocation.y;
child_allocation.width = vscrollbar_requisition.width;
@@ -1207,6 +1300,9 @@
}
gtk_widget_size_allocate (scrolled_window->vscrollbar, &child_allocation);
+
+ if (is_focus_visible)
+ gtk_scrolled_window_scroll_to_focus (scrolled_window);
}
else if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
gtk_widget_hide (scrolled_window->vscrollbar);

View File

@ -0,0 +1,21 @@
--- gtk+-2.6.4/gtk/gtkseparator.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkseparator.c 2005-04-06 16:19:37.928772312 +0300
@@ -65,6 +65,18 @@
static void
gtk_separator_class_init (GtkSeparatorClass *class)
{
+ GParamSpec* pspec;
+
+ pspec = g_param_spec_boolean("hildonlike-drawing",
+ "hildonlike looks.",
+ "hildonlike looks. "
+ "Draws with paint_box "
+ "instead of paint_(vh)line, 1/0",
+ FALSE,
+ G_PARAM_READABLE);
+
+ gtk_widget_class_install_style_property(GTK_WIDGET_CLASS(class),
+ pspec);
}
static void

View File

@ -0,0 +1,90 @@
--- gtk+-2.6.4/gtk/gtkseparatortoolitem.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtkseparatortoolitem.c 2005-04-06 16:19:37.937770944 +0300
@@ -29,6 +29,7 @@
#include "gtktoolbar.h"
#define MENU_ID "gtk-separator-tool-item-menu-id"
+#define HILDON_SEPARATOR_HEIGHT 40
enum {
PROP_0,
@@ -137,6 +138,18 @@
P_("Whether the separator is drawn, or just blank"),
TRUE,
G_PARAM_READWRITE));
+ /* Hildon addition : some new style properties we need. */
+ gtk_widget_class_install_style_property(widget_class,
+ g_param_spec_int ("separator_size",
+ P_("Separator size"), P_("The thickness of the separator. -1 for default behaviour."),
+ -1, G_MAXINT, -1, G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("is_image",
+ P_("Is separator an image or a line"),
+ P_("Whether the separator is drawn as an image, or just as a line"),
+ FALSE,
+ G_PARAM_READWRITE));
g_type_class_add_private (object_class, sizeof (GtkSeparatorToolItemPrivate));
}
@@ -213,14 +226,26 @@
GtkToolItem *item = GTK_TOOL_ITEM (widget);
GtkOrientation orientation = gtk_tool_item_get_orientation (item);
+ /* Hildon modifications from here on:
+ * if the "separator_size" style property
+ * is the default value (it has not been set
+ * in resource files), use default gtk+ behaviour.
+ */
+ gint separator_size = -1;
+
+ gtk_widget_style_get( widget, "separator_size", &separator_size, NULL );
+
+ if (separator_size == -1)
+ separator_size = get_space_size (item);
+
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- requisition->width = get_space_size (item);
+ requisition->width = separator_size;
requisition->height = 1;
}
else
{
- requisition->height = get_space_size (item);
+ requisition->height = separator_size;
requisition->width = 1;
}
}
@@ -235,10 +260,30 @@
if (priv->draw)
{
+ gboolean is_image = FALSE;
if (widget->parent && GTK_IS_TOOLBAR (widget->parent))
toolbar = GTK_TOOLBAR (widget->parent);
- _gtk_toolbar_paint_space_line (widget, toolbar,
+ gtk_widget_style_get( widget, "is_image", &is_image, NULL );
+ if (is_image)
+ {
+ gint separator_size = -1;
+ GtkOrientation orientation = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (widget));
+
+ gtk_widget_style_get( widget, "separator_size", &separator_size, NULL );
+
+ /* if style property not set, use gtk+
+ * default behaviour. */
+ if (separator_size == -1)
+ separator_size = get_space_size (GTK_TOOL_ITEM (widget));
+
+ gtk_paint_box( widget->style, widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget,
+ orientation == GTK_ORIENTATION_HORIZONTAL ? "vertical" : "horizontal",
+ widget->allocation.x, widget->allocation.y + (widget->allocation.height - HILDON_SEPARATOR_HEIGHT) / 2,
+ separator_size, HILDON_SEPARATOR_HEIGHT );
+ } else
+ _gtk_toolbar_paint_space_line (widget, toolbar,
&(event->area), &widget->allocation);
}

View File

@ -0,0 +1,66 @@
--- gtk+-2.6.4/gtk/gtksettings.c 2004-11-20 01:18:38.000000000 +0200
+++ gtk+-2.6.4/gtk/gtksettings.c 2005-04-06 16:19:37.941770336 +0300
@@ -1,4 +1,4 @@
-/* GTK - The GIMP Toolkit
+/*
* Copyright (C) 2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -24,6 +24,9 @@
#include "gtkintl.h"
#include "gtkwidget.h"
+#define DEFAULT_INITIAL_TIMEOUT 300
+#define DEFAULT_UPDATE_TIMEOUT 125
+
typedef struct _GtkSettingsValuePrivate GtkSettingsValuePrivate;
typedef enum
@@ -72,6 +75,9 @@
PROP_XFT_RGBA,
PROP_XFT_DPI,
#endif
+ PROP_INITIAL_TIMEOUT,
+ PROP_UPDATE_TIMEOUT,
+ PROP_HILDON_KEYBOARD_NAVIGATION,
PROP_ALTERNATIVE_BUTTON_ORDER
};
@@ -426,6 +432,37 @@
NULL);
g_assert (result == PROP_XFT_DPI);
+
+ result = settings_install_property_parser (class,
+ g_param_spec_int ("gtk-initial-timeout",
+ P_("Start timeout"),
+ P_("Starting value for timeouts, when button is pressed"),
+ 0, G_MAXINT, DEFAULT_INITIAL_TIMEOUT,
+ G_PARAM_READWRITE),
+ NULL);
+
+ g_assert (result == PROP_INITIAL_TIMEOUT);
+
+ result = settings_install_property_parser (class,
+ g_param_spec_int ("gtk-update-timeout",
+ P_("Repeat timeout"),
+ P_("Repeat value for timeouts, when button is pressed"),
+ 0, G_MAXINT, DEFAULT_UPDATE_TIMEOUT,
+ G_PARAM_READWRITE),
+ NULL);
+
+ g_assert (result == PROP_UPDATE_TIMEOUT);
+
+ result = settings_install_property_parser (class,
+ g_param_spec_boolean ("hildon-keyboard-navigation",
+ P_("Keyboard navigation"),
+ P_("This property can be used to enable keyboard navigation"),
+ FALSE,
+ G_PARAM_READWRITE),
+ NULL);
+
+ g_assert (result == PROP_HILDON_KEYBOARD_NAVIGATION);
+
#endif /* GDK_WINDOWING_X11 */
result = settings_install_property_parser (class,
g_param_spec_boolean ("gtk-alternative-button-order",

View File

@ -0,0 +1,50 @@
--- gtk+-2.6.4/gtk/gtkspinbutton.c 2004-11-14 03:25:35.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkspinbutton.c 2005-04-06 16:19:37.945769728 +0300
@@ -1041,15 +1041,21 @@
GtkArrowType click_child,
gdouble step)
{
+ GtkSettings *settings;
+ guint timeout;
+
g_return_if_fail (click_child == GTK_ARROW_UP || click_child == GTK_ARROW_DOWN);
-
+
+ settings = gtk_settings_get_default ();
+ g_object_get (settings, "gtk-initial-timeout", &timeout, NULL);
+
spin->click_child = click_child;
if (!spin->timer)
{
spin->timer_step = step;
spin->need_timer = TRUE;
- spin->timer = g_timeout_add (SPIN_BUTTON_INITIAL_TIMER_DELAY,
+ spin->timer = g_timeout_add (/*SPIN_BUTTON_INITIAL_TIMER_DELAY*/timeout,
(GSourceFunc) gtk_spin_button_timer,
(gpointer) spin);
}
@@ -1188,9 +1194,14 @@
gtk_spin_button_timer (GtkSpinButton *spin_button)
{
gboolean retval = FALSE;
+ GtkSettings *settings;
+ guint timeout;
GDK_THREADS_ENTER ();
+ settings = gtk_settings_get_default ();
+ g_object_get (settings, "gtk-update-timeout", &timeout, NULL);
+
if (spin_button->timer)
{
if (spin_button->click_child == GTK_ARROW_UP)
@@ -1201,7 +1212,7 @@
if (spin_button->need_timer)
{
spin_button->need_timer = FALSE;
- spin_button->timer = g_timeout_add (SPIN_BUTTON_TIMER_DELAY,
+ spin_button->timer = g_timeout_add (/*SPIN_BUTTON_TIMER_DELAY*/timeout,
(GSourceFunc) gtk_spin_button_timer,
(gpointer) spin_button);
}

View File

@ -0,0 +1,250 @@
--- gtk+-2.6.4/gtk/gtkstyle.c 2005-01-18 18:43:45.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkstyle.c 2005-04-06 16:19:37.951768816 +0300
@@ -38,6 +38,7 @@
#include "gtkthemes.h"
#include "gtkiconfactory.h"
#include "gtksettings.h" /* _gtk_settings_parse_convert() */
+#include "gtkhashtable.h"
#define LIGHTNESS_MULT 1.3
#define DARKNESS_MULT 0.7
@@ -49,6 +50,14 @@
GValue value;
} PropertyValue;
+#define GTK_STYLE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_STYLE, GtkStylePrivate))
+
+typedef struct _GtkStylePrivate GtkStylePrivate;
+
+struct _GtkStylePrivate {
+ GSList *logical_color_hashes;
+};
+
/* --- prototypes --- */
static void gtk_style_init (GtkStyle *style);
static void gtk_style_class_init (GtkStyleClass *klass);
@@ -655,6 +664,7 @@
klass->draw_layout = gtk_default_draw_layout;
klass->draw_resize_grip = gtk_default_draw_resize_grip;
+ g_type_class_add_private (object_class, sizeof (GtkStylePrivate));
/**
* GtkStyle::realize:
@@ -714,9 +724,28 @@
}
static void
+free_object_list (GSList *list)
+{
+ if (list)
+ {
+ GSList *tmp_list = list;
+
+ while (tmp_list)
+ {
+ g_object_unref (tmp_list->data);
+ tmp_list = tmp_list->next;
+ }
+
+ g_slist_free (list);
+ }
+
+}
+
+static void
gtk_style_finalize (GObject *object)
{
GtkStyle *style = GTK_STYLE (object);
+ GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
g_return_if_fail (style->attach_count == 0);
@@ -745,19 +774,9 @@
g_slist_free_1 (style->styles);
}
}
-
- if (style->icon_factories)
- {
- GSList *tmp_list = style->icon_factories;
-
- while (tmp_list)
- {
- g_object_unref (tmp_list->data);
- tmp_list = tmp_list->next;
- }
-
- g_slist_free (style->icon_factories);
- }
+
+ free_object_list (style->icon_factories);
+ free_object_list (priv->logical_color_hashes);
pango_font_description_free (style->font_desc);
@@ -1003,6 +1022,51 @@
return gtk_icon_factory_lookup_default (stock_id);
}
+ /**
+ * gtk_style_lookup_logical_color:
+ * @style: a #GtkStyle
+ * @color_name: the name of the logical color to look up
+ * @color: the #GdkColor to fill in
+ *
+ * Looks up @color_name in the style's logical color mappings,
+ * filling in @color and returning %TRUE if found, otherwise
+ * returning %FALSE. Do not cache the found mapping, because
+ * it depends on the #GtkStyle and might change when a theme
+ * switch occurs.
+ *
+ * Return value: %TRUE if the mapping was found.
+ */
+gboolean
+gtk_style_lookup_logical_color (GtkStyle *style,
+ const char *color_name,
+ GdkColor *color)
+{
+ GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
+ GSList *iter;
+
+ g_return_val_if_fail (GTK_IS_STYLE (style), FALSE);
+ g_return_val_if_fail (color_name != NULL, FALSE);
+ g_return_val_if_fail (color != NULL, FALSE);
+
+ iter = priv->logical_color_hashes;
+ while (iter != NULL)
+ {
+ GdkColor *mapping = g_hash_table_lookup (GTK_HASH_TABLE (iter->data)->hash,
+ color_name);
+ if (mapping)
+ {
+ color->red = mapping->red;
+ color->green = mapping->green;
+ color->blue = mapping->blue;
+ return TRUE;
+ }
+
+ iter = g_slist_next (iter);
+ }
+
+ return FALSE;
+}
+
/**
* gtk_draw_hline:
* @style: a #GtkStyle
@@ -1717,10 +1781,32 @@
clear_property_cache (style);
}
+static GSList *
+copy_object_list (GSList *list)
+{
+ if (list)
+ {
+ GSList *iter;
+
+ iter = list;
+ while (iter != NULL)
+ {
+ g_object_ref (iter->data);
+ iter = g_slist_next (iter);
+ }
+
+ return g_slist_copy (list);
+ }
+ else
+ return NULL;
+}
+
static void
gtk_style_real_init_from_rc (GtkStyle *style,
GtkRcStyle *rc_style)
{
+ GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
+ GSList *logical_color_hashes;
gint i;
/* cache _should_ be still empty */
@@ -1746,19 +1832,10 @@
if (rc_style->ythickness >= 0)
style->ythickness = rc_style->ythickness;
- if (rc_style->icon_factories)
- {
- GSList *iter;
+ style->icon_factories = copy_object_list (rc_style->icon_factories);
- style->icon_factories = g_slist_copy (rc_style->icon_factories);
-
- iter = style->icon_factories;
- while (iter != NULL)
- {
- g_object_ref (iter->data);
- iter = g_slist_next (iter);
- }
- }
+ logical_color_hashes = _gtk_rc_style_get_logical_color_hashes (rc_style);
+ priv->logical_color_hashes = copy_object_list (logical_color_hashes);
}
static gint
@@ -2065,7 +2142,7 @@
const gchar *detail)
{
GdkPixbuf *pixbuf;
-
+
g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
g_return_val_if_fail (GTK_STYLE_GET_CLASS (style)->render_icon != NULL, NULL);
@@ -2156,7 +2233,7 @@
{
return gdk_pixbuf_scale_simple (src,
width, height,
- GDK_INTERP_BILINEAR);
+ GDK_INTERP_NEAREST);
}
}
@@ -2183,7 +2260,6 @@
*/
base_pixbuf = gtk_icon_source_get_pixbuf (source);
-
g_return_val_if_fail (base_pixbuf != NULL, NULL);
if (widget && gtk_widget_has_screen (widget))
@@ -2213,7 +2289,9 @@
/* If the size was wildcarded, and we're allowed to scale, then scale; otherwise,
* leave it alone.
*/
- if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source))
+ /* Hildon addition: Device icons are never scaled */
+ if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source)
+ && size < HILDON_ICON_SIZE_26)
scaled = scale_or_ref (base_pixbuf, width, height);
else
scaled = g_object_ref (base_pixbuf);
@@ -2224,7 +2302,7 @@
if (state == GTK_STATE_INSENSITIVE)
{
stated = gdk_pixbuf_copy (scaled);
-
+
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
0.8, TRUE);
@@ -2232,8 +2310,8 @@
}
else if (state == GTK_STATE_PRELIGHT)
{
- stated = gdk_pixbuf_copy (scaled);
-
+ stated = gdk_pixbuf_copy (scaled);
+
gdk_pixbuf_saturate_and_pixelate (scaled, stated,
1.2, FALSE);

View File

@ -0,0 +1,13 @@
--- gtk+-2.6.4/gtk/gtkstyle.h 2004-11-28 09:02:27.000000000 +0200
+++ gtk+-2.6.4/gtk/gtkstyle.h 2005-04-06 16:19:37.952768664 +0300
@@ -454,6 +454,10 @@
gint width,
gint height);
+gboolean gtk_style_lookup_logical_color (GtkStyle *style,
+ const gchar *color_name,
+ GdkColor *color);
+
GtkIconSet* gtk_style_lookup_icon_set (GtkStyle *style,
const gchar *stock_id);
GdkPixbuf* gtk_style_render_icon (GtkStyle *style,

View File

@ -0,0 +1,95 @@
--- gtk+-2.6.4/gtk/gtktable.c 2004-08-09 19:59:52.000000000 +0300
+++ gtk+-2.6.4/gtk/gtktable.c 2005-04-06 16:19:37.974765320 +0300
@@ -28,6 +28,7 @@
#include "gtkalias.h"
#include "gtktable.h"
#include "gtkintl.h"
+#include "gtkbutton.h"
enum
{
@@ -507,6 +508,33 @@
return GTK_WIDGET (table);
}
+void osso_gtk_table_find_button_detail (GtkTable *table,
+ GtkTableChild *table_child)
+{
+ OssoGtkButtonAttachFlags attachflags = 0;
+ gboolean automatic_detail;
+
+ g_return_if_fail (GTK_IS_TABLE (table));
+ g_return_if_fail (table_child != NULL);
+ g_return_if_fail (GTK_IS_BUTTON (table_child->widget));
+
+ if (table_child->top_attach == 0)
+ attachflags |= OSSO_GTK_BUTTON_ATTACH_NORTH;
+
+ if (table_child->bottom_attach == table->nrows)
+ attachflags |= OSSO_GTK_BUTTON_ATTACH_SOUTH;
+
+ if (table_child->left_attach == 0)
+ attachflags |= OSSO_GTK_BUTTON_ATTACH_WEST;
+
+ if (table_child->right_attach == table->ncols)
+ attachflags |= OSSO_GTK_BUTTON_ATTACH_EAST;
+
+ g_object_get (G_OBJECT (table_child->widget), "automatic_detail", &automatic_detail, NULL);
+ if (automatic_detail == TRUE)
+ g_object_set (G_OBJECT (table_child->widget), "detail", osso_gtk_button_attach_details[attachflags], NULL);
+}
+
void
gtk_table_resize (GtkTable *table,
guint n_rows,
@@ -523,6 +551,18 @@
n_cols != table->ncols)
{
GList *list;
+ guint recalc_column = -1;
+ guint recalc_row = -1;
+
+ if (n_rows > table->nrows)
+ recalc_row = table->nrows;
+ else
+ recalc_row = n_rows;
+
+ if (n_cols > table->ncols)
+ recalc_column = table->ncols;
+ else
+ recalc_column = n_cols;
for (list = table->children; list; list = list->next)
{
@@ -577,6 +617,20 @@
g_object_notify (G_OBJECT (table), "n_columns");
}
+
+ if ((recalc_column != -1) || (recalc_row != -1))
+ for (list = table->children; list; list = list->next)
+ {
+ GtkTableChild *child;
+
+ child = list->data;
+
+ if (GTK_IS_BUTTON (child->widget) &&
+ ((child->bottom_attach == recalc_row) ||
+ (child->right_attach == recalc_column)))
+
+ osso_gtk_table_find_button_detail (table, child);
+ }
}
}
@@ -623,6 +677,10 @@
table_child->yshrink = (yoptions & GTK_SHRINK) != 0;
table_child->yfill = (yoptions & GTK_FILL) != 0;
table_child->ypadding = ypadding;
+
+
+ if (GTK_IS_BUTTON (table_child->widget))
+ osso_gtk_table_find_button_detail (table, table_child);
table->children = g_list_prepend (table->children, table_child);

View File

@ -0,0 +1,443 @@
--- gtk+-2.6.4/gtk/gtktextbuffer.c 2004-11-01 21:57:13.000000000 +0200
+++ gtk+-2.6.4/gtk/gtktextbuffer.c 2005-04-06 16:19:38.023757872 +0300
@@ -1,5 +1,6 @@
/* GTK - The GIMP Toolkit
* gtktextbuffer.c Copyright (C) 2000 Red Hat, Inc.
+ * Copyright (C) 2004 Nokia Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -39,6 +40,17 @@
#include "gtktextbtree.h"
#include "gtktextiterprivate.h"
#include "gtkintl.h"
+#include "gtktextbufferserialize.h"
+
+#define GTK_TEXT_BUFFER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_TEXT_BUFFER, GtkTextBufferPrivate))
+
+typedef struct _GtkTextBufferPrivate GtkTextBufferPrivate;
+
+struct _GtkTextBufferPrivate
+{
+ gboolean can_paste_rich_text;
+ gchar *rich_text_format;
+};
typedef struct _ClipboardRequest ClipboardRequest;
@@ -71,7 +83,10 @@
PROP_0,
/* Construct */
- PROP_TAG_TABLE
+ PROP_TAG_TABLE,
+
+ PROP_CAN_PASTE_RICH_TEXT,
+ PROP_RICH_TEXT_FORMAT
};
enum {
@@ -79,6 +94,8 @@
TARGET_TEXT,
TARGET_COMPOUND_TEXT,
TARGET_UTF8_STRING,
+ TARGET_TEXT_VIEW_MARKUP,
+ TARGET_TEXT_VIEW_RICH_TEXT_FORMAT,
TARGET_TEXT_BUFFER_CONTENTS
};
@@ -185,7 +202,20 @@
P_("Text Tag Table"),
GTK_TYPE_TEXT_TAG_TABLE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (object_class,
+ PROP_CAN_PASTE_RICH_TEXT,
+ g_param_spec_boolean ("can_paste_rich_text",
+ P_("Can paste rich text"),
+ P_("Whether it should be possible to paste rich text to the buffer"),
+ FALSE, G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_RICH_TEXT_FORMAT,
+ g_param_spec_string ("rich_text_format",
+ P_("Rich Text Format"),
+ P_("Name of a collection of tags that the text view supports"),
+ NULL, G_PARAM_READWRITE));
+
signals[INSERT_TEXT] =
g_signal_new ("insert_text",
G_OBJECT_CLASS_TYPE (object_class),
@@ -335,7 +365,9 @@
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE,
- 0);
+ 0);
+
+ g_type_class_add_private (object_class, sizeof (GtkTextBufferPrivate));
}
static void
@@ -385,7 +417,12 @@
case PROP_TAG_TABLE:
set_table (text_buffer, g_value_get_object (value));
break;
-
+ case PROP_CAN_PASTE_RICH_TEXT:
+ gtk_text_buffer_set_can_paste_rich_text (text_buffer, g_value_get_boolean (value));
+ break;
+ case PROP_RICH_TEXT_FORMAT:
+ gtk_text_buffer_set_rich_text_format (text_buffer, g_value_get_string (value));
+ break;
default:
break;
}
@@ -406,7 +443,14 @@
case PROP_TAG_TABLE:
g_value_set_object (value, get_table (text_buffer));
break;
-
+ case PROP_CAN_PASTE_RICH_TEXT:
+ g_value_set_boolean (value,
+ gtk_text_buffer_get_can_paste_rich_text (text_buffer));
+ break;
+ case PROP_RICH_TEXT_FORMAT:
+ g_value_set_string (value,
+ gtk_text_buffer_get_rich_text_format (text_buffer));
+ break;
default:
break;
}
@@ -434,11 +478,14 @@
gtk_text_buffer_finalize (GObject *object)
{
GtkTextBuffer *buffer;
+ GtkTextBufferPrivate *priv;
buffer = GTK_TEXT_BUFFER (object);
remove_all_selection_clipboards (buffer);
+ priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer);
+
if (buffer->tag_table)
{
_gtk_text_tag_table_remove_buffer (buffer->tag_table, buffer);
@@ -456,7 +503,9 @@
free_log_attr_cache (buffer->log_attr_cache);
buffer->log_attr_cache = NULL;
-
+
+ g_free (priv->rich_text_format);
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -2738,8 +2787,7 @@
if (gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
{
- if (selection_data->target ==
- gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE))
+ if (info == TARGET_TEXT_BUFFER_CONTENTS)
{
/* Provide the address of the buffer; this will only be
* used within-process
@@ -2750,6 +2798,32 @@
(void*)&buffer,
sizeof (buffer));
}
+ else if (info == TARGET_TEXT_VIEW_MARKUP)
+ {
+ gchar *str;
+ gint len;
+
+ str = gtk_text_buffer_serialize_rich_text (buffer, &start, &end, &len);
+
+ gtk_selection_data_set (selection_data,
+ gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE),
+ 8, /* bytes */
+ str, len);
+ g_free (str);
+ }
+ else if (info == TARGET_TEXT_VIEW_RICH_TEXT_FORMAT)
+ {
+ gint len;
+ gchar *format;
+
+ format = g_object_get_data (G_OBJECT (buffer), "gtk-text-buffer-clipboard-format");
+ len = format ? strlen (format) : -1;
+
+ gtk_selection_data_set (selection_data,
+ gdk_atom_intern ("application/x-gtk-text-view-rich-text-format", FALSE),
+ 8, /* bytes */
+ format, len);
+ }
else
{
gchar *str;
@@ -2765,10 +2839,16 @@
create_clipboard_contents_buffer (GtkTextBuffer *buffer)
{
GtkTextBuffer *contents;
+ gchar *format;
contents = gtk_text_buffer_new (gtk_text_buffer_get_tag_table (buffer));
+ format = GTK_TEXT_BUFFER_GET_PRIVATE (buffer)->rich_text_format;
+
g_object_set_data (G_OBJECT (contents), "gtk-text-buffer-clipboard", GINT_TO_POINTER (1));
+
+ g_object_set_data_full (G_OBJECT (contents), "gtk-text-buffer-clipboard-format",
+ format ? g_strdup (format) : NULL, g_free);
return contents;
}
@@ -2786,8 +2866,7 @@
g_assert (contents); /* This should never be called unless we own the clipboard */
- if (selection_data->target ==
- gdk_atom_intern ("GTK_TEXT_BUFFER_CONTENTS", FALSE))
+ if (info == TARGET_TEXT_BUFFER_CONTENTS)
{
/* Provide the address of the clipboard buffer; this will only
* be used within-process. OK to supply a NULL value for contents.
@@ -2798,6 +2877,35 @@
(void*)&contents,
sizeof (contents));
}
+ else if (info == TARGET_TEXT_VIEW_MARKUP)
+ {
+ gchar *str;
+ gint *len;
+ GtkTextIter start, end;
+
+ gtk_text_buffer_get_bounds (contents, &start, &end);
+
+ str = gtk_text_buffer_serialize_rich_text (contents, &start, &end, &len);
+
+ gtk_selection_data_set (selection_data,
+ gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE),
+ 8, /* bytes */
+ str, len);
+ g_free (str);
+ }
+ else if (info == TARGET_TEXT_VIEW_RICH_TEXT_FORMAT)
+ {
+ gint len;
+ gchar *format;
+
+ format = g_object_get_data (G_OBJECT (contents), "gtk-text-buffer-clipboard-format");
+ len = format ? strlen (format) : -1;
+
+ gtk_selection_data_set (selection_data,
+ gdk_atom_intern ("application/x-gtk-text-view-rich-text-format", FALSE),
+ 8, /* bytes */
+ format, len);
+ }
else
{
gchar *str;
@@ -2992,6 +3100,54 @@
#endif
static void
+clipboard_text_view_markup_received (GtkClipboard *clipboard,
+ GtkSelectionData *selection_data,
+ gpointer data)
+{
+ ClipboardRequest *request_data = data;
+ GtkTextIter insert_point;
+ gboolean retval = TRUE;
+ GError *error = NULL;
+ GtkTextBufferPrivate *priv;
+
+ priv = GTK_TEXT_BUFFER_GET_PRIVATE (request_data->buffer);
+
+ if (selection_data->target ==
+ gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE))
+ {
+ pre_paste_prep (request_data, &insert_point);
+
+ if (request_data->interactive)
+ gtk_text_buffer_begin_user_action (request_data->buffer);
+
+ if (!request_data->interactive ||
+ gtk_text_iter_can_insert (&insert_point, request_data->default_editable))
+ retval = gtk_text_buffer_deserialize_rich_text (request_data->buffer,
+ &insert_point,
+ selection_data->data, selection_data->length,
+ priv->rich_text_format == NULL, &error);
+
+ if (!retval)
+ {
+ g_warning ("error pasting: %s\n", error->message);
+ }
+
+ if (request_data->interactive)
+ gtk_text_buffer_end_user_action (request_data->buffer);
+
+ if (retval) {
+ post_paste_cleanup (request_data);
+ return;
+ }
+ }
+
+ /* Request the text selection instead */
+ gtk_clipboard_request_text (clipboard,
+ clipboard_text_received,
+ data);
+}
+
+static void
paste_from_buffer (ClipboardRequest *request_data,
GtkTextBuffer *src_buffer,
const GtkTextIter *start,
@@ -3029,6 +3185,35 @@
g_free (request_data);
}
+static gboolean
+formats_match (GtkClipboard *clipboard, const gchar *format)
+{
+ GtkSelectionData *data;
+ gchar *tmp;
+ gboolean retval;
+
+ if (!format)
+ return TRUE;
+
+ data = gtk_clipboard_wait_for_contents (clipboard,
+ gdk_atom_intern ("application/x-gtk-text-view-rich-text-format", FALSE));
+
+ if (data->length <= 0)
+ retval = FALSE;
+ else
+ {
+ tmp = g_strndup (data->data, data->length);
+
+ retval = (strcmp (tmp, format) == 0);
+
+ g_free (tmp);
+ }
+
+ gtk_selection_data_free (data);
+
+ return retval;
+}
+
static void
clipboard_clipboard_buffer_received (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
@@ -3036,6 +3221,7 @@
{
ClipboardRequest *request_data = data;
GtkTextBuffer *src_buffer;
+ GtkTextBufferPrivate *priv;
src_buffer = selection_data_get_buffer (selection_data, request_data);
@@ -3059,10 +3245,19 @@
}
else
{
- /* Request the text selection instead */
- gtk_clipboard_request_text (clipboard,
- clipboard_text_received,
- data);
+ priv = GTK_TEXT_BUFFER_GET_PRIVATE (request_data->buffer);
+
+ if (priv->can_paste_rich_text &&
+ formats_match (clipboard, priv->rich_text_format))
+ /* Request markup */
+ gtk_clipboard_request_contents (clipboard,
+ gdk_atom_intern ("application/x-gtk-text-view-markup", FALSE),
+ clipboard_text_view_markup_received, data);
+ else
+ /* Request the text selection instead */
+ gtk_clipboard_request_text (clipboard,
+ clipboard_text_received,
+ data);
}
}
@@ -3071,6 +3266,8 @@
{ "TEXT", 0, TARGET_TEXT },
{ "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT },
{ "UTF8_STRING", 0, TARGET_UTF8_STRING },
+ { "application/x-gtk-text-view-markup", 0, TARGET_TEXT_VIEW_MARKUP },
+ { "application/x-gtk-text-view-rich-text-format", 0, TARGET_TEXT_VIEW_RICH_TEXT_FORMAT },
{ "GTK_TEXT_BUFFER_CONTENTS", 0, TARGET_TEXT_BUFFER_CONTENTS }
};
@@ -3591,6 +3788,68 @@
}
}
+void
+gtk_text_buffer_set_can_paste_rich_text (GtkTextBuffer *buffer,
+ gboolean can_paste_rich_text)
+{
+ GtkTextBufferPrivate *priv;
+
+ g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
+
+ priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer);
+
+ can_paste_rich_text = (can_paste_rich_text != FALSE);
+
+ if (priv->can_paste_rich_text != can_paste_rich_text)
+ {
+ priv->can_paste_rich_text = can_paste_rich_text;
+
+ g_object_notify (G_OBJECT (buffer), "can_paste_rich_text");
+ }
+}
+
+gboolean
+gtk_text_buffer_get_can_paste_rich_text (GtkTextBuffer *buffer)
+{
+ GtkTextBufferPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE);
+
+ priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer);
+
+ return priv->can_paste_rich_text;
+}
+
+void
+gtk_text_buffer_set_rich_text_format (GtkTextBuffer *buffer,
+ const gchar *format)
+{
+ gchar *new_format;
+ GtkTextBufferPrivate *priv;
+
+ g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
+
+ priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer);
+
+ new_format = g_strdup (format);
+ g_free (priv->rich_text_format);
+
+ priv->rich_text_format = new_format;
+ g_object_notify (G_OBJECT (buffer), "rich_text_format");
+}
+
+G_CONST_RETURN gchar *
+gtk_text_buffer_get_rich_text_format (GtkTextBuffer *buffer)
+{
+ GtkTextBufferPrivate *priv;
+
+ g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL);
+
+ priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer);
+
+ return priv->rich_text_format;
+}
+
/*
* Logical attribute cache
*/

View File

@ -0,0 +1,17 @@
--- gtk+-2.6.4/gtk/gtktextbuffer.h 2004-10-21 22:13:17.000000000 +0300
+++ gtk+-2.6.4/gtk/gtktextbuffer.h 2005-04-06 16:19:38.024757720 +0300
@@ -365,6 +365,14 @@
void gtk_text_buffer_begin_user_action (GtkTextBuffer *buffer);
void gtk_text_buffer_end_user_action (GtkTextBuffer *buffer);
+void gtk_text_buffer_set_can_paste_rich_text (GtkTextBuffer *buffer,
+ gboolean can_paste_rich_text);
+gboolean gtk_text_buffer_get_can_paste_rich_text (GtkTextBuffer *buffer);
+
+void gtk_text_buffer_set_rich_text_format (GtkTextBuffer *buffer,
+ const gchar *format);
+G_CONST_RETURN gchar *gtk_text_buffer_get_rich_text_format (GtkTextBuffer *buffer);
+
/* INTERNAL private stuff */
void _gtk_text_buffer_spew (GtkTextBuffer *buffer);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
--- gtk+-2.6.4/gtk/gtktextbufferserialize.h 1970-01-01 02:00:00.000000000 +0200
+++ gtk+-2.6.4/gtk/gtktextbufferserialize.h 2005-04-06 16:19:38.025757568 +0300
@@ -0,0 +1,37 @@
+/* gtktextbufferserialize.h
+ *
+ * Copyright (C) 2004 Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+#ifndef GTK_TEXT_BUFFER_SERIALIZE_H
+
+#include <gtk/gtktextbuffer.h>
+
+gchar *gtk_text_buffer_serialize_rich_text (GtkTextBuffer *buffer,
+ const GtkTextIter *start,
+ const GtkTextIter *end,
+ gint *len);
+
+gboolean gtk_text_buffer_deserialize_rich_text (GtkTextBuffer *buffer,
+ GtkTextIter *iter,
+ const gchar *text,
+ gint len,
+ gboolean create_tags,
+ GError **error);
+
+
+#endif /* GTK_TEXT_BUFFER_SERIALIZE_H */

View File

@ -0,0 +1,417 @@
--- gtk+-2.6.4/gtk/gtktextview.c 2005-03-01 08:28:56.000000000 +0200
+++ gtk+-2.6.4/gtk/gtktextview.c 2005-04-06 16:19:38.152738264 +0300
@@ -99,6 +99,11 @@
#define SPACE_FOR_CURSOR 1
+typedef struct _GtkTextViewPrivate GtkTextViewPrivate;
+
+#define GTK_TEXT_VIEW_GET_PRIVATE(obj) ( G_TYPE_INSTANCE_GET_PRIVATE ((obj),\
+ GTK_TYPE_TEXT_VIEW, GtkTextViewPrivate) )
+
struct _GtkTextPendingScroll
{
GtkTextMark *mark;
@@ -145,6 +150,8 @@
PROP_BUFFER,
PROP_OVERWRITE,
PROP_ACCEPTS_TAB,
+ PROP_AUTOCAP,
+ PROP_INPUT_MODE,
LAST_PROP
};
@@ -343,6 +350,13 @@
static void gtk_text_view_update_im_spot_location (GtkTextView *text_view);
+static void gtk_text_view_set_autocap (GtkTextView *text_view,
+ gboolean autocap);
+static gboolean gtk_text_view_get_autocap (GtkTextView *text_view);
+static void gtk_text_view_set_input_mode (GtkTextView *text_view,
+ gint mode);
+static gint gtk_text_view_get_input_mode (GtkTextView *text_view);
+
/* Container methods */
static void gtk_text_view_add (GtkContainer *container,
GtkWidget *child);
@@ -412,6 +426,10 @@
static gint text_window_get_width (GtkTextWindow *win);
static gint text_window_get_height (GtkTextWindow *win);
+struct _GtkTextViewPrivate
+{
+ guint release_selection : 1;
+};
static const GtkTargetEntry target_table[] = {
{ "GTK_TEXT_BUFFER_CONTENTS", GTK_TARGET_SAME_APP, 0 },
@@ -481,6 +499,7 @@
parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private( klass, sizeof(GtkTextViewPrivate) );
/* Default handlers and virtual methods
*/
gobject_class->set_property = gtk_text_view_set_property;
@@ -667,6 +686,24 @@
TRUE,
G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_AUTOCAP,
+ g_param_spec_boolean ("autocap",
+ P_("auto capitalization"),
+ P_("Enable autocap support"),
+ TRUE,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+ g_object_class_install_property (gobject_class,
+ PROP_INPUT_MODE,
+ g_param_spec_int ("input_mode",
+ P_("input mode"),
+ P_("Define widget's input mode"),
+ 0,
+ 9, /* keep me updated */
+ 0,
+ G_PARAM_READABLE | G_PARAM_WRITABLE));
+
/*
* Style properties
*/
@@ -676,6 +713,14 @@
P_("Color with which to draw error-indication underlines"),
GDK_TYPE_COLOR,
G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_boolean ("autocap",
+ _("auto capitalization"),
+ _("Enable autocap support"),
+ TRUE,
+ G_PARAM_READABLE));
+
/*
* Signals
@@ -1040,8 +1085,9 @@
gtk_text_view_init (GtkTextView *text_view)
{
GtkWidget *widget;
-
+ GtkTextViewPrivate *priv = NULL;
widget = GTK_WIDGET (text_view);
+ priv = GTK_TEXT_VIEW_GET_PRIVATE(text_view);
GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
@@ -1057,6 +1103,8 @@
text_view->tabs = NULL;
text_view->editable = TRUE;
+ priv->release_selection = TRUE;
+
gtk_drag_dest_set (widget,
0,
target_table, G_N_ELEMENTS (target_table),
@@ -1070,6 +1118,10 @@
* to it; so we create it here and destroy it in finalize ().
*/
text_view->im_context = gtk_im_multicontext_new ();
+ /* Set default stuff. */
+ gtk_text_view_set_autocap (text_view, TRUE);
+ gtk_text_view_set_input_mode (text_view, 0); /* alpha-numeric-special */
+ g_object_set (G_OBJECT (text_view->im_context), "use-show-hide", TRUE, NULL);
g_signal_connect (text_view->im_context, "commit",
G_CALLBACK (gtk_text_view_commit_handler), text_view);
@@ -2664,6 +2716,14 @@
gtk_text_view_set_accepts_tab (text_view, g_value_get_boolean (value));
break;
+ case PROP_AUTOCAP:
+ gtk_text_view_set_autocap (text_view, g_value_get_boolean (value));
+ break;
+
+ case PROP_INPUT_MODE:
+ gtk_text_view_set_input_mode (text_view, g_value_get_int (value));
+ break;
+
default:
g_assert_not_reached ();
break;
@@ -2738,6 +2798,14 @@
g_value_set_boolean (value, text_view->accepts_tab);
break;
+ case PROP_AUTOCAP:
+ g_value_set_boolean (value, gtk_text_view_get_autocap (text_view));
+ break;
+
+ case PROP_INPUT_MODE:
+ g_value_set_int (value, gtk_text_view_get_input_mode (text_view));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -3916,7 +3984,7 @@
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
GtkTextMark *insert;
GtkTextIter iter;
-
+
if (text_view->layout == NULL || get_buffer (text_view) == NULL)
return FALSE;
@@ -4039,6 +4107,9 @@
if (event->window != text_view->text_window->bin_window)
return FALSE;
+ if (text_view->editable)
+ gtk_im_context_show (text_view->im_context);
+
if (event->button == 1)
{
if (text_view->drag_start_x >= 0)
@@ -4083,7 +4154,15 @@
static gint
gtk_text_view_focus_in_event (GtkWidget *widget, GdkEventFocus *event)
{
+ /*gboolean have_selection;
+ GtkTextIter sel_start, sel_end;*/
+
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
+
+ /*have_selection = gtk_text_buffer_get_selection_bounds(text_view->buffer, &sel_start, &sel_end);
+
+ if(!have_selection)
+ gtk_text_view_move_cursor(text_view, GTK_MOVEMENT_BUFFER_ENDS, 1, FALSE);*//*FIXME some other way to place the cursor in the end*/
gtk_widget_queue_draw (widget);
@@ -4100,8 +4179,10 @@
G_CALLBACK (keymap_direction_changed), text_view);
gtk_text_view_check_keymap_direction (text_view);
+ /* Keyboard hack */
text_view->need_im_reset = TRUE;
gtk_im_context_focus_in (GTK_TEXT_VIEW (widget)->im_context);
+ gtk_text_view_reset_im_context (text_view);
return FALSE;
}
@@ -4110,6 +4191,14 @@
gtk_text_view_focus_out_event (GtkWidget *widget, GdkEventFocus *event)
{
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
+ GtkTextViewPrivate *priv = GTK_TEXT_VIEW_GET_PRIVATE(text_view);
+ /*{
+ GtkTextIter start;
+ GtkTextIter end;
+
+ gtk_text_buffer_get_bounds(text_view->buffer, &start, &end);
+ gtk_text_buffer_select_range(text_view->buffer, &start, &start);
+ }*//*FIXME need a hack here to take away the focus*/
gtk_widget_queue_draw (widget);
@@ -4125,8 +4214,11 @@
keymap_direction_changed,
text_view);
- text_view->need_im_reset = TRUE;
- gtk_im_context_focus_out (GTK_TEXT_VIEW (widget)->im_context);
+ /* This is commented out to disable unselect feature.
+ When the decition of this has been made, we can either remove this patch
+ or to leave it.
+ if( priv->release_selection )
+ gtk_text_view_unselect( text_view );*/
return FALSE;
}
@@ -5082,7 +5174,8 @@
GtkTextIter end;
gboolean leave_one = FALSE;
- gtk_text_view_reset_im_context (text_view);
+ /*gtk_text_view_reset_im_context (text_view);*/ /*backspace should not clear
+ the word completion*/
if (type == GTK_DELETE_CHARS)
{
@@ -5200,7 +5293,8 @@
{
GtkTextIter insert;
- gtk_text_view_reset_im_context (text_view);
+ /*gtk_text_view_reset_im_context (text_view);*/ /*backspace should not clear
+ the word completion*/
/* Backspace deletes the selection, if one exists */
if (gtk_text_buffer_delete_selection (get_buffer (text_view), TRUE,
@@ -5928,11 +6022,11 @@
static void
gtk_text_view_reset_im_context (GtkTextView *text_view)
{
- if (text_view->need_im_reset)
+/* if (text_view->need_im_reset)
{
- text_view->need_im_reset = FALSE;
+ text_view->need_im_reset = FALSE;*/
gtk_im_context_reset (text_view->im_context);
- }
+/* }*/
}
/*
@@ -6665,18 +6759,23 @@
{
GtkTextIter start;
GtkTextIter end;
- gint pos;
+ gint pos, endpos;
gchar *text;
- gtk_text_buffer_get_iter_at_mark (text_view->buffer, &start,
+ gtk_text_buffer_get_iter_at_line (text_view->buffer, &start, 0);
+ gtk_text_buffer_get_iter_at_mark (text_view->buffer, &end,
gtk_text_buffer_get_insert (text_view->buffer));
- end = start;
- pos = gtk_text_iter_get_line_index (&start);
- gtk_text_iter_set_line_offset (&start, 0);
+ pos = gtk_text_iter_get_line_index (&end);
+
gtk_text_iter_forward_to_line_end (&end);
+ endpos = gtk_text_iter_get_line_index (&end);
text = gtk_text_iter_get_slice (&start, &end);
+ if (text)
+ pos = strlen (text) - (endpos - pos); /* want bytes, not characters */
+ else
+ pos = 0;
gtk_im_context_set_surrounding (context, text, -1, pos);
g_free (text);
@@ -6726,8 +6825,8 @@
need_reset = TRUE;
}
- if (need_reset)
- gtk_text_view_reset_im_context (text_view);
+ /*if (need_reset)
+ gtk_text_view_reset_im_context (text_view);*//*FIXME need a hack here*/
}
static void
@@ -6957,6 +7056,13 @@
}
static void
+block_selection_change( GtkMenuShell *menushell, gpointer user_data )
+{
+ GtkTextViewPrivate *priv = GTK_TEXT_VIEW_GET_PRIVATE(user_data);
+ priv->release_selection = TRUE;
+}
+
+static void
unichar_chosen_func (const char *text,
gpointer data)
{
@@ -7064,7 +7170,12 @@
signals[POPULATE_POPUP],
0,
text_view->popup_menu);
-
+ {
+ GtkTextViewPrivate *priv = GTK_TEXT_VIEW_GET_PRIVATE(text_view);
+ g_signal_connect( GTK_WIDGET(text_view->popup_menu), "selection-done",
+ G_CALLBACK(block_selection_change), text_view );
+ priv->release_selection = FALSE;
+ }
if (info->button)
gtk_menu_popup (GTK_MENU (text_view->popup_menu), NULL, NULL,
NULL, NULL,
@@ -8301,3 +8412,81 @@
return gtk_text_layout_move_iter_visually (text_view->layout, iter, count);
}
+
+/*
+ * gtk_text_view_set_autocap:
+ * @entry: a #GtkTextView
+ * @autocap: autocap
+ *
+ * Sets autocapitalization of the widget.
+ */
+static void
+gtk_text_view_set_autocap (GtkTextView *text_view,
+ gboolean autocap)
+{
+ g_return_if_fail (GTK_IS_TEXT_VIEW (text_view));
+
+ if (gtk_text_view_get_autocap (text_view) != autocap)
+ {
+ g_object_set (G_OBJECT (text_view->im_context), "autocap", autocap, NULL);
+ g_object_notify (G_OBJECT (text_view), "autocap");
+ }
+}
+
+/*
+ * gtk_text_view_get_autocap:
+ * @entry: a #GtkTextView
+ *
+ * Gets autocapitalization state of the widget.
+ *
+ * Return value: a state
+ */
+static gboolean
+gtk_text_view_get_autocap (GtkTextView *text_view)
+{
+ gboolean autocap;
+ g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), FALSE);
+
+ g_object_get (G_OBJECT (text_view->im_context), "autocap", &autocap, NULL);
+
+ return autocap;
+}
+
+/*
+ * gtk_text_view_set_input_mode:
+ * @text_view: a #GtkTextView
+ * @mode: input mode
+ *
+ * Sets autocapitalization of the widget.
+ */
+static void
+gtk_text_view_set_input_mode (GtkTextView *text_view,
+ gint mode)
+{
+ g_return_if_fail (GTK_IS_TEXT_VIEW (text_view));
+
+ if (gtk_text_view_get_input_mode (text_view) != mode)
+ {
+ g_object_set (G_OBJECT (text_view->im_context), "input_mode", mode, NULL);
+ g_object_notify (G_OBJECT (text_view), "input_mode");
+ }
+}
+
+/*
+ * gtk_text_view_get_input_mode:
+ * @text_view: a #GtkTextView
+ *
+ * Gets input mode of the widget.
+ *
+ * Return value: input mode
+ */
+static gint
+gtk_text_view_get_input_mode (GtkTextView *text_view)
+{
+ gint mode;
+ g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), FALSE);
+
+ g_object_get (G_OBJECT (text_view->im_context), "input_mode", &mode, NULL);
+
+ return mode;
+}

View File

@ -0,0 +1,252 @@
--- gtk+-2.6.4/gtk/gtktoolbar.c 2004-11-23 06:11:15.000000000 +0200
+++ gtk+-2.6.4/gtk/gtktoolbar.c 2005-04-06 16:19:38.166736136 +0300
@@ -67,7 +67,9 @@
#define DEFAULT_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR
#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH
+#define DEFAULT_ANIMATION_STATE FALSE
+#define DEFAULT_MAX_CHILD_SPACING G_MAXINT
#define MAX_HOMOGENEOUS_N_CHARS 13 /* Items that are wider than this do not participate
* in the homogeneous game. In units of
* pango_font_get_estimated_char_width().
@@ -140,10 +142,14 @@
GTimer * timer;
+ guint animation_connection;
+
guint show_arrow : 1;
guint need_sync : 1;
guint is_sliding : 1;
guint need_rebuild : 1; /* whether the overflow menu should be regenerated */
+ guint animation_set : 1;
+ guint animation : 1;
};
static void gtk_toolbar_init (GtkToolbar *toolbar);
@@ -225,9 +231,11 @@
static void gtk_toolbar_reconfigured (GtkToolbar *toolbar);
static gboolean gtk_toolbar_check_new_api (GtkToolbar *toolbar);
static gboolean gtk_toolbar_check_old_api (GtkToolbar *toolbar);
+static void gtk_toolbar_update_animation_state (GtkToolbar *toolbar);
static GtkReliefStyle get_button_relief (GtkToolbar *toolbar);
static gint get_internal_padding (GtkToolbar *toolbar);
+static gint get_max_child_expand (GtkToolbar *toolbar);
static GtkShadowType get_shadow_type (GtkToolbar *toolbar);
static gint get_space_size (GtkToolbar *toolbar);
static GtkToolbarSpaceStyle get_space_style (GtkToolbar *toolbar);
@@ -563,6 +571,15 @@
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("max_child_expand",
+ P_("Maximum toolbar item spacing"),
+ P_("Maximum space between the toolbar items."),
+ 0,
+ G_MAXINT,
+ DEFAULT_MAX_CHILD_SPACING,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property (widget_class,
g_param_spec_enum ("space_style",
P_("Space style"),
P_("Whether spacers are vertical lines or just blank"),
@@ -598,6 +615,12 @@
GTK_TYPE_ICON_SIZE,
DEFAULT_ICON_SIZE,
G_PARAM_READWRITE));
+
+ gtk_settings_install_property (g_param_spec_boolean ("gtk-toolbar-animation",
+ P_("Toolbar animation"),
+ P_("Are we using toolbar animation"),
+ DEFAULT_ANIMATION_STATE,
+ G_PARAM_READWRITE));
binding_set = gtk_binding_set_by_class (klass);
@@ -638,6 +661,7 @@
toolbar->orientation = GTK_ORIENTATION_HORIZONTAL;
toolbar->style = DEFAULT_TOOLBAR_STYLE;
toolbar->icon_size = DEFAULT_ICON_SIZE;
+ priv->animation = DEFAULT_ANIMATION_STATE;
toolbar->tooltips = gtk_tooltips_new ();
g_object_ref (toolbar->tooltips);
gtk_object_sink (GTK_OBJECT (toolbar->tooltips));
@@ -960,7 +984,7 @@
}
static gint
-position (gint from, gint to, gdouble elapsed)
+position (GtkToolbar *toolbar, gint from, gint to, gdouble elapsed)
{
gint n_pixels;
@@ -978,11 +1002,20 @@
n_pixels = (SLIDE_SPEED / ACCEL_THRESHOLD) * elapsed * elapsed -
SLIDE_SPEED * elapsed + SLIDE_SPEED * ACCEL_THRESHOLD;
}
-
- if (to > from)
- return MIN (from + n_pixels, to);
- else
- return MAX (from - n_pixels, to);
+ if (GTK_TOOLBAR_GET_PRIVATE (toolbar)->animation) {
+ if (to > from)
+ return MIN (from + n_pixels, to);
+ else
+ return MAX (from - n_pixels, to);
+ }
+ return to;
+}
+
+static GtkSettings *
+toolbar_get_settings (GtkToolbar *toolbar)
+{
+ GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
+ return priv->settings;
}
static void
@@ -994,12 +1027,12 @@
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
gdouble elapsed = g_timer_elapsed (priv->timer, NULL);
- intermediate->x = position (start->x, goal->x, elapsed);
- intermediate->y = position (start->y, goal->y, elapsed);
+ intermediate->x = position (toolbar, start->x, goal->x, elapsed);
+ intermediate->y = position (toolbar, start->y, goal->y, elapsed);
intermediate->width =
- position (start->x + start->width, goal->x + goal->width, elapsed) - intermediate->x;
+ position (toolbar, start->x + start->width, goal->x + goal->width, elapsed) - intermediate->x;
intermediate->height =
- position (start->y + start->height, goal->y + goal->height, elapsed) - intermediate->y;
+ position (toolbar, start->y + start->height, goal->y + goal->height, elapsed) - intermediate->y;
}
static void
@@ -1047,6 +1080,32 @@
}
}
+static void
+gtk_toolbar_update_animation_state (GtkToolbar *toolbar)
+{
+ gboolean animation_state;
+ GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
+
+ g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
+
+ if (priv->animation_set)
+ {
+ GtkSettings *settings = toolbar_get_settings (toolbar);
+
+ if (settings)
+ {
+ g_object_get (settings,
+ "gtk-toolbar-animation", &animation_state,
+ NULL);
+ }
+ else
+ animation_state = DEFAULT_ANIMATION_STATE;
+
+ priv->animation = animation_state;
+ priv->animation_set = FALSE;
+ }
+}
+
static gboolean
slide_idle_handler (gpointer data)
{
@@ -1537,10 +1596,14 @@
if (toolbar_content_get_expand (content) && new_states[i] == NORMAL)
{
+ gint mexpand = get_max_child_expand(toolbar);
gint extra = size / n_expand_items;
if (size % n_expand_items != 0)
extra++;
-
+ if (extra > mexpand) {
+ extra = mexpand;
+ }
+
allocations[i].width += extra;
size -= extra;
n_expand_items--;
@@ -1932,11 +1995,16 @@
}
}
-static GtkSettings *
-toolbar_get_settings (GtkToolbar *toolbar)
+static void
+animation_change_notify (GtkToolbar *toolbar)
{
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
- return priv->settings;
+ if (!priv->animation_set)
+ {
+ /* pretend it was set, then unset, thus reverting to new default */
+ priv->animation_set = TRUE;
+ gtk_toolbar_update_animation_state (toolbar);
+ }
}
static void
@@ -1960,6 +2028,7 @@
{
g_signal_handler_disconnect (old_settings, toolbar->style_set_connection);
g_signal_handler_disconnect (old_settings, toolbar->icon_size_connection);
+ g_signal_handler_disconnect (old_settings, priv->animation_connection);
g_object_unref (old_settings);
}
@@ -1976,6 +2045,11 @@
"notify::gtk-toolbar-icon-size",
G_CALLBACK (icon_size_change_notify),
toolbar);
+ priv->animation_connection =
+ g_signal_connect_swapped (settings,
+ "notify::gtk-toolbar-animation",
+ G_CALLBACK (animation_change_notify),
+ toolbar);
g_object_ref (settings);
priv->settings = settings;
@@ -1985,6 +2059,7 @@
style_change_notify (toolbar);
icon_size_change_notify (toolbar);
+ animation_change_notify (toolbar);
}
static int
@@ -2913,7 +2988,7 @@
* gtk_toolbar_get_icon_size:
* @toolbar: a #GtkToolbar
*
- * Retrieves the icon size fo the toolbar. See gtk_toolbar_set_icon_size().
+ * Retrieves the icon size for the toolbar. See gtk_toolbar_set_icon_size().
*
* Return value: the current icon size for the icons on the toolbar.
**/
@@ -4642,6 +4717,17 @@
return ipadding;
}
+static gint
+get_max_child_expand (GtkToolbar *toolbar)
+{
+ gint mexpand = DEFAULT_MAX_CHILD_SPACING;
+
+ gtk_widget_style_get (GTK_WIDGET (toolbar),
+ "max_child_expand", &mexpand,
+ NULL);
+ return mexpand;
+}
+
static GtkShadowType
get_shadow_type (GtkToolbar *toolbar)
{

Some files were not shown because too many files have changed in this diff Show More