Compare commits

...

347 Commits

Author SHA1 Message Date
Tim Janik
52223d33df released Gtk+-1.2.8.
Thu May 25 03:54:30 2000  Tim Janik  <timj@gtk.org>

        * released Gtk+-1.2.8.


(see? i _can_ get it right the first time ;)
2000-05-25 01:56:23 +00:00
Tim Janik
3a5d4e0087 gtk version 1.2.8, interface age 3, binary age 8.
Thu May 25 02:30:57 2000  Tim Janik  <timj@gtk.org>

        * configure.in: gtk version 1.2.8, interface age 3, binary age 8.
2000-05-25 01:00:26 +00:00
Tim Janik
b055c28254 update corrections ;) 2000-05-24 22:26:59 +00:00
Tim Janik
21d6acdd59 updates 2000-05-24 22:26:41 +00:00
Kjartan Maraas
71112bd2ea Update 2000-05-22 00:27:11 +00:00
Kenneth Christiansen
76014e2a5f update 2000-05-21 23:09:44 +00:00
Kjartan Maraas
5a4b3458f9 Added Norwegian translation (nynorsk dialect).
2000-05-20  Kjartan Maraas  <kmaraas@gnu.org>

	* nn.po: Added Norwegian translation (nynorsk dialect).
2000-05-20 17:41:16 +00:00
Kjartan Maraas
bb255d8d68 Removed obsolete 2000-05-19 10:34:08 +00:00
Tim Janik
90e47067c4 fix mangling of rectangle height with its width, spotted by Justin David
Fri May 19 09:54:53 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_clip_rect): fix mangling of rectangle
        height with its width, spotted by Justin David Smith (Ytinasni)
        <justins@velius.chaos2.org>.
2000-05-19 08:20:29 +00:00
Tim Janik
42c524897f handle "(nil)" foundries, patch from Grigorios Magklis.
Fri May 19 06:49:23 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkfontsel.c (gtk_font_selection_get_font_name): handle
        "(nil)" foundries, patch from Grigorios Magklis.

        * gtk/gtkfontsel.c (gtk_font_selection_load_font): don't crash
        on non-available fonts, based on a patch by Grigorios Magklis
        <maglis@cs.rochester.edu>.

Fri May 19 05:52:08 2000  Tim Janik  <timj@gtk.org>

        * gdk/gdkx.h: wrap contents into extern "C" { }, patch by Leonardo
        Zide (leo@lokigames.com).
2000-05-19 05:42:06 +00:00
Szabolcs Ban
93fe7a1353 Szabolcs BAN <shooby@gnome.hu>
* Finished Hungarian translations...
2000-05-18 13:19:46 +00:00
Ville Hautamaki
3d46b64e3d Minor finnish update
Ville
2000-05-18 11:06:16 +00:00
Pablo Saratxaga
5d1c00802e Updated Spanish and Walloon files
Corrected a syntax error in Dutch file ( s -> %s )
2000-05-17 23:33:45 +00:00
Raph Levien
eda7c00f58 Fixed segfault when gdk_rgb_min_colors exceeds maximum cube size. 2000-05-17 08:04:06 +00:00
Pablo Saratxaga
ab364d726a Added a gtkrc.cp1255 for Yiddish/Hebrew fontset
Added "*-r-*" to all fontsets; as a last resort default.
2000-05-08 18:49:18 +00:00
Pablo Saratxaga
7d622f5328 Updated ca.po (changed mantainer) 2000-05-04 13:09:40 +00:00
Tim Janik
ee76654247 some Make 3.79 $(strip ) versions are broken and require an empty arg,
Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>

        * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
        broken and require an empty arg, give it to them.
2000-05-04 00:19:04 +00:00
Pablo Saratxaga
cc4ef5bcdf Updated wa.po 2000-04-30 00:26:02 +00:00
Tim Janik
2e34ce303a when unref-ing the handlers, also invalidate them. bug nailed down by Karl
Sun Mar 26 03:21:28 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.c (gtk_signal_handlers_destroy): when unref-ing
        the handlers, also invalidate them. bug nailed down by Karl Nelson
        <kenelson@ece.ucdavis.edu>.
2000-03-26 01:30:34 +00:00
Pablo Saratxaga
44e72c4ac1 Updated Lithuanian file 2000-03-20 18:39:46 +00:00
Owen Taylor
74bd7ec0a1 Fix a bunch of cases where XGetWindowProperty() is called without trapping
Mon Mar 13 18:37:55 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c: Fix a bunch of cases where XGetWindowProperty()
	is called without trapping X errors.
2000-03-13 23:41:53 +00:00
Pablo Saratxaga
4078590376 Updated lt.po 2000-03-13 21:14:29 +00:00
GMT 2000 Tony Gale
388e9cc8b1 FAQ Update: - Minor cleanups (Emmanuel, me) - New questions: I need to add
Thu Mar  9 22:10:56 GMT 2000  Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ Update:
          - Minor cleanups (Emmanuel, me)
          - New questions:
                I need to add a new signal to a GTK+ widget. Any idea? (timj)
                How can I retrieve the text from a GtkMenuItem? (timj)
                How do I validate/limit/filter the input to a GtkEntry? (me)
                Memory does not seem to be released when I free the list
                        nodes I've allocated (timj)
2000-03-10 09:36:09 +00:00
Tim Janik
a24c0e61f6 nothing really 2000-03-01 05:08:59 +00:00
GMT 2000 Tony Gale
877738b90a Spelling/grammar fixes from Martin Buchholz <martin@xemacs.org>
Tue Feb 29 13:10:00 GMT 2000  Tony Gale <gale@gtk.org>

        * gdk/gdkwindow.h gdk/x11/gxid.c gtk/gtkclist.c gtk/gtkclist.h
          gtk/gtkctree.c gtk/gtkmenu.h gtk/gtkwidget.c gtk/testgtk.c
          docs/styles.txt docs/refcounting.txt docs/gtkfaq.sgml
          docs/gtk_tut.sgml docs/gtk.texi TODO:

          Spelling/grammar fixes from Martin Buchholz <martin@xemacs.org>
2000-02-29 13:28:13 +00:00
Owen Taylor
fcfaafd93e Fix problem where stray '"' characters found their way into the fontset
Fri Feb 25 10:48:53 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.*: Fix problem where stray '"' characters found their
	way into the fontset lists.
2000-02-25 15:49:36 +00:00
GMT 2000 Tony Gale
30cc40d29e Implement num_marked_dates, and don't emit mutiple day_selected signals on
Thu Feb 24 16:12:27 GMT 2000  Tony Gale <gale@gtk.org>

        * gtk/gtkcalendar.c: Implement num_marked_dates,
          and don't emit mutiple day_selected signals on
          month_prev.
2000-02-24 16:16:29 +00:00
GMT 2000 Tony Gale
86171eb551 New section on GtkCalendar Update example code
Wed Feb 23 10:54:14 GMT 2000  Tony Gale <gale@gtk.org>

        * docs/gtk_tut.sgml: New section on GtkCalendar
        * examples/calendar: Update example code
2000-02-23 10:55:56 +00:00
GMT 2000 Tony Gale
8ae8964c9f Get the date on the FAQ right. Grr.
Tue Feb 22 14:02:48 GMT 2000 Tony Gale <gale@gtk.org>

	* Get the date on the FAQ right. Grr.
2000-02-22 13:58:08 +00:00
GMT 2000 Tony Gale
5d4a62a69b FAQ Update
Tue Feb 22 13:54:12 GMT 2000  Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ Update
2000-02-22 13:52:46 +00:00
Tim Janik
572cec3f4c add extern "C" scope.
Tue Feb 22 08:52:52 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkthemes.h: add extern "C" scope.
2000-02-22 07:58:50 +00:00
Lars Hamann
a53000aa95 applied patch from Guy Harris <guy@netapp.com> to make appends to the list
Mon Feb 21 20:16:42 2000  Lars Hamann  <lars@gtk.org>

        * gtk/gtkclist.c: applied  patch from Guy Harris <guy@netapp.com>
        to make appends to the list constant. (gtk-guy-990901-0.patch)
2000-02-21 20:19:13 +00:00
Havoc Pennington
ac67b09410 Don't recommend the use of gtk_signal_handlers_destroy, closes bug #6390
2000-02-19  Havoc Pennington  <hp@pobox.com>

	* docs/gtk_tut.sgml: Don't recommend the use of
		gtk_signal_handlers_destroy, closes bug #6390
2000-02-19 19:59:06 +00:00
Tim Janik
e57721e0ba remove extraneous prototypes, patch from Sam O'Connor
Thu Feb 17 02:19:32 2000  Tim Janik  <timj@gtk.org>

        * gdk/gdk.h:
        * gtk/gtkaccelgroup.h:
        * gtk/gtkthemes.h: remove extraneous prototypes, patch from
        Sam O'Connor <oconnor@eiffel.com>.
2000-02-17 01:25:27 +00:00
CST 2000 Shawn T. Amundson
fa77e9551f Released GTK+ 1.2.7
Wed Feb 16 05:22:36 CST 2000 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.7
2000-02-16 13:04:31 +00:00
SHIRASAKI Yasuhiro
01ae7f9537 Updated Japanese translation.
* ja.po: Updated Japanese translation.

-- yasuhiro
2000-02-15 02:21:38 +00:00
Tim Janik
60aea982b0 use g_str_hash() and g_str_equal() for the typename hash table.
Mon Feb 14 22:50:10 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtktypeutils.c (gtk_type_init): use g_str_hash() and g_str_equal()
        for the typename hash table.
2000-02-14 21:55:04 +00:00
Owen Taylor
5c478e3754 Add some sanity checks to make sure we never divide by zero. (Problem
Mon Feb 14 15:01:23 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkpaned.c (gtk_paned_compute_position): Add some sanity checks
	to make sure we never divide by zero.
	(Problem pointed out by Michal Jaegermann <michal@ellpspace.math.ualberta.ca>)
2000-02-14 20:03:04 +00:00
Owen Taylor
2853369686 Apply patch from SHIRASAKI Yasuhiro <yasuhiro@awa.tohoku.ac.jp> to make
Mon Feb 14 12:29:38 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfontsel.c: Apply patch from
	SHIRASAKI Yasuhiro <yasuhiro@awa.tohoku.ac.jp> to make font selector work a little
	better with 2-byte fonts. (Load a fontset instead of a font for two byte fonts.)

	Also, some cleanups in atom handling.
2000-02-14 19:35:29 +00:00
Tim Janik
a326074438 parent class is GtkContainer, not GtkWidget.
Sun Feb 13 08:02:21 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtksocket.c (gtk_socket_class_init): parent class is GtkContainer,
        not GtkWidget.
2000-02-13 07:03:53 +00:00
Tim Janik
778cb9ab52 had to squeeze some more guint wrap-around bugs before going to bed.
Fri Feb 11 02:19:32 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkhpaned.c (gtk_hpaned_size_allocate):
        * gtk/gtkvpaned.c (gtk_vpaned_size_allocate):
        * gtk/gtkpaned.c (gtk_paned_compute_position): had to squeeze some
        more guint wrap-around bugs before going to bed.
2000-02-11 06:39:19 +00:00
Tim Janik
3f8d44d715 guard against guint wrap arounds in allocation.width.
Thu Feb 10 16:16:35 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkspinbutton.c (gtk_spin_button_size_allocate): guard against
        guint wrap arounds in allocation.width.

        * gtk/gtktable.c (gtk_table_size_allocate_pass1): repeat shrinking
        process untill we fit the allocation given.
2000-02-10 21:13:41 +00:00
Tim Janik
c39a5a1c6f guard widget access with ref/unref around signal emission.
Tue Feb  8 09:38:29 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c:
        (gtk_widget_unrealize): guard widget access with ref/unref
        around signal emission.
        (gtk_widget_hide): same here, but also check its destroyed
        state before queueing a resize.
2000-02-08 09:03:51 +00:00
Tim Janik
319b25908b use gtk_default_prelight_bg instead of gtk_default_insensitive_bg as
Tue Feb  8 03:05:55 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkstyle.c (gtk_style_new): use gtk_default_prelight_bg instead
        of gtk_default_insensitive_bg as insensitive base color.

        * gtk/gtktext.c (gtk_text_style_set): set the background color according
        to the widget's state.
        (gtk_text_realize): same here.
        (gtk_text_state_changed): same here.
        (draw_bg_rect): compare background color against base[] from
        GTK_WIDGET_STATE (text) not GTK_STATE_NORMAL.
2000-02-08 02:09:23 +00:00
Tim Janik
49bc9e0606 ignore delete events when grabs are active, unless a delete event is send
Mon Feb  7 04:01:55 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkmain.c (gtk_main_do_event): ignore delete events when
        grabs are active, unless a delete event is send to the toplevel
        of the currently grab holding widget.
2000-02-07 05:27:08 +00:00
Owen Taylor
81cb919181 Remove debugging g_print's.
Sun Feb  6 10:13:15 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (gtk_ctree_drag_data_received): Remove
	debugging g_print's.
2000-02-06 15:14:36 +00:00
Tim Janik
1f72a1fd70 up version number to 1.2.7, interface age 2, binary age 7. depend on glib
Fri Feb  4 19:40:50 2000  Tim Janik  <timj@gtk.org>

        * configure.in: up version number to 1.2.7, interface age 2, binary
        age 7. depend on glib 1.2.7.

        * NEWS: updates.
2000-02-04 03:26:10 +00:00
Owen Taylor
5aa2275d8b Feb 4 15:54:54 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_size_request): Don't
	ever make the scrolled-window requisition ever depend on the
	visibility state of the scrollbars for the AUTOMATIC policy.
	This breaks the	GTK+ requisition model, and causes loops.
2000-02-03 23:45:12 +00:00
Owen Taylor
ed581c7530 Set the charset explicitely for the default font to avoid problems with
Fri Feb  4 15:09:12 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c (gtk_style_new): Set the charset explicitely for
	the default font to avoid problems with XFree86-4.0 where the
	default charset is iso10646-1, not iso8859-1.
2000-02-03 22:15:44 +00:00
Pablo Saratxaga
84591d622b updated lt.po 2000-02-03 17:32:44 +00:00
Kjartan Maraas
d5c5dba8de Updated translation.
2000-02-04  Kjartan Maraas  <kmaraas@online.no>

	* no.po: Updated translation.
2000-02-03 11:05:58 +00:00
Manish Singh
b40cc444eb acinclude.m4 config.guess config.sub ltconfig upgrade to libtool 1.3.4
* acinclude.m4
* config.guess
* config.sub
* ltconfig
* ltmain.sh: upgrade to libtool 1.3.4 (bugfix only release)

* gtk/Makefile.am: minor cosmetic consistency tweak

-Yosh
2000-02-03 01:07:44 +00:00
Pablo Saratxaga
c299e5d963 updated ca.po 2000-02-03 01:03:10 +00:00
Owen Taylor
7de47cc94b Set the activate_time to 0, so that we handle a quick press/release
Thu Feb  3 14:46:01 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenushell.c (gtk_menu_shell_button_release): Set
	the activate_time to 0, so that we handle a quick
	press/release press/release properly and don't suppress
        the second release. (Red Hat bug #7545)
2000-02-02 22:04:41 +00:00
Tim Janik
cec440f3e4 fixed very evil reentrancy bugs with destruction notifier, *always* update
Wed Feb  2 22:25:17 2000  Tim Janik  <timj@gtk.org>

        * gtk/gtkctree.c (row_delete):
        (gtk_ctree_node_set_row_data_full): fixed very evil reentrancy bugs with
        destruction notifier, *always* update internal structures *before*
        calling user code.
2000-02-01 23:32:26 +00:00
Lars Hamann
255369aecb A few more fixes for bug #5487, #2051, #2677. Reset clist->anchor to -1 if
Sun Jan 30 20:10:52 2000  Lars Hamann  <lars@gtk.org>

        A few more fixes for bug #5487, #2051, #2677.
        * gtk/gtkclist.c :
        (gtk_clist_button_press):  Reset clist->anchor to -1 if event->type is
        not GDK_BUTTON_PRESS.
        (resync_selection): resync only if selection_mode is
        GTK_SELECTION_EXTENDED
        * gtk/gtkctree.c (resync_selection): same here
2000-01-29 23:12:08 +00:00
Owen Taylor
c59f760824 Removed duplicate prototypes for gdk_drag_get_selection() and
Sun Jan 30 12:29:20 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.h gtk/gtkmenu.h: Removed duplicate prototypes for
	gdk_drag_get_selection() and gtk_menu_detach().

	[ From Jeroen Ruigrok/Asmodai ]
2000-01-29 20:01:59 +00:00
Owen Taylor
06b6a0f70a page->tab_label can be NULL.
Sat Jan 29 10:11:56 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_size_request):
	page->tab_label can be NULL.
2000-01-28 17:19:02 +00:00
Havoc Pennington
dad7ab1fd6 parent_relative arg is boolean
2000-01-25  Havoc Pennington  <hp@pobox.com>

* gdk/gdkwindow.c (gdk_window_set_back_pixmap): parent_relative
arg is boolean

* gdk/gdkselection.c (gdk_selection_owner_set): return boolean

* gdk/gdkrectangle.c (gdk_rectangle_intersect): return boolean

* gdk/gdkproperty.c (gdk_property_get): return boolean

* gdk/gdkinput.c (gdk_input_set_mode): return boolean

* gdk/gdkim.c (gdk_im_ready): return boolean

* gdk/gdkgc.c (gdk_gc_set_exposures): gboolean arg

* gdk/gdkfont.c (gdk_font_equal): return gboolean (mild
glib clash, should fix glib)

* gdk/gdkevents.c (gdk_set_show_events): take gboolean arg
(gdk_get_show_events): return gboolean, and canonicalize
to TRUE/FALSE

* gdk/gdkcolor.c (gdk_colormap_new): gboolean flag whether the
colormap is private
(gdk_colors_alloc): gboolean whether to be contiguous
(gdk_color_equal): return gboolean since we are a predicate
and not a qsort() (this looks semi-wrong due to glib breakage,
IMO glib should be fixed)

* gdk/gdk.c (gdk_set_use_xshm): take gboolean arg
(gdk_get_use_xshm): return gboolean
(gdk_pointer_is_grabbed): return gboolean

* gdk/gdk.h: Change prototypes to match all the above changes,
and re-run egtk-format-protos as required.
2000-01-27 21:10:44 +00:00
Owen Taylor
bd39b10fc4 Return immediately if clist->drag_pos < 0. This is a workaround for the
Fri Jan 28 12:28:17 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (resync_selection):
	* gtk/gtkclist.c (resync_selection):

	Return immediately if clist->drag_pos < 0. This is a workaround
	for the corrupt state that the clist gets into when a
	GDK_2BUTTON_PRESS occurs. See note in gtk_clist_button_press().

	Bug #5487, #2051, #2677; fix suggested by David Helder and T. Alexander Popiel.

	* gtk/gtknotebook.c (gtk_notebook_size_request): Fix uninitialized
	variable from recent commit.
2000-01-27 19:37:34 +00:00
Pablo Saratxaga
3dad840ffb Added Lithuanian file 2000-01-27 16:29:39 +00:00
Owen Taylor
ef642b7799 Fix stupid typo in last commit.
Thu Jan 27 15:22:09 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_begin): Fix stupid typo in last commit.
2000-01-27 02:39:44 +00:00
Tim Janik
958d74e856 prefix all autogenerated source that get build in $(srcdir) with
Thu Jan 27 18:00:55 2000  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am: prefix all autogenerated source that get build in
        $(srcdir) with $(srcdir)/, so make doesn't assume they got generted
        in builddir. since we subsequently cd into srcdir for autogeneration,
        the paths have to be stripped from the target file names, thusly we
        use $(@F) as target names now.
        put a comment about configure.in's --disable-rebuilds option,
        which can be used for non-writable source directories, for development
        setups though, srcdir has to be *writable*.
