Updated.
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com> * NEWS: Updated. * configure.in: Remove support for uninstalled glib. * gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as so as not to stop emission. * gtk-config-2.0.in: Exit with an error message that gtk-config-2.0 is no longer supported. * Makefile.am gtk/Makefile.am tests/*: Moved all tests into tests, change build order to build modules before gtk/. * modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation to here.
This commit is contained in:
parent
748560e1fc
commit
af5c897e4b
19
ChangeLog
19
ChangeLog
@ -1,3 +1,22 @@
|
||||
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
* configure.in: Remove support for uninstalled glib.
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as
|
||||
so as not to stop emission.
|
||||
|
||||
* gtk-config-2.0.in: Exit with an error message that gtk-config-2.0
|
||||
is no longer supported.
|
||||
|
||||
* Makefile.am gtk/Makefile.am tests/*: Moved all tests
|
||||
into tests, change build order to build modules before
|
||||
gtk/.
|
||||
|
||||
* modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation
|
||||
to here.
|
||||
|
||||
Tue Apr 3 13:52:57 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkitemfactory.[hc]: changed gtk_item_factory_dump_items()
|
||||
|
@ -1,3 +1,22 @@
|
||||
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
* configure.in: Remove support for uninstalled glib.
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as
|
||||
so as not to stop emission.
|
||||
|
||||
* gtk-config-2.0.in: Exit with an error message that gtk-config-2.0
|
||||
is no longer supported.
|
||||
|
||||
* Makefile.am gtk/Makefile.am tests/*: Moved all tests
|
||||
into tests, change build order to build modules before
|
||||
gtk/.
|
||||
|
||||
* modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation
|
||||
to here.
|
||||
|
||||
Tue Apr 3 13:52:57 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkitemfactory.[hc]: changed gtk_item_factory_dump_items()
|
||||
|
@ -1,3 +1,22 @@
|
||||
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
* configure.in: Remove support for uninstalled glib.
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as
|
||||
so as not to stop emission.
|
||||
|
||||
* gtk-config-2.0.in: Exit with an error message that gtk-config-2.0
|
||||
is no longer supported.
|
||||
|
||||
* Makefile.am gtk/Makefile.am tests/*: Moved all tests
|
||||
into tests, change build order to build modules before
|
||||
gtk/.
|
||||
|
||||
* modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation
|
||||
to here.
|
||||
|
||||
Tue Apr 3 13:52:57 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkitemfactory.[hc]: changed gtk_item_factory_dump_items()
|
||||
|
@ -1,3 +1,22 @@
|
||||
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
* configure.in: Remove support for uninstalled glib.
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as
|
||||
so as not to stop emission.
|
||||
|
||||
* gtk-config-2.0.in: Exit with an error message that gtk-config-2.0
|
||||
is no longer supported.
|
||||
|
||||
* Makefile.am gtk/Makefile.am tests/*: Moved all tests
|
||||
into tests, change build order to build modules before
|
||||
gtk/.
|
||||
|
||||
* modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation
|
||||
to here.
|
||||
|
||||
Tue Apr 3 13:52:57 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkitemfactory.[hc]: changed gtk_item_factory_dump_items()
|
||||
|
@ -1,3 +1,22 @@
|
||||
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
* configure.in: Remove support for uninstalled glib.
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as
|
||||
so as not to stop emission.
|
||||
|
||||
* gtk-config-2.0.in: Exit with an error message that gtk-config-2.0
|
||||
is no longer supported.
|
||||
|
||||
* Makefile.am gtk/Makefile.am tests/*: Moved all tests
|
||||
into tests, change build order to build modules before
|
||||
gtk/.
|
||||
|
||||
* modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation
|
||||
to here.
|
||||
|
||||
Tue Apr 3 13:52:57 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkitemfactory.[hc]: changed gtk_item_factory_dump_items()
|
||||
|
@ -1,3 +1,22 @@
|
||||
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
* configure.in: Remove support for uninstalled glib.
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as
|
||||
so as not to stop emission.
|
||||
|
||||
* gtk-config-2.0.in: Exit with an error message that gtk-config-2.0
|
||||
is no longer supported.
|
||||
|
||||
* Makefile.am gtk/Makefile.am tests/*: Moved all tests
|
||||
into tests, change build order to build modules before
|
||||
gtk/.
|
||||
|
||||
* modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation
|
||||
to here.
|
||||
|
||||
Tue Apr 3 13:52:57 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkitemfactory.[hc]: changed gtk_item_factory_dump_items()
|
||||
|
@ -1,3 +1,22 @@
|
||||
Tue Apr 3 13:55:37 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated.
|
||||
|
||||
* configure.in: Remove support for uninstalled glib.
|
||||
|
||||
* gtk/gtkdnd.c (gtk_drag_highlight_expose): Return FALSE as
|
||||
so as not to stop emission.
|
||||
|
||||
* gtk-config-2.0.in: Exit with an error message that gtk-config-2.0
|
||||
is no longer supported.
|
||||
|
||||
* Makefile.am gtk/Makefile.am tests/*: Moved all tests
|
||||
into tests, change build order to build modules before
|
||||
gtk/.
|
||||
|
||||
* modules/input/Makefile.am: Move gtk-query-immodules-2.0 invocation
|
||||
to here.
|
||||
|
||||
Tue Apr 3 13:52:57 2001 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkitemfactory.[hc]: changed gtk_item_factory_dump_items()
|
||||
|
@ -1,6 +1,6 @@
|
||||
## Makefile.am for GTK+
|
||||
|
||||
SRC_SUBDIRS = gdk-pixbuf gdk modules gtk demos contrib
|
||||
SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests contrib
|
||||
SUBDIRS = po $(SRC_SUBDIRS) docs build
|
||||
|
||||
# require automake 1.4
|
||||
|
25
NEWS
25
NEWS
@ -1,3 +1,28 @@
|
||||
Overview of Changes in GTK+ 1.3.3
|
||||
=================================
|
||||
|
||||
[ 5600 lines of ChangeLog ]
|
||||
|
||||
* API cleanups
|
||||
* Win32 work (Tor, Hans Breuer)
|
||||
* Focus improvements (Owen)
|
||||
* Frame buffer improvements (Alex)
|
||||
* Work on GtkTextView (Havoc)
|
||||
* Much work on GtkTreeView (Jonathan)
|
||||
* Selectable labels (Havoc)
|
||||
* Converted many arguments to properties (Lee Mallabone, John Margaglione)
|
||||
* Add exact regions to GdkExposeEvent, propagate it. (Alex)
|
||||
* Added ability to have resize grips in status bars (etc.) using
|
||||
_NET_WM_MOVERESIZE protocol. (Havoc)
|
||||
* Added mnemnonic mechanism to make setting underline accelerators
|
||||
much easier. (Alex)
|
||||
* Add per-style property mechanism to allow themes to change
|
||||
geometry parameters. (Tim)
|
||||
* Added global settings mechanisms for settings such as double-click
|
||||
time. (Tim, Owen)
|
||||
* Various support functions for new and old WM properties (Havoc, Alex)
|
||||
* Add TRUE-stops-returns for boolean-returning signals (Ron Steinke)
|
||||
|
||||
Overview of Changes in GTK+ 1.3.2
|
||||
=================================
|
||||
|
||||
|
67
configure.in
67
configure.in
@ -109,7 +109,6 @@ AC_ARG_ENABLE(shm, [ --enable-shm support shared memory if available
|
||||
echo $enable_shm, enable_shm="yes")
|
||||
AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
|
||||
, enable_ansi=no)
|
||||
AC_ARG_WITH(glib, [ --with-glib=DIR Use uninstalled copy of glib])
|
||||
AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
|
||||
, enable_xim="yes")
|
||||
AC_ARG_ENABLE(xim_inst, [ --disable-xim-inst does not use xim instantiate callback],
|
||||
@ -285,68 +284,20 @@ AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
|
||||
CFLAGS="$gtk_save_CFLAGS"
|
||||
AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
|
||||
|
||||
|
||||
#
|
||||
# Find pkg-config
|
||||
#
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
if test x$PKG_CONFIG = xno ; then
|
||||
AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
|
||||
fi
|
||||
# Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
|
||||
#
|
||||
|
||||
if ! pkg-config --atleast-pkgconfig-version 0.5 ; then
|
||||
AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
|
||||
fi
|
||||
GLIB_PACKAGES="gobject-2.0 gmodule-2.0 gthread-2.0"
|
||||
GLIB_REQUIRED_VERSION=1.3.2
|
||||
|
||||
if test x$with_glib = xyes ; then
|
||||
AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
|
||||
AC_MSG_ERROR([
|
||||
*** Directory must be specified for --with-glib])
|
||||
fi
|
||||
*** GLIB $GLIB_REQUIRED_VERSION or better is required. The latest version of
|
||||
*** GLIB is always available from ftp://ftp.gtk.org/.]),
|
||||
gobject gmodule gthread)
|
||||
|
||||
if test x$with_glib = x ; then
|
||||
|
||||
# Look for separately installed glib
|
||||
|
||||
GLIB_PACKAGES="gobject-2.0 gmodule-2.0 gthread-2.0"
|
||||
GLIB_REQUIRED_VERSION=1.3.2
|
||||
|
||||
AC_MSG_CHECKING(GLib flags)
|
||||
if $PKG_CONFIG --atleast-version $GLIB_REQUIRED_VERSION glib-2.0 ; then
|
||||
GLIB_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES`
|
||||
GLIB_LIBS=`$PKG_CONFIG --libs $GLIB_PACKAGES`
|
||||
GLIB_DEPLIBS=$GLIB_LIBS
|
||||
|
||||
AC_MSG_RESULT($GLIB_CFLAGS $GLIB_LIBS)
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
*** GLIB $GLIB_REQUIRED_VERSION or newer is required. The latest version of GLIB
|
||||
*** is always available from ftp://ftp.gtk.org/.
|
||||
])
|
||||
fi
|
||||
|
||||
else
|
||||
# Use uninstalled glib (assume they got the version right)
|
||||
|
||||
if test -e glib-2.0.pc ; then
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured])
|
||||
fi
|
||||
|
||||
# canonicalize relative paths
|
||||
case $with_glib in
|
||||
/*)
|
||||
glib_dir=$with_glib
|
||||
;;
|
||||
*)
|
||||
glib_dir="\$(top_builddir)/$with_glib"
|
||||
;;
|
||||
esac
|
||||
|
||||
GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
|
||||
GLIB_LIBS="$glib_dir/libglib-1.3.la $glib_dir/gmodule/libgmodule-1.3.la"
|
||||
GLIB_DEPLIBS=
|
||||
fi
|
||||
GLIB_DEPLIBS=$GLIB_LIBS
|
||||
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
|
@ -6,6 +6,7 @@ GObject
|
||||
GdkPixmap
|
||||
GdkColormap
|
||||
GtkSettings
|
||||
GtkRcStyle
|
||||
GtkObject
|
||||
GtkWidget
|
||||
GtkMisc
|
||||
|
@ -496,7 +496,6 @@ This can later be composited together with other
|
||||
#GtkRcStyle structures to form a #GtkStyle.
|
||||
</para>
|
||||
|
||||
@parent_instance:
|
||||
@name:
|
||||
@bg_pixmap_name:
|
||||
@font_desc:
|
||||
|
@ -289,7 +289,7 @@ you don't want a return value.
|
||||
the callbacks.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_lookup ##### -->
|
||||
<!-- ##### MACRO gtk_signal_lookup ##### -->
|
||||
<para>
|
||||
Given the name of the signal and the type of object it connects
|
||||
to, get the signal's identifying integer. Emitting the signal
|
||||
@ -299,12 +299,13 @@ by number is somewhat faster than using the name each time.
|
||||
It also tries the ancestors of the given type.
|
||||
</para>
|
||||
|
||||
@Returns: the signal's identifying number, or 0 if no signal was found.
|
||||
<!-- # Unused Parameters # -->
|
||||
@name: the signal's name, e.g. clicked.
|
||||
@object_type: the type that the signal operates on, e.g. #GTK_TYPE_BUTTON.
|
||||
@Returns: the signal's identifying number, or 0 if no signal was found.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_name ##### -->
|
||||
<!-- ##### MACRO gtk_signal_name ##### -->
|
||||
<para>
|
||||
Given the signal's identifier, find its name.
|
||||
</para>
|
||||
@ -312,8 +313,9 @@ Given the signal's identifier, find its name.
|
||||
Two different signals may have the same name, if they have differing types.
|
||||
</para>
|
||||
|
||||
@signal_id: the signal's identifying number.
|
||||
@Returns: the signal name, or NULL if the signal number was invalid.
|
||||
<!-- # Unused Parameters # -->
|
||||
@signal_id: the signal's identifying number.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_emit ##### -->
|
||||
@ -381,7 +383,7 @@ an array of GtkArgs instead of using C's varargs mechanism.
|
||||
followed by one which is a pointer to the return type.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_emit_stop ##### -->
|
||||
<!-- ##### MACRO gtk_signal_emit_stop ##### -->
|
||||
<para>
|
||||
This function aborts a signal's current emission.
|
||||
</para>
|
||||
@ -395,11 +397,11 @@ It will print a warning if used on a signal which
|
||||
isn't being emitted.
|
||||
</para>
|
||||
|
||||
@object: the object whose signal handlers you wish to stop.
|
||||
@signal_id: the signal identifier, as returned by gtk_signal_lookup().
|
||||
<!-- # Unused Parameters # -->
|
||||
@i:
|
||||
@s:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object whose signal handlers you wish to stop.
|
||||
@signal_id: the signal identifier, as returned by gtk_signal_lookup().
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_emit_stop_by_name ##### -->
|
||||
@ -415,7 +417,7 @@ except it will lookup the signal id for you.
|
||||
@name: the name of the signal you wish to stop.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect ##### -->
|
||||
<para>
|
||||
Attach a function pointer and user data to a signal for
|
||||
a particular object.
|
||||
@ -454,38 +456,38 @@ static void attach_print_signal(GtkButton* button, gint to_print)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object associated with the signal, e.g. if a button
|
||||
is getting pressed, this is that button.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@func_data: value to pass as to your function (through the marshaller).
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_after ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect_after ##### -->
|
||||
<para>
|
||||
Attach a function pointer and user data to a signal
|
||||
so that this handler will be called after the other handlers.
|
||||
</para>
|
||||
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@func_data: value to pass as to your function (through the marshaller).
|
||||
@Returns: the unique identifier for this attachment: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the unique identifier for this attachment: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@func_data: value to pass as to your function (through the marshaller).
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_object ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect_object ##### -->
|
||||
<para>
|
||||
This function is for registering a callback that will
|
||||
call another object's callback. That is,
|
||||
@ -506,21 +508,21 @@ gtk_signal_connect_object(button, "clicked", gtk_widget_show, window);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal.
|
||||
@name: the name of the signal.
|
||||
@func: the function to callback.
|
||||
@slot_object: the object to pass as the first parameter to func.
|
||||
(Though it pretends to take an object, you can
|
||||
really pass any gpointer as the #slot_object .)
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_object_after ##### -->
|
||||
<!-- ##### MACRO gtk_signal_connect_object_after ##### -->
|
||||
<para>
|
||||
Attach a signal hook to a signal, passing in an alternate
|
||||
object as the first parameter, and guaranteeing
|
||||
@ -528,16 +530,16 @@ that the default handler and all normal
|
||||
handlers are called first.
|
||||
</para>
|
||||
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@slot_object: the object to pass as the first parameter to #func.
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object associated with the signal.
|
||||
@name: name of the signal.
|
||||
@func: function pointer to attach to the signal.
|
||||
@slot_object: the object to pass as the first parameter to #func.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_connect_full ##### -->
|
||||
@ -626,95 +628,98 @@ should signal the removal of this signal.
|
||||
@name: name of the signal.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_disconnect ##### -->
|
||||
<!-- ##### MACRO gtk_signal_disconnect ##### -->
|
||||
<para>
|
||||
Destroy a user-defined handler connection.
|
||||
</para>
|
||||
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which the handler pertains to.
|
||||
@handler_id: the connection id.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_disconnect_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_disconnect_by_func ##### -->
|
||||
<para>
|
||||
Destroy all connections for a particular object, with
|
||||
the given function-pointer and user-data.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@f:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_disconnect_by_data ##### -->
|
||||
<!-- ##### MACRO gtk_signal_disconnect_by_data ##### -->
|
||||
<para>
|
||||
Destroy all connections for a particular object, with
|
||||
the given user-data.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_block ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_block ##### -->
|
||||
<para>
|
||||
Prevent an user-defined handler from being invoked. All other
|
||||
signal processing will go on as normal, but this particular
|
||||
handler will ignore it.
|
||||
</para>
|
||||
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal to block.
|
||||
@handler_id: the connection id.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_block_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_block_by_func ##### -->
|
||||
<para>
|
||||
Prevent a user-defined handler from being invoked, by reference to
|
||||
the user-defined handler's function pointer and user data. (It may result in
|
||||
multiple hooks being blocked, if you've called connect multiple times.)
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal to block.
|
||||
@func: the function pointer of the handler to block.
|
||||
@data: the user data of the handler to block.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@f:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal to block.
|
||||
@func: the function pointer of the handler to block.
|
||||
@data: the user data of the handler to block.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_block_by_data ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_block_by_data ##### -->
|
||||
<para>
|
||||
Prevent all user-defined handlers with a certain user data from being invoked.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal we want to block.
|
||||
@data: the user data of the handlers to block.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to block.
|
||||
@data: the user data of the handlers to block.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_unblock ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_unblock ##### -->
|
||||
<para>
|
||||
Undo a block, by connection id. Note that undoing a block doesn't
|
||||
necessarily make the hook callable, because if you block a
|
||||
hook twice, you must unblock it twice.
|
||||
</para>
|
||||
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@handler_id: the emission handler identifier, as returned by
|
||||
gtk_signal_connect(), etc.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_unblock_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_unblock_by_func ##### -->
|
||||
<para>
|
||||
Undo a block, by function pointer and data.
|
||||
Note that undoing a block doesn't
|
||||
@ -722,29 +727,29 @@ necessarily make the hook callable, because if you block a
|
||||
hook twice, you must unblock it twice.
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@f:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_unblock_by_data ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_unblock_by_data ##### -->
|
||||
<para>
|
||||
Undo block(s), to all signals for a particular object
|
||||
with a particular user-data pointer
|
||||
</para>
|
||||
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@data: the user data to search for.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@d:
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object which emits the signal we want to unblock.
|
||||
@data: the user data to search for.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_pending ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_pending ##### -->
|
||||
<para>
|
||||
Returns a connection id corresponding to a given signal id and object.
|
||||
</para>
|
||||
@ -755,36 +760,36 @@ may opt to not emit the signal if no one is attached anyway,
|
||||
thus saving the cost of building the arguments.
|
||||
</para>
|
||||
|
||||
@i:
|
||||
@s:
|
||||
@b:
|
||||
@Returns: the connection id, if a connection was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object to search for the desired user-defined handler.
|
||||
@signal_id: the number of the signal to search for.
|
||||
@may_be_blocked: whether it is acceptable to return a blocked
|
||||
handler.
|
||||
@Returns: the connection id, if a connection was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@i:
|
||||
@s:
|
||||
@b:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_signal_handler_pending_by_func ##### -->
|
||||
<!-- ##### MACRO gtk_signal_handler_pending_by_func ##### -->
|
||||
<para>
|
||||
Returns a connection id corresponding to a given signal id, object, function
|
||||
pointer and user data.
|
||||
</para>
|
||||
|
||||
@o:
|
||||
@s:
|
||||
@b:
|
||||
@f:
|
||||
@d:
|
||||
@Returns: the connection id, if a handler was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@object: the object to search for the desired handler.
|
||||
@signal_id: the number of the signal to search for.
|
||||
@may_be_blocked: whether it is acceptable to return a blocked
|
||||
handler.
|
||||
@func: the function pointer to search for.
|
||||
@data: the user data to search for.
|
||||
@Returns: the connection id, if a handler was found. 0 otherwise.
|
||||
<!-- # Unused Parameters # -->
|
||||
@o:
|
||||
@s:
|
||||
@b:
|
||||
@f:
|
||||
@d:
|
||||
|
||||
|
||||
<!-- ##### MACRO gtk_signal_default_marshaller ##### -->
|
||||
|
@ -560,30 +560,33 @@ Create a new, unique type.
|
||||
@type_info: must not be null, and @type_info->type_name must also not be null.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_name ##### -->
|
||||
<!-- ##### MACRO gtk_type_name ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@type: a GtkType
|
||||
@Returns: a pointer to the name of a type, or NULL if it has none.
|
||||
<!-- # Unused Parameters # -->
|
||||
@type: a GtkType
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_from_name ##### -->
|
||||
<!-- ##### MACRO gtk_type_from_name ##### -->
|
||||
<para>
|
||||
Get the internal representation of a type given its name.
|
||||
</para>
|
||||
|
||||
@name: the name of a gtk type
|
||||
@Returns: a GtkType
|
||||
<!-- # Unused Parameters # -->
|
||||
@name: the name of a gtk type
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_parent ##### -->
|
||||
<!-- ##### MACRO gtk_type_parent ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@type: a GtkType
|
||||
@Returns: the GtkType of the parent
|
||||
<!-- # Unused Parameters # -->
|
||||
@type: a GtkType
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_class ##### -->
|
||||
@ -608,15 +611,16 @@ has all the proper initializers called.
|
||||
@Returns: gpointer to a GtkTypeObject
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_is_a ##### -->
|
||||
<!-- ##### MACRO gtk_type_is_a ##### -->
|
||||
<para>
|
||||
Look in the type hierarchy to see if @type has @is_a_type among its
|
||||
ancestors. Do so with a simple lookup, not a loop.
|
||||
</para>
|
||||
|
||||
@Returns:
|
||||
<!-- # Unused Parameters # -->
|
||||
@type: GtkType
|
||||
@is_a_type: GtkType
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_type_enum_get_values ##### -->
|
||||
|
189
gtk-2.0.m4
189
gtk-2.0.m4
@ -1,69 +1,65 @@
|
||||
# Configure paths for GTK+
|
||||
# Owen Taylor 97-11-3
|
||||
# Configure paths for GLIB
|
||||
# Owen Taylor 1997-2001
|
||||
|
||||
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
|
||||
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
|
||||
dnl gthread is specified in MODULES, pass to glib-config
|
||||
dnl
|
||||
AC_DEFUN(AM_PATH_GTK_2_0,
|
||||
AC_DEFUN(AM_PATH_GLIB_2_0,
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the gtk-config-2.0 script
|
||||
dnl Get the cflags and libraries from the glib-config-2.0 script
|
||||
dnl
|
||||
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
|
||||
gtk_config_prefix="$withval", gtk_config_prefix="")
|
||||
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
|
||||
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
|
||||
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
|
||||
, enable_gtktest=yes)
|
||||
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
|
||||
, enable_glibtest=yes)
|
||||
|
||||
pkg_config_args=gtk+-2.0
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gthread)
|
||||
gtk_config_args="$gtk_config_args gthread"
|
||||
pkg_config_args="$pkg_config_args gthread-2.0"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test x$gtk_config_exec_prefix != x ; then
|
||||
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
|
||||
if test x${GTK_CONFIG_2_0+set} != xset ; then
|
||||
GTK_CONFIG_2_0=$gtk_config_exec_prefix/bin/gtk-config-2.0
|
||||
fi
|
||||
fi
|
||||
if test x$gtk_config_prefix != x ; then
|
||||
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
|
||||
if test x${GTK_CONFIG_2_0+set} != xset ; then
|
||||
GTK_CONFIG_2_0=$gtk_config_prefix/bin/gtk-config-2.0
|
||||
fi
|
||||
min_glib_version=ifelse([$1], ,1.3.3,$1)
|
||||
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
|
||||
|
||||
no_glib=""
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
if pkg-config --atleast-pkgconfig-version 0.5 ; then
|
||||
:
|
||||
else
|
||||
echo *** pkg-config too old; version 0.5 or better required.
|
||||
no_glib=yes
|
||||
PKG_CONFIG=no
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(GTK_CONFIG_2_0, gtk-config-2.0, no)
|
||||
min_gtk_version=ifelse([$1], ,1.3.1,$1)
|
||||
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
|
||||
no_gtk=""
|
||||
if test "$GTK_CONFIG_2_0" = "no" ; then
|
||||
no_gtk=yes
|
||||
else
|
||||
GTK_CFLAGS=`$GTK_CONFIG_2_0 $gtk_config_args --cflags`
|
||||
GTK_LIBS=`$GTK_CONFIG_2_0 $gtk_config_args --libs`
|
||||
gtk_config_major_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
if test x"$no_glib" = x ; then
|
||||
GLIB_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
|
||||
GLIB_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
|
||||
glib_config_major_version=`$PKG_CONFIG glib-2.0 --modversion | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
gtk_config_minor_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
glib_config_minor_version=`$PKG_CONFIG glib-2.0 --modversion | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
gtk_config_micro_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
glib_config_micro_version=`$PKG_CONFIG glib-2.0 --modversion | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
if test "x$enable_glibtest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$GTK_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$GLIB_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GTK is sufficiently new. (Also sanity
|
||||
dnl checks the results of gtk-config-2.0 to some extent
|
||||
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
|
||||
dnl checks the results of glib-config-2.0 to some extent
|
||||
dnl
|
||||
rm -f conf.gtktest
|
||||
rm -f conf.glibtest
|
||||
AC_TRY_RUN([
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -73,98 +69,93 @@ main ()
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.gtktest");
|
||||
system ("touch conf.glibtest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_gtk_version");
|
||||
tmp_version = g_strdup("$min_glib_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_gtk_version");
|
||||
printf("%s, bad version string\n", "$min_glib_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((gtk_major_version != $gtk_config_major_version) ||
|
||||
(gtk_minor_version != $gtk_config_minor_version) ||
|
||||
(gtk_micro_version != $gtk_config_micro_version))
|
||||
if ((glib_major_version != $glib_config_major_version) ||
|
||||
(glib_minor_version != $glib_config_minor_version) ||
|
||||
(glib_micro_version != $glib_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'gtk-config-2.0 --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
|
||||
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf ("*** was found! If gtk-config-2.0 was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
|
||||
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
|
||||
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf ("*** was found! If pkg-config was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If gtk-config-2.0 was wrong, set the environment variable GTK_CONFIG_2_0\n");
|
||||
printf("*** to point to the correct copy of gtk-config-2.0, and remove the file config.cache\n");
|
||||
printf("*** before re-running configure\n");
|
||||
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
|
||||
printf("*** to point to the correct configuration files\n");
|
||||
}
|
||||
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
|
||||
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
|
||||
(gtk_minor_version != GTK_MINOR_VERSION) ||
|
||||
(gtk_micro_version != GTK_MICRO_VERSION))
|
||||
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
|
||||
(glib_minor_version != GLIB_MINOR_VERSION) ||
|
||||
(glib_micro_version != GLIB_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
|
||||
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
|
||||
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
|
||||
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
}
|
||||
#endif /* defined (GTK_MAJOR_VERSION) ... */
|
||||
else
|
||||
{
|
||||
if ((gtk_major_version > major) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
|
||||
if ((glib_major_version > major) ||
|
||||
((glib_major_version == major) && (glib_minor_version > minor)) ||
|
||||
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
|
||||
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the gtk-config-2.0 shell script is\n");
|
||||
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GTK+, but you can also set the GTK_CONFIG_2_0 environment to point to the\n");
|
||||
printf("*** correct copy of gtk-config-2.0. (In this case, you will have to\n");
|
||||
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
|
||||
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_gtk" = x ; then
|
||||
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
|
||||
if test "x$no_glib" = x ; then
|
||||
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$GTK_CONFIG_2_0" = "no" ; then
|
||||
echo "*** The gtk-config-2.0 script installed by GTK could not be found"
|
||||
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the GTK_CONFIG_2_0 environment variable to the"
|
||||
echo "*** full path to gtk-config-2.0."
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** A new enough version of pkg-config was not found."
|
||||
echo "*** See http://pkgconfig.sourceforge.net"
|
||||
else
|
||||
if test -f conf.gtktest ; then
|
||||
if test -f conf.glibtest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GTK test program, checking why..."
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
echo "*** Could not run GLIB test program, checking why..."
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$LIBS $GLIB_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
|
||||
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GTK or finding the wrong"
|
||||
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
|
||||
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
|
||||
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
@ -177,18 +168,18 @@ main ()
|
||||
echo "***"
|
||||
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
|
||||
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the gtk-config-2.0 script: $GTK_CONFIG_2_0" ])
|
||||
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
|
||||
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GTK_CFLAGS=""
|
||||
GTK_LIBS=""
|
||||
GLIB_CFLAGS=""
|
||||
GLIB_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
rm -f conf.gtktest
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
rm -f conf.glibtest
|
||||
])
|
||||
|
@ -1,118 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
glib_libs="@glib_libs@"
|
||||
glib_cflags="@glib_cflags@"
|
||||
glib_thread_libs="@glib_thread_libs@"
|
||||
glib_thread_cflags="@glib_thread_cflags@"
|
||||
|
||||
target=@gdktarget@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
exec_prefix_set=no
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: gtk-config-2.0 [OPTIONS] [LIBRARIES]
|
||||
Options:
|
||||
[--prefix[=DIR]]
|
||||
[--exec-prefix[=DIR]]
|
||||
[--target=gdktarget]
|
||||
[--version]
|
||||
[--libs]
|
||||
[--cflags]
|
||||
Libraries:
|
||||
gtk
|
||||
gthread
|
||||
EOF
|
||||
exit $1
|
||||
}
|
||||
|
||||
if test $# -eq 0; then
|
||||
usage 1 1>&2
|
||||
fi
|
||||
|
||||
lib_gtk=yes
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--prefix=*)
|
||||
prefix=$optarg
|
||||
if test $exec_prefix_set = no ; then
|
||||
exec_prefix=$optarg
|
||||
fi
|
||||
;;
|
||||
--prefix)
|
||||
echo_prefix=yes
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix=$optarg
|
||||
exec_prefix_set=yes
|
||||
;;
|
||||
--target=*)
|
||||
target=$optarg
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo_exec_prefix=yes
|
||||
;;
|
||||
--version)
|
||||
echo @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@
|
||||
;;
|
||||
--cflags)
|
||||
echo_cflags=yes
|
||||
;;
|
||||
--libs)
|
||||
echo_libs=yes
|
||||
;;
|
||||
gtk)
|
||||
lib_gtk=yes
|
||||
;;
|
||||
gthread)
|
||||
lib_gthread=yes
|
||||
;;
|
||||
*)
|
||||
usage 1 1>&2
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test "$echo_prefix" = "yes"; then
|
||||
echo $prefix
|
||||
fi
|
||||
|
||||
if test "$echo_exec_prefix" = "yes"; then
|
||||
echo $exec_prefix
|
||||
fi
|
||||
|
||||
if test "$lib_gthread" = "yes"; then
|
||||
glib_cflags="$glib_thread_cflags"
|
||||
glib_libs="$glib_thread_libs"
|
||||
fi
|
||||
|
||||
if test "$echo_cflags" = "yes"; then
|
||||
includes=-I@includedir@/gtk-2.0
|
||||
echo -I@libdir@/gtk-2.0/include $includes $glib_cflags @PANGO_CFLAGS@ @more_cflags@
|
||||
fi
|
||||
|
||||
if test "$echo_libs" = "yes"; then
|
||||
my_glib_libs=
|
||||
libdirs=-L@libdir@
|
||||
for i in $glib_libs ; do
|
||||
if test $i != -L@libdir@ ; then
|
||||
if test -z "$my_glib_libs" ; then
|
||||
my_glib_libs="$i"
|
||||
else
|
||||
my_glib_libs="$my_glib_libs $i"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo $libdirs @more_ldflags@ -lgtk-$target-1.3 -lgdk_pixbuf-1.3 -lgdk-$target-1.3 $my_glib_libs @INTLLIBS@ @PANGO_LIBS@ @more_libs@ @GDK_WLIBS@ @MATH_LIB@
|
||||
fi
|
||||
|
||||
echo gtk-config-2.0 is no longer supported. Please use pkg-config instead 2>&1
|
||||
exit 1
|
||||
|
@ -7,18 +7,7 @@ makefile.msc
|
||||
_libs
|
||||
.libs
|
||||
libgtk-*.la
|
||||
testcalendar
|
||||
testgtk
|
||||
testinput
|
||||
testrgb
|
||||
testselection
|
||||
testtext
|
||||
testtextbuffer
|
||||
treestoretest
|
||||
simple
|
||||
testtree
|
||||
gtkcompat.h
|
||||
testthreads
|
||||
libgtk.la
|
||||
gtkfeatures.h
|
||||
gtkmarshal.h
|
||||
@ -34,5 +23,4 @@ stamp-gtktypebuiltins.h
|
||||
stamp-gtkmarshal.h
|
||||
stamp-gtk.defs
|
||||
gtk-query-immodules-2.0
|
||||
gtk.immodules
|
||||
.saved
|
||||
|
116
gtk/3DRings.xpm
116
gtk/3DRings.xpm
@ -1,116 +0,0 @@
|
||||
/* XPM */
|
||||
static char * DRings_xpm[] = {
|
||||
"48 48 65 1",
|
||||
" c None",
|
||||
". c #104010404103",
|
||||
"X c #1040208130C2",
|
||||
"o c #104014515144",
|
||||
"O c #000010402081",
|
||||
"+ c #1040104030C2",
|
||||
"@ c #208120815144",
|
||||
"# c #28A241035965",
|
||||
"$ c #30C230C26185",
|
||||
"% c #208130C24103",
|
||||
"& c #104010402081",
|
||||
"* c #104000002081",
|
||||
"= c #000010401040",
|
||||
"- c #492441036185",
|
||||
"; c #596559659E79",
|
||||
": c #30C220815144",
|
||||
"> c #0820186128A2",
|
||||
", c #000000001040",
|
||||
"< c #2081104030C2",
|
||||
"1 c #514459659658",
|
||||
"2 c #514455556185",
|
||||
"3 c #104000001040",
|
||||
"4 c #000008200000",
|
||||
"5 c #618569A6AEBA",
|
||||
"6 c #618569A69658",
|
||||
"7 c #410345148E38",
|
||||
"8 c #104020814103",
|
||||
"9 c #79E782079658",
|
||||
"0 c #208120814103",
|
||||
"q c #596571C69E79",
|
||||
"w c #4103514471C6",
|
||||
"e c #2081208130C2",
|
||||
"r c #6185618571C6",
|
||||
"t c #28A228A25965",
|
||||
"y c #596561858617",
|
||||
"u c #96589E79BEFB",
|
||||
"i c #28A230C271C6",
|
||||
"p c #38E345145144",
|
||||
"a c #79E78207A699",
|
||||
"s c #30C2492469A6",
|
||||
"d c #410330C25965",
|
||||
"f c #410351446185",
|
||||
"g c #AEBAAAAAD75C",
|
||||
"h c #38E338E34103",
|
||||
"j c #EFBEEBADEFBE",
|
||||
"k c #208130C25144",
|
||||
"l c #9658A289DF7D",
|
||||
"z c #208110404103",
|
||||
"x c #28A228A26185",
|
||||
"c c #8E388A28BEFB",
|
||||
"v c #208118612081",
|
||||
"b c #38E3451479E7",
|
||||
"n c #4924618579E7",
|
||||
"m c #86178617B6DA",
|
||||
"M c #30C220814103",
|
||||
"N c #104030C25144",
|
||||
"B c #4103410371C6",
|
||||
"V c #86178A28D75C",
|
||||
"C c #DF7DDB6CE79D",
|
||||
"Z c #BEFBC30BD75C",
|
||||
"A c #410330C271C6",
|
||||
"S c #30C228A230C2",
|
||||
"D c #082008201861",
|
||||
"F c #186130C238E3",
|
||||
"G c #0000208130C2",
|
||||
" .Xo ",
|
||||
" O+O@#$% ",
|
||||
" &*=+X-;: ",
|
||||
" >&=,=<11#2 ",
|
||||
" +O34,X567& ",
|
||||
" 8X+=,90q9w. ",
|
||||
" +e<>3r tyu-& ",
|
||||
" Xi%.= paus+ ",
|
||||
" Od-@= fga$h ",
|
||||
" @y7X, Xrjak ",
|
||||
" 2:eaw+ $ag;@ ",
|
||||
" .X@8@k@o@X+ +pl9tO ",
|
||||
" +zX@x$$isikt8o02crv ",
|
||||
" 8@%ip7757ywbs$Ohn6#. ",
|
||||
" &0%$p7r215ybw1pzp2-0= ",
|
||||
" 8tk$#yw21665n;1+%-p$O ",
|
||||
" O<e7pbryq5am9ay6XMpM>3& ",
|
||||
" 9.NtpBw16amclVcm1t%kX*88 ",
|
||||
" +&etd7r6y9ulgglm6>e>3s@83 ",
|
||||
" +0k$y-y69cgCCCZVam%+#ik8X ",
|
||||
" O&oi$d725amgCjCZu962ybtx8+p ",
|
||||
" &X0x$sBym9VZCCCZca;yBbi%08& ",
|
||||
" =++@sApMy5muZZgum6y2wds:>+& ",
|
||||
" #tp;1;yB#i25cVucma5;w-pti@8& ",
|
||||
" .#2alumnBp:@1r59y9y6ywBS$%0X+= ",
|
||||
" %$wmZVu;#tX8X07r1656y2wbp$k@%@OD ",
|
||||
" 0Byc9a;h%0>&D&hBrr2r1bwB-AF:0<&*= ",
|
||||
" kBf;yr#@X+&<%MkhsBwBwpsB#Bktkt8+Oh ",
|
||||
" xt7B-t8*,3O.X00:$i#dBd#bptFek0X.+* ",
|
||||
" Xt#b#@=, =&O+X0Ft%ibsp$p$ki%l5sX&= ",
|
||||
" &<kvX&4 +O*&<X0e:%$pAti%:edugn0= ",
|
||||
" +X@&+, V,O&>+Xt>tktktv0%@k;Cls+ ",
|
||||
" =+O*4*X:p;9cy3&&8ve0FMtt$ee0>z7cZ6k ",
|
||||
" D=D4,=.k$sBs$ee=+X0Fk%-#t%0X&O0nu9bG ",
|
||||
" ,,434*&ze@F<eeeeee><tdhdSMe<&&XAaawx ",
|
||||
" 4,4,=+><peeeeee&=<%M%$hSF0X&O&kw5r%Z ",
|
||||
" D&vSFMF<>&D =0S-2i& ",
|
||||
" +>puB> >0h7s. ",
|
||||
" SM5VqM &0t#$8 ",
|
||||
" XpVV70 &0kMk. ",
|
||||
" XdyB%z *X<%@+ ",
|
||||
" &k$b0X+=8X08o ",
|
||||
" &e:e+=*X.X+& ",
|
||||
" +X.O+X0O.=, ",
|
||||
" +>&+0>3&* ",
|
||||
" &X0k+O, ",
|
||||
" >v,3 ",
|
||||
" "};
|
@ -1,98 +0,0 @@
|
||||
/* XPM */
|
||||
static char * FilesQueue_xpm[] = {
|
||||
"44 31 64 1",
|
||||
" c None",
|
||||
". c #E79DE38DDF7D",
|
||||
"X c #CF3CC71BCF3C",
|
||||
"o c #71C675D671C6",
|
||||
"O c #B6DAB2CAB6DA",
|
||||
"+ c #CF3CD34CCF3C",
|
||||
"@ c #DF7DE38DE79D",
|
||||
"# c #FFFFFBEEFFFF",
|
||||
"$ c #EFBEEFBEEFBE",
|
||||
"% c #DF7DDB6CDF7D",
|
||||
"& c #BEFBBAEAC71B",
|
||||
"* c #BEFBBAEABEFB",
|
||||
"= c #BEFBC30BC71B",
|
||||
"- c #71C66DB671C6",
|
||||
"; c #D75CD34CD75C",
|
||||
": c #9E799A699E79",
|
||||
"> c #E79DE38DE79D",
|
||||
", c #CF3CCB2BC71B",
|
||||
"< c #B6DAB2CABEFB",
|
||||
"1 c #BEFBBAEAB6DA",
|
||||
"2 c #B6DAB6DAB6DA",
|
||||
"3 c #618561856185",
|
||||
"4 c #C71BBAEABEFB",
|
||||
"5 c #AEBAAAAAAEBA",
|
||||
"6 c #965892488E38",
|
||||
"7 c #A699A699A699",
|
||||
"8 c #38E338E338E3",
|
||||
"9 c #F7DEF7DEF7DE",
|
||||
"0 c #E79DEFBEEFBE",
|
||||
"q c #DF7DE38DDF7D",
|
||||
"w c #C71BC71BC71B",
|
||||
"e c #C71BC30BBEFB",
|
||||
"r c #BEFBC30BBEFB",
|
||||
"t c #B6DAAAAAAEBA",
|
||||
"y c #410345144103",
|
||||
"u c #D75CDB6CD75C",
|
||||
"i c #C71BCB2BC71B",
|
||||
"p c #BEFBCB2BBEFB",
|
||||
"a c #9E79A289A699",
|
||||
"s c #86178E388E38",
|
||||
"d c #CF3CCF3CD75C",
|
||||
"f c #CF3CD75CCF3C",
|
||||
"g c #C71BC30BCF3C",
|
||||
"h c #28A22CB228A2",
|
||||
"j c #000000000000",
|
||||
"k c #D75CD34CDF7D",
|
||||
"l c #10400C300820",
|
||||
"z c #E79DEBADEFBE",
|
||||
"x c #DF7DDB6CD75C",
|
||||
"c c #514459655965",
|
||||
"v c #8617861779E7",
|
||||
"b c #DF7DD34CD75C",
|
||||
"n c #CF3CCB2BCF3C",
|
||||
"m c #618555555965",
|
||||
"M c #861786178617",
|
||||
"N c #30C234D330C2",
|
||||
"B c #EFBEEBADE79D",
|
||||
"V c #DF7DDB6CE79D",
|
||||
"C c #D75CE38DD75C",
|
||||
"Z c #514449245144",
|
||||
"A c #186120812081",
|
||||
"S c #79E77DF779E7",
|
||||
"D c #6185659569A6",
|
||||
"F c #9E7992489E79",
|
||||
" .XoOX+ ",
|
||||
" @#$%&*=-o;: ",
|
||||
" @>,=O<12*&:-<3X ",
|
||||
" >%&1*4*2*OO**56758790 ",
|
||||
" 9qX+we=r*&e<<<251t5555yu9 ",
|
||||
" $qu++;ipi=p*=p**2tOOO27a5s<- ",
|
||||
" #9udfXi;,gi&**4**4r*Ot5t55tehj ",
|
||||
" 0qku+u;+d,gg=*=r*&**&<255t<*yl1 ",
|
||||
" $$zq@%xk%uf;,w,i=i=e**r=12tO1=8cvj ",
|
||||
" $@%>.%.%%%xbkx,w+ni,wwrwe*4*1=;8mMNj ",
|
||||
" zz@Bz>>>V%%%C+u;;dfnnfwggi&=&X+yZsNll ",
|
||||
" af#9@B0>q>qqq>xk.;;;kfX+XnXw=g,fycMhhN5 ",
|
||||
" al5#9$$>qzBV.%x%%b;x+fnf+,X,iiqym6NAo-j ",
|
||||
" #roS%#$zz>>V%%xkk%f;;+df,XnwnVZD:8AS-j* ",
|
||||
" D-9Oy*9$Bz>q%qx%%u;x;;dknX+d>Zm:hhSDjr ",
|
||||
" a3o+>S3z#90@@z.%>qCC%uu;ff%@Zm:NhMoj= ",
|
||||
" wlvvo#:3599$>B>q>%%%%+f;fk$ymaalMvjr ",
|
||||
" 0.a--S49mct9$z@.qkkqC;xu%@Zm5AlvSj* ",
|
||||
" ohu%3:Z:9@y609q@@>..>Cx>$Zm5NhMvjr ",
|
||||
" -j797Zv5705y=#$0>>V.%>#Z378AMMj* ",
|
||||
" Zj9Xo-McBXDv%90.%%#9cc78AsMj* ",
|
||||
" 8hM#M-DSF96cvz0>z#c35Nhs6j1 ",
|
||||
" jl9#o63vx#-D###mmt8N66j* ",
|
||||
" 5jc@fZF3o%+ZFDm<8A6FjO ",
|
||||
" :j50sSay<$ss2Nh:FjO ",
|
||||
" 6880&SDMF.rNNFFj1 ",
|
||||
" 8jr#:SFScA6ajO ",
|
||||
" Alr$DSysajO ",
|
||||
" >jy#51:jO ",
|
||||
" %Dy*gjO ",
|
||||
" alla "};
|
@ -494,9 +494,6 @@ EXTRA_LTLIBRARIES = libgtk-x11-1.3.la libgtk-nanox-1.3.la libgtk-linux-fb-1.3.la
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk-2.0
|
||||
echo "# Empty gtkrc for default theme" > $(DESTDIR)$(datadir)/themes/Default/gtk-2.0/gtkrc
|
||||
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0
|
||||
$(top_builddir)/gtk/gtk-query-immodules-2.0 > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-2.0/gtkrc
|
||||
|
||||
DEPS = @gtktargetlib@ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-1.3.la $(top_builddir)/gdk/@gdktargetlib@
|
||||
@ -525,38 +522,6 @@ gtk_query_immodules_2_0_LDADD = $(LDADDS)
|
||||
|
||||
gtk_query_immodules_2_0_SOURCES = queryimmodules.c
|
||||
|
||||
gtk.immodules: gtk-query-immodules-2.0 ../modules/input/Makefile.am
|
||||
./gtk-query-immodules-2.0 ../modules/input/.libs/*.so > gtk.immodules
|
||||
|
||||
#
|
||||
# test programs, not to be installed
|
||||
#
|
||||
noinst_PROGRAMS = testgtk testcalendar testinput testselection testrgb testdnd testtext simple treestoretest testtextbuffer # testthreads
|
||||
|
||||
testcalendar_DEPENDENCIES = $(TEST_DEPS)
|
||||
testgtk_DEPENDENCIES = $(TEST_DEPS)
|
||||
testinput_DEPENDENCIES = $(TEST_DEPS)
|
||||
testrgb_DEPENDENCIES = $(TEST_DEPS)
|
||||
testselection_DEPENDENCIES = $(TEST_DEPS)
|
||||
testtext_DEPENDENCIES = $(TEST_DEPS)
|
||||
testtextbuffer_DEPENDENCIES = $(TEST_DEPS)
|
||||
treestoretest_DEPENDENCIES = $(TEST_DEPS)
|
||||
testdnd_DEPENDENCIES = $(TEST_DEPS)
|
||||
simple_DEPENDENCIES = $(TEST_DEPS)
|
||||
#testthreads_DEPENDENCIES = $(TEST_DEPS)
|
||||
|
||||
testcalendar_LDADD = $(LDADDS)
|
||||
testgtk_LDADD = $(LDADDS)
|
||||
testinput_LDADD = $(LDADDS)
|
||||
testrgb_LDADD = $(LDADDS)
|
||||
testselection_LDADD = $(LDADDS)
|
||||
testtext_LDADD = $(LDADDS)
|
||||
testtextbuffer_LDADD = $(LDADDS)
|
||||
treestoretest_LDADD = $(LDADDS)
|
||||
testdnd_LDADD = $(LDADDS)
|
||||
simple_LDADD = $(LDADDS)
|
||||
#testthreads_LDADD = $(LDADDS)
|
||||
|
||||
.PHONY: files test test-debug
|
||||
|
||||
files:
|
||||
@ -564,38 +529,14 @@ files:
|
||||
echo $$p; \
|
||||
done
|
||||
|
||||
test: testgtk
|
||||
builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \
|
||||
cd $$builddir; cd $(srcdir); \
|
||||
$(SHELL) $$top_builddir/libtool --mode=execute $$builddir/testgtk
|
||||
|
||||
test-debug: testgtk
|
||||
builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \
|
||||
cd $$builddir; cd $(srcdir); \
|
||||
$(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk
|
||||
|
||||
EXTRA_DIST += @STRIP_BEGIN@ \
|
||||
oldest-source-stamp \
|
||||
testgtk.1 \
|
||||
testgtkrc \
|
||||
testgtkrc2 \
|
||||
circles.xbm \
|
||||
line-arrow.xbm \
|
||||
line-wrap.xbm \
|
||||
tree_plus.xbm \
|
||||
tree_minus.xbm \
|
||||
3DRings.xpm \
|
||||
FilesQueue.xpm \
|
||||
Modeller.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
marble.xpm \
|
||||
tree_minus.xpm \
|
||||
tree_plus.xpm \
|
||||
test.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
test.xpm \
|
||||
gtk.def \
|
||||
gtk-win32.rc \
|
||||
gtk-win32.rc.in \
|
||||
|
117
gtk/Modeller.xpm
117
gtk/Modeller.xpm
@ -1,117 +0,0 @@
|
||||
/* XPM */
|
||||
static char * InterfaceModeller_app_2_Tile_xpm[] = {
|
||||
"48 48 66 1",
|
||||
" c None",
|
||||
". c #86174D344103",
|
||||
"X c #69A651445144",
|
||||
"o c #8617410330C2",
|
||||
"O c #69A6410338E3",
|
||||
"+ c #30C218611861",
|
||||
"@ c #AEBA6DB66185",
|
||||
"# c #71C638E328A2",
|
||||
"$ c #69A634D328A2",
|
||||
"% c #30C228A228A2",
|
||||
"& c #79E73CF330C2",
|
||||
"* c #BEFB9E799E79",
|
||||
"= c #8E3869A66185",
|
||||
"- c #514424921861",
|
||||
"; c #A699A289B6DA",
|
||||
": c #A6999E79A699",
|
||||
"> c #71C65D756185",
|
||||
", c #9E799A69A699",
|
||||
"< c #8E3882078E38",
|
||||
"1 c #861779E78617",
|
||||
"2 c #A6999A69AEBA",
|
||||
"3 c #8E388A289658",
|
||||
"4 c #71C675D679E7",
|
||||
"5 c #96588A289E79",
|
||||
"6 c #30C230C238E3",
|
||||
"7 c #C71BC71BC71B",
|
||||
"8 c #9E79A289AEBA",
|
||||
"9 c #AEBAAAAABEFB",
|
||||
"0 c #96589248A699",
|
||||
"q c #A699AAAAB6DA",
|
||||
"w c #AEBAAAAAB6DA",
|
||||
"e c #D75CD34CD75C",
|
||||
"r c #EFBEE79DEFBE",
|
||||
"t c #BEFBB6DABEFB",
|
||||
"y c #B6DABAEAC71B",
|
||||
"u c #AEBAAEBAB6DA",
|
||||
"i c #E79DDB6CDF7D",
|
||||
"p c #96588E389658",
|
||||
"a c #596559656185",
|
||||
"s c #AEBA8E388E38",
|
||||
"d c #CF3CCB2BCF3C",
|
||||
"f c #9E799A699E79",
|
||||
"g c #86177DF78E38",
|
||||
"h c #69A6659571C6",
|
||||
"j c #AEBAAEBABEFB",
|
||||
"k c #96589E799E79",
|
||||
"l c #B6DAA699A699",
|
||||
"z c #E79DC71BC71B",
|
||||
"x c #B6DAB6DAB6DA",
|
||||
"c c #861786179658",
|
||||
"v c #B6DAB2CABEFB",
|
||||
"b c #BEFBAAAAAEBA",
|
||||
"n c #C71BBEFBC71B",
|
||||
"m c #514441034103",
|
||||
"M c #41033CF34103",
|
||||
"N c #492428A228A2",
|
||||
"B c #AEBAA289B6DA",
|
||||
"V c #618530C22081",
|
||||
"C c #69A630C228A2",
|
||||
"Z c #69A630C22081",
|
||||
"A c #596528A22081",
|
||||
"S c #492428A22081",
|
||||
"D c #618528A22081",
|
||||
"F c #596520811861",
|
||||
"G c #69A628A22081",
|
||||
"H c #FFFF14514103",
|
||||
" .X ",
|
||||
" .oO+ ",
|
||||
" @.o#++ ",
|
||||
" @.o$%+ ",
|
||||
" @.&#++ ",
|
||||
" @.o#++ ",
|
||||
" @.o$++ ",
|
||||
" @.&#++ ",
|
||||
" .O#++ ",
|
||||
" *=-$++ ",
|
||||
" ;:>+++ ",
|
||||
" ;,<1% ",
|
||||
" 2,34 ",
|
||||
" 2;,51 ",
|
||||
" 2,,,,6 ",
|
||||
" 7777 28888,6 ",
|
||||
" 77777777 2829,,,06 ",
|
||||
" 9qwwe7rrrrr77rr 828,9tyt,6 ",
|
||||
" uuwriirrieiiieii77pa< 82,8,,,8,06 ",
|
||||
" s=1ttiieeeeded77eufgh>j,8,8,k,0,6 ",
|
||||
" =@lzieeeeee77eeex:fpcg4>9,,,,qjv6 ",
|
||||
" =O=blt7eeee7deenw:ffp<gha:t979;06 ",
|
||||
" =OO@=@zieeee7ex:::fffff0,v72444h6 ",
|
||||
" =OOo&Osst7iee7wkf:f:ff;t721444ham ",
|
||||
" =#&&&&OO@di7eu:ff:fferiv114444hmMX ",
|
||||
" =O&&&..o.sdp33fff:errrii7cc1hhh6mmNX= ",
|
||||
" =O&&&@.o.@sberrrrrriiuxuxnB;44aMmVCO#OX ",
|
||||
" =O&&o@..o.zrrrie777nnxtuxx:x;n:>mV##&&O$mX ",
|
||||
" =O&&o....zrrieieuxunx7txx:nnfwpMmVZ#$ZZZVVN ",
|
||||
" =O&oooo.*rrde77ewxnxxtnw:f4M%M%+NA#$Z$ZZVmN> ",
|
||||
" =Oo&ooo@iree7inxn7nnuuff4h%M>m%S-AZ$CCZDZmSX ",
|
||||
" =O&o.o.@rrn7eulun7xxuwp4mm6ahM%--AZCCZDDDANX ",
|
||||
" =Ooooo.*rixenuwwn7nxupph%M>>h6mAADVVZVVDDANX ",
|
||||
" =O&o.o.zrexwwnwuxxnughX%mahhmMN-AZCCVVDDAAN> ",
|
||||
" *XOoo.*iin7n777xxxtphaM+ama>MSNFVCZZVVDAAAS> ",
|
||||
" 1O..izewxux7nuuux4%++%hha>%N-DDCZZVDAAAASX ",
|
||||
" 1.=ituu:uButnxxuX%>hh>M%++NADZZZVDADAA--X ",
|
||||
" :e7f::lnn7*ppnx6ahm6++mNN-ADCZVDDAAAA-SX ",
|
||||
" 7nupp:wxxg%MMau6%++NmmmADADVVVVVDAA---NX ",
|
||||
" 7uBgh1wwxg6h>m%:MmmVNAVDZVZCVZZDAAAAF-S+X ",
|
||||
" nfgaM%pnwhX6%mXb6$DVVZC$C#C$ZZDVAAA---+NX ",
|
||||
" 27a%MaM47:mN.OoolmODGZ####$$ZZVDDA-----SSX ",
|
||||
" 2gmg<m6p7wmmOo...O$GZ####$$CZVVDAAA----++X ",
|
||||
" qBcaM <gxgmXmo.@.o&$$##$$$CZZZDADA-A-++-NX ",
|
||||
" M6> paMa HX.@@@oZ$###$$CZVDDAAAA---SS+X ",
|
||||
" 43 p=&@@&&$##$CCCVVVAAA--+S+S+%X ",
|
||||
" k =o@.##$VVmmmNNNSSSSSS%XXXX ",
|
||||
" s>OSSNmN>>aaa177777 "};
|
@ -1,21 +0,0 @@
|
||||
/* XPM */
|
||||
static char *openfile[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 10 9 5 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
"y c #666666",
|
||||
"i c #ff1f00",
|
||||
"# c #9f9f9f",
|
||||
/* pixels */
|
||||
"..........",
|
||||
"........yy",
|
||||
".......yy.",
|
||||
"......yy..",
|
||||
".yyy.yy...",
|
||||
"..yyyy....",
|
||||
"...yy.....",
|
||||
"..........",
|
||||
"..........",
|
||||
};
|
@ -1,21 +0,0 @@
|
||||
/* XPM */
|
||||
static char *openfile[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 10 9 5 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
"i c #ff0fff",
|
||||
"y c #ff1f00",
|
||||
"# c #9f9f9f",
|
||||
/* pixels */
|
||||
"..........",
|
||||
"........yy",
|
||||
".......yy.",
|
||||
"......yy..",
|
||||
".yyy.yy...",
|
||||
"..yyyy....",
|
||||
"...yy.....",
|
||||
"..........",
|
||||
"..........",
|
||||
};
|
@ -782,7 +782,7 @@ gtk_drag_highlight_expose (GtkWidget *widget,
|
||||
x, y, width - 1, height - 1);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
|
408
gtk/marble.xpm
408
gtk/marble.xpm
File diff suppressed because one or more lines are too long
92
gtk/test.xpm
92
gtk/test.xpm
@ -1,92 +0,0 @@
|
||||
/* XPM */
|
||||
static char *openfile[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 20 19 66 2",
|
||||
/* colors */
|
||||
".. c None",
|
||||
".# c #000000",
|
||||
".a c #dfdfdf",
|
||||
".b c #7f7f7f",
|
||||
".c c #006f6f",
|
||||
".d c #00efef",
|
||||
".e c #009f9f",
|
||||
".f c #004040",
|
||||
".g c #00bfbf",
|
||||
".h c #ff0000",
|
||||
".i c #ffffff",
|
||||
".j c #7f0000",
|
||||
".k c #007070",
|
||||
".l c #00ffff",
|
||||
".m c #00a0a0",
|
||||
".n c #004f4f",
|
||||
".o c #00cfcf",
|
||||
".p c #8f8f8f",
|
||||
".q c #6f6f6f",
|
||||
".r c #a0a0a0",
|
||||
".s c #7f7f00",
|
||||
".t c #007f7f",
|
||||
".u c #5f5f5f",
|
||||
".v c #707070",
|
||||
".w c #00f0f0",
|
||||
".x c #009090",
|
||||
".y c #ffff00",
|
||||
".z c #0000ff",
|
||||
".A c #00afaf",
|
||||
".B c #00d0d0",
|
||||
".C c #00dfdf",
|
||||
".D c #005f5f",
|
||||
".E c #00b0b0",
|
||||
".F c #001010",
|
||||
".G c #00c0c0",
|
||||
".H c #000f0f",
|
||||
".I c #00007f",
|
||||
".J c #005050",
|
||||
".K c #002f2f",
|
||||
".L c #dfcfcf",
|
||||
".M c #dfd0d0",
|
||||
".N c #006060",
|
||||
".O c #00e0e0",
|
||||
".P c #00ff00",
|
||||
".Q c #002020",
|
||||
".R c #dfc0c0",
|
||||
".S c #008080",
|
||||
".T c #001f1f",
|
||||
".U c #003f3f",
|
||||
".V c #007f00",
|
||||
".W c #00000f",
|
||||
".X c #000010",
|
||||
".Y c #00001f",
|
||||
".Z c #000020",
|
||||
".0 c #00002f",
|
||||
".1 c #000030",
|
||||
".2 c #00003f",
|
||||
".3 c #000040",
|
||||
".4 c #00004f",
|
||||
".5 c #000050",
|
||||
".6 c #00005f",
|
||||
".7 c #000060",
|
||||
".8 c #00006f",
|
||||
".9 c #000070",
|
||||
"#. c #7f7f80",
|
||||
"## c #9f9f9f",
|
||||
/* pixels */
|
||||
"........................................",
|
||||
"........................................",
|
||||
"........................................",
|
||||
".......................#.#.#............",
|
||||
".....................#.......#...#......",
|
||||
"...............................#.#......",
|
||||
".......#.#.#.................#.#.#......",
|
||||
".....#.y.i.y.#.#.#.#.#.#.#..............",
|
||||
".....#.i.y.i.y.i.y.i.y.i.#..............",
|
||||
".....#.y.i.y.i.y.i.y.i.y.#..............",
|
||||
".....#.i.y.i.y.#.#.#.#.#.#.#.#.#.#.#....",
|
||||
".....#.y.i.y.#.s.s.s.s.s.s.s.s.s.#......",
|
||||
".....#.i.y.#.s.s.s.s.s.s.s.s.s.#........",
|
||||
".....#.y.#.s.s.s.s.s.s.s.s.s.#..........",
|
||||
".....#.#.s.s.s.s.s.s.s.s.s.#............",
|
||||
".....#.#.#.#.#.#.#.#.#.#.#..............",
|
||||
"........................................",
|
||||
"........................................",
|
||||
"........................................"
|
||||
};
|
@ -1,422 +0,0 @@
|
||||
/* example-start calendar calendar.c */
|
||||
/*
|
||||
* Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grönlund
|
||||
* Copyright (C) 2000 Tony Gale
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#define DEF_PAD 10
|
||||
#define DEF_PAD_SMALL 5
|
||||
|
||||
#define TM_YEAR_BASE 1900
|
||||
|
||||
typedef struct _CalendarData {
|
||||
GtkWidget *flag_checkboxes[5];
|
||||
gboolean settings[5];
|
||||
GtkWidget *font_dialog;
|
||||
GtkWidget *window;
|
||||
GtkWidget *prev2_sig;
|
||||
GtkWidget *prev_sig;
|
||||
GtkWidget *last_sig;
|
||||
GtkWidget *month;
|
||||
} CalendarData;
|
||||
|
||||
enum {
|
||||
calendar_show_header,
|
||||
calendar_show_days,
|
||||
calendar_month_change,
|
||||
calendar_show_week,
|
||||
calendar_monday_first
|
||||
};
|
||||
|
||||
/*
|
||||
* GtkCalendar
|
||||
*/
|
||||
|
||||
void calendar_date_to_string( CalendarData *data,
|
||||
char *buffer,
|
||||
gint buff_len )
|
||||
{
|
||||
struct tm tm;
|
||||
time_t time;
|
||||
|
||||
memset (&tm, 0, sizeof (tm));
|
||||
gtk_calendar_get_date (GTK_CALENDAR(data->window),
|
||||
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
|
||||
tm.tm_year -= TM_YEAR_BASE;
|
||||
time = mktime(&tm);
|
||||
strftime (buffer, buff_len-1, "%x", gmtime(&time));
|
||||
}
|
||||
|
||||
void calendar_set_signal_strings (char *sig_str,
|
||||
CalendarData *data)
|
||||
{
|
||||
gchar *prev_sig;
|
||||
|
||||
gtk_label_get (GTK_LABEL (data->prev_sig), &prev_sig);
|
||||
gtk_label_set_text (GTK_LABEL (data->prev2_sig), prev_sig);
|
||||
|
||||
gtk_label_get (GTK_LABEL (data->last_sig), &prev_sig);
|
||||
gtk_label_set_text (GTK_LABEL (data->prev_sig), prev_sig);
|
||||
gtk_label_set_text (GTK_LABEL (data->last_sig), sig_str);
|
||||
}
|
||||
|
||||
void calendar_month_changed( GtkWidget *widget,
|
||||
CalendarData *data )
|
||||
{
|
||||
char buffer[256] = "month_changed: ";
|
||||
|
||||
calendar_date_to_string (data, buffer+15, 256-15);
|
||||
calendar_set_signal_strings (buffer, data);
|
||||
}
|
||||
|
||||
void calendar_day_selected( GtkWidget *widget,
|
||||
CalendarData *data )
|
||||
{
|
||||
char buffer[256] = "day_selected: ";
|
||||
|
||||
calendar_date_to_string (data, buffer+14, 256-14);
|
||||
calendar_set_signal_strings (buffer, data);
|
||||
}
|
||||
|
||||
void calendar_day_selected_double_click( GtkWidget *widget,
|
||||
CalendarData *data )
|
||||
{
|
||||
struct tm tm;
|
||||
char buffer[256] = "day_selected_double_click: ";
|
||||
|
||||
calendar_date_to_string (data, buffer+27, 256-27);
|
||||
calendar_set_signal_strings (buffer, data);
|
||||
|
||||
memset (&tm, 0, sizeof (tm));
|
||||
gtk_calendar_get_date (GTK_CALENDAR(data->window),
|
||||
&tm.tm_year, &tm.tm_mon, &tm.tm_mday);
|
||||
tm.tm_year -= TM_YEAR_BASE;
|
||||
|
||||
if(GTK_CALENDAR(data->window)->marked_date[tm.tm_mday-1] == 0) {
|
||||
gtk_calendar_mark_day(GTK_CALENDAR(data->window),tm.tm_mday);
|
||||
} else {
|
||||
gtk_calendar_unmark_day(GTK_CALENDAR(data->window),tm.tm_mday);
|
||||
}
|
||||
}
|
||||
|
||||
void calendar_prev_month( GtkWidget *widget,
|
||||
CalendarData *data )
|
||||
{
|
||||
char buffer[256] = "prev_month: ";
|
||||
|
||||
calendar_date_to_string (data, buffer+12, 256-12);
|
||||
calendar_set_signal_strings (buffer, data);
|
||||
}
|
||||
|
||||
void calendar_next_month( GtkWidget *widget,
|
||||
CalendarData *data )
|
||||
{
|
||||
char buffer[256] = "next_month: ";
|
||||
|
||||
calendar_date_to_string (data, buffer+12, 256-12);
|
||||
calendar_set_signal_strings (buffer, data);
|
||||
}
|
||||
|
||||
void calendar_prev_year( GtkWidget *widget,
|
||||
CalendarData *data )
|
||||
{
|
||||
char buffer[256] = "prev_year: ";
|
||||
|
||||
calendar_date_to_string (data, buffer+11, 256-11);
|
||||
calendar_set_signal_strings (buffer, data);
|
||||
}
|
||||
|
||||
void calendar_next_year( GtkWidget *widget,
|
||||
CalendarData *data )
|
||||
{
|
||||
char buffer[256] = "next_year: ";
|
||||
|
||||
calendar_date_to_string (data, buffer+11, 256-11);
|
||||
calendar_set_signal_strings (buffer, data);
|
||||
}
|
||||
|
||||
|
||||
void calendar_set_flags( CalendarData *calendar )
|
||||
{
|
||||
gint i;
|
||||
gint options=0;
|
||||
for (i=0;i<5;i++)
|
||||
if (calendar->settings[i])
|
||||
{
|
||||
options=options + (1<<i);
|
||||
}
|
||||
if (calendar->window)
|
||||
gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
|
||||
}
|
||||
|
||||
void calendar_toggle_flag( GtkWidget *toggle,
|
||||
CalendarData *calendar )
|
||||
{
|
||||
gint i;
|
||||
gint j;
|
||||
j=0;
|
||||
for (i=0; i<5; i++)
|
||||
if (calendar->flag_checkboxes[i] == toggle)
|
||||
j = i;
|
||||
|
||||
calendar->settings[j]=!calendar->settings[j];
|
||||
calendar_set_flags(calendar);
|
||||
|
||||
}
|
||||
|
||||
void calendar_font_selection_ok (GtkWidget *button,
|
||||
CalendarData *calendar)
|
||||
{
|
||||
GtkRcStyle *style;
|
||||
char *font_name;
|
||||
|
||||
if (calendar->window)
|
||||
{
|
||||
font_name = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(calendar->font_dialog));
|
||||
if (font_name)
|
||||
{
|
||||
style = gtk_rc_style_new ();
|
||||
pango_font_description_free (style->font_desc);
|
||||
style->font_desc = pango_font_description_from_string (font_name);
|
||||
gtk_widget_modify_style (calendar->window, style);
|
||||
g_free (font_name);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_destroy (calendar->font_dialog);
|
||||
}
|
||||
|
||||
void calendar_select_font( GtkWidget *button,
|
||||
CalendarData *calendar )
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
if (!calendar->font_dialog) {
|
||||
window = gtk_font_selection_dialog_new ("Font Selection Dialog");
|
||||
g_return_if_fail(GTK_IS_FONT_SELECTION_DIALOG(window));
|
||||
calendar->font_dialog = window;
|
||||
|
||||
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
|
||||
&calendar->font_dialog);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button),
|
||||
"clicked", GTK_SIGNAL_FUNC(calendar_font_selection_ok),
|
||||
calendar);
|
||||
gtk_signal_connect_object (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_destroy),
|
||||
GTK_OBJECT (calendar->font_dialog));
|
||||
}
|
||||
window=calendar->font_dialog;
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
}
|
||||
|
||||
void create_calendar()
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *vbox, *vbox2, *vbox3;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *hbbox;
|
||||
GtkWidget *calendar;
|
||||
GtkWidget *toggle;
|
||||
GtkWidget *button;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *separator;
|
||||
GtkWidget *label;
|
||||
GtkWidget *bbox;
|
||||
static CalendarData calendar_data;
|
||||
gint i;
|
||||
|
||||
struct {
|
||||
char *label;
|
||||
} flags[] =
|
||||
{
|
||||
{ "Show Heading" },
|
||||
{ "Show Day Names" },
|
||||
{ "No Month Change" },
|
||||
{ "Show Week Numbers" },
|
||||
{ "Week Start Monday" }
|
||||
};
|
||||
|
||||
|
||||
calendar_data.window = NULL;
|
||||
calendar_data.font_dialog = NULL;
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
calendar_data.settings[i]=0;
|
||||
}
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example");
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
|
||||
gtk_signal_connect(GTK_OBJECT(window), "destroy",
|
||||
GTK_SIGNAL_FUNC(gtk_main_quit),
|
||||
NULL);
|
||||
gtk_signal_connect(GTK_OBJECT(window), "delete-event",
|
||||
GTK_SIGNAL_FUNC(gtk_false),
|
||||
NULL);
|
||||
|
||||
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, DEF_PAD);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/*
|
||||
* The top part of the window, Calendar, flags and fontsel.
|
||||
*/
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, DEF_PAD);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), hbox, TRUE, TRUE, DEF_PAD);
|
||||
hbbox = gtk_hbutton_box_new();
|
||||
gtk_box_pack_start(GTK_BOX(hbox), hbbox, FALSE, FALSE, DEF_PAD);
|
||||
gtk_button_box_set_layout(GTK_BUTTON_BOX(hbbox), GTK_BUTTONBOX_SPREAD);
|
||||
gtk_box_set_spacing(GTK_BOX(hbbox), 5);
|
||||
|
||||
/* Calendar widget */
|
||||
frame = gtk_frame_new("Calendar");
|
||||
gtk_box_pack_start(GTK_BOX(hbbox), frame, FALSE, TRUE, DEF_PAD);
|
||||
calendar=gtk_calendar_new();
|
||||
calendar_data.window = calendar;
|
||||
calendar_set_flags(&calendar_data);
|
||||
gtk_calendar_mark_day ( GTK_CALENDAR(calendar), 19);
|
||||
gtk_container_add( GTK_CONTAINER( frame), calendar);
|
||||
gtk_signal_connect (GTK_OBJECT (calendar), "month_changed",
|
||||
GTK_SIGNAL_FUNC (calendar_month_changed),
|
||||
&calendar_data);
|
||||
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected",
|
||||
GTK_SIGNAL_FUNC (calendar_day_selected),
|
||||
&calendar_data);
|
||||
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click",
|
||||
GTK_SIGNAL_FUNC (calendar_day_selected_double_click),
|
||||
&calendar_data);
|
||||
gtk_signal_connect (GTK_OBJECT (calendar), "prev_month",
|
||||
GTK_SIGNAL_FUNC (calendar_prev_month),
|
||||
&calendar_data);
|
||||
gtk_signal_connect (GTK_OBJECT (calendar), "next_month",
|
||||
GTK_SIGNAL_FUNC (calendar_next_month),
|
||||
&calendar_data);
|
||||
gtk_signal_connect (GTK_OBJECT (calendar), "prev_year",
|
||||
GTK_SIGNAL_FUNC (calendar_prev_year),
|
||||
&calendar_data);
|
||||
gtk_signal_connect (GTK_OBJECT (calendar), "next_year",
|
||||
GTK_SIGNAL_FUNC (calendar_next_year),
|
||||
&calendar_data);
|
||||
|
||||
|
||||
separator = gtk_vseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (hbox), separator, FALSE, TRUE, 0);
|
||||
|
||||
vbox2 = gtk_vbox_new(FALSE, DEF_PAD);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, DEF_PAD);
|
||||
|
||||
/* Build the Right frame with the flags in */
|
||||
|
||||
frame = gtk_frame_new("Flags");
|
||||
gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, DEF_PAD);
|
||||
vbox3 = gtk_vbox_new(TRUE, DEF_PAD_SMALL);
|
||||
gtk_container_add(GTK_CONTAINER(frame), vbox3);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
toggle = gtk_check_button_new_with_label(flags[i].label);
|
||||
gtk_signal_connect (GTK_OBJECT (toggle),
|
||||
"toggled",
|
||||
GTK_SIGNAL_FUNC(calendar_toggle_flag),
|
||||
&calendar_data);
|
||||
gtk_box_pack_start (GTK_BOX (vbox3), toggle, TRUE, TRUE, 0);
|
||||
calendar_data.flag_checkboxes[i]=toggle;
|
||||
}
|
||||
/* Build the right font-button */
|
||||
button = gtk_button_new_with_label("Font...");
|
||||
gtk_signal_connect (GTK_OBJECT (button),
|
||||
"clicked",
|
||||
GTK_SIGNAL_FUNC(calendar_select_font),
|
||||
&calendar_data);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
||||
|
||||
/*
|
||||
* Build the Signal-event part.
|
||||
*/
|
||||
|
||||
frame = gtk_frame_new("Signal events");
|
||||
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, DEF_PAD);
|
||||
|
||||
vbox2 = gtk_vbox_new(TRUE, DEF_PAD_SMALL);
|
||||
gtk_container_add(GTK_CONTAINER(frame), vbox2);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
|
||||
label = gtk_label_new ("Signal:");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
|
||||
calendar_data.last_sig = gtk_label_new ("");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.last_sig, FALSE, TRUE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
|
||||
label = gtk_label_new ("Previous signal:");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
|
||||
calendar_data.prev_sig = gtk_label_new ("");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev_sig, FALSE, TRUE, 0);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 3);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
|
||||
label = gtk_label_new ("Second previous signal:");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
|
||||
calendar_data.prev2_sig = gtk_label_new ("");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.prev2_sig, FALSE, TRUE, 0);
|
||||
|
||||
bbox = gtk_hbutton_box_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0);
|
||||
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
|
||||
|
||||
button = gtk_button_new_with_label ("Close");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (gtk_main_quit),
|
||||
NULL);
|
||||
gtk_container_add (GTK_CONTAINER (bbox), button);
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_grab_default (button);
|
||||
|
||||
gtk_widget_show_all(window);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,
|
||||
char *argv[] )
|
||||
{
|
||||
gtk_set_locale ();
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
create_calendar();
|
||||
|
||||
gtk_main();
|
||||
|
||||
return(0);
|
||||
}
|
||||
/* example-end */
|
665
gtk/testdnd.c
665
gtk/testdnd.c
@ -1,665 +0,0 @@
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
/* Target side drag signals */
|
||||
|
||||
/* XPM */
|
||||
static char * drag_icon_xpm[] = {
|
||||
"36 48 9 1",
|
||||
" c None",
|
||||
". c #020204",
|
||||
"+ c #8F8F90",
|
||||
"@ c #D3D3D2",
|
||||
"# c #AEAEAC",
|
||||
"$ c #ECECEC",
|
||||
"% c #A2A2A4",
|
||||
"& c #FEFEFC",
|
||||
"* c #BEBEBC",
|
||||
" .....................",
|
||||
" ..&&&&&&&&&&&&&&&&&&&.",
|
||||
" ...&&&&&&&&&&&&&&&&&&&.",
|
||||
" ..&.&&&&&&&&&&&&&&&&&&&.",
|
||||
" ..&&.&&&&&&&&&&&&&&&&&&&.",
|
||||
" ..&&&.&&&&&&&&&&&&&&&&&&&.",
|
||||
" ..&&&&.&&&&&&&&&&&&&&&&&&&.",
|
||||
" ..&&&&&.&&&@&&&&&&&&&&&&&&&.",
|
||||
" ..&&&&&&.*$%$+$&&&&&&&&&&&&&.",
|
||||
" ..&&&&&&&.%$%$+&&&&&&&&&&&&&&.",
|
||||
" ..&&&&&&&&.#&#@$&&&&&&&&&&&&&&.",
|
||||
" ..&&&&&&&&&.#$**#$&&&&&&&&&&&&&.",
|
||||
" ..&&&&&&&&&&.&@%&%$&&&&&&&&&&&&&.",
|
||||
" ..&&&&&&&&&&&.&&&&&&&&&&&&&&&&&&&.",
|
||||
" ..&&&&&&&&&&&&.&&&&&&&&&&&&&&&&&&&.",
|
||||
"................&$@&&&@&&&&&&&&&&&&.",
|
||||
".&&&&&&&+&&#@%#+@#@*$%$+$&&&&&&&&&&.",
|
||||
".&&&&&&&+&&#@#@&&@*%$%$+&&&&&&&&&&&.",
|
||||
".&&&&&&&+&$%&#@&#@@#&#@$&&&&&&&&&&&.",
|
||||
".&&&&&&@#@@$&*@&@#@#$**#$&&&&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&@%&%$&&&&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.",
|
||||
".&&&&&&&&$#@@$&&&&&&&&&&&&&&&&&&&&&.",
|
||||
".&&&&&&&&&+&$+&$&@&$@&&$@&&&&&&&&&&.",
|
||||
".&&&&&&&&&+&&#@%#+@#@*$%&+$&&&&&&&&.",
|
||||
".&&&&&&&&&+&&#@#@&&@*%$%$+&&&&&&&&&.",
|
||||
".&&&&&&&&&+&$%&#@&#@@#&#@$&&&&&&&&&.",
|
||||
".&&&&&&&&@#@@$&*@&@#@#$#*#$&&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&$%&%$&&&&&&&&.",
|
||||
".&&&&&&&&&&$#@@$&&&&&&&&&&&&&&&&&&&.",
|
||||
".&&&&&&&&&&&+&$%&$$@&$@&&$@&&&&&&&&.",
|
||||
".&&&&&&&&&&&+&&#@%#+@#@*$%$+$&&&&&&.",
|
||||
".&&&&&&&&&&&+&&#@#@&&@*#$%$+&&&&&&&.",
|
||||
".&&&&&&&&&&&+&$+&*@&#@@#&#@$&&&&&&&.",
|
||||
".&&&&&&&&&&$%@@&&*@&@#@#$#*#&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&&&$%&%$&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&$#@@$&&&&&&&&&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&+&$%&$$@&$@&&$@&&&&.",
|
||||
".&&&&&&&&&&&&&&&+&&#@%#+@#@*$%$+$&&.",
|
||||
".&&&&&&&&&&&&&&&+&&#@#@&&@*#$%$+&&&.",
|
||||
".&&&&&&&&&&&&&&&+&$+&*@&#@@#&#@$&&&.",
|
||||
".&&&&&&&&&&&&&&$%@@&&*@&@#@#$#*#&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&&&&&&&$%&%$&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.",
|
||||
".&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.",
|
||||
"...................................."};
|
||||
|
||||
/* XPM */
|
||||
static char * trashcan_closed_xpm[] = {
|
||||
"64 80 17 1",
|
||||
" c None",
|
||||
". c #030304",
|
||||
"+ c #5A5A5C",
|
||||
"@ c #323231",
|
||||
"# c #888888",
|
||||
"$ c #1E1E1F",
|
||||
"% c #767677",
|
||||
"& c #494949",
|
||||
"* c #9E9E9C",
|
||||
"= c #111111",
|
||||
"- c #3C3C3D",
|
||||
"; c #6B6B6B",
|
||||
"> c #949494",
|
||||
", c #282828",
|
||||
"' c #808080",
|
||||
") c #545454",
|
||||
"! c #AEAEAC",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ==......=$$...=== ",
|
||||
" ..$------)+++++++++++++@$$... ",
|
||||
" ..=@@-------&+++++++++++++++++++-.... ",
|
||||
" =.$$@@@-&&)++++)-,$$$$=@@&+++++++++++++,..$ ",
|
||||
" .$$$$@@&+++++++&$$$@@@@-&,$,-++++++++++;;;&.. ",
|
||||
" $$$$,@--&++++++&$$)++++++++-,$&++++++;%%'%%;;$@ ",
|
||||
" .-@@-@-&++++++++-@++++++++++++,-++++++;''%;;;%*-$ ",
|
||||
" +------++++++++++++++++++++++++++++++;;%%%;;##*!. ",
|
||||
" =+----+++++++++++++++++++++++;;;;;;;;;;;;%'>>). ",
|
||||
" .=)&+++++++++++++++++;;;;;;;;;;;;;;%''>>#>#@. ",
|
||||
" =..=&++++++++++++;;;;;;;;;;;;;%###>>###+%== ",
|
||||
" .&....=-+++++%;;####''''''''''##'%%%)..#. ",
|
||||
" .+-++@....=,+%#####'%%%%%%%%%;@$-@-@*++!. ",
|
||||
" .+-++-+++-&-@$$=$=......$,,,@;&)+!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" =+-++-+++-+++++++++!++++!++++!+++!++!+++= ",
|
||||
" $.++-+++-+++++++++!++++!++++!+++!++!+.$ ",
|
||||
" =.++++++++++++++!++++!++++!+++!++.= ",
|
||||
" $..+++++++++++++++!++++++...$ ",
|
||||
" $$=.............=$$ ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
||||
|
||||
/* XPM */
|
||||
static char * trashcan_open_xpm[] = {
|
||||
"64 80 17 1",
|
||||
" c None",
|
||||
". c #030304",
|
||||
"+ c #5A5A5C",
|
||||
"@ c #323231",
|
||||
"# c #888888",
|
||||
"$ c #1E1E1F",
|
||||
"% c #767677",
|
||||
"& c #494949",
|
||||
"* c #9E9E9C",
|
||||
"= c #111111",
|
||||
"- c #3C3C3D",
|
||||
"; c #6B6B6B",
|
||||
"> c #949494",
|
||||
", c #282828",
|
||||
"' c #808080",
|
||||
") c #545454",
|
||||
"! c #AEAEAC",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" .=.==.,@ ",
|
||||
" ==.,@-&&&)-= ",
|
||||
" .$@,&++;;;%>*- ",
|
||||
" $,-+)+++%%;;'#+. ",
|
||||
" =---+++++;%%%;%##@. ",
|
||||
" @)++++++++;%%%%'#%$ ",
|
||||
" $&++++++++++;%%;%##@= ",
|
||||
" ,-++++)+++++++;;;'#%) ",
|
||||
" @+++&&--&)++++;;%'#'-. ",
|
||||
" ,&++-@@,,,,-)++;;;'>'+, ",
|
||||
" =-++&@$@&&&&-&+;;;%##%+@ ",
|
||||
" =,)+)-,@@&+++++;;;;%##%&@ ",
|
||||
" @--&&,,@&)++++++;;;;'#)@ ",
|
||||
" ---&)-,@)+++++++;;;%''+, ",
|
||||
" $--&)+&$-+++++++;;;%%'';- ",
|
||||
" .,-&+++-$&++++++;;;%''%&= ",
|
||||
" $,-&)++)-@++++++;;%''%), ",
|
||||
" =,@&)++++&&+++++;%'''+$@&++++++ ",
|
||||
" .$@-++++++++++++;'#';,........=$@&++++ ",
|
||||
" =$@@&)+++++++++++'##-.................=&++ ",
|
||||
" .$$@-&)+++++++++;%#+$.....................=)+ ",
|
||||
" $$,@-)+++++++++;%;@=........................,+ ",
|
||||
" .$$@@-++++++++)-)@=............................ ",
|
||||
" $,@---)++++&)@===............................,. ",
|
||||
" $-@---&)))-$$=..............................=)!. ",
|
||||
" --&-&&,,$=,==...........................=&+++!. ",
|
||||
" =,=$..=$+)+++++&@$=.............=$@&+++++!++!. ",
|
||||
" .)-++-+++++++++++++++++++++++++++!++!++!. ",
|
||||
" .+-++-+++++++++++++++++++++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!+++!!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" .+-++-+++-+++++++++!++++!++++!+++!++!++!. ",
|
||||
" =+-++-+++-+++++++++!++++!++++!+++!++!+++= ",
|
||||
" $.++-+++-+++++++++!++++!++++!+++!++!+.$ ",
|
||||
" =.++++++++++++++!++++!++++!+++!++.= ",
|
||||
" $..+++++++++++++++!++++++...$ ",
|
||||
" $$==...........==$$ ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
||||
|
||||
GdkPixmap *trashcan_open;
|
||||
GdkPixmap *trashcan_open_mask;
|
||||
GdkPixmap *trashcan_closed;
|
||||
GdkPixmap *trashcan_closed_mask;
|
||||
|
||||
gboolean have_drag;
|
||||
|
||||
enum {
|
||||
TARGET_STRING,
|
||||
TARGET_ROOTWIN
|
||||
};
|
||||
|
||||
static GtkTargetEntry target_table[] = {
|
||||
{ "STRING", 0, TARGET_STRING },
|
||||
{ "text/plain", 0, TARGET_STRING },
|
||||
{ "application/x-rootwin-drop", 0, TARGET_ROOTWIN }
|
||||
};
|
||||
|
||||
static guint n_targets = sizeof(target_table) / sizeof(target_table[0]);
|
||||
|
||||
void
|
||||
target_drag_leave (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
guint time)
|
||||
{
|
||||
g_print("leave\n");
|
||||
have_drag = FALSE;
|
||||
gtk_pixmap_set (GTK_PIXMAP (widget), trashcan_closed, trashcan_closed_mask);
|
||||
}
|
||||
|
||||
gboolean
|
||||
target_drag_motion (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
guint time)
|
||||
{
|
||||
GtkWidget *source_widget;
|
||||
GList *tmp_list;
|
||||
|
||||
if (!have_drag)
|
||||
{
|
||||
have_drag = TRUE;
|
||||
gtk_pixmap_set (GTK_PIXMAP (widget), trashcan_open, trashcan_open_mask);
|
||||
}
|
||||
|
||||
source_widget = gtk_drag_get_source_widget (context);
|
||||
g_print ("motion, source %s\n", source_widget ?
|
||||
GTK_OBJECT_TYPE_NAME (source_widget) :
|
||||
"NULL");
|
||||
|
||||
tmp_list = context->targets;
|
||||
while (tmp_list)
|
||||
{
|
||||
char *name = gdk_atom_name (GPOINTER_TO_UINT (tmp_list->data));
|
||||
g_print ("%s\n", name);
|
||||
g_free (name);
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
gdk_drag_status (context, context->suggested_action, time);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
target_drag_drop (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
guint time)
|
||||
{
|
||||
g_print("drop\n");
|
||||
have_drag = FALSE;
|
||||
|
||||
gtk_pixmap_set (GTK_PIXMAP (widget), trashcan_closed, trashcan_closed_mask);
|
||||
|
||||
if (context->targets)
|
||||
{
|
||||
gtk_drag_get_data (widget, context,
|
||||
GPOINTER_TO_INT (context->targets->data),
|
||||
time);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
target_drag_data_received (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkSelectionData *data,
|
||||
guint info,
|
||||
guint time)
|
||||
{
|
||||
if ((data->length >= 0) && (data->format == 8))
|
||||
{
|
||||
g_print ("Received \"%s\" in trashcan\n", (gchar *)data->data);
|
||||
gtk_drag_finish (context, TRUE, FALSE, time);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_drag_finish (context, FALSE, FALSE, time);
|
||||
}
|
||||
|
||||
void
|
||||
label_drag_data_received (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkSelectionData *data,
|
||||
guint info,
|
||||
guint time)
|
||||
{
|
||||
if ((data->length >= 0) && (data->format == 8))
|
||||
{
|
||||
g_print ("Received \"%s\" in label\n", (gchar *)data->data);
|
||||
gtk_drag_finish (context, TRUE, FALSE, time);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_drag_finish (context, FALSE, FALSE, time);
|
||||
}
|
||||
|
||||
void
|
||||
source_drag_data_get (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
GtkSelectionData *selection_data,
|
||||
guint info,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
if (info == TARGET_ROOTWIN)
|
||||
g_print ("I was dropped on the rootwin\n");
|
||||
else
|
||||
gtk_selection_data_set (selection_data,
|
||||
selection_data->target,
|
||||
8, "I'm Data!", 9);
|
||||
}
|
||||
|
||||
/* The following is a rather elaborate example demonstrating/testing
|
||||
* changing of the window heirarchy during a drag - in this case,
|
||||
* via a "spring-loaded" popup window.
|
||||
*/
|
||||
static GtkWidget *popup_window = NULL;
|
||||
|
||||
static gboolean popped_up = FALSE;
|
||||
static gboolean in_popup = FALSE;
|
||||
static guint popdown_timer = 0;
|
||||
static guint popup_timer = 0;
|
||||
|
||||
gint
|
||||
popdown_cb (gpointer data)
|
||||
{
|
||||
popdown_timer = 0;
|
||||
|
||||
gtk_widget_hide (popup_window);
|
||||
popped_up = FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
popup_motion (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
guint time)
|
||||
{
|
||||
if (!in_popup)
|
||||
{
|
||||
in_popup = TRUE;
|
||||
if (popdown_timer)
|
||||
{
|
||||
g_print ("removed popdown\n");
|
||||
gtk_timeout_remove (popdown_timer);
|
||||
popdown_timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
popup_leave (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
guint time)
|
||||
{
|
||||
if (in_popup)
|
||||
{
|
||||
in_popup = FALSE;
|
||||
if (!popdown_timer)
|
||||
{
|
||||
g_print ("added popdown\n");
|
||||
popdown_timer = gtk_timeout_add (500, popdown_cb, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
popup_cb (gpointer data)
|
||||
{
|
||||
if (!popped_up)
|
||||
{
|
||||
if (!popup_window)
|
||||
{
|
||||
GtkWidget *button;
|
||||
GtkWidget *table;
|
||||
int i, j;
|
||||
|
||||
popup_window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_window_set_position (GTK_WINDOW (popup_window), GTK_WIN_POS_MOUSE);
|
||||
|
||||
table = gtk_table_new (3,3, FALSE);
|
||||
|
||||
for (i=0; i<3; i++)
|
||||
for (j=0; j<3; j++)
|
||||
{
|
||||
char buffer[128];
|
||||
g_snprintf(buffer, sizeof(buffer), "%d,%d", i, j);
|
||||
button = gtk_button_new_with_label (buffer);
|
||||
gtk_table_attach (GTK_TABLE (table), button, i, i+1, j, j+1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
|
||||
0, 0);
|
||||
|
||||
gtk_drag_dest_set (button,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
target_table, n_targets - 1, /* no rootwin */
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "drag_motion",
|
||||
GTK_SIGNAL_FUNC (popup_motion), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "drag_leave",
|
||||
GTK_SIGNAL_FUNC (popup_leave), NULL);
|
||||
}
|
||||
|
||||
gtk_widget_show_all (table);
|
||||
gtk_container_add (GTK_CONTAINER (popup_window), table);
|
||||
|
||||
}
|
||||
gtk_widget_show (popup_window);
|
||||
popped_up = TRUE;
|
||||
}
|
||||
|
||||
popdown_timer = gtk_timeout_add (500, popdown_cb, NULL);
|
||||
g_print ("added popdown\n");
|
||||
|
||||
popup_timer = FALSE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
popsite_motion (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gint x,
|
||||
gint y,
|
||||
guint time)
|
||||
{
|
||||
if (!popup_timer)
|
||||
popup_timer = gtk_timeout_add (500, popup_cb, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
popsite_leave (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
guint time)
|
||||
{
|
||||
if (popup_timer)
|
||||
{
|
||||
gtk_timeout_remove (popup_timer);
|
||||
popup_timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
source_drag_data_delete (GtkWidget *widget,
|
||||
GdkDragContext *context,
|
||||
gpointer data)
|
||||
{
|
||||
g_print ("Delete the data!\n");
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *table;
|
||||
GtkWidget *label;
|
||||
GtkWidget *pixmap;
|
||||
GtkWidget *button;
|
||||
GdkPixmap *drag_icon;
|
||||
GdkPixmap *drag_mask;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_signal_connect (GTK_OBJECT(window), "destroy",
|
||||
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
|
||||
|
||||
|
||||
table = gtk_table_new (2, 2, FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (window), table);
|
||||
|
||||
drag_icon = gdk_pixmap_colormap_create_from_xpm_d (NULL,
|
||||
gtk_widget_get_colormap (window),
|
||||
&drag_mask,
|
||||
NULL, drag_icon_xpm);
|
||||
|
||||
trashcan_open = gdk_pixmap_colormap_create_from_xpm_d (NULL,
|
||||
gtk_widget_get_colormap (window),
|
||||
&trashcan_open_mask,
|
||||
NULL, trashcan_open_xpm);
|
||||
trashcan_closed = gdk_pixmap_colormap_create_from_xpm_d (NULL,
|
||||
gtk_widget_get_colormap (window),
|
||||
&trashcan_closed_mask,
|
||||
NULL, trashcan_closed_xpm);
|
||||
|
||||
label = gtk_label_new ("Drop Here\n");
|
||||
|
||||
gtk_drag_dest_set (label,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
target_table, n_targets - 1, /* no rootwin */
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(label), "drag_data_received",
|
||||
GTK_SIGNAL_FUNC( label_drag_data_received), NULL);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
|
||||
0, 0);
|
||||
|
||||
label = gtk_label_new ("Popup\n");
|
||||
|
||||
gtk_drag_dest_set (label,
|
||||
GTK_DEST_DEFAULT_ALL,
|
||||
target_table, n_targets - 1, /* no rootwin */
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), label, 1, 2, 1, 2,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
|
||||
0, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (label), "drag_motion",
|
||||
GTK_SIGNAL_FUNC (popsite_motion), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (label), "drag_leave",
|
||||
GTK_SIGNAL_FUNC (popsite_leave), NULL);
|
||||
|
||||
pixmap = gtk_pixmap_new (trashcan_closed, trashcan_closed_mask);
|
||||
gtk_drag_dest_set (pixmap, 0, NULL, 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (table), pixmap, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
|
||||
0, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_leave",
|
||||
GTK_SIGNAL_FUNC (target_drag_leave), NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_motion",
|
||||
GTK_SIGNAL_FUNC (target_drag_motion), NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_drop",
|
||||
GTK_SIGNAL_FUNC (target_drag_drop), NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (pixmap), "drag_data_received",
|
||||
GTK_SIGNAL_FUNC (target_drag_data_received), NULL);
|
||||
|
||||
/* Drag site */
|
||||
|
||||
button = gtk_button_new_with_label ("Drag Here\n");
|
||||
|
||||
gtk_drag_source_set (button, GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
|
||||
target_table, n_targets,
|
||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
||||
gtk_drag_source_set_icon (button,
|
||||
gtk_widget_get_colormap (window),
|
||||
drag_icon, drag_mask);
|
||||
|
||||
gdk_pixmap_unref (drag_icon);
|
||||
gdk_pixmap_unref (drag_mask);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
|
||||
0, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button), "drag_data_get",
|
||||
GTK_SIGNAL_FUNC (source_drag_data_get), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "drag_data_delete",
|
||||
GTK_SIGNAL_FUNC (source_drag_data_delete), NULL);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
10352
gtk/testgtk.c
10352
gtk/testgtk.c
File diff suppressed because it is too large
Load Diff
393
gtk/testinput.c
393
gtk/testinput.c
@ -1,393 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "gtk.h"
|
||||
|
||||
/* Backing pixmap for drawing area */
|
||||
|
||||
static GdkPixmap *pixmap = NULL;
|
||||
|
||||
/* Information about cursor */
|
||||
|
||||
static gint cursor_proximity = TRUE;
|
||||
static gdouble cursor_x;
|
||||
static gdouble cursor_y;
|
||||
|
||||
/* Unique ID of current device */
|
||||
static GdkDevice *current_device;
|
||||
|
||||
/* Erase the old cursor, and/or draw a new one, if necessary */
|
||||
static void
|
||||
update_cursor (GtkWidget *widget, gdouble x, gdouble y)
|
||||
{
|
||||
static gint cursor_present = 0;
|
||||
gint state = !current_device->has_cursor && cursor_proximity;
|
||||
|
||||
if (pixmap != NULL)
|
||||
{
|
||||
if (cursor_present && (cursor_present != state ||
|
||||
x != cursor_x || y != cursor_y))
|
||||
{
|
||||
gdk_draw_pixmap(widget->window,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
pixmap,
|
||||
cursor_x - 5, cursor_y - 5,
|
||||
cursor_x - 5, cursor_y - 5,
|
||||
10, 10);
|
||||
}
|
||||
|
||||
cursor_present = state;
|
||||
cursor_x = x;
|
||||
cursor_y = y;
|
||||
|
||||
if (cursor_present)
|
||||
{
|
||||
gdk_draw_rectangle (widget->window,
|
||||
widget->style->black_gc,
|
||||
TRUE,
|
||||
cursor_x - 5, cursor_y -5,
|
||||
10, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Create a new backing pixmap of the appropriate size */
|
||||
static gint
|
||||
configure_event (GtkWidget *widget, GdkEventConfigure *event)
|
||||
{
|
||||
if (pixmap)
|
||||
gdk_pixmap_unref (pixmap);
|
||||
pixmap = gdk_pixmap_new(widget->window,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
gdk_draw_rectangle (pixmap,
|
||||
widget->style->white_gc,
|
||||
TRUE,
|
||||
0, 0,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Refill the screen from the backing pixmap */
|
||||
static gint
|
||||
expose_event (GtkWidget *widget, GdkEventExpose *event)
|
||||
{
|
||||
gdk_draw_pixmap(widget->window,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
pixmap,
|
||||
event->area.x, event->area.y,
|
||||
event->area.x, event->area.y,
|
||||
event->area.width, event->area.height);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Draw a rectangle on the screen, size depending on pressure,
|
||||
and color on the type of device */
|
||||
static void
|
||||
draw_brush (GtkWidget *widget, GdkInputSource source,
|
||||
gdouble x, gdouble y, gdouble pressure)
|
||||
{
|
||||
GdkGC *gc;
|
||||
GdkRectangle update_rect;
|
||||
|
||||
switch (source)
|
||||
{
|
||||
case GDK_SOURCE_MOUSE:
|
||||
gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)];
|
||||
break;
|
||||
case GDK_SOURCE_PEN:
|
||||
gc = widget->style->black_gc;
|
||||
break;
|
||||
case GDK_SOURCE_ERASER:
|
||||
gc = widget->style->white_gc;
|
||||
break;
|
||||
default:
|
||||
gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)];
|
||||
}
|
||||
|
||||
update_rect.x = x - 10 * pressure;
|
||||
update_rect.y = y - 10 * pressure;
|
||||
update_rect.width = 20 * pressure;
|
||||
update_rect.height = 20 * pressure;
|
||||
gdk_draw_rectangle (pixmap, gc, TRUE,
|
||||
update_rect.x, update_rect.y,
|
||||
update_rect.width, update_rect.height);
|
||||
gtk_widget_draw (widget, &update_rect);
|
||||
}
|
||||
|
||||
static guint32 motion_time;
|
||||
|
||||
static void
|
||||
print_axes (GdkDevice *device, gdouble *axes)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (axes)
|
||||
{
|
||||
g_print ("%s ", device->name);
|
||||
|
||||
for (i=0; i<device->num_axes; i++)
|
||||
g_print ("%g ", axes[i]);
|
||||
|
||||
g_print ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
button_press_event (GtkWidget *widget, GdkEventButton *event)
|
||||
{
|
||||
current_device = event->device;
|
||||
cursor_proximity = TRUE;
|
||||
|
||||
if (event->button == 1 && pixmap != NULL)
|
||||
{
|
||||
gdouble pressure = 0.5;
|
||||
|
||||
print_axes (event->device, event->axes);
|
||||
gdk_event_get_axis ((GdkEvent *)event, GDK_AXIS_PRESSURE, &pressure);
|
||||
draw_brush (widget, event->device->source, event->x, event->y, pressure);
|
||||
|
||||
motion_time = event->time;
|
||||
}
|
||||
|
||||
update_cursor (widget, event->x, event->y);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
key_press_event (GtkWidget *widget, GdkEventKey *event)
|
||||
{
|
||||
if ((event->keyval >= 0x20) && (event->keyval <= 0xFF))
|
||||
printf("I got a %c\n", event->keyval);
|
||||
else
|
||||
printf("I got some other key\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
|
||||
{
|
||||
GdkTimeCoord **events;
|
||||
int n_events;
|
||||
int i;
|
||||
|
||||
current_device = event->device;
|
||||
cursor_proximity = TRUE;
|
||||
|
||||
if (event->state & GDK_BUTTON1_MASK && pixmap != NULL)
|
||||
{
|
||||
if (gdk_device_get_history (event->device, event->window,
|
||||
motion_time, event->time,
|
||||
&events, &n_events))
|
||||
{
|
||||
for (i=0; i<n_events; i++)
|
||||
{
|
||||
double x = 0, y = 0, pressure = 0.5;
|
||||
|
||||
gdk_device_get_axis (event->device, events[i]->axes, GDK_AXIS_X, &x);
|
||||
gdk_device_get_axis (event->device, events[i]->axes, GDK_AXIS_Y, &y);
|
||||
gdk_device_get_axis (event->device, events[i]->axes, GDK_AXIS_PRESSURE, &pressure);
|
||||
draw_brush (widget, event->device->source, x, y, pressure);
|
||||
|
||||
print_axes (event->device, events[i]->axes);
|
||||
}
|
||||
gdk_device_free_history (events, n_events);
|
||||
}
|
||||
else
|
||||
{
|
||||
double pressure = 0.5;
|
||||
|
||||
gdk_event_get_axis ((GdkEvent *)event, GDK_AXIS_PRESSURE, &pressure);
|
||||
|
||||
draw_brush (widget, event->device->source, event->x, event->y, pressure);
|
||||
}
|
||||
motion_time = event->time;
|
||||
}
|
||||
|
||||
if (event->is_hint)
|
||||
gdk_device_get_state (event->device, event->window, NULL, NULL);
|
||||
|
||||
print_axes (event->device, event->axes);
|
||||
update_cursor (widget, event->x, event->y);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* We track the next two events to know when we need to draw a
|
||||
cursor */
|
||||
|
||||
static gint
|
||||
proximity_out_event (GtkWidget *widget, GdkEventProximity *event)
|
||||
{
|
||||
cursor_proximity = FALSE;
|
||||
update_cursor (widget, cursor_x, cursor_y);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
leave_notify_event (GtkWidget *widget, GdkEventCrossing *event)
|
||||
{
|
||||
cursor_proximity = FALSE;
|
||||
update_cursor (widget, cursor_x, cursor_y);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
input_dialog_destroy (GtkWidget *w, gpointer data)
|
||||
{
|
||||
*((GtkWidget **)data) = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
create_input_dialog (void)
|
||||
{
|
||||
static GtkWidget *inputd = NULL;
|
||||
|
||||
if (!inputd)
|
||||
{
|
||||
inputd = gtk_input_dialog_new();
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(inputd), "destroy",
|
||||
(GtkSignalFunc)input_dialog_destroy, &inputd);
|
||||
gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button),
|
||||
"clicked",
|
||||
(GtkSignalFunc)gtk_widget_hide,
|
||||
GTK_OBJECT(inputd));
|
||||
gtk_widget_hide (GTK_INPUT_DIALOG(inputd)->save_button);
|
||||
|
||||
gtk_widget_show (inputd);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GTK_WIDGET_MAPPED(inputd))
|
||||
gtk_widget_show(inputd);
|
||||
else
|
||||
gdk_window_raise(inputd->window);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quit (void)
|
||||
{
|
||||
gtk_exit (0);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *drawing_area;
|
||||
GtkWidget *vbox;
|
||||
|
||||
GtkWidget *button;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
current_device = gdk_core_pointer;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_widget_set_name (window, "Test Input");
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (quit), NULL);
|
||||
|
||||
/* Create the drawing area */
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
|
||||
|
||||
gtk_widget_show (drawing_area);
|
||||
|
||||
/* Signals used to handle backing pixmap */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
|
||||
(GtkSignalFunc) expose_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event",
|
||||
(GtkSignalFunc) configure_event, NULL);
|
||||
|
||||
/* Event signals */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event",
|
||||
(GtkSignalFunc) motion_notify_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event",
|
||||
(GtkSignalFunc) button_press_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "key_press_event",
|
||||
(GtkSignalFunc) key_press_event, NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "leave_notify_event",
|
||||
(GtkSignalFunc) leave_notify_event, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (drawing_area), "proximity_out_event",
|
||||
(GtkSignalFunc) proximity_out_event, NULL);
|
||||
|
||||
gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
|
||||
| GDK_LEAVE_NOTIFY_MASK
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_KEY_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_POINTER_MOTION_HINT_MASK
|
||||
| GDK_PROXIMITY_OUT_MASK);
|
||||
|
||||
/* The following call enables tracking and processing of extension
|
||||
events for the drawing area */
|
||||
gtk_widget_set_extension_events (drawing_area, GDK_EXTENSION_EVENTS_ALL);
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (drawing_area, GTK_CAN_FOCUS);
|
||||
gtk_widget_grab_focus (drawing_area);
|
||||
|
||||
/* .. And create some buttons */
|
||||
button = gtk_button_new_with_label ("Input Dialog");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (create_input_dialog), NULL);
|
||||
gtk_widget_show (button);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_destroy),
|
||||
GTK_OBJECT (window));
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
292
gtk/testrgb.c
292
gtk/testrgb.c
@ -1,292 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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 <glib.h>
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
|
||||
/* Note: these #includes differ slightly from the testrgb.c file included
|
||||
in the GdkRgb release. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "gtk.h"
|
||||
|
||||
static void
|
||||
quit_func (GtkWidget *widget, gpointer dummy)
|
||||
{
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
#define WIDTH 640
|
||||
#define HEIGHT 400
|
||||
#define NUM_ITERS 100
|
||||
|
||||
static void
|
||||
testrgb_rgb_test (GtkWidget *drawing_area)
|
||||
{
|
||||
guchar *buf;
|
||||
gint i, j;
|
||||
gint offset;
|
||||
guchar val;
|
||||
gdouble start_time, total_time;
|
||||
gint x, y;
|
||||
gboolean dither;
|
||||
int dith_max;
|
||||
GTimer *timer;
|
||||
|
||||
buf = g_malloc (WIDTH * HEIGHT * 6);
|
||||
|
||||
val = 0;
|
||||
for (j = 0; j < WIDTH * HEIGHT * 6; j++)
|
||||
{
|
||||
val = (val + ((val + (rand () & 0xff)) >> 1)) >> 1;
|
||||
buf[j] = val;
|
||||
}
|
||||
|
||||
/* Let's warm up the cache, and also wait for the window manager
|
||||
to settle. */
|
||||
for (i = 0; i < NUM_ITERS; i++)
|
||||
{
|
||||
offset = (rand () % (WIDTH * HEIGHT * 3)) & -4;
|
||||
gdk_draw_rgb_image (drawing_area->window,
|
||||
drawing_area->style->white_gc,
|
||||
0, 0, WIDTH, HEIGHT,
|
||||
GDK_RGB_DITHER_NONE,
|
||||
buf + offset, WIDTH * 3);
|
||||
}
|
||||
|
||||
if (gdk_rgb_ditherable ())
|
||||
dith_max = 2;
|
||||
else
|
||||
dith_max = 1;
|
||||
|
||||
timer = g_timer_new ();
|
||||
for (dither = 0; dither < dith_max; dither++)
|
||||
{
|
||||
start_time = g_timer_elapsed (timer, NULL);
|
||||
for (i = 0; i < NUM_ITERS; i++)
|
||||
{
|
||||
offset = (rand () % (WIDTH * HEIGHT * 3)) & -4;
|
||||
gdk_draw_rgb_image (drawing_area->window,
|
||||
drawing_area->style->white_gc,
|
||||
0, 0, WIDTH, HEIGHT,
|
||||
dither ? GDK_RGB_DITHER_MAX :
|
||||
GDK_RGB_DITHER_NONE,
|
||||
buf + offset, WIDTH * 3);
|
||||
}
|
||||
total_time = g_timer_elapsed (timer, NULL) - start_time;
|
||||
g_print ("Color test%s time elapsed: %.2fs, %.1f fps, %.2f megapixels/s\n",
|
||||
dither ? " (dithered)" : "",
|
||||
total_time,
|
||||
NUM_ITERS / total_time,
|
||||
NUM_ITERS * (WIDTH * HEIGHT * 1e-6) / total_time);
|
||||
}
|
||||
|
||||
for (dither = 0; dither < dith_max; dither++)
|
||||
{
|
||||
start_time = g_timer_elapsed (timer, NULL);
|
||||
for (i = 0; i < NUM_ITERS; i++)
|
||||
{
|
||||
offset = (rand () % (WIDTH * HEIGHT)) & -4;
|
||||
gdk_draw_gray_image (drawing_area->window,
|
||||
drawing_area->style->white_gc,
|
||||
0, 0, WIDTH, HEIGHT,
|
||||
dither ? GDK_RGB_DITHER_MAX :
|
||||
GDK_RGB_DITHER_NONE,
|
||||
buf + offset, WIDTH);
|
||||
}
|
||||
total_time = g_timer_elapsed (timer, NULL) - start_time;
|
||||
g_print ("Grayscale test%s time elapsed: %.2fs, %.1f fps, %.2f megapixels/s\n",
|
||||
dither ? " (dithered)" : "",
|
||||
total_time,
|
||||
NUM_ITERS / total_time,
|
||||
NUM_ITERS * (WIDTH * HEIGHT * 1e-6) / total_time);
|
||||
}
|
||||
|
||||
g_print ("Please submit these results to http://www.levien.com/gdkrgb/survey.html\n");
|
||||
|
||||
#if 1
|
||||
for (x = 0; x < WIDTH; x++)
|
||||
{
|
||||
int cindex;
|
||||
|
||||
cindex = (x * 8) / WIDTH;
|
||||
buf[x * 3] = cindex & 4 ? 0 : 255;
|
||||
buf[x * 3 + 1] = cindex & 2 ? 0 : 255;
|
||||
buf[x * 3 + 2] = cindex & 1 ? 0 : 255;
|
||||
}
|
||||
for (y = 1; y < (HEIGHT * 19) / 32; y++)
|
||||
{
|
||||
memcpy (buf + y * WIDTH * 3, buf, WIDTH * 3);
|
||||
}
|
||||
for (; y < (HEIGHT * 20) / 32; y++)
|
||||
{
|
||||
for (x = 0; x < WIDTH; x++)
|
||||
{
|
||||
guchar gray;
|
||||
|
||||
gray = (x * 255) / (WIDTH - 1);
|
||||
buf[y * WIDTH * 3 + x * 3] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 1] = 0;
|
||||
buf[y * WIDTH * 3 + x * 3 + 2] = 0;
|
||||
}
|
||||
}
|
||||
for (; y < (HEIGHT * 21) / 32; y++)
|
||||
{
|
||||
for (x = 0; x < WIDTH; x++)
|
||||
{
|
||||
guchar gray;
|
||||
|
||||
gray = (x * 255) / (WIDTH - 1);
|
||||
buf[y * WIDTH * 3 + x * 3] = 0;
|
||||
buf[y * WIDTH * 3 + x * 3 + 1] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 2] = 0;
|
||||
}
|
||||
}
|
||||
for (; y < (HEIGHT * 22) / 32; y++)
|
||||
{
|
||||
for (x = 0; x < WIDTH; x++)
|
||||
{
|
||||
guchar gray;
|
||||
|
||||
gray = (x * 255) / (WIDTH - 1);
|
||||
buf[y * WIDTH * 3 + x * 3] = 0;
|
||||
buf[y * WIDTH * 3 + x * 3 + 1] = 0;
|
||||
buf[y * WIDTH * 3 + x * 3 + 2] = gray;
|
||||
}
|
||||
}
|
||||
for (; y < (HEIGHT * 24) / 32; y++)
|
||||
{
|
||||
for (x = 0; x < WIDTH; x++)
|
||||
{
|
||||
guchar gray;
|
||||
|
||||
gray = 112 + (x * 31) / (WIDTH - 1);
|
||||
buf[y * WIDTH * 3 + x * 3] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 1] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 2] = gray;
|
||||
}
|
||||
}
|
||||
for (; y < (HEIGHT * 26) / 32; y++)
|
||||
{
|
||||
for (x = 0; x < WIDTH; x++)
|
||||
{
|
||||
guchar gray;
|
||||
|
||||
gray = (x * 255) / (WIDTH - 1);
|
||||
buf[y * WIDTH * 3 + x * 3] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 1] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 2] = gray;
|
||||
}
|
||||
}
|
||||
|
||||
for (; y < HEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < WIDTH; x++)
|
||||
{
|
||||
int cindex;
|
||||
guchar gray;
|
||||
|
||||
cindex = (x * 16) / WIDTH;
|
||||
gray = cindex < 3 ? 0 :
|
||||
cindex < 5 ? 255 :
|
||||
cindex < 7 ? 128 :
|
||||
0;
|
||||
buf[y * WIDTH * 3 + x * 3] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 1] = gray;
|
||||
buf[y * WIDTH * 3 + x * 3 + 2] = gray;
|
||||
}
|
||||
}
|
||||
gdk_draw_rgb_image (drawing_area->window,
|
||||
drawing_area->style->white_gc,
|
||||
0, 0, WIDTH, HEIGHT, GDK_RGB_DITHER_MAX,
|
||||
buf, WIDTH * 3);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
new_testrgb_window (void)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
GtkWidget *drawing_area;
|
||||
|
||||
window = gtk_widget_new (gtk_window_get_type (),
|
||||
"GtkObject::user_data", NULL,
|
||||
"GtkWindow::type", GTK_WINDOW_TOPLEVEL,
|
||||
"GtkWindow::title", "testrgb",
|
||||
"GtkWindow::allow_shrink", FALSE,
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
(GtkSignalFunc) quit_func, NULL);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
|
||||
gtk_widget_set_usize (drawing_area, WIDTH, HEIGHT);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, FALSE, FALSE, 0);
|
||||
gtk_widget_show (drawing_area);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
||||
(GtkSignalFunc) gtk_widget_destroy,
|
||||
GTK_OBJECT (window));
|
||||
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
testrgb_rgb_test (drawing_area);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
gdk_rgb_set_verbose (TRUE);
|
||||
|
||||
gdk_rgb_init ();
|
||||
|
||||
gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
|
||||
new_testrgb_window ();
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,490 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define GTK_ENABLE_BROKEN
|
||||
#include "gtk.h"
|
||||
|
||||
typedef enum {
|
||||
SEL_TYPE_NONE,
|
||||
APPLE_PICT,
|
||||
ATOM,
|
||||
ATOM_PAIR,
|
||||
BITMAP,
|
||||
C_STRING,
|
||||
COLORMAP,
|
||||
COMPOUND_TEXT,
|
||||
DRAWABLE,
|
||||
INTEGER,
|
||||
PIXEL,
|
||||
PIXMAP,
|
||||
SPAN,
|
||||
STRING,
|
||||
TEXT,
|
||||
WINDOW,
|
||||
LAST_SEL_TYPE
|
||||
} SelType;
|
||||
|
||||
GdkAtom seltypes[LAST_SEL_TYPE];
|
||||
|
||||
typedef struct _Target {
|
||||
gchar *target_name;
|
||||
SelType type;
|
||||
GdkAtom target;
|
||||
gint format;
|
||||
} Target;
|
||||
|
||||
/* The following is a list of all the selection targets defined
|
||||
in the ICCCM */
|
||||
|
||||
static Target targets[] = {
|
||||
{ "ADOBE_PORTABLE_DOCUMENT_FORMAT", STRING, 0, 8 },
|
||||
{ "APPLE_PICT", APPLE_PICT, 0, 8 },
|
||||
{ "BACKGROUND", PIXEL, 0, 32 },
|
||||
{ "BITMAP", BITMAP, 0, 32 },
|
||||
{ "CHARACTER_POSITION", SPAN, 0, 32 },
|
||||
{ "CLASS", TEXT, 0, 8 },
|
||||
{ "CLIENT_WINDOW", WINDOW, 0, 32 },
|
||||
{ "COLORMAP", COLORMAP, 0, 32 },
|
||||
{ "COLUMN_NUMBER", SPAN, 0, 32 },
|
||||
{ "COMPOUND_TEXT", COMPOUND_TEXT, 0, 8 },
|
||||
/* { "DELETE", "NULL", 0, ? }, */
|
||||
{ "DRAWABLE", DRAWABLE, 0, 32 },
|
||||
{ "ENCAPSULATED_POSTSCRIPT", STRING, 0, 8 },
|
||||
{ "ENCAPSULATED_POSTSCRIPT_INTERCHANGE", STRING, 0, 8 },
|
||||
{ "FILE_NAME", TEXT, 0, 8 },
|
||||
{ "FOREGROUND", PIXEL, 0, 32 },
|
||||
{ "HOST_NAME", TEXT, 0, 8 },
|
||||
/* { "INSERT_PROPERTY", "NULL", 0, ? NULL }, */
|
||||
/* { "INSERT_SELECTION", "NULL", 0, ? NULL }, */
|
||||
{ "LENGTH", INTEGER, 0, 32 },
|
||||
{ "LINE_NUMBER", SPAN, 0, 32 },
|
||||
{ "LIST_LENGTH", INTEGER, 0, 32 },
|
||||
{ "MODULE", TEXT, 0, 8 },
|
||||
/* { "MULTIPLE", "ATOM_PAIR", 0, 32 }, */
|
||||
{ "NAME", TEXT, 0, 8 },
|
||||
{ "ODIF", TEXT, 0, 8 },
|
||||
{ "OWNER_OS", TEXT, 0, 8 },
|
||||
{ "PIXMAP", PIXMAP, 0, 32 },
|
||||
{ "POSTSCRIPT", STRING, 0, 8 },
|
||||
{ "PROCEDURE", TEXT, 0, 8 },
|
||||
{ "PROCESS", INTEGER, 0, 32 },
|
||||
{ "STRING", STRING, 0, 8 },
|
||||
{ "TARGETS", ATOM, 0, 32 },
|
||||
{ "TASK", INTEGER, 0, 32 },
|
||||
{ "TEXT", TEXT, 0, 8 },
|
||||
{ "TIMESTAMP", INTEGER, 0, 32 },
|
||||
{ "USER", TEXT, 0, 8 },
|
||||
};
|
||||
|
||||
static int num_targets = sizeof(targets)/sizeof(Target);
|
||||
|
||||
static int have_selection = FALSE;
|
||||
|
||||
GtkWidget *selection_text;
|
||||
GtkWidget *selection_button;
|
||||
GString *selection_string = NULL;
|
||||
|
||||
static void
|
||||
init_atoms (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
seltypes[SEL_TYPE_NONE] = GDK_NONE;
|
||||
seltypes[APPLE_PICT] = gdk_atom_intern ("APPLE_PICT",FALSE);
|
||||
seltypes[ATOM] = gdk_atom_intern ("ATOM",FALSE);
|
||||
seltypes[ATOM_PAIR] = gdk_atom_intern ("ATOM_PAIR",FALSE);
|
||||
seltypes[BITMAP] = gdk_atom_intern ("BITMAP",FALSE);
|
||||
seltypes[C_STRING] = gdk_atom_intern ("C_STRING",FALSE);
|
||||
seltypes[COLORMAP] = gdk_atom_intern ("COLORMAP",FALSE);
|
||||
seltypes[COMPOUND_TEXT] = gdk_atom_intern ("COMPOUND_TEXT",FALSE);
|
||||
seltypes[DRAWABLE] = gdk_atom_intern ("DRAWABLE",FALSE);
|
||||
seltypes[INTEGER] = gdk_atom_intern ("INTEGER",FALSE);
|
||||
seltypes[PIXEL] = gdk_atom_intern ("PIXEL",FALSE);
|
||||
seltypes[PIXMAP] = gdk_atom_intern ("PIXMAP",FALSE);
|
||||
seltypes[SPAN] = gdk_atom_intern ("SPAN",FALSE);
|
||||
seltypes[STRING] = gdk_atom_intern ("STRING",FALSE);
|
||||
seltypes[TEXT] = gdk_atom_intern ("TEXT",FALSE);
|
||||
seltypes[WINDOW] = gdk_atom_intern ("WINDOW",FALSE);
|
||||
|
||||
for (i=0; i<num_targets; i++)
|
||||
targets[i].target = gdk_atom_intern (targets[i].target_name, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
selection_toggled (GtkWidget *widget)
|
||||
{
|
||||
if (GTK_TOGGLE_BUTTON(widget)->active)
|
||||
{
|
||||
have_selection = gtk_selection_owner_set (widget,
|
||||
GDK_SELECTION_PRIMARY,
|
||||
GDK_CURRENT_TIME);
|
||||
if (!have_selection)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (have_selection)
|
||||
{
|
||||
if (gdk_selection_owner_get (GDK_SELECTION_PRIMARY) == widget->window)
|
||||
gtk_selection_owner_set (NULL, GDK_SELECTION_PRIMARY,
|
||||
GDK_CURRENT_TIME);
|
||||
have_selection = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
selection_get (GtkWidget *widget,
|
||||
GtkSelectionData *selection_data,
|
||||
guint info,
|
||||
guint time,
|
||||
gpointer data)
|
||||
{
|
||||
guchar *buffer;
|
||||
gint len;
|
||||
GdkAtom type = GDK_NONE;
|
||||
|
||||
if (!selection_string)
|
||||
{
|
||||
buffer = NULL;
|
||||
len = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer = (guchar *)selection_string->str;
|
||||
len = selection_string->len;
|
||||
}
|
||||
|
||||
switch (info)
|
||||
{
|
||||
case COMPOUND_TEXT:
|
||||
case TEXT:
|
||||
type = seltypes[COMPOUND_TEXT];
|
||||
case STRING:
|
||||
type = seltypes[STRING];
|
||||
}
|
||||
|
||||
gtk_selection_data_set (selection_data, type, 8, buffer, len);
|
||||
}
|
||||
|
||||
gint
|
||||
selection_clear (GtkWidget *widget, GdkEventSelection *event)
|
||||
{
|
||||
have_selection = FALSE;
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gchar *
|
||||
stringify_atom (guchar *data, gint *position)
|
||||
{
|
||||
gchar *str = gdk_atom_name (*(GdkAtom *)(data+*position));
|
||||
*position += sizeof(GdkAtom);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
gchar *
|
||||
stringify_text (guchar *data, gint *position)
|
||||
{
|
||||
gchar *str = g_strdup ((gchar *)(data+*position));
|
||||
*position += strlen (str) + 1;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
gchar *
|
||||
stringify_xid (guchar *data, gint *position)
|
||||
{
|
||||
gchar buffer[20];
|
||||
gchar *str;
|
||||
|
||||
sprintf(buffer,"0x%x",*(guint32 *)(data+*position));
|
||||
str = g_strdup (buffer);
|
||||
|
||||
*position += sizeof(guint32);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
gchar *
|
||||
stringify_integer (guchar *data, gint *position)
|
||||
{
|
||||
gchar buffer[20];
|
||||
gchar *str;
|
||||
|
||||
sprintf(buffer,"%d",*(int *)(data+*position));
|
||||
str = g_strdup (buffer);
|
||||
|
||||
*position += sizeof(int);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
gchar *
|
||||
stringify_span (guchar *data, gint *position)
|
||||
{
|
||||
gchar buffer[42];
|
||||
gchar *str;
|
||||
|
||||
sprintf(buffer,"%d - %d",((int *)(data+*position))[0],
|
||||
((int *)(data+*position))[1]);
|
||||
str = g_strdup (buffer);
|
||||
|
||||
*position += 2*sizeof(int);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
void
|
||||
selection_received (GtkWidget *widget, GtkSelectionData *data)
|
||||
{
|
||||
int position;
|
||||
int i;
|
||||
SelType seltype;
|
||||
char *str;
|
||||
|
||||
if (data->length < 0)
|
||||
{
|
||||
g_print("Error retrieving selection\n");
|
||||
return;
|
||||
}
|
||||
|
||||
seltype = SEL_TYPE_NONE;
|
||||
for (i=0; i<LAST_SEL_TYPE; i++)
|
||||
{
|
||||
if (seltypes[i] == data->type)
|
||||
{
|
||||
seltype = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (seltype == SEL_TYPE_NONE)
|
||||
{
|
||||
char *name = gdk_atom_name (data->type);
|
||||
g_print("Don't know how to handle type: %s (%ld)\n",
|
||||
name?name:"<unknown>",
|
||||
data->type);
|
||||
return;
|
||||
}
|
||||
|
||||
if (selection_string != NULL)
|
||||
g_string_free (selection_string, TRUE);
|
||||
|
||||
selection_string = g_string_new (NULL);
|
||||
|
||||
gtk_text_freeze (GTK_TEXT (selection_text));
|
||||
gtk_text_set_point (GTK_TEXT (selection_text), 0);
|
||||
gtk_text_forward_delete (GTK_TEXT (selection_text),
|
||||
gtk_text_get_length (GTK_TEXT (selection_text)));
|
||||
|
||||
position = 0;
|
||||
while (position < data->length)
|
||||
{
|
||||
switch (seltype)
|
||||
{
|
||||
case ATOM:
|
||||
str = stringify_atom (data->data, &position);
|
||||
break;
|
||||
case COMPOUND_TEXT:
|
||||
case STRING:
|
||||
case TEXT:
|
||||
str = stringify_text (data->data, &position);
|
||||
break;
|
||||
case BITMAP:
|
||||
case DRAWABLE:
|
||||
case PIXMAP:
|
||||
case WINDOW:
|
||||
case COLORMAP:
|
||||
str = stringify_xid (data->data, &position);
|
||||
break;
|
||||
case INTEGER:
|
||||
case PIXEL:
|
||||
str = stringify_integer (data->data, &position);
|
||||
break;
|
||||
case SPAN:
|
||||
str = stringify_span (data->data, &position);
|
||||
break;
|
||||
default:
|
||||
{
|
||||
char *name = gdk_atom_name (data->type);
|
||||
g_print("Can't convert type %s (%ld) to string\n",
|
||||
name?name:"<unknown>",
|
||||
data->type);
|
||||
position = data->length;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
gtk_text_insert (GTK_TEXT (selection_text), NULL,
|
||||
&selection_text->style->black,
|
||||
NULL, str, -1);
|
||||
gtk_text_insert (GTK_TEXT (selection_text), NULL,
|
||||
&selection_text->style->black,
|
||||
NULL, "\n", -1);
|
||||
g_string_append (selection_string, str);
|
||||
g_free (str);
|
||||
}
|
||||
gtk_text_thaw (GTK_TEXT (selection_text));
|
||||
}
|
||||
|
||||
void
|
||||
paste (GtkWidget *widget, GtkWidget *entry)
|
||||
{
|
||||
char *name;
|
||||
GdkAtom atom;
|
||||
|
||||
name = gtk_entry_get_text (GTK_ENTRY(entry));
|
||||
atom = gdk_atom_intern (name, FALSE);
|
||||
|
||||
if (atom == GDK_NONE)
|
||||
{
|
||||
g_print("Could not create atom: \"%s\"\n",name);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_selection_convert (selection_button, GDK_SELECTION_PRIMARY, atom,
|
||||
GDK_CURRENT_TIME);
|
||||
}
|
||||
|
||||
void
|
||||
quit (void)
|
||||
{
|
||||
gtk_exit (0);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *button;
|
||||
GtkWidget *table;
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry;
|
||||
GtkWidget *hscrollbar;
|
||||
GtkWidget *vscrollbar;
|
||||
GtkWidget *hbox;
|
||||
|
||||
static GtkTargetEntry targetlist[] = {
|
||||
{ "STRING", 0, STRING },
|
||||
{ "TEXT", 0, TEXT },
|
||||
{ "COMPOUND_TEXT", 0, COMPOUND_TEXT }
|
||||
};
|
||||
static gint ntargets = sizeof(targetlist) / sizeof(targetlist[0]);
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
init_atoms();
|
||||
|
||||
dialog = gtk_dialog_new ();
|
||||
gtk_widget_set_name (dialog, "Test Input");
|
||||
gtk_container_set_border_width (GTK_CONTAINER(dialog), 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
||||
GTK_SIGNAL_FUNC (quit), NULL);
|
||||
|
||||
table = gtk_table_new (4, 2, FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER(table), 10);
|
||||
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 5);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 1, 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 2, 2);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox),
|
||||
table, TRUE, TRUE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
selection_button = gtk_toggle_button_new_with_label ("Claim Selection");
|
||||
gtk_table_attach (GTK_TABLE (table), selection_button, 0, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
||||
gtk_widget_show (selection_button);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(selection_button), "toggled",
|
||||
GTK_SIGNAL_FUNC (selection_toggled), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(selection_button), "selection_clear_event",
|
||||
GTK_SIGNAL_FUNC (selection_clear), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(selection_button), "selection_received",
|
||||
GTK_SIGNAL_FUNC (selection_received), NULL);
|
||||
|
||||
gtk_selection_add_targets (selection_button, GDK_SELECTION_PRIMARY,
|
||||
targetlist, ntargets);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT(selection_button), "selection_get",
|
||||
GTK_SIGNAL_FUNC (selection_get), NULL);
|
||||
|
||||
selection_text = gtk_text_new (NULL, NULL);
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), selection_text, 0, 1, 1, 2);
|
||||
gtk_widget_show (selection_text);
|
||||
|
||||
hscrollbar = gtk_hscrollbar_new (GTK_TEXT (selection_text)->hadj);
|
||||
gtk_table_attach (GTK_TABLE (table), hscrollbar, 0, 1, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (hscrollbar);
|
||||
|
||||
vscrollbar = gtk_vscrollbar_new (GTK_TEXT (selection_text)->vadj);
|
||||
gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 1, 2,
|
||||
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (vscrollbar);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 0, 2, 3, 4,
|
||||
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
label = gtk_label_new ("Target:");
|
||||
gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
entry = gtk_entry_new ();
|
||||
gtk_box_pack_start (GTK_BOX(hbox), entry, TRUE, TRUE, 0);
|
||||
gtk_widget_show (entry);
|
||||
|
||||
/* .. And create some buttons */
|
||||
button = gtk_button_new_with_label ("Paste");
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area),
|
||||
button, TRUE, TRUE, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (paste), entry);
|
||||
gtk_widget_show (button);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area),
|
||||
button, TRUE, TRUE, 0);
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (gtk_widget_destroy),
|
||||
GTK_OBJECT (dialog));
|
||||
gtk_widget_show (button);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
2287
gtk/testtext.c
2287
gtk/testtext.c
File diff suppressed because it is too large
Load Diff
@ -1,732 +0,0 @@
|
||||
/* Simplistic test suite */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtktextbtree.h"
|
||||
|
||||
static void fill_buffer (GtkTextBuffer *buffer);
|
||||
|
||||
static void run_tests (GtkTextBuffer *buffer);
|
||||
|
||||
int
|
||||
main (int argc, char** argv)
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
int n;
|
||||
gunichar ch;
|
||||
GtkTextIter start, end;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* Check UTF8 unknown char thing */
|
||||
g_assert (g_utf8_strlen (gtk_text_unknown_char_utf8, 3) == 1);
|
||||
ch = g_utf8_get_char (gtk_text_unknown_char_utf8);
|
||||
g_assert (ch == GTK_TEXT_UNKNOWN_CHAR);
|
||||
|
||||
/* First, we turn on btree debugging. */
|
||||
gtk_debug_flags |= GTK_DEBUG_TEXT;
|
||||
|
||||
/* Create a buffer */
|
||||
buffer = gtk_text_buffer_new (NULL);
|
||||
|
||||
/* Check that buffer starts with one empty line and zero chars */
|
||||
|
||||
n = gtk_text_buffer_get_line_count (buffer);
|
||||
if (n != 1)
|
||||
g_error ("%d lines, expected 1", n);
|
||||
|
||||
n = gtk_text_buffer_get_char_count (buffer);
|
||||
if (n != 1)
|
||||
g_error ("%d chars, expected 1", n);
|
||||
|
||||
/* Run gruesome alien test suite on buffer */
|
||||
run_tests (buffer);
|
||||
|
||||
/* Put stuff in the buffer */
|
||||
|
||||
fill_buffer (buffer);
|
||||
|
||||
/* Subject stuff-bloated buffer to further torment */
|
||||
run_tests (buffer);
|
||||
|
||||
/* Delete all stuff from the buffer */
|
||||
gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
gtk_text_buffer_delete (buffer, &start, &end);
|
||||
|
||||
/* Check buffer for emptiness (note that a single
|
||||
empty line always remains in the buffer) */
|
||||
n = gtk_text_buffer_get_line_count (buffer);
|
||||
if (n != 1)
|
||||
g_error ("%d lines, expected 1", n);
|
||||
|
||||
n = gtk_text_buffer_get_char_count (buffer);
|
||||
if (n != 1)
|
||||
g_error ("%d chars, expected 1", n);
|
||||
|
||||
run_tests (buffer);
|
||||
|
||||
g_object_unref (G_OBJECT (buffer));
|
||||
|
||||
g_print ("All tests passed.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gint
|
||||
count_toggles_at_iter (GtkTextIter *iter,
|
||||
GtkTextTag *of_tag)
|
||||
{
|
||||
GSList *tags;
|
||||
GSList *tmp;
|
||||
gint count = 0;
|
||||
|
||||
/* get toggle-ons and toggle-offs */
|
||||
tags = gtk_text_iter_get_toggled_tags (iter, TRUE);
|
||||
tags = g_slist_concat (tags,
|
||||
gtk_text_iter_get_toggled_tags (iter, FALSE));
|
||||
|
||||
tmp = tags;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
if (of_tag == NULL)
|
||||
++count;
|
||||
else if (of_tag == tmp->data)
|
||||
++count;
|
||||
|
||||
tmp = g_slist_next (tmp);
|
||||
}
|
||||
|
||||
g_slist_free (tags);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static gint
|
||||
count_toggles_in_buffer (GtkTextBuffer *buffer,
|
||||
GtkTextTag *of_tag)
|
||||
{
|
||||
GtkTextIter iter;
|
||||
gint count = 0;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
|
||||
do
|
||||
{
|
||||
count += count_toggles_at_iter (&iter, of_tag);
|
||||
}
|
||||
while (gtk_text_iter_forward_char (&iter));
|
||||
|
||||
/* Do the end iterator, because forward_char won't return TRUE
|
||||
* on it.
|
||||
*/
|
||||
count += count_toggles_at_iter (&iter, of_tag);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
check_specific_tag (GtkTextBuffer *buffer,
|
||||
const gchar *tag_name)
|
||||
{
|
||||
GtkTextIter iter;
|
||||
GtkTextTag *tag;
|
||||
gboolean state;
|
||||
gint count;
|
||||
gint buffer_count;
|
||||
gint last_offset;
|
||||
|
||||
tag = gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table (buffer),
|
||||
tag_name);
|
||||
|
||||
buffer_count = count_toggles_in_buffer (buffer, tag);
|
||||
|
||||
state = FALSE;
|
||||
count = 0;
|
||||
|
||||
last_offset = -1;
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
|
||||
if (gtk_text_iter_toggles_tag (&iter, tag) ||
|
||||
gtk_text_iter_forward_to_tag_toggle (&iter, tag))
|
||||
{
|
||||
do
|
||||
{
|
||||
gint this_offset;
|
||||
|
||||
++count;
|
||||
|
||||
this_offset = gtk_text_iter_get_offset (&iter);
|
||||
|
||||
if (this_offset <= last_offset)
|
||||
g_error ("forward_to_tag_toggle moved in wrong direction");
|
||||
|
||||
last_offset = this_offset;
|
||||
|
||||
if (gtk_text_iter_begins_tag (&iter, tag))
|
||||
{
|
||||
if (state)
|
||||
g_error ("Tag %p is already on, and was toggled on?", tag);
|
||||
state = TRUE;
|
||||
}
|
||||
else if (gtk_text_iter_ends_tag (&iter, tag))
|
||||
{
|
||||
if (!state)
|
||||
g_error ("Tag %p toggled off, but wasn't toggled on?", tag);
|
||||
state = FALSE;
|
||||
}
|
||||
else
|
||||
g_error ("forward_to_tag_toggle went to a location without a toggle");
|
||||
}
|
||||
while (gtk_text_iter_forward_to_tag_toggle (&iter, tag));
|
||||
}
|
||||
|
||||
if (count != buffer_count)
|
||||
g_error ("Counted %d tags iterating by char, %d iterating by tag toggle\n",
|
||||
buffer_count, count);
|
||||
|
||||
state = FALSE;
|
||||
count = 0;
|
||||
|
||||
gtk_text_buffer_get_end_iter (buffer, &iter);
|
||||
last_offset = gtk_text_iter_get_offset (&iter);
|
||||
if (gtk_text_iter_toggles_tag (&iter, tag) ||
|
||||
gtk_text_iter_backward_to_tag_toggle (&iter, tag))
|
||||
{
|
||||
do
|
||||
{
|
||||
gint this_offset;
|
||||
|
||||
++count;
|
||||
|
||||
this_offset = gtk_text_iter_get_offset (&iter);
|
||||
|
||||
if (this_offset >= last_offset)
|
||||
g_error ("backward_to_tag_toggle moved in wrong direction");
|
||||
|
||||
last_offset = this_offset;
|
||||
|
||||
if (gtk_text_iter_begins_tag (&iter, tag))
|
||||
{
|
||||
if (!state)
|
||||
g_error ("Tag %p wasn't on when we got to the on toggle going backward?", tag);
|
||||
state = FALSE;
|
||||
}
|
||||
else if (gtk_text_iter_ends_tag (&iter, tag))
|
||||
{
|
||||
if (state)
|
||||
g_error ("Tag %p off toggle, but we were already inside a tag?", tag);
|
||||
state = TRUE;
|
||||
}
|
||||
else
|
||||
g_error ("backward_to_tag_toggle went to a location without a toggle");
|
||||
}
|
||||
while (gtk_text_iter_backward_to_tag_toggle (&iter, tag));
|
||||
}
|
||||
|
||||
if (count != buffer_count)
|
||||
g_error ("Counted %d tags iterating by char, %d iterating by tag toggle\n",
|
||||
buffer_count, count);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
run_tests (GtkTextBuffer *buffer)
|
||||
{
|
||||
GtkTextIter iter;
|
||||
GtkTextIter start;
|
||||
GtkTextIter end;
|
||||
GtkTextIter mark;
|
||||
gint i, j;
|
||||
gint num_chars;
|
||||
GtkTextMark *bar_mark;
|
||||
GtkTextTag *tag;
|
||||
GHashTable *tag_states;
|
||||
gint count;
|
||||
gint buffer_count;
|
||||
|
||||
gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
|
||||
/* Check that walking the tree via chars and via iterators produces
|
||||
* the same number of indexable locations.
|
||||
*/
|
||||
num_chars = gtk_text_buffer_get_char_count (buffer);
|
||||
iter = start;
|
||||
bar_mark = gtk_text_buffer_create_mark (buffer, "bar", &iter, FALSE);
|
||||
i = 0;
|
||||
while (i < num_chars)
|
||||
{
|
||||
GtkTextIter current;
|
||||
GtkTextMark *foo_mark;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, ¤t, i);
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, ¤t))
|
||||
{
|
||||
g_error ("get_char_index didn't return current iter");
|
||||
}
|
||||
|
||||
j = gtk_text_iter_get_offset (&iter);
|
||||
|
||||
if (i != j)
|
||||
{
|
||||
g_error ("iter converted to %d not %d", j, i);
|
||||
}
|
||||
|
||||
/* get/set mark */
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &mark, bar_mark);
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, &mark))
|
||||
{
|
||||
gtk_text_iter_spew (&iter, "iter");
|
||||
gtk_text_iter_spew (&mark, "mark");
|
||||
g_error ("Mark not moved to the right place.");
|
||||
}
|
||||
|
||||
foo_mark = gtk_text_buffer_create_mark (buffer, "foo", &iter, FALSE);
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &mark, foo_mark);
|
||||
gtk_text_buffer_delete_mark (buffer, foo_mark);
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, &mark))
|
||||
{
|
||||
gtk_text_iter_spew (&iter, "iter");
|
||||
gtk_text_iter_spew (&mark, "mark");
|
||||
g_error ("Mark not created in the right place.");
|
||||
}
|
||||
|
||||
if (gtk_text_iter_is_end (&iter))
|
||||
g_error ("iterators ran out before chars (offset %d of %d)",
|
||||
i, num_chars);
|
||||
|
||||
gtk_text_iter_forward_char (&iter);
|
||||
|
||||
gtk_text_buffer_move_mark (buffer, bar_mark, &iter);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, &end))
|
||||
g_error ("Iterating over all chars didn't end with the end iter");
|
||||
|
||||
/* Do the tree-walk backward
|
||||
*/
|
||||
num_chars = gtk_text_buffer_get_char_count (buffer);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, -1);
|
||||
|
||||
gtk_text_buffer_move_mark (buffer, bar_mark, &iter);
|
||||
|
||||
i = num_chars;
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, &end))
|
||||
g_error ("iter at char -1 is not equal to the end iterator");
|
||||
|
||||
while (i >= 0)
|
||||
{
|
||||
GtkTextIter current;
|
||||
GtkTextMark *foo_mark;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, ¤t, i);
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, ¤t))
|
||||
{
|
||||
g_error ("get_char_index didn't return current iter while going backward");
|
||||
}
|
||||
j = gtk_text_iter_get_offset (&iter);
|
||||
|
||||
if (i != j)
|
||||
{
|
||||
g_error ("going backward, iter converted to %d not %d", j, i);
|
||||
}
|
||||
|
||||
/* get/set mark */
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &mark, bar_mark);
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, &mark))
|
||||
{
|
||||
gtk_text_iter_spew (&iter, "iter");
|
||||
gtk_text_iter_spew (&mark, "mark");
|
||||
g_error ("Mark not moved to the right place.");
|
||||
}
|
||||
|
||||
foo_mark = gtk_text_buffer_create_mark (buffer, "foo", &iter, FALSE);
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &mark, foo_mark);
|
||||
gtk_text_buffer_delete_mark (buffer, foo_mark);
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, &mark))
|
||||
{
|
||||
gtk_text_iter_spew (&iter, "iter");
|
||||
gtk_text_iter_spew (&mark, "mark");
|
||||
g_error ("Mark not created in the right place.");
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
if (!gtk_text_iter_backward_char (&iter))
|
||||
g_error ("iterators ran out before char indexes");
|
||||
|
||||
gtk_text_buffer_move_mark (buffer, bar_mark, &iter);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gtk_text_iter_backward_char (&iter))
|
||||
g_error ("went backward from 0?");
|
||||
}
|
||||
|
||||
--i;
|
||||
}
|
||||
|
||||
if (!gtk_text_iter_equal (&iter, &start))
|
||||
g_error ("Iterating backward over all chars didn't end with the start iter");
|
||||
|
||||
/*
|
||||
* Check that get_line_count returns the same number of lines
|
||||
* as walking the tree by line
|
||||
*/
|
||||
i = 1; /* include current (first) line */
|
||||
gtk_text_buffer_get_iter_at_line (buffer, &iter, 0);
|
||||
while (gtk_text_iter_forward_line (&iter))
|
||||
++i;
|
||||
|
||||
if (i != gtk_text_buffer_get_line_count (buffer))
|
||||
g_error ("Counted %d lines, buffer has %d", i,
|
||||
gtk_text_buffer_get_line_count (buffer));
|
||||
|
||||
/*
|
||||
* Check that moving over tag toggles thinks about working.
|
||||
*/
|
||||
|
||||
buffer_count = count_toggles_in_buffer (buffer, NULL);
|
||||
|
||||
tag_states = g_hash_table_new (NULL, NULL);
|
||||
count = 0;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
|
||||
if (gtk_text_iter_toggles_tag (&iter, NULL) ||
|
||||
gtk_text_iter_forward_to_tag_toggle (&iter, NULL))
|
||||
{
|
||||
do
|
||||
{
|
||||
GSList *tags;
|
||||
GSList *tmp;
|
||||
gboolean found_some = FALSE;
|
||||
|
||||
/* get toggled-on tags */
|
||||
tags = gtk_text_iter_get_toggled_tags (&iter, TRUE);
|
||||
|
||||
if (tags)
|
||||
found_some = TRUE;
|
||||
|
||||
tmp = tags;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
++count;
|
||||
|
||||
tag = tmp->data;
|
||||
|
||||
if (g_hash_table_lookup (tag_states, tag))
|
||||
g_error ("Tag %p is already on, and was toggled on?", tag);
|
||||
|
||||
g_hash_table_insert (tag_states, tag, GINT_TO_POINTER (TRUE));
|
||||
|
||||
tmp = g_slist_next (tmp);
|
||||
}
|
||||
|
||||
g_slist_free (tags);
|
||||
|
||||
/* get toggled-off tags */
|
||||
tags = gtk_text_iter_get_toggled_tags (&iter, FALSE);
|
||||
|
||||
if (tags)
|
||||
found_some = TRUE;
|
||||
|
||||
tmp = tags;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
++count;
|
||||
|
||||
tag = tmp->data;
|
||||
|
||||
if (!g_hash_table_lookup (tag_states, tag))
|
||||
g_error ("Tag %p is already off, and was toggled off?", tag);
|
||||
|
||||
g_hash_table_remove (tag_states, tag);
|
||||
|
||||
tmp = g_slist_next (tmp);
|
||||
}
|
||||
|
||||
g_slist_free (tags);
|
||||
|
||||
if (!found_some)
|
||||
g_error ("No tags found going forward to tag toggle.");
|
||||
|
||||
}
|
||||
while (gtk_text_iter_forward_to_tag_toggle (&iter, NULL));
|
||||
}
|
||||
|
||||
g_hash_table_destroy (tag_states);
|
||||
|
||||
if (count != buffer_count)
|
||||
g_error ("Counted %d tags iterating by char, %d iterating by tag toggle\n",
|
||||
buffer_count, count);
|
||||
|
||||
/* Go backward; here TRUE in the hash means we saw
|
||||
* an off toggle last.
|
||||
*/
|
||||
|
||||
tag_states = g_hash_table_new (NULL, NULL);
|
||||
count = 0;
|
||||
|
||||
gtk_text_buffer_get_end_iter (buffer, &iter);
|
||||
if (gtk_text_iter_toggles_tag (&iter, NULL) ||
|
||||
gtk_text_iter_backward_to_tag_toggle (&iter, NULL))
|
||||
{
|
||||
do
|
||||
{
|
||||
GSList *tags;
|
||||
GSList *tmp;
|
||||
gboolean found_some = FALSE;
|
||||
|
||||
/* get toggled-off tags */
|
||||
tags = gtk_text_iter_get_toggled_tags (&iter, FALSE);
|
||||
|
||||
if (tags)
|
||||
found_some = TRUE;
|
||||
|
||||
tmp = tags;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
++count;
|
||||
|
||||
tag = tmp->data;
|
||||
|
||||
if (g_hash_table_lookup (tag_states, tag))
|
||||
g_error ("Tag %p has two off-toggles in a row?", tag);
|
||||
|
||||
g_hash_table_insert (tag_states, tag, GINT_TO_POINTER (TRUE));
|
||||
|
||||
tmp = g_slist_next (tmp);
|
||||
}
|
||||
|
||||
g_slist_free (tags);
|
||||
|
||||
/* get toggled-on tags */
|
||||
tags = gtk_text_iter_get_toggled_tags (&iter, TRUE);
|
||||
|
||||
if (tags)
|
||||
found_some = TRUE;
|
||||
|
||||
tmp = tags;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
++count;
|
||||
|
||||
tag = tmp->data;
|
||||
|
||||
if (!g_hash_table_lookup (tag_states, tag))
|
||||
g_error ("Tag %p was toggled on, but saw no off-toggle?", tag);
|
||||
|
||||
g_hash_table_remove (tag_states, tag);
|
||||
|
||||
tmp = g_slist_next (tmp);
|
||||
}
|
||||
|
||||
g_slist_free (tags);
|
||||
|
||||
if (!found_some)
|
||||
g_error ("No tags found going backward to tag toggle.");
|
||||
}
|
||||
while (gtk_text_iter_backward_to_tag_toggle (&iter, NULL));
|
||||
}
|
||||
|
||||
g_hash_table_destroy (tag_states);
|
||||
|
||||
if (count != buffer_count)
|
||||
g_error ("Counted %d tags iterating by char, %d iterating by tag toggle\n",
|
||||
buffer_count, count);
|
||||
|
||||
check_specific_tag (buffer, "fg_red");
|
||||
check_specific_tag (buffer, "bg_green");
|
||||
check_specific_tag (buffer, "front_tag");
|
||||
check_specific_tag (buffer, "center_tag");
|
||||
check_specific_tag (buffer, "end_tag");
|
||||
}
|
||||
|
||||
|
||||
static char *book_closed_xpm[] = {
|
||||
"16 16 6 1",
|
||||
" c None s None",
|
||||
". c black",
|
||||
"X c red",
|
||||
"o c yellow",
|
||||
"O c #808080",
|
||||
"# c white",
|
||||
" ",
|
||||
" .. ",
|
||||
" ..XX. ",
|
||||
" ..XXXXX. ",
|
||||
" ..XXXXXXXX. ",
|
||||
".ooXXXXXXXXX. ",
|
||||
"..ooXXXXXXXXX. ",
|
||||
".X.ooXXXXXXXXX. ",
|
||||
".XX.ooXXXXXX.. ",
|
||||
" .XX.ooXXX..#O ",
|
||||
" .XX.oo..##OO. ",
|
||||
" .XX..##OO.. ",
|
||||
" .X.#OO.. ",
|
||||
" ..O.. ",
|
||||
" .. ",
|
||||
" "};
|
||||
|
||||
static void
|
||||
fill_buffer (GtkTextBuffer *buffer)
|
||||
{
|
||||
GtkTextTag *tag;
|
||||
GdkColor color, color2;
|
||||
GtkTextIter iter;
|
||||
GtkTextIter iter2;
|
||||
GdkPixbuf *pixbuf;
|
||||
int i;
|
||||
|
||||
color.red = color.green = 0;
|
||||
color.blue = 0xffff;
|
||||
color2.red = 0xfff;
|
||||
color2.blue = 0x0;
|
||||
color2.green = 0;
|
||||
|
||||
gtk_text_buffer_create_tag (buffer, "fg_blue",
|
||||
"foreground_gdk", &color,
|
||||
"background_gdk", &color2,
|
||||
"font", "-*-courier-bold-r-*-*-30-*-*-*-*-*-*-*",
|
||||
NULL);
|
||||
|
||||
color.blue = color.green = 0;
|
||||
color.red = 0xffff;
|
||||
|
||||
gtk_text_buffer_create_tag (buffer, "fg_red",
|
||||
"rise", -4,
|
||||
"foreground_gdk", &color,
|
||||
NULL);
|
||||
|
||||
color.blue = color.red = 0;
|
||||
color.green = 0xffff;
|
||||
|
||||
gtk_text_buffer_create_tag (buffer, "bg_green",
|
||||
"background_gdk", &color,
|
||||
"font", "-*-courier-bold-r-*-*-10-*-*-*-*-*-*-*",
|
||||
NULL);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_xpm_data (book_closed_xpm);
|
||||
|
||||
g_assert (pixbuf != NULL);
|
||||
|
||||
i = 0;
|
||||
while (i < 10)
|
||||
{
|
||||
gchar *str;
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
|
||||
|
||||
gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 1);
|
||||
|
||||
gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
|
||||
|
||||
str = g_strdup_printf ("%d Hello World!\nwoo woo woo woo woo woo woo woo\n",
|
||||
i);
|
||||
|
||||
gtk_text_buffer_insert (buffer, &iter, str, -1);
|
||||
|
||||
g_free (str);
|
||||
|
||||
gtk_text_buffer_insert (buffer, &iter,
|
||||
"(Hello World!)\nfoo foo Hello this is some text we are using to text word wrap. It has punctuation! gee; blah - hmm, great.\nnew line\n\n"
|
||||
/* This is UTF8 stuff, Emacs doesn't
|
||||
really know how to display it */
|
||||
"Spanish (Español) ¡Hola! / French (Français) Bonjour, Salut / German (Deutsch Süd) Grüß Gott (testing Latin-1 chars encoded in UTF8)\nThai (we can't display this, just making sure we don't crash) (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ\n",
|
||||
-1);
|
||||
|
||||
gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
|
||||
gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 4);
|
||||
|
||||
gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 7);
|
||||
|
||||
gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 8);
|
||||
|
||||
gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf);
|
||||
|
||||
gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 8);
|
||||
iter2 = iter;
|
||||
gtk_text_iter_forward_chars (&iter2, 10);
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "fg_blue", &iter, &iter2);
|
||||
|
||||
gtk_text_iter_forward_chars (&iter, 7);
|
||||
gtk_text_iter_forward_chars (&iter2, 10);
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "bg_green", &iter, &iter2);
|
||||
|
||||
gtk_text_iter_forward_chars (&iter, 12);
|
||||
gtk_text_iter_forward_chars (&iter2, 10);
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "bg_green", &iter, &iter2);
|
||||
|
||||
gtk_text_iter_forward_chars (&iter, 10);
|
||||
gtk_text_iter_forward_chars (&iter2, 15);
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "fg_red", &iter, &iter2);
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "fg_blue", &iter, &iter2);
|
||||
|
||||
gtk_text_iter_forward_chars (&iter, 20);
|
||||
gtk_text_iter_forward_chars (&iter2, 20);
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "fg_red", &iter, &iter2);
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "fg_blue", &iter, &iter2);
|
||||
|
||||
gtk_text_iter_backward_chars (&iter, 25);
|
||||
gtk_text_iter_forward_chars (&iter2, 5);
|
||||
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "fg_red", &iter, &iter2);
|
||||
gtk_text_buffer_apply_tag_by_name (buffer, "fg_blue", &iter, &iter2);
|
||||
|
||||
gtk_text_iter_forward_chars (&iter, 15);
|
||||
gtk_text_iter_backward_chars (&iter2, 10);
|
||||
|
||||
gtk_text_buffer_remove_tag_by_name (buffer, "fg_red", &iter, &iter2);
|
||||
gtk_text_buffer_remove_tag_by_name (buffer, "fg_blue", &iter, &iter2);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
/* Put in tags that are just at the beginning, and just near the end,
|
||||
* and just near the middle.
|
||||
*/
|
||||
tag = gtk_text_buffer_create_tag (buffer, "front_tag", NULL);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, 3);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter2, 300);
|
||||
|
||||
gtk_text_buffer_apply_tag (buffer, tag, &iter, &iter2);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (buffer, "end_tag", NULL);
|
||||
gtk_text_buffer_get_end_iter (buffer, &iter2);
|
||||
gtk_text_iter_backward_chars (&iter2, 12);
|
||||
iter = iter2;
|
||||
gtk_text_iter_backward_chars (&iter, 157);
|
||||
|
||||
gtk_text_buffer_apply_tag (buffer, tag, &iter, &iter2);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (buffer, "center_tag", NULL);
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter,
|
||||
gtk_text_buffer_get_char_count (buffer)/2);
|
||||
gtk_text_iter_backward_chars (&iter, 37);
|
||||
iter2 = iter;
|
||||
gtk_text_iter_forward_chars (&iter2, 57);
|
||||
|
||||
gtk_text_buffer_apply_tag (buffer, tag, &iter, &iter2);
|
||||
|
||||
gdk_pixbuf_unref (pixbuf);
|
||||
}
|
@ -1,162 +0,0 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifdef USE_PTHREADS
|
||||
#include <pthread.h>
|
||||
|
||||
static int nthreads = 0;
|
||||
static pthread_mutex_t nthreads_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
void
|
||||
close_cb (GtkWidget *w, gint *flag)
|
||||
{
|
||||
*flag = 1;
|
||||
}
|
||||
|
||||
gint
|
||||
delete_cb (GtkWidget *w, GdkEvent *event, gint *flag)
|
||||
{
|
||||
*flag = 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void *
|
||||
counter (void *data)
|
||||
{
|
||||
gchar *name = data;
|
||||
gint flag = 0;
|
||||
gint counter = 0;
|
||||
gchar buffer[32];
|
||||
|
||||
GtkWidget *window;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *button;
|
||||
|
||||
gdk_threads_enter();
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), name);
|
||||
gtk_widget_set_usize (window, 100, 50);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
|
||||
GTK_SIGNAL_FUNC (delete_cb), &flag);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
label = gtk_label_new ("0");
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0);
|
||||
|
||||
button = gtk_button_new_with_label ("Close");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (close_cb), &flag);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
/* Since flag is only checked or set inside the GTK lock,
|
||||
* we don't have to worry about locking it explicitly
|
||||
*/
|
||||
while (!flag)
|
||||
{
|
||||
sprintf(buffer, "%d", counter);
|
||||
gtk_label_set_text (GTK_LABEL (label), buffer);
|
||||
gdk_threads_leave();
|
||||
counter++;
|
||||
/* Give someone else a chance to get the lock next time.
|
||||
* Only necessary because we don't do anything else while
|
||||
* releasing the lock.
|
||||
*/
|
||||
sleep(0);
|
||||
|
||||
gdk_threads_enter();
|
||||
}
|
||||
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
pthread_mutex_lock (&nthreads_mutex);
|
||||
nthreads--;
|
||||
if (nthreads == 0)
|
||||
gtk_main_quit();
|
||||
pthread_mutex_unlock (&nthreads_mutex);
|
||||
|
||||
gdk_threads_leave();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
#ifdef USE_PTHREADS
|
||||
int i;
|
||||
|
||||
if (!gdk_threads_init())
|
||||
{
|
||||
fprintf(stderr, "Could not initialize threads\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
pthread_mutex_lock (&nthreads_mutex);
|
||||
|
||||
for (i=0; i<5; i++)
|
||||
{
|
||||
char buffer[5][10];
|
||||
pthread_t thread;
|
||||
|
||||
sprintf(buffer[i], "Thread %i", i);
|
||||
if (pthread_create (&thread, NULL, counter, buffer[i]))
|
||||
{
|
||||
fprintf(stderr, "Couldn't create thread\n");
|
||||
exit(1);
|
||||
}
|
||||
nthreads++;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock (&nthreads_mutex);
|
||||
|
||||
gdk_threads_enter();
|
||||
gtk_main();
|
||||
gdk_threads_leave();
|
||||
fprintf(stderr, "Done\n");
|
||||
#else /* !USE_PTHREADS */
|
||||
fprintf (stderr, "GTK+ not compiled with threads support\n");
|
||||
exit (1);
|
||||
#endif /* USE_PTHREADS */
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,69 +1,65 @@
|
||||
# Configure paths for GTK+
|
||||
# Owen Taylor 97-11-3
|
||||
# Configure paths for GLIB
|
||||
# Owen Taylor 1997-2001
|
||||
|
||||
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
|
||||
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
|
||||
dnl gthread is specified in MODULES, pass to glib-config
|
||||
dnl
|
||||
AC_DEFUN(AM_PATH_GTK_2_0,
|
||||
AC_DEFUN(AM_PATH_GLIB_2_0,
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the gtk-config-2.0 script
|
||||
dnl Get the cflags and libraries from the glib-config-2.0 script
|
||||
dnl
|
||||
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
|
||||
gtk_config_prefix="$withval", gtk_config_prefix="")
|
||||
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
|
||||
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
|
||||
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
|
||||
, enable_gtktest=yes)
|
||||
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
|
||||
, enable_glibtest=yes)
|
||||
|
||||
pkg_config_args=gtk+-2.0
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gthread)
|
||||
gtk_config_args="$gtk_config_args gthread"
|
||||
pkg_config_args="$pkg_config_args gthread-2.0"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test x$gtk_config_exec_prefix != x ; then
|
||||
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
|
||||
if test x${GTK_CONFIG_2_0+set} != xset ; then
|
||||
GTK_CONFIG_2_0=$gtk_config_exec_prefix/bin/gtk-config-2.0
|
||||
fi
|
||||
fi
|
||||
if test x$gtk_config_prefix != x ; then
|
||||
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
|
||||
if test x${GTK_CONFIG_2_0+set} != xset ; then
|
||||
GTK_CONFIG_2_0=$gtk_config_prefix/bin/gtk-config-2.0
|
||||
fi
|
||||
min_glib_version=ifelse([$1], ,1.3.3,$1)
|
||||
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
|
||||
|
||||
no_glib=""
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
if pkg-config --atleast-pkgconfig-version 0.5 ; then
|
||||
:
|
||||
else
|
||||
echo *** pkg-config too old; version 0.5 or better required.
|
||||
no_glib=yes
|
||||
PKG_CONFIG=no
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(GTK_CONFIG_2_0, gtk-config-2.0, no)
|
||||
min_gtk_version=ifelse([$1], ,1.3.1,$1)
|
||||
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
|
||||
no_gtk=""
|
||||
if test "$GTK_CONFIG_2_0" = "no" ; then
|
||||
no_gtk=yes
|
||||
else
|
||||
GTK_CFLAGS=`$GTK_CONFIG_2_0 $gtk_config_args --cflags`
|
||||
GTK_LIBS=`$GTK_CONFIG_2_0 $gtk_config_args --libs`
|
||||
gtk_config_major_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
if test x"$no_glib" = x ; then
|
||||
GLIB_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
|
||||
GLIB_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
|
||||
glib_config_major_version=`$PKG_CONFIG glib-2.0 --modversion | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
gtk_config_minor_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
glib_config_minor_version=`$PKG_CONFIG glib-2.0 --modversion | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
gtk_config_micro_version=`$GTK_CONFIG_2_0 $gtk_config_args --version | \
|
||||
glib_config_micro_version=`$PKG_CONFIG glib-2.0 --modversion | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
if test "x$enable_glibtest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$GTK_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$GLIB_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GTK is sufficiently new. (Also sanity
|
||||
dnl checks the results of gtk-config-2.0 to some extent
|
||||
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
|
||||
dnl checks the results of glib-config-2.0 to some extent
|
||||
dnl
|
||||
rm -f conf.gtktest
|
||||
rm -f conf.glibtest
|
||||
AC_TRY_RUN([
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -73,98 +69,93 @@ main ()
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.gtktest");
|
||||
system ("touch conf.glibtest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_gtk_version");
|
||||
tmp_version = g_strdup("$min_glib_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_gtk_version");
|
||||
printf("%s, bad version string\n", "$min_glib_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((gtk_major_version != $gtk_config_major_version) ||
|
||||
(gtk_minor_version != $gtk_config_minor_version) ||
|
||||
(gtk_micro_version != $gtk_config_micro_version))
|
||||
if ((glib_major_version != $glib_config_major_version) ||
|
||||
(glib_minor_version != $glib_config_minor_version) ||
|
||||
(glib_micro_version != $glib_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'gtk-config-2.0 --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
|
||||
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf ("*** was found! If gtk-config-2.0 was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
|
||||
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
|
||||
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf ("*** was found! If pkg-config was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If gtk-config-2.0 was wrong, set the environment variable GTK_CONFIG_2_0\n");
|
||||
printf("*** to point to the correct copy of gtk-config-2.0, and remove the file config.cache\n");
|
||||
printf("*** before re-running configure\n");
|
||||
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
|
||||
printf("*** to point to the correct configuration files\n");
|
||||
}
|
||||
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
|
||||
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
|
||||
(gtk_minor_version != GTK_MINOR_VERSION) ||
|
||||
(gtk_micro_version != GTK_MICRO_VERSION))
|
||||
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
|
||||
(glib_minor_version != GLIB_MINOR_VERSION) ||
|
||||
(glib_micro_version != GLIB_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
|
||||
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
|
||||
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
|
||||
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
}
|
||||
#endif /* defined (GTK_MAJOR_VERSION) ... */
|
||||
else
|
||||
{
|
||||
if ((gtk_major_version > major) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
|
||||
if ((glib_major_version > major) ||
|
||||
((glib_major_version == major) && (glib_minor_version > minor)) ||
|
||||
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
|
||||
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the gtk-config-2.0 shell script is\n");
|
||||
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GTK+, but you can also set the GTK_CONFIG_2_0 environment to point to the\n");
|
||||
printf("*** correct copy of gtk-config-2.0. (In this case, you will have to\n");
|
||||
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
|
||||
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_gtk" = x ; then
|
||||
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
|
||||
if test "x$no_glib" = x ; then
|
||||
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$GTK_CONFIG_2_0" = "no" ; then
|
||||
echo "*** The gtk-config-2.0 script installed by GTK could not be found"
|
||||
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the GTK_CONFIG_2_0 environment variable to the"
|
||||
echo "*** full path to gtk-config-2.0."
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** A new enough version of pkg-config was not found."
|
||||
echo "*** See http://pkgconfig.sourceforge.net"
|
||||
else
|
||||
if test -f conf.gtktest ; then
|
||||
if test -f conf.glibtest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GTK test program, checking why..."
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
echo "*** Could not run GLIB test program, checking why..."
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$LIBS $GLIB_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
|
||||
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GTK or finding the wrong"
|
||||
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
|
||||
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
|
||||
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
@ -177,18 +168,18 @@ main ()
|
||||
echo "***"
|
||||
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
|
||||
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the gtk-config-2.0 script: $GTK_CONFIG_2_0" ])
|
||||
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
|
||||
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GTK_CFLAGS=""
|
||||
GTK_LIBS=""
|
||||
GLIB_CFLAGS=""
|
||||
GLIB_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
rm -f conf.gtktest
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
rm -f conf.glibtest
|
||||
])
|
||||
|
@ -58,5 +58,15 @@ im_inuktitut_la_SOURCES = iminuktitut.c
|
||||
im_ipa_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module
|
||||
im_ipa_la_SOURCES = imipa.c
|
||||
|
||||
# We create a dummy theme for the default GTK+ theme
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0
|
||||
$(top_builddir)/gtk/gtk-query-immodules-2.0 > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules
|
||||
|
||||
module_LTLIBRARIES = im-cyrillic-translit.la $(IM_XIM_MODULE) im-viqr.la im-thai-broken.la \
|
||||
im-inuktitut.la im-ipa.la
|
||||
|
||||
gtk.immodules: Makefile.am $(module_LTLIBRARIES)
|
||||
$(top_builddir)/gtk/gtk-query-immodules-2.0 .libs/*.so > gtk.immodules
|
||||
|
||||
all-local: gtk.immodules
|
||||
|
@ -4,8 +4,16 @@ makefile.mingw
|
||||
makefile.msc
|
||||
.deps
|
||||
.libs
|
||||
simple
|
||||
testcalendar
|
||||
testgtk
|
||||
testinput
|
||||
testrgb
|
||||
testselection
|
||||
testtext
|
||||
testtreeview
|
||||
testtreecolumns
|
||||
testsocket
|
||||
testsocket_child
|
||||
testtreefocus
|
||||
treestoretest
|
||||
|
@ -31,24 +31,72 @@ LDADDS = @STRIP_BEGIN@ \
|
||||
@STRIP_END@
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
simple \
|
||||
testcalendar \
|
||||
testdnd \
|
||||
testgtk \
|
||||
testinput \
|
||||
testrgb \
|
||||
testselection \
|
||||
## testsocket \
|
||||
## testsocket_child \
|
||||
testtext \
|
||||
testtextbuffer \
|
||||
testtreeview \
|
||||
testtreefocus \
|
||||
testtreecolumns \
|
||||
testtreesort
|
||||
testtreesort \
|
||||
treestoretest
|
||||
|
||||
#testsocket_DEPENDENCIES = $(DEPS)
|
||||
#testsocket_child_DEPENDENCIES = $(DEPS)
|
||||
simple_DEPENDENCIES = $(TEST_DEPS)
|
||||
testcalendar_DEPENDENCIES = $(TEST_DEPS)
|
||||
testdnd_DEPENDENCIES = $(TEST_DEPS)
|
||||
testgtk_DEPENDENCIES = $(TEST_DEPS)
|
||||
testinput_DEPENDENCIES = $(TEST_DEPS)
|
||||
testrgb_DEPENDENCIES = $(TEST_DEPS)
|
||||
testselection_DEPENDENCIES = $(TEST_DEPS)
|
||||
testtext_DEPENDENCIES = $(TEST_DEPS)
|
||||
testtextbuffer_DEPENDENCIES = $(TEST_DEPS)
|
||||
testtreeview_DEPENDENCIES = $(DEPS)
|
||||
testtreefocus_DEPENDENCIES = $(DEPS)
|
||||
testtreecolumns_DEPENDENCIES = $(DEPS)
|
||||
testtreesort_DEPENDENCIES = $(DEPS)
|
||||
treestoretest_DEPENDENCIES = $(TEST_DEPS)
|
||||
|
||||
#testsocket_LDADD = $(LDADDS)
|
||||
#testsocket_child_LDADD = $(LDADDS)
|
||||
simple_LDADD = $(LDADDS)
|
||||
testcalendar_LDADD = $(LDADDS)
|
||||
testdnd_LDADD = $(LDADDS)
|
||||
testgtk_LDADD = $(LDADDS)
|
||||
testinput_LDADD = $(LDADDS)
|
||||
testrgb_LDADD = $(LDADDS)
|
||||
testselection_LDADD = $(LDADDS)
|
||||
testtextbuffer_LDADD = $(LDADDS)
|
||||
testtreeview_LDADD = $(LDADDS)
|
||||
testtreefocus_LDADD = $(LDADDS)
|
||||
testtreecolumns_LDADD = $(LDADDS)
|
||||
testtreesort_LDADD = $(LDADDS)
|
||||
testtext_LDADD = $(LDADDS)
|
||||
treestoretest_LDADD = $(LDADDS)
|
||||
|
||||
EXTRA_DIST += @STRIP_BEGIN@ \
|
||||
testgtk.1 \
|
||||
testgtkrc \
|
||||
testgtkrc2 \
|
||||
circles.xbm \
|
||||
3DRings.xpm \
|
||||
FilesQueue.xpm \
|
||||
Modeller.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
marble.xpm \
|
||||
test.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
test.xpm \
|
||||
@STRIP_END@
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
#endif
|
||||
|
||||
#define GTK_ENABLE_BROKEN
|
||||
#include "gtk.h"
|
||||
#include "gtk/gtk.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "gtk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
/* Backing pixmap for drawing area */
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "gtk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
static void
|
||||
quit_func (GtkWidget *widget, gpointer dummy)
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define GTK_ENABLE_BROKEN
|
||||
#include "gtk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
typedef enum {
|
||||
SEL_TYPE_NONE,
|
||||
|
@ -1,9 +1,10 @@
|
||||
/* Simplistic test suite */
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtktextbtree.h"
|
||||
#include "../gtk/gtktexttypes.h" /* Private header, for UNKNOWN_CHAR */
|
||||
|
||||
static void fill_buffer (GtkTextBuffer *buffer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user