2000-01-26 19:20:44 +00:00
Tim Janik
39246639a1 revert change so stuff compiles 2000-01-26 17:11:12 +00:00
Owen Taylor
e5b7ec7e36 Finish the job of allowing event to be NULL. (Fixes bug #4283, reported by
Thu Jan 27 00:15:03 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_begin gtk_drag_get_event_actions):
	  Finish the job of allowing event to be NULL.
	  (Fixes bug #4283, reported by Chris Blizzard)

	* gtk/gtkentry.c (entry_adjust_scroll): When calculating
	  things so that the cursor appears on screen, properly
	  take into account INNER_BORDER.
	  (Fixes bug #4754, reported by Antonio Campos)
2000-01-26 05:50:53 +00:00
Owen Taylor
b269eb0874 Don't show the tab_label unless it itself is visible.
Wed Jan 26 23:12:28 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_map): Don't
	  show the tab_label unless it itself is visible.

	  gtk/gtknotebook.c (gtk_notebook_size_request):
	  Do a better job of making sure that the visibility
	  of the tab label corresponds to whether it should
	  be mapped or not.
2000-01-26 04:29:01 +00:00
Owen Taylor
9770128fb9 Use the requisition, not the allocation, since the allocation has not
Wed Jan 26 21:17:03 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkoptionmenu.c (gtk_option_menu_position):
	  Use the requisition, not the allocation, since the
	  allocation has not necessarily been computed yet.
	  (Pointed out by Eugene Osintsev)
2000-01-26 02:33:04 +00:00
Owen Taylor
c1f4231af6 Dont' set style/base[GTK_STATE_INSENSITIVE] both to
Wed Jan 26 19:44:25 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c (gtk_style_new): Dont' set
	  style/base[GTK_STATE_INSENSITIVE] both to
	  gtk_default_insensitive_bg!
	  (Bug #2187, reported by Jonathan Blandford)

	* gtk/gtkaccelgroup.c (gtk_accelerator_valid):
	  Add Alt_L, Alt_R to list of invalid accelerators.
 	  (Bug #3736, reported by Vlad Harchev)
2000-01-26 01:03:28 +00:00
Owen Taylor
f86f2a2944 Fix several bugs which occured after an attempt to open invalid home
Wed Jan 26 19:01:56 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c (open_ref_dir): Fix several
	bugs which occured after an attempt to open
	invalid home directory left cmpl_state->reference_dir == NULL.

	 - completion on files in home directory didn't work
	 - completion on an empty string caused  segfault

	 (Bug #3768, reported by Steve Ratcliffe)

	* gtk/gtkscale.c (gtk_scale_get_value_width): Fix
	cut and paste error that was causing scales to
	be incorrectly positioned.
	(Bug #2956,
	 patch from Steve Ratcliffe <steve@parabola.demon.co.uk>)
2000-01-26 00:44:30 +00:00
Shirasaki Yasuhiro
04d6ead184 check dcgettext with libintl, if it's specified.
2000-01-27  Shirasaki Yasuhiro  <yasuhiro@gnome.gr.jp>

        * acinclude.m4 (AM_GTK_WITH_NLS): check dcgettext
        with libintl, if it's specified.
2000-01-26 00:14:43 +00:00
Owen Taylor
4249864c0d Ignore queue_clear on NO_WINDOW widgets during a reparent, since at that
Wed Jan 26 18:06:07 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
	queue_clear on NO_WINDOW widgets during a reparent,
	since at that point the window and widget heirarchies
	are out of sync. This stops crashing in some cases
	(the scrolled window reparent test, for instance), and
	_probably_ won't cause drawing errors.

	* gtk/testgtk.c: Make the reparenting-a-scrolled-window
	test do what it was supposed to do and be robust against
	window closings, etc. (Bug #2443)
2000-01-25 23:48:45 +00:00
Owen Taylor
cc7b995f66 Fix return values on mouse events. (Bug #2686, Sky <seb_sky@yahoo.com>)
Wed Jan 26 16:56:54 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c: Fix return values on mouse events.
	(Bug #2686, Sky <seb_sky@yahoo.com>)

	* gtk/genmarshal.pl: Fix up handling of FOREIGN.
	(pointed out by George Lebl)

 	* gdk/gdkcolor.c (gdk_color_copy): Made const-safe.
	(From Ettore Perazzoli  <ettore@helixcode.com>)
2000-01-25 22:20:20 +00:00
Owen Taylor
03fc238e46 Tiny update from Stanislav Brabec <utx@k332.feld.cvut.cz> (closes Bug
Tue Jan 25 16:46:23 2000  Owen Taylor  <otaylor@redhat.com>

	* cs.po: Tiny update from  Stanislav Brabec <utx@k332.feld.cvut.cz>
	(closes Bug #2406)
2000-01-25 21:26:28 +00:00
Owen Taylor
911ced17c2 Handle clicks between rows or outside calender area correctly. (Patch from
Mon Jan 24 10:44:48 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcalendar.c (gtk_calendar_main_button): Handle
	clicks between rows or outside calender area correctly.
	(Patch from Damon Chaplin)

	* gtk/gtkclist.c (gtk_clist_set_row_data_full):
	* gtk/gtkctree.c (gtk_ctree_node_set_row_data_full):
	  Call destroy function when overwriting existing data.
	  (Pointed out by Damon Chaplin)
2000-01-25 15:18:19 +00:00
Owen Taylor
67dbd575c2 Remove useless #include of <X11/Xmu/WinUtil.h>, which was causing problems
Tue Jan 25 09:55:41 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c: Remove useless #include of <X11/Xmu/WinUtil.h>,
	  which was causing problems on various systems with Xmu.
	  This hasn't been needed for a very long time.
	  (Fixes #1185 3167)
2000-01-25 14:42:27 +00:00
Owen Taylor
c3bf3122da Include <ctype.h> when defining gdk_isw* in terms of is* as a fallback.
Sun Jan 23 22:27:36 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdki18n.h: Include <ctype.h> when defining
	  gdk_isw* in terms of is* as a fallback.
	  (Bug #4106 - Dan Winship <danw@MIT.EDU>)
2000-01-24 02:58:21 +00:00
Owen Taylor
1175039476 Don't realize the widget when it is size allocated! (old, old bug)
Sun Jan 23 22:12:36 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkviewport.c (gtk_viewport_size_allocate): Don't
	  realize the widget when it is size allocated!
	  (old, old bug)

	* gtk/gtkviewport.c (gtk_viewport_adjustment_value_changed):
	  Removed unused call to gdk_window_get_size() that
	  showed up when the above was fixed.
2000-01-24 02:41:59 +00:00
Owen Taylor
373c75d574 Added short note about setting LDFLAGS and CPPFLAGS to find libraries not
Sun Jan 23 20:52:40 2000  Owen Taylor  <otaylor@redhat.com>

	* INSTALL: Added short note about setting LDFLAGS
	  and CPPFLAGS to find libraries not in the default
	  install path. Fixed env/setenv confusion for csh.
2000-01-24 01:21:20 +00:00
Owen Taylor
fcd4498506 Correctly fix up widget->window when the widget is a NO_WINDOW container
Sat Jan 22 15:44:30 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_reparent): Correctly
	  fix up widget->window when the widget is a
	  NO_WINDOW container widget.
2000-01-22 21:48:49 +00:00
Owen Taylor
7c1abc5f73 Rewrite to account for the fact that feof() does _not_ return TRUE on
Sat Jan 22 12:40:48 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite
	  to account for the fact that feof() does _not_
	  return TRUE on errors, and thus avoid infinite loops
	  when trying to use gdk_pixmap_create_from_xpm()
	  on unreadable values.
2000-01-22 17:43:44 +00:00
Owen Taylor
25b47b88cd s/gint/gboolean/.
Fri Jan 21 18:32:43 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/.
2000-01-21 23:34:54 +00:00
Owen Taylor
638080f28a Change from gdk_gc_set_dashes to take gint8 instead of gchar to make it
Fri Jan 21 16:24:08 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkgc.c (gdk_gc_set_dashes): Change from
	  gdk_gc_set_dashes to take gint8 instead of gchar to
	  make it clearer that it is _not_ a NULL terminated string.

	* gdk/gdk.h gdk/gdkfont.c gdk/gdkgc.c gdk/gdkselection.c
	  gdk/gdkwindow.c gtk/gtkprogress.[ch] gtk/gtkthemes.[ch]
	  gtk/gtktreeitem.[ch] gtk/gtkwidget.[ch]: Constify string
	  arguments.
2000-01-21 23:22:51 +00:00
Elliot Lee
087eed88f3 Add note about gtk_tooltips_set_colors().
2000-01-13 Elliot Lee <sopwith@redhat.com>
	* gtk/gtktooltips.c: Add note about gtk_tooltips_set_colors().
2000-01-13 21:17:40 +00:00
Pablo Saratxaga
ecc7096f83 updated es.po 2000-01-09 17:42:09 +00:00
Jesus Bravo Alvarez
29edc1802f Added Galician to ALL_LINGUAS 2000-01-08 10:11:18 +00:00
Kjartan Maraas
bd063a8f9a And this file too 2000-01-03 23:57:26 +00:00
Kjartan Maraas
bc36a3cdb0 A little script that lets people update the .pot file without makefiles
2000-01-04  Kjartan Maraas  <kmaraas@online.no>

	* update.sh: A little script that lets people
	update the .pot file without makefiles etc.
2000-01-03 23:56:24 +00:00
Jesus Bravo Alvarez
cb0c6a6943 Updated Galician translation 2000-01-03 12:47:22 +00:00
Tim Janik
ddd28f9d4c when calculating the background size relative to our allocation, guard
Thu Dec 30 04:51:05 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkvscale.c (gtk_vscale_pos_background):
        * gtk/gtkhscale.c (gtk_hscale_pos_background): when calculating the
        background size relative to our allocation, guard against small
        allocations, we may have not yet been size allocated.
1999-12-30 03:57:47 +00:00
Tim Janik
4ff91a04c0 reverted sopwith's changes to Makefile.am, the builddir != srcdir case was
Fri Dec 24 03:41:33 1999  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am: reverted sopwith's changes to Makefile.am,
        the builddir != srcdir case was already handled fine, and his
        "fix" would produce multiple copies of the built sources.
        for development you just need a writable srcdir.
1999-12-24 02:46:23 +00:00
Elliot Lee
1b1ea194a5 And add .c to a filename, DOH!
And add .c to a filename, DOH!
1999-12-21 23:41:14 +00:00
Elliot Lee
d74b6b56e6 (Tagalong to previous commit) Trailing \'s on previous lines were
(Tagalong to previous commit) Trailing \'s on previous lines were
preventing CWD going back to $builddir
1999-12-21 23:39:31 +00:00
Elliot Lee
822fab280f Fix builddir != srcdir for generation of gtktypebuiltins*.[ch]
* gtk/Makefile.am: Fix builddir != srcdir for
  generation of gtktypebuiltins*.[ch]
1999-12-21 23:36:07 +00:00
Owen Taylor
7b31d00ddf Allow version >= 3, not just version == 3. We implement all 3 + most of 4
Thu Dec  2 10:59:14 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c (xdnd_check_dest): Allow version >= 3,
	not just version == 3. We implement all 3 + most of 4 -
	(we don't support matching text/plain;charset=iso-8859-1
	to a dest that expects text/plain). We'll still advertise
	3 to be safe, but any client implementing version >= 3
	must interoperate with 3.
1999-12-02 17:03:55 +00:00
Owen Taylor
f6e398fa53 Reverted pending mail to developers explaining patch 1999-11-20 14:32:35 +00:00
Dietmar Maurer
6eb684bebc *** empty log message *** 1999-11-20 14:16:34 +00:00
Owen Taylor
d8ebd2d78a If translation does not include a '/', use entire translation instead of
Tue Nov 16 10:15:54 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
	If translation does not include a '/', use entire
	translation instead of crashing.
1999-11-16 15:25:48 +00:00
GMT 1999 Tony Gale
0d4c279b4b s/gtk_main_iteration/g_main_iteration/
Mon Nov 15 17:17:51 GMT 1999 Tony Gale  <gale@gtk.org>

        * docs/gtkfaq.sgml: s/gtk_main_iteration/g_main_iteration/
1999-11-15 17:21:26 +00:00
Pablo Saratxaga
6c70ce7260 updated el.po 1999-11-14 18:48:20 +00:00
GMT 1999 Tony Gale
828b8b8600 New example code files.
Sat Nov 13 23:18:42 GMT 1999  Tony Gale  <gale@gtk.org>

New example code files.
1999-11-13 23:02:30 +00:00
GMT 1999 Tony Gale
bcb86b752f threads example from Erik Mouw. New question on GtkLabel background
Sat Nov 13 22:30:29 GMT 1999 Tony Gale  <gale@gtk.org>

        * docs/gtkfaq.sgml: threads example from Erik Mouw.
        New question on GtkLabel background colors.

        * docs/gtk_tut.sgml:
          - Correct the example code callback
            function definitions.
          - Update the gtkdial example code, from Frans van Schaik.
          - Update setselection.c to current API.
          - Merge the various versions of this document.

        * examples/Makefile examples/*/*.c: Update to code
        listed in tutorial.
1999-11-13 23:01:18 +00:00
Pablo Saratxaga
0a4ea40510 updated danish file 1999-11-13 20:39:28 +00:00
Sven Neumann
43f31b2e7d gdk/gdkinputcommon.h Call XFreeDeviceState() on results of
* gdk/gdkinputcommon.h
        * gdk/gdkinputxfree.h: Call XFreeDeviceState() on results of
        XQueryDeviceState(). (Ported from HEAD)

--Sven
1999-11-12 21:27:10 +00:00
GMT 1999 Tony Gale
10b03b35c0 Fix off-by-one bug in parameter check.
Wed Nov 10 17:26:49 GMT 1999 Tony Gale  <gale@gtk.org>

        * gtk/gtkclist.c: Fix off-by-one bug in parameter
        check.
1999-11-10 17:31:11 +00:00
Pablo Saratxaga
ab3a70ee16 completed the gtkrc (when declaring arial for the native charset it works
better if it is used for iso8859-1 in the fontset too...)
1999-11-09 18:00:27 +00:00
Pablo Saratxaga
b0e81d06c0 added arial to the various gtkrc fontsets; so on systems that have those
fonts installed the can be used (and in some cases they are currently the
only good fonts available at no cost for some charset encodings)
1999-11-09 17:52:45 +00:00
Owen Taylor
6ed6b20570 Remove files that leaked in from head branch due to CVS magic 1999-11-08 20:16:42 +00:00
Tim Janik
9230dc1470 s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sun Oct 31 22:21:11 1999  Tim Janik  <timj@gtk.org>

        * docs/gtk_tut.sgml:
        s/gtk_accel_group_attach/gtk_window_add_accel_group/.
1999-10-31 22:46:16 +00:00
BST 1999 Tony Gale
47e15bdf5f FAQ update
Sat Oct 30 13:17:18 BST 1999 Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ update
1999-10-30 12:04:35 +00:00
Owen Taylor
e9c55bc8ce Use g_list_remove_link, not g_list_remove.
Sat Oct 30 09:09:09 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.c (gtk_target_list_remove): Use
	g_list_remove_link, not g_list_remove.

	[ From Geert Bevin <gbevin@thunderstorms.org> ]
1999-10-25 00:05:26 +00:00
Tim Janik
703f17ec05 commented out g_print() statement upon unselection (how the heck did that
Sun Oct 24 07:41:40 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkclist.c (real_undo_selection): commented out g_print()
        statement upon unselection (how the heck did that slip in?).
1999-10-24 06:27:11 +00:00
Tim Janik
3b3891191e undraw/draw cursor here to avoid unnecessary scrolling in frozen state
Sat Oct 23 03:03:08 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtktext.c (gtk_text_freeze):
        (gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
        in frozen state (and aparently crashes). patch provided by Anders
        Melchiorsen <and@kampsax.dtu.dk>.

Sat Oct 23 02:53:20 1999  Tim Janik  <timj@gtk.org>

        * fix insensitive default/focus widget activation,
        reported by Matt Goodall <mgg@isotek.co.uk>.

        * gtk/gtkwindow.c (gtk_window_key_press_event):
        (gtk_window_activate_default):
        (gtk_window_activate_focus):
        return handled=FALSE for actiavtion of insensitive default
        widgets. return handled=TRUE for activation of insensitive
        focus widgets. don't activate in either case.
1999-10-23 01:32:26 +00:00
Owen Taylor
ae1f478285 Switch order of @x_cflags@ and $glib_cflags to match library order and in
Tue Oct 19 09:55:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk-config.in (lib_gtk): Switch order of @x_cflags@
	and $glib_cflags to match library order and in the
	theory that an old version of GLib is more likely to
	be in the include directory for X then vice-versa.
	(Bug #2776)
1999-10-19 14:56:55 +00:00
Owen Taylor
1e8e510300 Always use LC_CTYPE to determine the locale for fontsets, not LC_MESSAGES;
Tue Oct 19 09:46:49 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
	to determine the locale for fontsets, not LC_MESSAGES;
	the user may want English messages with a handling
	for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
	will still be broken)
1999-10-19 14:49:44 +00:00
Changwoo Ryu
d7e9880433 Fixed the wrong number of "*"'s.
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
1999-10-19 11:39:25 +00:00
Changwoo Ryu
23c00ecebe Changed the Korean default fontset.
* gtk/gtkrc.ko: Changed the Korean default fontset.
1999-10-19 03:17:46 +00:00
Sergey I. Panov
6841c77b0c ru.po: Gramm. and Style corrections from Sergey Chernikov
<Sergey_Chernikov@f29.n5051.z2.fidonet.org>
1999-10-15 14:14:32 +00:00
Shawn Amundson
abfd8215f8 release-o-rama 1999-10-08 16:19:38 +00:00
Owen Taylor
e69a498bd5 Fix bug where when scrolling to the left or top double exposes were done,
Fri Oct  8 02:32:47 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
	where when scrolling to the left or top double exposes
	were done, causing major slowdowns.
1999-10-08 14:27:28 +00:00
Yukihiro Nakai
ad246fcf51 ja.po: Update from Shirasaki Yasuhiro
ja.po: Update from Shirasaki Yasuhiro
1999-10-08 08:38:52 +00:00
Owen Taylor
e322f322e2 Always normalize codeset names to lowercase and alphanumeric, before
Thu Oct  7 18:31:55 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
	names to lowercase and alphanumeric, before looking
	them up.

	* gtk/Makefile.am: Install codeset variant gtkrc files
	with normalized names.
1999-10-07 22:38:34 +00:00
Tim Janik
d76955e34b even popup menus when the menu is already visible, but its parent is still
Thu Oct  7 22:52:42 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
        popup menus when the menu is already visible, but its parent
        is still hidden, (happens after tornoff window got hidden).
1999-10-07 21:29:41 +00:00
CDT 1999 Shawn T. Amundson
003c5dccd0 Released GTK+ 1.2.6
Thu Oct  7 12:50:23 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.6
1999-10-07 18:28:04 +00:00
Owen Taylor
95a5e5cd09 Fix a typo where gtkrc.vi_VN.tcvn5712 wasn't getting deleted, causing
Thu Oct  7 11:09:55 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am (install-data-local): Fix
	a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
	deleted, causing error messages on install.

Thu Oct  7 11:03:06 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
	the handle as well, since we now sometimes ignore
	exposes on the handle while resizing.
1999-10-07 15:26:07 +00:00
Jesus Bravo Alvarez
fe725cf7d9 Added Galician .po file 1999-10-06 22:45:46 +00:00
Owen Taylor
4a50847abd Fix stupid extra g_free introduced in one of the last one or two commits.
Wed Oct  6 18:02:31 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
	extra g_free introduced in one of the last one or two
	commits.
1999-10-06 21:53:32 +00:00
Owen Taylor
83f3b1e8e3 Fix typo from last commit. 1999-10-06 20:33:15 +00:00
Owen Taylor
fd37d2bdb0 Make naming of gtkrc files consistent, put each style that a gtkrc.* file
Wed Oct  6 16:38:36 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
	consistent, put each style that a gtkrc.* file creates
	in a unique namespace, remove old files before installing.
1999-10-06 20:30:11 +00:00
Sergey I. Panov
3b8ecf24f6 ru.po: Updated Russian translation 1999-10-05 18:52:42 +00:00
Manish Singh
91307e5e87 don't list gtkrc in gtkconf_DATA, it totally barfs
-Yosh
1999-10-05 18:42:52 +00:00
Owen Taylor
c2aaaf16f3 Free device->info.axes for core pointer.
Tue Oct  5 02:43:41 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkinputcommon.h (gdk_input_device_new): Free
	device->info.axes for core pointer.
1999-10-05 16:27:03 +00:00
Pablo Saratxaga
5bfdcc2c3e Added several gtkrc.* fiels for new charset encodings 1999-10-05 12:21:20 +00:00
Pablo Saratxaga
2dc5212004 added several gtkrc.* files 1999-10-05 12:18:22 +00:00
Sergey I. Panov
4478fefd28 ru.po: Updated Russian translation 1999-10-05 05:20:34 +00:00
Nam SungHyun
91da226af7 updated 1999-10-04 18:28:15 +00:00
Kjartan Maraas
f8ca8253f9 Added Ukrainian translation from Yuri Syrota <yuri@renome.rovno.ua>.
1999-09-28  Kjartan Maraas  <kmaraas@online.no>

	* uk.po: Added Ukrainian translation from Yuri
	Syrota <yuri@renome.rovno.ua>.
1999-10-01 22:58:15 +00:00
Owen Taylor
9b98ede875 Rename idle to idle_id, to deal with obsolete, broken C libraries.
Thu Sep 30 13:55:25 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/testgtk.c (destroy_idle_test): Rename idle to
	idle_id, to deal with obsolete, broken C libraries.
1999-09-30 17:50:50 +00:00
Owen Taylor
a97747dfc7 Get rid of stupid C unsigned integer bug. (Bug #2272)
Wed Sep 29 15:41:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktreeitem.c (gtk_tree_item_size_allocate):
	Get rid of stupid C unsigned integer bug.
	(Bug #2272)
1999-09-29 23:13:01 +00:00
Kjartan Maraas
5739ca8f3b Added Romainan translation from Dan Damian <dand@dnttm.ro>.
1999-09-28  Kjartan Maraas  <kmaraas@online.no>

	* ro.po: Added Romainan translation from Dan
	Damian <dand@dnttm.ro>.
1999-09-28 22:25:29 +00:00
Owen Taylor
9cc3eb8c0d Don't add in allocation->x/y twice!
Mon Sep 27 02:50:15 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
	allocation->x/y twice!

	* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
	consistent with gtk_vscale_pos_trough().
1999-09-27 14:56:17 +00:00
Owen Taylor
6b5d56e39c We may be queueing a resize on a toplevel container between the time we
Sun Sep 26 19:44:34 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
	be queueing a resize on a toplevel container between
	the time we show it and when we map it. So, we need
	to test GTK_WIDGET_VISIBLE() for toplevels, and only
	use GTK_WIDGET_DRAWABLE() for child windows.
1999-09-26 23:46:57 +00:00
Chyla Zbigniew
7a4bc2038f Updated Polish translation 1999-09-26 22:28:48 +00:00
Lauris Kaplinski
6b7f4bb036 updated Estonian tranlation 1999-09-26 20:45:39 +00:00
Elliot Lee
51bae3f9cd Make 'dist-hook' targets, which copy the .spec file into $(distdir),
Make 'dist-hook' targets, which copy the .spec file into $(distdir), depend upon the
.spec file, so that the .spec file will be regenerated when a previously-compiled tree
is 'dist'd with a new version number.
1999-09-24 16:18:02 +00:00
CDT 1999 Shawn T. Amundson
60a7c53123 Released GTK+ 1.2.5
Thu Sep 23 20:11:38 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.5
1999-09-24 01:37:05 +00:00
Tim Janik
ee09d2e5da changed version from Gtk+-1.2.5-pre2, to Gtk+-1.2.5, interface age 0,
Fri Sep 24 02:00:21 1999  Tim Janik  <timj@gtk.org>

        * configure.in (GTK_VERSION): changed version from Gtk+-1.2.5-pre2,
        to Gtk+-1.2.5, interface age 0, binary age 5.
1999-09-24 00:12:30 +00:00
Owen Taylor
4eb1338d42 Add GDK_WLIBS to LDADDS (fixes bug #2144)
Thu Sep 23 16:41:03 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
	(fixes bug #2144)
1999-09-23 23:19:35 +00:00
Tim Janik
8e8ac56db5 check for container DRAWABLE (instead of VISIBLE), so we don't queue
Fri Sep 24 00:51:45 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkcontainer.c (gtk_container_queue_resize): check for
        container DRAWABLE (instead of VISIBLE), so we don't queue
        resizes on non-toplevel containers.
1999-09-23 22:59:42 +00:00
Tim Janik
54a90a6c61 updates for real 1.2.5 1999-09-23 20:01:29 +00:00
Tim Janik
fc0117177c grr, even if Gdk doesn't handle CreateNotify itself, still put out a
Thu Sep 23 17:59:59 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): grr, even if Gdk doesn't
        handle CreateNotify itself, still put out a debuging message for
        --gdk-debug=events. made the ReparentNotify debugging message more
        verbose.
        wrap xcoords translation for ConfigureEvents into an error trap,
        a destroy event may already be pending, and in that case, the
        actuall coordinate values are not at all critical.
1999-09-23 19:48:16 +00:00
Vincent Renardias
8a7795d2db Updated for 1.2.5.
* Updated for 1.2.5.
1999-09-21 16:58:33 +00:00
Kjartan Maraas
2a0a33bc35 Updated Danish translation from Kenneth Christiansen <kenneth@ripen.dk>
1999-09-20  Kjartan Maraas  <kmaraas@online.no>

	* da.po: Updated Danish translation from Kenneth
	Christiansen <kenneth@ripen.dk>
1999-09-20 18:30:35 +00:00
Pablo Saratxaga
cd1c6de2ea added pt_BR.po file 1999-09-20 11:34:35 +00:00
Tim Janik
44a04ee211 released Gtk+-1.2.5-pre2, interface age 0, binary age 5.
Mon Sep 20 01:21:53 1999  Tim Janik  <timj@gtk.org>

        * released Gtk+-1.2.5-pre2, interface age 0, binary age 5.
1999-09-19 23:57:12 +00:00
Owen Taylor
b107653636 Make the data argument const guchar *.
Sun Sep 19 18:13:31 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.[ch]: Make the data argument
	const guchar *.
1999-09-19 22:23:46 +00:00
Owen Taylor
90d2cae68c Stop leaking the color_hash all over the place. Simplify and improve the
Sat Sep 18 22:24:15 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkcc.c: Stop leaking the color_hash all over
	the place. Simplify and improve the logic.
1999-09-19 02:19:26 +00:00
Owen Taylor
369ea6013d Try to behave sensibly if the focus widget is the window itself. (Should
Sat Sep 18 21:27:40 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c: Try to behave sensibly if
	the focus widget is the window itself. (Should
	we allow this at all?)
1999-09-19 01:43:30 +00:00
Kjartan Maraas
175b04c33d Updated Danish translation from Kenneth Christiansen <kenneth@ripen.dk>.
1999-09-17  Kjartan Maraas  <kmaraas@online.no>

	* da.po: Updated Danish translation from Kenneth
	Christiansen <kenneth@ripen.dk>.
1999-09-17 19:35:50 +00:00
Tim Janik
389f174dad make gboolean args in prototypes and implementations consistent (Tomas
Fri Sep 17 09:57:15 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_set_sensitive):
        * gtk/gtknotebook.c (gtk_notebook_set_scrollable):
        * gtk/gtknotebook.c (gtk_notebook_set_show_border):
        * gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
        in prototypes and implementations consistent (Tomas Ogren).

        * gdk/gdk.h, gdk/gdkcolor.c: make return types (gint or gboolean)
        for prototypes and function implementations consistent (reported
        by Tomas Ogren).

        * gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
        before the widget is unparented (reported by damon).

        * gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
        since we provide unsigned data anyways.
1999-09-17 09:03:44 +00:00
Owen Taylor
c98ffe744f Delay the call to gtk_tooltips_layout_text() until later.
Thu Sep 16 21:32:01 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
	the call to gtk_tooltips_layout_text() until later.

	* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
	Call gtk_widget_ensure_style() before using the style.
1999-09-17 01:35:56 +00:00
Owen Taylor
661d0ad067 Added workaround for old widgets that don't propagate draws to all
Wed Sep 15 02:52:19 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_event): Added workaround
	for old widgets that don't propagate draws to all
	children. (Namely gnome-dock for gnome-libs <= 1.0.16)
1999-09-16 18:59:24 +00:00
Tim Janik
f04d58dd29 NEWS updates 1999-09-14 17:47:06 +00:00
Tim Janik
0ab9dddc34 slight version increment to 1.2.5-pre2.
Tue Sep 14 19:37:53 1999  Tim Janik  <timj@gtk.org>

        * configure.in (GTK_VERSION): slight version increment to 1.2.5-pre2.

Tue Sep 14 19:22:19 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
        for a redraw but just the widget that requested the resize.

Tue Sep 14 18:29:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkcontainer.c: added new widget level method
        gtk_container_set_reallocate_redraws() and a GtkContainer flag
        reallocate_redraws : 1 to reflect the setting, exported this through
        the argument system as a boolean ::reallocate_redraws.

        * gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
        on the widget because the allocation changes, do so as well for
        widget->parent if the parent has reallocate_redraws set to TRUE.
        with that containers requesting reallocation redraws get automatically
        redrawn if their children changed allocation (this unfortunately
        affects also other children that didn't change allocation, but we
        cannot work around that before 1.3).

Tue Sep 14 18:23:01 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): tell if expose events have
        send_event set in debugging output.
        (gdk_compress_exposures): default initialize the event so we don't
        operate on bogus values (namely send_event).

        * gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
        _and_ height are >0 (not _or_).

        * gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
        instead of gtk_container_queue_resize(), which is a core gtk internal
        function (must have been on crack when i queued that).

        * gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
        we can check more reliably if we want to discard expose events.
        * gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
        flag.

        * gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
        we simply trust these events. for deciding whether to discard exposes,
        check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
1999-09-14 17:43:56 +00:00
Owen Taylor
7347cd702f Ignore queues of areas that are completely off screen.
Mon Sep 13 15:01:21 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
	queues of areas that are completely off screen.

	* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
	logic for handleboxes.

	* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
	check on width/height.
1999-09-13 19:01:49 +00:00
Tim Janik
531f44bbdc backed out Raja's recent VPATH build "improvements", we are fine with
Mon Sep 13 02:22:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
        we are fine with using $@ the way we do (if we actually encounter
        brokeness with $@ in VPATH builds because of additional path prefixes,
        we need to use $(@F) actually).
1999-09-13 11:13:07 +00:00
Tim Janik
d807397177 renamed two variables, hopefully didn't introduce short lived bugs, that
Mon Sep 13 01:34:53 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
        short lived bugs, that would allow language bindings to do surgeries
        to our guts.
1999-09-12 23:39:49 +00:00
Raja R Harinath
8014d7db5e Fix AC_DEFINEs.
* configure.in (wctype): Fix AC_DEFINEs.
1999-09-12 21:07:52 +00:00
Pablo Saratxaga
8cf06479ae updated danis hfile 1999-09-11 00:13:53 +00:00
Pablo Saratxaga
123914048c put Greek file from gtk+ HEAD cvs 1999-09-10 23:35:33 +00:00
Pablo Saratxaga
91645584a5 added Estonian language file 1999-09-10 19:45:35 +00:00
Owen Taylor
6362c20b8b Fix typo where comparison was being done against an uninitialized value
Fri Sep 10 15:22:50 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
	where comparison was being done against an uninitialized
	value causing intermittant results depending on
	compiler flags. Also make it clearer that we aren't
	ever initializing the child as 0x0 (though this will
	be caught in gtk_widget_size_allocate())
1999-09-10 19:19:00 +00:00
Owen Taylor
a88d8fff6d Move gtk_window_unset_transient_for() call after we do checks involving
Fri Sep 10 10:06:56 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
	gtk_window_unset_transient_for() call after we do checks
	involving the old transient parent.
	[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-10 14:00:45 +00:00
Tim Janik
61f9087af4 fixed "GNU Make" check to pass with new make version 3.77.95.
Wed Sep  8 07:13:29 1999  Tim Janik  <timj@gtk.org>

        * configure.in: fixed "GNU Make" check to pass with new make version
        3.77.95.
1999-09-08 07:03:00 +00:00
Raja R Harinath
2b2ee64b60 Go back to using `touch' to create an empty file.
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
1999-09-07 18:45:04 +00:00
Pablo Saratxaga
4767c40249 updated da file 1999-09-06 09:42:10 +00:00
Lars Hamann
844cbfb1ba return FALSE if node has no children. (Reported by: Chris Rogers
Mon Sep  6 00:11:56 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
        no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-05 22:22:27 +00:00
Kjartan Maraas
04d23ae07e Updated translation.
1999-09-04  Kjartan Maraas  <kmaraas@fib.hl.no>

	* no.po: Updated translation.
1999-09-04 08:40:46 +00:00
Raja R Harinath
59724766af Improve VPATH builds. `$@' is valid only in the build dir, not after we've
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'.  Also use `test -f' instead of less portable
`test -e'.
1999-09-03 22:59:25 +00:00
CDT 1999 Shawn T. Amundson
2c331c9fdf Released GTK+ 1.2.5-pre1 (test release)
Fri Sep  3 17:20:57 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.5-pre1  (test release)
1999-09-03 22:47:09 +00:00
Owen Taylor
df57d883b3 Overview of Changes in GTK+ 1.2.5:
* new configure.in option --disable-rebuilds to completely disable
  rebuilds of autogenerated sources.
* check for 5.002 now, to avoid failing autogeneration build rules due
  to old perl versions.
* fonts (and fontsets) are cached now.
* more autogeneration make rules and dependancy fixups, we should be
  save with autogeneration up to make -j12 now ;)
* new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the
  GtkWindow on every size change.
* major rework of window manager hints handling code, fixed a bunch of
  races with the new resizing code.
* the new wm hints and resizing code is absolutely perfect and bug free now,
  it only lacks testing ;)
* fixed up various rc style memory prolems.
* gtk_widget_modify_style() now properly changes the style of realized widgets
  and references the style passed into it. if people worked around this bug,
  this will introduce a slight memory leak in their code.
  The code should typically look like:
            GtkRcStyle *rc_style = gtk_rc_style_new ();
            [...]
            gtk_widget_modify_style (widget, rc_style);
            gtk_rc_style_unref (rc_style);
* fix problems with positioning menus offscreen.
* GtkText fixes for some crashes and drawing errors.
* Better handling for unexpected window destroys in GDK and GTK+.
  This should make it possible to use a GtkPlug and catch the
  case where its parent socket is randomly killed.
* FAQ updates.
* FileSelection i18n patches, RadioButton fixups.
* miscellaneous other bugs fixed.
1999-09-03 21:01:15 +00:00
Owen Taylor
c9dec55549 Rewrite for simplicity, and hopefully correctness. (Fixes bug #1322, which
Fri Sep  3 15:59:56 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (correct_cache_insert): Rewrite
	 for simplicity, and hopefully correctness.
	 (Fixes bug #1322, which was a segfault when
	  on some insertions with the properties around
	  the insertion set up just wrong.)

	* gtk/gtktext.c (gtk_text_adjustment): When we receive
	 a "changed" signal, clamp the new value to the adjustment
	 bounds to avoid segfaulting if someone tries to change
	 the adjustment to a bogus value. (Bug #1795)
1999-09-03 20:45:35 +00:00
Owen Taylor
22a15408bb When we receive an unexpected destroy notify on one of our windows, don't
Thu Sep  2 16:33:59 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: When we receive an unexpected
	destroy notify on one of our windows, don't just
	warn about it, also mark our windows as destroyed.

	* gtk/gtkmain.c: Ignore unexpected destroy notifies
	for children, for toplevel windows handle them
	like delete_event.

	* gtk/gtkplug.c: Add an unrealize handler so that
	we unref plug->socket_window when we are done
	with it.
1999-09-03 20:08:13 +00:00
Owen Taylor
3abc634152 Fix stupid signedness problem that was causing background to sometimes be
Fri Sep  3 14:52:54 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (clear_area): Fix stupid signedness
	 problem that was causing background to sometimes
	 be misaligned.
1999-09-03 18:54:03 +00:00
Owen Taylor
ad9263ec39 [ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
Fri Sep  3 12:26:33 1999  Owen Taylor  <otaylor@redhat.com>

	[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]

	* gtk/gtkmenu.c (gtk_menu_position): Make
	 sure we never position menus with negative x, y,
	 since gtk_widget_set_uposition() can't handle that.

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
	 Modify the positioning code a bit so that we always
	 put the top-left corner onscreen. (This is for
	 UI reasons, gtk_menu_position() now takes care of
	 gtk_widet_set_uposition() brokeness.)
1999-09-03 16:51:12 +00:00
Tim Janik
501c87a65d don't echo @GTK_VERSION@, but
Fri Sep  3 16:04:41 1999  Tim Janik  <timj@gtk.org>

        * gtk-config.in (--version): don't echo @GTK_VERSION@, but
        @GTK_MAJOR_VERSION@.@GTK_MINOR_VERSION@.@GTK_MICRO_VERSION@, so the
        AM_PATH_GTK() macros don't get confused by the -pre1.
1999-09-03 14:08:51 +00:00
Tim Janik
f9c868233f changed version number to 1.2.5-pre1, interface age 0, binary age 5. we
Fri Sep  3 03:06:30 1999  Tim Janik  <timj@gtk.org>

        * configure.in: changed version number to 1.2.5-pre1,
        interface age 0, binary age 5. we still require Glib-1.2.4 though.

        * gtk/Makefile.am: fixed up things for -jx, x > 1.

        * NEWS: updates for 1.2.5.
1999-09-03 04:38:55 +00:00
Owen Taylor
0285d26804 Ref the RC style that is passed in. The lack of the ref before was a bug.
Sun Sep  5 08:48:51 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
	  RC style that is passed in. The lack of the ref
	  before was a bug. If people worked around this
	  bug, this will introduce a slight memory leak
	  in their code. The code should typically look like:

	    rc_style = gtk_rc_style_new ();
	    [...]
	    gtk_widget_modify_style (widget, rc_style);
	    gtk_rc_style_unref (rc_style);

	* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
	  the style if it was already set.

	* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
	  style if it was set before.
1999-09-03 03:57:14 +00:00
Owen Taylor
189706f619 Add name => font and name => fontset hashes. The name => fontset hash is a
Sun Sep  5 08:10:53 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkfont.c (gdk_font_hash_insert): Add
	  name => font and name => fontset hashes. The
	  name => fontset hash is a _big_ win since we
	  weren't previously caching fontsets at all and loading
	  fontsets is expensive. The name => font hash
	  is less of a win, but it does save us from doing
	  repeated XQueryFont calls on the same font.

	* gdk/gdkprivate.h (struct _GdkFontPrivate): Add a names
	  list so we can remove font/fontset from hash.
1999-09-03 03:56:34 +00:00
Chyla Zbigniew
b4def251f8 Updated polish translation 1999-09-03 02:55:23 +00:00
Owen Taylor
ddc6217c32 Remove useless and slightly confusing test. [ XInternAtom (,,TRUE) will
Thu Sep  2 19:02:37 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkproperty.c (gdk_atom_intern): Remove useless
	  and slightly confusing test. [ XInternAtom (,,TRUE)
	  will never return None ].

	* gtk/testgtk.c (main): Add a check to see if we
	  are being run from the correct directory and
	  to quit nicely if we are not.

	* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
	  static.

	* configure.in (REBUILD): Change check for perl5
	  to check explicitely for v >= 5.002. (5.001
	  does not work with our scripts.)
1999-09-02 23:02:14 +00:00
Tim Janik
80ed2661c5 uncomma 1999-09-02 22:31:38 +00:00
Tim Janik
088428655b added GTK_WIN_POS_CENTER_ALWAYS.
Thu Sep  2 23:00:03 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.

        * gtk/gtkwindow.c:
        queue resizes unconditionally (gtk_widget_queue_resize will figure
        what to do if the window is not realized).
        (gtk_window_move_resize): only recenter the window
        for GTK_WIN_POS_CENTER_ALWAYS.
        (gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
        the same way as GTK_WIN_POS_CENTER.

Thu Sep  2 22:39:27 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_reposition): check for the last position
        with (!(info->last_flags & GDK_HINT_POS)) instead of
        (!info->last_flags & GDK_HINT_POS).

        * gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
        new_height unconditionally, because we use these values even if
        !default_size_changed && !hints_changed.
        comented the (default_size_changed || hints_changed) case with
        respect to resize rejects from the window manager.

        * gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
        in the zvt condition hack, since this includes the window hints, set
        the hints after the handling_resize case.

        * gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
        window is initially shown with to the geometry.
1999-09-02 21:15:01 +00:00
Tim Janik
be326a5a7c s/size_changed/default_size_changed/g so i know what's really going on
Thu Sep  2 07:38:56 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_move_resize):
        s/size_changed/default_size_changed/g so i know what's
        really going on (frying brain on smaller flame now).
1999-09-02 05:41:57 +00:00
Tim Janik
108d82e785 queue a new resize if we have size_changed upon handling_resize. this is a
Thu Sep  2 05:47:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
        we have size_changed upon handling_resize. this is a gross
        workaround for the broken zvt widget and should be removed in
        1.3 again (search for FIXME).
        Owen provided an accurate comment for this:

        /* We could be here for two reasons
         *  1) We coincidentally got a resize while handling
         *     another resize.
         *  2) Our computation of size_changed was completely
         *     screwed up, probably because one of our children
         *     is broken. It's probably a zvt widget.
         *
         * For 1), we could just go ahead and ask for the
         * new size right now, but doing that for 2)
         * might well be fighting the user (and can even
         * trigger a loop). Since we really don't want to
         * do that, we requeue a resize in hopes that
         * by the time it gets handled, the child has seen
         * the light and is willing to go along with the
         * new size. (this happens for the zvt widget, since
         * the size_allocate() above will have stored the
         * requisition corresponding to the new size in the
         * zvt widget)
         *
         * This doesn't buy us anything for 1), but it shouldn't
         * hurt us too badly, since it is what would have
         * happened if we had gotten the configure event before
         * the new size had been set.
         */
1999-09-02 04:01:11 +00:00
Owen Taylor
c431108d84 Don't omit setting the properties if flags == 0 - there may be an existing
Sat Sep  4 08:39:26 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_set_geometry_hints)
	  gdk/gdkwindow.c (gdk_window_set_hints):

	Don't omit setting the properties if flags == 0 -
	there may be an existing set of properties there
	already. (Very old bug. Would it be better to
	delete the property instead?)

	* gdk/gdkselection.c (gdk_selection_property_get): Fix
	  spelling error in comment.
1999-09-02 03:41:41 +00:00
Owen Taylor
bd2194afb1 deal properly with the fact that RC style lists may include rc styles more
Wed Sep  1 20:46:11 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c: deal properly with the fact that RC
	  style lists may include rc styles more than once.

	* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
	  unused static function.

	* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
	  stack of directories of RC files currently being
	  parsed and implicitely add them to pixmap path.

	  This fixes a bug where the directory would get
	  appended then overwritten by pixmap_path declarations.

	  (bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)

	* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
	  theme's exit function. (Patch from Peter Wainwright,
	  bug #1454)

	* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
	  Add a destroy() handler to take care of removing
	  group for menu item. (Fixes bug #1197)

	* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
	  in warning message.
1999-09-02 00:43:37 +00:00
Tim Janik
39fb4797ae don't require a server roundtrip to figure window's width and height,
Wed Sep  1 21:27:42 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
        roundtrip to figure window's width and height, since we know that
        anyways from widget->allocation.
1999-09-01 19:50:58 +00:00
Owen Taylor
10f1fff6ec Use gdk_error_trap_push() to avoid stomping over gdk_error_warnings.
Wed Sep  1 14:05:30 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkimage.c (gdk_image_new): Use gdk_error_trap_push()
	  to avoid stomping over gdk_error_warnings.

	* gdk/gdkimage.c (gdk_image_new): compute image->bpp
	  as (bits_per_pixel + 7) / 8. This gives the same
	  result as before for multiples of 8, but actually
	  a "reasonable" value for 1bit or 4bit displays.
1999-09-01 17:59:50 +00:00
Owen Taylor
becd87fbd4 Compute the hints after we request the new size.
Wed Sep  1 12:37:44 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_move_resize): Compute
	  the hints after we request the new size.
1999-09-01 16:32:30 +00:00
Owen Taylor
55c0a94c2c Removed GTK_WIDGET_REALIZED() assertion - we can compute the hints before
Wed Sep  1 10:38:37 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
	  GTK_WIDGET_REALIZED() assertion - we can compute the
	  hints before we are realized.

	* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
	  hint changing so that we have a value of hints_changed
	  when we decide whether to constrain the window size.

	* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.

	* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
	change back to G_MAXINT.
1999-09-01 14:51:02 +00:00
Pablo Saratxaga
c64f52a36c added da file 1999-09-01 12:31:59 +00:00
Tim Janik
b2a084beb4 zero initialize new GtkWindowGeometryInfo, so fields like GdkGeometry
Wed Sep  1 06:54:59 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
        new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
        contain uncluttered values.
        (gtk_window_compute_hints): simply assert that window is realized
        and that geometry_info is valid, since we rely on this anyways.
        (gtk_window_constrain_size): major cleanups to the code.
        if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
        for the base size, instead of the minimums. use 32767 as max width
        and height (like in gtkwindow.c) instead of G_MAXINT.
1999-09-01 05:48:55 +00:00
Tim Janik
57485d9029 cleaned up the GtkContainer.need_resize flag handling mess, we only need
Wed Sep  1 04:41:25 1999  Tim Janik  <timj@gtk.org>

        * cleaned up the GtkContainer.need_resize flag handling mess, we
        only need to force resize requests when we were prematurely
        realized, or our widget tree was modified when we were temporarily
        hidden. handling these cases directly upon showing the window (i.e.
        while the GdkWindow is still unmapped) avoids the need to wait for
        a configure event response and therefore makes the GUI more snappier
        and avoids blank windows during the roundtrip.

        * gtk/gtkwidget.c:
        (gtk_widget_hide):
        (gtk_widget_show): don't queue resizes on toplevels, they know how
        to deal with matters.

        * gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
        flag directly for not visible resize containers and spare us unecessary
        signal emissions.

        * gtk/gtkwindow.c:
        (gtk_window_realize): if we need to enforce premature size allocation,
        queue a container resize so we are correctly resized later on.
        (gtk_window_init):
        (gtk_window_size_request):
        don't freak around with the ->need_resize flag,
        gtk_container_queue_resize() will care about that.
        (gtk_window_show):
        handle initial resizing issues here, we can handle matters better in
        this place, especially since we know that our GdkWindow is still
        unmapped.
        (gtk_window_move_resize):
        don't care about ->need_resize at all.
        handle size changes properly that occoured while we waited for a
        configure event.
1999-09-01 02:58:05 +00:00
Owen Taylor
92671fe1f6 Move the hint setting code from gtk_widget_set_uposition to here; set the
Tue Aug 31 15:58:46 1999  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwidget.c (gtk_widget_set_uposition):
        * gtk/gtkwindow.[hc] (gtk_window_reposition):
        Move the hint setting code from gtk_widget_set_uposition
        to here; set the hints so that we respect any previously
        set geometry hints.

        * gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
        change the window hints here or move the window here,
        let that happen in gtk_window_move_resize().
1999-09-01 01:13:10 +00:00
Tim Janik
5e049110f3 when discarding exposes due to already queued resizes (and therefore
Tue Aug 31 06:58:52 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
        to already queued resizes (and therefore redraws) on a widget, check
        its anchestry as well.

        * gtk/gtkcontainer.c:
        (gtk_container_queue_resize): clear resize widgets for resize
        containers before aborting prematurely. this is especially important
        for toplevels which may need imemdiate processing or their resize
        handler to be queued.
        (gtk_container_dequeue_resize_handler): added new internal function for
        gtkwindow.c.

        * gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
        configure event, take possible changes in window position into account
        as well.
        if we request a new window size, queue up a resize handler that will
        last until the configure event response arrives.
        combined the ->need_resize case (initial show) with the general size
        (hints) changed case and added even more comments.
        if !auto_shrink, only revert to the old allocation if the new size
        is smaller than the current allocation.

Tue Aug 31 11:55:20 1999  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
                           gtk_window_set_geometry_hints
                           gtk_window_set_default_size):
        When hints are set, queue a resize so that the hints will
        be eventually reset on the toplevel.

        * gtk/gtkwindow.c (gtk_window_show): Use
        gtk_window_compute_default_size(). Clear the need_resize flag
        on the initail map so that we don't unnecessarily trigger the
        resize code.

        * gtk/gtkwindow.c (gtk_window_move_resize): Split apart
        into separate functions. Compare the hints we are setting
        with what we set last time so that we can accurately
        tell when we need to reset the hints.

        * gtk/gtkwindow.c (gtk_window_compute_default_size): New
        function to figure out the size from requisition
        and default_size.

        * gtk/gtkwindow.c (gtk_window_constrain_size): Function
        from fvwm to constrain a size to the geometry hints.

        * gtk/gtkwindow.c (gtk_window_compare_hints): New functio
        to compare two sets of geometry hints.

        * gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
        from gtk_window_set_hints(), just compute the hints,
        don't set them.

        * gtk/gtkwindow.c (gtk_window_compute_reposition): Move
        code from gtk_window_move_resize() to separate function,
        rationalize a bit.
1999-09-01 00:48:57 +00:00
Owen Taylor
d008fbb84d Missed file from last gtkrc commit. 1999-08-31 21:12:40 +00:00
Owen Taylor
b7fa562427 Move the ref_count member out of the GtkRcStyle structure into a new
Tue Aug 31 13:05:03 1999  Owen Taylor  <otaylor@redhat.com>

	* gtkrc.h: Move the ref_count member out of the GtkRcStyle
	structure into a new private structure.

	* gtkrc.c: Split GtkRcStyle into public/private.
	In the private part, add a list of pointers to the
	RcStyle lists this RcStyle participates in.

	* gtkrc.c: When a RcStyle is free, remove all
	lists referencing it from the
	realized_style_ht hash, and free those lists.

	* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
	gtk_rc_init(), since that adds the default styles
	to the list of parsed RC files again.

	* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
1999-08-31 17:13:33 +00:00
Pablo Saratxaga
5bfd32fd64 a little patch to gtk/gtkfontsel.c to add the missing bit of i18n
support (displays font attributes translated)
1999-08-30 17:43:08 +00:00
Pablo Saratxaga
b977baed2b added eu and ga languages
merged with translations of gtk+ 1.3.0 when they were more up to date
1999-08-30 17:12:09 +00:00
BST 1999 Tony Gale
39024c05ae Minor FAQ Update
Sun Aug 29 13:38:59 BST 1999 Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: Minor FAQ Update
1999-08-29 12:30:32 +00:00
Tony Gale
8ec53bf61b Helps to commit the right version
Helps to commit the right version
1999-08-28 13:44:12 +00:00
BST 1999 Tony Gale
b6d42f7eb7 FAQ update
Sat Aug 28 14:34:37 BST 1999 Tony Gale <gale@gtk.org>

        * docs/gtkfaq.sgml: FAQ update
1999-08-28 13:27:40 +00:00
Raph Levien
7a73d7bd4d Comment fix (it was confusing for yosh). 1999-08-27 05:48:39 +00:00
Tim Janik
083941009f reactivated the sanity checks that ensure that a widget's allocation is at
Thu Aug 26 14:14:42 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
        checks that ensure that a widget's allocation is at least 1 in width
        and height. (GNOME note: this doesn't affect old panel code anymore,
        because GtkSocket will request width and height of at least 1 since
        Fri Jul 23).

        * gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
        allocated yet (happens if the user realizes the window prematurely),
        size request and allocate it.
        (gtk_window_size_allocate): guard against guint underflows.
1999-08-26 12:44:07 +00:00
Lars Hamann
eb0859b277 reordered stamp-gtk.defs in gtk_built_sources, so gtk.defs gets built
Wed Aug 25 19:01:36 1999  Lars Hamann  <lars@gtk.org>

        * gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
        in gtk_built_sources, so gtk.defs gets built prior to all other
        sources.
1999-08-25 17:08:03 +00:00
Tim Janik
bb2b76689c evaluate $PERL for the perl version check. added --disable-rebuilds to
Wed Aug 25 15:45:46 1999  Tim Janik  <timj@gtk.org>

        * configure.in: evaluate $PERL for the perl version check. added
        --disable-rebuilds to give the user an option to completely disable
        any source autogeneration rules.
1999-08-25 13:52:36 +00:00
CDT 1999 Shawn T. Amundson
65725a25ff Released GTK+ 1.2.4
Mon Aug 23 15:05:17 CDT 1999  Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.4
1999-08-23 22:49:05 +00:00
Tim Janik
bd91541a01 evaluate $ac_make when checking for GNU Make.
Mon Aug 23 23:16:14 1999  Tim Janik  <timj@gtk.org>

        * configure.in: evaluate $ac_make when checking for GNU Make.
1999-08-23 21:20:22 +00:00
Tim Janik
2e6baef994 added some $(srcdir)/ prefixing 1999-08-23 20:39:17 +00:00
Tim Janik
6469f8473e small fix 1999-08-23 20:15:50 +00:00
Tim Janik
40d855bb0c invoke indent on gtkmarshal.*. rewrote source generation rules, use
Mon Aug 23 19:11:17 1999  Tim Janik  <timj@gtk.org>

        * gtk/Makefile.am:
        invoke indent on gtkmarshal.*.
        rewrote source generation rules, use COPYING as oldest source tag for
        a piggyback rule to generate all sources from (don't touch it ;).
        major cleanups, strip spaces on build rules for GNU Make.

        * gtk/genmarshal.pl: don't operate on hardcoded filenames but take
        source and target files from commandline arguments. don't invoke indent.

        * gdk/Makefile.am: minor cleanups, strip spaces on build rules for
        GNU Make.

        * docs/Makefile.am: added generation.txt.

        * Makefile.am: require automake 1.4, build README from README.in and
        INSTALL from INSTALL.in in dist-hook.

        * README.in:
        * INSTALL.in: new files to autogenerate README and INSTALL from.

        * gtk/COPYING:
        * gdk/COPYING: new files containing the GNU LESSER GENERAL PUBLIC
        LICENSE.

        * configure.in: figure wether we have GNU Make, version update to
        Gtk+ 1.2.4, interface age 2, binary age 4.

        * NEWS: updates.

        * docs/generation.txt: minor additions/corrections.
1999-08-23 19:35:22 +00:00
Manish Singh
fb44e1b6df rambopoo commit
-Yosh
1999-08-23 19:21:25 +00:00
Lars Hamann
0ab658cd10 queue_resize notebook after switch to avoid drawing problems. (Bug#856
Sat Aug 21 14:07:36 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
	notebook after switch to avoid drawing problems.
	(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)

	(gtk_notebook_pages_allocate): don't map not visible tab_labels,
	show them instead.
	(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
1999-08-22 12:53:04 +00:00
Tim Janik
f5891aa3bf we use window->need_resize from configure_event now, to indicate that the
Wed Aug 18 09:20:10 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c:
        we use window->need_resize from configure_event now, to indicate that
        the gtkwindow should keep its allocation (e.g. because the user resized
        the window through window manager handles). resize_count is now reliably
        used to figure whether we got the allocation we requested from the
        window manager.
        configure events get queued as resizes now, the real stuff (size
        computation and allocation) now only goes on in gtk_window_move_resize().
        GtkWindow's requisition now contains its *real* requisition (like all
        other widgets), *not* taking usize into account.
        geometry_info->last_{width|height} is now updated from set_hints() only
        so it always contains the last hints we set for the window manager.
        made some event handlers return TRUE instead of FALSE.
        the overall code should be much more straight forward now, and the
        significant code portions are accompanied by comments now.
        (gtk_window_set_hints):
        removed requisition argument and made it
        fetch the requisition through gtk_widget_get_child_requisition.
        we also don't move the gdkwindow here anymore, gtk_window_move_resize()
        does that now.
        (gtk_window_show):
        ensure that the widget is realized before calling
        gtk_container_check_resize() (and thus gtk_window_move_resize()), also
        ensure that we got properly size requested and allocated before
        realization.
        (gtk_window_configure_event):
        ignore plain window moves, or reallocate the widget tree through the
        resize queue otherwise.
        (gtk_window_move_resize):
        mostly rewrote this function to figure window manager hints more
        reliably, coalesce window moves and resizes to reduce configure events
        and do actuall size allocations.

Tue Aug 17 07:43:04 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
        that have a resize pending, because a redraw is already queued for them.

        * gdk/gdkevents.c (gdk_event_translate): give a debugging note when
        discarding configure events.

        * gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
        hack to clear resize_widgets.

        * gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
        for resize containers prior to size allocation. (this is also a bit
        ugly, but avoids side effects for stopped emissions and is thus more
        reliable).
        (gtk_widget_unparent): removed disconnect call for clear_resize_widgets.

        * gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
        function from gtk_tooltips_expose, as we connect to ::expose_event
        *and* ::draw now.

Tue Aug 17 07:43:04 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
        that have a resize pending, because a redraw is already queued for them.

        * gdk/gdkevents.c (gdk_event_translate): give a debugging note when
        discarding configure events.

        * gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
        hack to clear resize_widgets.

        * gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
        for resize containers prior to size allocation. (this is also a bit
        ugly, but avoids side effects for stopped emissions and is thus more
        reliable).
        (gtk_widget_unparent): removed disconnect call for clear_resize_widgets.

        * gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
        function from gtk_tooltips_expose, as we connect to ::expose_event
        *and* ::draw now.
1999-08-20 02:18:22 +00:00
Federico Mena Quintero
5568346aa2 Added missing sanity checks. (gtk_target_list_unref): Likewise.
1999-08-18  Federico Mena Quintero  <federico@redhat.com>

	* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
	checks.
	(gtk_target_list_unref): Likewise.

	* gdk/gdkpixmap.c (gdk_pixmap_unref): g_return_if_fail() the
	refcount is greater than zero.

	* gdk/gdkwindow.c (gdk_window_unref): Likewise.

	* gdk/gdkfont.c (gdk_font_unref): Likewise.

	* gdk/gdkgc.c (gdk_gc_unref): Likewise.

	* gdk/gdkdnd.c (gdk_drag_context_unref): Likewise.

	* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
1999-08-18 20:21:07 +00:00
Owen Taylor
0f8e13ca60 guard against division by zero. (Fixes bug #1339)
Tue Aug 17 15:47:07 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
	guard against division by zero. (Fixes bug #1339)
1999-08-17 19:49:06 +00:00
Owen Taylor
8830e211f8 Prevent the trivial leak of information of allowing word motion when the
Tue Aug 17 10:56:49 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
	Prevent the trivial leak of information of allowing
	word motion when the entry is not visible.
1999-08-17 14:58:50 +00:00
Owen Taylor
a6c5f95bac Propagate modality to error dialog as well as confirmation dialogs. (Bug
Tue Aug 17 10:28:52 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
	modality to error dialog as well as confirmation dialogs.
	(Bug #1803, reported by Rosanna Wing Sze Yuen)
1999-08-17 14:34:33 +00:00
BST 1999 Tony Gale
bae298ea0e FAQ Update
Wed Aug 11 13:38:26 BST 1999 Tony Gale  <gale@gtk.org>
        * docs/gtkfaq.sgml: FAQ Update
1999-08-11 12:39:49 +00:00
Owen Taylor
4139d6fc64 Honor tree->view_lines. (gtk-guy-990611-3.patch: Guy Harris
Wed Aug 11 01:04:57 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
	tree->view_lines.
	(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)

	* gtk/Makefile.am (install-data-local): Solaris apparently
	has various troubles with ln -f; use rm first instead.
	(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)

	* gdk/gdkproperty.c (gdk_property_get): Fix assumption
	that format 32 => sizeof(item) == 4. It really is
	sizeof(long).
1999-08-08 20:31:45 +00:00
Raja R Harinath
54b231b034 Don't mv' from builddir to srcdir, use cp' followed by rm' (the rm'
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
1999-07-30 17:12:48 +00:00
Elliot Lee
0c39d9a4f3 . configure.in: Fix autoconf warnings about cross compilation by trying to
. configure.in: Fix autoconf warnings about cross compilation by trying to
  provide sane defaults for AC_TRY_RUN.
. docs/Makefile.am: Tell distcheck how to generate the .gif files.
. gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir), put them into
  $(srcdir) when generated. Also add a dependency of gtksignal.h on gtkmarshal.h
  for -j builds.
. gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
1999-07-30 16:14:09 +00:00
Elliot Lee
263a095543 Allow defining a CUSTOM_RELEASE at RPM build time 1999-07-29 20:09:24 +00:00
Owen Taylor
fe3173bd1a Added missing GDK_THREADS_{LEAVE,ENTER} pair. (From Paul Fisher
Wed Jul 28 09:29:19 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
	GDK_THREADS_{LEAVE,ENTER} pair.
	(From Paul Fisher <pnfisher@redhat.com>)
1999-07-28 13:26:40 +00:00
Tim Janik
6eb649146c asure that the requested width and height are always >0 (owen).
Fri Jul 23 01:00:15 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
        width and height are always >0 (owen).
1999-07-23 00:36:33 +00:00
Tim Janik
b7b01fa9d3 typo 1999-07-22 22:15:46 +00:00
Tim Janik
4f490f626a backed out my recent change that assured that a widget's allocated with
Fri Jul 23 00:00:47 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
        change that assured that a widget's allocated with and height are
        always >1, since this breaks *buggy* panel code. unfortunately this
        back-breaks the gimp's color selector.

        * gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
        allocation is always >0 in width and height, before sending the
        configure event; this is a *gross* hack to get the gimp back to work.

        * maked both cases with TODO-1.3
1999-07-22 22:11:47 +00:00
Owen Taylor
66a7a593e2 Don't display wrap indicators when text is not editable and word wrap is
Wed Jul 21 15:47:39 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c: Don't display wrap indicators when
	text is not editable and word wrap is on.
1999-07-21 19:45:55 +00:00
Yukihiro Nakai
bd7c5b22be ja.po: Japanese translation update from Shirasaki Yasuhiro.
ja.po: Japanese translation update from Shirasaki Yasuhiro.
1999-07-21 08:52:49 +00:00
Tim Janik
32e24f9f32 special case option menus here as they are not derived from menu shell,
Wed Jul 21 08:21:40 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
        option menus here as they are not derived from menu shell, assure that
        the option menu has a menu we can add items to.
1999-07-21 06:27:12 +00:00
Tim Janik
f50fed4098 convert allocation-> width/height to (gint) before calculations and check
Tue Jul 20 23:29:48 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
        width/height to (gint) before calculations and check against < 0 to
        avoid guint wraparounds.
1999-07-20 21:59:11 +00:00
Tim Janik
13aa12ea14 ensure that the allocated width and height is never zero. sanity check
Sun Jul 18 00:35:49 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
        width and height is never zero. sanity check both dimensions against
        32767 and issue a warning if the allocation is greater than that.
1999-07-17 22:42:49 +00:00
Manish Singh
ca599d6060 libtool 1.3.3
-Yosh
1999-07-17 05:21:02 +00:00
Yukihiro Nakai
029baff26a ja.po: "Rename file" translation fixed.
ja.po: "Rename file"  translation fixed.
1999-07-13 05:02:51 +00:00
Tomas Ogren
79e872c851 Updated
1999-07-11  Tomas Ogren  <stric@ing.umu.se>

* sv.po: Updated
1999-07-10 22:28:42 +00:00
Owen Taylor
fa80ff6c59 Indicate that the --with-glib= configure time flag is unsupported.
Thu Jul  8 11:30:18 1999  Owen Taylor  <otaylor@redhat.com>

	* INSTALL: Indicate that the --with-glib= configure
	time flag is unsupported.

	* configure.in: Some small fixups for libgno
1999-07-08 15:33:41 +00:00
Stuart Parmenter
58102a49f0 s/,/./ 1999-07-07 22:20:33 +00:00
Owen Taylor
d38f1248d1 Unlock around call to g_main_pending() as well.
Wed Jul  7 15:03:30 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_events_pending): Unlock around call
	to g_main_pending() as well.
1999-07-07 19:04:09 +00:00
Owen Taylor
8e401114ef Unlock around call to g_main_iteration() - since that will regrab GTK+
Wed Jul  7 14:59:01 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_main_iteration): Unlock around
	call to g_main_iteration() - since that will regrab
	GTK+ lock to process events.
1999-07-07 18:55:46 +00:00
Owen Taylor
46144b1be4 Added a file that gives documenation about the autogeneration process for
Mon Jul  5 20:36:03 1999  Owen Taylor  <otaylor@redhat.com>

	* docs/generation.txt: Added a file that gives
	documenation about the autogeneration process for
	various autogenerated files.
1999-07-06 00:36:56 +00:00
Owen Taylor
af5243ab71 - Code cleanups - Instantaneously update on modifier key presses - Allow
Wed Jun 30 19:26:36 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c:
	- Code cleanups
	- Instantaneously update on modifier key presses
	- Allow cancellation of the drag with Escape.
1999-06-30 23:35:55 +00:00
Owen Taylor
37ad5eb7c0 Don't core dump at all on X IO errors, only core dump if --enable-debug
Tue Jun 29 23:02:42 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c (gdk_x_error / gdk_x_io_error): Don't
	core dump at all on X IO errors, only core dump
	if --enable-debug for X errors.

Tue Jun 29 17:04:09 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/testgtk.c (create_handle_box): Set the policy
	to auto_shrink - otherwise the appearance is rather
	strange when flipping between horizontal and vertical.
1999-06-30 21:52:35 +00:00
Owen Taylor
d97fede574 Look for libgmodule in the right location.
Tue Jun 29 15:59:25 1999  Owen Taylor  <otaylor@redhat.com>

	* configure.in (LIBS): Look for libgmodule in the
	right location.
1999-06-29 19:58:24 +00:00
Tim Janik
dc624c4dd8 add ::default_width and ::default_height arguments.
Mon Jun 28 09:29:52 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
        (gtk_window_set_default_size): don't change a value if it's < 0.
        queue a resize.

Sun Jun 27 11:00:33 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
1999-06-28 23:52:46 +00:00
Owen Taylor
43e80bc87a Don't add an extra "/" when concating "/" + filename. (From Matt Grossman
Mon Jun 28 12:08:25 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
	add an extra "/" when concating "/" + filename.
	(From Matt Grossman <mattg@oz.net>)
1999-06-28 16:08:28 +00:00
Owen Taylor
4c09ae6026 Reset clip mask for fg_gc if we set it for drawing pixmap.
Mon Jun 28 10:57:12 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
	for fg_gc if we set it for drawing pixmap.
1999-06-28 15:50:44 +00:00
Tim Janik
86e47a1efa removed old ""Got event for unknown window:" message. disabled
Thu Jun 24 17:06:23 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): removed old ""Got event for
        unknown window:" message. disabled ConfigureNotify discarding code,
        because it led to events being processed out of order.

Thu Jun 24 12:22:02 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkglobals.c: preinitialize gdk_error_code to 0.

        * gdk/gdkevents.c (gdk_event_send_client_message_to_all_recurse): since
        we export this function, supress error warnings and don't reset the
        error code in the first half of this function.

        * gdk/gdk.c (gdk_x_error): set gdk_error_code to the actuall X error
        code (instead of just -1) so gdk_error_trap_pop() reveals something
        actually informative about the error that happened.

        * gdk/*.c:
        don't rely on gdk_error_code being -1 if an error occoured, but just
        gdk_error_code != 0.

Thu Jun 24 11:50:07 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_apply_filters): advance the filter list
        pointer *before* invoking the filter function, so we at least don't
        crash if a filter is removed that is currently executed. window filters
        *really* need to be made truely reentrant at some point.

Wed Jun 16 20:28:34 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): don't segfault for
        window==NULL in ConfigureNotify.

Mon Jun 14 11:10:15 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkevents.c (gdk_event_translate): print the atom name in the
        PropertyNotify debug messages.
1999-06-25 23:23:07 +00:00
Owen Taylor
b90f0c9ee7 Removed references to code examples in my directory on gtk.org as they
Thu Jun 17 13:57:31 1999  Owen Taylor  <otaylor@redhat.com>

	* docs/gtk_tut.sgml: Removed references to
	code examples in my directory on gtk.org as
	they should all be in the tutorial now.

	* docs/gtk_tut.sgml: Added sources for dial-test
	and scribble-xinput programs that were previously
	missing.
1999-06-17 18:01:14 +00:00
Elliot Lee
e0bc92268b Add maintainers list 1999-06-15 17:20:46 +00:00
Tim Janik
94ba2610fe queue a resize.
Thu Jun 10 17:59:38 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
1999-06-11 03:36:07 +00:00
Tim Janik
b39b03d27d small fix 1999-06-09 09:08:22 +00:00
Tim Janik
611e6e20e7 mark certain functions as internal.
Wed Jun  9 15:13:16 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkaccelgroup.h: mark certain functions as internal.

Wed Jun  9 13:48:28 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
        expand behaviour changed.

        * gtk/gtklabel.c (gtk_label_set_pattern):
        (gtk_label_set_justify):
        (gtk_label_set_line_wrap):
        don't bother invoking queue_clear, the reallocation does
        that for us, always free_words so the upcoming resize will
        relayout the label's contents.

Wed Jun  9 12:50:48 1999  Tim Janik  <timj@gtk.org>

        * applied argument implementation patches from Elena Devdariani
        <elena@cogent.ca>.

        * gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
        ::space_style, ::relief
        * gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
        * gtk/gtkpreview.c: ::expand
        * gtk/gtkpaned.c: ::handle_size, ::gutter_size
        * gtk/gtknotebook.c: ::homogeneous
        * gtk/gtklabel.c: ::wrap
        * gtk/gtklist.c: ::selection_mode
        * gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
        * gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
        * gtk/gtkcolorsel.c: ::policy, ::use_opacity
        * gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
        * gtk/gtkclist.c: ::sort_type
        * gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
        * gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
1999-06-09 09:07:42 +00:00
Owen Taylor
852baf9bfe Added entry about menu keyboard navigation, removed some finished items.
Fri Jun  4 00:08:59 1999  Owen Taylor  <otaylor@redhat.com>

	* TODO: Added entry about menu keyboard navigation, removed
	some finished items.
1999-06-04 04:47:27 +00:00
Owen Taylor
2d19ab20f7 Removed ill-thought-out part of last comment.
Tue Jun  1 23:38:38 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c: Removed ill-thought-out part of last
	comment.
1999-06-02 03:35:54 +00:00
Owen Taylor
f9aee08d6e Get the reference counting right when we have to attach a new style for a
Tue Jun  1 23:30:09 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c (gtk_style_attach): Get the reference
	counting right when we have to attach a new style
	for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)

	* gtk/gtkstyle.c: Documented the refcounting
	peculularities of gtk_style_attach.
1999-06-02 03:29:39 +00:00
1
c084c71294 added return if fail for invalid window types.
1999-06-01    <timj@dhcpd7.redhat.com>

        * gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
        window types.

        * examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
        of GTK_TOPLEVEL for creating the window.
1999-06-01 17:26:26 +00:00
1
c288d2419e don't segfault when --gtk-module is the last argument (reported by Per
1999-06-01    <timj@dhcpd7.redhat.com>

        * gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
        the last argument (reported by Per Winkvist).
1999-06-01 16:57:02 +00:00
Owen Taylor
8d32617d16 Standardize on func_dgettext not func_gettext, so that the checks for
Mon May 31 00:11:24 1999  Owen Taylor  <otaylor@redhat.com>

	* acinclude.m4: Standardize on func_dgettext
	not func_gettext, so that the checks for dgettext
	actually are paid attention to.
1999-06-01 12:42:56 +00:00
Manish Singh
651a662ba5 blah
-Yosh
1999-05-29 18:19:56 +00:00
Manish Singh
1c2bde024e libtool 1.3.2
add Changes-1.2.txt to EXTRA_DIST

-Yosh
1999-05-29 18:19:22 +00:00
Owen Taylor
3680b735d7 Updates from Stanislav Brabec <utx@k332.feld.cvut.cz>.
Tue May 25 14:11:09 1999  Owen Taylor  <otaylor@redhat.com>

	* cs.po: Updates from Stanislav Brabec <utx@k332.feld.cvut.cz>.
1999-05-25 18:09:26 +00:00
Owen Taylor
9d40a0cd27 Fixes for invisible XOR lines (Frank Loemker
Tue May 25 13:13:12 1999  Owen Taylor  <otaylor@redhat.com>

        Fixes for invisible XOR lines (Frank Loemker
	<floemker@TechFak.Uni-Bielefeld.DE>)

	* gtk/gtkclist.c (gtk_clist_realize): Always use
	a non-zero pixel for GDK_XOR.

	* gtk/gtkvpaned.c gtk/gtkhpaned.c:
	Use GDK_INVERT instead of GDK_XOR.
1999-05-25 17:25:07 +00:00
Lars Hamann
dc9569756e signal emit value_changed signals if h/voffsets differ from adjustment
Wed May 12 21:56:40 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
	signals if h/voffsets differ from adjustment values.
	Reportet by Jerome Bolliet <bolliet@in2p3.fr>
1999-05-12 20:29:31 +00:00
CDT 1999 Shawn T. Amundson
0ef2295c53 GTK+ is as easy as 1.2.3...
Mon May 10 22:20:06 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * GTK+ is as easy as 1.2.3...
1999-05-11 04:50:54 +00:00
Tim Janik
519fed9991 propagate ::selection-done emissions up to the topmost menu shell.
Mon May 10 04:20:41 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
        ::selection-done emissions up to the topmost menu shell.
1999-05-11 02:19:37 +00:00
Owen Taylor
5e52b31fd7 Unset the user data on the window before destroying it.
Fri May  7 10:15:14 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
	the user data on the window before destroying it.

	* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
	unrealize handler to take care of destroying
	notebook->panel properly.
	(Bug #1198 - Morten Welinder <terra@diku.dk>)

	* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
	of g_new and g_realloc to stop memory leak. (Actually,
	we could just use g_realloc(), but I'm not 100% sure
	that is portable).
	(Bug #1196 - Morten Welinder <terra@diku.dk>)
1999-05-07 14:29:04 +00:00
Owen Taylor
bbe8b7ba61 Removed stray GtkPlugButton declaration.
Wed Apr 21 00:42:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.

	* gdk/gdkfont.c (gdk_text_measure): Fix the return value
        for fontsets.

	* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
	with bin/button confusion.
1999-05-06 03:13:41 +00:00
Owen Taylor
f187c3bb24 Change G_MAXINT to 2^16 to alleviate overflow problems in various window
Wed May  5 22:24:21 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_set_geometry_hints): Change
	G_MAXINT to 2^16 to alleviate overflow problems in
	various window managers.
1999-05-06 03:12:08 +00:00
Owen Taylor
6227a115be Patch from Sung-Hyun Nam <namsh@lgic.co.kr>
Wed May  5 22:51:06 1999  Owen Taylor  <otaylor@redhat.com>

        Patch from Sung-Hyun Nam <namsh@lgic.co.kr>

	* gdk/gdkim.c: Fix cut-and-paste errors for
	x/y and PreeditAttributes/StatusAttributes.
1999-05-06 03:11:38 +00:00
Tim Janik
2f80acc28e in the ItemFactory test, link radio items together, and show how
Thu May  6 04:53:26 1999  Tim Janik  <timj@gtk.org>

        * gtk/testgtk.c: in the ItemFactory test, link radio items together,
        and show how preselection of radio items is done.

Sun May  2 13:31:14 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
        * gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
        * gtk/gtktoolbar.c (gtk_toolbar_insert_element):
        * gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
        * gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
        * gtk/gtktable.c (gtk_table_attach):
        * gtk/gtklist.c (gtk_list_insert_items):
        * gtk/gtkmenushell.c (gtk_menu_shell_insert):
        * gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
        * gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
        * gtk/gtkbin.c (gtk_bin_add):
        * gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
        * gtk/gtkfixed.c (gtk_fixed_put):
        * gtk/gtklayout.c (gtk_layout_put):
        general fixups to container_add logic. always realize child if
        child->parent is realized, only map the child and queue a resize
        if child and child->parent are both visible.

Fri Apr 30 09:02:28 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
        instead of gtk_container_foreach to walk and unrealize children, so
        composite children get also unrealized.
        (gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
        (gtk_widget_map): assert that the widget is visible (basic constrain).
        (gtk_widget_real_map): assert that the widget is realized (basic
        constrain).

Fri Apr 29 00:53:20 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
1999-05-06 02:59:18 +00:00
Owen Taylor
30d6a30b01 Initialize size_hints.x and size_hints.y because kwm brokenly pays
Wed May  5 12:42:01 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_set_geometry_hints):
	Initialize size_hints.x and size_hints.y because kwm
	brokenly pays attention to them.
	(Bug #1181 -  Lars Heete <hel@admin.de>)
1999-05-05 16:46:28 +00:00
Owen Taylor
7f9cb3548b Free the return value of gdk_list_visuals(). (Bug #1193 - Morten Welinder
Wed May  5 11:38:56 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkrgb.c (gdk_rgb_choose_visual): Free the
	return value of gdk_list_visuals().
	(Bug #1193 - Morten Welinder <terra@diku.dk>)
1999-05-05 15:38:48 +00:00
Owen Taylor
17c8d9cd74 Add $INTLLIBS into $LIBS directly, rather than repeating the checks for
Wed May  5 10:47:54 1999  Owen Taylor  <otaylor@redhat.com>

	* configure.in (LIBS): Add $INTLLIBS into $LIBS
	directly, rather than repeating the checks for
	gettext.

	* INSTALL: Added information about gettext and
	NLS support.

	* acinclude.m4 (LIBM): Check for dgettext, not
	just gettext. This should hopefully fix things wrt
	systems with old versions of GNU gettext installed.
1999-05-05 15:11:36 +00:00
Manish Singh
197950e184 cast the return value of XSetIMValues to (void *) when comparing to NULL,
* gdk/gdkim.c (gdk_im_real_open): cast the return value of
XSetIMValues to (void *) when comparing to NULL, to workaround
the problem of some compilers barfing since older X headers don't
have the prototype for it.

-Yosh
1999-05-04 18:18:06 +00:00
Owen Taylor
bbf7b3a60f Use width,height = 0, 0 to mean - here to edge of window, instead of -1,
Tue May  4 08:44:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
	width,height = 0, 0 to mean - here to edge of window,
	instead of -1, -1, since the former is all we support.

Tue May  4 08:34:43 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmain.c (gtk_main): Correctly free list nodes
	when removing from quit_functions list.

Mon Apr 19 10:11:12 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkcolor.c (gdk_colormap_new): Fix memory leak
	for pseudocolor where colormap->colors was double
	allocated.

	* gdk/gdkcolor.c (gdk_colormap_alloc1): Store the
	color value in the hash table with the pixel filled
	in so when we do later hash table lookups, the color
	value is correct.
1999-05-04 15:00:07 +00:00
Owen Taylor
498b5eca13 Add a gtkrc file for iso-8859-2 locales.
Tue May  4 09:32:08 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
	file for iso-8859-2 locales.

	* configure.in (ALL_LINGUAS): ALL_LINGUAS update.

Tue Apr 27 16:38:32 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
	 (Pointed out by andy@rz.uni-karlsruhe.de and others).
	 Remove some suspicious and useless lines.
1999-05-04 13:53:19 +00:00
Owen Taylor
658f736af1 Backmerge from HEAD sk.po sl.po zh_TW.Big5.po: New additions
Tue May  4 09:09:52 1999  Owen Taylor  <otaylor@redhat.com>

	* fi.wa wa.po ca.po: Backmerge from HEAD
	  sk.po sl.po zh_TW.Big5.po: New additions

	* pl.po: Backported updates from HEAD
1999-05-04 13:52:23 +00:00
Manish Singh
edf4aa4bcd check private->destroyed before making the call
* gdk/gdkdraw.c (gdk_draw_lines): check private->destroyed before
making the call

-Yosh
1999-05-02 22:34:49 +00:00
Manish Singh
3046ab9f0f libtool 1.3 upgrade
-Yosh
1999-05-01 18:06:06 +00:00
Tim Janik
a654f96831 remove unused variable.
Tue Apr 27 14:17:16 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
1999-04-29 00:21:01 +00:00
Owen Taylor
ff01cccfb9 Fix leak pointed out by Morten Welinder <terra@diku.dk>.
Tue Apr 27 11:17:35 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c (xdnd_set_{targets,actions}): Fix leak
	pointed out by Morten Welinder <terra@diku.dk>.
1999-04-27 22:34:00 +00:00
Owen Taylor
0c177d15d1 When redrawing characters on non-visible entry, use appropriate '*'
Tue Apr 27 18:23:35 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
	 When redrawing characters on non-visible entry, use appropriate
	 '*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
1999-04-27 22:33:02 +00:00
Lars Hamann
be0f11a4d2 compute destination cell from drag coordinates.
Tue Apr 27 01:31:40 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtkclist.c (drag_dest_cell): compute destination cell
        from drag coordinates.
        (gtk_clist_drag_data_received) (gtk_clist_drag_motion):
        use drag_dest_cell.

        * gtk/gtktree (drag_dest_cell)
        (gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
        (Bug #1129)
1999-04-26 23:57:45 +00:00
Changwoo Ryu
ed0db4cd4f Updated.
1999-04-24  Changwoo Ryu  <cwryu@adam.kaist.ac.kr>

	* ko.po: Updated.
1999-04-24 14:42:49 +00:00
Tim Janik
1cc01ceb59 fix (and foxy ;) 1999-04-22 16:05:14 +00:00
Tim Janik
caf95cd161 properly initialize translate_* fields. (gtk_item_factory_finalize):
Wed Apr 21 21:26:11 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
        translate_* fields.
        (gtk_item_factory_finalize): invoke translate_notify independant from
        translate_data.
        (gtk_item_factory_set_translate_func): likewise.
        (gtk_item_factory_destroy): only ifactory pointer from those widgets
        that belong to us (stupid me).
1999-04-21 22:25:48 +00:00
George Lebl
83c4021614 correctly remove the default filter from the list
Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>

        * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
          default filter from the list
1999-04-21 21:26:46 +00:00
Owen Taylor
fdb8efb35a Fixed leak of rc_style list when lookup succeeeds.
Mon Apr 19 12:05:31 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
	rc_style list when lookup succeeeds.
1999-04-21 17:12:43 +00:00
Drazen Kacar
9ad66ac6e8 Merged Croatian locale from HEAD. 1999-04-19 01:16:07 +00:00
Tomas Ogren
3834ea83c0 Add a / before the directory name to keep directory names from eachother.
1999-04-18  Tomas Ogren  <stric@ing.umu.se>

        * gtk/gtkrc.c: Add a / before the directory name to keep directory
        names from eachother. (Already fixed in 1.3.x)
1999-04-18 18:21:19 +00:00
Manish Singh
e3b8c8ba92 #include "gdkkeysyms.h" for gdk_XConvertCase #defines
* gdk/gdk.c: #include "gdkkeysyms.h" for gdk_XConvertCase #defines

* gtk/gtkfontsel.c (gtk_font_selection_create_xlfd): use
g_strdup_printf instead of calcing the length separately

-Yosh
1999-04-17 03:49:50 +00:00
Lars Hamann
e6828ec4e4 fixed undo_selection bug. fixed resync_selection bug.
Thu Apr 15 01:11:24 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkctree.c (resync_selection):
	* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
	* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
 	bug.
1999-04-14 23:33:07 +00:00
CDT 1999 Shawn T. Amundson
7ee4ba7781 Released GTK+ 1.2.2
Tue Apr 13 17:14:28 CDT 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.2
1999-04-13 23:09:16 +00:00
Owen Taylor
3a03678080 removed some silly #ifdef HAVE_CONFIG that we don't do in many other
Tue Apr 13 02:49:33 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: removed some silly #ifdef HAVE_CONFIG
	that we don't do in many other places. (Fixing duplicate
	#include of config.h)

	* gdk/gdkevents.c: include gdkinput.h _after_ config.h.
	Otherwise, #ifndef XINPUT_NONE check in the latter
	doesn't work. (Bug #546)
1999-04-13 06:55:55 +00:00
Tim Janik
badd841246 bumped version number to Gtk+ 1.2.2, interface 0, binary 2.
Sun Apr 11 15:08:27 1999  Tim Janik  <timj@gtk.org>

        * configure.in: bumped version number to Gtk+ 1.2.2, interface 0,
        binary 2.

        * NEWS: updates.

Sun Apr 11 14:38:03 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): check for color
        "None" case insensitive.
1999-04-11 15:01:30 +00:00
Owen Taylor
ffafb164d9 Add some missing GDK_THREADS_ENTER()/LEAVE around timeouts. (Patches from
Fri Apr  9 19:22:19 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
        Add some missing GDK_THREADS_ENTER()/LEAVE around
        timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
1999-04-09 23:34:05 +00:00
Tim Janik
8286bd2493 use gtk_widget_activate() rather than emit_by_name.
Thu Apr  8 20:10:33 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
        rather than emit_by_name.

        * gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
        on the widget across multiple signal emissions.
        (gtk_editable_delete_text): same here.
        (gtk_editable_class_init): set widget_class->activate_signal after
        editable_signals[ACTIVATE] has been created.
1999-04-08 20:11:42 +00:00
Owen Taylor
ceb0f66e51 Don't clamp position here prematurely -- we might not have the right
Wed Apr  7 22:59:47 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
	position here prematurely -- we might not have the
	right ->min_position and ->max_position yet.
1999-04-08 03:06:03 +00:00
Owen Taylor
3de957405f Add error traps so if the other end of the connection dies, we survive.
Tue Apr  6 16:38:51 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
	Add error traps so if the other end of the connection
	dies, we survive.

	* gtk/gtkselection.c (gtk_selection_notify): Clean
	up properly when selection property retrieval fails.

	* gtk/gtkselection.c (gtk_selection_request): Correctly
	reject SelectionRequest notifies where the handler
	returns no data.
1999-04-06 21:00:45 +00:00
Owen Taylor
4361369939 Only unhighlight when we've previously highlighted.
Tue Apr  6 12:24:21 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
	when we've previously highlighted.

	* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
	emit two "drag_leave" signals for Motif drops.

	* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
	back the correct status messages when dropping from
	Motif onto a proxy window that is rejecting the
	drop.

	* gdk/gdkdnd.c (gdk_drag_motion): Separate out the
	dest_xid field into two fields - one for the window
	to send in messages, one to indicate the last looked
	up window for caching purposes. This is needed, so
	that Leave messages get the correct window.
1999-04-06 18:50:38 +00:00
Owen Taylor
0d353949e2 Check explicitly for the string "None" - it is in the XPM spec and some
Mon Apr  5 17:11:57 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkpixmap.c (_gdk_pixmap_create_from_xpm): Check
	explicitly for the string "None" - it is in the XPM
	spec and some servers treat unknown colors in odd ways
	(like asking the user!)
1999-04-05 21:14:25 +00:00
Owen Taylor
80c5ac85d4 Fix warning created by people mucking around with the gsource API.
Mon Apr  5 13:21:30 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkevents.c (gdk_event_check, gdk_event_prepare):
	Fix warning created by people mucking around
	with the gsource API.

	* gdk/gdkevents.c (gdk_io_invoke, gdk_input_add_full):
	Change mapping between GIOCondition and GdkInputCondition
	to match the way the Linux kernel does it. This should
	fix problems where closed pipes were no longer signalling
	GDK_INPUT_READ on systems with a native poll().
1999-04-05 17:24:41 +00:00
Manish Singh
b44c5d0f0c made "->" into a "." of previous change so it compiles
* gdk/gdkevents.c: made "->" into a "." of previous change so
it compiles

* gtk/gtkfontsel.c: added braces enclosing an if-else construct

* autogen.sh: add --enable-maintainer-mode

* configure.in: set ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

-Yosh
1999-04-02 01:17:12 +00:00
Federico Mena Quintero
7ac92e74e8 Set the window field of the event structure before calling user filters.
Thu Apr  1 18:41:25 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkevents.c (gdk_compress_exposures): Set the
	window field of the event structure before calling
	user filters.

1999-03-31  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gdk/gdk.c (gdk_init_check): Use False as the last argument to
	XInternAtom() here.  This is a particularly Old And Nasty(tm) bug.
1999-04-01 23:38:43 +00:00
Federico Mena Quintero
eaa98e5cfc Use False as the last argument to XInternAtom() here. This is a
1999-03-31  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gdk/gdk.c (gdk_init_check): Use False as the last argument to
	XInternAtom() here.  This is a particularly Old And Nasty(tm) bug.
1999-04-01 10:42:06 +00:00
Tim Janik
db496116d9 added functions from GLE, gtk_arg_reset() to free the value and reset type
Sat Mar 27 23:32:13 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
        the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
        to compare two argument values. added gtk_arg_to_valueloc() to set a
        variable from an arg through its location (pointer).

        * gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
        gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
        as gfloat*, uchars are collected as guchar*, ints are collected as
        gint*, etc...
1999-03-30 18:28:38 +00:00
Owen Taylor
d32d93cc3c Include <string.h> instead of <strings.h>.
Mon Mar 29 17:45:47 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
	Include <string.h> instead of <strings.h>.

	* gtk/gtkstyle.c: Fix double include of gtkthemes.h
	(actually, a lot more duplicate includes occur if
	 you trace through the sequence of #include's)
	gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
1999-03-29 23:44:33 +00:00
Owen Taylor
da74d5d843 Free the value of the intermediate text property - prevents major memory
Mon Mar 29 17:31:52 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkim.c (gdk_mbstowcs): Free the value of the
	intermediate text property - prevents major memory
        leak when gdk_use_mb.
	gtk-d3august-990311-0: Bj|rn Augustsson <d3august@dtek.chalmers.se>
1999-03-29 22:38:18 +00:00
Owen Taylor
44dd4a430d Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
Mon Mar 29 17:02:58 1999  Owen Taylor  <otaylor@redhat.com>

        Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
	gtk-a-higuti-990322-[0-3]

	* gdk/gdkfont.c (gdk_text_extents_wc): Make  work when
	sizeof(wchar_t) != sizeof (GdkWChar)

	* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
	that was causing -DX_LOCALE not	to work.

	* gtk/gtkrc.c (gtk_rc_init):
	X_LOCALE will never have LC_MESSAGES defined

	* gdk/gdk.c (gdk_init_check):
	Remove --xim-preedit and --xim-status from argv properly.

	* gdk/gdkim.c (gdk_ic_real_new): Add a gdk_flush() so
	that the client window is present on the X server
	before we pass it to the input method.
1999-03-29 22:20:41 +00:00
Owen Taylor
fcc38c19d8 Fix bug where if --display is specified on the command line, than the drag
Tue Mar  9 10:46:49 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c (motif_find_drag_window): Fix bug where
	if --display is specified on the command line, than
	the drag window will not be created on that display.

Tue Mar  9 10:38:24 1999  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkproperty.c (gdk_atom_intern): Fixed bug where
	lookups with only_if_exists == TRUE were inserting
	bogus values into the atom cache.
1999-03-29 20:40:47 +00:00
Manish Singh
737580cc57 Shut up CVS
-Yosh
1999-03-28 01:07:21 +00:00
Kjartan Maraas
db025ebfb0 updated translation
1999-03-27  Kjartan Maraas  <kmaraas@online.no>

		* no.po: updated translation
1999-03-26 23:11:18 +00:00
Tim Janik
0ae73a09dd get $HOME from g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
Thu Mar 25 12:38:31 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
        g_get_home_dir() (gtk-pmc-990123-0.patch.gz).

        * gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
        left/right as well (gtk-michael-980726-0.patch.gz).

        * gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
        for pointer values, use gchar instead of char. fixed uline allocation
        leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
        chunks instead of G_ALLOC_ONLY.
        (gtk_label_size_request): always alter requisition as passed and leave
        widget->requisition alone.
        (gtk_label_set_text): allow NULL strings.
        (gtk_label_new): likewise.
1999-03-25 13:39:54 +00:00
CST 1999 Shawn T. Amundson
2c659472e2 Released GTK+ 1.2.1
Wed Mar 24 23:03:49 CST 1999 Shawn T. Amundson <amundson@gtk.org>

        * Released GTK+ 1.2.1

        * INSTALL:
          README:
          sanity_check: Updated.

        * docs/gtk-config.1.in:
          docs/Makefile.am:
          configure.in: gtk-config is now generated.

        * docs/gtk-config.1: Removed, now generated.
1999-03-25 05:55:03 +00:00
Tim Janik
0720955e17 type/macro fixups.
Wed Mar 24 09:24:03 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkdrawingarea.[hc]: type/macro fixups.
1999-03-24 15:01:55 +00:00
Stefan Jeske
0c90498103 Added missing "%" to "prefix" 1999-03-24 09:43:05 +00:00
Kjartan Maraas
bab8d95583 1112: add missing . after @xref
1999-03-22  Kjartan Maraas  <kmaraas@online.no>

		* gtk.texi:1112: add missing . after @xref
1999-03-22 20:47:19 +00:00
Tim Janik
3f2cd052fd grrr, stupid cvs, try grasp the meaning of "abort"!
Mon Mar 22 05:51:34 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
        *and* mapped (i.e. drawable).
        (gtk_bin_expose): only send exposes to drawable children.

        * gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
        (gtk_box_expose): only send exposes to drawable children.

        * gtk/gtkhscale.c (gtk_hscale_draw):
        * gtk/gtkvscale.c (gtk_vscale_draw):
        hm, this is an ugly one. we first compute the size of our trough area
        here (window relative) and then check intersection with the draw_area
        which is parent relative because we're a NO_WINDOW widget, so we need
        to offset the trough area by allocation.x and allocation.y before the
        check. (this must not be done for the background area though, since
        that's already computed parent relative).
1999-03-22 06:46:16 +00:00
Tim Janik
0362058f6e only redraw children that are visible *and* mapped (i.e. drawable).
Mon Mar 22 05:51:34 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
        *and* mapped (i.e. drawable).
        (gtk_bin_expose): only send exposes to drawable children.

        * gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
        (gtk_box_expose): only send exposes to drawable children.

        * gtk/gtkhscale.c (gtk_hscale_draw):
        * gtk/gtkvscale.c (gtk_vscale_draw):
        hm, this is an ugly one. we first compute the size of our trough area
        here (window relative) and then check intersection with the draw_area
        which is widget relative, so we need to offset the trough area by
        allocation.x and allocation.y before the check. (this must not be done
        for the background area though, sicne that's already computed parent
        relative).
1999-03-22 06:35:54 +00:00
Lars Hamann
b59eefd649 unmap clist if neccessary, unrealize title buttons.
Mon Mar 22 00:41:39 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
	unrealize title buttons.
1999-03-21 23:57:07 +00:00
Manish Singh
287624f406 shut up cvs
-Yosh
1999-03-21 02:19:44 +00:00
Manish Singh
d4ecce94c8 acinclude.m4 config.guess config.sub ltconfig upgrade to libtool 1.2f
* acinclude.m4
* config.guess
* config.sub
* ltconfig
* ltmain.sh: upgrade to libtool 1.2f

* autogen.sh: libtool is not required to autogen gtk+

* acconfig.h: remove WITH_SYMBOL_UNDERSCORE (not explictly needed)

-Yosh
1999-03-20 00:48:13 +00:00
Lars Hamann
536673ad38 only connect/disconnect to GtkWidgetClass::event to block mouse events.
Fri Mar 19 00:00:22 1999  Lars Hamann  <lars@gtk.org>

	* gtk/gtkclist.c (gtk_clist_column_title_passive)
	(gtk_clist_column_title_active):
	only connect/disconnect to GtkWidgetClass::event to block mouse events.

	* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
	zero initialize event, removed superfluous gdk_window_get_pointer call

	* gtk/gtklist.c (gtk_list_vertical_timeout)
	(gtk_list_horizontal_timeout): removed superfluous
 	gdk_window_get_pointer call
1999-03-19 12:36:22 +00:00
Tim Janik
8b424288ba plugging problems reported by "Bruce Mitchener, Jr." <bruce@puremagic.com>
Wed Mar 17 09:00:00 1999  Tim Janik  <timj@gtk.org>

        * plugging problems reported by "Bruce Mitchener, Jr."
        <bruce@puremagic.com> due to a purify session.

        * gtk/gtkstyle.c:
        (gtk_style_ref):
        (gtk_style_unref): assert ref_count to be > 0.

        * gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
        the requisition.
        (gtk_clist_set_shift): likewise.

        * gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
        adjustments.

        * gdk/gdkselection.c (gdk_selection_property_get): first XFree(t),
        then reset it to NULL.

        * gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
        event before sending it and set send_event to TRUE (which needs to
        be done for *all* synthesized events).
        (gtk_list_vertical_timeout): likewise.

        * gdk/gdkcolor.c:
        (gdk_colors_free):
        (gdk_colormap_free_colors): use colormap->colors[in_pixels[i]] as the
        key for g_hash_table_remove() in both functions, this prevents us
        from accessing possibly uninitialized portions of a GdkColor structure
        where we are only interested in its pixel value.

        * gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
        leaks.

        * gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
        to TRUE when synthesizing events.
1999-03-17 10:32:33 +00:00
Stuart Parmenter
f880eba7cd make sure gtk_style_copy copies theme information 1999-03-17 03:32:11 +00:00
Tim Janik
ac8d845b3d updates.
* NEWS: updates.
1999-03-17 02:38:38 +00:00
Tim Janik
b691a88e07 bumped version number to Gtk+1.2.1, interface 0, binary 1.
Wed Mar 17 00:44:23 1999  Tim Janik  <timj@gtk.org>

        * configure.in: bumped version number to Gtk+1.2.1, interface 0,
        binary 1.

        * gtk/gtkfeatures.h.in: added GTK_CHECK_VERSION(major,minor,micro)
        macro to test for specific gtk versions, e.g.
        #if GTK_CHECK_VERSION (1,2,1)
            gtk_menu_ensure_uline_accel_group (menu);
        #endif /* Gtk+1.2.1 */
        this macro will return whether the Gtk+ header files are from version
        major.minor.micro or _newer_, as opposed to gtk_check_version() which
        requires an exact match for binary compatibility.
1999-03-17 00:03:10 +00:00
Tim Janik
af138bc287 ensure the item factory class has been created.
Tue Mar 16 17:43:33 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
	item factory class has been created.
	(gtk_item_factory_parse_rc): likewise.

	* gtk/gtkmenu.c:
	keep proper references for old_active_menu_item.
	(gtk_menu_reparent): unset the usize of the new parent,
	so the menu can sanely be size requested and we don't get nasty screen
	artefacts upon next reparentation.
	(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
	enter notify. only synthesize enter notifies if the pointer really is
	inside the event window.
	(gtk_menu_popdown): use gtk_menu_shell_deselect().
	(gtk_menu_popup): move the background setting stuff into
	gtk_menu_tearoff_bg_copy() so it can be called from other places as well.

	* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
	gtk_menu_shell_select_item() to select the new item.
	(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
	do the right thing for deselection as well.

Sat Mar 15 20:10:33 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkwidget.[hc]:
	(gtk_widget_accelerators_locked): return whether a widget's accelerators
	are locked.

        * gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
	existing accelerators if the widget's accelerators are locked.

Sat Mar 14 19:44:05 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.

	* gtk/gtkmenu.c: truely forward key press and key release events to
	the menu widget from the toplevel or tearoff window. we can't simply
	connect to that, we need to stop further processing of the events as
	well.

Sat Mar 13 13:14:17 1999  Tim Janik  <timj@gtk.org>

	* gtk/gtkmenu.c:
	(gtk_menu_key_press): pass event->keyval, event->state to
	gtk_accelerator_valid, instead of event->keyval twice.
	refuse to install single letter accelerators for menus that use
	single letter shortcuts.

	* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
	gtk_menu_ensure_uline_accel_group().

	* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
	which will always return an uline accel group, made
	gtk_menu_get_uline_accel_group() return NULL if the group isn't
	yet created.
1999-03-16 22:37:32 +00:00
Lars Hamann
29ce61fcf3 added button_passive flag.
Mon Mar 15 01:03:27 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.

        * gtk/gtkclist.c (gtk_clist_column_title_passive):
        Leave button sensitive, trap  button_press, button_release,
        motion_notify, enter_notify and leave_notify events instead.
        (gtk_clist_column_title_active): disconnect event handler.
        (gtk_clist_drag_data_get): fixed memory leak. Reported by
        Guillaume Laurent <glaurent@worldnet.fr>
1999-03-15 22:37:28 +00:00
George Lebl
69d2eba366 swap the gtk_drag_highlight_expose and gtk_drag_highlight_paint since it
Mon Mar 15 03:39:47 1999  George Lebl  <jirka@5z.com>

        * gtk/gtkdnd.c: (gtk_drag_highlight) swap the
          gtk_drag_highlight_expose and gtk_drag_highlight_paint since
          it was connecting a void function to expose_event and the int
          returning function to the draw signal
1999-03-15 11:40:27 +00:00
Lars Hamann
efb837bdb6 fixed a few width/height mixups.
Wed Mar 10 23:49:55 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
        width/height mixups.

        * gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
        if needed.
1999-03-10 23:20:10 +00:00
Federico Mena Quintero
5db63aaa6d Significantly reduced the number of calls to gdk_draw_point() (and thus to
Wed Mar 10 02:07:31 1999  Tim Janik  <timj@gtk.org>

        * merged from 1.3:
1999-03-09  Federico Mena Quintero  <federico@nuclecu.unam.mx>

        * gtk/gtkstyle.c (gtk_default_draw_handle): Significantly reduced
        the number of calls to gdk_draw_point() (and thus to X) by
        clipping the points by hand.

        * gtk/gtkhandlebox.c (draw_textured_frame): Actually make use of
        the clip parameter.
        (gtk_handle_box_paint): Only paint the handle if the expose area
        intersects it.
1999-03-10 01:14:38 +00:00
Tim Janik
7e8d27f327 unref the item factory after window's destruction.
Wed Mar 10 00:11:32 1999  Tim Janik  <timj@gtk.org>

        * gtk/testgtk.c (create_item_factory): unref the item factory after
        window's destruction.

        * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
        count on the menu shell around the menu item's activation, since the
        signal emission may cause menu shell destruction.

        * gtk/gtkitemfactory.c:
        the previous code leaked one accel group per menu. we use
        gtk_menu_get_uline_accel_group() now to fix that, and with that
        also create the underline accelerator group of the menus only if
        required (i.e. an underline accelerator has been specified).
        (gtk_item_factory_construct):
        (gtk_item_factory_create_item): removed code that would create an
        extra accel group for the menu (and leak references).
        (gtk_item_factory_create_item): adapted the underline accelerator
        installation code to properly feature gtk_menu_get_uline_accel_group().

        * gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
        menu->accel_group, this may return NULL if the accelerator group
        hasn't been set yet.
        added gtk_menu_get_uline_accel_group() to retrive the underline
        accelerator group of the menu, this will be created on demand
        and proper care is taken about its reference count.

        * gtk/gtkitemfactory.h:
        * gtk/gtkitemfactory.c:
        dumped the approach of keeping a widgets by action list on the
        factory since the factory<->widget destroy negotiation didn't work
        and would be hard to get going at all. instead we keep a list of
        GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
        persistant throughout a program's life time).
        also, i removed the static const gchar *key_* variables, and made
        them inline strings (they weren't actually used anyways).
        (gtk_item_factory_add_item): update ifactory->items.
        (gtk_item_factory_destroy): destroy ifactory->items (and remove
        the item factory pointer from the remaining ifactory widgets).
        (gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
        list to find the widget.
        (gtk_item_factory_get_item): new function that works around
        gtk_item_factory_get_widget() limitations, this function will only
        return menu items, even for <Branch> entries.
1999-03-10 01:00:04 +00:00
Tim Janik
8556b64654 first lookup the xfont ID in our font hash table, if we have a
Tue Mar  9 01:01:28 1999  Tim Janik  <timj@gtk.org>

        * gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
        font hash table, if we have a GdkFontPrivate entry for this font
        already, simply increment its reference count, provided by Olaf Dietsche
        <olaf.dietsche+list.gtk@netcologne.de>.

        * gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
        provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
1999-03-09 00:21:31 +00:00
Tim Janik
12d38df79e before adding a child to a conatiner, make sure it is (default)
Sun Mar  7 06:13:29 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkcontainer.c:
        (gtk_container_add_with_args):
        (gtk_container_addv):
        (gtk_container_add): before adding a child to a conatiner, make sure
        it is (default) constructed, this is neccessary because under certain
        circumstances the child will get relized and mapped immediatedly, in
        which case it has to be constructed already.
1999-03-07 06:09:53 +00:00
Tim Janik
7699e34d83 count object_signal values > 1 as TRUE also.
Mon Mar  1 17:58:21 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
        values > 1 as TRUE also.
1999-03-01 18:51:07 +00:00
Tim Janik
14ff63b93d minor fix. 1999-02-27 00:35:08 +00:00
305 changed files with 50635 additions and 33021 deletions

View File

@@ -13,3 +13,5 @@ gtk-config
config.cache
ABOUT-NLS
intl
stamp-h.in
gtk+.spec

2580
ChangeLog

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

53
INSTALL
View File

@@ -7,12 +7,12 @@ you got this package.
Simple install procedure
========================
% gzip -cd gtk+-1.2.0.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.0 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
% gzip -cd gtk+-1.2.8.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.8 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
% make install # install GTK
% make install # install GTK
The Nitty-Gritty
================
@@ -43,6 +43,13 @@ which form of support to use:
For more information, follow the link from http://www.gtk.org
* --disable-nls do not use Native Language Support
If this flag is not specified, GTK+ will try to find
and use the gettext() set of functions to provide translations
of the strings in the standard dialogs into the
user's native language.
* --enable-xim support XIM [default=yes]
Specifying --disable-xim will disable support for entering
@@ -50,7 +57,7 @@ internationalized text using X Input Methods. This will give some
slight savings in speed and memory use and might be necessary
with older versions of X.
* --with-locale=LOCALE locale name you want to use
* --with-locale=LOCALE locale name you want to use
The --with-locale options is used to determine if your operating
system has support for the locale you will be using. If not, X's
@@ -84,19 +91,43 @@ or,
setenv CFLAGS -O2 ; ./configure # csh and variants
Native-Language Support and gettext()
=====================================
Using an uninstalled copy of GLIB
=================================
To provide native-language support (NLS) GTK+ uses the
gettext() set of functions. These functions are found
in the C library on many systems, such as the Solaris
C library and the GNU C Library, version 2.
If your C library does not provide the necessary functionality,
you may wish to install the GNU gettext package. You'll
need version 0.10.35 or better. Version 0.10.35 is
available from ftp://alpha.gnu.org/pub/gnu
Generally, GTK+ will properly detect what is installed
on your system and enable or disable NLS as appropriate.
However, in rare cases, it may be necessary to disable
NLS manually to get GTK+ to compile. You can do this
by specifying the --disable-nls flag when configuring
GTK+.
Using an uninstalled copy of GLIB [ Unsupported ]
=================================================
You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-1.2.0
./configure --with-glib=../glib-1.2.8
This, however, will not work if you built GLIB with different
source and build directories.
It is recommended that you install GLIB before compiling
GTK+. The --with-glib option is not regularly tested
and may not function correctly. In addition,
inter-library dependencies won't be generated when
using --with-glib=.
Installation directories
========================
@@ -126,7 +157,7 @@ For complete details, see the file docs/gtk-config.txt
Notes for using XIM support for Japanese input
==============================================
* There is a bug in older versions of kinput2 that will cause GTK
* There is a bug in older versions of kinput2 that will cause GTK+
to hang when destroying a text entry. The latest versions of
kinput is available from:
@@ -138,7 +169,7 @@ C library multibyte functions. Unless your C library has support
for Japanese locales, this is incorrect, and will cause problems
for GTK's internationalization.
(In particular, this occurs with GNU libc 2.0 and 2.1, in which
(In particular, this occurs with GNU libc 2.0 in which
the multibyte functions always translate to and from UTF-8; but
the problem may occur for other C libraries, and other operating
systems as well.)

187
INSTALL.in Normal file
View File

@@ -0,0 +1,187 @@
Prerequisites
=============
GTK+ requires the GLIB library, available at the same location as
you got this package.
Simple install procedure
========================
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
% make install # install GTK
The Nitty-Gritty
================
The 'configure' script can be given a number of options to enable
and disable various features. For a complete list, type:
./configure --help
A few of the more important ones:
* --prefix=PREFIX install architecture-independent files in PREFIX
[ Defaults to /usr/local ]
* --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[ Defaults to the value given to --prefix ]
* --with-xinput=[no/gxi/xfree] support XInput [default=no]
The --with-xinput flag specifies whether to compile with support
for the XInput extension (mainly used for graphics tablets), and
which form of support to use:
no : no support
gxi : Use generic XInput support
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
and later.
For more information, follow the link from http://www.gtk.org
* --disable-nls do not use Native Language Support
If this flag is not specified, GTK+ will try to find
and use the gettext() set of functions to provide translations
of the strings in the standard dialogs into the
user's native language.
* --enable-xim support XIM [default=yes]
Specifying --disable-xim will disable support for entering
internationalized text using X Input Methods. This will give some
slight savings in speed and memory use and might be necessary
with older versions of X.
* --with-locale=LOCALE locale name you want to use
The --with-locale options is used to determine if your operating
system has support for the locale you will be using. If not, X's
built in locale support will be used.
Because of bugs in autoconf, it is necessary to specify this
option even if your LANG environment variable is correctly set.
This option does not determine which locale GTK will use at
runtime. That will be determined from the usual environment
variables. If you will be using multiple locales with GTK,
specify the one for which your operating system has the worst
support for the --with-locale option.
Options can be given to the compiler and linker by setting
environment variables before running configure. A few of the more
important ones:
CC : The C compiler to use
CPPFLAGS : Flags for the C preprocesser such as -I and -D
CFLAGS : C compiler flags
The most important use of this is to set the
optimization/debugging flags. For instance, to compile with no
debugging information at all, run configure as:
CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh)
or,
setenv CFLAGS -O2 ; ./configure # csh and variants
Native-Language Support and gettext()
=====================================
To provide native-language support (NLS) GTK+ uses the
gettext() set of functions. These functions are found
in the C library on many systems, such as the Solaris
C library and the GNU C Library, version 2.
If your C library does not provide the necessary functionality,
you may wish to install the GNU gettext package. You'll
need version 0.10.35 or better. Version 0.10.35 is
available from ftp://alpha.gnu.org/pub/gnu
Generally, GTK+ will properly detect what is installed
on your system and enable or disable NLS as appropriate.
However, in rare cases, it may be necessary to disable
NLS manually to get GTK+ to compile. You can do this
by specifying the --disable-nls flag when configuring
GTK+.
Using an uninstalled copy of GLIB [ Unsupported ]
=================================================
You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-@GTK_VERSION@
This, however, will not work if you built GLIB with different
source and build directories.
It is recommended that you install GLIB before compiling
GTK+. The --with-glib option is not regularly tested
and may not function correctly. In addition,
inter-library dependencies won't be generated when
using --with-glib=.
Installation directories
========================
The location of the installed files is determined by the --prefix
and --exec-prefix options given to configure. There are also more
detailed flags to control individual directories. However, the
use of these flags is not tested.
One particular detail to note, is that the architecture-dependent
include file glibconfig.h is installed in:
$exec_pref/lib/glib/include/
if you have a version in $prefix/include, this is out of date
and should be deleted.
A shell script gtk-config is created during the configure
process, and installed in the bin/ directory
($exec_prefix/bin). This is used to determine the location of GTK
when building applications. If you move GTK after installation,
it will be necessary to edit this file.
For complete details, see the file docs/gtk-config.txt
Notes for using XIM support for Japanese input
==============================================
* There is a bug in older versions of kinput2 that will cause GTK+
to hang when destroying a text entry. The latest versions of
kinput is available from:
ftp://ftp.sra.co.jp/pub/x11/kinput2
* The locale information file for the ja_JP EUC locale
distributed with some recent versions of X11 specifies to use the
C library multibyte functions. Unless your C library has support
for Japanese locales, this is incorrect, and will cause problems
for GTK's internationalization.
(In particular, this occurs with GNU libc 2.0 in which
the multibyte functions always translate to and from UTF-8; but
the problem may occur for other C libraries, and other operating
systems as well.)
To fix this, change the line:
use_stdc_env True
to
use_stdc_env False
in the file /usr/X11R6/lib/X11/locale/ja_JP/XLC_LOCALE.

1
MAINTAINERS Normal file
View File

@@ -0,0 +1 @@
Email: gtk-bugs@gimp.org

View File

@@ -1,10 +1,13 @@
## Process this file with automake to produce Makefile.in
## Makefile.am for GTK+
SRC_SUBDIRS = gdk gtk
SUBDIRS = po $(SRC_SUBDIRS) docs
bin_SCRIPTS = gtk-config
# require automake 1.4
AUTOMAKE_OPTIONS = 1.4
EXTRA_DIST = \
HACKING \
gtk+.spec.in \
@@ -28,7 +31,7 @@ EXTRA_DIST = \
examples/buttons/buttons.c \
examples/buttons/info.xpm \
examples/calendar/Makefile \
examples/calendar/gcalendar.c \
examples/calendar/calendar.c \
examples/clist/Makefile \
examples/clist/clist.c \
examples/entry/Makefile \
@@ -97,8 +100,14 @@ EXTRA_DIST = \
examples/spinbutton/Makefile \
examples/find-examples.sh
dist-hook:
cp gtk+.spec $(distdir)
dist-hook: gtk+.spec
if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \
CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \
CONFIG_HEADERS= \
$(SHELL) config.status \
&& cp INSTALL README $(distdir) ; \
fi \
&& cp gtk+.spec $(distdir)
m4datadir = $(datadir)/aclocal
m4data_DATA = gtk.m4

111
NEWS
View File

@@ -1,3 +1,114 @@
Overview of Changes in GTK+ 1.2.8:
* GNU Make 3.79 bug workaround
* FAQ and tutorial updates and improvements
* Miscellaneous bug fixes: CList, Calendar, rc-files, FontSelection
Overview of Changes in GTK+ 1.2.7:
* More header cleanups.
* Fixed activation bug for insensitive widgets.
* Locale fixes to RC file parsing code.
* Miscellaneous bugfixes for Item Factory, CList, CTree, X Selections,
HScale, VScale, Pixmap, Viewport, OptionMenu, Entry and Notebook.
* Upgrade to libtool 1.3.4.
Overview of Changes in GTK+ 1.2.6:
* container queue_resize fixes
* gtk[vh]scale: minor fixups
* rename idle to idle_id in testgtk to avoid conflicts with
broken libs
* More consistant naming of gtkrc files
* Added language support: ro, uk
Overview of Changes in GTK+ 1.2.5:
* more GtkCTree and GtkWindow bug fixes.
* more redraw/resize queue fixes, better expose event
discarding code.
* more miscellaneous bugs fixed
* new configure.in option --disable-rebuilds to completely disable
rebuilds of autogenerated sources.
* check for 5.002 now, to avoid failing autogeneration build rules due
to old perl versions.
* fonts (and fontsets) are cached now.
* more autogeneration make rules and dependancy fixups, we should be
save with autogeneration up to make -j12 now ;)
* new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the
GtkWindow on every size change.
* major rework of window manager hints handling code, fixed a bunch of
races with the new resizing code.
* the new wm hints and resizing code is absolutely perfect and bug free now,
it only lacks testing ;)
* fixed up various rc style memory prolems.
* gtk_widget_modify_style() now properly changes the style of realized widgets
and references the style passed into it. if people worked around this bug,
this will introduce a slight memory leak in their code.
The code should typically look like:
GtkRcStyle *rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* fix problems with positioning menus offscreen.
* GtkText fixes for some crashes and drawing errors.
* Better handling for unexpected window destroys in GDK and GTK+.
This should make it possible to use a GtkPlug and catch the
case where its parent socket is randomly killed.
* FAQ updates.
* FileSelection i18n patches, RadioButton fixups.
* many translation improvements.
* miscellaneous other bugs fixed.
Overview of Changes in GTK+ 1.2.4:
* DnD improvements (drags can be canceled with Esc now).
* suppressed configure event reordering in Gdk.
* rewrite of Gtk's configure event handling.
* major improvements for the object argument system (Elena Devdariani).
* major bugfixes for threading, GtkNotebook, GtkItemFactory, GtkCList and
GtkCTree.
* tutorial/FAQ updates, new file generation.txt on autogenerated sources.
* configure's --with-glib= is "officially" unsupported.
* upgrade to libtool 1.3.3.
* various buglets fixed.
Overview of Changes in GTK+ 1.2.3:
* Upgrade to libtool 1.3
* Check for dgettext (for systems with old versions of GNU Gettext)
* Many bug fixes (see ChangeLog for details)
Overview of Changes in GTK+ 1.2.2:
* Improved Dnd behaviour with Motif applications.
* Bug fixes for the Gtk selection code.
* Minor bug fixes to the Gdk Atom cache and Dnd code (with --display option).
* Bug fixes and leak plugs for the Gdk IM code.
* Added gtk_object_get() facility to retrive object arguments easily.
The var args list expects ("arg-name", &value) pairs.
* Fixed mapping for GdkInputCondition<->GIOCondition, this should fix
problems where closed pipes were no longer signalling GDK_INPUT_READ on
systems with a native poll().
* Some cleanups to GtkLabel's memory allocation code (shouldn't leak memory
anymore).
* We don't attempt to lookup xpm color "None" anymore, this should prevent
eXodus (commercial X windows server) from popping up a color dialog every
time a transparent pixmap is created.
* Fixed bug where Gtk timout/idle handlers would execute without the global
Gdk lock being held.
* Other minor bug fixes.
Overview of Changes in GTK+ 1.2.1:
* Many Bug fixes have been applied to the menu and accelerator code.
* GtkItemFactory can "adopt" foreign menu items now and manage their
accelerator installation. This is often required to get GtkItemFactory
like accelerator propagation between different windows with the same
menu heirarchy and for centralized parsing and saving of accelerators.
* GtkCList/GtkCTree buttons should always display correctly now.
* Miscellaneous other bug fixes.
What's New in GTK+ 1.2.0 (since 1.0.x):
* New widgets: GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree,

8
README
View File

@@ -1,7 +1,7 @@
General Information
===================
This is GTK+ version 1.2.0. GTK+, which stands for the Gimp ToolKit,
This is GTK+ version 1.2.8. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
@@ -37,9 +37,9 @@ version number. This should be separated by a blank
line from the actual headers.
Package: gtk+
Version: 1.2.0
Version: 1.2.8
[ Please substitute 1.2.0 with the version of GTK+ that
[ Please substitute 1.2.8 with the version of GTK+ that
you have installed ]
Then describe the bug. Include:
@@ -82,7 +82,7 @@ From: yourname@your.address.org
Subject: handlebox test in testgtk is misnamed.
Package: gtk+
Version: 1.2.0
Version: 1.2.8
When I run gtk/testgtk, the button "handle box"
is misnamed. There are multiple handle boxes in

101
README.in Normal file
View File

@@ -0,0 +1,101 @@
General Information
===================
This is GTK+ version @GTK_VERSION@. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
The official ftp site is:
ftp://ftp.gtk.org/pub/gtk
The official web site is:
http://www.gtk.org/
A mailing list is located at:
gtk-list@redhat.com
To subscribe: mail -s subscribe gtk-list-request@redhat.com < /dev/null
(Send mail to gtk-list-request@redhat.com with the subject "subscribe")
Installation
============
See the file 'INSTALL'
How to report bugs
==================
Bugs should be reported to the GNOME bug tracking
system. (http://bugs.gnome.org). To report a problem
about GTK+, send mail to submit@bugs.gnome.org.
The subject of the mail should describe your problem.
In the body of the mail, you should first include
a "pseudo-header" that gives the package and
version number. This should be separated by a blank
line from the actual headers.
Package: gtk+
Version: @GTK_VERSION@
[ Please substitute @GTK_VERSION@ with the version of GTK+ that
you have installed ]
Then describe the bug. Include:
* Information about your system. For instance:
- What operating system and version
- What version of X
- For Linux, what version of the C library
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with the testgtk program that is built
in the gtk/ subdirectory, that will be most convenient. Otherwise,
please include a short test program that exhibits the behavior.
As a last resort, you can also provide a pointer to a larger piece
of software that can be downloaded.
(Bugs that can be reproduced within the GIMP are almost as good
as bugs that can be reproduced in testgtk. If you are reporting a
bug found with the GIMP, please include the version number of the GIMP
you are using)
* If the bug was a crash, the exact text that was printed out
when the crash occured.
* Further information such as stack traces may be useful, but
is not necessary. If you do send a stack trace, and the error
is an X error, it will be more useful if the stacktrace
is produced running the test program with the --sync command
line option.
An example of a bug report:
====
To: submit@bugs.gnome.org
From: yourname@your.address.org
Subject: handlebox test in testgtk is misnamed.
Package: gtk+
Version: @GTK_VERSION@
When I run gtk/testgtk, the button "handle box"
is misnamed. There are multiple handle boxes in
the demo, so it should be "handle boxes", to
be like "buttons" or "check buttons".
===
Patches
=======
Patches can be uploaded to the incoming/ directory on
ftp.gtk.org. Please follow the instructions there, and include
your name and email address in the README file.
If the patch fixes a bug, it is usually a good idea to include
all the information described in "How to Report Bugs".

18
TODO
View File

@@ -12,21 +12,14 @@ Outstanding items:
* Make all widget attributes configurable after the widget is created (timj).
* Radio buttons need to display CAN/HAS_DEFAULT correctly, if draw_inidicator
is TRUE.
is TRUE. (Radio buttons do not need to CAN_DEFAULT! OWT)
* gdk_expose_compress: ala-Xt, this would really help for opaque moves and
such
* More dialogs: Print, GtkFontSelector, maybe others...
* More dialogs: Print, maybe others...
* make the gtk_main callbacks consistent in their add/remove behaviour.
* Check return values on all calls to XIC[Get/Set]Values
* Rewrite the interface to the i18n stuff so GTK widgets don't need to
retrieve X values, and so they don't have to know the value of the
XNxxx character constants.
* The "--geometry" option should be supported
- Having gdk_init() parse the geometry option. (putting it into
@@ -70,6 +63,11 @@ Outstanding items:
cause confusing presses to be sent to containers that actually
want to get events on themselves.
* The menu code should skip separators during keyboard navigation,
whether they are sensitive or insensitive.
* OwnerButtonPressGrab needs to go!
Text/Edit widget:
Bugs:
@@ -187,7 +185,7 @@ DND
- Use a cursor instead of an ICON when over Motif windows,
to get rid of the current junk that Motif leaves because
of it's XCopyArea stupidity for doing highlighting.
of its XCopyArea stupidity for doing highlighting.
- Add a GTK_DRAG_VERIFY target flag and a "drag_data_verify"
signal so that apps can easily check if a, say,

View File

@@ -29,8 +29,6 @@
#undef HAVE_SYS_SELECT_H
#undef HAVE_XCONVERTCASE
#undef WITH_SYMBOL_UNDERSCORE
#undef NO_FD_SET
#undef RESOURCE_BASE

View File

@@ -1,6 +1,6 @@
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1998 Free Software Foundation, Inc.
## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## 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
@@ -21,35 +21,75 @@
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 29 AM_PROG_LIBTOOL
AC_DEFUN(AM_PROG_LIBTOOL,
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
AC_REQUIRE([AM_ENABLE_STATIC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AM_PROG_LD])dnl
AC_REQUIRE([AM_PROG_NM])dnl
AC_REQUIRE([AM_SYS_NM_PARSE])dnl
AC_REQUIRE([AM_SYS_SYMBOL_UNDERSCORE])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
AC_DEFUN(AC_LIBTOOL_SETUP,
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig.
libtool_flags=
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$host" in
case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
@@ -81,46 +121,31 @@ case "$host" in
fi
;;
*-*-cygwin32*)
AM_SYS_LIBTOOL_CYGWIN32
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
])
esac
# enable the --disable-libtool-lock switch
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock force libtool not to do file locking],
need_locks=$enableval,
need_locks=yes)
if test x"$need_locks" = xno; then
libtool_flags="$libtool_flags --disable-lock"
fi
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
DLLTOOL="$DLLTOOL" AS="$AS" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
# AM_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AM_ENABLE_SHARED[(DEFAULT)]
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AM_ENABLE_SHARED,
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_DEFUN(AC_ENABLE_SHARED, [dnl
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -138,26 +163,22 @@ no) enable_shared=no ;;
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AM_DISABLE_SHARED,
[AM_ENABLE_SHARED(no)])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AM_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AM_DISABLE_STATIC,
[AM_ENABLE_STATIC(no)])
# AM_ENABLE_STATIC - implement the --enable-static flag
# Usage: AM_ENABLE_STATIC[(DEFAULT)]
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AM_ENABLE_STATIC,
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_DEFUN(AC_ENABLE_STATIC, [dnl
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -175,12 +196,49 @@ no) enable_static=no ;;
IFS="$ac_save_ifs"
;;
esac],
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AM_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AM_PROG_LD,
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
@@ -195,47 +253,15 @@ if test "$ac_cv_prog_gcc" = yes; then
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
/* | [A-Za-z]:/*)
# Canonicalize the path of ld
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
changequote([,])dnl
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
case "$host_os" in
cygwin*)
# Convert to a UNC path for cygwin
test -z "$LD" && LD=`echo X$ac_prog | sed -e "1s/^X//" -e "$sub_uncdrive"`
;;
*)
test -z "$LD" && LD="$ac_prog"
;;
esac
;;
##
## FIXME: The code fails later on if we try to use an $LD with
## '\\' path separators.
##
changequote(,)dnl
[A-Za-z]:[\\]*)
# Canonicalize the path of ld
re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
changequote([,])dnl
sub_uncdir='s%\\%/%g'
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
case "$host_os" in
cygwin*)
# Convert to a UNC path for cygwin
test -z "$LD" && LD=`echo X$ac_prog | sed -e 's%^X%%' -e "$sub_uncdrive" -e "$sub_uncdir"`
;;
*)
test -z "$LD" && LD="$ac_prog"
;;
esac
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
@@ -253,10 +279,10 @@ else
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog"; then
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
@@ -264,7 +290,7 @@ AC_CACHE_VAL(ac_cv_path_LD,
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -279,11 +305,10 @@ else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
AM_PROG_LD_GNU
AC_PROG_LD_GNU
])
AC_DEFUN(AM_PROG_LD_GNU,
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -293,29 +318,31 @@ else
fi])
])
# AM_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AM_PROG_NM,
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm; then
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
ac_cv_path_NM="$ac_dir/nm -B"
break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
ac_cv_path_NM="$ac_dir/nm -p"
break
else
ac_cv_path_NM="$ac_dir/nm"
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
break
fi
done
IFS="$ac_save_ifs"
@@ -323,224 +350,84 @@ else
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
# AM_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
# by C symbol name from nm.
AC_DEFUN(AM_SYS_NM_PARSE,
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AM_PROG_NM])dnl
# Check for command to grab the raw symbol name followed by C symbol from nm.
AC_MSG_CHECKING([command to parse $NM output])
AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
[# These are sane defaults that work on at least a few old systems.
# {They come from Ultrix. What could be older than Ultrix?!! ;)}
changequote(,)dnl
# Character class describing NM global symbol codes.
ac_symcode='[BCDEGRSTU]'
# Regexp to match symbols that can be accessed directly from C.
ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
# Transform the above into a raw symbol and a C symbol.
ac_symxfrm='\1 \1'
# Define system-specific variables.
case "$host_os" in
aix*)
ac_symcode='[BCDTU]'
LIBM=
case "$lt_target" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
sunos* | cygwin32* | mingw32*)
ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
ac_symxfrm='_\1 \1'
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
irix*)
# Cannot use undefined symbols on IRIX because inlined functions mess us up.
ac_symcode='[BCDEGRST]'
;;
solaris*)
ac_symcode='[BDTU]'
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# If we're using GNU nm, then use its standard symbol codes.
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
ac_symcode='[ABCDGISTUW]'
fi
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
case "$host_os" in
cygwin32* | mingw32*)
# We do not want undefined symbols on cygwin32. The user must
# arrange to define them via -l arguments.
ac_symcode='[ABCDGISTW]'
;;
esac
changequote([,])dnl
# Write the raw and C identifiers.
ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* $ac_symcode $ac_sympat$/$ac_symxfrm/p'"
# Check to see that the pipe works correctly.
ac_pipe_works=no
cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func;return 0;}
EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
ac_nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
# Try sorting and uniquifying the output.
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
mv -f "$ac_nlist"T "$ac_nlist"
ac_wcout=`wc "$ac_nlist" 2>/dev/null`
changequote(,)dnl
ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
changequote([,])dnl
(test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
else
rm -f "$ac_nlist"T
ac_count=-1
fi
# Make sure that we snagged all the symbols we need.
if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
cat <<EOF > conftest.c
#ifdef __cplusplus
extern "C" {
#endif
EOF
# Now generate the symbol file.
sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
cat <<EOF >> conftest.c
#if defined (__STDC__) && __STDC__
# define __ptr_t void *
#else
# define __ptr_t char *
#endif
/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
int dld_preloaded_symbol_count = $ac_count;
/* The mapping between symbol names and symbols. */
struct {
char *name;
__ptr_t address;
}
changequote(,)dnl
dld_preloaded_symbols[] =
changequote([,])dnl
{
EOF
sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
cat <<\EOF >> conftest.c
{0, (__ptr_t) 0}
};
#ifdef __cplusplus
}
#endif
EOF
# Now try linking the two files.
mv conftest.$ac_objext conftestm.$ac_objext
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="conftestm.$ac_objext"
CFLAGS="$CFLAGS$no_builtin_flag"
if AC_TRY_EVAL(ac_link) && test -s conftest; then
ac_pipe_works=yes
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.c >&AC_FD_CC
fi
LIBS="$ac_save_LIBS"
CFLAGS="$ac_save_CFLAGS"
else
echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
fi
else
echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
fi
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
INCLTDL=
fi
else
echo "$progname: failed program was:" >&AC_FD_CC
cat conftest.c >&AC_FD_CC
fi
rm -rf conftest*
# Do not use the global_symbol_pipe unless it works.
test "$ac_pipe_works" = yes || ac_cv_sys_global_symbol_pipe=
])
ac_result=yes
if test -z "$ac_cv_sys_global_symbol_pipe"; then
ac_result=no
fi
AC_MSG_RESULT($ac_result)
])
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
# AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
])
# AM_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
# with an underscore?
AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE,
[AC_REQUIRE([AM_PROG_NM])dnl
AC_REQUIRE([AM_SYS_NM_PARSE])dnl
AC_MSG_CHECKING([for _ prefix in compiled symbols])
AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
[ac_cv_sys_symbol_underscore=no
cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
ac_nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
else
if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then
:
else
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
fi
fi
else
echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
fi
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.c >&AC_FD_CC
fi
rm -rf conftest*
])
AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
if test x$ac_cv_sys_symbol_underscore = xyes; then
AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1,
[define if compiled symbols have a leading underscore])
fi
])
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
@@ -589,22 +476,26 @@ AC_DEFUN(AM_GTK_WITH_NLS,
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
[AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
if test "$gt_cv_func_dgettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_CHECK_LIB(intl, gettext,
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)],
gt_cv_func_gettext_libintl=no)])
[AC_CACHE_CHECK([for dgettext in libintl],
gt_cv_func_dgettext_libintl,
[AC_CHECK_LIB(intl, dgettext,
gt_cv_func_dgettext_libintl=yes,
gt_cv_func_dgettext_libintl=no)],
gt_cv_func_dgettext_libintl=no)])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
LIBS="$LIBS -lintl";
fi
if test "$gt_cv_func_dgettext_libc" = "yes" \
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
@@ -624,8 +515,8 @@ AC_DEFUN(AM_GTK_WITH_NLS,
fi
# Added by Martin Baulig 12/15/98 for libc5 systems
if test "$gt_cv_func_gettext_libc" != "yes" \
&& test "$gt_cv_func_gettext_libintl" = "yes"; then
if test "$gt_cv_func_dgettext_libc" != "yes" \
&& test "$gt_cv_func_dgettext_libintl" = "yes"; then
INTLLIBS=-lintl
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
fi

View File

@@ -20,14 +20,6 @@ DIE=0
DIE=1
}
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have libtool installed to compile $PROJECT."
echo "Get ftp://alpha.gnu.org/gnu/libtool-1.2b.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile $PROJECT."
@@ -88,7 +80,7 @@ automake -a $am_opt
autoconf
cd $ORIGDIR
$srcdir/configure "$@"
$srcdir/configure --enable-maintainer-mode "$@"
echo
echo "Now type 'make' to compile $PROJECT."

358
config.guess vendored
View File

@@ -1,6 +1,7 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -23,6 +24,7 @@
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
# Please send patches to <autoconf-patches@gnu.org>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -35,6 +37,20 @@
# (but try to keep the structure clean).
#
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
fi
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -46,7 +62,8 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
@@ -59,7 +76,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >dummy.s
cat <<EOF >$dummy.s
.globl main
.ent main
main:
@@ -76,9 +93,9 @@ main:
ret \$31,(\$26),1
.end main
EOF
${CC-cc} dummy.s -o dummy 2>/dev/null
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
@@ -97,8 +114,14 @@ EOF
;;
esac
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
@@ -133,6 +156,9 @@ EOF
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
@@ -142,7 +168,7 @@ EOF
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
@@ -150,7 +176,7 @@ EOF
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE:*:*:dcosx)
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4H:SunOS:5.*:*)
@@ -201,6 +227,32 @@ EOF
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit 0 ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit 0 ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
@@ -234,12 +286,16 @@ EOF
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:*)
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -254,10 +310,10 @@ EOF
exit (-1);
}
EOF
${CC-cc} dummy.c -o dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
@@ -275,15 +331,18 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
@@ -309,7 +368,7 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
main()
@@ -320,8 +379,8 @@ EOF
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -368,25 +427,25 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
sed 's/^ //' << EOF >dummy.c
9000/[678][0-9][0-9])
sed 's/^ //' << EOF >$dummy.c
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
@@ -394,20 +453,20 @@ EOF
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
rm -f dummy.c dummy
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
rm -f $dummy.c $dummy
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
main ()
@@ -432,8 +491,8 @@ EOF
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -442,6 +501,9 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
@@ -458,6 +520,9 @@ EOF
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
hppa*:OpenBSD:*:*)
echo hppa-unknown-openbsd
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
@@ -490,11 +555,14 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*T3E:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
@@ -507,29 +575,47 @@ EOF
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
if test -x /usr/bin/objformat; then
if test "elf" = "`/usr/bin/objformat`"; then
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0
fi
fi
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin32
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
echo powerpcle-unknown-cygwin
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -538,15 +624,11 @@ EOF
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# uname on the ARM produces all sorts of strangeness, and we need to
# filter it out.
case "$UNAME_MACHINE" in
arm* | sa110*) UNAME_MACHINE="arm" ;;
esac
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
@@ -554,16 +636,74 @@ EOF
s/ .*//
p'`
case "$ld_supported_emulations" in
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
*ia64)
echo "${UNAME_MACHINE}-unknown-linux"
exit 0
;;
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32ppc)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
extern char __libc_release[];
#endif
main(argc, argv)
int argc;
char *argv[];
{
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unkown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0
;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >dummy.s
sed 's/^ //' <<EOF >$dummy.s
.globl main
.ent main
main:
@@ -581,9 +721,9 @@ EOF
.end main
EOF
LIBC=""
${CC-cc} dummy.s -o dummy 2>/dev/null
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
@@ -600,22 +740,23 @@ EOF
16)
UNAME_MACHINE="alphaev6"
;;
esac
esac
objdump --private-headers dummy | \
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f dummy.s dummy
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
cat >$dummy.c <<EOF
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
@@ -625,8 +766,8 @@ main(argc, argv)
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
@@ -645,12 +786,13 @@ EOF
;;
esac
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
cat >$dummy.c <<EOF
#include <features.h>
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
@@ -667,8 +809,8 @@ main(argc, argv)
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
@@ -684,10 +826,20 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
i?86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:3.2:*)
@@ -699,18 +851,15 @@ EOF
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i?86:UnixWare:*:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
fi
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
exit 0 ;;
pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
@@ -752,7 +901,7 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:*)
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
@@ -764,6 +913,9 @@ EOF
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
@@ -794,7 +946,7 @@ EOF
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
@@ -810,12 +962,27 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-qnx-qnx${UNAME_VERSION}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
@@ -853,7 +1020,10 @@ main ()
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
@@ -913,8 +1083,8 @@ main ()
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.

335
config.sub vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -98,11 +98,21 @@ case $os in
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=sco3.2v5
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
@@ -121,6 +131,9 @@ case $os in
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -143,22 +156,33 @@ case $os in
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el \
| sparc | sparclet | sparclite | sparc64 | v850)
| 580 | i960 | h8300 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -171,27 +195,45 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mipstx39-* | mipstx39el-* \
| f301-*)
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
@@ -221,6 +263,10 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -297,6 +343,10 @@ case $basic_machine in
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
@@ -315,6 +365,14 @@ case $basic_machine in
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
@@ -330,13 +388,30 @@ case $basic_machine in
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -345,9 +420,16 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32)
@@ -366,6 +448,25 @@ case $basic_machine in
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
i386-qnx | qnx)
basic_machine=i386-qnx
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -394,6 +495,10 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
@@ -408,10 +513,30 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
msdos)
basic_machine=i386-unknown
os=-msdos
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
@@ -424,6 +549,10 @@ case $basic_machine in
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
@@ -449,9 +578,25 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
np1)
basic_machine=np1-gould
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -469,19 +614,19 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | nexen)
pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc
;;
pentiumpro | p6 | k6 | 6x86)
pentiumpro | p6 | 6x86)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | nexen-*)
pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | k6-* | 6x86-*)
pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
@@ -505,12 +650,20 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sequent)
basic_machine=i386-sequent
;;
@@ -518,6 +671,10 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
@@ -525,6 +682,13 @@ case $basic_machine in
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
@@ -569,6 +733,10 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=t3e-cray
os=-unicos
;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -586,6 +754,10 @@ case $basic_machine in
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
@@ -609,6 +781,14 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xmp)
basic_machine=xmp-cray
os=-unicos
@@ -616,6 +796,10 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
@@ -623,6 +807,15 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
@@ -645,7 +838,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sparc)
sparc | sparcv9)
basic_machine=sparc-sun
;;
cydra)
@@ -657,6 +850,16 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -710,13 +913,21 @@ case $os in
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos*)
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -726,6 +937,9 @@ case $os in
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-osfrose*)
os=-osfrose
;;
@@ -741,6 +955,9 @@ case $os in
-acis*)
os=-aos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
@@ -760,6 +977,9 @@ case $os in
-oss*)
os=-sysv3
;;
-qnx)
os=-qnx4
;;
-svr4)
os=-sysv4
;;
@@ -772,9 +992,18 @@ case $os in
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -*MiNT)
os=-mint
;;
-none)
;;
*)
@@ -800,6 +1029,9 @@ case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
@@ -821,6 +1053,15 @@ case $basic_machine in
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -833,6 +1074,15 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
@@ -896,6 +1146,18 @@ case $basic_machine in
f301-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
@@ -917,9 +1179,15 @@ case $basic_machine in
-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
@@ -935,7 +1203,7 @@ case $basic_machine in
-genix*)
vendor=ns
;;
-mvs*)
-mvs* | -opened*)
vendor=ibm
;;
-ptx*)
@@ -947,6 +1215,15 @@ case $basic_machine in
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -*MiNT)
vendor=atari
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;

View File

@@ -15,7 +15,7 @@ AC_INIT(gdk/gdktypes.h)
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
dnl we to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
dnl are available for $ac_help expansion (don't we all *love* autoconf?)
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
#
@@ -29,9 +29,9 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
#
GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=2
GTK_MICRO_VERSION=0
GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0
GTK_MICRO_VERSION=8
GTK_INTERFACE_AGE=3
GTK_BINARY_AGE=8
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
dnl
AC_DIVERT_POP()dnl
@@ -95,6 +95,7 @@ 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],
, enable_xim_inst="maybe")
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
@@ -143,6 +144,9 @@ if test "x$GCC" = "xyes"; then
fi
changequote([,])dnl
# Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
# define a MAINT-like variable REBUILD which is set if Perl
# and awk are found, so autogenerated sources can be rebuilt
@@ -153,20 +157,35 @@ AC_CHECK_PROGS(PERL, perl5 perl)
AC_CHECK_PROG(INDENT, indent, indent)
REBUILD=\#
if test -n "$PERL" && perl -v | grep 'version 5.' > /dev/null ; then
if test -n "$AWK" ; then
REBUILD=
fi
if test "x$enable_rebuilds" = "xyes" && \
test -n "$PERL" && \
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
test -n "$AWK" ; then
REBUILD=
fi
AC_SUBST(REBUILD)
AC_MSG_CHECKING(whether make is GNU Make)
STRIP_BEGIN=
STRIP_END=
if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
STRIP_END=')'
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
dnl some Make 3.79 $(strip ) versions are broken and require an empty arg
STRIP_DUMMY=
AC_SUBST(STRIP_DUMMY)
AC_SUBST(STRIP_BEGIN)
AC_SUBST(STRIP_END)
# i18n stuff
ALL_LINGUAS="cs de es fr hu it ja ko nl no pl pt ru sv"
ALL_LINGUAS="ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no nn pl pt pt_BR ro ru sk sl sv uk wa zh_TW.Big5"
AM_GTK_GNU_GETTEXT
AC_CHECK_FUNC(gettext,
,
AC_CHECK_LIB(intl, gettext)
)
LIBS="$LIBS $INTLLIBS"
# AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
gtklocaledir='${prefix}/${DATADIRNAME}/locale'
@@ -189,8 +208,10 @@ AC_TRY_RUN([#include <math.h>
AC_MSG_RESULT()
CFLAGS=$gtk_save_CFLAGS
AC_MSG_WARN(
[No ANSI prototypes found in library. (-std1 didn't work.)])
)
[No ANSI prototypes found in library. (-std1 didn't work.)]),
true
),
AC_MSG_RESULT(none needed)
)
LIBS=$gtk_save_LIBS
@@ -214,9 +235,9 @@ fi
if test x$with_glib = x ; then
# Look for separately installed glib
AM_PATH_GLIB(1.2.0,,
AM_PATH_GLIB(1.2.8,,
AC_MSG_ERROR([
*** GLIB 1.2.0 or better is required. The latest version of GLIB
*** GLIB 1.2.8 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org/.]),
gmodule gthread)
@@ -256,7 +277,7 @@ else
esac
GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule.la"
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgmodule.la"
GLIB_DEPLIBS=
AC_SUBST(GLIB_CFLAGS)
@@ -412,11 +433,12 @@ main ()
return setlocale (LC_ALL, "${with_locale}") == NULL;
}],
need_x_locale=no,
need_x_locale=yes)
need_x_locale=yes,
need_x_locale=no)
AC_MSG_RESULT($need_x_locale)
if test $need_x_locale = yes; then
GTK_LOCALE_CFLAGS="-DX_LOCALE"
GTK_LOCALE_FLAGS="-DX_LOCALE"
fi
# Checks for header files.
@@ -448,28 +470,18 @@ fi
# Duplicate `widechar' tests from `glib'.
# Check for wchar.h
if test x = y; then
# will not be executed
# hack so as not to update `acconfig.h'
AC_CHECK_HEADERS(wchar.h wctype.h)
AC_CHECK_FUNCS(broken_wctype)
fi
AC_MSG_CHECKING(for wchar.h)
AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
ac_kludge=HAVE_WCHAR_H
AC_DEFINE($ac_kludge)
AC_DEFINE(HAVE_WCHAR_H,1,[Define if wchar.h exists])
fi
AC_MSG_RESULT($gtk_ok)
# Check for wctype.h (for iswalnum)
AC_MSG_CHECKING(for wctype.h)
AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
ac_kludge=HAVE_WCTYPE_H
AC_DEFINE($ac_kludge)
AC_DEFINE(HAVE_WCTYPE_H,1,[Define if wctype.h exists])
fi
AC_MSG_RESULT($gtk_ok)
@@ -498,8 +510,7 @@ iswalnum((wchar_t) 0);
LIBS="$oLIBS"
if test $gtk_ok = no; then
ac_kludge=HAVE_BROKEN_WCTYPE
AC_DEFINE($ac_kludge)
AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Define if the wctype function is broken])
GDK_WLIBS=
fi
AC_MSG_RESULT($gtk_ok)
@@ -511,6 +522,7 @@ AC_SUBST(GTK_LOCALE_FLAGS)
AC_OUTPUT([
gtk+.spec
docs/gtk-config.1
Makefile
gtk-config
po/Makefile.in

View File

@@ -18,3 +18,4 @@ Makefile.in
*.vrs
html
text
gtk-config.1

View File

@@ -101,36 +101,7 @@ FAQ_FILES=html/gtkfaq.html \
html/gtkfaq-7.html \
text/gtkfaq.txt
EXTRA_DIST = \
gtk-config.1 \
texinfo.tex \
macros.texi \
gtkdocs_fix \
gtkfaq.sgml \
gtk-config.txt \
gtk_tut.sgml \
gtk_tut_it.sgml \
gtk_tut_fr.sgml \
debugging.txt \
developers.txt \
refcounting.txt \
styles.txt \
text_widget.txt \
widget_system.txt \
gtk_tut_packbox1.gif \
gtk_tut_packbox2.gif \
html/gtk_tut_table.gif \
html/gtk_tut_packbox1.gif \
html/gtk_tut_packbox2.gif \
gtk_tut_table.gif \
html/gdk.html \
html/gdk_toc.html \
html/gtk.html \
html/gtk_toc.html \
$(TUTORIAL_FILES) \
$(TUTORIAL_FR_FILES) \
$(TUTORIAL_IT_FILES) \
$(FAQ_FILES)
html/gtk_tut_table.gif: gdk.html gtk.html
.PHONY: html htmldir faq tutorial tutorial_it tutorial_fr files
@@ -195,3 +166,36 @@ files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
EXTRA_DIST += \
Changes-1.2.txt \
debugging.txt \
developers.txt \
refcounting.txt \
styles.txt \
text_widget.txt \
widget_system.txt \
generation.txt \
gtk-config.txt \
gtk-config.1.in \
texinfo.tex \
macros.texi \
gtkdocs_fix \
gtkfaq.sgml \
gtk_tut.sgml \
gtk_tut_it.sgml \
gtk_tut_fr.sgml \
gtk_tut_packbox1.gif \
gtk_tut_packbox2.gif \
html/gtk_tut_table.gif \
html/gtk_tut_packbox1.gif \
html/gtk_tut_packbox2.gif \
gtk_tut_table.gif \
html/gdk.html \
html/gdk_toc.html \
html/gtk.html \
html/gtk_toc.html \
$(TUTORIAL_FILES) \
$(TUTORIAL_FR_FILES) \
$(TUTORIAL_IT_FILES) \
$(FAQ_FILES)

File diff suppressed because it is too large Load Diff

177
docs/generation.txt Normal file
View File

@@ -0,0 +1,177 @@
Overview:
========
This file describes the way that autogeneration
works within the GTK+ source code.
The following files in the gdk/ subdirectory
are autogenerated:
gdkkeysyms.h
gdkcursors.h
The following files in the gtk/ subdirectory
are autogenerated:
gtk.defs
Description of GTK+ types (and some functions) in a lisp-style
format.
gtktypebuiltins.h
Header file including declarations for internal types
gtktypebuiltins_vars.c
Variables for type values for internal types.
gtktypebuiltins_ids.c
Arrays holding information about each internal type.
gtktypebuiltins_evals.c
Arrays holding mapping between enumeration values
and strings.
gtkmarshal.c
gtkmarshal.h
Autogenerated signal marshallers
GDK
===
gdkkeysyms.h and gdkcursors.h are generated from
the corresponding header files
X11/cursorfont.h
X11/keysymdef.h
by some simple sed scripts. These are not actually
run automatically because we want all the keysyms
even on systems with a limited set.
So the Gdk rule to generate both files (X-derived-headers)
only needs to be rerun for every new release of the X Window
System.
GTK+ - type definitions
=======================
The type definitions are generated from several sources:
gtk-boxed.defs - definitions for boxed types
GTK+ header files
GDK header files
The makeenums.pl script does a heuristic parse of
the header files and extracts all enumerations declarations.
It also recognizes a number of pseudo-comments in the
header files:
Two of these apply to individual enumeration values:
/*< skip >*/
This enumeration value should be skipped.
/*< nick=NICK >*/
The nickname for this value should NICK instead of the
normally guessed value. For instance:
typedef enum {
GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/
} GtkTargetFlags;
makes the nicks "same-app" and "same-widget", instead of
"app" and "widget" that would normally be used.
The other two apply to entire enumeration declarations.
/*< prefix=PREFIX >*/
Specifies the prefix to be removed from the enumeration
values to generate nicknames.
/*< flags >*/
Specifies that this enumeration is used as a bitfield.
(makenums.pl normally guesses this from the presence of values
with << operators). For instance:
typedef enum /*< flags >*/
{
GDK_IM_PREEDIT_AREA = 0x0001,
GDK_IM_PREEDIT_CALLBACKS = 0x0002,
[ ... ]
} GdkIMStyle;
makeenums.pl can be run into two modes:
1) Generate the gtktypebuiltins_eval.c file (this
contains arrays holding the mapping of
string <=> enumeration value)
2) Generate the enumeration portion of gtk.defs.
The enumearation portion is added to the boxed type
declarations in gtk-boxed.defs to create gtk.defs.
The makeetypes.awk program takes the gtk.defs file, and
from that generates various files depending on the
third parameter passed to it:
macros: gtktypebuiltins.h
variables: gtktypebuiltins_vars.c
entries: gtktypebuiltins_ids.c
GTK+ - marshallers
==================
The files gtkmarshal.c and gtkmarshal.h include declarations
and definitions for the marshallers needed inside of
GTK+. The marshallers to be generated are listed in
the file gtkmashal.list, which is processed
by genmarshal.pl.
The format of this file is a list of lines:
<retval-type>:<arg1-type>,<arg2-type>,<arg3-type>
e.g.:
BOOL:POINTER,STRING,STRING,POINTER
A marshaller is generated for each line in the file.
The possible types are:
NONE
BOOL
CHAR
INT
UINT
LONG
ULONG
FLOAT
DOUBLE
STRING
ENUM
FLAGS
BOXED
POINTER
OBJECT
FOREIGN (gpointer data, GtkDestroyNotify notify)
C_CALLBACK (GtkFunction func, gpointer func_data)
SIGNAL (GtkSignalFunc f, gpointer data)
ARGS (gint n_args, GtkArg *args)
CALLBACK (GtkCallBackMarshal marshall,
gpointer data,
GtkDestroyNotify Notify)
Some of these types map to multiple return values - these
are marked above with the return types in parantheses.
NOTES
=====
When autogenerating GTK+ files, the autogenerated
files are often rebuild resulting in the same result.
To prevent unecessary rebuilds of the entire directory, some files
that multiple other source files depend on are not actually written
to directly. Instead, an intermediate file is written, which
is then compared to the old file, and only if it is different
is it copied into the final location.

View File

@@ -1,4 +1,4 @@
.TH GTK+ 1 "25 October 1998" Version 1.2.0
.TH GTK+ 1 "25 October 1998" Version @VERSION@
.SH NAME
gtk-config - script to get information about the installed version of GTK+
.SH SYNOPSIS

View File

@@ -79,7 +79,7 @@ approved by Peter Mattis.
This is edition @value{edition} of the GTK documentation,
@w{@value{update-date}}.
@end ifinfo
@c FIXME: Do a introduction to the GTK?
@c FIXME: Do an introduction to the GTK?
@menu
* Copying:: Your rights.
@@ -288,7 +288,7 @@ form that is easier to parse. Tools for generating bindings of Gtk to
other languages can read these declarations and---because all the
important details are defined---automatically generate the bulk of the
needed glue code. It is also possible to feed these declarations into a
running application (a interface builder, say) and thus make it aware of
running application (an interface builder, say) and thus make it aware of
new widgets and functions without recompiling anything.
The run-time side of the type system is also somewhat introspective.
@@ -320,7 +320,7 @@ inherit these rules from their fundamental type. For example,
derive from @samp{GtkObject} and so the rules for @samp{GtkObject} apply
to all widgets as well.
This derivation defines a type hierachy, but this hierachy is not
This derivation defines a type hierarchy, but this hierarchy is not
completely general. You can't derive from @samp{int} for example, and
you can only have one level of derivation from @samp{enum}. The
fundamental type @samp{GtkObject}, however, is the basis for the large
@@ -382,7 +382,7 @@ to a fundamental type and thus there is no name for it.
@deftp {Data type} GtkType
The type @code{GtkType} holds the run-time representation of a type. It
is a integer of a certain size. The follwing macros are defined to
is an integer of a certain size. The follwing macros are defined to
access the basic properties of a @code{GtkType}:
@deftypefn {Macro} {unsigned int} GTK_TYPE_SEQNO (GtkType type)
@@ -461,7 +461,7 @@ always return @code{NULL}.
@item
The @code{class_init_func} and @code{base_class_init_func} fields are
callbacks which are used by the type mechanism to initialize class
specific fields. The single argument these function taks is a pointer to
specific fields. The single argument these functions take is a pointer to
a class structure. When you do not need one or both of them, set the
corresponding field to @code{NULL}. The @code{class_init_func} will be
called at most once, right after the class structure of size
@@ -1109,7 +1109,7 @@ opaque.
All widget creation routines in GTK return pointers to GtkWidget
structures. In reality, all widget creation routines create structures
that can be viewed as equivalent to the GtkWidget structure, but often
have contain additional information. @xref{Object Implementation}
have contain additional information. @xref{Object Implementation}.
The widgets available for use are implemented in a hierarchy. Several
widgets exist solely as common bases for more specific widgets. For

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@ functions that follow these conventions:
GtkObjects also provide the following functions:
*_destroy: Render an object `unusable', but as long as there are
references to it, it's allocated memory will not be freed.
references to it, its allocated memory will not be freed.
*_sink: Clear a GtkObjects `floating' state and decrement the
reference count by 1.
@@ -240,7 +240,7 @@ Taking care of proper referencing
---------------------------------
There are some cases where referencing of widgets from outside the toolkit
(on the application side is needed).
(on the application side) is needed.
Once the application performes an operation on a widget that will cause
its reference count to drop, if it wants to take further actions on the
widget, it needs to hold a reference to it.
@@ -248,7 +248,7 @@ widget, it needs to hold a reference to it.
Example code sequences that require reference wraps:
/* gtk_container_remove() will unparent the child and therefore
* cause it's reference count to be decremented by one.
* cause its reference count to be decremented by one.
*/
gtk_widget_ref (widget);
gtk_container_remove (container, widget);

View File

@@ -88,13 +88,13 @@ GtkWidget::style_set
Flag indications:
!GTK_RC_STYLE && !GTK_USER_STYLE:
The widget has it's default style set, no rc lookup has been
The widget has its default style set, no rc lookup has been
performed, the widget has not been size requested yet and is
therefore not yet realized.
GTK_USER_STYLE:
GTK_RC_STYLE is not set.
The widget has a user style assigned, and it's default style has been
The widget has a user style assigned, and its default style has been
saved.
GTK_RC_STYLE:

View File

@@ -398,7 +398,7 @@ according the the tab continuation of the previous line.
Exposure and drawing:
Exposure is handled from the EXPOSE_TEXT function. It assumes that
the LINE_START_CACHE and all it's parameters are accurate and simply
the LINE_START_CACHE and all its parameters are accurate and simply
exposes any line which is in the exposure region. It calls the
CLEAR_AREA function to clear the background and/or lay down a pixmap
background. The text widget has a scrollable pixmap background, which

File diff suppressed because it is too large Load Diff

View File

@@ -27,6 +27,7 @@ SUBDIRS = arrow \
rangewidgets \
rulers \
scribble-simple \
scribble-xinput \
scrolledwin \
selection \
spinbutton \

View File

@@ -2,8 +2,8 @@
#include <gtk/gtk.h>
int
main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *aspect_frame;

View File

@@ -3,12 +3,12 @@
#include <gtk/gtk.h>
/* Create a Button Box with the specified parameters */
GtkWidget *create_bbox (gint horizontal,
char* title,
gint spacing,
gint child_w,
gint child_h,
gint layout)
GtkWidget *create_bbox( gint horizontal,
char *title,
gint spacing,
gint child_w,
gint child_h,
gint layout )
{
GtkWidget *frame;
GtkWidget *bbox;

View File

@@ -75,7 +75,6 @@ int main( int argc,
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (gtk_exit), NULL);
/* Sets the border width of the window. */
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_widget_realize(window);

View File

@@ -1,8 +1,8 @@
CC = gcc
gcalendar: gcalendar.c
$(CC) `gtk-config --cflags` gcalendar.c -o gcalendar `gtk-config --libs`
calendar: calendar.c
$(CC) `gtk-config --cflags` calendar.c -o calendar `gtk-config --libs`
clean:
rm -f gcalendar
rm -f calendar

View File

@@ -1,5 +1,7 @@
/* G Calendar
/* 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
@@ -26,84 +28,18 @@
#define TM_YEAR_BASE 1900
typedef struct _CalendarData {
GtkWidget *flag_checkboxes[5];
gboolean settings[5];
gchar *font;
GtkWidget *font_dialog;
GtkWidget *window;
GtkWidget *selected;
GtkWidget *selected_double_click;
GtkWidget *prev2_sig;
GtkWidget *prev_sig;
GtkWidget *last_sig;
GtkWidget *month;
} CalendarData;
void create_calendar();
gint delete_event(GtkWidget *widget, GdkEvent *event, gpointer data);
void destroy (GtkWidget *widget, gpointer data);
void day_selected_double_click (GtkWidget *widget, gpointer data);
int main(int argc, char *argv[]);
void calendar_month_changed (GtkWidget *widget, CalendarData *data);
void calendar_day_selected (GtkWidget *widget, CalendarData *data);
void calendar_day_selected_double_click (GtkWidget *widget, CalendarData *data);
void calendar_set_flags(CalendarData *calendar);
void calendar_toggle_flag(GtkWidget * toggle, CalendarData *calendar);
void calendar_font_selection_ok(GtkWidget * button, CalendarData *calendar);
void calendar_font_selection_destroy(GtkWidget * button, GtkWidget widget);
void calendar_select_font(GtkWidget * button, CalendarData *calendar);
void calendar_create_window_destroy(GtkWidget * ignore, CalendarData *calendar);
void calendar_create_window(GtkWidget * ignored, CalendarData * calendar);
void calendar_window_destroy(GtkWidget * ignore, CalendarData *calendar);
void create_calendar();
/*
* GtkCalendar
*/
void
calendar_month_changed (GtkWidget *widget, CalendarData *data)
{
char buffer[256];
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, 255, "%x", gmtime(&time));
gtk_label_set (GTK_LABEL (data->month), buffer);
}
void
calendar_day_selected (GtkWidget *widget, CalendarData *data)
{
char buffer[256];
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, 255, "%x", gmtime(&time));
gtk_label_set (GTK_LABEL (data->selected), buffer);
}
void
calendar_day_selected_double_click (GtkWidget *widget, CalendarData *data)
{
char buffer[256];
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, 255, "%x", gmtime(&time));
gtk_label_set (GTK_LABEL (data->selected_double_click), buffer);
}
enum {
calendar_show_header,
calendar_show_days,
@@ -112,8 +48,115 @@ enum {
calendar_monday_first
};
void
calendar_set_flags(CalendarData *calendar)
/*
* 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 (GTK_LABEL (data->prev2_sig), prev_sig);
gtk_label_get (GTK_LABEL (data->last_sig), &prev_sig);
gtk_label_set (GTK_LABEL (data->prev_sig), prev_sig);
gtk_label_set (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;
@@ -126,8 +169,8 @@ calendar_set_flags(CalendarData *calendar)
gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
}
void
calendar_toggle_flag(GtkWidget * toggle, CalendarData *calendar)
void calendar_toggle_flag( GtkWidget *toggle,
CalendarData *calendar )
{
gint i;
gint j;
@@ -140,13 +183,15 @@ calendar_toggle_flag(GtkWidget * toggle, CalendarData *calendar)
calendar_set_flags(calendar);
}
void
calendar_font_selection_ok(GtkWidget * button, CalendarData *calendar)
void calendar_font_selection_ok( GtkWidget *button,
CalendarData *calendar )
{
GtkStyle *style;
GdkFont *font;
calendar->font = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (calendar->font_dialog));
calendar->font = gtk_font_selection_dialog_get_font_name(
GTK_FONT_SELECTION_DIALOG (calendar->font_dialog));
if (calendar->window)
{
font = gtk_font_selection_dialog_get_font(GTK_FONT_SELECTION_DIALOG(calendar->font_dialog));
@@ -161,8 +206,8 @@ calendar_font_selection_ok(GtkWidget * button, CalendarData *calendar)
}
}
void
calendar_select_font(GtkWidget * button, CalendarData *calendar)
void calendar_select_font( GtkWidget *button,
CalendarData *calendar )
{
GtkWidget *window;
@@ -193,8 +238,7 @@ calendar_select_font(GtkWidget * button, CalendarData *calendar)
}
void
create_calendar()
void create_calendar()
{
GtkWidget *window;
GtkWidget *vbox, *vbox2, *vbox3;
@@ -231,6 +275,7 @@ create_calendar()
}
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example");
gtk_container_border_width (GTK_CONTAINER (window), 5);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
@@ -257,7 +302,7 @@ create_calendar()
/* Calendar widget */
frame = gtk_frame_new("Calendar");
gtk_box_pack_start(GTK_BOX(hbbox), frame, TRUE, TRUE, DEF_PAD);
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);
@@ -272,6 +317,18 @@ create_calendar()
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 ();
@@ -311,30 +368,31 @@ create_calendar()
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, 5);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Day selected:");
label = gtk_label_new ("Signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.selected = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.selected, 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, 5);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Day selected double click:");
label = gtk_label_new ("Previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.selected_double_click = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.selected_double_click, 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, 5);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, TRUE, 0);
label = gtk_label_new ("Month change:");
label = gtk_label_new ("Second previous signal:");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
calendar_data.month = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (hbox), calendar_data.month, 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);
@@ -351,12 +409,16 @@ create_calendar()
}
int
main(int argc, char *argv[])
int main(int argc,
char *argv[] )
{
gtk_set_locale ();
gtk_init (&argc, &argv);
create_calendar();
gtk_main ();
return 0;
gtk_main();
return(0);
}
/* example-end */

View File

@@ -83,7 +83,7 @@ int main( int argc,
{
GtkWidget *window;
GtkWidget *vbox, *hbox;
GtkWidget *clist;
GtkWidget *scrolled_window, *clist;
GtkWidget *button_add, *button_clear, *button_hide_show;
gchar *titles[2] = { "Ingredients", "Amount" };
@@ -103,7 +103,15 @@ int main( int argc,
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(vbox);
/* Create the GtkCList. For this example we use 2 columns */
/* Create a scrolled window to pack the CList widget into */
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
gtk_widget_show (scrolled_window);
/* Create the CList. For this example we use 2 columns */
clist = gtk_clist_new_with_titles( 2, titles);
/* When a selection is made, we want to know about it. The callback
@@ -121,8 +129,8 @@ int main( int argc,
*/
gtk_clist_set_column_width (GTK_CLIST(clist), 0, 150);
/* Add the GtkCList widget to the vertical box and show it. */
gtk_box_pack_start(GTK_BOX(vbox), clist, TRUE, TRUE, 0);
/* Add the CList widget to the vertical box and show it. */
gtk_container_add(GTK_CONTAINER(scrolled_window), clist);
gtk_widget_show(clist);
/* Create the buttons and add them to the window. See the button

View File

@@ -2,28 +2,30 @@
#include <gtk/gtk.h>
void enter_callback(GtkWidget *widget, GtkWidget *entry)
void enter_callback( GtkWidget *widget,
GtkWidget *entry )
{
gchar *entry_text;
entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
printf("Entry contents: %s\n", entry_text);
}
void entry_toggle_editable (GtkWidget *checkbutton,
GtkWidget *entry)
void entry_toggle_editable( GtkWidget *checkbutton,
GtkWidget *entry )
{
gtk_entry_set_editable(GTK_ENTRY(entry),
GTK_TOGGLE_BUTTON(checkbutton)->active);
}
void entry_toggle_visibility (GtkWidget *checkbutton,
GtkWidget *entry)
void entry_toggle_visibility( GtkWidget *checkbutton,
GtkWidget *entry )
{
gtk_entry_set_visibility(GTK_ENTRY(entry),
GTK_TOGGLE_BUTTON(checkbutton)->active);
}
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;

View File

@@ -2,8 +2,8 @@
#include <gtk/gtk.h>
int
main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *event_box;

View File

@@ -3,17 +3,20 @@
#include <gtk/gtk.h>
/* Get the selected filename and print it to the console */
void file_ok_sel (GtkWidget *w, GtkFileSelection *fs)
void file_ok_sel( GtkWidget *w,
GtkFileSelection *fs )
{
g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
}
void destroy (GtkWidget *widget, gpointer data)
void destroy( GtkWidget *widget,
gpointer data )
{
gtk_main_quit ();
}
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *filew;
@@ -29,7 +32,8 @@ int main (int argc, char *argv[])
"clicked", (GtkSignalFunc) file_ok_sel, filew );
/* Connect the cancel_button to destroy the widget */
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION
(filew)->cancel_button),
"clicked", (GtkSignalFunc) gtk_widget_destroy,
GTK_OBJECT (filew));

View File

@@ -51,7 +51,7 @@ int main( int argc,
button = gtk_button_new_with_label ("Press me");
/* When the button receives the "clicked" signal, it will call the
* function move_button() passing it the Fixed Containter as its
* function move_button() passing it the Fixed Container as its
* argument. */
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (move_button), fixed);

View File

@@ -30,7 +30,7 @@ int main( int argc,
frame = gtk_frame_new(NULL);
gtk_container_add(GTK_CONTAINER(window), frame);
/* Set the frames label */
/* Set the frame's label */
gtk_frame_set_label( GTK_FRAME(frame), "GTK Frame Widget" );
/* Align the label at the right of the frame */

View File

@@ -275,12 +275,14 @@ gtk_dial_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkDial *dial;
GdkPoint points[3];
GdkPoint points[6];
gdouble s,c;
gdouble theta;
gdouble theta, last, increment;
GtkStyle *blankstyle;
gint xc, yc;
gint upper, lower;
gint tick_length;
gint i;
gint i, inc;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_DIAL (widget), FALSE);
@@ -291,37 +293,22 @@ gtk_dial_expose (GtkWidget *widget,
dial = GTK_DIAL (widget);
gdk_window_clear_area (widget->window,
/* gdk_window_clear_area (widget->window,
0, 0,
widget->allocation.width,
widget->allocation.height);
*/
xc = widget->allocation.width/2;
yc = widget->allocation.height/2;
/* Draw ticks */
upper = dial->adjustment->upper;
lower = dial->adjustment->lower;
for (i=0; i<25; i++)
{
theta = (i*M_PI/18. - M_PI/6.);
s = sin(theta);
c = cos(theta);
tick_length = (i%6 == 0) ? dial->pointer_width : dial->pointer_width/2;
gdk_draw_line (widget->window,
widget->style->fg_gc[widget->state],
xc + c*(dial->radius - tick_length),
yc - s*(dial->radius - tick_length),
xc + c*dial->radius,
yc - s*dial->radius);
}
/* Draw pointer */
s = sin(dial->angle);
c = cos(dial->angle);
/* Erase old pointer */
s = sin(dial->last_angle);
c = cos(dial->last_angle);
dial->last_angle = dial->angle;
points[0].x = xc + s*dial->pointer_width/2;
points[0].y = yc + c*dial->pointer_width/2;
@@ -329,14 +316,90 @@ gtk_dial_expose (GtkWidget *widget,
points[1].y = yc - s*dial->radius;
points[2].x = xc - s*dial->pointer_width/2;
points[2].y = yc - c*dial->pointer_width/2;
points[3].x = xc - c*dial->radius/10;
points[3].y = yc + s*dial->radius/10;
points[4].x = points[0].x;
points[4].y = points[0].y;
blankstyle = gtk_style_new ();
blankstyle->bg_gc[GTK_STATE_NORMAL] =
widget->style->bg_gc[GTK_STATE_NORMAL];
blankstyle->dark_gc[GTK_STATE_NORMAL] =
widget->style->bg_gc[GTK_STATE_NORMAL];
blankstyle->light_gc[GTK_STATE_NORMAL] =
widget->style->bg_gc[GTK_STATE_NORMAL];
blankstyle->black_gc =
widget->style->bg_gc[GTK_STATE_NORMAL];
gtk_draw_polygon (blankstyle,
widget->window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
points, 5,
FALSE);
gtk_style_unref(blankstyle);
/* Draw ticks */
if ((upper - lower) == 0)
return;
increment = (100*M_PI)/(dial->radius*dial->radius);
inc = (upper - lower);
while (inc < 100) inc *=10;
while (inc >= 1000) inc /=10;
last = -1;
for (i=0; i<=inc; i++)
{
theta = ((gfloat)i*M_PI/(18*inc/24.) - M_PI/6.);
if ((theta - last) < (increment))
continue;
last = theta;
s = sin(theta);
c = cos(theta);
tick_length = (i%(inc/10) == 0) ? dial->pointer_width : dial->pointer_width/2;
gdk_draw_line (widget->window,
widget->style->fg_gc[widget->state],
xc + c*(dial->radius - tick_length),
yc - s*(dial->radius - tick_length),
xc + c*dial->radius,
yc - s*dial->radius);
}
/* Draw pointer */
s = sin(dial->angle);
c = cos(dial->angle);
dial->last_angle = dial->angle;
points[0].x = xc + s*dial->pointer_width/2;
points[0].y = yc + c*dial->pointer_width/2;
points[1].x = xc + c*dial->radius;
points[1].y = yc - s*dial->radius;
points[2].x = xc - s*dial->pointer_width/2;
points[2].y = yc - c*dial->pointer_width/2;
points[3].x = xc - c*dial->radius/10;
points[3].y = yc + s*dial->radius/10;
points[4].x = points[0].x;
points[4].y = points[0].y;
gtk_draw_polygon (widget->style,
widget->window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
points, 3,
points, 5,
TRUE);
return FALSE;
}

View File

@@ -59,6 +59,7 @@ struct _GtkDial
/* Current angle */
gfloat angle;
gfloat last_angle;
/* Old values from adjustment stored so we know when something changes */
gfloat old_value;

View File

@@ -50,7 +50,7 @@ int main( int argc,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* When the window is given the "delete_event" signal (this is given
* by the window manager, usually by the 'close' option, or on the
* by the window manager, usually by the "close" option, or on the
* titlebar), we ask it to call the delete_event () function
* as defined above. The data passed to the callback
* function is NULL and is ignored in the callback function. */
@@ -59,7 +59,7 @@ int main( int argc,
/* Here we connect the "destroy" event to a signal handler.
* This event occurs when we call gtk_widget_destroy() on the window,
* or if we return 'FALSE' in the "delete_event" callback. */
* or if we return FALSE in the "delete_event" callback. */
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy), NULL);

View File

@@ -11,11 +11,12 @@ void callback( GtkWidget *widget,
}
/* another callback */
void delete_event( GtkWidget *widget,
gint delete_event( GtkWidget *widget,
GdkEvent *event,
gpointer data )
gpointer data )
{
gtk_main_quit ();
gtk_main_quit();
return(FALSE);
}
int main( int argc,
@@ -33,7 +34,7 @@ int main( int argc,
/* Create a new window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* This is a new call, this just sets the title of our
/* This is a new call, which just sets the title of our
* new window to "Hello Buttons!" */
gtk_window_set_title (GTK_WINDOW (window), "Hello Buttons!");

View File

@@ -72,7 +72,7 @@ int main( int argc,
label = gtk_label_new ("This is an example of a line-wrapped, filled label. " \
"It should be taking "\
"up the entire width allocated to it. " \
"Here is a seneance to prove "\
"Here is a sentence to prove "\
"my point. Here is another sentence. "\
"Here comes the sun, do de do de do.\n"\
" This is a new paragraph.\n"\

View File

@@ -1,6 +1,6 @@
/* example-start list list.c */
/* Include the gtk+ header files
/* Include the GTK header files
* Include stdio.h, we need that for the printf() function
*/
#include <gtk/gtk.h>
@@ -13,7 +13,7 @@ const gchar *list_item_data_key="list_item_data";
/* prototypes for signal handler that we are going to connect
* to the GtkList widget
* to the List widget
*/
static void sigh_print_selection( GtkWidget *gtklist,
gpointer func_data);
@@ -25,8 +25,8 @@ static void sigh_button_event( GtkWidget *gtklist,
/* Main function to set up the user interface */
gint main (int argc,
gchar *argv[])
gint main( int argc,
gchar *argv[] )
{
GtkWidget *separator;
GtkWidget *window;
@@ -41,7 +41,7 @@ gint main (int argc,
gchar buffer[64];
/* Initialize gtk+ (and subsequently gdk) */
/* Initialize GTK (and subsequently GDK) */
gtk_init(&argc, &argv);
@@ -65,15 +65,15 @@ gint main (int argc,
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(vbox);
/* This is the scrolled window to put the GtkList widget inside */
/* This is the scrolled window to put the List widget inside */
scrolled_window=gtk_scrolled_window_new(NULL, NULL);
gtk_widget_set_usize(scrolled_window, 250, 150);
gtk_container_add(GTK_CONTAINER(vbox), scrolled_window);
gtk_widget_show(scrolled_window);
/* Create the GtkList widget.
/* Create thekList widget.
* Connect the sigh_print_selection() signal handler
* function to the "selection_changed" signal of the GtkList
* function to the "selection_changed" signal of the List
* to print out the selected items each time the selection
* has changed */
gtklist=gtk_list_new();
@@ -93,7 +93,7 @@ gint main (int argc,
gtk_container_add(GTK_CONTAINER(vbox), frame);
gtk_widget_show(frame);
/* Connect the sigh_button_event() signal handler to the GtkList
/* Connect the sigh_button_event() signal handler to the List
* which will handle the "arresting" of list items
*/
gtk_signal_connect(GTK_OBJECT(gtklist),
@@ -106,7 +106,7 @@ gint main (int argc,
gtk_container_add(GTK_CONTAINER(vbox), separator);
gtk_widget_show(separator);
/* Finally create a button and connect it's "clicked" signal
/* Finally create a button and connect its "clicked" signal
* to the destruction of the window */
button=gtk_button_new_with_label("Close");
gtk_container_add(GTK_CONTAINER(vbox), button);
@@ -117,8 +117,8 @@ gint main (int argc,
GTK_OBJECT(window));
/* Now we create 5 list items, each having it's own
* label and add them to the GtkList using gtk_container_add()
/* Now we create 5 list items, each having its own
* label and add them to the List using gtk_container_add()
* Also we query the text string from the label and
* associate it with the list_item_data_key for each list item
*/
@@ -176,7 +176,7 @@ gint main (int argc,
}
/* This is the signal handler that got connected to button
* press/release events of the GtkList
* press/release events of the List
*/
void sigh_button_event( GtkWidget *gtklist,
GdkEventButton *event,
@@ -218,7 +218,7 @@ void sigh_button_event( GtkWidget *gtklist,
g_list_free(free_list);
/* If we have a new prisoner, remove him from the
* GtkList and put him into the frame "Prison".
* List and put him into the frame "Prison".
* We need to unselect the item first.
*/
if (new_prisoner) {
@@ -235,16 +235,16 @@ void sigh_button_event( GtkWidget *gtklist,
}
}
/* This is the signal handler that gets called if GtkList
/* This is the signal handler that gets called if List
* emits the "selection_changed" signal
*/
void sigh_print_selection( GtkWidget *gtklist,
gpointer func_data)
gpointer func_data )
{
GList *dlist;
/* Fetch the doubly linked list of selected items
* of the GtkList, remember to treat this as read-only!
* of the List, remember to treat this as read-only!
*/
dlist=GTK_LIST(gtklist)->selection;

View File

@@ -4,8 +4,10 @@
#include <strings.h>
/* Obligatory basic callback */
static void print_hello(GtkWidget *w, gpointer data) {
g_message("Hello, World!\n");
static void print_hello( GtkWidget *w,
gpointer data )
{
g_message ("Hello, World!\n");
}
/* This is the GtkItemFactoryEntry structure used to generate new menus.
@@ -27,31 +29,33 @@ static void print_hello(GtkWidget *w, gpointer data) {
"<RadioItem>" -> create a radio item
<path> -> path of a radio item to link against
"<Separator>" -> create a separator
"<Branch>" -> create an item to hold sub items
"<Branch>" -> create an item to hold sub items (optional)
"<LastBranch>" -> create a right justified branch
*/
static GtkItemFactoryEntry menu_items[] = {
{"/_File", NULL, NULL, 0, "<Branch>"},
{"/File/_New", "<control>N", print_hello, 0, NULL},
{"/File/_Open", "<control>O", print_hello, 0, NULL},
{"/File/_Save", "<control>S", print_hello, 0, NULL},
{"/File/Save _As", NULL, NULL, 0, NULL},
{"/File/sep1", NULL, NULL, 0, "<Separator>"},
{"/File/Quit", "<control>Q", gtk_main_quit, 0, NULL},
{"/_Options", NULL, NULL, 0, "<Branch>"},
{"/Options/Test", NULL, NULL, 0, NULL},
{"/_Help", NULL, NULL, 0, "<LastBranch>"},
{"/_Help/About", NULL, NULL, 0, NULL},
{ "/_File", NULL, NULL, 0, "<Branch>" },
{ "/File/_New", "<control>N", print_hello, 0, NULL },
{ "/File/_Open", "<control>O", print_hello, 0, NULL },
{ "/File/_Save", "<control>S", print_hello, 0, NULL },
{ "/File/Save _As", NULL, NULL, 0, NULL },
{ "/File/sep1", NULL, NULL, 0, "<Separator>" },
{ "/File/Quit", "<control>Q", gtk_main_quit, 0, NULL },
{ "/_Options", NULL, NULL, 0, "<Branch>" },
{ "/Options/Test", NULL, NULL, 0, NULL },
{ "/_Help", NULL, NULL, 0, "<LastBranch>" },
{ "/_Help/About", NULL, NULL, 0, NULL },
};
void get_main_menu(GtkWidget *window, GtkWidget ** menubar) {
int nmenu_items = sizeof(menu_items) / sizeof(menu_items[0]);
void get_main_menu( GtkWidget *window,
GtkWidget **menubar )
{
GtkItemFactory *item_factory;
GtkAccelGroup *accel_group;
gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
accel_group = gtk_accel_group_new();
accel_group = gtk_accel_group_new ();
/* This function initializes the item factory.
Param 1: The type of menu - can be GTK_TYPE_MENU_BAR, GTK_TYPE_MENU,
@@ -61,47 +65,49 @@ void get_main_menu(GtkWidget *window, GtkWidget ** menubar) {
the accelerator table while generating menus.
*/
item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>",
item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>",
accel_group);
/* This function generates the menu items. Pass the item factory,
the number of items in the array, the array itself, and any
callback data for the the menu items. */
gtk_item_factory_create_items(item_factory, nmenu_items, menu_items, NULL);
gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, NULL);
/* Attach the new accelerator group to the window. */
gtk_accel_group_attach (accel_group, GTK_OBJECT (window));
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
if (menubar)
/* Finally, return the actual menu bar created by the item factory. */
*menubar = gtk_item_factory_get_widget(item_factory, "<main>");
*menubar = gtk_item_factory_get_widget (item_factory, "<main>");
}
int main(int argc, char *argv[]) {
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *main_vbox;
GtkWidget *menubar;
gtk_init(&argc, &argv);
gtk_init (&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
"WM destroy");
gtk_window_set_title(GTK_WINDOW(window), "Item Factory");
gtk_widget_set_usize(GTK_WIDGET(window), 300, 200);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit),
"WM destroy");
gtk_window_set_title (GTK_WINDOW(window), "Item Factory");
gtk_widget_set_usize (GTK_WIDGET(window), 300, 200);
main_vbox = gtk_vbox_new(FALSE, 1);
gtk_container_border_width(GTK_CONTAINER(main_vbox), 1);
gtk_container_add(GTK_CONTAINER(window), main_vbox);
gtk_widget_show(main_vbox);
main_vbox = gtk_vbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (main_vbox), 1);
gtk_container_add (GTK_CONTAINER (window), main_vbox);
gtk_widget_show (main_vbox);
get_main_menu(window, &menubar);
gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, TRUE, 0);
gtk_widget_show(menubar);
get_main_menu (window, &menubar);
gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, TRUE, 0);
gtk_widget_show (menubar);
gtk_widget_show(window);
gtk_main();
gtk_widget_show (window);
gtk_main ();
return(0);
}

View File

@@ -5,7 +5,8 @@
static gint button_press (GtkWidget *, GdkEvent *);
static void menuitem_response (gchar *);
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
@@ -21,17 +22,17 @@ int main (int argc, char *argv[])
gtk_init (&argc, &argv);
/* create a new window */
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize( GTK_WIDGET (window), 200, 100);
gtk_window_set_title(GTK_WINDOW (window), "GTK Menu Test");
gtk_signal_connect(GTK_OBJECT (window), "delete_event",
(GtkSignalFunc) gtk_main_quit, NULL);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize (GTK_WIDGET (window), 200, 100);
gtk_window_set_title (GTK_WINDOW (window), "GTK Menu Test");
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
(GtkSignalFunc) gtk_main_quit, NULL);
/* Init the menu-widget, and remember -- never
* gtk_show_widget() the menu widget!!
* This is the menu that holds the menu items, the one that
* will pop up when you click on the "Root Menu" in the app */
menu = gtk_menu_new();
menu = gtk_menu_new ();
/* Next we make a little loop that makes three menu-entries for "test-menu".
* Notice the call to gtk_menu_append. Here we are adding a list of
@@ -39,64 +40,64 @@ int main (int argc, char *argv[])
* signal on each of the menu items and setup a callback for it,
* but it's omitted here to save space. */
for(i = 0; i < 3; i++)
for (i = 0; i < 3; i++)
{
/* Copy the names to the buf. */
sprintf(buf, "Test-undermenu - %d", i);
sprintf (buf, "Test-undermenu - %d", i);
/* Create a new menu-item with a name... */
menu_items = gtk_menu_item_new_with_label(buf);
menu_items = gtk_menu_item_new_with_label (buf);
/* ...and add it to the menu. */
gtk_menu_append(GTK_MENU (menu), menu_items);
gtk_menu_append (GTK_MENU (menu), menu_items);
/* Do something interesting when the menuitem is selected */
gtk_signal_connect_object(GTK_OBJECT(menu_items), "activate",
GTK_SIGNAL_FUNC(menuitem_response), (gpointer) g_strdup(buf));
gtk_signal_connect_object (GTK_OBJECT (menu_items), "activate",
GTK_SIGNAL_FUNC (menuitem_response), (gpointer) g_strdup (buf));
/* Show the widget */
gtk_widget_show(menu_items);
gtk_widget_show (menu_items);
}
/* This is the root menu, and will be the label
* displayed on the menu bar. There won't be a signal handler attached,
* as it only pops up the rest of the menu when pressed. */
root_menu = gtk_menu_item_new_with_label("Root Menu");
root_menu = gtk_menu_item_new_with_label ("Root Menu");
gtk_widget_show(root_menu);
gtk_widget_show (root_menu);
/* Now we specify that we want our newly created "menu" to be the menu
* for the "root menu" */
gtk_menu_item_set_submenu(GTK_MENU_ITEM (root_menu), menu);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu);
/* A vbox to put a menu and a button in: */
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_widget_show(vbox);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show (vbox);
/* Create a menu-bar to hold the menus and add it to our main window */
menu_bar = gtk_menu_bar_new();
gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 2);
gtk_widget_show(menu_bar);
menu_bar = gtk_menu_bar_new ();
gtk_box_pack_start (GTK_BOX (vbox), menu_bar, FALSE, FALSE, 2);
gtk_widget_show (menu_bar);
/* Create a button to which to attach menu as a popup */
button = gtk_button_new_with_label("press me");
gtk_signal_connect_object(GTK_OBJECT(button), "event",
GTK_SIGNAL_FUNC (button_press), GTK_OBJECT(menu));
gtk_box_pack_end(GTK_BOX(vbox), button, TRUE, TRUE, 2);
gtk_widget_show(button);
button = gtk_button_new_with_label ("press me");
gtk_signal_connect_object (GTK_OBJECT (button), "event",
GTK_SIGNAL_FUNC (button_press), GTK_OBJECT (menu));
gtk_box_pack_end (GTK_BOX (vbox), button, TRUE, TRUE, 2);
gtk_widget_show (button);
/* And finally we append the menu-item to the menu-bar -- this is the
* "root" menu-item I have been raving about =) */
gtk_menu_bar_append(GTK_MENU_BAR (menu_bar), root_menu);
gtk_menu_bar_append (GTK_MENU_BAR (menu_bar), root_menu);
/* always display the window as the last step so it all splashes on
* the screen at once. */
gtk_widget_show(window);
gtk_widget_show (window);
gtk_main ();
return 0;
return(0);
}
/* Respond to a button-press by posting a menu passed in as widget.
@@ -105,12 +106,13 @@ int main (int argc, char *argv[])
* the button that was pressed.
*/
static gint button_press (GtkWidget *widget, GdkEvent *event)
static gint button_press( GtkWidget *widget,
GdkEvent *event )
{
if (event->type == GDK_BUTTON_PRESS) {
GdkEventButton *bevent = (GdkEventButton *) event;
gtk_menu_popup (GTK_MENU(widget), NULL, NULL, NULL, NULL,
gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL,
bevent->button, bevent->time);
/* Tell calling code that we have handled this event; the buck
* stops here. */
@@ -124,8 +126,8 @@ static gint button_press (GtkWidget *widget, GdkEvent *event)
/* Print a string when a menu item is selected */
static void menuitem_response (gchar *string)
static void menuitem_response( gchar *string )
{
printf("%s\n", string);
printf ("%s\n", string);
}
/* example-end */

View File

@@ -3,13 +3,15 @@
#include <gtk/gtk.h>
/* This function rotates the position of the tabs */
void rotate_book (GtkButton *button, GtkNotebook *notebook)
void rotate_book( GtkButton *button,
GtkNotebook *notebook )
{
gtk_notebook_set_tab_pos (notebook, (notebook->tab_pos +1) %4);
}
/* Add/Remove the page tabs and the borders */
void tabsborder_book (GtkButton *button, GtkNotebook *notebook)
void tabsborder_book( GtkButton *button,
GtkNotebook *notebook )
{
gint tval = FALSE;
gint bval = FALSE;
@@ -23,7 +25,8 @@ void tabsborder_book (GtkButton *button, GtkNotebook *notebook)
}
/* Remove a page from the notebook */
void remove_book (GtkButton *button, GtkNotebook *notebook)
void remove_book( GtkButton *button,
GtkNotebook *notebook )
{
gint page;
@@ -34,12 +37,16 @@ void remove_book (GtkButton *button, GtkNotebook *notebook)
gtk_widget_draw(GTK_WIDGET(notebook), NULL);
}
void delete (GtkWidget *widget, GtkWidget *event, gpointer data)
gint delete( GtkWidget *widget,
GtkWidget *event,
gpointer data )
{
gtk_main_quit ();
gtk_main_quit();
return(FALSE);
}
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *button;
@@ -70,7 +77,7 @@ int main (int argc, char *argv[])
gtk_table_attach_defaults(GTK_TABLE(table), notebook, 0,6,0,1);
gtk_widget_show(notebook);
/* Lets append a bunch of pages to the notebook */
/* Let's append a bunch of pages to the notebook */
for (i=0; i < 5; i++) {
sprintf(bufferf, "Append Frame %d", i+1);
sprintf(bufferl, "Page %d", i+1);
@@ -88,7 +95,7 @@ int main (int argc, char *argv[])
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
}
/* Now lets add a page to a specific spot */
/* Now let's add a page to a specific spot */
checkbutton = gtk_check_button_new_with_label ("Check me please!");
gtk_widget_set_usize(checkbutton, 100, 75);
gtk_widget_show (checkbutton);
@@ -96,7 +103,7 @@ int main (int argc, char *argv[])
label = gtk_label_new ("Add page");
gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), checkbutton, label, 2);
/* Now finally lets prepend pages to the notebook */
/* Now finally let's prepend pages to the notebook */
for (i=0; i < 5; i++) {
sprintf(bufferf, "Prepend Frame %d", i+1);
sprintf(bufferl, "PPage %d", i+1);
@@ -140,7 +147,8 @@ int main (int argc, char *argv[])
button = gtk_button_new_with_label ("tab position");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) rotate_book, GTK_OBJECT(notebook));
(GtkSignalFunc) rotate_book,
GTK_OBJECT(notebook));
gtk_table_attach_defaults(GTK_TABLE(table), button, 3,4,1,2);
gtk_widget_show(button);

View File

@@ -1,13 +1,15 @@
/* example-start packbox packbox.c */
#include <stdio.h>
#include <stdlib.h>
#include "gtk/gtk.h"
void delete_event( GtkWidget *widget,
gint delete_event( GtkWidget *widget,
GdkEvent *event,
gpointer data )
gpointer data )
{
gtk_main_quit ();
gtk_main_quit();
return(FALSE);
}
/* Make a new hbox filled with button-labels. Arguments for the
@@ -82,7 +84,7 @@ int main( int argc,
if (argc != 2) {
fprintf (stderr, "usage: packbox num, where num is 1, 2, or 3.\n");
/* this just does cleanup in GTK, and exits with an exit status of 1. */
/* This just does cleanup in GTK and exits with an exit status of 1. */
gtk_exit (1);
}
@@ -91,8 +93,8 @@ int main( int argc,
/* Create our window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
/* You should always remember to connect the destroy signal to the
* main window. This is very important for proper intuitive
/* You should always remember to connect the delete_event signal
* to the main window. This is very important for proper intuitive
* behavior */
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (delete_event), NULL);
@@ -128,7 +130,7 @@ int main( int argc,
gtk_widget_show (box2);
/* Call our make box function - homogeneous = FALSE, spacing = 0,
* expand = FALSE, fill = FALSE, padding = 0 */
* expand = TRUE, fill = FALSE, padding = 0 */
box2 = make_box (FALSE, 0, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
gtk_widget_show (box2);
@@ -142,8 +144,8 @@ int main( int argc,
* but they are quite simple. */
separator = gtk_hseparator_new ();
/* Cack the separator into the vbox. Remember each of these
* widgets are being packed into a vbox, so they'll be stacked
/* Pack the separator into the vbox. Remember each of these
* widgets is being packed into a vbox, so they'll be stacked
* vertically. */
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5);
gtk_widget_show (separator);
@@ -166,7 +168,8 @@ int main( int argc,
/* Another new separator. */
separator = gtk_hseparator_new ();
/* The last 3 arguments to gtk_box_pack_start are: expand, fill, padding. */
/* The last 3 arguments to gtk_box_pack_start are:
* expand, fill, padding. */
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5);
gtk_widget_show (separator);
@@ -192,7 +195,8 @@ int main( int argc,
gtk_widget_show (box2);
separator = gtk_hseparator_new ();
/* The last 3 arguments to gtk_box_pack_start are: expand, fill, padding. */
/* The last 3 arguments to gtk_box_pack_start are:
* expand, fill, padding. */
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 5);
gtk_widget_show (separator);
@@ -255,14 +259,13 @@ int main( int argc,
/* Our quit button. */
button = gtk_button_new_with_label ("Quit");
/* Setup the signal to destroy the window. Remember that this will send
* the "destroy" signal to the window which will be caught by our signal
* handler as defined above. */
/* Setup the signal to terminate the program when the button is clicked */
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit),
GTK_OBJECT (window));
/* Pack the button into the quitbox.
* The last 3 arguments to gtk_box_pack_start are: expand, fill, padding. */
* The last 3 arguments to gtk_box_pack_start are:
* expand, fill, padding. */
gtk_box_pack_start (GTK_BOX (quitbox), button, TRUE, FALSE, 0);
/* pack the quitbox into the vbox (box1) */
gtk_box_pack_start (GTK_BOX (box1), quitbox, FALSE, FALSE, 0);

View File

@@ -2,7 +2,7 @@
CC = gcc
packer: pack.c
$(CC) `gtk-config --cflags` pack.c -o packer `gtk-config --libs`
$(CC) -g `gtk-config --cflags` pack.c -o packer `gtk-config --libs`
clean:
rm -f *.o packer

View File

@@ -81,7 +81,7 @@ main (int argv, char **argc)
info = g_malloc(sizeof(Info));
window = gtk_window_new(GTK_TOPLEVEL);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy), NULL);

View File

@@ -3,8 +3,7 @@
#include <gtk/gtk.h>
/* Create the list of "messages" */
GtkWidget *
create_list (void)
GtkWidget *create_list( void )
{
GtkWidget *scrolled_window;
@@ -22,8 +21,8 @@ create_list (void)
/* Create a new list and put it in the scrolled window */
list = gtk_list_new ();
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
list);
gtk_scrolled_window_add_with_viewport (
GTK_SCROLLED_WINDOW (scrolled_window), list);
gtk_widget_show (list);
/* Add some messages to the window */
@@ -44,8 +43,8 @@ when our window is realized. We could also force our window to be
realized with gtk_widget_realize, but it would have to be part of
a hierarchy first */
void
realize_text (GtkWidget *text, gpointer data)
void realize_text( GtkWidget *text,
gpointer data )
{
gtk_text_freeze (GTK_TEXT (text));
gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL,
@@ -62,8 +61,7 @@ realize_text (GtkWidget *text, gpointer data)
}
/* Create a scrolled text area that displays a "message" */
GtkWidget *
create_text (void)
GtkWidget *create_text( void )
{
GtkWidget *table;
GtkWidget *text;
@@ -100,8 +98,8 @@ create_text (void)
return table;
}
int
main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *vpaned;

View File

@@ -29,18 +29,24 @@ static const char * xpm_data[] = {
/* when invoked (via signal delete_event), terminates the application.
*/
void close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) {
gint close_application( GtkWidget *widget,
GdkEvent *event,
gpointer data )
{
gtk_main_quit();
return(FALSE);
}
/* is invoked when the button is clicked. It just prints a message.
*/
void button_clicked( GtkWidget *widget, gpointer data ) {
printf( "button clicked\n" );
void button_clicked( GtkWidget *widget,
gpointer data ) {
g_print( "button clicked\n" );
}
int main( int argc, char *argv[] )
int main( int argc,
char *argv[] )
{
/* GtkWidget is the storage type for widgets */
GtkWidget *window, *pixmapwid, *button;

View File

@@ -115,7 +115,7 @@ int main( int argc,
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 5);
gtk_widget_show(align);
/* Create a GtkAdjusment object to hold the range of the
/* Create a Adjusment object to hold the range of the
* progress bar */
adj = (GtkAdjustment *) gtk_adjustment_new (0, 1, 150, 0, 0, 0);

View File

@@ -3,11 +3,12 @@
#include <gtk/gtk.h>
#include <glib.h>
void close_application( GtkWidget *widget,
gint close_application( GtkWidget *widget,
GdkEvent *event,
gpointer data )
gpointer data )
{
gtk_main_quit();
return(FALSE);
}
int main( int argc,

View File

@@ -102,7 +102,7 @@ void create_range_controls( void )
gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0);
gtk_widget_show (box2);
/* calue, lower, upper, step_increment, page_increment, page_size */
/* value, lower, upper, step_increment, page_increment, page_size */
/* Note that the page_size value only makes a difference for
* scrollbar widgets, and the highest value you'll get is actually
* (upper - page_size). */
@@ -218,7 +218,7 @@ void create_range_controls( void )
box2 = gtk_hbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
/* A GtkHScale widget for adjusting the number of digits on the
/* An HScale widget for adjusting the number of digits on the
* sample scales. */
label = gtk_label_new ("Scale Digits:");
gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0);
@@ -238,7 +238,7 @@ void create_range_controls( void )
box2 = gtk_hbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
/* And, one last GtkHScale widget for adjusting the page size of the
/* And, one last HScale widget for adjusting the page size of the
* scrollbar. */
label = gtk_label_new ("Scrollbar Page Size:");
gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0);

View File

@@ -8,12 +8,17 @@
#define YSIZE 400
/* This routine gets control when the close button is clicked */
void close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) {
gint close_application( GtkWidget *widget,
GdkEvent *event,
gpointer data )
{
gtk_main_quit();
return(FALSE);
}
/* The main routine */
int main( int argc, char *argv[] ) {
int main( int argc,
char *argv[] ) {
GtkWidget *window, *table, *area, *hrule, *vrule;
/* Initialize GTK and create the main window */
@@ -32,28 +37,33 @@ int main( int argc, char *argv[] ) {
gtk_drawing_area_size( (GtkDrawingArea *)area, XSIZE, YSIZE );
gtk_table_attach( GTK_TABLE(table), area, 1, 2, 1, 2,
GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0 );
gtk_widget_set_events( area, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK );
gtk_widget_set_events( area, GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK );
/* The horizontal ruler goes on top. As the mouse moves across the drawing area,
* a motion_notify_event is passed to the appropriate event handler for the ruler. */
/* The horizontal ruler goes on top. As the mouse moves across the
* drawing area, a motion_notify_event is passed to the
* appropriate event handler for the ruler. */
hrule = gtk_hruler_new();
gtk_ruler_set_metric( GTK_RULER(hrule), GTK_PIXELS );
gtk_ruler_set_range( GTK_RULER(hrule), 7, 13, 0, 20 );
gtk_signal_connect_object( GTK_OBJECT(area), "motion_notify_event",
(GtkSignalFunc)EVENT_METHOD(hrule, motion_notify_event),
(GtkSignalFunc)EVENT_METHOD(hrule,
motion_notify_event),
GTK_OBJECT(hrule) );
/* GTK_WIDGET_CLASS(GTK_OBJECT(hrule)->klass)->motion_notify_event, */
gtk_table_attach( GTK_TABLE(table), hrule, 1, 2, 0, 1,
GTK_EXPAND|GTK_SHRINK|GTK_FILL, GTK_FILL, 0, 0 );
/* The vertical ruler goes on the left. As the mouse moves across the drawing area,
* a motion_notify_event is passed to the appropriate event handler for the ruler. */
/* The vertical ruler goes on the left. As the mouse moves across
* the drawing area, a motion_notify_event is passed to the
* appropriate event handler for the ruler. */
vrule = gtk_vruler_new();
gtk_ruler_set_metric( GTK_RULER(vrule), GTK_PIXELS );
gtk_ruler_set_range( GTK_RULER(vrule), 0, YSIZE, 10, YSIZE );
gtk_signal_connect_object( GTK_OBJECT(area), "motion_notify_event",
(GtkSignalFunc)
GTK_WIDGET_CLASS(GTK_OBJECT(vrule)->klass)->motion_notify_event,
GTK_WIDGET_CLASS(GTK_OBJECT(vrule)->klass)->
motion_notify_event,
GTK_OBJECT(vrule) );
gtk_table_attach( GTK_TABLE(table), vrule, 0, 1, 1, 2,
GTK_FILL, GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0 );

View File

@@ -25,8 +25,8 @@
static GdkPixmap *pixmap = NULL;
/* Create a new backing pixmap of the appropriate size */
static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
static gint configure_event( GtkWidget *widget,
GdkEventConfigure *event )
{
if (pixmap)
gdk_pixmap_unref(pixmap);
@@ -46,8 +46,8 @@ configure_event (GtkWidget *widget, GdkEventConfigure *event)
}
/* Redraw the screen from the backing pixmap */
static gint
expose_event (GtkWidget *widget, GdkEventExpose *event)
static gint expose_event( GtkWidget *widget,
GdkEventExpose *event )
{
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
@@ -60,8 +60,9 @@ expose_event (GtkWidget *widget, GdkEventExpose *event)
}
/* Draw a rectangle on the screen */
static void
draw_brush (GtkWidget *widget, gdouble x, gdouble y)
static void draw_brush( GtkWidget *widget,
gdouble x,
gdouble y)
{
GdkRectangle update_rect;
@@ -77,8 +78,8 @@ draw_brush (GtkWidget *widget, gdouble x, gdouble y)
gtk_widget_draw (widget, &update_rect);
}
static gint
button_press_event (GtkWidget *widget, GdkEventButton *event)
static gint button_press_event( GtkWidget *widget,
GdkEventButton *event )
{
if (event->button == 1 && pixmap != NULL)
draw_brush (widget, event->x, event->y);
@@ -86,8 +87,8 @@ button_press_event (GtkWidget *widget, GdkEventButton *event)
return TRUE;
}
static gint
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
static gint motion_notify_event( GtkWidget *widget,
GdkEventMotion *event )
{
int x, y;
GdkModifierType state;
@@ -107,14 +108,13 @@ motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
return TRUE;
}
void
quit ()
void quit ()
{
gtk_exit (0);
}
int
main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *drawing_area;

View File

@@ -0,0 +1,8 @@
CC = gcc
scribble-xinput: scribble-xinput.c
$(CC) `gtk-config --cflags` scribble-xinput.c -o scribble-xinput `gtk-config --libs`
clean:
rm -f *.o scribble-xinput

View File

@@ -0,0 +1,270 @@
/* example-start scribble-xinput scribble-xinput.c */
/* 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 Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gtk/gtk.h>
/* Backing pixmap for drawing area */
static GdkPixmap *pixmap = NULL;
/* 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;
}
/* Redraw 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 void
print_button_press (guint32 deviceid)
{
GList *tmp_list;
/* gdk_input_list_devices returns an internal list, so we shouldn't
free it afterwards */
tmp_list = gdk_input_list_devices();
while (tmp_list)
{
GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data;
if (info->deviceid == deviceid)
{
g_print("Button press on device '%s'\n", info->name);
return;
}
tmp_list = tmp_list->next;
}
}
static gint
button_press_event (GtkWidget *widget, GdkEventButton *event)
{
print_button_press (event->deviceid);
if (event->button == 1 && pixmap != NULL)
draw_brush (widget, event->source, event->x, event->y, event->pressure);
return TRUE;
}
static gint
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
{
gdouble x, y;
gdouble pressure;
GdkModifierType state;
if (event->is_hint)
gdk_input_window_get_pointer (event->window, event->deviceid,
&x, &y, &pressure,
NULL, NULL, &state);
else
{
x = event->x;
y = event->y;
pressure = event->pressure;
state = event->state;
}
if (state & GDK_BUTTON1_MASK && pixmap != NULL)
draw_brush (widget, event->source, x, y, pressure);
return TRUE;
}
void
input_dialog_destroy (GtkWidget *w, gpointer data)
{
*((GtkWidget **)data) = NULL;
}
void
create_input_dialog ()
{
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 ()
{
gtk_exit (0);
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *drawing_area;
GtkWidget *vbox;
GtkWidget *button;
gtk_init (&argc, &argv);
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_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
| GDK_LEAVE_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_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_CURSOR);
/* .. And 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;
}
/* example-end */

View File

@@ -2,12 +2,14 @@
#include <gtk/gtk.h>
void destroy(GtkWidget *widget, gpointer data)
void destroy( GtkWidget *widget,
gpointer data )
{
gtk_main_quit();
}
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
static GtkWidget *window;
GtkWidget *scrolled_window;
@@ -19,9 +21,7 @@ int main (int argc, char *argv[])
gtk_init (&argc, &argv);
/* Create a new dialog window for the scrolled window to be
* packed into. A dialog is just like a normal window except it has a
* vbox and a horizontal separator packed into it. It's just a shortcut
* for creating dialogs */
* packed into. */
window = gtk_dialog_new ();
gtk_signal_connect (GTK_OBJECT (window), "destroy",
(GtkSignalFunc) destroy, NULL);
@@ -54,8 +54,8 @@ int main (int argc, char *argv[])
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
/* pack the table into the scrolled window */
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
table);
gtk_scrolled_window_add_with_viewport (
GTK_SCROLLED_WINDOW (scrolled_window), table);
gtk_widget_show (table);
/* this simply creates a grid of toggle buttons on the table

View File

@@ -2,13 +2,13 @@
#include <gtk/gtk.h>
void selection_received (GtkWidget *widget,
GtkSelectionData *selection_data,
gpointer data);
void selection_received( GtkWidget *widget,
GtkSelectionData *selection_data,
gpointer data );
/* Signal handler invoked when user clicks on the "Get Targets" button */
void
get_targets (GtkWidget *widget, gpointer data)
void get_targets( GtkWidget *widget,
gpointer data )
{
static GdkAtom targets_atom = GDK_NONE;
@@ -22,9 +22,9 @@ get_targets (GtkWidget *widget, gpointer data)
}
/* Signal handler called when the selections owner returns the data */
void
selection_received (GtkWidget *widget, GtkSelectionData *selection_data,
gpointer data)
void selection_received( GtkWidget *widget,
GtkSelectionData *selection_data,
gpointer data )
{
GdkAtom *atoms;
GList *item_list;
@@ -60,8 +60,8 @@ selection_received (GtkWidget *widget, GtkSelectionData *selection_data,
return;
}
int
main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *button;

View File

@@ -4,8 +4,8 @@
#include <time.h>
/* Callback when the user toggles the selection */
void
selection_toggled (GtkWidget *widget, gint *have_selection)
void selection_toggled( GtkWidget *widget,
gint *have_selection )
{
if (GTK_TOGGLE_BUTTON(widget)->active)
{
@@ -32,9 +32,9 @@ selection_toggled (GtkWidget *widget, gint *have_selection)
}
/* Called when another application claims the selection */
gint
selection_clear (GtkWidget *widget, GdkEventSelection *event,
gint *have_selection)
gint selection_clear( GtkWidget *widget,
GdkEventSelection *event,
gint *have_selection )
{
*have_selection = FALSE;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), FALSE);
@@ -43,15 +43,16 @@ selection_clear (GtkWidget *widget, GdkEventSelection *event,
}
/* Supplies the current time as the selection. */
void
selection_handle (GtkWidget *widget,
GtkSelectionData *selection_data,
gpointer data)
void selection_handle( GtkWidget *widget,
GtkSelectionData *selection_data,
guint info,
guint time_stamp,
gpointer data )
{
gchar *timestr;
time_t current_time;
current_time = time (NULL);
current_time = time(NULL);
timestr = asctime (localtime(&current_time));
/* When we return a single string, it should not be null terminated.
That will be done for us */
@@ -60,11 +61,10 @@ selection_handle (GtkWidget *widget,
8, timestr, strlen(timestr));
}
int
main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *selection_button;
static int have_selection = FALSE;
@@ -91,9 +91,12 @@ main (int argc, char *argv[])
gtk_signal_connect (GTK_OBJECT(selection_button), "selection_clear_event",
GTK_SIGNAL_FUNC (selection_clear), &have_selection);
gtk_selection_add_handler (selection_button, GDK_SELECTION_PRIMARY,
GDK_SELECTION_TYPE_STRING,
selection_handle, NULL);
gtk_selection_add_target (selection_button,
GDK_SELECTION_PRIMARY,
GDK_SELECTION_TYPE_STRING,
1);
gtk_signal_connect (GTK_OBJECT(selection_button), "selection_get",
GTK_SIGNAL_FUNC (selection_handle), &have_selection);
gtk_widget_show (selection_button);
gtk_widget_show (window);

View File

@@ -5,7 +5,8 @@
GtkWidget *status_bar;
void push_item (GtkWidget *widget, gpointer data)
void push_item( GtkWidget *widget,
gpointer data )
{
static int count = 1;
char buff[20];
@@ -16,13 +17,15 @@ void push_item (GtkWidget *widget, gpointer data)
return;
}
void pop_item (GtkWidget *widget, gpointer data)
void pop_item( GtkWidget *widget,
gpointer data )
{
gtk_statusbar_pop( GTK_STATUSBAR(status_bar), GPOINTER_TO_INT(data) );
return;
}
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
@@ -48,7 +51,8 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (vbox), status_bar, TRUE, TRUE, 0);
gtk_widget_show (status_bar);
context_id = gtk_statusbar_get_context_id( GTK_STATUSBAR(status_bar), "Statusbar example");
context_id = gtk_statusbar_get_context_id(
GTK_STATUSBAR(status_bar), "Statusbar example");
button = gtk_button_new_with_label("push item");
gtk_signal_connect(GTK_OBJECT(button), "clicked",

View File

@@ -11,11 +11,12 @@ void callback( GtkWidget *widget,
}
/* This callback quits the program */
void delete_event( GtkWidget *widget,
gint delete_event( GtkWidget *widget,
GdkEvent *event,
gpointer data )
gpointer data )
{
gtk_main_quit ();
return(FALSE);
}
int main( int argc,

View File

@@ -19,12 +19,14 @@ void text_toggle_word_wrap (GtkWidget *checkbutton,
GTK_TOGGLE_BUTTON(checkbutton)->active);
}
void close_application( GtkWidget *widget, gpointer data )
void close_application( GtkWidget *widget,
gpointer data )
{
gtk_main_quit();
}
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *box1;
@@ -37,7 +39,7 @@ int main (int argc, char *argv[])
GtkWidget *vscrollbar;
GtkWidget *text;
GdkColormap *cmap;
GdkColor colour;
GdkColor color;
GdkFont *fixed_font;
FILE *infile;
@@ -85,28 +87,29 @@ int main (int argc, char *argv[])
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (vscrollbar);
/* Get the system colour map and allocate the colour red */
/* Get the system color map and allocate the color red */
cmap = gdk_colormap_get_system();
colour.red = 0xffff;
colour.green = 0;
colour.blue = 0;
if (!gdk_color_alloc(cmap, &colour)) {
g_error("couldn't allocate colour");
color.red = 0xffff;
color.green = 0;
color.blue = 0;
if (!gdk_color_alloc(cmap, &color)) {
g_error("couldn't allocate color");
}
/* Load a fixed font */
fixed_font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*");
/* Realizing a widget creates a window for it, ready for us to insert some text */
/* Realizing a widget creates a window for it,
* ready for us to insert some text */
gtk_widget_realize (text);
/* Freeze the text widget, ready for multiple updates */
gtk_text_freeze (GTK_TEXT (text));
/* Insert some coloured text */
/* Insert some colored text */
gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL,
"Supports ", -1);
gtk_text_insert (GTK_TEXT (text), NULL, &colour, NULL,
gtk_text_insert (GTK_TEXT (text), NULL, &color, NULL,
"colored ", -1);
gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL,
"text and different ", -1);

View File

@@ -68,8 +68,10 @@ tictactoe_class_init (TictactoeClass *class)
tictactoe_signals[TICTACTOE_SIGNAL] = gtk_signal_new ("tictactoe",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (TictactoeClass, tictactoe),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
GTK_SIGNAL_OFFSET (TictactoeClass,
tictactoe),
gtk_signal_default_marshaller,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, tictactoe_signals, LAST_SIGNAL);

View File

@@ -3,15 +3,15 @@
#include <gtk/gtk.h>
#include "tictactoe.h"
void
win (GtkWidget *widget, gpointer data)
void win( GtkWidget *widget,
gpointer data )
{
g_print ("Yay!\n");
tictactoe_clear (TICTACTOE (widget));
}
int
main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window;
GtkWidget *ttt;

View File

@@ -3,12 +3,13 @@
#include <gtk/gtk.h>
/* for all the GtkItem:: and GtkTreeItem:: signals */
static void cb_itemsignal (GtkWidget *item, gchar *signame)
static void cb_itemsignal( GtkWidget *item,
gchar *signame )
{
gchar *name;
GtkLabel *label;
/* It's a GtkBin, so it has one child, which we know to be a
/* It's a Bin, so it has one child, which we know to be a
label, so get that */
label = GTK_LABEL (GTK_BIN (item)->child);
/* Get the text of the label */
@@ -19,8 +20,9 @@ static void cb_itemsignal (GtkWidget *item, gchar *signame)
}
/* Note that this is never called */
static void cb_unselect_child (GtkWidget *root_tree, GtkWidget *child,
GtkWidget *subtree)
static void cb_unselect_child( GtkWidget *root_tree,
GtkWidget *child,
GtkWidget *subtree )
{
g_print ("unselect_child called for root tree %p, subtree %p, child %p\n",
root_tree, subtree, child);
@@ -35,7 +37,7 @@ static void cb_select_child (GtkWidget *root_tree, GtkWidget *child,
root_tree, subtree, child);
}
static void cb_selection_changed (GtkWidget *tree)
static void cb_selection_changed( GtkWidget *tree )
{
GList *i;
@@ -58,7 +60,8 @@ static void cb_selection_changed (GtkWidget *tree)
}
}
int main (int argc, char *argv[])
int main( int argc,
char *argv[] )
{
GtkWidget *window, *scrolled_win, *tree;
static gchar *itemnames[] = {"Foo", "Bar", "Baz", "Quux",

View File

@@ -120,11 +120,16 @@ static char * WheelbarrowFull_xpm[] = {
/* When invoked (via signal delete_event), terminates the application */
void close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) {
gint close_application( GtkWidget *widget,
GdkEvent *event,
gpointer data )
{
gtk_main_quit();
return(FALSE);
}
int main (int argc, char *argv[])
int main (int argc,
char *argv[] )
{
/* GtkWidget is the storage type for widgets */
GtkWidget *window, *pixmap, *fixed;

View File

View File

@@ -1,22 +0,0 @@
lib_LTLIBRARIES = \
libgdk-pixbuf.la \
libpixbuf-png.la
#
# The GdkPixBuf library
#
libgdk_pixbufincludedir = $(includedir)/gdk-pixbuf
libgdk_pixbuf_la_SOURCES = \
gdk-pixbuf.c \
gdk-pixbuf-io.c
libgdk_pixbufinclude_HEADERS = \
gdk-pixbuf.h
#
# The PNG plugin.
#
libpixbuf_png_la_SOURCES = \
io-png.c

View File

@@ -1,15 +0,0 @@
#ifndef _GDK_PIXBUF_CACHE_H_
#define _GDK_PIXBUF_CACHE_H_
/* The optional cache interface */
typedef struct {
int dummy;
} GdkPixBufCache;
GdkPixBufCache *gdk_pixbuf_cache_new (long image_cache_limit,
long pixmap_bitmap_cache_limit);
void gdk_pixbuf_cache_destroy (GdkPixBufCache *cache);
GdkPixBuf *gdk_pixbuf_cache_load_image (GdkPixBufCache *cache,
const char *file);
#endif

View File

@@ -1,199 +0,0 @@
/*
* gdk-pixbuf-io.c: Code to load images into GdkPixBufs
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*/
#include <config.h>
#include <stdio.h>
#include "gdk-pixbuf.h"
static gboolean
pixbuf_check_png (unsigned char *buffer, int size)
{
if (size < 28)
return FALSE;
if (buffer [0] != 0x89 ||
buffer [1] != 'P' ||
buffer [2] != 'N' ||
buffer [3] != 'G' ||
buffer [4] != 0x0d ||
buffer [5] != 0x0a ||
buffer [6] != 0x1a ||
buffer [7] != 0x0a)
return FALSE;
return TRUE;
}
static gboolean
pixbuf_check_jpeg (unsigned char *buffer, int size)
{
if (size < 10)
return FALSE;
if (buffer [0] != 0xff || buffer [1] != 0xd8)
return FALSE;
return TRUE;
}
static gboolean
pixbuf_check_tiff (unsigned char *buffer, int size)
{
if (size < 10)
return FALSE;
if (buffer [0] == 'M' && buffer [1] == 'M' && buffer [2] == 0 && buffer [3] == 0x2a)
return TRUE;
if (buffer [0] == 'I' && buffer [1] == 'I' && buffer [2] == 0x2a && buffer [3] == 0)
return TRUE;
return FALSE;
}
static gboolean
pixbuf_check_gif (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (strncmp (buffer, "GIF8", 4) == 0)
return TRUE;
return FALSE;
}
static gboolean
pixbuf_check_xpm (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (strncmp (buffer, "/* XPM */", 9) == 0)
return TRUE;
return FALSE;
}
static gboolean
pixbuf_check_bmp (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (buffer [0] != 'B' || buffer [1] != 'M')
return FALSE;
return TRUE;
}
static gboolean
pixbuf_check_ppm (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (buffer [0] == 'P'){
if (buffer [1] == '1' ||
buffer [1] == '2' ||
buffer [1] == '3' ||
buffer [1] == '4' ||
buffer [1] == '5' ||
buffer [1] == '6')
return TRUE;
}
return FALSE;
}
static struct {
char *module_name;
gboolean (*format_check)(unsigned char *buffer, int size);
GModule *module;
GdkPixBuf *(*load)(FILE *f)
int (*save)(char *filename, ...);
} file_formats [] = {
{ "png", pixbuf_check_png, NULL, NULL, NULL },
{ "jpeg", pixbuf_check_jpeg, NULL, NULL, NULL },
{ "tiff", pixbuf_check_tiff, NULL, NULL, NULL },
{ "gif", pixbuf_check_gif, NULL, NULL, NULL },
{ "xpm", pixbuf_check_xpm, NULL, NULL, NULL }
{ "bmp", pixbuf_check_bmp, NULL, NULL, NULL },
{ "ppm", pixbuf_check_ppm, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL, NULL },
};
static int
image_file_format (const char *file)
{
FILE *f = fopen (file);
if (!f)
return -1;
}
static void
image_handler_load (int idx)
{
char *module_name = g_strconcat ("pixbuf-", file_formats [idx].module_name, NULL);
char *path;
GModule *module;
void *load_sym, *save_sym;
path = g_module_build_path (PIXBUF_LIBDIR, module_name);
g_free (module_name);
module = g_module_open (path, G_MODULE_BIND_LAZY);
if (!module)
return;
file_formats [idx].module = module;
if (g_module_symbol (module, "image_load", &load_sym))
file_formats [idx].load = load_sym;
if (g_module_symbol (module, "image_save", &save_sym))
file_formats [idx].save = save_sym;
}
GdkPixBuf *
gdk_pixbuf_load_image (const char *file)
{
GdkPixBuf *pixbuf;
FormatLoader format_loader;
FILE *f;
char buffer [128];
f = fopen (file);
if (!f)
return NULL;
n = fread (&buffer, 1, sizeof (buffer), f);
if (n == 0){
fclose (f);
return NULL;
}
for (i = 0; file_formats [i].module_name; i++){
if ((*file_formats [i].format_check)(buffer, n)){
if (!file_formats [i].load)
image_handler_load (i);
if (!file_formats [i].load){
fclose (f);
return NULL;
}
rewind (f);
pixbuf = (*file_formats [i].load)(f);
fclose (f);
return pixbuf;
}
}
fclose (f);
return NULL;
}

View File

@@ -1,36 +0,0 @@
/*
* gdk-pixbuf.c: Resource management.
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*/
#include <config.h>
#include "gdk-pixbuf.h"
static void
gdk_pixbuf_destroy (GdkPixBuf *pixbuf)
{
art_pixbuf_free (pixbuf->art_pixbuf);
g_free (pixbuf);
}
void
gdk_pixbuf_ref (GdkPixBuf *pixbuf)
{
g_return_if_fail (pixbuf != NULL);
pixbuf->ref_count++;
}
void
gdk_pixbuf_unref (GdkPixBuf *pixbuf)
{
g_return_if_fail (pixbuf != NULL);
g_return_if_fail (pixbuf->ref_count == 0);
pixbuf->ref_count--;
if (pixbuf->ref_count)
gdk_pixbuf_destroy (pixbuf);
}

View File

@@ -1,19 +0,0 @@
#ifndef _GDK_PIXBUF_H_
#define _GDK_PIXBUF_H_
#include <libart_lgpl/art_misc.h>
#include <libart_lgpl/art_pixbuf.h>
typedef struct {
int ref_count;
ArtPixBuf *art_pixbuf;
void (*unref_func)(void *gdkpixbuf);
} GdkPixBuf;
GdkPixBuf *gdk_pixbuf_load_image (const char *file);
void gdk_pixbuf_save_image (const char *format_id, const char *file, ...);
void gdk_pixbuf_ref (GdkPixBuf *pixbuf);
void gdk_pixbuf_unref (GdkPixBuf *pixbuf);
GdkPixBuf gdk_pixbuf_duplicate (GdkPixBuf *pixbuf);
#endif /* _GDK_PIXBUF_H_ */

View File

@@ -1,90 +0,0 @@
/*
* io-png.c: GdkPixBuf image loader for PNG files.
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*
*/
#include <config.h>
#include <stdio.h>
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-io.h"
#include <png.h>
/* Shared library entry point */
GdkPixBuf *
image_load (FILE *f);
{
png_structp png;
png_infop info_ptr, end_info;
int width, height, depth, color_type, interlace_type;
int have_alpha, number_passes;
art_u8 *data;
g_return_val_if_fail (filename != NULL, NULL);
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png)
return NULL;
info_ptr = png_create_info_struct (png);
if (!info_ptr){
png_destroy_read_struct (&png, NULL, NULL);
return NULL;
}
end_info = png_create_info_struct (png);
if (!end_info){
png_destroy_read_struct (&png, &info_ptr, NULL);
return NULL:
}
if (setjmp (png->jmpbuf)){
png_destroy_read_struct (&png, &info_ptr, &end_info);
return NULL;
}
png_init_io (pngptr, f);
png_read_info (png, info_ptr);
png_get_IHDR (png, info_ptr, &width, &height, &depth, &color_type, &interlace_type, NULL, NULL);
if (color_type == color_type == PNG_COLOR_TYPE_PALETTE)
png_set_expand (png);
/*
* Strip 16 bit information to 8 bit
*/
png_set_strip_16 (png);
/*
* Extract multiple pixels with bit depths 1, 2 and 4 from a single
* byte into separate bytes
*/
png_set_packing (png);
/*
* Makes the PNG file to be rendered into RGB or RGBA
* modes (no matter of the bit depth nor the image
* mode
*/
png_set_expand (png);
/*
* Simplify loading by always having 4 bytes
*/
png_set_filler (png, 0xff, PNG_FILLER_AFTER);
if (color_type & PNG_COLOR_MASK_ALPHA)
have_alpha = 1
else
have_alpha = 0;
data = art_alloc (width * height * (3 + have_alpha));
if (!data){
png_destroy_read_struct (&png, &info_ptr, &end_info);
return NULL;
}
number_passes = png_set_interlace_handling (png);
}

View File

@@ -1,18 +0,0 @@
#ifndef _GDK_PIXBUF_H_
#define _GDK_PIXBUF_H_
#include <libart_lgpl/art_pixbuf.h>
typedef struct {
int ref_count;
ArtPixBuf *pixbuf;
void (*unref_func)(void *gdkpixbuf);
} GdkPixBuf;
GdkPixBuf *gdk_pixbuf_load_image (const char *file);
void gdk_pixbuf_save_image (const char *format_id, const char *file, ...);
void gdk_pixbuf_ref (GdkPixBuf *pixbuf);
void gdk_pixbuf_unref (GdkPixBuf *pixbuf);
GdkPixBuf gdk_pixbuf_duplicate (GdkPixBuf *pixbuf);
#endif /* _GDK_PIXBUF_H_ */

504
gdk/COPYING Normal file
View File

@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,19 +1,47 @@
## Process this file with automake to produce Makefile.in
## Makefile.am for gtk+/gdk
gdkincludedir = $(includedir)/gdk
lib_LTLIBRARIES = libgdk.la
INCLUDES = \
INCLUDES = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gdk\" \
-I$(top_srcdir) \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@
@x_cflags@ \
@STRIP_END@
libgdk_la_SOURCES = \
#
# libraries to compile and install
#
lib_LTLIBRARIES = libgdk.la
# libtool stuff: set version and export symbols for resolving
libgdkincludedir = $(includedir)/gdk
libgdk_la_LDFLAGS = @STRIP_BEGIN@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE) \
-export-dynamic \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
-lm \
@STRIP_END@
#
# setup source file variables
#
# GDK header files for public installation (non-generated)
gdk_public_h_sources = @STRIP_BEGIN@ \
gdk.h \
gdkcursors.h \
gdkrgb.h \
gdki18n.h \
gdkkeysyms.h \
gdkprivate.h \
gdktypes.h \
gdkx.h \
@STRIP_END@
gdk_c_sources = @STRIP_BEGIN@ \
gdk.c \
gdkcc.c \
gdkcolor.c \
@@ -44,42 +72,23 @@ libgdk_la_SOURCES = \
MwmUtil.h \
gxid_lib.h \
gxid_proto.h \
gxid_lib.c
## this last one is ifdef'd out unless XINPUT_GXI is defined
## It's easier than trying to get automake to handle compiling
## it conditionally
gxid_lib.c \
@STRIP_END@
gdkinclude_HEADERS = \
gdk.h \
gdkcursors.h \
gdkrgb.h \
gdki18n.h \
gdkkeysyms.h \
gdkprivate.h \
gdktypes.h \
gdkx.h
LDADDS = \
@x_ldflags@ \
@x_libs@ \
@GLIB_LIBS@ \
-lm
libgdk_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
-lm
EXTRA_PROGRAMS = gxid
bin_PROGRAMS = @xinput_progs@
gxid_SOURCES = gxid.c
gxid_LDADD = $(LDADDS)
#
# setup GDK sources and their dependancies
#
libgdkinclude_HEADERS = $(gdk_public_h_sources)
libgdk_la_SOURCES = $(gdk_c_sources)
MAINTAINERCLEANFILES +=
EXTRA_HEADERS +=
EXTRA_DIST +=
EXTRA_DIST +=
#
# rules to generate built sources
#
# we only need to remake these headers once a new X version is released
X-derived-headers:
sed -e 's/^#define[ ]*XC\([^ ]*\)[ ]*\([^ ]*\)[ ]*.*$$/GDK\1 = \2,/' \
-e 'tb' -e 'd' -e ':b' \
@@ -89,6 +98,21 @@ X-derived-headers:
-e 'tb' -e 'd' -e ':b' -e 's/ 0X/ 0x/' \
< @x_includes@/X11/keysymdef.h > gdkkeysyms.h
#
# extra programs
#
EXTRA_PROGRAMS = gxid
bin_PROGRAMS = @xinput_progs@
LDADDS = @STRIP_BEGIN@ \
@x_ldflags@ \
@x_libs@ \
@GLIB_LIBS@ \
-lm \
@STRIP_END@
gxid_SOURCES = gxid.c
gxid_LDADD = $(LDADDS)
.PHONY: files
files:

View File

@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
@@ -41,13 +42,13 @@
#include <X11/Xlib.h>
#include <X11/Xos.h>
#include <X11/Xutil.h>
#include <X11/Xmu/WinUtil.h>
#include <X11/cursorfont.h>
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkinput.h"
#include "gdkx.h"
#include "gdki18n.h"
#include "gdkkeysyms.h"
#ifndef X_GETTIMEOFDAY
#define X_GETTIMEOFDAY(tv) gettimeofday (tv, NULL)
@@ -333,6 +334,7 @@ gdk_init_check (int *argc,
gdk_im_set_best_style (GDK_IM_PREEDIT_POSITION);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
(*argv)[i] = NULL;
}
}
else if (strcmp ("--xim-status", (*argv)[i]) == 0)
@@ -348,6 +350,7 @@ gdk_init_check (int *argc,
gdk_im_set_best_style (GDK_IM_STATUS_AREA);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
(*argv)[i] = NULL;
}
}
#endif
@@ -406,9 +409,9 @@ gdk_init_check (int *argc,
g_free(argv_orig[i]);
g_free(argv_orig);
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", True);
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", True);
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", True);
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", False);
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", False);
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", False);
gdk_wm_window_protocols[0] = gdk_wm_delete_window;
gdk_wm_window_protocols[1] = gdk_wm_take_focus;
gdk_selection_property = XInternAtom (gdk_display, "GDK_SELECTION", False);
@@ -476,12 +479,12 @@ gdk_exit (int errorcode)
}
void
gdk_set_use_xshm (gint use_xshm)
gdk_set_use_xshm (gboolean use_xshm)
{
gdk_use_xshm = use_xshm;
}
gint
gboolean
gdk_get_use_xshm (void)
{
return gdk_use_xshm;
@@ -731,7 +734,7 @@ gdk_pointer_ungrab (guint32 time)
*--------------------------------------------------------------
*/
gint
gboolean
gdk_pointer_is_grabbed (void)
{
return gdk_xgrab_window != NULL;
@@ -1032,20 +1035,35 @@ static int
gdk_x_error (Display *display,
XErrorEvent *error)
{
char buf[64];
if (gdk_error_warnings)
if (error->error_code)
{
XGetErrorText (display, error->error_code, buf, 63);
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
if (gdk_error_warnings)
{
char buf[64];
XGetErrorText (display, error->error_code, buf, 63);
#ifdef G_ENABLE_DEBUG
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
#else /* !G_ENABLE_DEBUG */
fprintf (stderr, "Gdk-ERROR **: %s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
exit(1);
#endif /* G_ENABLE_DEBUG */
}
gdk_error_code = error->error_code;
}
gdk_error_code = -1;
return 0;
}
@@ -1071,8 +1089,27 @@ gdk_x_error (Display *display,
static int
gdk_x_io_error (Display *display)
{
g_error ("an x io error occurred");
return 0;
/* This is basically modelled after the code in XLib. We need
* an explicit error handler here, so we can disable our atexit()
* which would otherwise cause a nice segfault.
* We fprintf(stderr, instead of g_warning() because g_warning()
* could possibly be redirected to a dialog
*/
if (errno == EPIPE)
{
fprintf (stderr, "Gdk-ERROR **: X connection to %s broken (explicit kill or server shutdown).\n", gdk_display ? DisplayString (gdk_display) : gdk_get_display());
}
else
{
fprintf (stderr, "Gdk-ERROR **: Fatal IO error %d (%s) on X server %s.\n",
errno, g_strerror (errno),
gdk_display ? DisplayString (gdk_display) : gdk_get_display());
}
/* Disable the atexit shutdown for GDK */
gdk_initialized = 0;
exit(1);
}
gchar *
@@ -1104,7 +1141,7 @@ gdk_error_trap_push (void)
}
else
{
node = g_slist_alloc();
node = g_slist_alloc ();
node->data = g_new (GdkErrorTrap, 1);
}
@@ -1166,7 +1203,7 @@ gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
XSync (gdk_display, False);
gdk_error_warnings = old_warnings;
return result && (gdk_error_code != -1);
return result && !gdk_error_code;
}
#ifndef HAVE_XCONVERTCASE

293
gdk/gdk.h
View File

@@ -66,11 +66,11 @@ void gdk_event_handler_set (GdkEventFunc func,
gpointer data,
GDestroyNotify notify);
void gdk_set_show_events (gint show_events);
void gdk_set_use_xshm (gint use_xshm);
void gdk_set_show_events (gboolean show_events);
void gdk_set_use_xshm (gboolean use_xshm);
gint gdk_get_show_events (void);
gint gdk_get_use_xshm (void);
gboolean gdk_get_show_events (void);
gboolean gdk_get_use_xshm (void);
gchar* gdk_get_display (void);
guint32 gdk_time_get (void);
@@ -90,20 +90,19 @@ gint gdk_input_add (gint source,
gpointer data);
void gdk_input_remove (gint tag);
gint gdk_pointer_grab (GdkWindow * window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow * confine_to,
GdkCursor * cursor,
guint32 time);
void gdk_pointer_ungrab (guint32 time);
gint gdk_pointer_grab (GdkWindow *window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time);
void gdk_pointer_ungrab (guint32 time);
gint gdk_keyboard_grab (GdkWindow *window,
gboolean owner_events,
guint32 time);
void gdk_keyboard_ungrab (guint32 time);
gboolean gdk_pointer_is_grabbed (void);
gint gdk_keyboard_grab (GdkWindow * window,
gint owner_events,
guint32 time);
void gdk_keyboard_ungrab (guint32 time);
gint gdk_pointer_is_grabbed (void);
gint gdk_screen_width (void);
gint gdk_screen_height (void);
@@ -300,8 +299,6 @@ void gdk_drag_drop (GdkDragContext *context,
void gdk_drag_abort (GdkDragContext *context,
guint32 time);
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
/* GdkWindow */
void gdk_window_set_hints (GdkWindow *window,
@@ -328,7 +325,7 @@ void gdk_window_set_background (GdkWindow *window,
GdkColor *color);
void gdk_window_set_back_pixmap (GdkWindow *window,
GdkPixmap *pixmap,
gint parent_relative);
gboolean parent_relative);
void gdk_window_set_cursor (GdkWindow *window,
GdkCursor *cursor);
void gdk_window_set_colormap (GdkWindow *window,
@@ -375,7 +372,7 @@ void gdk_window_set_icon (GdkWindow *window,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gdk_window_set_icon_name (GdkWindow *window,
gchar *name);
const gchar *name);
void gdk_window_set_group (GdkWindow *window,
GdkWindow *leader);
void gdk_window_set_decorations (GdkWindow *window,
@@ -444,7 +441,7 @@ void gdk_gc_set_clip_region (GdkGC *gc,
void gdk_gc_set_subwindow (GdkGC *gc,
GdkSubwindowMode mode);
void gdk_gc_set_exposures (GdkGC *gc,
gint exposures);
gboolean exposures);
void gdk_gc_set_line_attributes (GdkGC *gc,
gint line_width,
GdkLineStyle line_style,
@@ -452,7 +449,7 @@ void gdk_gc_set_line_attributes (GdkGC *gc,
GdkJoinStyle join_style);
void gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gchar dash_list[],
gint8 dash_list[],
gint n);
void gdk_gc_copy (GdkGC *dst_gc,
GdkGC *src_gc);
@@ -479,8 +476,8 @@ GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename);
GdkPixmap* gdk_pixmap_colormap_create_from_xpm
(GdkWindow *window,
GdkPixmap* gdk_pixmap_colormap_create_from_xpm (
GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
@@ -489,8 +486,8 @@ GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data);
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d
(GdkWindow *window,
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (
GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
@@ -529,77 +526,76 @@ void gdk_image_destroy (GdkImage *image);
/* Color
*/
GdkColormap* gdk_colormap_new (GdkVisual *visual,
gint allocate);
GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
void gdk_colormap_unref (GdkColormap *cmap);
GdkColormap* gdk_colormap_new (GdkVisual *visual,
gboolean allocate);
GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
void gdk_colormap_unref (GdkColormap *cmap);
GdkColormap* gdk_colormap_get_system (void);
gint gdk_colormap_get_system_size (void);
GdkColormap* gdk_colormap_get_system (void);
gint gdk_colormap_get_system_size (void);
void gdk_colormap_change (GdkColormap *colormap,
gint ncolors);
void gdk_colormap_change (GdkColormap *colormap,
gint ncolors);
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
gboolean writeable,
gboolean best_match,
gboolean *success);
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
GdkColor *color,
gboolean writeable,
gboolean best_match);
void gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors,
gboolean writeable,
gboolean best_match,
gboolean *success);
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
GdkColor *color,
gboolean writeable,
gboolean best_match);
void gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
GdkVisual* gdk_colormap_get_visual (GdkColormap *colormap);
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
GdkColor *gdk_color_copy (GdkColor *color);
void gdk_color_free (GdkColor *color);
GdkColor* gdk_color_copy (const GdkColor *color);
void gdk_color_free (GdkColor *color);
gint gdk_color_parse (const gchar *spec,
GdkColor *color);
guint gdk_color_hash (const GdkColor *colora,
const GdkColor *colorb);
gint gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
guint gdk_color_hash (const GdkColor *colora,
const GdkColor *colorb);
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
/* The following functions are deprecated */
void gdk_colors_store (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
gint gdk_colors_alloc (GdkColormap *colormap,
gint contiguous,
gulong *planes,
gint nplanes,
gulong *pixels,
gint npixels);
void gdk_colors_free (GdkColormap *colormap,
gulong *pixels,
gint npixels,
gulong planes);
gint gdk_color_white (GdkColormap *colormap,
GdkColor *color);
gint gdk_color_black (GdkColormap *colormap,
GdkColor *color);
gint gdk_color_alloc (GdkColormap *colormap,
GdkColor *color);
gint gdk_color_change (GdkColormap *colormap,
GdkColor *color);
void gdk_colors_store (GdkColormap *colormap,
GdkColor *colors,
gint ncolors);
gboolean gdk_colors_alloc (GdkColormap *colormap,
gboolean contiguous,
gulong *planes,
gint nplanes,
gulong *pixels,
gint npixels);
void gdk_colors_free (GdkColormap *colormap,
gulong *pixels,
gint npixels,
gulong planes);
gboolean gdk_color_white (GdkColormap *colormap,
GdkColor *color);
gboolean gdk_color_black (GdkColormap *colormap,
GdkColor *color);
gboolean gdk_color_alloc (GdkColormap *colormap,
GdkColor *color);
gboolean gdk_color_change (GdkColormap *colormap,
GdkColor *color);
/* Fonts
*/
GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (gchar *fontset_name);
GdkFont* gdk_fontset_load (const gchar *fontset_name);
GdkFont* gdk_font_ref (GdkFont *font);
void gdk_font_unref (GdkFont *font);
gint gdk_font_id (const GdkFont *font);
gint gdk_font_equal (const GdkFont *fonta,
gboolean gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb);
gint gdk_string_width (GdkFont *font,
const gchar *string);
@@ -714,15 +710,6 @@ void gdk_draw_pixmap (GdkDrawable *drawable,
gint ydest,
gint width,
gint height);
void gdk_draw_bitmap (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void gdk_draw_image (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
@@ -750,7 +737,7 @@ void gdk_draw_lines (GdkDrawable *drawable,
/* Selections
*/
gint gdk_selection_owner_set (GdkWindow *owner,
gboolean gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gint send_event);
@@ -759,7 +746,7 @@ void gdk_selection_convert (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time);
gint gdk_selection_property_get (GdkWindow *requestor,
gboolean gdk_selection_property_get (GdkWindow *requestor,
guchar **data,
GdkAtom *prop_type,
gint *prop_format);
@@ -769,89 +756,87 @@ void gdk_selection_send_notify (guint32 requestor,
GdkAtom property,
guint32 time);
gint gdk_text_property_to_text_list (GdkAtom encoding, gint format,
gint gdk_text_property_to_text_list (GdkAtom encoding, gint format,
guchar *text, gint length,
gchar ***list);
void gdk_free_text_list (gchar **list);
gint gdk_string_to_compound_text (gchar *str,
gint gdk_string_to_compound_text (const gchar *str,
GdkAtom *encoding, gint *format,
guchar **ctext, gint *length);
void gdk_free_compound_text (guchar *ctext);
/* Properties
*/
GdkAtom gdk_atom_intern (const gchar *atom_name,
gint only_if_exists);
gchar* gdk_atom_name (GdkAtom atom);
gint gdk_property_get (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
gulong length,
gint pdelete,
GdkAtom *actual_property_type,
gint *actual_format,
gint *actual_length,
guchar **data);
GdkAtom gdk_atom_intern (const gchar *atom_name,
gint only_if_exists);
gchar* gdk_atom_name (GdkAtom atom);
gboolean gdk_property_get (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gulong offset,
gulong length,
gint pdelete,
GdkAtom *actual_property_type,
gint *actual_format,
gint *actual_length,
guchar **data);
void gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
guchar *data,
gint nelements);
void gdk_property_delete (GdkWindow *window,
GdkAtom property);
void gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
guchar *data,
gint nelements);
void gdk_property_delete (GdkWindow *window,
GdkAtom property);
/* Rectangle utilities
*/
gint gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
gboolean gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
/* XInput support
*/
void gdk_input_init (void);
void gdk_input_exit (void);
GList *gdk_input_list_devices (void);
void gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode);
void gdk_input_set_source (guint32 deviceid,
GdkInputSource source);
gint gdk_input_set_mode (guint32 deviceid,
GdkInputMode mode);
void gdk_input_set_axes (guint32 deviceid,
GdkAxisUse *axes);
void gdk_input_set_key (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers);
void gdk_input_window_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return);
void gdk_input_init (void);
void gdk_input_exit (void);
GList * gdk_input_list_devices (void);
void gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode);
void gdk_input_set_source (guint32 deviceid,
GdkInputSource source);
gboolean gdk_input_set_mode (guint32 deviceid,
GdkInputMode mode);
void gdk_input_set_axes (guint32 deviceid,
GdkAxisUse *axes);
void gdk_input_set_key (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers);
void gdk_input_window_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return);
/* International Input Method Support Functions
*/
gint gdk_im_ready (void);
gboolean gdk_im_ready (void);
void gdk_im_begin (GdkIC *ic,
GdkWindow *window);

View File

@@ -491,10 +491,11 @@ init_palette (GdkColorContext *cc)
if (cc->color_hash)
{
/* XXX: quick-and-dirty way to remove everything */
g_hash_table_foreach (cc->color_hash,
free_hash_entry,
NULL);
g_hash_table_destroy (cc->color_hash);
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
cc->color_hash = NULL;
}
cc->palette = NULL;
@@ -618,11 +619,6 @@ gdk_color_context_new (GdkVisual *visual,
g_message ("gdk_color_context_new: screen depth is %i, no. of colors is %i\n",
cc->visual->depth, cc->num_colors));
/* check if we need to initialize a hash table */
if ((cc->mode == GDK_CC_MODE_STD_CMAP) || (cc->mode == GDK_CC_MODE_UNDEFINED))
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
return (GdkColorContext *) cc;
}
@@ -677,17 +673,9 @@ gdk_color_context_free (GdkColorContext *cc)
gdk_colormap_unref (cc->colormap);
/* free any palette that has been associated with this GdkColorContext */
init_palette (cc);
if (cc->color_hash)
{
g_hash_table_foreach (cc->color_hash,
free_hash_entry,
NULL);
g_hash_table_destroy (cc->color_hash);
}
g_free (cc);
}
@@ -780,13 +768,14 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
default:
{
GdkColor color;
GdkColor *result;
GdkColor *result = NULL;
color.red = red;
color.green = green;
color.blue = blue;
result = g_hash_table_lookup (cc->color_hash, &color);
if (cc->color_hash)
result = g_hash_table_lookup (cc->color_hash, &color);
if (!result)
{
@@ -831,6 +820,9 @@ gdk_color_context_get_pixel (GdkColorContext *cc,
cnew = g_new (GdkColor, 1);
*cnew = color;
if (!cc->color_hash)
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
g_hash_table_insert (cc->color_hash, cnew, cnew);
cc->clut[cc->num_allocated] = color.pixel;
@@ -1489,20 +1481,7 @@ gdk_color_context_add_palette (GdkColorContext *cc,
/* restore previous mode if we aren't adding a new palette */
if (num_palette == 0)
{
/* GDK_CC_MODE_STD_CMAP uses a hash table, so we'd better initialize one */
/* XXX: here, the hash table is already initialized */
return 0;
}
/* Initialize a hash table for this palette (we need one for allocating
* the pixels in the palette using the current settings)
*/
if (cc->color_hash == NULL)
cc->color_hash = g_hash_table_new (hash_color, compare_colors);
return 0;
/* copy incoming palette */
@@ -1549,6 +1528,9 @@ gdk_color_context_add_palette (GdkColorContext *cc,
if (cc->color_hash)
{
g_hash_table_foreach (cc->color_hash,
free_hash_entry,
NULL);
g_hash_table_destroy (cc->color_hash);
cc->color_hash = NULL;
}

View File

@@ -46,7 +46,7 @@ static GHashTable *colormap_hash = NULL;
GdkColormap*
gdk_colormap_new (GdkVisual *visual,
gint private_cmap)
gboolean private_cmap)
{
GdkColormap *colormap;
GdkColormapPrivate *private;
@@ -70,7 +70,7 @@ gdk_colormap_new (GdkVisual *visual,
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
colormap->size = visual->colormap_size;
colormap->colors = g_new (GdkColor, colormap->size);
colormap->colors = NULL;
switch (visual->type)
{
@@ -117,6 +117,7 @@ gdk_colormap_new (GdkVisual *visual,
private->private_val = TRUE;
private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window,
xvisual, AllocAll);
colormap->colors = g_new (GdkColor, colormap->size);
size = 1 << visual->red_prec;
for (i = 0; i < size; i++)
@@ -403,7 +404,7 @@ gdk_colors_store (GdkColormap *colormap,
gboolean
gdk_colors_alloc (GdkColormap *colormap,
gint contiguous,
gboolean contiguous,
gulong *planes,
gint nplanes,
gulong *pixels,
@@ -429,56 +430,7 @@ gdk_colors_alloc (GdkColormap *colormap,
}
}
return return_val;
}
/* This is almost identical to gdk_colormap_free_colors.
* Keep them in sync!
*/
void
gdk_colors_free (GdkColormap *colormap,
gulong *in_pixels,
gint in_npixels,
gulong planes)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (in_pixels != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, in_npixels);
for (i=0; i<in_npixels; i++)
{
gulong pixel = in_pixels[i];
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[in_pixels[i]]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, planes);
g_free (pixels);
return return_val != 0;
}
/*
@@ -499,7 +451,7 @@ gdk_colors_free (GdkColormap *colormap,
static GMemChunk *color_chunk;
GdkColor*
gdk_color_copy (GdkColor *color)
gdk_color_copy (const GdkColor *color)
{
GdkColor *new_color;
@@ -537,7 +489,7 @@ gdk_color_free (GdkColor *color)
g_mem_chunk_free (color_chunk, color);
}
gint
gboolean
gdk_color_white (GdkColormap *colormap,
GdkColor *color)
{
@@ -560,7 +512,7 @@ gdk_color_white (GdkColormap *colormap,
return return_val;
}
gint
gboolean
gdk_color_black (GdkColormap *colormap,
GdkColor *color)
{
@@ -609,6 +561,104 @@ gdk_color_parse (const gchar *spec,
return return_val;
}
/* This is almost identical to gdk_colormap_free_colors.
* Keep them in sync!
*/
void
gdk_colors_free (GdkColormap *colormap,
gulong *in_pixels,
gint in_npixels,
gulong planes)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (in_pixels != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, in_npixels);
for (i=0; i<in_npixels; i++)
{
gulong pixel = in_pixels[i];
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, planes);
g_free (pixels);
}
/* This is almost identical to gdk_colors_free.
* Keep them in sync!
*/
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (colors != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, ncolors);
for (i=0; i<ncolors; i++)
{
gulong pixel = colors[i].pixel;
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, 0);
g_free (pixels);
}
/********************
* Color allocation *
********************/
@@ -649,6 +699,7 @@ gdk_colormap_alloc1 (GdkColormap *colormap,
else
{
colormap->colors[ret->pixel] = *color;
colormap->colors[ret->pixel].pixel = ret->pixel;
private->info[ret->pixel].ref_count = 1;
g_hash_table_insert (private->hash,
@@ -1026,55 +1077,6 @@ gdk_colormap_alloc_color (GdkColormap *colormap,
return success;
}
/* This is almost identical to gdk_colors_free.
* Keep them in sync!
*/
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (colors != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, ncolors);
for (i=0; i<ncolors; i++)
{
gulong pixel = colors[i].pixel;
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colors[i]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, 0);
g_free (pixels);
}
gboolean
gdk_color_alloc (GdkColormap *colormap,
GdkColor *color)
@@ -1118,7 +1120,7 @@ gdk_color_hash (const GdkColor *colora,
(colora->blue >> 6));
}
gint
gboolean
gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb)
{

View File

@@ -31,8 +31,6 @@
#include "gdk/gdkprivate.h"
#include "gdk.h"
#define NEW_DRAGS
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
typedef enum {
@@ -70,7 +68,8 @@ struct _GdkDragContextPrivate {
GdkDragAction old_actions; /* The last actions we sent to the source */
GdkDragAction xdnd_actions; /* What is currently set in XdndActionList */
Window dest_xid;
Window dest_xid; /* The last window we looked up */
Window drop_xid; /* The (non-proxied) window that is receiving drops */
guint xdnd_targets_set : 1; /* Whether we've already set XdndTypeList */
guint xdnd_actions_set : 1; /* Whether we've already set XdndActionList */
guint xdnd_have_actions : 1; /* Whether an XdndActionList was provided */
@@ -151,6 +150,7 @@ gdk_drag_context_unref (GdkDragContext *context)
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
g_return_if_fail (context != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count--;
@@ -196,8 +196,8 @@ gdk_drag_context_find (gboolean is_source,
private = (GdkDragContextPrivate *)context;
context_dest_xid = context->dest_window ?
(private->dest_xid ?
private->dest_xid :
(private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window)) :
None;
@@ -387,7 +387,7 @@ gdk_window_cache_new (void)
xwa.x, xwa.y, xwa.width, xwa.height,
xwa.map_state != IsUnmapped);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else
{
@@ -441,9 +441,10 @@ get_client_window_at_coords_recurse (Window win,
wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -458,9 +459,10 @@ get_client_window_at_coords_recurse (Window win,
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -469,7 +471,7 @@ get_client_window_at_coords_recurse (Window win,
&root, &tmp_parent, &children, &nchildren) == 0)
return 0;
if (gdk_error_code == 0)
if (!gdk_error_code)
{
for (i = nchildren - 1; (i >= 0) && (child == None); i--)
{
@@ -477,7 +479,7 @@ get_client_window_at_coords_recurse (Window win,
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
(x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
@@ -566,9 +568,10 @@ get_client_window_at_coords_recurse (Window win,
wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -581,9 +584,10 @@ get_client_window_at_coords_recurse (Window win,
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -620,7 +624,7 @@ get_client_window_at_coords (Window ignore,
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) &&
(x_root >= xwa.x) && (x_root < xwa.x + (gint)xwa.width) &&
@@ -869,7 +873,7 @@ motif_find_drag_window (gboolean create)
Display *display;
XSetWindowAttributes attr;
display = XOpenDisplay (NULL);
display = XOpenDisplay (gdk_display_name);
XSetCloseDownMode (display, RetainPermanent);
XGrabServer (display);
@@ -943,6 +947,7 @@ motif_read_target_table (void)
guchar *p;
gboolean success = FALSE;
gdk_error_trap_push ();
XGetWindowProperty (gdk_display, motif_drag_window,
motif_drag_targets_atom,
0, (sizeof(MotifTargetTableHeader)+3)/4, FALSE,
@@ -950,12 +955,13 @@ motif_read_target_table (void)
&type, &format, &nitems, &bytes_after,
(guchar **)&header);
if ((format != 8) || (nitems < sizeof (MotifTargetTableHeader)))
if (gdk_error_trap_pop () || (format != 8) || (nitems < sizeof (MotifTargetTableHeader)))
goto error;
header->n_lists = card16_to_host (header->n_lists, header->byte_order);
header->total_size = card32_to_host (header->total_size, header->byte_order);
gdk_error_trap_push ();
XGetWindowProperty (gdk_display, motif_drag_window, motif_drag_targets_atom,
(sizeof(MotifTargetTableHeader)+3)/4,
(header->total_size + 3)/4 - (sizeof(MotifTargetTableHeader) + 3)/4,
@@ -963,7 +969,7 @@ motif_read_target_table (void)
motif_drag_targets_atom, &type, &format, &nitems,
&bytes_after, &target_bytes);
if ((format != 8) || (bytes_after != 0) ||
if (gdk_error_trap_pop () || (format != 8) || (bytes_after != 0) ||
(nitems != header->total_size - sizeof(MotifTargetTableHeader)))
goto error;
@@ -1287,29 +1293,33 @@ motif_check_dest (Window win)
if (!motif_drag_receiver_info_atom)
motif_drag_receiver_info_atom = gdk_atom_intern ("_MOTIF_DRAG_RECEIVER_INFO", FALSE);
gdk_error_trap_push ();
XGetWindowProperty (gdk_display, win,
motif_drag_receiver_info_atom,
0, (sizeof(*info)+3)/4, False, AnyPropertyType,
&type, &format, &nitems, &after,
(guchar **)&info);
if (type != None)
{
if ((format == 8) && (nitems == sizeof(*info)))
{
if ((info->protocol_version == 0) &&
((info->protocol_style == XmDRAG_PREFER_PREREGISTER) ||
(info->protocol_style == XmDRAG_PREFER_DYNAMIC) ||
(info->protocol_style == XmDRAG_DYNAMIC)))
retval = TRUE;
}
else
{
GDK_NOTE (DND,
g_warning ("Invalid Motif drag receiver property on window %ld\n", win));
}
XFree (info);
if (gdk_error_trap_pop() == 0)
{
if (type != None)
{
if ((format == 8) && (nitems == sizeof(*info)))
{
if ((info->protocol_version == 0) &&
((info->protocol_style == XmDRAG_PREFER_PREREGISTER) ||
(info->protocol_style == XmDRAG_PREFER_DYNAMIC) ||
(info->protocol_style == XmDRAG_DYNAMIC)))
retval = TRUE;
}
else
{
GDK_NOTE (DND,
g_warning ("Invalid Motif drag receiver property on window %ld\n", win));
}
XFree (info);
}
}
return retval ? win : GDK_NONE;
@@ -1468,13 +1478,14 @@ motif_read_initiator_info (Window source_window,
if (!motif_drag_initiator_info)
motif_drag_initiator_info = gdk_atom_intern ("_MOTIF_DRAG_INITIATOR_INFO", FALSE);
gdk_error_trap_push ();
XGetWindowProperty (gdk_display, source_window, atom,
0, sizeof(*initiator_info), FALSE,
motif_drag_initiator_info,
&type, &format, &nitems, &bytes_after,
(guchar **)&initiator_info);
if ((format != 8) || (nitems != sizeof (MotifDragInitiatorInfo)) || (bytes_after != 0))
if (gdk_error_trap_pop () || (format != 8) || (nitems != sizeof (MotifDragInitiatorInfo)) || (bytes_after != 0))
{
g_warning ("Error reading initiator info\n");
return FALSE;
@@ -2027,6 +2038,8 @@ xdnd_set_targets (GdkDragContext *context)
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
g_free (atomlist);
private->xdnd_targets_set = 1;
}
@@ -2073,6 +2086,8 @@ xdnd_set_actions (GdkDragContext *context)
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
g_free (atomlist);
private->xdnd_actions_set = 1;
private->xdnd_actions = context->actions;
}
@@ -2106,13 +2121,9 @@ xdnd_send_enter (GdkDragContext *context)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = (3 << 24); /* version */
xev.xclient.data.l[2] = 0;
@@ -2162,13 +2173,9 @@ xdnd_send_leave (GdkDragContext *context)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
@@ -2195,13 +2202,9 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
@@ -2232,13 +2235,9 @@ xdnd_send_motion (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root;
@@ -2313,7 +2312,7 @@ xdnd_check_dest (Window win)
{
if ((format == 32) && (nitems == 1))
{
if (*version == 3)
if (*version >= 3)
retval = TRUE;
}
else
@@ -2517,13 +2516,14 @@ xdnd_enter_filter (GdkXEvent *xev,
new_context->targets = NULL;
if (get_types)
{
gdk_error_trap_push ();
XGetWindowProperty (GDK_WINDOW_XDISPLAY (event->any.window),
source_window,
gdk_atom_intern ("XdndTypeList", FALSE), 0, 65536,
False, XA_ATOM, &type, &format, &nitems,
&after, (guchar **)&data);
if ((format != 32) || (type != XA_ATOM))
if (gdk_error_trap_pop () || (format != 32) || (type != XA_ATOM))
{
gdk_drag_context_unref (new_context);
return GDK_FILTER_REMOVE;
@@ -2785,10 +2785,12 @@ gdk_drag_get_protocol (guint32 xid,
if (xid == gdk_root_window)
rootwin = TRUE;
gdk_error_warnings = 0;
if (!rootwin)
{
gdk_error_code = 0;
XGetWindowProperty (gdk_display, xid,
gdk_atom_intern ("ENLIGHTENMENT_DESKTOP", FALSE),
0, 0, False, AnyPropertyType,
@@ -2859,6 +2861,12 @@ gdk_drag_find_window (GdkDragContext *context,
/* Check if new destination accepts drags, and which protocol */
/* There is some ugliness here. We actually need to pass
* _three_ pieces of information to drag_motion - dest_window,
* protocol, and the XID of the unproxied window. The first
* two are passed explicitely, the third implicitly through
* protocol->dest_xid.
*/
if ((recipient = gdk_drag_get_protocol (dest, protocol)))
{
*dest_window = gdk_window_lookup (recipient);
@@ -2917,6 +2925,7 @@ gdk_drag_motion (GdkDragContext *context,
if (dest_window)
{
context->dest_window = dest_window;
private->drop_xid = private->dest_xid;
gdk_window_ref (context->dest_window);
context->protocol = protocol;
@@ -2941,6 +2950,7 @@ gdk_drag_motion (GdkDragContext *context,
else
{
context->dest_window = NULL;
private->drop_xid = None;
context->action = 0;
}

View File

@@ -501,12 +501,14 @@ gdk_draw_lines (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawLines (drawable_private->xdisplay,
drawable_private->xwindow,
gc_private->xgc,
(XPoint *) points,
npoints,
CoordModeOrigin);
drawable_private->xwindow,
gc_private->xgc,
(XPoint *) points,
npoints,
CoordModeOrigin);
}

View File

@@ -27,7 +27,6 @@
#include "gdk.h"
#include "gdkx.h"
#include "gdkprivate.h"
#include "gdkinput.h"
#include "gdkkeysyms.h"
#if HAVE_CONFIG_H
@@ -37,6 +36,7 @@
# endif
#endif
#include "gdkinput.h"
typedef struct _GdkIOClosure GdkIOClosure;
typedef struct _GdkEventPrivate GdkEventPrivate;
@@ -88,9 +88,11 @@ static GdkEvent* gdk_event_unqueue (void);
static gboolean gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout);
gint *timeout,
gpointer user_data);
static gboolean gdk_event_check (gpointer source_data,
GTimeVal *current_time);
GTimeVal *current_time,
gpointer user_data);
static gboolean gdk_event_dispatch (gpointer source_data,
GTimeVal *current_time,
gpointer user_data);
@@ -434,6 +436,10 @@ gdk_compress_exposures (XEvent *xevent,
rect1.width = xevent->xexpose.width;
rect1.height = xevent->xexpose.height;
event.any.type = GDK_EXPOSE;
event.any.window = None;
event.any.send_event = FALSE;
while (1)
{
if (count == 0)
@@ -449,6 +455,8 @@ gdk_compress_exposures (XEvent *xevent,
&tmp_event,
expose_predicate,
(XPointer)&info);
event.any.window = window;
/* We apply filters here, and if it was filtered, completely
* ignore the return
@@ -824,7 +832,7 @@ gdk_event_get_time (GdkEvent *event)
*/
void
gdk_set_show_events (gint show_events)
gdk_set_show_events (gboolean show_events)
{
if (show_events)
gdk_debug_flags |= GDK_DEBUG_EVENTS;
@@ -832,10 +840,10 @@ gdk_set_show_events (gint show_events)
gdk_debug_flags &= ~GDK_DEBUG_EVENTS;
}
gint
gboolean
gdk_get_show_events (void)
{
return gdk_debug_flags & GDK_DEBUG_EVENTS;
return (gdk_debug_flags & GDK_DEBUG_EVENTS) != 0;
}
static void
@@ -849,6 +857,12 @@ gdk_io_destroy (gpointer data)
g_free (closure);
}
/* What do we do with G_IO_NVAL?
*/
#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
#define EXCEPTION_CONDITION (G_IO_PRI)
static gboolean
gdk_io_invoke (GIOChannel *source,
GIOCondition condition,
@@ -857,11 +871,11 @@ gdk_io_invoke (GIOChannel *source,
GdkIOClosure *closure = data;
GdkInputCondition gdk_cond = 0;
if (condition & (G_IO_IN | G_IO_PRI))
if (condition & READ_CONDITION)
gdk_cond |= GDK_INPUT_READ;
if (condition & G_IO_OUT)
if (condition & WRITE_CONDITION)
gdk_cond |= GDK_INPUT_WRITE;
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
if (condition & EXCEPTION_CONDITION)
gdk_cond |= GDK_INPUT_EXCEPTION;
if (closure->condition & gdk_cond)
@@ -888,11 +902,11 @@ gdk_input_add_full (gint source,
closure->data = data;
if (condition & GDK_INPUT_READ)
cond |= (G_IO_IN | G_IO_PRI);
cond |= READ_CONDITION;
if (condition & GDK_INPUT_WRITE)
cond |= G_IO_OUT;
cond |= WRITE_CONDITION;
if (condition & GDK_INPUT_EXCEPTION)
cond |= G_IO_ERR|G_IO_HUP|G_IO_NVAL;
cond |= EXCEPTION_CONDITION;
channel = g_io_channel_unix_new (source);
result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, cond,
@@ -923,7 +937,6 @@ gdk_event_apply_filters (XEvent *xevent,
GdkEvent *event,
GList *filters)
{
GdkEventFilter *filter;
GList *tmp_list;
GdkFilterReturn result;
@@ -931,13 +944,12 @@ gdk_event_apply_filters (XEvent *xevent,
while (tmp_list)
{
filter = (GdkEventFilter*) tmp_list->data;
result = (*filter->function) (xevent, event, filter->data);
if (result != GDK_FILTER_CONTINUE)
return result;
GdkEventFilter *filter = (GdkEventFilter*) tmp_list->data;
tmp_list = tmp_list->next;
result = filter->function (xevent, event, filter->data);
if (result != GDK_FILTER_CONTINUE)
return result;
}
return GDK_FILTER_CONTINUE;
@@ -1002,7 +1014,7 @@ gdk_event_translate (GdkEvent *event,
gdk_window_ref (window);
event->any.window = window;
event->any.send_event = xevent->xany.send_event;
event->any.send_event = xevent->xany.send_event ? TRUE : FALSE;
if (window_private && window_private->destroyed)
{
@@ -1057,9 +1069,6 @@ gdk_event_translate (GdkEvent *event,
}
#endif
if (window == NULL)
g_message ("Got event for unknown window: %#lx\n", xevent->xany.window);
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
* the conversion is fairly straightforward. We also
@@ -1513,10 +1522,11 @@ gdk_event_translate (GdkEvent *event,
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d",
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s",
xevent->xexpose.window, xevent->xexpose.count,
xevent->xexpose.x, xevent->xexpose.y,
xevent->xexpose.width, xevent->xexpose.height));
xevent->xexpose.width, xevent->xexpose.height,
event->any.send_event ? " (send)" : ""));
gdk_compress_exposures (xevent, window);
event->expose.type = GDK_EXPOSE;
@@ -1601,7 +1611,17 @@ gdk_event_translate (GdkEvent *event,
break;
case CreateNotify:
/* Not currently handled */
GDK_NOTE (EVENTS,
g_message ("create notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d parent: %ld ovr: %d",
xevent->xcreatewindow.window,
xevent->xcreatewindow.x,
xevent->xcreatewindow.y,
xevent->xcreatewindow.width,
xevent->xcreatewindow.height,
xevent->xcreatewindow.border_width,
xevent->xcreatewindow.parent,
xevent->xcreatewindow.override_redirect));
/* not really handled */
break;
case DestroyNotify:
@@ -1616,7 +1636,7 @@ gdk_event_translate (GdkEvent *event,
return_val = window_private && !window_private->destroyed;
if(window && window_private->xwindow != GDK_ROOT_WINDOW())
if (window && window_private->xwindow != GDK_ROOT_WINDOW())
gdk_window_destroy_notify (window);
break;
@@ -1651,8 +1671,12 @@ gdk_event_translate (GdkEvent *event,
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("reparent notify:\twindow: %ld",
xevent->xreparent.window));
g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d",
xevent->xreparent.window,
xevent->xreparent.x,
xevent->xreparent.y,
xevent->xreparent.parent,
xevent->xreparent.override_redirect));
/* Not currently handled */
return_val = FALSE;
@@ -1661,9 +1685,10 @@ gdk_event_translate (GdkEvent *event,
case ConfigureNotify:
/* Print debugging info.
*/
while ((XPending (gdk_display) > 0) &&
XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
ConfigureNotify, xevent))
while (0 && /* don't reorder ConfigureNotify events at all */
XPending (gdk_display) > 0 &&
XCheckTypedWindowEvent (gdk_display, xevent->xany.window,
ConfigureNotify, xevent))
{
GdkFilterReturn result;
@@ -1690,7 +1715,7 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS,
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d",
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s",
xevent->xconfigure.window,
xevent->xconfigure.x,
xevent->xconfigure.y,
@@ -1698,14 +1723,19 @@ gdk_event_translate (GdkEvent *event,
xevent->xconfigure.height,
xevent->xconfigure.border_width,
xevent->xconfigure.above,
xevent->xconfigure.override_redirect));
if (!window_private->destroyed &&
xevent->xconfigure.override_redirect,
!window
? " (discarding)"
: window_private->window_type == GDK_WINDOW_CHILD
? " (discarding child)"
: ""));
if (window &&
!window_private->destroyed &&
(window_private->extension_events != 0) &&
gdk_input_vtable.configure_event)
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
if (window_private->window_type == GDK_WINDOW_CHILD)
if (!window || window_private->window_type == GDK_WINDOW_CHILD)
return_val = FALSE;
else
{
@@ -1721,17 +1751,23 @@ gdk_event_translate (GdkEvent *event,
gint tx = 0;
gint ty = 0;
Window child_window = 0;
if (!XTranslateCoordinates (window_private->xdisplay,
window_private->xwindow,
gdk_root_window,
0, 0,
&tx, &ty,
&child_window))
g_warning ("GdkWindow %ld doesn't share root windows display?",
window_private->xwindow);
event->configure.x = tx;
event->configure.y = ty;
gdk_error_trap_push ();
if (XTranslateCoordinates (window_private->xdisplay,
window_private->xwindow,
gdk_root_window,
0, 0,
&tx, &ty,
&child_window))
{
if (!gdk_error_trap_pop ())
{
event->configure.x = tx;
event->configure.y = ty;
}
}
else
gdk_error_trap_pop ();
}
else
{
@@ -1751,8 +1787,14 @@ gdk_event_translate (GdkEvent *event,
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("property notify:\twindow: %ld",
xevent->xproperty.window));
gchar *atom = gdk_atom_name (xevent->xproperty.atom);
g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s",
xevent->xproperty.window,
xevent->xproperty.atom,
atom ? "\"" : "",
atom ? atom : "unknown",
atom ? "\"" : "");
);
event->property.type = GDK_PROPERTY_NOTIFY;
event->property.window = window;
@@ -1910,8 +1952,8 @@ gdk_event_translate (GdkEvent *event,
GdkFilterReturn
gdk_wm_protocols_filter (GdkXEvent *xev,
GdkEvent *event,
gpointer data)
GdkEvent *event,
gpointer data)
{
XEvent *xevent = (XEvent *)xev;
@@ -1993,8 +2035,7 @@ gdk_events_queue (void)
event->any.type = GDK_NOTHING;
event->any.window = NULL;
event->any.send_event = FALSE;
event->any.send_event = xevent.xany.send_event;
event->any.send_event = xevent.xany.send_event ? TRUE : FALSE;
((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING;
@@ -2017,7 +2058,8 @@ gdk_events_queue (void)
static gboolean
gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout)
gint *timeout,
gpointer user_data)
{
gboolean retval;
@@ -2034,7 +2076,8 @@ gdk_event_prepare (gpointer source_data,
static gboolean
gdk_event_check (gpointer source_data,
GTimeVal *current_time)
GTimeVal *current_time,
gpointer user_data)
{
gboolean retval;
@@ -2133,29 +2176,29 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
guint level)
{
static GdkAtom wm_state_atom = GDK_NONE;
Atom type = None;
int format;
unsigned long nitems, after;
unsigned char *data;
Window *ret_children, ret_root, ret_parent;
unsigned int ret_nchildren;
int i;
gint old_warnings = gdk_error_warnings;
gboolean send = FALSE;
gboolean found = FALSE;
int i;
if (!wm_state_atom)
wm_state_atom = gdk_atom_intern ("WM_STATE", FALSE);
gdk_error_warnings = FALSE;
gdk_error_code = 0;
XGetWindowProperty (gdk_display, xid, wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code)
{
gdk_error_code = 0;
gdk_error_warnings = old_warnings;
return FALSE;
}
@@ -2167,18 +2210,20 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
else
{
/* OK, we're all set, now let's find some windows to send this to */
if (XQueryTree(gdk_display, xid, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True)
return FALSE;
if (gdk_error_code)
return FALSE;
if (XQueryTree (gdk_display, xid, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True ||
gdk_error_code)
{
gdk_error_warnings = old_warnings;
return FALSE;
}
for(i = 0; i < ret_nchildren; i++)
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
if (gdk_event_send_client_message_to_all_recurse (xev, ret_children[i], level + 1))
found = TRUE;
XFree(ret_children);
XFree (ret_children);
}
if (send || (!found && (level == 1)))
@@ -2187,6 +2232,8 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
gdk_send_xevent (xid, False, NoEventMask, xev);
}
gdk_error_warnings = old_warnings;
return (send || found);
}

View File

@@ -29,38 +29,112 @@
#include "gdk.h"
#include "gdkprivate.h"
static GHashTable *font_name_hash = NULL;
static GHashTable *fontset_name_hash = NULL;
static void
gdk_font_hash_insert (GdkFontType type, GdkFont *font, const gchar *font_name)
{
GdkFontPrivate *private = (GdkFontPrivate *)font;
GHashTable **hashp = (type == GDK_FONT_FONT) ?
&font_name_hash : &fontset_name_hash;
if (!*hashp)
*hashp = g_hash_table_new (g_str_hash, g_str_equal);
private->names = g_slist_prepend (private->names, g_strdup (font_name));
g_hash_table_insert (*hashp, private->names->data, font);
}
static void
gdk_font_hash_remove (GdkFontType type, GdkFont *font)
{
GdkFontPrivate *private = (GdkFontPrivate *)font;
GSList *tmp_list;
GHashTable *hash = (type == GDK_FONT_FONT) ?
font_name_hash : fontset_name_hash;
tmp_list = private->names;
while (tmp_list)
{
g_hash_table_remove (hash, tmp_list->data);
g_free (tmp_list->data);
tmp_list = tmp_list->next;
}
g_slist_free (private->names);
private->names = NULL;
}
static GdkFont *
gdk_font_hash_lookup (GdkFontType type, const gchar *font_name)
{
GdkFont *result;
GHashTable *hash = (type == GDK_FONT_FONT) ?
font_name_hash : fontset_name_hash;
if (!hash)
return NULL;
else
{
result = g_hash_table_lookup (hash, font_name);
if (result)
gdk_font_ref (result);
return result;
}
}
GdkFont*
gdk_font_load (const gchar *font_name)
{
GdkFont *font;
GdkFontPrivate *private;
XFontStruct *xfont;
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
g_return_val_if_fail (font_name != NULL, NULL);
private->xdisplay = gdk_display;
private->xfont = XLoadQueryFont (private->xdisplay, font_name);
private->ref_count = 1;
font = gdk_font_hash_lookup (GDK_FONT_FONT, font_name);
if (font)
return font;
if (!private->xfont)
xfont = XLoadQueryFont (gdk_display, font_name);
if (xfont == NULL)
return NULL;
font = gdk_font_lookup (xfont->fid);
if (font != NULL)
{
g_free (font);
return NULL;
private = (GdkFontPrivate *) font;
if (xfont != private->xfont)
XFreeFont (gdk_display, xfont);
gdk_font_ref (font);
}
else
{
private = g_new (GdkFontPrivate, 1);
private->xdisplay = gdk_display;
private->xfont = xfont;
private->ref_count = 1;
private->names = NULL;
font = (GdkFont*) private;
font->type = GDK_FONT_FONT;
font->ascent = ((XFontStruct *) private->xfont)->ascent;
font->descent = ((XFontStruct *) private->xfont)->descent;
font->ascent = xfont->ascent;
font->descent = xfont->descent;
gdk_xid_table_insert (&xfont->fid, font);
}
gdk_xid_table_insert (&((XFontStruct *) private->xfont)->fid, font);
gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
return font;
}
GdkFont*
gdk_fontset_load (gchar *fontset_name)
gdk_fontset_load (const gchar *fontset_name)
{
GdkFont *font;
GdkFontPrivate *private;
@@ -69,6 +143,10 @@ gdk_fontset_load (gchar *fontset_name)
gchar **missing_charset_list;
gchar *def_string;
font = gdk_font_hash_lookup (GDK_FONT_FONTSET, fontset_name);
if (font)
return font;
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
@@ -111,8 +189,12 @@ gdk_fontset_load (gchar *fontset_name)
font->ascent = MAX (font->ascent, font_structs[i]->ascent);
font->descent = MAX (font->descent, font_structs[i]->descent);
}
private->names = NULL;
gdk_font_hash_insert (GDK_FONT_FONTSET, font, fontset_name);
return font;
}
return font;
}
GdkFont*
@@ -131,14 +213,16 @@ void
gdk_font_unref (GdkFont *font)
{
GdkFontPrivate *private;
private = (GdkFontPrivate*) font;
g_return_if_fail (font != NULL);
private = (GdkFontPrivate*) font;
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
{
gdk_font_hash_remove (font->type, font);
switch (font->type)
{
case GDK_FONT_FONT:
@@ -175,7 +259,7 @@ gdk_font_id (const GdkFont *font)
}
}
gint
gboolean
gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb)
{
@@ -195,12 +279,16 @@ gdk_font_equal (const GdkFont *fonta,
}
else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
{
/* how to compare two fontsets ?? by basename or XFontSet ?? */
return (((XFontSet) privatea->xfont) == ((XFontSet) privateb->xfont));
gchar *namea, *nameb;
namea = XBaseFontNameListOfFontSet((XFontSet) privatea->xfont);
nameb = XBaseFontNameListOfFontSet((XFontSet) privateb->xfont);
return (strcmp(namea, nameb) == 0);
}
else
/* fontset != font */
return 0;
return FALSE;
}
gint
@@ -568,7 +656,20 @@ gdk_text_extents_wc (GdkFont *font,
}
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XwcTextExtents (fontset, text, text_length, &ink, &logical);
if (sizeof(GdkWChar) == sizeof(wchar_t))
XwcTextExtents (fontset, (wchar_t *)text, text_length, &ink, &logical);
else
{
wchar_t *text_wchar;
gint i;
text_wchar = g_new (wchar_t, text_length);
for (i = 0; i < text_length; i++)
text_wchar[i] = text[i];
XwcTextExtents (fontset, text_wchar, text_length, &ink, &logical);
g_free (text_wchar);
}
if (lbearing)
*lbearing = ink.x;
if (rbearing)
@@ -642,7 +743,7 @@ gdk_text_measure (GdkFont *font,
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XmbTextExtents (fontset, text, text_length, &ink, &log);
width = log.width;
width = ink.x + ink.width;
break;
default:
width = 0;

View File

@@ -286,6 +286,7 @@ gdk_gc_unref (GdkGC *gc)
GdkGCPrivate *private = (GdkGCPrivate*) gc;
g_return_if_fail (gc != NULL);
g_return_if_fail (private->ref_count > 0);
if (private->ref_count > 1)
private->ref_count -= 1;
@@ -738,8 +739,8 @@ gdk_gc_set_subwindow (GdkGC *gc,
}
void
gdk_gc_set_exposures (GdkGC *gc,
gint exposures)
gdk_gc_set_exposures (GdkGC *gc,
gboolean exposures)
{
GdkGCPrivate *private;
@@ -819,10 +820,10 @@ gdk_gc_set_line_attributes (GdkGC *gc,
}
void
gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gchar dash_list[],
gint n)
gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gint n)
{
GdkGCPrivate *private;

View File

@@ -57,7 +57,7 @@ GdkDndGlobals gdk_dnd = {None,None,None,
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
gchar *gdk_progclass = NULL;
gint gdk_error_code;
gint gdk_error_code = 0;
gint gdk_error_warnings = TRUE;
gint gdk_null_window_warnings = TRUE;
GList *gdk_default_filters = NULL;

View File

@@ -46,6 +46,7 @@
# define gdk_iswalnum(c) iswalnum(c)
# define gdk_iswspace(c) iswspace(c)
#else
# include <ctype.h>
# define gdk_iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
# define gdk_iswspace(c) ((wchar_t)(c) <= 0xFF && isspace(c))
#endif

View File

@@ -386,7 +386,7 @@ gdk_im_real_open (void)
destroy_cb.callback = gdk_im_destroy_cb;
destroy_cb.client_data = NULL;
if (NULL != XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
if (NULL != (void *) XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
GDK_NOTE (XIM, g_warning ("Could not set destroy callback to IM. Be careful to not destroy your input method."));
#endif
@@ -442,7 +442,7 @@ gdk_im_close (void)
}
}
gint
gboolean
gdk_im_ready (void)
{
return (xim_im != NULL);
@@ -469,7 +469,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_PREEDIT_AREA_REQ;
preedit_area.x = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.y;
preedit_area.width = attr->preedit_area.width;
preedit_area.height = attr->preedit_area.height;
@@ -484,7 +484,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_PREEDIT_POSITION_REQ;
preedit_area.x = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.y;
preedit_area.width = attr->preedit_area.width;
preedit_area.height = attr->preedit_area.height;
@@ -506,7 +506,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_STATUS_AREA_REQ;
status_area.x = attr->status_area.x;
status_area.y = attr->status_area.x;
status_area.y = attr->status_area.y;
status_area.width = attr->status_area.width;
status_area.height = attr->status_area.height;
@@ -518,6 +518,12 @@ gdk_ic_real_new (GdkIC *ic)
break;
}
/* We have to ensure that the client window is actually created on
* the X server, or XCreateIC fails because the XIM server can't get
* information about the client window.
*/
gdk_flush();
if (preedit_attr != NULL && status_attr != NULL)
private->xic = XCreateIC (xim_im,
XNInputStyle,
@@ -871,7 +877,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNFontSet;
arg->value = (gpointer) GDK_FONT_XFONT(attr->status_fontset);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_FONTSET;
}
@@ -887,7 +893,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNArea;
arg->value = (gpointer) &rect;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_AREA;
}
@@ -903,7 +909,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNArea;
arg->value = (gpointer) &rect;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_AREA_NEEDED;
else
private->mask &= ~GDK_IC_STATUS_AREA_NEEDED;
@@ -914,7 +920,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNForeground;
arg->value = (gpointer) attr->status_foreground.pixel;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_FOREGROUND;
}
@@ -923,7 +929,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNBackground;
arg->value = (gpointer) attr->status_background.pixel;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_BACKGROUND;
}
@@ -932,7 +938,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNBackgroundPixmap;
arg->value = (gpointer) GDK_WINDOW_XWINDOW(attr->status_pixmap);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_PIXMAP;
}
@@ -941,7 +947,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNColormap;
arg->value = (gpointer) GDK_COLORMAP_XCOLORMAP(attr->status_colormap);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_COLORMAP;
}
@@ -1565,8 +1571,10 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
!= Success)
{
/* InvalidChar */
XFree(tpr.value);
return -1;
}
XFree(tpr.value);
if (num_wstrs == 0)
return 0;
wstr_src = wstrs[0];
@@ -1580,7 +1588,7 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
gint i;
for (i=0; i<dest_max && src[i]; i++)
dest[i] = src[i];
dest[i] = (guchar)src[i];
return i;
}

View File

@@ -251,14 +251,12 @@ gdk_image_new (GdkImageType type,
return NULL;
}
gdk_error_code = 0;
gdk_error_warnings = 0;
gdk_error_trap_push ();
XShmAttach (private->xdisplay, x_shm_info);
XSync (private->xdisplay, False);
gdk_error_warnings = 1;
if (gdk_error_code == -1)
if (gdk_error_trap_pop ())
{
/* this is the common failure case so omit warning */
XDestroyImage (private->ximage);
@@ -269,6 +267,7 @@ gdk_image_new (GdkImageType type,
g_free (image);
gdk_use_xshm = False;
return NULL;
}
@@ -315,22 +314,7 @@ gdk_image_new (GdkImageType type,
image->byte_order = private->ximage->byte_order;
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
switch (private->ximage->bits_per_pixel)
{
case 8:
image->bpp = 1;
break;
case 16:
image->bpp = 2;
break;
case 24:
image->bpp = 3;
break;
case 32:
image->bpp = 4;
break;
}
image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
}
}

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