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
535 changed files with 96341 additions and 142136 deletions

View File

@@ -15,6 +15,3 @@ ABOUT-NLS
intl
stamp-h.in
gtk+.spec
missing
install-sh
mkinstalldirs

13107
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

File diff suppressed because it is too large Load Diff

View File

@@ -7,8 +7,8 @@ you got this package.
Simple install procedure
========================
% gzip -cd gtk+-1.2.7.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.7 # change to the toplevel directory
% 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 ]
@@ -118,7 +118,7 @@ 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.7
./configure --with-glib=../glib-1.2.8
This, however, will not work if you built GLIB with different
source and build directories.
@@ -169,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.)

1
MAINTAINERS Normal file
View File

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

View File

@@ -17,7 +17,6 @@ EXTRA_DIST = \
NEWS.pre-1-0 \
ChangeLog.pre-1-0 \
README.cvs-commits \
README.win32 \
intl/libgettext.h \
intl/po2tbl.sed.in \
examples/aspectframe/Makefile \

15
NEWS
View File

@@ -1,3 +1,18 @@
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

8
README
View File

@@ -1,7 +1,7 @@
General Information
===================
This is GTK+ version 1.2.7. 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.7
Version: 1.2.8
[ Please substitute 1.2.7 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.7
Version: 1.2.8
When I run gtk/testgtk, the button "handle box"
is misnamed. There are multiple handle boxes in

View File

@@ -1,154 +0,0 @@
Gtk port to nano-X
STATUS
Once upon a time I got a few apps working, then started merging
the new features added by Owen (32 bit sizes for windows and buffering).
Since then I haven't found the time to work on it:-/
TODO
Finish internal window manager abstraction or add proper support in nano-X.
Fix event polling.
Implement GdkImage, GdkRgb stuff.
Put generic region code in generic gdk and/or use the region code from nano-X.
Fix ugly automake stuff for make dist.
TODO in nano-X
We need to be able to clip and change the background of windows at runtime
for apps to not look so ugly!
Fonts: wait for better nano-X font implementation.
Properties on windows.
If you want to work on this port or get additional informnation, get in
touch with me.
To get the beast to compile you also need to apply the patch below
(any auto* wizard here?): the issue of having two gtk libraries in the
system needs to be addressed too, maybe use libgtk-x11-1.4.so and
libgtk-nanox-1.4.so ...
Paolo Molaro
lupus@linuxcare.com
Index: acconfig.h
===================================================================
RCS file: /cvs/gnome/gtk+/acconfig.h,v
retrieving revision 1.16
diff -u -r1.16 acconfig.h
--- acconfig.h 1999/03/20 00:52:29 1.16
+++ acconfig.h 2000/05/06 11:52:38
@@ -49,6 +49,8 @@
/* Most machines will be happy with int or void. IRIX requires '...' */
#undef SIGNAL_ARG_TYPE
+#undef USE_NANOX
+
/* #undef PACKAGE */
/* #undef VERSION */
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gtk+/configure.in,v
retrieving revision 1.142
diff -u -r1.142 configure.in
--- configure.in 2000/05/04 00:29:46 1.142
+++ configure.in 2000/05/06 11:52:38
@@ -99,6 +99,8 @@
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
+AC_ARG_ENABLE(nanox, [ --enable-nanox use nano-X instead of X11 [default=no]],
+ , enable_nanox="no")
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
@@ -322,6 +324,8 @@
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
+if text "x$enable_nanox" = "xno"; then
+
CFLAGS="$CFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
@@ -465,6 +469,13 @@
GTK_LOCALE_FLAGS="-DX_LOCALE"
fi
+else
+AC_CHECK_LIB(nano-X, GrOpen)
+LIBS="-lnano-X $LIBS"
+ AC_DEFINE(USE_NANOX)
+AM_CONDITIONAL(USE_NANOX, test x$enable_nanox = xyes)
+fi # if enable_nanox
+
# Checks for header files.
AC_HEADER_STDC
@@ -602,8 +613,13 @@
esac
],[
# Currently we always use X11 on those systems where we run configure...
+if test x$enable_nanox = xno; then
gdk_windowing='
#define GDK_WINDOWING_X11'
+else
+gdk_windowing='
+#define GDK_WINDOWING_NANOX'
+fi
if test x$gdk_wchar_h = xyes; then
gdk_wc='
#define GDK_HAVE_WCHAR_H 1'
@@ -629,6 +645,7 @@
docs/Makefile
gdk/Makefile
gdk/x11/Makefile
+gdk/nanox/Makefile
gdk/win32/Makefile
gtk/Makefile
gtk/gtkfeatures.h
Index: gdk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/Makefile.am,v
retrieving revision 1.41
diff -u -r1.41 Makefile.am
--- gdk/Makefile.am 2000/04/05 04:11:10 1.41
+++ gdk/Makefile.am 2000/05/06 11:52:38
@@ -1,6 +1,10 @@
## Makefile.am for gtk+/gdk
+if USE_NANOX
+SUBDIRS=win32 nanox
+else
SUBDIRS=x11 win32
+endif
EXTRA_DIST = \
gdkconfig.h.win32 \
@@ -36,8 +40,13 @@
-lm \
@STRIP_END@
+if USE_NANOX
libgdk_la_LIBADD = \
+ nanox/libgdk-nanox.la
+else
+libgdk_la_LIBADD = \
x11/libgdk-x11.la
+endif
#
# setup source file variables
@@ -138,3 +147,8 @@
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
+
+noinst_PROGRAMS = simple
+simple_DEPENDENCIES = libgdk.la simple.c
+simple_LDADD = libgdk.la
+

View File

@@ -1,45 +0,0 @@
The Win32 port of GTk+ is a work in progress, and not as stable or
correct as the Unix/X11 version. For more information about the Win32
port, see http://www.gimp.org/tml/gimp/win32/ or
http://www.iki.fi/tml/gimp/win32/ .
The current (CVS) version of the Win32 backend is *not* as stable as it
was before the no-flicker branch was merged. A zipfile with that
version is available from http://www.gimp.org/win32/. That should be
use by "production" code until this CVS version is usable. (But note,
the Win32 backend has never been claimed to be "production quality".)
To build GTk+ on Win32, you need either the Microsoft compiler and
tools, or gcc-2.95 or later. The mingw setup of gcc is preferred, but
you can run gcc also under cygwin-b20.1 or later. Compile in
gdk\win32, gdk and gtk with `nmake -f makefile.msc` or `make -f
makefile.cygwin`. The name makefile.cygwin is misleading, it should
really be called makefile.mingw.
See the README.win32 file in the GLib distribution for instructions
how to build with gcc.
To use GTk+ on Win32, you also need either of the above mentioned
compilers. Other compilers might work, but don't count on it. The
same instructions on how to set up a correct version of gcc should
also be followed if you want to build applications that use GTk+ with
gcc.
The tablet support uses the Wintab API. The Wintab development kit can
be downloaded from http://www.pointing.com. If you don't care for
that, undefine HAVE_WINTAB in config.h.win32 and remove references to
the wntab32x library from the makefile before building.
GTk+ wants to be built with the GNU "intl" library for
internationalisation (i18n). Get the version ported to Win32 (not a
very big deal) from tml's web site mentioned above. We build the
"intl" library as a DLL called gnu-intl.dll (the "gnu" prefix is used
to reduce name clash risks). If you don't want any i18n stuff,
undefine ENABLE_NLS, HAVE_GETTEXT and HAVE_LIBINTL in the
config.h.win32 file, and remove references to the gnu-intl library
from the makefiles.
Note that while the GNU gettext package is under the GPL, the "intl"
part of it which is distributed with GNU libc is under the LGPL (like
GTk+ or GLib). We want the LGPL one, even if they are the same, more
or less.

739
TODO.xml
View File

@@ -1,739 +0,0 @@
<!-- This is used to generate the online TODO list for GTK+ using
the script docs/make-todo. Whenever a change to this file is
committed to CVS,the file is run through make-todo and the online
version updated. If you modify this file, you should check for
parse errors by running:
$ docs/make-todo TODO.xml > /dev/null
before committing, or you may screw up the online version -->
<todo logourl="gtk-logo-rgb.gif">
<title>GTK+ TODO list</title>
<section>
<title>GDK</title>
<entry size="medium" status="70%" target="1.4">
<title>Add backing store support</title>
<description>
<p>
GTK+'s drawing model involves clearing to a background, and
then drawing widgets on top of this. Without having
backing-store support, this results in flickering in various
situations. Backing store cannot be added widget-by-widget,
because the drawing in a particular window is not confined
to a single widget. Instead it needs to be added per GDK
window.
</p>
<p>
The way this is done is by having
<tt>gdk_window_begin_paint()</tt>
and <tt>gdk_window_end_paint()</tt> functions that
redirect all drawing to a particular window to an offscreen
pixmap, and then copy that offscreen pixmap back onto the
screen when the paint operation is done. The implementation
of this is mostly complete in the <tt>gtk-no-flicker</tt> branch of
GTK+.
</p>
</description>
<url>http://www.gtk.org/~otaylor/gtk/1.4/gdk-drawing.html</url>
<contact>Owen Taylor &lt;otaylor@redhat.com&gt;</contact>
</entry>
<entry size="medium" status="70%" target="1.4">
<title>32 Bit Coordinates</title>
<description>
<p>
GTK+-1.2 and earlier share X's limitation on the
size of coordinates and restrict all dimensions
to 16 bit quantities. By clever use of X it is
possible to lift this restriction and present a
full 32-bit space to the user.
</p>
<p>
There are some difficulties with performance in this
approach - mostly because scrolling can involve mapping and
unmapping lots of widgets, but in general, current
trials in this area seem to work pretty well.
</p>
</description>
<url>http://www.gtk.org/~otaylor/gtk/1.4/gdk-drawing.html</url>
<contact>Owen Taylor &lt;otaylor@redhat.com&gt;</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Customizable double-click timeout</title>
<description>
<p>
The current fixed double-click timeout in GTK+
is too small for some users. This needs to be
customizable
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
<bugs>#3958</bugs>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Make color handling more convenient</title>
<description>
<p>
Add some color convenience functions; such as a way to get an
allocated GdkColor from GdkRGB, and export functions from gtkstyle.c
that lighten/darken a given color, and set a color from HSV in
addition to RGB. Also, consider having static variables that contain
preallocated common colors (gdk_blue, gdk_red, etc.), the problem
being colormap issues.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Cursors</title>
<description>
<p>
Two tasks: 1) move the cursors in the cursor font that people actually
care about to the top of the gdkcursor.h header file, and put a nice
list of the 15 cursors people actually care about in the docs 2) if
the cursor font lacks some commonly-useful cursors (like magnifying
glass), add these cursors to gdkcursor.h and then emulate them in
gdk_cursor_new by transparently creating the cursor from a bitmap.
The list of Qt cursors is worth http://doc.trolltech.com/qcursor.html
looking at for this task.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Make GdkRGB work on any visual</title>
<description>
<p>
GdkRGB should be able to render to an arbitrary visual
(i.e. the visual shouldn't be fixed at gdk_rgb_init()
time). This will break gdk_rgb_gc_set_foreground() and
friends, though.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
</section> <!-- GDK -->
<section>
<title>Internationalization</title>
<entry size="big" status="70%" target="1.4">
<title>Integrate Pango</title>
<description>
<p>
The purpose of the Pango project is to provide a system for
layout and rendering of internationalized text. It handles
most of the issues necessary to
</p>
</description>
<url>http://www.pango.org</url>
<contact>gtk-i18n-list@redhat.com</contact>
</entry>
<entry size="medium" status="80%" target="1.4">
<title>Switch to using UTF-8</title>
<description>
<p>
This is closely related to Pango integration. Pango deals
with all strings in terms of UTF-8; by switching GTK+ over
to UTF-8 we make it considerably simpler for developers to
support multiple languages properly while still retaining
a large degree of compatibility with existing programs.
</p>
<p>
Some work has already been done on this as part of the Win32
port, since the Win32 port is currently using UTF-8 for all
strings. In general, this should be an easy job; the hardest
parts are places like GtkFileSelection, cut and paste, and
input method support where there is interaction between GTK+
and the operating system.
</p>
</description>
<contact>gtk-i18n-list@redhat.com</contact>
</entry>
<entry size="big" status="40%" target="1.4">
<title>Rewrite Input Method Support</title>
<description>
<p>
Support for Input Methods is GTK+-1.2 is done via XIM, with
supported styles being over-the-spot and the root-window
styles. However, the over-the-spot style is not going to
work well with the Pango integration, since it relies on the
text rendering in the program being done in the standard
Xlib style, so it will be necessary to also support
on-the-spot input. On-the-spot input is done by supplying a
set of callbacks that are invoked by the input methods.
</p>
<p>
GTK+-1.4 will have a new system with loadable input method
modules. These modules can either be implemented using XIM,
or written from scratch.
</p>
</description>
<contact>gtk-i18n-list@redhat.com</contact>
</entry>
</section> <!-- i18n -->
<section>
<title>GTK+ Core</title>
<entry size="big" status="5%" target="1.4">
<title>GLib based object and type system</title>
<description>
<p>
The GTK+ object system is already in use in quite a few different
non-GUI applications; it would be desirable for these uses
to have the object and type systems separated from the GUI portions
of GTK+ and be generalized for non-GUI usage.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="1%" target="1.4">
<title>Overall callback improvements</title>
<description>
<p>
The GTK+ type and signal systems need significant improvements to
allow signal creation with default handlers from language bindings
and to aid language bindings in deriving new objects.
One aspect of this is the Closure support, recently suggested by
Karl Nelson &lt;kenelson@ece.ucdavis.edu&gt;, but this also
requires a GLib based type and parameter system (ties in with
"GLib based object and type system").
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="1.4">
<title>State change notification</title>
<description>
<p>
GTK+ objects emit various types of signals, some to perform
arbitrary actions, some to allow customization from user code,
and some signals are emitted to notify of certain changes
of an object. For the latter, what really is required is a
gneneric signal that can be used to monitor *any* kind of object
changes. For that, all object changes need to be routed through
a central point (otherwise the signal emissions are spread all
over the object implementation), i.e. an object argument setter.
The state change notification signal doesn't need to be emitted
syncronously, in fact, it's probably most effective to always
emit this asynchronously, so subsequent changes are accumulated.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="5%" target="1.4">
<title>Widget as sensitivity/grab state machine</title>
<description>
<p>
Maintenance of pointer and keybnoard grabs is currently very
tedious and error-prone, most widget's cook up their own stuff
in this regard.
By moving the general concept of "Grabs" to the GTK+ level as
a widget state, and providing a new signal for alterations of
a widget's state ("visible", "visible+insensitive",
"visible+grab", "hidden", "hidden+insensitive", etc.), things
can be unified and more stabelize. A couple of bugs, such as
insensitive widgets still holding a grab, or buttons that
still think they are depressed when hidden, will be squeezed
automatically with that.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="0%" target="1.4">
<title>Allow argument customization</title>
<description>
<p>
Many types of object arguments (expander style in the CList,
default padding in button boxes, etc), conceptually go with
the theme, or as user preferences; they should not be set by
a particular program.
</p>
<p>
There needs to be a mechanism for themes to be able to
control these arguments from the RC file.
</p>
</description>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Allow global customization</title>
<description>
<p>
There are a number of global parameters in GTK+ and GDK that should be
customizable by the user, such as the double-click timeout,
or whether widgets should be backing-stored by default.
</p>
<p>
If we had argument customization from an RC file, it might
be possible to do this simply with a global object with
arguments for the various global parameters that was
customized in the same fashion as object arguments.
</p>
</description>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Gtk+ Modules installation directory</title>
<description>
<p>
Gtk+ needs to support an extra lib/ directory, to search
for dynamically loadable modules, it also needs to support
an environment variable to specify module search paths.
This has quite some cross-platform issues with the GModule
code (especially on AIX).
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Convenient widget setup</title>
<description>
<p>
Make it simpler to set all the basic attributes of a widget. Might
want set_tooltip(), set_accel(), set_color(FOREGROUND, color),
set_min_size() (usize does this, but needs a rename), set_whatsthis(),
etc. set_accel() may not work for all widgets, may need a convenience
API for button and label accelerators specifically.
</p>
<p>
The idea is that it should be easy, out of the box, to set up a widget
with all the nice touches and features the widget really should
have. Users shouldn't need to do their own convenience functions for
this.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="> 1.4">
<title>Make selections/clipboard more convenient</title>
<description>
<p>
Make GtkSelectionData more like the MIME blobs in Swing and Qt.
Consider a GtkClipboard object to simplify cut-and-paste handling.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="50%" target="1.4">
<title>Stock label/icon system</title>
<description>
<p>
A system like GnomeStock for getting a standard labels/icons
for menus and toolbars. Should be extensible by themes, and
by libgnomeui. Some work already done on this.
</p>
</description>
<contact>hp@redhat.com</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Session Management</title>
<description>
<p>
Look in to session management. Consider whether to use
X11R6 SM, or some custom spec shared with KDE. Create
GTK+ API for this.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Online help enhancements</title>
<description>
<p>
Look at a small "What's This" popup widget,
and a What's This system in general (this part
could maybe be done for 1.4). A more difficult, probably
a post-1.4 task, is to integrate a very simple little
help browser gizmo into GTK.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>GUI-editable means of user configuration</title>
<description>
<p>
Need to be able to set double click time, whether cursors
blink, etc., from a control panel type of deal.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
</section> <!-- Core -->
<section>
<title>GTK+ Widgets</title>
<entry size="small" status="50%" target="1.4">
<title>Make GtkFrame use a label</title>
<description>
<p>
The title of a frame should simply be another child widget
which, by default, holds a label widget. This will important
with Pango where proper text behavior will be more complex to
implement, but is also useful for certain user-interface
designs. (It can be useful, for example, to put a checkbutton
in that slot.)
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="75%" target="1.4">
<title>Replace GtkText Widget</title>
<description>
<p>
The GtkText widget is badly in need of replacement, since it
is buggy and insufficiently feature rich. This is being done
using Havoc Pennington's port of the Tk Text widget.
</p>
<p>
As part of this job <a href="http://www.pango.org">Pango</a>
support is being added to the replacement. The structure of
the Tk text widget port is suited to this as it works
paragraph-by-paragraph, and Pango works at a sub-paragraph
scale. The main remaining tasks here are to implement
incremental reflow to make performance acceptable and to
implement embedded pixmaps and widgets.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Improve Radio/Checkbutton Look</title>
<description>
<p>
The default look for the radio and checkbuttons is both
unattractive and not friendly to the user . Motif did not
get this one right, and we should not keep on following the
Motif look. The right thing here is probably to copy the
Windows appearance for these controls fairly closely. This
will fit in with well with the rest of the GTK+ look.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Improve Submenu Navigation</title>
<description>
<p>
Navigating through a deep menu tree in GTK+ is currently
quite tricky, because as soon as one leaves a menu item,
the submenu disappears. The way that the Macintosh is
reputed to handle this is that to pop down the current
submenu, you have to leave the triangle defined by the
upper left hand corner of the menu item and right
side of the submenu.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4 ?">
<title>Improve Spinbutton Look</title>
<description>
<p>
Spinbuttons currently appear to have lumpy boundaries,
because sides of the arrows aren't at an angle that
meshes well with the pixel grid. However, fixing this
would require making the spinbuttons narrower and
harder to hit. This points out a general problem with
the spinbutton (and the arrows on the scrollbars) - the
target area for clicks actually the bounding box of the
arrows, but the user thinks that they must click on the
arrows themselves. It would probably be more friendly
to use a square button with an arrow drawn on top instead
of a arrow-shaped button, the approach taken by most other
windowing systems.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="90%" target="1.4">
<title>Supply horizontable/vertical wrapping boxes</title>
<description>
<p>
An often requested feature are wrapping containers, at this
point, gimp's development version already uses such widgets:
horizontable/vertical wrap boxes, that need to go into 1.4
proper at some point.
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="medium" status="90%" target="1.4">
<title>Improved generic combo support</title>
<description>
<p>
Gtk+'s combo box has several drawbacks in design and
implementation. An new attempt at providing the combo box
functionality with improved flexibility has been made with
the GtkClueHunter widget, sitting in the CVS module "gle".
</p>
</description>
<contact>Tim Janik &lt;timj@gtk.org&gt;</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Add unified set of List/Tree/Grid widgets</title>
<description>
<p>
Currently, GTK+ has a large number of list and tree widgets
(GtkList, GtkTree, GtkCList, GtkCTree), none of which are
ideal. The GtkList and GtkTree widgets perform badly on large
number of items. (GtkTree widget is also quite buggy.) GtkCList
and GtkCTree mostly solve the size problem, but are quite
complex and, despite that, not very flexible. They are limited to
displaying pixmaps and text, and can neither support arbitrary
widgets nor custom drawing functions.
</p>
<p>
In addition to list and tree widgets, a closely related need
is a sheet widget that displays a (possibly editable) 2-D grid.
It would be desirable to have a complete set of widgets that
could be presented as the one-true-solution for these needs.
Model/View techniques could be used effectively to increase
both the simplicity and power of the interfaces.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>GtkPixbuf</title>
<description>
<p>
gdk-pixbuf is moving to become a GTK+ dependency, a new image-display
widget is thus needed.
</p>
</description>
<contact>hp@redhat.com</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Attempt to fix GtkStatusbar</title>
<description>
<p>
GtkStatusbar is too inconvenient to use.
The only non-breakage-inducing fix we could
come up with is to permit 0 as a context ID, so you
don't have to use gtk_statusbar_get_context_id().
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="95%" target="1.4">
<title>Decruft GtkProgress, GtkProgressbar</title>
<description>
<p>UPDATE: this is done, just need to apply the patch.
</p>
<p>
This interface is just a disaster of overcomplexity;
it should pretty much just be set_percentage(),
pulse() (to move during activity mode), and set_text().
There's no reason that there are two objects, should
just be one interface. Almost all the functions
that currently exist should be deprecated.
</p>
</description>
<contact>hp@redhat.com</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Entry validation hooks</title>
<description>
<p>
Simple hooks for validation in a GtkEntry. Pretty much just a
"validate" callback which takes a string (current entry contents) and
returns either VALID, INVALID, or COULDBEVALID. Then the
GtkEntry calls this function if it's set, and does the appropriate
UI things. GTK should come with validators for int and float,
see GtkSpinButton where these are already implemented.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>pseudo-MDI Widget</title>
<description>
<p>
Add a widget that lets you rearrange various views (similar to many
IDEs, like Visual SlickEdit or JBuilder). Basically there should be a
central slot and 4 slots around the sides; each slot holds one or more
views. If two views are dropped in the same slot, then a notebook is
created displaying both views. If a view is dropped outside the
application window, it becomes a standalone window. It should be
possible to restrict whether a view can be dropped on the sides,
horizontal/vertical sides only, in the central content area, or in
any of those places.
</p>
<p>
(Havoc has a proposed interface for this, mail hp@redhat.com)
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="> 1.4">
<title>Icon List Widget</title>
<description>
<p>
A simple icon list widget, suitable for creating a file selector or
the like.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="> 1.4">
<title>Dock widget</title>
<description>
<p>
Add a widget like GnomeDock (perhaps based on GnomeDock)
that allows people to put rearrangeable toolbars, menubars, etc.
around a central content area. The widget should have hooks for
saving the current positions of the various docked bars.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="big" status="0%" target="> 1.4">
<title>Canvas widget</title>
<description>
<p>
Figure out how to get GnomeCanvas or a derived work into GTK+ itself.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Menu scroll</title>
<description>
<p>
When menus are bigger than the screen, allow scrolling
as on the Mac.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Toolbar/menubar wrap</title>
<description>
<p>
When toolbars and menubars are too wide, do some sort of
wrapping or drop-down deal. (See Windows/Mac apps for examples.)
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Blink cursor in GtkEntry</title>
<description>
<p>
Make the cursor optionally blink in GtkEntry. Beware, the entry code
is somewhat in flux; mail Owen and ask.
</p>
</description>
<contact>otaylor@redhat.com</contact>
</entry>
<entry size="small" status="100%" target="1.4">
<title>Don't highlight first menu item when menus come up</title>
<description>
<p>
Keep GtkMenu from prelighting the first menu item.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="95%" target="1.4">
<title>Integrate new color selector</title>
<description>
<p>
There's a new color selector in CVS (module gnome-colorsel),
it needs to be folded in to GTK and any remaining issues resolved.
(This new selector is API-compatible with the old one, and
still called GtkColorSelector).
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="medium" status="0%" target="1.4">
<title>Write new font selector</title>
<description>
<p>
Pango introduces a new font handling system,
replacing the XLFD system. Need a font selector for this.
The XLFD selector should probably remain, for apps where
it makes sense (like gnome-terminal probably).
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Stack Widget</title>
<description>
<p>
Jonathan has a widget like a tabless/frameless notebook, used for
something like the GNOME control center where you want to toggle which
widget is visible to the user. Needs to be cleaned up and considered
for GTK.
</p>
</description>
<contact>gtk-devel-list@gnome.org, jrb@redhat.com</contact>
</entry>
<entry size="small" status="0%" target="1.4">
<title>Clean up GtkNotebook</title>
<description>
<p>
GtkNotebook currently breaks GTK invariants about
mapping/visibility/etc., needs fixing.
</p>
</description>
<contact>gtk-devel-list@gnome.org</contact>
</entry>
</section> <!-- GTK+ -->
</todo>

View File

@@ -19,17 +19,14 @@
#undef GTK_COMPILED_WITH_DEBUGGING
#undef HAVE_CATGETS
#undef HAVE_DIRENT_H
#undef HAVE_GETTEXT
#undef HAVE_IPC_H
#undef HAVE_LC_MESSAGES
#undef HAVE_PWD_H
#undef HAVE_SHM_H
#undef HAVE_STPCPY
#undef HAVE_XSHM_H
#undef HAVE_SHAPE_EXT
#undef HAVE_SYS_SELECT_H
#undef HAVE_SYS_TIME_H
#undef HAVE_XCONVERTCASE
#undef NO_FD_SET

View File

@@ -1,192 +0,0 @@
/* config.h.win32. Handcrafted for Microsoft C and gcc -mno-cygwin */
#if ! (defined(_MSC_VER) || defined(__GNUC__))
#error Unrecognized Win32 compiler, edit config.h.win32 by hand
#endif
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* #undef CRAY_STACKSEG_END */
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
#ifdef _MSC_VER
#define alloca _alloca
#elif defined (__GNUC__)
#define alloca __builtin_alloca
#endif
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define to empty, or __inline if that's what your compiler wants. */
#define inline __inline
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE*/
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
/* #undef STACK_DIRECTION */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Other stuff */
#define ENABLE_NLS 1
#define GTK_COMPILED_WITH_DEBUGGING "minimum"
/* #undef HAVE_CATGETS */
/* #undef HAVE_DIRENT_H */
#define HAVE_GETTEXT 1
/* #undef HAVE_IPC_H */
/* #undef HAVE_LC_MESSAGES */
/* #undef HAVE_PWD_H */
/* #undef HAVE_SHM_H */
/* #undef HAVE_STPCPY */
/* #undef HAVE_XSHM_H */
#define HAVE_SHAPE_EXT 1
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_TIME_H */
/* #undef HAVE_XCONVERTCASE */
/* #undef NO_FD_SET */
/* #undef XINPUT_NONE */
/* #undef XINPUT_GXI */
/* #undef XINPUT_XFREE */
#define XINPUT_WIN32 1
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define if you have the __argz_count function. */
/* #undef HAVE___ARGZ_COUNT */
/* Define if you have the __argz_next function. */
/* #undef HAVE___ARGZ_NEXT */
/* Define if you have the __argz_stringify function. */
/* #undef HAVE___ARGZ_STRINGIFY */
/* Define if you have the broken_wctype function. */
/* #undef HAVE_BROKEN_WCTYPE */
/* Define if you have the dcgettext function. */
/* #undef HAVE_DCGETTEXT */
/* Define if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the lstat function. */
/* #undef HAVE_LSTAT */
/* Define if you have the munmap function. */
/* #undef HAVE_MUNMAP */
/* Define if you have the putenv function. */
#define HAVE_PUTENV 1
#define putenv _putenv
/* Define if you have the setenv function. */
/* #undef HAVE_SETENV */
/* Define if you have the setlocale function. */
#define HAVE_SETLOCALE 1
/* Define if you have the stpcpy function. */
/* #undef HAVE_STPCPY */
/* Define if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
#define strcasecmp _stricmp
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the <argz.h> header file. */
/* #undef HAVE_ARGZ_H */
/* Define if you have the <dirent.h> header file. */
/* #undef HAVE_DIRENT_H */
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define if you have the <nl_types.h> header file. */
/* #undef HAVE_NL_TYPES_H */
/* Define if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */
/* Define if you have the <unistd.h> header file. */
/* #undef HAVE_UNISTD_H */
/* Define if you have the <wchar.h> header file. */
#define HAVE_WCHAR_H 1
/* Define if you have the <wctype.h> header file. */
#ifdef _MSC_VER
#define HAVE_WCTYPE_H 1
#endif /* _MSC_VER */
/* Define if you have the i library (-li). */
/* #undef HAVE_LIBI */
/* Define if you have the intl library (-lintl). */
#define HAVE_LIBINTL 1
/* define if compiled symbols have a leading underscore */
/* #undef WITH_SYMBOL_UNDERSCORE */
/* Define if you have the Wintab programmer's kit */
#define HAVE_WINTAB 1
/* Define if you have the <dimm.h> header file
* (available in the Platform SDK)
*/
/* #define HAVE_DIMM_H 1 */

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
#
@@ -28,10 +28,10 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
#
GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=3
GTK_MICRO_VERSION=0
GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0
GTK_MINOR_VERSION=2
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
@@ -165,8 +165,6 @@ if test "x$enable_rebuilds" = "xyes" && \
fi
AC_SUBST(REBUILD)
AC_CHECK_FUNCS(lstat)
AC_MSG_CHECKING(whether make is GNU Make)
STRIP_BEGIN=
STRIP_END=
@@ -177,13 +175,14 @@ if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
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="ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no pl pt pt_BR ro ru sk sl sv tr uk wa zh_TW.Big5 zh_CN.GB2312"
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
LIBS="$LIBS $INTLLIBS"
@@ -216,22 +215,6 @@ AC_TRY_RUN([#include <math.h>
)
LIBS=$gtk_save_LIBS
MATH_LIB=-lm
GTK_LIBS_EXTRA=
AC_MSG_CHECKING(for the BeOS)
case $host in
*-*-beos*)
AC_MSG_RESULT(yes)
GTK_LIBS_EXTRA="-L\$(top_builddir_full)/gdk/.libs -lgdk"
MATH_LIB=
;;
*)
AC_MSG_RESULT(no)
;;
esac
AC_SUBST(MATH_LIB)
AC_SUBST(GTK_LIBS_EXTRA)
dnl NeXTStep cc seems to need this
AC_MSG_CHECKING([for extra flags for POSIX compliance])
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
@@ -252,16 +235,16 @@ fi
if test x$with_glib = x ; then
# Look for separately installed glib
AM_PATH_GLIB(1.3.1,,
AM_PATH_GLIB(1.2.8,,
AC_MSG_ERROR([
*** GLIB 1.3.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/.]),
gobject gmodule gthread)
gmodule gthread)
# we do not want to make all gtk progs to link to thread libraries.
glib_cflags=`$GLIB_CONFIG glib gobject gmodule --cflags`
glib_cflags=`$GLIB_CONFIG glib gmodule --cflags`
glib_thread_cflags="$GLIB_CFLAGS"
glib_libs=`$GLIB_CONFIG glib gobject gmodule --libs`
glib_libs=`$GLIB_CONFIG glib gmodule --libs`
glib_thread_libs="$GLIB_LIBS"
GLIB_LIBS="$glib_libs"
GLIB_DEPLIBS="$glib_libs"
@@ -307,10 +290,6 @@ AC_SUBST(glib_thread_cflags)
AC_SUBST(glib_thread_libs)
AC_SUBST(GLIB_DEPLIBS)
AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
# Find the X11 include and library directories
AC_PATH_X
AC_PATH_XTRA
@@ -410,9 +389,6 @@ else
AC_DEFINE(XINPUT_NONE)
fi
AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
@@ -492,29 +468,30 @@ else
fi
fi
# `widechar' tests for gdki18n.h
# Duplicate `widechar' tests from `glib'.
# Check for wchar.h
AC_MSG_CHECKING(for wchar.h)
AC_TRY_CPP([#include <wchar.h>], gdk_wchar_h=yes, gdk_wchar_h=no)
if test $gdk_wchar_h = yes; then
AC_DEFINE(HAVE_WCHAR_H,1,[Have wchar.h include file])
AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
AC_DEFINE(HAVE_WCHAR_H,1,[Define if wchar.h exists])
fi
AC_MSG_RESULT($gdk_wchar_h)
AC_MSG_RESULT($gtk_ok)
# Check for wctype.h (for iswalnum)
AC_MSG_CHECKING(for wctype.h)
AC_TRY_CPP([#include <wctype.h>], gdk_wctype_h=yes, gdk_wctype_h=no)
if test $gdk_wctype_h = yes; then
AC_DEFINE(HAVE_WCTYPE_H,1,[Have wctype.h include file])
AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
AC_DEFINE(HAVE_WCTYPE_H,1,[Define if wctype.h exists])
fi
AC_MSG_RESULT($gdk_wctype_h)
AC_MSG_RESULT($gtk_ok)
# in Solaris 2.5, `iswalnum' is in -lw
GDK_WLIBS=
AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
# The following is necessary for Linux libc-5.4.38
oLIBS="$LIBS"
LIBS="$LIBS $GDK_WLIBS"
# The following is necessary for Linux libc-5.4.38
AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
AC_TRY_LINK([#include <stdlib.h>],[
#if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
@@ -529,97 +506,20 @@ AC_TRY_LINK([#include <stdlib.h>],[
# define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
#endif
iswalnum((wchar_t) 0);
], gdk_working_wctype=yes, gdk_working_wctype=no)
], gtk_ok=yes, gtk_ok=no)
LIBS="$oLIBS"
if test $gdk_working_wctype = no; then
AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Is the wctype implementation broken])
if test $gtk_ok = no; then
AC_DEFINE(HAVE_BROKEN_WCTYPE,1,[Define if the wctype function is broken])
GDK_WLIBS=
fi
AC_MSG_RESULT($gdk_working_wctype)
AC_MSG_RESULT($gtk_ok)
AC_SUBST(GDK_WLIBS)
AC_SUBST(GTK_DEBUG_FLAGS)
AC_SUBST(GTK_XIM_FLAGS)
AC_SUBST(GTK_LOCALE_FLAGS)
AC_OUTPUT_COMMANDS([
## Generate `gdk/gdkconfig.h' in two cases
## 1. `config.status' is run either explicitly, or via configure.
## Esp. not when it is run in `Makefile' to generate makefiles and
## config.h
## 2. CONFIG_OTHER is set explicitly
##
## Case 1 is difficult. We know that `automake' sets one of
## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
## only when AM_CONFIG_HEADER is set, however.
if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
# Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
CONFIG_OTHER=${CONFIG_OTHER:-gdk/gdkconfig.h}
fi
case "$CONFIG_OTHER" in
*gdk/gdkconfig.h*)
echo creating gdk/gdkconfig.h
outfile=gdkconfig.h-tmp
cat > $outfile <<\_______EOF
/* gdkconfig.h
*
* This is a generated file. Please modify `configure.in'
*/
#ifndef GDKCONFIG_H
#define GDKCONFIG_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
_______EOF
cat >>$outfile <<_______EOF
$gdk_windowing
$gdk_wc
_______EOF
cat >>$outfile <<_______EOF
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GDKCONFIG_H */
_______EOF
if cmp -s $outfile gdk/gdkconfig.h; then
echo gdk/gdkconfig.h is unchanged
rm -f $outfile
else
mv $outfile gdk/gdkconfig.h
fi ;;
esac
],[
# Currently we always use X11 on those systems where we run configure...
gdk_windowing='
#define GDK_WINDOWING_X11'
if test x$gdk_wchar_h = xyes; then
gdk_wc='
#define GDK_HAVE_WCHAR_H 1'
fi
if test x$gdk_wctype_h = xyes; then
gdk_wc="\$gdk_wc
#define GDK_HAVE_WCTYPE_H 1"
fi
if test x$gdk_working_wctype = xno; then
gdk_wc="\$gdk_wc
#define GDK_HAVE_BROKEN_WCTYPE 1"
fi
])
AC_OUTPUT([
gtk+.spec
docs/gtk-config.1
@@ -628,9 +528,6 @@ gtk-config
po/Makefile.in
docs/Makefile
gdk/Makefile
gdk/x11/Makefile
gdk/win32/Makefile
gtk/Makefile
gtk/gtkfeatures.h
gtk/gtkcompat.h
], [chmod +x gtk-config])

View File

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

View File

@@ -1,108 +0,0 @@
Incompatible Changes from GTK+-1.2 to GTK+-1.4:
* The gdk_time* functions have been removed. This functionality
has been unused since the main loop was moved into GLib
prior to 1.2.
* The signature for GtkPrintFunc (used for gtk_item_factory_dump_items)
has been changed to take a 'const gchar *' instead of 'gchar *', to
match what we do for glib, and other similar cases.
* The detail arguments in the GtkStyleClass structure are now 'const gchar *'.
* gtk_paned_set_gutter_size() has been removed, since the small handle tab
has been changed to include the entire area previously occupied by
the gutter.
* GDK no longer selects OwnerGrabButtonMask for button presses. This means
that the automatic grab that occurs when the user presses a button
will have owner_events = FALSE, so all events are redirected to the
grab window, even events that would normally go to other windows of the
window's owner.
* GtkColorSelectionDialog has now been moved into it's own set of files,
gtkcolorseldialog.c and gtkcolorseldialog.h.
* gtk_widget_shape_combine_mask() now keeps a reference count on the
mask pixmap that is passed in.
* Type system changes:
- GTK_TYPE_OBJECT is not a fundamental type anymore. Type checks of the
style (GTK_FUNDAMENTAL_TYPE (some_type) == GTK_TYPE_OBJECT)
will not work anymore. As a replacement, (GTK_TYPE_IS_OBJECT (some_type))
can be used now.
- The following types vanished: GTK_TYPE_ARGS, GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK, GTK_TYPE_FOREIGN. The corresponding GtkArg
fields and field access macros are also gone.
- The following type aliases vanished: GTK_TYPE_FLAT_FIRST,
GTK_TYPE_FLAT_LAST, GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST.
- The type macros GTK_TYPE_MAKE() and GTK_TYPE_SEQNO() vanished, use of
GTK_FUNDAMENTAL_TYPE() is discouraged. Instead, the corresponding GType
API should be used: G_TYPE_FUNDAMENTAL(), G_TYPE_DERIVE_ID(),
G_TYPE_BRANCH_SEQNO(). Note that the GLib type system doesn't build new
type ids based on a global incremental sequential number anymore, but
numbers new type ids sequentially per fundamental type branch.
- The following type functions vanished/were replaced:
Old Function Replacement
gtk_type_query() - being investigated -
gtk_type_set_varargs_type() -
gtk_type_get_varargs_type() -
gtk_type_check_object_cast() g_type_check_instance_cast()
gtk_type_check_class_cast() g_type_check_class_cast()
gtk_type_describe_tree() -
gtk_type_describe_heritage() -
gtk_type_free() -
gtk_type_children_types() g_type_children()
gtk_type_set_chunk_alloc() GTypeInfo.n_preallocs
gtk_type_register_enum() g_enum_register_static()
gtk_type_register_flags() g_flags_register_static()
gtk_type_parent_class() g_type_parent() / g_type_class_peek_parent()
Use of g_type_class_ref() / g_type_class_unref() and g_type_class_peek()
is recommended over usage of gtk_type_class().
Use of g_type_register_static() / g_type_register_dynamic() is recommended
over usage of gtk_type_unique().
* Object system changes:
GtkObject derives from GObject, so is not the basic object type anymore.
This imposes the following source incompatible changes:
- GtkObject has no klass field anymore, an object's class can be retrived
with the object's coresponding GTK_<OBJECT>_GET_CLASS (object) macro.
- GtkObjectClass has no type field anymore, a class's type can be retrived
with the GTK_CLASS_TYPE (class) macro.
- GtkObjectClass does not introduce the finalize() and shutdown() methods
anymore. While shutdown() is intended for GTK+ internal use only, finalize()
is required by a variety of object implementations. GObjectClass.finalize
should be overriden here, e.g.:
static void gtk_label_finalize (GObject *gobject)
{
GtkLabel *label = GTK_LABEL (gobject);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void gtk_label_class_init (GtkLabelClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
gobject_class->finalize = gtk_label_finalize;
}
- the GtkObject::destroy signal can now be emitted multiple times on an object.
::destroy implementations should check that make sure that they take this
into account, by checking to make sure that resources are there before
freeing them. For example:
if (object->foo_data)
{
g_free (object->foo_data);
object->foo_data = NULL;
}
Also, ::destroy implementations have to release object references that
the object holds. Code in finalize implementations such as:
if (object->adjustment)
{
gtk_object_unref (object->adjustment);
object->adjustment = NULL;
}
have to be moved into the ::destroy implementations. The reason for doing
this is that all object reference cycles should be broken at destruction
time.

View File

@@ -1,338 +0,0 @@
The overall syntax is:
(type-of-thing-being-defined name-used-to-refer-to-this-thing
(attribute-name attribute-value-depending-on-the-attribute)
(attribute-name attribute-value-depending-on-the-attribute)
(attribute-name attribute-value-depending-on-the-attribute))
Some definitions can have a c-declaration field that gives the C code
we parsed to arrive at the definition. The c-declaration is a quoted
string because it can contain parentheses and such.
Defined types and their attributes:
===
(module module-name
(submodule-of module-name)) ;; submodule is optional
Ex: (module Gtk)
Ex: (module Rgb
(submodule-of Gdk))
modules are later referred to with a list of module names, like
(Gdk Rgb) or (Gtk)
Object and boxed type definitions automatically create a submodule.
For example, GtkCList creates the module (module CList (submodule-of
(Gtk))) which is referred to as module (Gtk CList).
===
(type
(alias some-unique-identifier)
(in-module module-name) ;; optional, gchar* is not in a module
(gtk-type-id gtk-type-system-id) ;; optional, absent if this is not
;; in the type system
(is-parametric boolean) ;; optional default to #f
(in-c-name name-of-symbol-in-C)
(out-c-name name-of-symbol-in-C)
(inout-c-name name-of-symbol-in-C))
Ex: (type
(alias string)
(gtk-type-id GTK_TYPE_STRING)
(in-c-name "const gchar*")
(out-c-name "gchar**") ;; actually I'm not sure how strings work out/inout
(inout-c-name "gchar*"))
(type
(alias list)
(gtk-type-id GTK_TYPE_POINTER)
(is-parametric #t)
(in-c-name "GList*")
(out-c-name "GList**")
(inout-c-name "GList**"))
;; This one would be implied by the (object) def for GtkWidget I
;; think - (type) is only required for types that are not implied
;; by other definitions, such as int/boolean/etc.
(type
(alias GtkWidget)
(in-module (Gtk))
(gtk-type-id GTK_TYPE_WIDGET)
(in-c-name "GtkWidget*")
(inout-c-name "GtkWidget*")
(out-c-name "GtkWidget**"))
"Type" bindings are automatically assumed for objects, boxed types,
etc. as defined below.
The alias field is used to refer to the type later on.
Whenever a type alias can be used, it is also possible to use the
keyword "native", which implies that the type in question is too
C-specific to represent. Then a c-declaration will typically be
available for use.
C types containing [] or () are function pointers or arrays. For
arrays that don't specify a size, we just treat them as pointers. For
function pointers, we need special (type) syntax/attributes of some
kind, but since there basically aren't any of these right now in the
libs we care about we can just ignore them. For arrays that specify a
size ditto, you would handle them by adding an (array-size) attribute
or something or using the "native" keyword and skipping the (type)
stuff.
===
(object object-name
(in-module module-name-list)
(parent object-name optional-module-name-if-different)
(abstract boolean-is-abstract-class) ;; omit for default of #f
(c-name name-of-the-object-in-C)
(field (type-and-name type-alias-of-struct-field name-of-struct-field)
(access read-or-write-or-readwrite)))
Ex: (object Widget
(in-module (Gtk))
(parent Object) ;; could say (parent Object (Gtk))
(abstract #t)
(c-name GtkWidget)
(field (type-and-name GdkWindow* window) (access read)))
An "object" declaration automatically implies the type definition:
(type
(alias concat-module-elements-and-object-name)
(in-c-name pointer-to-c-name)
(out-c-name pointer-to-pointer-to-c-name)
(inout-c-name pointer-to-c-name))
Ex:
(type (alias GtkWidget)
(in-c-name GtkWidget*)
(out-c-name GtkWidget**)
(inout-c-name GtkWidget*))
It also implies a module that is the name broken into parts:
(module CTree
(submodule-of Gtk))
===
(function function-name
(in-module module-name-list) ;; "static methods" go in their
;; object's module
(is-constructor-of object-type-alias) ;; optional, marks a constructor
(c-name function-name)
(return-type return-value-type) ;; defaults to void
(caller-owns-return boolean-value) ;; defaults to #f
(can-return-null boolean-value) ;; defaults to #t
(parameter in-or-out-or-inout
(type-and-name parameter-type-alias parameter-name)
(type-parameter name-of-contained-type) ;; optional, requires parametric type
(c-declaration "c-type-and-name")) ;; c-declaration only required
;; if the type alias is "native"
(varargs #t) ;; has varargs at the end
)
Ex:
(function init
(in-module (Gdk Rgb)
(c-name gdk_rgb_init)))
Ex:
(function new
(in-module (Gdk Rgb Cmap))
(is-constructor-of GdkRgbCmap)
(c-name gdk_rgb_cmap_new)
(return-type GdkRgbCmap)
(caller-owns-return #t) ;; perhaps this could be implied by is-constructor-of
(parameter in (type-and-name array-of-guint32 colors))
(parameter in (type-and-name gint n_colors)))
Ex:
(function config_set_set_handler
(in-module (Gnome))
(c-name gnome_config_set_set_handler)
(parameter in (type-and-name native func)
(c-declaration "void (*func)(void*)"))
(parameter in (type-and-name gpointer data)))
===
(method method-name
(of-object object-name module-name)
;; retval/arg attributes as for (function), but with first parameter
;; omitted for non-constructors
)
Ex:
(method set_text
(of-object Label (Gtk))
(parameter (type-and-name const-gchar* str)))
===
(object-argument arg-name
(of-object object-we-are-an-argument-of optional-objects-module)
(type-id argument-type) ;; GTK_TYPE_OBJECT etc.
;; flags all default to #f
(readable bool-value)
(writeable bool-value)
(construct-only bool-value))
Ex:
(object-argument label
(of-object Label (Gtk))
(type GTK_TYPE_STRING)
(readable #t)
(writeable #t))
===
(signal signal-name
(run-action bool-value)
(run-first bool-value)
(run-last bool-value)
(of-object object-we-are-a-signal-of optional-objects-module)
;; return value and parameters as for a function, omitting the object
;; and user data parameters
;; what other properties matter for a signal?
)
Ex:
(signal select_row
(of-object CList (Gtk))
(run-first #t)
;; return type defaults to void
(parameter in (type-and-name gint row))
(parameter in (type-and-name gint column))
(parameter in (type-and-name GdkEvent* event)))
===
(enum enum-name
(in-module modname)
(c-name name-in-c)
(value (nick value-name-noprefixes-hyphen-lowercase) (c-name value-c-name)))
Ex:
(enum DirectionType
(in-module Gtk)
(c-name GtkDirectionType)
(value (nick tab-forward) (c-name GTK_DIR_TAB_FORWARD))
(value (nick tab-backward) (c-name GTK_DIR_TAB_BACKWARD))
(value (nick up) (c-name GTK_DIR_UP))
(value (nick down) (c-name GTK_DIR_DOWN))
(value (nick left) (c-name GTK_DIR_LEFT))
(value (nick right) (c-name GTK_DIR_RIGHT)))
(enum Pos
(in-module (Gtk CTree))
(c-name GtkCTreePos)
(value (nick before) (c-name GTK_CTREE_POS_BEFORE))
(value (nick as-child) (c-name GTK_CTREE_POS_AS_CHILD))
(value (nick after) (c-name GTK_CTREE_POS_AFTER)))
===
(flags) is just like enum, but some bindings may wrap enums and flags differently.
===
(boxed boxed-name
(in-module modname)
(c-name c-name)
(ref-func func-to-increase-refcount)
(copy-func func-to-copy)
(release-func func-to-destroy-or-decrement-refcount)
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
It is never OK to use memcpy() to copy a boxed type, or use
malloc()/free() to alloc/free one.
Ex:
(boxed Pixmap
(in-module (Gdk))
(c-name GdkPixmap)
(ref-func pixmap_ref)
(release-func pixmap_unref))
An "object" declaration automatically implies the type definition:
(type
(alias concat-module-elements-and-boxed-name)
(in-c-name pointer-to-c-name)
(out-c-name pointer-to-pointer-to-c-name)
(inout-c-name pointer-to-c-name))
Ex:
(type (alias GdkPixmap)
(in-c-name GdkPixmap*)
(out-c-name GdkPixmap**)
(inout-c-name GdkPixmap*))
===
(struct struct-name
(in-module modname)
(c-name c-name)
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
Unlike a boxed type, a struct type can be copied with memcpy() and
allocated on the stack or with g_malloc().
Ex:
(struct Rectangle
(in-module (Gdk))
(c-name GdkRectangle)
(field (type-and-name gint16 x) (access readwrite))
(field (type-and-name gint16 y) (access readwrite))
(field (type-and-name guint16 width) (access readwrite))
(field (type-and-name guint16 height) (access readwrite)))
Implies GdkRectangle type alias:
(type (alias GdkRectangle)
(in-c-name GdkRectangle*)
(out-c-name GdkRectangle*) ;; note - not the same as boxed types
(inout-c-name GdkRectangle*))
===
(user-function name
(in-module module)
(c-name c-typedef-name)
;; return-type and parameters as for (function)
)
Ex:
(user-function PrintFunc
(in-module (Gtk))
(parameter in (type-and-name gpointer func_data))
(parameter in (type-and-name gchar* str)))
===
(typedef new-name
(in-module module)
(c-name c-full-name)
(orig-type alias-of-orig-type))
Ex:
(typedef Type
(in-module (Gtk))
(c-name GtkType)
(orig-type guint))

View File

@@ -1,103 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ</TITLE>
<LINK HREF="gtkfaq-es-1.html" REL=next>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
<HR NOSHADE>
<H1>GTK+ FAQ</H1>
<H2>Nathan Froyd, Tony Gale, Shawn T. Amundson.</H2>Seis de Julio de 1998
<P><HR NOSHADE>
<EM>La intención de este documento es dar respuesta a las preguntas
realizadas con más frecuencia por parte de los programadores que utilizan GTK+ o simplemente por personas que desean utilizar GTK+. </EM>
<HR NOSHADE>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="gtkfaq-es-1.html">Información General</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-1.html#ss1.1">1.1 Autores</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.2">1.2 ¿Qué es GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.3">1.3 ¿Qué es el + en GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.9">1.9 Cómo reportar errores en GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
</UL>
<P>
<H2><A NAME="toc2">2.</A> <A HREF="gtkfaq-es-2.html">Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-2.html#ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
<LI><A HREF="gtkfaq-es-2.html#ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
</UL>
<P>
<H2><A NAME="toc3">3.</A> <A HREF="gtkfaq-es-3.html">Desarrollo de GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-3.html#ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="gtkfaq-es-4.html">Desarrollo con GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-4.html#ss4.1">4.1 ¿Cómo empiezo?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
</UL>
<P>
<H2><A NAME="toc5">5.</A> <A HREF="gtkfaq-es-5.html">Acerca de gdk</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-5.html#ss5.1">5.1 ¿Qué es gdk?</A>
<LI><A HREF="gtkfaq-es-5.html#ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
</UL>
<P>
<H2><A NAME="toc6">6.</A> <A HREF="gtkfaq-es-6.html">Acerca de glib</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-6.html#ss6.1">6.1 ¿Qué es glib?</A>
<LI><A HREF="gtkfaq-es-6.html#ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
</UL>
<P>
<H2><A NAME="toc7">7.</A> <A HREF="gtkfaq-es-7.html">Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-7.html#ss7.1">7.1 Nota del Traductor</A>
</UL>
<HR NOSHADE>
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
</BODY>
</HTML>

View File

@@ -1,192 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Información General</TITLE>
<LINK HREF="gtkfaq-es-2.html" REL=next>
<LINK HREF="gtkfaq-es.html#toc1" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-2.html">Next</A>
Previous
<A HREF="gtkfaq-es.html#toc1">Contents</A>
<HR NOSHADE>
<H2><A NAME="s1">1. Información General</A></H2>
<H2><A NAME="ss1.1">1.1 Autores</A>
</H2>
<P>Los autores de GTK+ son:
<P>
<UL>
<LI>Peter Mattis (petm@xcf.berkeley.edu)</LI>
<LI>Spencer Kimball (spencer@xcf.berkeley.edu)</LI>
<LI>Josh MacDonald (jmacd@xcf.berkeley.edu)</LI>
</UL>
GTK+ se ditribuye bajo la licencia de Librería Pública General de GNU
<P>
<H2><A NAME="ss1.2">1.2 ¿Qué es GTK+?</A>
</H2>
<P>GTK+ es un pequeño y eficiente conjunto de <EM>widgets</EM>, diseñados
con un aspecto y sentir general a Motif. Contiene <EM>widgets</EM> comúnes
y algúnos <EM>widgets</EM> más complejos como una selección de
archivos, y <EM>widgets</EM> de selección de colores.
<P>GTK+ proporciona algunas características únicas. (No tengo conocimiento
de otra librería de <EM>widge>
<HR><H3>Transfer interrupted!</H3>
enos).
Por ejemplo, un botón no contiene una etiqueta, contiene un <EM>widget</EM>
hijo, que en muchas instancias será una etiqueta. Sin embargo, el
<EM>widget</EM> hijo también puede ser un <EM>pixmap</EM> (mapa de pixels),
imagén o cualquier combinación posible que desee el programador. Toda la
librería es así de flexible.
<P>
<H2><A NAME="ss1.3">1.3 ¿Qué es el + en GTK+?</A>
</H2>
<P>Peter Mattis informó a la lista de correo gtk:
<BLOCKQUOTE>
"Escribí originalmente gtk el cual incluía tres librerías,
libglib, libgdk y libgtk. Era caracterizado por una jerarquía de
<EM>widget</EM> plana. O sea, no podías derivar un nuevo
<EM>widget</EM> de uno ya existente. Contenía un mecanismo de
<EM>callback</EM> (llamada) más estándar en lugar del mecanismo
de señales ahora presente en gtk+. El + fue agregado para distinguir
entre la versión original de gtk y la nueva versión. Pueden pensar
en ello como una ampliación al gtk original que agrega características
orientadas o objetos."
</BLOCKQUOTE>
<P>
<H2><A NAME="ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
</H2>
<P>Peter Mattis informó a la lista de correo gtk:
<BLOCKQUOTE>
"Pienso que la última vez que Spencer y yo hablamos al respecto nos
decidimos por GTK = Gimp ToolKit. Pero no estoy seguro. Sin embargo,
definitivamente no es GNU."
</BLOCKQUOTE>
<P>
<H2><A NAME="ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
</H2>
<P>
En el directorio doc/ de la distribución de GTK+ encontrarás
el material de referencia para GTK y GDK, este FAQ y el tutor de GTK.
<P>Adicionalmente, puedes encontrar enlaces a versiones HTML de estos
documentos al ir a
<A HREF="http://www.gtk.org/">http://www.gtk.org/</A>.
<P>El Tutor y el FAQ también se pueden encontrar en
<A HREF="http://www.geocities.com/ResearchTriangle/Lab/4299/">http://www.geocities.com/ResearchTriangle/Lab/4299/</A>.
<P>
<H2><A NAME="ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
</H2>
<P>Hay dos listas de correo:
<UL>
<LI>Una lista de correo para la discusión del desarrollo de aplicaciones
basadas en GTK se hospeda en gtk-app-devel-list@redhat.com. Para suscribirse
envíe un correo electrónico a
<A HREF="mailto:gtk-app-devel-list-request@redhat.com">gtk-app-devel-list-request@redhat.com</A> con <EM>subscribe</EM> en el
campo <B>subject</B>.
<P>
</LI>
<LI>Una lista de correo para la discusión del desarrollo de GTK se hospeda
en gtk-list@redhat.com. Para suscribirse envíe un correo electrónico
a
<A HREF="mailto:gtk-list-request@redhat.com">gtk-list-request@redhat.com</A> con <EM>subscribe</EM>
en el campo <B>subject</B>.
<P>Un archivo escudriñable de la lista de correo puede ser encontrado en
<A HREF="http://archive.redhat.com/gtk-list">http://archive.redhat.com/gtk-list</A></LI>
</UL>
<H2><A NAME="ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
está muerta?</H2>
<P>No, todos están ocupados codificando.
<P>
<H2><A NAME="ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
</H2>
<P>Primero, asegúrate que tu pregunta no esté respondida en la
documentación, este FAQ o el tutor. ¿Hecho? ¿Estás seguro de que
lo has hecho, verdad? En ese caso, el mejor lugar para hacer preguntas es
la lista de correo de GTK+.
<P>
<H2><A NAME="ss1.9">1.9 Cómo reportar errores en GTK+</A>
</H2>
<P>Los reportes de errores se deben enviar a la lista de correo de GTK+.
<P>
<H2><A NAME="ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
</H2>
<P>Algunas aplicaciones que utilizan GTK+ son:
<UL>
<LI>GIMP (
<A HREF="http://www.XCF.Berkeley.EDU/~gimp/">http://www.XCF.Berkeley.EDU/~gimp/</A> ),
un programa de manipulación de imágenes</LI>
<LI>Gsumi (
<A HREF="http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html">http://www.msc.cornell.edu/~otaylor/gsumi/gsumi.html</A>),
un divertido programa para rayar en blanco y negro con soporte para
XInput.</LI>
<LI>GUBI (
<A HREF="http://www.SoftHome.net/pub/users/timj/gubi/index.htm">http://www.SoftHome.net/pub/users/timj/gubi/index.htm</A>),
un constructor de interface de usuario</LI>
<LI>Gzilla (
<A HREF="http://www.levien.com/gzilla/">http://www.levien.com/gzilla/</A>),
un navegador del web</LI>
<LI>SANE (
<A HREF="http://www.azstarnet.com/~axplinux/sane/">http://www.azstarnet.com/~axplinux/sane/</A> ),
una interface universal para <EM>scanner</EM></LI>
<LI>XQF (
<A HREF="http://www.botik.ru/~roma/quake/">http://www.botik.ru/~roma/quake/</A>),
un lanzador y navegador de servidores de QuakeWorld/Quake2</LI>
<LI>ElectricEyes (
<A HREF="http://www.labs.redhat.com/ee.shtml">http://www.labs.redhat.com/ee.shtml</A>),
un visor de imágenes que se dirige a ser un reemplazo libre de xv</LI>
<LI>GPK - the General Proxy Kit (
<A HREF="http://www.humanfactor.com/gpk/">http://www.humanfactor.com/gpk/</A>),
una librería agregable que permite accesso seguro a GTK+
ante múltiples hilos</LI>
<LI>GCK - the General Convenience Kit (
<A HREF="http://www.ii.uib.no/~tomb/gck.html">http://www.ii.uib.no/~tomb/gck.html</A>),
funciones misceláneas cuya intención es facilitar el manejo de
colores, construcción de IU (interfaces de usuario), operaciones
vectoriales, y funciones matemáticas</LI>
<LI>GDK Imlib (
<A HREF="http://www.labs.redhat.com/imlib/">http://www.labs.redhat.com/imlib/</A>),
una librería de manipulación y carga rápida de imágenes para
GDK </LI>
</UL>
<P>Adicionalmente a lo de arriba, el proyecto GNOME
(
<A HREF="http://www.gnome.org">http://www.gnome.org</A>)
utiliza GTK+ para construír un escritorio libre para Linux. Muchos más
programas pueden ser encontrados ahí.
<P>
<H2><A NAME="ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
</H2>
<P>
<P>Pregunte en gtk-list para sugerencias. Actualmente hay por lo menos cuatro
clientes IRC endesarrollo.
<P>
<UL>
<LI>girc. (Incluído con GNOME)</LI>
<LI>Bezerk (
<A HREF="http://www.gtk.org/~trog/">http://www.gtk.org/~trog/</A>)</LI>
<LI>gsirc. (¿Localización?)</LI>
<LI>Gnirc. (
<A HREF="http://www.imaginet.fr/~dramboz/gnirc">http://www.imaginet.fr/~dramboz/gnirc</A>)</LI>
</UL>
<P>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-2.html">Next</A>
Previous
<A HREF="gtkfaq-es.html#toc1">Contents</A>
</BODY>
</HTML>

View File

@@ -1,195 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Cómo encontrar, configurar, instalar y comprobar GTK+</TITLE>
<LINK HREF="gtkfaq-es-3.html" REL=next>
<LINK HREF="gtkfaq-es-1.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc2" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-3.html">Next</A>
<A HREF="gtkfaq-es-1.html">Previous</A>
<A HREF="gtkfaq-es.html#toc2">Contents</A>
<HR NOSHADE>
<H2><A NAME="s2">2. Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
<H2><A NAME="ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
</H2>
<P>Para compilar GTK+, todo lo que necesita es un compilador de C (gcc) y
el Sistema X Windows y librerías asociadas en su sistema.
<P>
<H2><A NAME="ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
</H2>
<P>El sitio canónico es:
<PRE>
ftp://ftp.gtk.org/pub/gtk
</PRE>
Por supuesto, cualquier espejo de ftp.gtk.org debe tener las últimas
versiones también.
<P>
<H2><A NAME="ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
</H2>
<P>Por lo general, todo lo que necesita es emititir los comandos:
<PRE>
./configure
make
</PRE>
en el directorio gtk+-version/.
<P>
<H2><A NAME="ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
</H2>
<P>Asegúrese de que utiliza GNU make (verifique con <CODE>make -v</CODE>). Hay
varias versiones extrañas y maravillosas de make por ahí, y no todas
manejan los <EM>Makefiles</EM> generados automáticamente.
<P>
<P>
<H2><A NAME="ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
</H2>
<P>Este problema se encuentra comúnmente cuando las librerías GTK+ no pueden
ser localizadas o tienen la versión incorrecta. Generalmente, el compilador
se quejará de un 'unresolved symbol' (símbolo no resuelto). Hay dos cosas
que necesita verificar:
<P>
<UL>
<LI>Asegúrese de que las librerías pueden ser encontradas. Usted desea editar
/etc/ld.so.conf para incluír los directorios que contienen las librerías
GTK, de manera que luzca como:
<PRE>
/usr/X11R6/lib
/usr/local/lib
</PRE>
Luego necesita correr /sbin/ldconfig como root. Puede encontrar que directorio
utiliza GTK al ejecutar
<PRE>
gtk-config --libs
</PRE>
Si su sitema no utiliza ld.so para encontrar librerías (como Solaris),
entonces tendrá que utilizar la variable de ambiente LD_LIBRARY_PATH
(o compilar el camino en su programa, lo cual no voy a cubrir aquí). Así
que, con un shell tipo Bourne usted puede hacer (si sus librerías GTK
están en /usr/local/lib):
<PRE>
export LD_LIBRARY_PATH=/usr/local/lib
</PRE>
y en un csh, usted puede hacer:
<PRE>
setenv LD_LIBRARY_PATH /usr/local/lib
</PRE>
</LI>
<LI>Asegúrese de que el enlazador está ha encontrado el conjunto correcto de
librerías. Si tiene una distribución de Linux que instala GTK+ (ej.
RedHat 5.0) entonces esta versión anterior puede ser utilizada. Ahora
(asumiendo que tiene un sistema RedHat), emita el comando
<PRE>
rpm -e gtk gtk-devel
</PRE>
También puede querer remover los paquetes que dependen de gtk (rpm le
dirá cuáles son). Si no tiene un sistema Linux RedHat, verifique
para estar seguro que ni
<PRE>
/usr/lib
</PRE>
ni
<PRE>
/usr/local/lib
</PRE>
contengan alguna de las librerías libgtk, libgdk, libglib, or libgck.
Si existen, elimínelas (y cualquier archivo <EM>include</EM>, como
/usr/include/gtk y /usr/include/gdk) y reinstale gtk+.</LI>
</UL>
<P>
<H2><A NAME="ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
</H2>
<P>El archivo de encabezado "glibconfig.h" se movió al directorio
$exec_prefix/lib/glib/include/. $exec_prefix es el directorio que fue
especificado al dar la bandera --exec-prefix a ./configure cuando se
compiló GTK+. Va por omisión a $prefix, (especificado con --prefix),
que en su lugar va por omisión a /usr/local/.
<P>Ésto se hizo asi porque "glibconfig.h" incluye información
dependiente de la arquitectura, y el resto de los archivos <EM>include</EM>
se colocan en $prefix/include, el cual puede ser compartido entre distintas
arquitecturas.
<P>GTK+ incluye un guión para el intérprete de comandos,
<CODE>gtk-config</CODE>, el cual hace fácil
encontrar los caminos correctos de inclusión. El tutor de GTK+ incluye
un ejemplo de como utilizar <CODE>gtk-config</CODE> para una compilación simple
desde la línea de comandos. Para información sobre configuraciones más
complicadas, vea el archivo docs/gtk-config.txt en la distribución de GTK+.
<P>Si está intentando compilar un programa viejo, puede bordear el problema
al configurarlo con una línea de comando como:
<P>
<BLOCKQUOTE><CODE>
<PRE>
CPPFLAGS="-I/usr/local/include/glib/include" ./configure
</PRE>
</CODE></BLOCKQUOTE>
<P>para intérpretes de comandos compatibles con Bourne como bash, o para
variantes csh:
<P>
<BLOCKQUOTE><CODE>
<PRE>
setenv CPPFLAGS "-I/usr/local/include/glib/include"
./configure
</PRE>
</CODE></BLOCKQUOTE>
<P>(Sustituya el valor apropiado de $exec_prefix para /usr/local.)
<P>
<H2><A NAME="ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
</H2>
<P>Hay varias razones comúnes para esto:
<UL>
<LI>Usted tiene una versión vieja de GTK instalada en algún lugar.
RedHat 5.0, por ejemplo, instala una copia anterior de GTK que no funcinará
con las últimas veriones de GIMP. Debe eliminar esta copia vieja, pero
observe que en el caso de RedHat 5.0 esto dañará las aplicaciones
<CODE>control-panel</CODE>.
<P>
</LI>
<LI><CODE>gtk-config</CODE> (u otro componente de GTK) no se encuentra en el camino
(<EM>path</EM>),
o hay una versión vieja en su sistema. Teclee:
<PRE>
gtk-config --version
</PRE>
para verificar ambos casos. Ésto debe devolver un valor de por lo menos
0.99.8 para que las cosas funcionen correctamente con GIMP 0.99.23. Si
devuelve un valor distinto a lo que usted espera, entonces tiene una versión
vieja de GTK en su sistema.
<P>
</LI>
<LI>El guión ./configure no puede encontrar las librerías GTK. Como
./configure compila varios programas de prueba, necesita poder encontrar las
librerías GTK. Revise la pregunta anterior para obtener más ayuda al
respecto.</LI>
</UL>
<P>Si nada de lo anterior ayuda, entonces revise config.log, el cual es
generado por ./configure cuando corre. Al final estará la última
acción tomada antes de fallar. Si es una sección de código fuente,
copie el código fuente a un archivo y compilelo con la línea
jústamente arriba de él en config.log. Si la compilación tiene
éxito, intente ejecutarlo.
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-3.html">Next</A>
<A HREF="gtkfaq-es-1.html">Previous</A>
<A HREF="gtkfaq-es.html#toc2">Contents</A>
</BODY>
</HTML>

View File

@@ -1,198 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Desarrollo de GTK+</TITLE>
<LINK HREF="gtkfaq-es-4.html" REL=next>
<LINK HREF="gtkfaq-es-2.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc3" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-4.html">Next</A>
<A HREF="gtkfaq-es-2.html">Previous</A>
<A HREF="gtkfaq-es.html#toc3">Contents</A>
<HR NOSHADE>
<H2><A NAME="s3">3. Desarrollo de GTK+</A></H2>
<H2><A NAME="ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
</H2>
<P>CVS es el Concurrent Version System (Sistema de Versión Concurrente) y es
un medio muy popular de control de versión para proyectos de software.
Está diseñado para permitir que múltiples autores puedan operar de
manera simultánea en el mismo árbol fuente. Este árbol fuente es
mantenido centralizadamente, pero cada desarrollador tiene una réplica local
de este repositorio en el cual hacen sus cambios.
<P>Los desarrolladores de GTK+ utilizan un repositorio CVS para almacenar la
copia maestra de la actual versión en desarrollo de GTK+. Como tal,
la gente que desea contribuír con parches a GTK+ deben generarlos para la
versión del CVS. La gente normal debe utilizar los paquetes liberados.
<P>El conjunto de herramientas CVS está disponible como paquetes RPM en los
sitios usuales de RedHat. La última versión está disponible en
<A HREF="http://download.cyclic.com/pub/">&lt;http://download.cyclic.com/pub/&gt;</A><P>Cualquiera puede bajar la última versión CVS de GTK+ utilizando
acceso anónimo con los siguientes pasos:
<UL>
<LI> En un descendiente del intérprete de comandos bourne (ej. bash)
teclee:
<PRE>
export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/debian/home/gnomecvs'
</PRE>
</LI>
<LI>Luego, la primera vez que el árbol fuente se retira, se necesita
un <EM>login</EM> cvs.
<PRE>
cvs login
</PRE>
Ésto hará que se le solicite una clave de acceso. No hay clave de
acceso para cvs.gimp.org, así que solo ingrese un retorno de carro.</LI>
<LI>Para conseguir el árbol y colocarlo en un subdirectorio de su
directorio de trabajo actual, emita el comando:
<PRE>
cvs -z3 get gtk+
</PRE>
Observe que con el árbol GTK+ 1.1, glib se ha movido a un módulo CVS
separado, de manera que si no tiene glib instalado necesitará conseguirlo
igualmente:
<PRE>
cvs -z3 get glib
</PRE>
</LI>
</UL>
<H2><A NAME="ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
</H2>
<P>Es simple. Si algo no funciona en un programa como usted piensa que debería,
revise la documentación para asegurarse de que no ha pasado algo por alto.
Si es un verdadero error o característica perdida, rastréelo en el
fuente de GTK+, cámbielo, y entonces genere un parche en la forma de un
'diff de contexto'. Esto puede hacerse utilizando un comando como
<CODE>diff -ru &lt;oldfile&gt; &lt;newfile&gt;</CODE>. Entonces envíe el archivo
de parche a:
<PRE>
ftp://ftp.gtk.org/incoming
</PRE>
junto a un archivo README. ¡Asegúrese de seguir las convenciones de
asignación de nombres o su parche será borrado! Los archivos deben ser
de esta forma:
<PRE>
gtk-&lt;username>-&lt;date yymmdd-n>.patch.gz
gtk-&lt;username>-&lt;date yymmdd-n>.patch.README
</PRE>
La "n" en la fecha indica un número único (empezando de 0)
de parches que subió ese día. Debe ser 0, a menos que envíe más de
un parche en el mismo día.
<P>Example:
<PRE>
gtk-gale-982701-0.patch.gz
gtk-gale-982701-0.patch.README
</PRE>
Una vez que usted envía <EM>lo que sea</EM>, envíe el README a
ftp-admin@gtk.org
<P>
<H2><A NAME="ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
</H2>
<P>Los parches enviados se mandarán a
<CODE>ftp://ftp.gtk.org/pub/gtk/patches</CODE>
donde uno del equipo de desarrollo de GTK+ los recogerá. Si son aplicados,
serán movidos a <CODE>/pub/gtk/patches/old</CODE>.
<P>Los parches que no son aplicados, por cualquier razón, se mandarán a
<CODE>/pub/gtk/patches/unapplied</CODE> o <CODE>/pub/gtk/patches/outdated</CODE>.
En este punto puede preguntar en la lista de correo <CODE>gtk-list</CODE> el porqué
su parche no fué aplicado. Hay muchas razones posibles por las cuales un
parche no se aplica, pasando desde que no se puede aplicar limpiamente, hasta
que no es correcto. No se rinda si no logró que su parche se aplicase a la
primera.
<P>
<H2><A NAME="ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
</H2>
<P>Esto corresponde a los autores, de manera que tendrá que preguntarles
al terminar su <EM>widget</EM>. Como una guía general, los <EM>widgets</EM>
que por lo general son útiles, funcionan, y no son una desgracia al conjunto
de <EM>widgets</EM> serán incluídos con mucho gusto.
<P>
<H2><A NAME="ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
</H2>
<P>Sí. Existe
<UL>
<LI>una envoltura de C++ para GTK+ llamada gtk--. Puede encontrar el su
página hogar en:
<A HREF="http://www.cs.tut.fi/~p150650/gtk/gtk--.html">http://www.cs.tut.fi/~p150650/gtk/gtk--.html</A>.
El sitio FTP es
<A HREF="ftp://ftp.gtk.org/pub/gtk/gtk--">ftp://ftp.gtk.org/pub/gtk/gtk--</A>.
<P>
<P>
</LI>
<LI>Hay dos ataduras para Objective-C en desarrollo:
<UL>
<LI>El paquete elegido por el
<A HREF="http://www.gnome.org/">proyecto GNOME</A> es obgtk. Objgtk se basa en la clase Object y es
mantenido por
<A HREF="mailto:sopwith@cuc.edu">Elliot Lee</A>.
Aparentemente, objgtk se está aceptando como el atamiento `estándar'
de Objective-C para GTK+.
</LI>
<LI> Si usted está más inclinado al
<A HREF="http://www.gnustep.org/">proyecto GNUstep</A>,
puede que quiera revisar GTKKit por
<A HREF="mailto:helge@mdlink.de">Helge He&szlig;</A>.
La intención es crear un atamiento GTK+ utilizando FoundationKit.
GTKKit incluye linduras como escribir un archivo con una plantilla tipo
XML para construír una interface GTK+.
</LI>
</UL>
<P>
</LI>
<LI>Atamientos Perl
<A HREF="ftp://ftp.gtk.org/pub/gtk/perl">ftp://ftp.gtk.org/pub/gtk/perl</A>
<P>
</LI>
<LI>Atamientos Guile. La página hogar se encuentra en
<A HREF="http://www.ping.de/sites/zagadka/guile-gtk">http://www.ping.de/sites/zagadka/guile-gtk</A>.
Por cierto, Guile es la implantación del Proyecto GNU de Scheme R4RS (el
estándar). Si le gusta Scheme, querrá darle un vistazo a éste.
<P>
<P>
</LI>
<LI>David Monniaux informa:
<BLOCKQUOTE>
He empezado un sistema de atamiento gtk-O'Caml. Las bases del sistema,
incluyendo <EM>callbacks</EM>, funcionan bien.
El desarrollo actual se encuentra en
<A HREF="http://www.ens-lyon.fr/~dmonniau/arcs">http://www.ens-lyon.fr/~dmonniau/arcs</A></BLOCKQUOTE>
</LI>
<LI>Se han hecho varios atamientos para python:
<P>
<UL>
<LI>pygtk se encuentra en
<A HREF="http://www.daa.com.au/~james/pygtk">http://www.daa.com.au/~james/pygtk</A> y
<A HREF="ftp://ftp.gtk.org/pub/gtk/python">ftp://ftp.gtk.org/pub/gtk/python</A></LI>
<LI>python-gtk se encuentra en
<A HREF="http://www.ucalgary.ca/~nascheme/python-gtk">http://www.ucalgary.ca/~nascheme/python-gtk</A></LI>
</UL>
<P>
</LI>
<LI>Hay un <EM>widget</EM> disponible para GTK+. Agárrelo en
<A HREF="http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html">http://www.sakuranet.or.jp/~aozasa/shige/doc/comp/gtk/gtkGL/files-en.html</A>
</LI>
</UL>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-4.html">Next</A>
<A HREF="gtkfaq-es-2.html">Previous</A>
<A HREF="gtkfaq-es.html#toc3">Contents</A>
</BODY>
</HTML>

View File

@@ -1,435 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Desarrollo con GTK+</TITLE>
<LINK HREF="gtkfaq-es-5.html" REL=next>
<LINK HREF="gtkfaq-es-3.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc4" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-5.html">Next</A>
<A HREF="gtkfaq-es-3.html">Previous</A>
<A HREF="gtkfaq-es.html#toc4">Contents</A>
<HR NOSHADE>
<H2><A NAME="s4">4. Desarrollo con GTK+</A></H2>
<H2><A NAME="ss4.1">4.1 ¿Cómo empiezo?</A>
</H2>
<P>Después de que ha instalado GTK+, hay un par de cosas que pueden
facilitarle el desarrollo de aplicaciones con él. Está el Tutor de
GTK+
<A HREF="http://www.gtk.org/tutorial/">&lt;http://www.gtk.org/tutorial/&gt;</A>, el cual está en desarrollo
activo. Este tutorial le introducirá en la escritura de aplicaciones
utilizando C.
<P>El Tutor no contiene (todavía) información sobre todos los
<EM>widgets</EM> que existen en GTK+. Para código de ejemplo sobre la
utilización básica de todos los <EM>widgets</EM> de GTK+, debe ver
el archivo gtk/testgtk.c (y archivos fuentes asociados) en la distribución
GTK+. Ver estos ejemplos le dará una buena base sobre lo que pueden hacer
los <EM>widgets</EM>.
<P>
<H2><A NAME="ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
</H2>
<P>El Tutor de GTK+ lista los siguientes <EM>widgets</EM>:
<PRE>
GtkObject
+GtkData
| +GtkAdjustment
| `GtkTooltips
`GtkWidget
+GtkContainer
| +GtkBin
| | +GtkAlignment
| | +GtkEventBox
| | +GtkFrame
| | | `GtkAspectFrame
| | +GtkHandleBox
| | +GtkItem
| | | +GtkListItem
| | | +GtkMenuItem
| | | | `GtkCheckMenuItem
| | | | `GtkRadioMenuItem
| | | `GtkTreeItem
| | +GtkViewport
| | `GtkWindow
| | +GtkColorSelectionDialog
| | +GtkDialog
| | | `GtkInputDialog
| | `GtkFileSelection
| +GtkBox
| | +GtkButtonBox
| | | +GtkHButtonBox
| | | `GtkVButtonBox
| | +GtkHBox
| | | +GtkCombo
| | | `GtkStatusbar
| | `GtkVBox
| | +GtkColorSelection
| | `GtkGammaCurve
| +GtkButton
| | +GtkOptionMenu
| | `GtkToggleButton
| | `GtkCheckButton
| | `GtkRadioButton
| +GtkCList
| `GtkCTree
| +GtkFixed
| +GtkList
| +GtkMenuShell
| | +GtkMenuBar
| | `GtkMenu
| +GtkNotebook
| +GtkPaned
| | +GtkHPaned
| | `GtkVPaned
| +GtkScrolledWindow
| +GtkTable
| +GtkToolbar
| `GtkTree
+GtkDrawingArea
| `GtkCurve
+GtkEditable
| +GtkEntry
| | `GtkSpinButton
| `GtkText
+GtkMisc
| +GtkArrow
| +GtkImage
| +GtkLabel
| | `GtkTipsQuery
| `GtkPixmap
+GtkPreview
+GtkProgressBar
+GtkRange
| +GtkScale
| | +GtkHScale
| | `GtkVScale
| `GtkScrollbar
| +GtkHScrollbar
| `GtkVScrollbar
+GtkRuler
| +GtkHRuler
| `GtkVRuler
`GtkSeparator
+GtkHSeparator
`GtkVSeparator
</PRE>
<P>
<H2><A NAME="ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
</H2>
<P>Aunque GTK+, como la mayoría de los juegos de herramientas para X,
no es seguro ante múltiples hilos, esto no prohibe el desarrollo de
aplicaciones con múltiples hilos con GTK+.
<P>Rob Browning (rlb@cs.utexas.edu) describe técnicas de hilamiento
que pueden utilizarse con GTK+ (levemente modificado):
<P>Básicamente existen dos enfoques principales, el primero es sencillo,
y el segundo complicado. En el primero, simplemente hay que asegurarse
de que todas las interacciones de GTK+ (o X) se manejan por un, y solo un,
hilo. Cualquier otro hilo que desee dibujar algo tiene que notificarlo de
alguna manera al hilo "GTK+", y dejarlo que maneje el trabajo real.
<P>El segundo enfoque le permite llamar funciones de GTK+ (o X) desde cualquier
hilo, pero requiere sincronización cuidadosa. La idea básica es crear
una exclusión mutua de protección para X, de manera que nadie haga
llamadas X sin primero adquirir esta exclusión mutua.
<P>Observe que se trata de un pequeño esfuerzo, pero que le permitirá ser
potencialmente más eficiente que un GTK+ completamente seguro ante
múltiples hilos. Usted decide la granularidad del bloqueo de hilos.
También debe asegurarse que el hilo que llama a gtk_main mantiene la
cerradura cuando llama a gtk_main.
<P>Lo siguiente por lo que hay que preocuparse ya que se tenía agarrada
la exclusión mutua global cuando se entró a gtk_main, es que todos
los <EM>callbacks</EM> también la tendrán. Esto significa que el
<EM>callback</EM> debe soltarla si va a llamar a cualquier otro código
que pueda readquirirla. De otra manera obtendrá un bloqueo mortal.
También hay que tener agarrada la exclusión mutua cuando finalmente
regresa del <EM>callback</EM>.
<P>Para permitir a otros hilos, además del que llama a gtk_main, tener
acceso a la exclusión mutua, necesitamos registrar una función de
trabajo con GTK que nos permita liberar la exclusión mutua
periódicamente.
<P>¿Por qué GTK+ no puede ser seguro ante múltiples hilos de
manera nativa?
<P>Complejidad, sobrecarga, y mano de obra. La proporción de programas
con hilos es todavía razonablemente pequeña, y conseguir seguridad
ante hilos es muy difícil y le quita tiempo valioso al trabajo
principal de obtener una buena librería gráfica terminada. Sería
muy agradable que GTK+ fuera seguro ante hilos "al sacarlo de la caja",
pero no es práctico ahora mismo, y haría a GTK+ sustancialmente menos
eficiente si no se maneja cuidadosamente.
<P>De cualquier manera, no es una prioridad esencial ya que existen remedios
relativamente buenos.
<P>
<H2><A NAME="ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
</H2>
<P>
Utilize gtk_container_disable_resize y gtk_container_enable_resize alrededor
del código donde quiere cambiar varias cosas. Esto resultará en mayor
velocidad ya que prevendrá tener que darle el tamaño otra vez a la
jerarquía de <EM>widget</EM> por completo.
<P>
<H2><A NAME="ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
</H2>
<P>Tim Janik escribió a la lista gtk-list (ligeramente modificado):
<P>Defina un manejador de señal:
<P>
<BLOCKQUOTE><CODE>
<PRE>
gint
signal_handler_event(GtkWiget *widget, GdkEvenButton *event, gpointer func_data)
{
if (GTK_IS_LIST_ITEM(widget) &amp;&amp;
(event->type==GDK_2BUTTON_PRESS ||
event->type==GDK_3BUTTON_PRESS) ) {
printf("I feel %s clicked on button %d\",
event->type==GDK_2BUTTON_PRESS ? "double" : "triple",
event->button);
}
return FALSE;
}
</PRE>
</CODE></BLOCKQUOTE>
<P>Y conecte el manejador a su objeto:
<P>
<BLOCKQUOTE><CODE>
<PRE>
{
/* lista, asuntos de inicializacion de articulos de lista */
gtk_signal_connect(GTK_OBJECT(list_item),
"button_press_event",
GTK_SIGNAL_FUNC(signal_handler_event),
NULL);
/* y/o */
gtk_signal_connect(GTK_OBJECT(list_item),
"button_release_event",
GTK_SIGNAL_FUNC(signal_handler_event),
NULL);
/* algo mas */
}
</PRE>
</CODE></BLOCKQUOTE>
<P>y, Owen Taylor escribió:
<P>Observe que se recibirá la pulsación del botón de antemano, y
si está haciendo esto para un botón, también obtendrá una señal
de "tecleado" para el botón. (Esto es cierto para cualquier juego de
herramientas, ya que las computadoras no son buenas para leer la mente de
cada quien.)
<P>
<H2><A NAME="ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
</H2>
<P>
<P>Consiga la selección con algo como esto:
<BLOCKQUOTE><CODE>
<PRE>
GList *sel;
sel = GTK_LIST(list)->selection;
</PRE>
</CODE></BLOCKQUOTE>
<P>Así es como GList está definido (sacado de glist.h):
<BLOCKQUOTE><CODE>
<PRE>
typedef struct _GList GList;
struct _GList
{
gpointer data;
GList *next;
GList *prev;
};
</PRE>
</CODE></BLOCKQUOTE>
<P>Una estructura GList es simplemente una estructura para listas doblemente
enlazadas. Existen varias funciones g_list_*() para modificar una lista
enlazada en glib.h. Sin embargo, la selección GTK_LIST(MyGtkList)->selection
es mantenida por las funciones gtk_list_*() y no deben ser modificadas.
<P>El selection_mode del GtkList determina las facilidades de selección de un
GtkList y por lo tanto los contenidos de GTK_LIST(AnyGtkList)->selection:
<P>
<PRE>
selection_mode GTK_LIST()->selection contents
------------------------------------------------------
GTK_SELECTION_SINGLE) la selección es NULL
o contiene un puntero GList*
para un artículo seleccionado individualmente
GTK_SELECTION_BROWSE) la selección es NULL si la lista
no contiene widgets, de otra manera
contiene un puntero GList*
para una estructura GList.
GTK_SELECTION_MULTIPLE) la selección es NULL si no se seleccionan
listitems para un apuntador GList*
para el primer artículo seleccionado. Eso en
su lugar apunta a una estructura GList para el
segundo artículo seleccionado y continúa
GTK_SELECTION_EXTENDED) la selección es NULL.
</PRE>
<P>El campo data de la estructura GList GTK_LIST(MyGtkList)->selection apunta
al primer GtkListItem que es seleccionado. De manera que si quiere determinar
cuales listitems están seleccionados debe hacer esto:
<P>Durante la in>
<HR><H3>Transfer interrupted!</H3>
>
{
gchar *list_items[]={
"Item0",
"Item1",
"foo",
"last Item",
};
guint nlist_items=sizeof(list_items)/sizeof(list_items[0]);
GtkWidget *list_item;
guint i;
list=gtk_list_new();
gtk_list_set_selection_mode(GTK_LIST(list), GTK_SELECTION_MULTIPLE);
gtk_container_add(GTK_CONTAINER(AnyGtkContainer), list);
gtk_widget_show (list);
for (i = 0; i &lt; nlist_items; i++)
{
list_item=gtk_list_item_new_with_label(list_items[i]);
gtk_object_set_user_data(GTK_OBJECT(list_item), (gpointer)i);
gtk_container_add(GTK_CONTAINER(list), list_item);
gtk_widget_show(list_item);
}
}
</PRE>
</CODE></BLOCKQUOTE>
<P>Para tener conocimiento de la inicialización:
<BLOCKQUOTE><CODE>
<PRE>
{
GList *items;
items=GTK_LIST(list)->selection;
printf("Selected Items: ");
while (items) {
if (GTK_IS_LIST_ITEM(items->data))
printf("%d ", (guint)
gtk_object_get_user_data(items->data));
items=items->next;
}
printf("\n");
}
</PRE>
</CODE></BLOCKQUOTE>
<H2><A NAME="ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
</H2>
<P>El comportamiento de GTK+ (sin recorte) es una consecuencia de sus intentos
para conservar recursos de X. Los <EM>widgets</EM> etiqueta (entre otros) no
tienen su propia ventana X - simplemente dibujan su contenido en la ventana
de su padre. Aunque sería posible hacer que ocurran recortes al establecer
la máscara de recorte antes de dibujar el texto, esto podría causar una
penalización substancial en el rendimiento.
<P>Es posible que, a largo plazo, la mejor solución a tales problemas sea
simplemente cambiar gtk para que le de ventanas X a las etiquetas. Un remedio
a corto plazo es poner el <EM>widget</EM> de etiqueta dentro de otro
<EM>widget</EM> que sí obtiene su propia ventana - un candidato posible puede ser el <EM>widget</EM> <EM>viewport</EM>.
<P>
<BLOCKQUOTE><CODE>
<PRE>
viewport = gtk_viewport (NULL, NULL);
gtk_widget_set_usize (viewport, 50, 25);
gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
gtk_widget_show(viewport);
label = gtk_label ("a really long label that won't fit");
gtk_container_add (GTK_CONTAINER(viewport), label);
gtk_widget_show (label);
</PRE>
</CODE></BLOCKQUOTE>
<P>Si estuviera haciendo esto para un montón de <EM>widgets</EM>, querrá
copiar gtkviewport.c y arrancar la funcionalidad de sombra y ajuste (tal vez
quiera llamarlo GtkClipper).
<P>
<H2><A NAME="ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
</H2>
<P>De: Peter Mattis
<P>La razón por la cuál los botones no mueven a su hijo abajo y a la derecha
cuando son presionados es porque no me parece que eso es lo que ocurre
visualmente. Mi visión de los botonos es que los miras de manera recta.
O sea, la interface de usuario tiende sobre un plano y tú estás sobre
él observándolo de manera recta. Cuando un botón es presionado se
mueve directamente lejos de tí. Para ser absolutamente correcto supongo
que el hijo debería encojerse un poquito. Pero no veo por qué el hijo
debería moverse abajo y a la izquierda. Recurda, el hijo se supone que
está pegado a la superficie del botón. No es bueno que luzca como si
el hijo se resbala sobre la superficie del botón.
<P>En una nota más práctica, ya implanté esto una vez y determiné
que no se veía bien y lo quité.
<P>
<H2><A NAME="ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
</H2>
<P>Revise el
<A HREF="http://www.gtk.org/tutorial/">Tutor</A> para información sobre como crear menús.
<P>Sin embargo, para crear una línea de separación en un menú,
simplemente inserte un artículo de menú vacío:
<P>
<BLOCKQUOTE><CODE>
<PRE>
menuitem = gtk_menu_item_new();
gtk_menu_append(GTK_MENU(menu), menuitem);
gtk_widget_show(menuitem);
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
</H2>
<P>Utilice algo como lo que sigue:
<P>
<BLOCKQUOTE><CODE>
<PRE>
menu_path = gtk_menu_factory_find (factory, "&lt;MyApp>/Help");
gtk_menu_item_right_justify(menu_path->widget);
</PRE>
</CODE></BLOCKQUOTE>
<H2><A NAME="ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
</H2>
<P>Después de haber creado su ventana, haga gtk_grab_add(my_window). Y
después de cerrar la ventana haga gtk_grab_remove(my_window).
<P>
<H2><A NAME="ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
</H2>
<P>
<P>Probablemente usted está haciendo todos los cambios dentro de una función
sin devolver el control a gtk_main. La mayoría de las actualizaciones de
dibujo se colocan simplemente en una cola, la cual es procesada dentro de
gtk_main. Puede forzar que se procese la cola de dibujado utilizando algo como:
<P>
<BLOCKQUOTE><CODE>
<PRE>
while (gtk_events_pending())
gtk_main_iteration();
</PRE>
</CODE></BLOCKQUOTE>
<P>dentro de la función que cambia el <EM>widget</EM>.
<P>Lo que el fragmento anterior hace es correr todos los eventos pendientes y
funciones ociosas de alta prioridad, luego regresa de inmediato (el dibujado
se realiza en una función ociosa de alta prioridad).
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-5.html">Next</A>
<A HREF="gtkfaq-es-3.html">Previous</A>
<A HREF="gtkfaq-es.html#toc4">Contents</A>
</BODY>
</HTML>

View File

@@ -1,92 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Acerca de gdk</TITLE>
<LINK HREF="gtkfaq-es-6.html" REL=next>
<LINK HREF="gtkfaq-es-4.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc5" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-6.html">Next</A>
<A HREF="gtkfaq-es-4.html">Previous</A>
<A HREF="gtkfaq-es.html#toc5">Contents</A>
<HR NOSHADE>
<H2><A NAME="s5">5. Acerca de gdk</A></H2>
<H2><A NAME="ss5.1">5.1 ¿Qué es gdk?</A>
</H2>
<P>gdk es básicamente una envoltura alrededor de las llamadas a funciones
Xlib. Si estás familiarizado con Xlib, muchas de las funciones en gdk
requerirán poco o ningún tiempo para acostumbrarse.
Todas las funciones están escritas para proporcionar una manera fácil de
acceder a las funciones Xlib en una manera un poco más intuitiva.
Adicionalmente, ya que gdk utiliza glib (vea abajo), será más portable
y seguro de utilizar en
múltiples plataformas.
<P>
<P>
<H2><A NAME="ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
</H2>
<P>Una de las cosas agradables de GDK es que está basado sobre Xlib; esto
también es un problema, especialmente en el área de administración
de colores. Si usted quiere utilizar color en su programa (dibujando un
rectángulo o algo por el estilo, su código debe lucir algo así:
<P>
<BLOCKQUOTE><CODE>
<PRE>
{
GdkColor *color;
int width, height;
GtkWidget *widget;
GdkGC *gc;
...
/* primero, cree un GC (contexto grafico) en el cual dibujar */
gc = gdk_gc_new(widget->window);
/* encuentre las dimensiones correctas para el rectangulo */
gdk_window_get_size(widget->window, &amp;width, &amp;height);
/* el color que queremos utilizar */
color = (GdkColor *)malloc(sizeof(GdkColor));
/* rojo, verde y azul son valores pasados, indicando el trio RGB
* del color que queremos dibujar. Note que los valores de los componentes
* RGB dentro de GdkColor son tomados de 0 a 65535, no de 0 a 255.
*/
color->red = red * (65535/255);
color->green = green * (65535/255);
color->blue = blue * (65535/255);
/* el valor de pixel indica el indice en el mapa de colores del color.
* simplemente es una combinacion de los valores RGB colocados anteriormente
*/
color->pixel = (gulong)(red*65536 + green*256 + blue);
/* Sin embargo, el valor de pixel es solo valido en dispositivos de 24-bit
* (color verdadero). Por lo tanto, esta llamada es requerida para que GDK
* y X puedan darnos el color mas cercano disponible en el mapa de colores
*/
gdk_color_alloc(gtk_widget_get_colormap(widget), color);
/* colocar la parte delantera a nuestro color */
gdk_gc_set_foreground(gc, color);
/* dibujar el rectangulo*/
gdk_draw_rectangle(widget->window, gc, 1, 0, 0, width, height);
...
}
</PRE>
</CODE></BLOCKQUOTE>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-6.html">Next</A>
<A HREF="gtkfaq-es-4.html">Previous</A>
<A HREF="gtkfaq-es.html#toc5">Contents</A>
</BODY>
</HTML>

View File

@@ -1,64 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Acerca de glib</TITLE>
<LINK HREF="gtkfaq-es-7.html" REL=next>
<LINK HREF="gtkfaq-es-5.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc6" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-7.html">Next</A>
<A HREF="gtkfaq-es-5.html">Previous</A>
<A HREF="gtkfaq-es.html#toc6">Contents</A>
<HR NOSHADE>
<H2><A NAME="s6">6. Acerca de glib</A></H2>
<H2><A NAME="ss6.1">6.1 ¿Qué es glib?</A>
</H2>
<P>glib es una librería de funciones y definiciones útiles disponibles
para ser utilizadas cuando se crean aplicaciones GDK y GTK. Proporciona
reemplazos para algunas funciones estándar de libc, como malloc, las
cuales tienen errores en algunos sistemas.
<P>También proporciona rutinas para manejar:
<UL>
<LI>Listas Doblemente Enlazadas</LI>
<LI>Listas con Enlace Sencillo</LI>
<LI>Cronómetros</LI>
<LI>Manipulación de cadenas</LI>
<LI>Un Analizador Léxico</LI>
<LI>Funciones de Error</LI>
</UL>
<P>
<P>
<H2><A NAME="ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
</H2>
<P>Gracias a Tim Janik que escribió a gtk-list: (ligeramente modificado)
<BLOCKQUOTE>
Con respecto a g_malloc(), g_free() y hermanos, estas funciones son más
seguras que sus equivalentes en libc. Por ejemplo, g_free() solo regresa si
se llama con NULL. También, si se define USE_DMALLOC, la definición para
estas funciones cambia (en glib.h) para utilizar MALLOC(), FREE() etc... Si
MEM_PROFILE o MEM_CHECK se definen, hay incluso pequeñas estadísticas
realizadas las cuales cuentan los tamaños de los bloques (mostrado por
g_mem_profile() / g_mem_check()).
<P>Considerando el hecho de que glib provee una interface para salvar espacio en
pedazos de memoria si se tiene varios bloques que son siempre del mismo
tamaño y para marcarlos ALLOC_ONLY si es necesario, es sencillo crear
una pequeña envoltura para salvar (revisable para errores) alrededor del
malloc/free normal asimismo - igual que gdk cubre Xlib. ;)
<P>Utilizar g_error() y g_warning() dentro de aplicaciones como GIMP las cuales
utilizan gtk por completo incluso da la oportunidad de hacer saltar una ventana
que muestre los mensajes dentro de una ventana gtk con tu propio handler
(utilizando g_set_error_handler()) con el mismo estilo que gtk_print()
(dentro de gtkmain.c).
</BLOCKQUOTE>
<P>
<HR NOSHADE>
<A HREF="gtkfaq-es-7.html">Next</A>
<A HREF="gtkfaq-es-5.html">Previous</A>
<A HREF="gtkfaq-es.html#toc6">Contents</A>
</BODY>
</HTML>

View File

@@ -1,80 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ: Contribuciones al GTK+ FAQ, Mantenedores y Copyright</TITLE>
<LINK HREF="gtkfaq-es-6.html" REL=previous>
<LINK HREF="gtkfaq-es.html#toc7" REL=contents>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
Next
<A HREF="gtkfaq-es-6.html">Previous</A>
<A HREF="gtkfaq-es.html#toc7">Contents</A>
<HR NOSHADE>
<H2><A NAME="s7">7. Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
<P>Si desea hacer una contribución al FAQ, envíe a alguno de nosotros
un mensaje por correo electrónico con el texto exacto que cree que
debería ser incluído (pregunta y respuesta). ¡Con su ayuda, este
documento puede crecer y llegar a ser más útil!
<P>Este documento es mantenido por Nathan Froyd
<A HREF="mailto:maestrox@geocities.com">&lt;maestrox@geocities.com&gt;</A>
y Tony Gale
<A HREF="mailto:gale@gimp.org">&lt;gale@gimp.org&gt;</A>.
Este FAQ fue creado por Shawn T. Amundson
<A HREF="mailto:amundson@gimp.org">&lt;amundson@gimp.org&gt;</A> quien continúa dando soporte.
<P>El GTK+ FAQ está registrado Copyright (C) 1997, 1998 por Shawn T. Amundson,
Nathan Froyd y tony Gale.
<P>Se otorga permiso para hacer y distribuír copias textuales de este manual
siempre y cuando la información de copyright y este permiso se preserven en
todas las copias.
<P>Se otorga permiso para copiar y distribuir versiones modificados de este
documento bajo las condiciones para copiado textual, siempre y cuando esta
noticia de copyright se incluya exáctamente como en el original, y
que el trabajo resultante en su totalidad sea distribuído bajo los
términos de una noticia de permiso idéntica a esta.
<P>Se otorga permiso para copiar y distribuír traducciones de este documento
a otro lenguaje, bajo las condiciones anteriores de versiones modificadas.
<P>Si tiene intenciones de incorporar este documento en un trabajo publicado,
por favor contacte a uno de los mantenedores, y nos aseguraremos de que
obtenga la información más actual posible.
<P>No hay garantía de que este documento logre su propósito. Este documento
se proporciona simplemente como un recurso libre. Como tal, los autores y
mantenedores de la información proporcionada en él no pueden dar
garantía alguna de que la información es precisa.
<P>
<H2><A NAME="ss7.1">7.1 Nota del Traductor</A>
</H2>
<P>Esta traducción fue realizada por
<A HREF="http://www.talisman.com.pa">Ramsés Morales</A>.
He intentado hacer
la mejor adaptación posible de los términos técnicos, si tiene
alguna sugerencia o mejora a estos términos y mi español, o alguna
duda por causa de mi traducción, no dude en comunicármelo a
<A HREF="mailto:ramses@computer.org">&lt;ramses@computer.org&gt;</A><P>Gracias a
<A HREF="mailto: e98cuenc@criens.u-psud.fr">Joaquín Cuenca</A> por todas sus sugerencias para mejorar la
traducción, fueron de gran ayuda.
<P>--------------------------------------
<P>The GTK+ FAQ is Copyright (C) 1997,1998 by Shawn T. Amundson, Nathan Froyd and Tony Gale.
<P>Permission is granted to make and distribute verbatim copies of this manual provided the
copyright notice and this permission notice are preserved on all copies.
<P>Permission is granted to copy and distribute modified versions of this document under the conditions
for verbatim copying, provided that this copyright notice is included exactly as in the original,
and that the entire resulting derived work is distributed under the terms of a permission
notice identical to this one.
<P>Permission is granted to copy and distribute translations of this document into another language,
under the above conditions for modified versions.
<P>If you are intending to incorporate this document into a published work, please contact one of
the maintainers, and we will make an effort to ensure that you have the most up to date
information available.
<P>There is no guarentee that this document lives up to its intended
purpose. This is simply provided as a free resource. As such,
the authors and maintainers of the information provided within can
not make any guarentee that the information is even accurate.
<HR NOSHADE>
Next
<A HREF="gtkfaq-es-6.html">Previous</A>
<A HREF="gtkfaq-es.html#toc7">Contents</A>
</BODY>
</HTML>

View File

@@ -1,103 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.6">
<TITLE>GTK+ FAQ</TITLE>
<LINK HREF="gtkfaq-es-1.html" REL=next>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
<HR NOSHADE>
<H1>GTK+ FAQ</H1>
<H2>Nathan Froyd, Tony Gale, Shawn T. Amundson.</H2>Seis de Julio de 1998
<P><HR NOSHADE>
<EM>La intención de este documento es dar respuesta a las preguntas
realizadas con más frecuencia por parte de los programadores que utilizan GTK+ o simplemente por personas que desean utilizar GTK+. </EM>
<HR NOSHADE>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="gtkfaq-es-1.html">Información General</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-1.html#ss1.1">1.1 Autores</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.2">1.2 ¿Qué es GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.3">1.3 ¿Qué es el + en GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.4">1.4 ¿La G en GTK+ significa General, Gimp, o GNU?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.5">1.5 ¿Dónde está la documentación para GTK?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.6">1.6 ¿Hay alguna lista de correo (o archivo de lista de correo) para GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.7">1.7 ¿La lista gtk-list no ha tenido tráfico alguno por días,</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.8">1.8 Cómo conseguir ayuda con GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.9">1.9 Cómo reportar errores en GTK+</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.10">1.10 ¿Qué aplicaciones se han escrito con GTK+?</A>
<LI><A HREF="gtkfaq-es-1.html#ss1.11">1.11 Estoy buscando una aplicación que escribir en GTK+. ¿Qué tal un cliente IRC?</A>
</UL>
<P>
<H2><A NAME="toc2">2.</A> <A HREF="gtkfaq-es-2.html">Cómo encontrar, configurar, instalar y comprobar GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-2.html#ss2.1">2.1 ¿Qué necesito para correr GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.2">2.2 ¿Dónde puedo conseguir GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.3">2.3 ¿Cómo configuro/compilo GTK+?</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.4">2.4 Cuando compilo GTK+ obtengo un error como: <CODE>make: file `Makefile' line 456: Syntax error</CODE></A>
<LI><A HREF="gtkfaq-es-2.html#ss2.5">2.5 ¡He compilado e instalado GTK+, pero no puedo lograr que los programas se enlacen con él!</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.6">2.6 Cuando compilo programas con GTK+, obtengo mensajes de error del compilador diciendo que no es capaz de encontrar <CODE>"glibconfig.h"</CODE>.</A>
<LI><A HREF="gtkfaq-es-2.html#ss2.7">2.7 Cuando instalo El GIMP, configure reporta que no puede encontrar GTK.</A>
</UL>
<P>
<H2><A NAME="toc3">3.</A> <A HREF="gtkfaq-es-3.html">Desarrollo de GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-3.html#ss3.1">3.1 ¿Qué es esta cosa CVS de la cual todo el mundo habla, y cómo puedo acceder a ella?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.2">3.2 ¿Cómo puedo contribuír a GTK+?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.3">3.3 ¿Cómo averiguo si mi parche fue aplicado, y si no, por qué no?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.4">3.4 ¿Cuál es la política sobre la incorporación de nuevos <EM>widgets</EM> en la librería?</A>
<LI><A HREF="gtkfaq-es-3.html#ss3.5">3.5 ¿Hay alguien trabajando en atamientos para otros lenguajes distintos a C?</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="gtkfaq-es-4.html">Desarrollo con GTK+</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-4.html#ss4.1">4.1 ¿Cómo empiezo?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.2">4.2 ¿Qué <EM>widgets</EM> existen en GTK?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.3">4.3 ¿GTK+ es seguro ante múltiples hilos?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.4">4.4 ¿Cómo puedo prevenir el redibujar y reacomodar tamaños mientras cambio múltiples <EM>widgets</EM>?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.5">4.5 ¿Cómo atrapo un evento de doble tecleo (en un <EM>widget</EM> de lista, por ejemplo)?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.6">4.6 ¿Cómo puedo averiguar cuál es la selección de un GtkList?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.7">4.7 ¿Acaso es posible desplegar un texto que se recorte para que quepa dentro del lugar que tenga asignado?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.8">4.8 ¿Por qué el contenido de un botón no se mueve al presionar el botón? Aquí les envío un parche para que funcione de esa forma...</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.9">4.9 ¿Cómo puedo definir una línea de separación como en un menú?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.10">4.10 ¿Cómo puedo darle justificación a la derecha a un menú, como Help, cuando utilizo MenuFactory?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.11">4.11 ¿Cómo hago mi ventana modal? / ¿Cómo hago una sóla ventana activa?</A>
<LI><A HREF="gtkfaq-es-4.html#ss4.12">4.12 ¿Por qué mi <EM>widget</EM> (ej. progressbar) no se actualiza?</A>
</UL>
<P>
<H2><A NAME="toc5">5.</A> <A HREF="gtkfaq-es-5.html">Acerca de gdk</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-5.html#ss5.1">5.1 ¿Qué es gdk?</A>
<LI><A HREF="gtkfaq-es-5.html#ss5.2">5.2 ¿Cómo utilizo la asignación de colores?</A>
</UL>
<P>
<H2><A NAME="toc6">6.</A> <A HREF="gtkfaq-es-6.html">Acerca de glib</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-6.html#ss6.1">6.1 ¿Qué es glib?</A>
<LI><A HREF="gtkfaq-es-6.html#ss6.2">6.2 ¿Por qué utilizar g_print, g_malloc, g_strdup y funciones compañeras de glib?</A>
</UL>
<P>
<H2><A NAME="toc7">7.</A> <A HREF="gtkfaq-es-7.html">Contribuciones al GTK+ FAQ, Mantenedores y Copyright</A></H2>
<UL>
<LI><A HREF="gtkfaq-es-7.html#ss7.1">7.1 Nota del Traductor</A>
</UL>
<HR NOSHADE>
<A HREF="gtkfaq-es-1.html">Next</A>
Previous
Contents
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@@ -1,350 +0,0 @@
#!/usr/bin/python
import xmllib;
import sys;
import string
import re
def html_subst(s):
if s.group(1) != None:
return s.group(0)
elif s.group(2) != None:
return '<a href="' + s.group(0) + '">' + s.group(0) + '</a>'
elif s.group(3) != None:
return '<a href="mailto:' + s.group(0) + '">' + s.group(0) + '</a>'
def htmlify(str):
return re.sub ("(<[^>]*>)|(http://[~.:/\w-]+)|([\w._!-]+@[\w_-]+).[\w_-]+", html_subst, str)
def bug_subst(s):
if s.group(1) != None:
return s.group(0)
else:
n = s.group(2)
return '<a href="http://bugs.gnome.org/db/%s/%s.html">#%s</a>' % (n[0:2], n, n)
def bugify(str):
str = re.sub ("(<[^>]*>)|#(\d+)", bug_subst, str)
return htmlify(str)
def make_id(str):
return re.sub ("[^a-z]","-", string.lower(str))
class ParseError (Exception):
pass
class Entry:
def __init__(self):
self.description = None
self.title = None
self.url = None
self.contact = None
self.bugs = None
def set_size(self, size):
size = string.lower(size)
if size == "small":
self.size = "Small"
elif size == "medium":
self.size = "Medium"
elif size == "big":
self.size = "Big"
else:
raise ParseError, 'size must be "small", "medium", or "big"'
def output(self):
if self.size == "Big":
bgcolor = "#88bb88"
elif self.size == "Medium":
bgcolor = "#b4d4b4"
else:
bgcolor = "#d0e0d0"
print '''<table cellspacing="0" cellpadding="2" width="97%%" border="0" bgcolor="#000000">
<tbody><tr><td colspan=2>
<table cellspacing="0" cellpadding="5" width="100%%" border="0" bgcolor="#ffffff">
<tbody>
<tr bgcolor="%s">
<td align="left"><font size="+1">%s</font></font></td>
<td align="left" width="20%%"><b>Size</b>: %s</td>
<td align="center" width="20%%"><b>Status</b>: %s</td>
<td align="right" width="20%%"><b>Target Version</b>: %s</td>
</tr>
<tr>
<td colspan=4>
%s
<table cellspacing="0" cellpadding="0">
<tbody>''' % (bgcolor, self.title, self.size, self.status, self.target, htmlify(self.description))
if self.url != None:
print '''<tr><td width="0"><b>More Info</b>:</td>
<td>%s</td>
</tr>''' % htmlify (self.url)
if self.bugs != None:
print '''<tr><td width="0"><b>Bug Reports</b>:</td>
<td>%s</td>
</tr>''' % bugify (self.bugs)
if self.contact != None:
print '''<tr><td width="0"><b>Contact</b>:</td>
<td>%s</td>
</tr>''' % htmlify (self.contact)
print '''</tbody>
</table>
</td>
</tr>
</tbody></table>
</td></tr></tbody></table>
'''
class Section:
def __init__(self):
self.title = None
self.entries = []
def output(self):
print '<h2><a name="%s">%s</a></h2>' % (make_id(self.title), self.title)
first = 1
for entry in self.entries:
if not first:
print "<br>"
first = 0
entry.output()
class TodoParser (xmllib.XMLParser):
def __init__(self):
xmllib.XMLParser.__init__(self)
self.in_todo = 0
self.in_data = 0
self.data = ""
self.section = None
self.entry = None
self.logourl = None
self.title = None
self.sections = []
self.entitydefs = {}
def start_todo(self,attributes):
if self.in_todo:
raise ParseError, "<todo> tags may not be nested"
if attributes.has_key ("logourl"):
self.logourl = attributes["logourl"]
self.in_todo = 1
def end_todo(self):
self.in_todo = 0
def start_section(self,attributes):
if self.section:
raise ParseError, "<section> tags may not be nested"
self.section = Section()
def end_section(self):
if self.section.title == None:
raise ParseError, "<section> requires <title>"
self.sections.append(self.section)
self.section = None
def start_title(self,attributes):
if not self.in_todo:
raise ParseError, "<title> tag must be in <todo>, <section> or <entry>"
if self.in_data:
raise ParseError, "Unexpected <title> tag in content"
self.in_data = 1
def end_title(self):
self.in_data = 0
if self.entry:
self.entry.title = self.data
elif self.section:
self.section.title = self.data
else:
self.title = self.data
self.data = ""
def start_description(self,attributes):
if not self.entry:
raise ParseError, "<description> tag must be in <entry>"
if self.in_data:
raise ParseError, "Unexpected <description> tag in content"
self.in_data = 1
def end_description(self):
self.in_data = 0
self.entry.description = self.data
self.data = ""
def start_url(self,attributes):
if not self.entry:
raise ParseError, "<url> tag must be in <entry>"
if self.in_data:
raise ParseError, "Unexpected <url> tag in content"
self.in_data = 1
def end_url(self):
self.in_data = 0
self.entry.url = self.data
self.data = ""
def start_contact(self,attributes):
if not self.entry:
raise ParseError, "<contact> tag must be in <contact>"
if self.in_data:
raise ParseError, "Unexpected <contact> tag in content"
self.in_data = 1
def end_contact(self):
self.in_data = 0
self.entry.contact = self.data
self.data = ""
def start_bugs(self,attributes):
if not self.entry:
raise ParseError, "<bugs> tag must be in <bugs>"
if self.in_data:
raise ParseError, "Unexpected <bugs> tag in content"
self.in_data = 1
def end_bugs(self):
self.in_data = 0
self.entry.bugs = self.data
self.data = ""
def start_entry(self,attributes):
if not self.section:
raise ParseError, "<entry> tag must be in <section>"
if self.entry:
raise ParseError, "<entry> tags may not be nested"
self.entry = Entry()
if not attributes.has_key("size"):
raise ParseError, '"size" attribute required for entry'
self.entry.set_size(attributes["size"])
if not attributes.has_key("status"):
raise ParseError, '"status" attribute (completion percentage) required for entry'
self.entry.status=attributes["status"]
if not attributes.has_key("target"):
raise ParseError, '"target" attribute (target version) required for entry'
self.entry.target=attributes["target"]
def end_entry(self):
if self.entry.title == None:
raise ParseError, "<entry> requires <title>"
if self.entry.description == None:
raise ParseError, "<entry> requires <description>"
self.section.entries.append(self.entry)
self.entry = None
def handle_data(self,data):
if self.in_data:
self.data = self.data + data
def unknown_starttag(self,tag,attributes):
if not self.in_data:
raise ParseError, "Unexpected start tag: " + tag
else:
self.data = self.data + "<" + tag
for (key,val) in attributes.items():
self.data = self.data + ' %s="%s"' % (key,val)
self.data = self.data + ">"
def unknown_endtag(self,tag):
if not self.in_data:
raise ParseError, "Unexpected end tag: " + tag
else:
self.data = self.data + "</%s>" % tag
def syntax_error(self, err):
if re.match("reference to unknown entity", err):
pass
else:
xmllib.XMLParser.syntax_error (self, err)
def unknown_entityref(self,ref):
if not self.in_data:
raise ParseError, "Unknown entity &" + ref + ";"
else:
self.data = self.data + "&" + ref + ";"
file = open(sys.argv[1])
parser = TodoParser()
lineno = 1
while 1:
line = file.readline()
if line == "":
break
try:
parser.feed(line)
except ParseError, err:
sys.stderr.write("Parse error at line " + `lineno` + ": " + err.__str__() + "\n")
sys.exit(1)
except RuntimeError, err:
sys.stderr.write(err.__str__() + "\n")
sys.exit(1)
lineno = lineno + 1
parser.close()
if parser.title == None:
sys.stderr.write ("<todo> Document must have a <title>\n")
sys.exit (1)
print '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>%s</title>
</head>
<body bgcolor="#ffffff">
<table width="100%%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr valign="top">
<td>
<h1>%s</h1>''' % (parser.title, parser.title)
for section in parser.sections:
ntasks = len(section.entries)
id = make_id (section.title)
if ntasks == 1:
print '<a href="#%s">%s</a> (1 item)<br>' % (id,section.title)
else:
print '<a href="#%s">%s</a> (%d items)<br>' % (id,section.title,ntasks)
print '''
</td>'''
if parser.logourl != None:
print ''' <td align="right">
<img src="%s" alt="Logo"></img>
</td>''' % parser.logourl
print '''
</tr>
</tbody>
</table>
'''
first = 1
for section in parser.sections:
if not first:
print "<br><br>"
first = 0
section.output()
print '''</body>
</html>'''

File diff suppressed because it is too large Load Diff

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

@@ -8,5 +8,3 @@ libgdk-1.1.la
gdkcursors.h
gdkkeysyms.h
libgdk.la
gdkconfig.h
stamp-gc-h

View File

@@ -1,17 +1,8 @@
## Makefile.am for gtk+/gdk
SUBDIRS=x11 win32
EXTRA_DIST = \
gdkconfig.h.win32 \
gdk.def \
makefile.cygwin \
makefile.msc
INCLUDES = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gdk\" \
-I$(top_srcdir) \
-I$(top_builddir)/gdk \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@@ -36,59 +27,52 @@ libgdk_la_LDFLAGS = @STRIP_BEGIN@ \
-lm \
@STRIP_END@
libgdk_la_LIBADD = \
x11/libgdk-x11.la
#
# setup source file variables
#
#
# GDK header files for public installation (non-generated)
#
# Note: files added here may need to be be propagated to gdk_headers in gtk/Makefile.am
#
gdk_public_h_sources = @STRIP_BEGIN@ \
gdk.h \
gdkcc.h \
gdkcolor.h \
gdkcompat.h \
gdkcursor.h \
gdkcursors.h \
gdkdnd.h \
gdkdrawable.h \
gdkevents.h \
gdkfont.h \
gdkgc.h \
gdkkeysyms.h \
gdki18n.h \
gdkim.h \
gdkimage.h \
gdkinput.h \
gdkpixmap.h \
gdkprivate.h \
gdkproperty.h \
gdkregion.h \
gdkrgb.h \
gdkselection.h \
gdki18n.h \
gdkkeysyms.h \
gdkprivate.h \
gdktypes.h \
gdkvisual.h \
gdkwindow.h \
gdkx.h \
@STRIP_END@
gdk_c_sources = @STRIP_BEGIN@ \
gdk.c \
gdkcc.c \
gdkcolor.c \
gdkcursor.c \
gdkdnd.c \
gdkdraw.c \
gdkevents.c \
gdkfont.c \
gdkgc.c \
gdkglobals.c \
gdkim.c \
gdkimage.c \
gdkinternals.h \
gdkinput.c \
gdkinput.h \
gdkinputnone.h \
gdkinputcommon.h\
gdkinputgxi.h \
gdkinputxfree.h \
gdkpixmap.c \
gdkproperty.c \
gdkrgb.c \
gdkrectangle.c \
gdkregion.c \
gdkselection.c \
gdkvisual.c \
gdkwindow.c \
gdkxid.c \
MwmUtil.h \
gxid_lib.h \
gxid_proto.h \
gxid_lib.c \
@STRIP_END@
#
@@ -115,23 +99,19 @@ X-derived-headers:
< @x_includes@/X11/keysymdef.h > gdkkeysyms.h
#
# Rule to install gdkconfig.h header file
# extra programs
#
configexecincludedir = $(pkglibdir)/include
#configexecinclude_DATA = gdkconfig.h
install-exec-local: gdkconfig.h
$(mkinstalldirs) $(DESTDIR)$(configexecincludedir)
file=$(DESTDIR)$(configexecincludedir)/gdkconfig.h; \
if test -r $$file && cmp -s gdkconfig.h $$file; then :; \
else $(INSTALL_DATA) gdkconfig.h $$file; fi
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)
BUILT_SOURCES = stamp-gc-h #note: not gdkconfig.h
gdkconfig.h: stamp-gc-h
@if test -f gdkconfig.h; then :; \
else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
stamp-gc-h: ../config.status
cd .. && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=gdk/gdkconfig.h ./config.status
echo timestamp > stamp-gc-h
.PHONY: files

342
gdk/TODO
View File

@@ -1,342 +0,0 @@
General
=======
- gdk_pointer_grab() and gdk_keyboard_grab() are logically member
functions of GdkWindow.
X specific Functions that need to be moved out of the common header files
=========================================================================
Dir structure for ports
=======================
The directory structure here is:
gdk/
gdk/x11
gdk/win32
...
The gdk/ directory directly contains all public
header files (that are not specific to one
windowing system).
There, in general should be no system dependency
For each set of functionality, there are the following
files:
gdkwindow.h: public header file
gdkwindow.c: common implementation
x11/gdkwindow.i: functionality specific to X11
win32/gdkwindow.i: functionality specific to win32
The gdkwindow.c file looks like:
====
#include "gdkwindow.h"
#ifdef GDK_WINDOWING_X11
#include "x11/gdkwindow.i"
#elif defined(GDK_WINDOW_WIN32)
#include "win32/gdkwindow.i"
fo#endif
[ generic implementation bits ]
====
x11/gdkwindow.i should only assume that gdkwindow.h has been
included and included all other dependencies explicitely.
The x11/ directory will contain:
.i files
.c files specific to X
.h files specific to X
And a Makefile.am that takes care of distributing the
files in the directory, and also for building any
X-specific utilities. (Such as the gxid daemon).
Port Status for Files
=====================
gdk
Much of the contents have been moved to x11/gtkmain.c.
I've added a little argument-parsing abstraction.
(Currently called gdk_arg_context_*) that allows
arguments from multiple places to be combined - that
probably needs to be either fixed up and moved into
GLib or replaced with some existing solution like
popt.
gdkcc
This will be removed for GTK+-1.4. Right now, it has been moved
completely into the x11/ directory to avoid having to port it.
gdkcolor
There are a few common utility functions, and the rest
is in the port-specific files.
gdkcursor
No shared code - completely port-specific.
gdkdnd
No shared code - completely arch-specific. It's possible that some
common code for handling GdkDragContext could exist, but the
GdkDragContextPrivate will be different on each port.
gdkdrawable
Pretty much done. GdkDrawable is completely virtualized.
gdkevents
There are a few common utility functions, and the rest
is in the port-specific files.
gdkfont
Pretty much done for now - gdkfont.c contains a number of functions
reimplemented as utility functions, and the rest is
ports-specific. It will be obsoleted by pango before 1.4.
gdkgc
GdkGC is virtualized to go along with GdkDrawable. There are
a couple of functions I punted on for now and moved into the
port-specific files - the clipmask functions (because gdkregion
is not finalized) and also gdk_gc_copy, which I'm not sure
I like enough to put into the vtable.
gdkim
All in the port-specific directories. The abstraction here probably
will be changed at some point to something more convenient and
more Unicode-based.
gdkimage
GdkImage is virtualized - all of the code except for ref/unref
is in the port-specific files.
gdkinput
Right now all the code is port-specific. It should be possible
to share the code in gdkinputnone.c, but probably not worth it;
I'd like to get rid of the gdk_input_vtable in X11 code -
it doesn't make sense since you can't switch the type of input
on the fly.
gdkpixmap
All moved into the port-specific file for now. The xpm loader
should be changed to render with GdkRGB, and thus be
windowing-system independent, but that requires
first making GdkRGB able to render onto any arbitrary visual.
gdkproperty
All port-specific. Possibly should be X-specific with a higher-level
clipboard API on top of it.
gdkregion
Right now punted to being port-specific, but that probably needs
to change with the virtualized drawables and GC's.
gdkrgb
With a few changes to debugging code, it was already port-independent.
gdkselection
Completely port specific. (In fact, really doesn't make sense
on anything other than X; a higher-level clipboard facility
should be provided somewhere, though.)
gdkvisual
Completely port-specific. (The concepts are rather X-specific)
gdkwindow
The window-private data is split between windowing-system independent
parts and windowing system dependent parts. There are a few
functions in gdk/gdkwindow.c and the rest is moved off
into x11/gdkwindow-x11.c
Virtualization
==============
The concept of virtualization is that calls to draw
on a drawable are dispatched through a function table.
This potentially allows for:
Postscript drawables
metafiles
It also provides a nice clean framework for multi-windowing
support - instead of reimplementing a whole bunch of function
calls, one provides an implementaiton for the vtables.
X works in this way internally - per-screen functions are
virtualized inside a screen structure, and drawing functions
are virtualized inside the GC structure.
For the virtualization of drawing, clearly GdkDrawable needs
to be virtualized. Beyond that, one has to decide on
a case-by-case basis whether a particular structure is
drawing-mode independent (like GdkRectangle) or not.
The most important GDK structures that are involved drawing are:
GdkColor
GdkGC
GdkFont
GdkRegion
The whole font aspect of Gdk is going to get heavily
reworked with the introduction of "Pango".
GdkRegion almost certainly needs to be virtualized,
if you, way, want to do postscript drawables.
While doing so, the API of GdkRegion should be
changed so that the region operations take 3 parameters
instead of returning a newly created region.
Drawable operations:
destroy
create_gc
get_values
set_values
set_dashes
copy
GC Operations:
draw_point
draw_line
draw_rectangle
draw_arc
draw_polygon
draw_string
draw_text
draw_text_wc
draw_pixmap
draw_bitmap
draw_image
draw_points
draw_segments
draw_lines
Adding multi-screen, display support.
=====================================
The following functions need to have per-display variants:
void gdk_pointer_ungrab (guint32 time);
void gdk_keyboard_ungrab (guint32 time);
gint gdk_pointer_is_grabbed (void);
gint gdk_screen_width (void);
gint gdk_screen_height (void);
gint gdk_screen_width_mm (void);
gint gdk_screen_height_mm (void);
void gdk_beep (void);
void gdk_key_repeat_disable (void);
void gdk_key_repeat_restore (void);
gint gdk_visual_get_best_depth (void);
GdkVisualType gdk_visual_get_best_type (void);
GdkVisual* gdk_visual_get_system (void);
GdkVisual* gdk_visual_get_best (void);
GdkVisual* gdk_visual_get_best_with_depth (gint depth);
GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
GdkVisual* gdk_visual_get_best_with_both (gint depth,
GdkVisualType visual_type);
void gdk_query_depths (gint **depths,
gint *count);
void gdk_query_visual_types (GdkVisualType **visual_types,
gint *count);
GList* gdk_list_visuals (void);
void gdk_add_client_message_filter (GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
guint32 gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol);
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkPixmap *mask,
GdkColor *fg,
GdkColor *bg,
gint x,
gint y);
GdkColormap* gdk_colormap_get_system (void);
gint gdk_colormap_get_system_size (void);
GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (gchar *fontset_name);
gint gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gint send_event);
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
void gdk_selection_send_notify (guint32 requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time);
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,
GdkAtom *encoding, gint *format,
guchar **ctext, gint *length);
void gdk_free_compound_text (guchar *ctext);
GdkAtom gdk_atom_intern (const gchar *atom_name,
gint only_if_exists);
gchar* gdk_atom_name (GdkAtom atom);
GList *gdk_input_list_devices (void);
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);
gint gdk_im_ready (void);
void gdk_im_end (void);
GdkIC* gdk_ic_new (GdkICAttr *attr,
GdkICAttributesType mask);
GdkRegion* gdk_region_new (void);
void gdk_event_send_clientmessage_toall (GdkEvent *event);
gboolean gdk_event_send_client_message (GdkEvent *event,
guint32 xid);
And maybe:
void gdk_error_trap_push (void);
gint gdk_error_trap_pop (void);

1343
gdk/gdk.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,347 +0,0 @@
EXPORTS
gdk_atom_intern
gdk_atom_name
gdk_beep
gdk_bitmap_create_from_data
gdk_char_height
gdk_char_measure
gdk_char_width
gdk_char_width_wc
gdk_color_alloc
gdk_color_black
gdk_color_change
gdk_color_context_add_palette
gdk_color_context_free
gdk_color_context_free_dither
gdk_color_context_get_index_from_palette
gdk_color_context_get_pixel
gdk_color_context_get_pixel_from_palette
gdk_color_context_get_pixels
gdk_color_context_get_pixels_incremental
gdk_color_context_init_dither
gdk_color_context_new
gdk_color_context_new_mono
gdk_color_context_query_color
gdk_color_context_query_colors
gdk_color_copy
gdk_color_equal
gdk_color_free
gdk_color_hash
gdk_color_parse
gdk_color_white
gdk_colormap_alloc_color
gdk_colormap_alloc_colors
gdk_colormap_change
gdk_colormap_free_colors
gdk_colormap_get_system
gdk_colormap_get_system_size
gdk_colormap_get_visual
gdk_colormap_new
gdk_colormap_ref
gdk_colormap_unref
gdk_colors_alloc
gdk_colors_free
gdk_colors_store
gdk_cursor_new
gdk_cursor_new_from_pixmap
gdk_cursor_ref
gdk_cursor_unref
gdk_dnd_init
gdk_drag_abort
gdk_drag_begin
gdk_drag_context_new
gdk_drag_context_ref
gdk_drag_context_unref
gdk_drag_drop
gdk_drag_find_window
gdk_drag_get_protocol
gdk_drag_get_selection
gdk_drag_motion
gdk_drag_status
gdk_draw_arc
gdk_draw_drawable
gdk_draw_gray_image
gdk_draw_image
gdk_draw_indexed_image
gdk_draw_line
gdk_draw_lines
gdk_draw_point
gdk_draw_points
gdk_draw_polygon
gdk_draw_rectangle
gdk_draw_rgb_32_image
gdk_draw_rgb_image
gdk_draw_rgb_image_dithalign
gdk_draw_segments
gdk_draw_string
gdk_draw_text
gdk_draw_text_wc
gdk_drawable_alloc
gdk_drawable_get_colormap
gdk_drawable_get_size
gdk_drawable_get_type
gdk_drawable_get_visual
gdk_drawable_ref
gdk_drawable_set_colormap
gdk_drawable_set_data
gdk_drawable_unref
gdk_drop_finish
gdk_drop_reply
gdk_error_code
gdk_error_trap_pop
gdk_error_trap_push
gdk_error_warnings
gdk_event_button_generate
gdk_event_copy
gdk_event_data
gdk_event_free
gdk_event_func
gdk_event_get
gdk_event_get_graphics_expose
gdk_event_get_time
gdk_event_handler_set
gdk_event_new
gdk_event_peek
gdk_event_put
gdk_event_queue_append
gdk_event_queue_find_first
gdk_event_queue_remove_link
gdk_event_send_client_message
gdk_event_send_clientmessage_toall
gdk_event_unqueue
gdk_events_pending
gdk_exit
gdk_flush
gdk_font_equal
gdk_font_full_name_free
gdk_font_full_name_get
gdk_font_id
gdk_font_list_free
gdk_font_list_new
gdk_font_load
gdk_font_ref
gdk_font_unref
gdk_fontset_load
gdk_free_compound_text
gdk_free_text_list
gdk_gc_alloc
gdk_gc_copy
gdk_gc_get_values
gdk_gc_new
gdk_gc_new_with_values
gdk_gc_ref
gdk_gc_set_background
gdk_gc_set_clip_mask
gdk_gc_set_clip_origin
gdk_gc_set_clip_rectangle
gdk_gc_set_clip_region
gdk_gc_set_dashes
gdk_gc_set_exposures
gdk_gc_set_fill
gdk_gc_set_font
gdk_gc_set_foreground
gdk_gc_set_function
gdk_gc_set_line_attributes
gdk_gc_set_stipple
gdk_gc_set_subwindow
gdk_gc_set_tile
gdk_gc_set_ts_origin
gdk_gc_unref
gdk_get_display
gdk_get_show_events
gdk_get_use_xshm
gdk_ic_destroy
gdk_ic_get_attr
gdk_ic_get_events
gdk_ic_get_style
gdk_ic_get_values
gdk_ic_new
gdk_ic_set_attr
gdk_ic_set_values
gdk_im_begin
gdk_im_decide_style
gdk_im_end
gdk_im_ready
gdk_im_set_best_style
gdk_image_bitmap_new
gdk_image_get
gdk_image_get_pixel
gdk_image_new
gdk_image_new_bitmap
gdk_image_put_pixel
gdk_image_ref
gdk_image_unref
gdk_init
gdk_init_check
gdk_input_add
gdk_input_add_full
gdk_input_exit
gdk_input_init
gdk_input_list_devices
gdk_input_motion_events
gdk_input_remove
gdk_input_set_axes
gdk_input_set_extension_events
gdk_input_set_key
gdk_input_set_mode
gdk_input_set_source
gdk_input_window_get_pointer
gdk_key_repeat_disable
gdk_key_repeat_restore
gdk_keyboard_grab
gdk_keyboard_ungrab
gdk_keyval_from_name
gdk_keyval_is_lower
gdk_keyval_is_upper
gdk_keyval_name
gdk_keyval_to_lower
gdk_keyval_to_upper
gdk_list_visuals
gdk_mbstowcs
gdk_null_window_warnings
gdk_parent_root
gdk_pixmap_colormap_create_from_xpm
gdk_pixmap_colormap_create_from_xpm_d
gdk_pixmap_create_from_data
gdk_pixmap_create_from_xpm
gdk_pixmap_create_from_xpm_d
gdk_pixmap_create_on_shared_image
gdk_pixmap_foreign_new
gdk_pixmap_new
gdk_pointer_grab
gdk_pointer_is_grabbed
gdk_pointer_ungrab
gdk_progclass
gdk_property_change
gdk_property_delete
gdk_property_get
gdk_query_depths
gdk_query_visual_types
gdk_rectangle_intersect
gdk_rectangle_union
gdk_region_destroy
gdk_region_empty
gdk_region_equal
gdk_region_get_clipbox
gdk_region_intersect
gdk_region_new
gdk_region_offset
gdk_region_point_in
gdk_region_polygon
gdk_region_rect_in
gdk_region_shrink
gdk_region_subtract
gdk_region_union
gdk_region_union_with_rect
gdk_region_xor
gdk_rgb_cmap_free
gdk_rgb_cmap_new
gdk_rgb_ditherable
gdk_rgb_gc_set_background
gdk_rgb_gc_set_foreground
gdk_rgb_get_cmap
gdk_rgb_get_visual
gdk_rgb_init
gdk_rgb_set_install
gdk_rgb_set_min_colors
gdk_rgb_set_verbose
gdk_rgb_xpixel_from_rgb
gdk_screen_height
gdk_screen_height_mm
gdk_screen_width
gdk_screen_width_mm
gdk_selection_convert
gdk_selection_owner_get
gdk_selection_owner_set
gdk_selection_property
gdk_selection_property_get
gdk_selection_send_notify
gdk_set_locale
gdk_set_show_events
gdk_set_sm_client_id
gdk_set_use_xshm
gdk_string_extents
gdk_string_height
gdk_string_measure
gdk_string_to_compound_text
gdk_string_width
gdk_text_extents
gdk_text_extents_wc
gdk_text_height
gdk_text_measure
gdk_text_property_to_text_list
gdk_text_width
gdk_text_width_wc
gdk_threads_enter
gdk_threads_leave
gdk_threads_mutex
gdk_visual_get_best
gdk_visual_get_best_depth
gdk_visual_get_best_type
gdk_visual_get_best_with_both
gdk_visual_get_best_with_depth
gdk_visual_get_best_with_type
gdk_visual_get_system
gdk_visual_ref
gdk_visual_unref
gdk_wcstombs
gdk_window_add_filter
gdk_window_at_pointer
gdk_window_begin_paint_rect
gdk_window_clear
gdk_window_clear_area
gdk_window_clear_area_e
gdk_window_destroy
gdk_window_end_paint
gdk_window_foreign_new
gdk_window_get_children
gdk_window_get_deskrelative_origin
gdk_window_get_events
gdk_window_get_geometry
gdk_window_get_origin
gdk_window_get_parent
gdk_window_get_pointer
gdk_window_get_position
gdk_window_get_root_origin
gdk_window_get_toplevel
gdk_window_get_toplevels
gdk_window_get_user_data
gdk_window_hide
gdk_window_invalidate_rect
gdk_window_is_viewable
gdk_window_is_visible
gdk_window_lower
gdk_window_merge_child_shapes
gdk_window_move
gdk_window_move_resize
gdk_window_new
gdk_window_process_all_updates
gdk_window_process_updates
gdk_window_raise
gdk_window_register_dnd
gdk_window_remove_filter
gdk_window_reparent
gdk_window_resize
gdk_window_set_back_pixmap
gdk_window_set_background
gdk_window_set_child_shapes
gdk_window_set_cursor
gdk_window_set_decorations
gdk_window_set_events
gdk_window_set_functions
gdk_window_set_geometry_hints
gdk_window_set_group
gdk_window_set_hints
gdk_window_set_icon
gdk_window_set_icon_name
gdk_window_set_override_redirect
gdk_window_set_role
gdk_window_set_static_gravities
gdk_window_set_title
gdk_window_set_transient_for
gdk_window_set_user_data
gdk_window_shape_combine_mask
gdk_window_show
gdk_window_withdraw
gdk_xid_table_insert
gdk_xid_table_lookup

917
gdk/gdk.h
View File

@@ -27,27 +27,8 @@
#ifndef __GDK_H__
#define __GDK_H__
#include <gdk/gdkcc.h>
#include <gdk/gdkcolor.h>
#include <gdk/gdkcursor.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkdrawable.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkfont.h>
#include <gdk/gdkgc.h>
#include <gdk/gdkim.h>
#include <gdk/gdkimage.h>
#include <gdk/gdkinput.h>
#include <gdk/gdkpixmap.h>
#include <gdk/gdkproperty.h>
#include <gdk/gdkregion.h>
#include <gdk/gdkrgb.h>
#include <gdk/gdkselection.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkvisual.h>
#include <gdk/gdkwindow.h>
#include <gdk/gdkcompat.h>
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
@@ -70,11 +51,34 @@ void gdk_error_trap_push (void);
gint gdk_error_trap_pop (void);
gboolean gdk_events_pending (void);
GdkEvent* gdk_event_get (void);
GdkEvent* gdk_event_peek (void);
GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window);
void gdk_event_put (GdkEvent *event);
GdkEvent* gdk_event_copy (GdkEvent *event);
void gdk_event_free (GdkEvent *event);
guint32 gdk_event_get_time (GdkEvent *event);
void gdk_event_handler_set (GdkEventFunc func,
gpointer data,
GDestroyNotify notify);
void gdk_set_show_events (gboolean show_events);
void gdk_set_use_xshm (gboolean use_xshm);
gboolean gdk_get_show_events (void);
gboolean gdk_get_use_xshm (void);
gchar* gdk_get_display (void);
guint32 gdk_time_get (void);
guint32 gdk_timer_get (void);
void gdk_timer_set (guint32 milliseconds);
void gdk_timer_enable (void);
void gdk_timer_disable (void);
gint gdk_input_add_full (gint source,
GdkInputCondition condition,
GdkInputFunction function,
@@ -87,18 +91,19 @@ gint gdk_input_add (gint source,
void gdk_input_remove (gint tag);
gint gdk_pointer_grab (GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time);
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);
gboolean owner_events,
guint32 time);
void gdk_keyboard_ungrab (guint32 time);
gboolean gdk_pointer_is_grabbed (void);
gint gdk_screen_width (void);
gint gdk_screen_height (void);
@@ -111,14 +116,749 @@ void gdk_beep (void);
void gdk_key_repeat_disable (void);
void gdk_key_repeat_restore (void);
/* Visuals
*/
gint gdk_visual_get_best_depth (void);
GdkVisualType gdk_visual_get_best_type (void);
GdkVisual* gdk_visual_get_system (void);
GdkVisual* gdk_visual_get_best (void);
GdkVisual* gdk_visual_get_best_with_depth (gint depth);
GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
GdkVisual* gdk_visual_get_best_with_both (gint depth,
GdkVisualType visual_type);
/* Actually, these are no-ops... */
GdkVisual* gdk_visual_ref (GdkVisual *visual);
void gdk_visual_unref (GdkVisual *visual);
void gdk_query_depths (gint **depths,
gint *count);
void gdk_query_visual_types (GdkVisualType **visual_types,
gint *count);
GList* gdk_list_visuals (void);
/* Windows
*/
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
void gdk_window_destroy (GdkWindow *window);
GdkWindow* gdk_window_ref (GdkWindow *window);
void gdk_window_unref (GdkWindow *window);
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
void gdk_window_withdraw (GdkWindow *window);
void gdk_window_move (GdkWindow *window,
gint x,
gint y);
void gdk_window_resize (GdkWindow *window,
gint width,
gint height);
void gdk_window_move_resize (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y);
void gdk_window_clear (GdkWindow *window);
void gdk_window_clear_area (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_clear_area_e(GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_copy_area (GdkWindow *window,
GdkGC *gc,
gint x,
gint y,
GdkWindow *source_window,
gint source_x,
gint source_y,
gint width,
gint height);
void gdk_window_raise (GdkWindow *window);
void gdk_window_lower (GdkWindow *window);
void gdk_window_set_user_data (GdkWindow *window,
gpointer user_data);
void gdk_window_set_override_redirect(GdkWindow *window,
gboolean override_redirect);
void gdk_window_add_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
void gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
/*
* This allows for making shaped (partially transparent) windows
* - cool feature, needed for Drag and Drag for example.
* The shape_mask can be the mask
* from gdk_pixmap_create_from_xpm. Stefan Wille
*/
void gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *shape_mask,
gint offset_x,
gint offset_y);
/*
* This routine allows you to quickly take the shapes of all the child windows
* of a window and use their shapes as the shape mask for this window - useful
* for container windows that dont want to look like a big box
*
* - Raster
*/
void gdk_window_set_child_shapes (GdkWindow *window);
/*
* This routine allows you to merge (ie ADD) child shapes to your
* own window's shape keeping its current shape and ADDING the shild
* shapes to it.
*
* - Raster
*/
void gdk_window_merge_child_shapes (GdkWindow *window);
/*
* Check if a window has been shown, and whether all it's
* parents up to a toplevel have been shown, respectively.
* Note that a window that is_viewable below is not necessarily
* viewable in the X sense.
*/
gboolean gdk_window_is_visible (GdkWindow *window);
gboolean gdk_window_is_viewable (GdkWindow *window);
/* Set static bit gravity on the parent, and static
* window gravity on all children.
*/
gboolean gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static);
/*
* The following function adds a global filter for all client
* messages of type message_type
*/
void gdk_add_client_message_filter (GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
/* Drag and Drop */
GdkDragContext * gdk_drag_context_new (void);
void gdk_drag_context_ref (GdkDragContext *context);
void gdk_drag_context_unref (GdkDragContext *context);
/* Destination side */
void gdk_drag_status (GdkDragContext *context,
GdkDragAction action,
guint32 time);
void gdk_drop_reply (GdkDragContext *context,
gboolean ok,
guint32 time);
void gdk_drop_finish (GdkDragContext *context,
gboolean success,
guint32 time);
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
/* Source side */
GdkDragContext * gdk_drag_begin (GdkWindow *window,
GList *targets);
guint32 gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol);
void gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol);
gboolean gdk_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
GdkDragAction suggested_action,
GdkDragAction possible_actions,
guint32 time);
void gdk_drag_drop (GdkDragContext *context,
guint32 time);
void gdk_drag_abort (GdkDragContext *context,
guint32 time);
/* GdkWindow */
void gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags);
void gdk_window_set_geometry_hints (GdkWindow *window,
GdkGeometry *geometry,
GdkWindowHints flags);
void gdk_set_sm_client_id (const gchar *sm_client_id);
void gdk_window_set_title (GdkWindow *window,
const gchar *title);
void gdk_window_set_role (GdkWindow *window,
const gchar *role);
void gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *leader);
void gdk_window_set_background (GdkWindow *window,
GdkColor *color);
void gdk_window_set_back_pixmap (GdkWindow *window,
GdkPixmap *pixmap,
gboolean parent_relative);
void gdk_window_set_cursor (GdkWindow *window,
GdkCursor *cursor);
void gdk_window_set_colormap (GdkWindow *window,
GdkColormap *colormap);
void gdk_window_get_user_data (GdkWindow *window,
gpointer *data);
void gdk_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth);
void gdk_window_get_position (GdkWindow *window,
gint *x,
gint *y);
void gdk_window_get_size (GdkWindow *window,
gint *width,
gint *height);
GdkVisual* gdk_window_get_visual (GdkWindow *window);
GdkColormap* gdk_window_get_colormap (GdkWindow *window);
GdkWindowType gdk_window_get_type (GdkWindow *window);
gint gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y);
gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
gint *x,
gint *y);
void gdk_window_get_root_origin (GdkWindow *window,
gint *x,
gint *y);
GdkWindow* gdk_window_get_pointer (GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow* gdk_window_get_parent (GdkWindow *window);
GdkWindow* gdk_window_get_toplevel (GdkWindow *window);
GList* gdk_window_get_children (GdkWindow *window);
GdkEventMask gdk_window_get_events (GdkWindow *window);
void gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask);
void gdk_window_set_icon (GdkWindow *window,
GdkWindow *icon_window,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gdk_window_set_icon_name (GdkWindow *window,
const gchar *name);
void gdk_window_set_group (GdkWindow *window,
GdkWindow *leader);
void gdk_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations);
void gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions);
GList * gdk_window_get_toplevels (void);
void gdk_window_register_dnd (GdkWindow *window);
void gdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,
gpointer data,
GDestroyNotify destroy_func);
/* Cursors
*/
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkPixmap *mask,
GdkColor *fg,
GdkColor *bg,
gint x,
gint y);
void gdk_cursor_destroy (GdkCursor *cursor);
/* GCs
*/
GdkGC* gdk_gc_new (GdkWindow *window);
GdkGC* gdk_gc_new_with_values (GdkWindow *window,
GdkGCValues *values,
GdkGCValuesMask values_mask);
GdkGC* gdk_gc_ref (GdkGC *gc);
void gdk_gc_unref (GdkGC *gc);
void gdk_gc_destroy (GdkGC *gc);
void gdk_gc_get_values (GdkGC *gc,
GdkGCValues *values);
void gdk_gc_set_foreground (GdkGC *gc,
GdkColor *color);
void gdk_gc_set_background (GdkGC *gc,
GdkColor *color);
void gdk_gc_set_font (GdkGC *gc,
GdkFont *font);
void gdk_gc_set_function (GdkGC *gc,
GdkFunction function);
void gdk_gc_set_fill (GdkGC *gc,
GdkFill fill);
void gdk_gc_set_tile (GdkGC *gc,
GdkPixmap *tile);
void gdk_gc_set_stipple (GdkGC *gc,
GdkPixmap *stipple);
void gdk_gc_set_ts_origin (GdkGC *gc,
gint x,
gint y);
void gdk_gc_set_clip_origin (GdkGC *gc,
gint x,
gint y);
void gdk_gc_set_clip_mask (GdkGC *gc,
GdkBitmap *mask);
void gdk_gc_set_clip_rectangle (GdkGC *gc,
GdkRectangle *rectangle);
void gdk_gc_set_clip_region (GdkGC *gc,
GdkRegion *region);
void gdk_gc_set_subwindow (GdkGC *gc,
GdkSubwindowMode mode);
void gdk_gc_set_exposures (GdkGC *gc,
gboolean exposures);
void gdk_gc_set_line_attributes (GdkGC *gc,
gint line_width,
GdkLineStyle line_style,
GdkCapStyle cap_style,
GdkJoinStyle join_style);
void gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gint n);
void gdk_gc_copy (GdkGC *dst_gc,
GdkGC *src_gc);
/* Pixmaps
*/
GdkPixmap* gdk_pixmap_new (GdkWindow *window,
gint width,
gint height,
gint depth);
GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window,
const gchar *data,
gint width,
gint height);
GdkPixmap* gdk_pixmap_create_from_data (GdkWindow *window,
const gchar *data,
gint width,
gint height,
gint depth,
GdkColor *fg,
GdkColor *bg);
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,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename);
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,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data);
GdkPixmap *gdk_pixmap_ref (GdkPixmap *pixmap);
void gdk_pixmap_unref (GdkPixmap *pixmap);
GdkBitmap *gdk_bitmap_ref (GdkBitmap *pixmap);
void gdk_bitmap_unref (GdkBitmap *pixmap);
/* Images
*/
GdkImage* gdk_image_new_bitmap(GdkVisual *visual,
gpointer data,
gint width,
gint height);
GdkImage* gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height);
GdkImage* gdk_image_get (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_image_put_pixel (GdkImage *image,
gint x,
gint y,
guint32 pixel);
guint32 gdk_image_get_pixel (GdkImage *image,
gint x,
gint y);
void gdk_image_destroy (GdkImage *image);
/* Color
*/
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);
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);
GdkVisual* gdk_colormap_get_visual (GdkColormap *colormap);
GdkColor* gdk_color_copy (const GdkColor *color);
void gdk_color_free (GdkColor *color);
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);
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 (const gchar *fontset_name);
GdkFont* gdk_font_ref (GdkFont *font);
void gdk_font_unref (GdkFont *font);
gint gdk_font_id (const GdkFont *font);
gboolean gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb);
gint gdk_string_width (GdkFont *font,
const gchar *string);
gint gdk_text_width (GdkFont *font,
const gchar *text,
gint text_length);
gint gdk_text_width_wc (GdkFont *font,
const GdkWChar *text,
gint text_length);
gint gdk_char_width (GdkFont *font,
gchar character);
gint gdk_char_width_wc (GdkFont *font,
GdkWChar character);
gint gdk_string_measure (GdkFont *font,
const gchar *string);
gint gdk_text_measure (GdkFont *font,
const gchar *text,
gint text_length);
gint gdk_char_measure (GdkFont *font,
gchar character);
gint gdk_string_height (GdkFont *font,
const gchar *string);
gint gdk_text_height (GdkFont *font,
const gchar *text,
gint text_length);
gint gdk_char_height (GdkFont *font,
gchar character);
void gdk_text_extents (GdkFont *font,
const gchar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent);
void gdk_text_extents_wc (GdkFont *font,
const GdkWChar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent);
void gdk_string_extents (GdkFont *font,
const gchar *string,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent);
/* Drawing
*/
void gdk_draw_point (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y);
void gdk_draw_line (GdkDrawable *drawable,
GdkGC *gc,
gint x1,
gint y1,
gint x2,
gint y2);
void gdk_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
void gdk_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
void gdk_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
void gdk_draw_string (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *string);
void gdk_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
void gdk_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
void gdk_draw_pixmap (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,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void gdk_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void gdk_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
void gdk_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
/* Selections
*/
gboolean gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gint send_event);
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
void gdk_selection_convert (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time);
gboolean gdk_selection_property_get (GdkWindow *requestor,
guchar **data,
GdkAtom *prop_type,
gint *prop_format);
void gdk_selection_send_notify (guint32 requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time);
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 (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);
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);
/* Rectangle utilities
*/
gboolean gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
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);
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
*/
gboolean gdk_im_ready (void);
void gdk_im_begin (GdkIC *ic,
GdkWindow *window);
void gdk_im_end (void);
GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style);
GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style);
GdkIC* gdk_ic_new (GdkICAttr *attr,
GdkICAttributesType mask);
void gdk_ic_destroy (GdkIC *ic);
GdkIMStyle gdk_ic_get_style (GdkIC *ic);
GdkEventMask gdk_ic_get_events (GdkIC *ic);
GdkICAttr* gdk_ic_attr_new (void);
void gdk_ic_attr_destroy (GdkICAttr *attr);
GdkICAttributesType gdk_ic_set_attr (GdkIC *ic,
GdkICAttr *attr,
GdkICAttributesType mask);
GdkICAttributesType gdk_ic_get_attr (GdkIC *ic,
GdkICAttr *attr,
GdkICAttributesType mask);
/* Conversion functions between wide char and multibyte strings.
*/
@@ -127,6 +867,101 @@ gint gdk_mbstowcs (GdkWChar *dest,
const gchar *src,
gint dest_max);
/* Color Context */
GdkColorContext *gdk_color_context_new (GdkVisual *visual,
GdkColormap *colormap);
GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual,
GdkColormap *colormap);
void gdk_color_context_free (GdkColorContext *cc);
gulong gdk_color_context_get_pixel (GdkColorContext *cc,
gushort red,
gushort green,
gushort blue,
gint *failed);
void gdk_color_context_get_pixels (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gulong *colors,
gint *nallocated);
void gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gint *used,
gulong *colors,
gint *nallocated);
gint gdk_color_context_query_color (GdkColorContext *cc,
GdkColor *color);
gint gdk_color_context_query_colors (GdkColorContext *cc,
GdkColor *colors,
gint num_colors);
gint gdk_color_context_add_palette (GdkColorContext *cc,
GdkColor *palette,
gint num_palette);
void gdk_color_context_init_dither (GdkColorContext *cc);
void gdk_color_context_free_dither (GdkColorContext *cc);
gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
gushort *red,
gushort *green,
gushort *blue,
gint *failed);
guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc,
gint *red,
gint *green,
gint *blue,
gint *failed);
/* Regions
*/
GdkRegion* gdk_region_new (void);
void gdk_region_destroy (GdkRegion *region);
void gdk_region_get_clipbox(GdkRegion *region,
GdkRectangle *rectangle);
gboolean gdk_region_empty (GdkRegion *region);
gboolean gdk_region_equal (GdkRegion *region1,
GdkRegion *region2);
gboolean gdk_region_point_in (GdkRegion *region,
int x,
int y);
GdkOverlapType gdk_region_rect_in (GdkRegion *region,
GdkRectangle *rect);
GdkRegion* gdk_region_polygon (GdkPoint *points,
gint npoints,
GdkFillRule fill_rule);
void gdk_region_offset (GdkRegion *region,
gint dx,
gint dy);
void gdk_region_shrink (GdkRegion *region,
gint dx,
gint dy);
GdkRegion* gdk_region_union_with_rect (GdkRegion *region,
GdkRectangle *rect);
GdkRegion* gdk_regions_intersect (GdkRegion *source1,
GdkRegion *source2);
GdkRegion* gdk_regions_union (GdkRegion *source1,
GdkRegion *source2);
GdkRegion* gdk_regions_subtract (GdkRegion *source1,
GdkRegion *source2);
GdkRegion* gdk_regions_xor (GdkRegion *source1,
GdkRegion *source2);
/* Miscellaneous */
void gdk_event_send_clientmessage_toall (GdkEvent *event);
gboolean gdk_event_send_client_message (GdkEvent *event,
@@ -134,21 +969,17 @@ gboolean gdk_event_send_client_message (GdkEvent *event,
/* Key values
*/
gchar* gdk_keyval_name (guint keyval);
guint gdk_keyval_from_name (const gchar *keyval_name);
void gdk_keyval_convert_case (guint symbol,
guint *lower,
guint *upper);
guint gdk_keyval_to_upper (guint keyval);
guint gdk_keyval_to_lower (guint keyval);
gboolean gdk_keyval_is_upper (guint keyval);
gboolean gdk_keyval_is_lower (guint keyval);
gchar* gdk_keyval_name (guint keyval);
guint gdk_keyval_from_name (const gchar *keyval_name);
guint gdk_keyval_to_upper (guint keyval);
guint gdk_keyval_to_lower (guint keyval);
gboolean gdk_keyval_is_upper (guint keyval);
gboolean gdk_keyval_is_lower (guint keyval);
/* Threading
*/
GDKVAR GMutex *gdk_threads_mutex;
extern GMutex *gdk_threads_mutex;
void gdk_threads_enter (void);
void gdk_threads_leave (void);
@@ -167,6 +998,8 @@ void gdk_threads_leave (void);
# define GDK_THREADS_LEAVE()
#endif /* !G_THREADS_ENABLED */
#include <gdk/gdkrgb.h>
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@@ -61,25 +61,15 @@
*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdlib.h>
#include <string.h>
#include "gdkcc.h"
#include "gdkcolor.h"
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkx.h"
#include "gdkinternals.h"
#define MAX_IMAGE_COLORS 256
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
struct _GdkColorContextPrivate
{
GdkColorContext color_context;
Display *xdisplay;
XStandardColormap std_cmap;
};
static guint
hash_color (gconstpointer key)

View File

@@ -1,149 +0,0 @@
#ifndef __GDK_CC_H__
#define __GDK_CC_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkColorContextDither GdkColorContextDither;
typedef struct _GdkColorContext GdkColorContext;
/* Color Context modes.
*
* GDK_CC_MODE_UNDEFINED - unknown
* GDK_CC_MODE_BW - default B/W
* GDK_CC_MODE_STD_CMAP - has a standard colormap
* GDK_CC_MODE_TRUE - is a TrueColor/DirectColor visual
* GDK_CC_MODE_MY_GRAY - my grayramp
* GDK_CC_MODE_PALETTE - has a pre-allocated palette
*/
typedef enum
{
GDK_CC_MODE_UNDEFINED,
GDK_CC_MODE_BW,
GDK_CC_MODE_STD_CMAP,
GDK_CC_MODE_TRUE,
GDK_CC_MODE_MY_GRAY,
GDK_CC_MODE_PALETTE
} GdkColorContextMode;
struct _GdkColorContextDither
{
gint fast_rgb[32][32][32]; /* quick look-up table for faster rendering */
gint fast_err[32][32][32]; /* internal RGB error information */
gint fast_erg[32][32][32];
gint fast_erb[32][32][32];
};
struct _GdkColorContext
{
GdkVisual *visual;
GdkColormap *colormap;
gint num_colors; /* available no. of colors in colormap */
gint max_colors; /* maximum no. of colors */
gint num_allocated; /* no. of allocated colors */
GdkColorContextMode mode;
gint need_to_free_colormap;
GdkAtom std_cmap_atom;
gulong *clut; /* color look-up table */
GdkColor *cmap; /* colormap */
GHashTable *color_hash; /* hash table of allocated colors */
GdkColor *palette; /* preallocated palette */
gint num_palette; /* size of palette */
GdkColorContextDither *fast_dither; /* fast dither matrix */
struct
{
gint red;
gint green;
gint blue;
} shifts;
struct
{
gulong red;
gulong green;
gulong blue;
} masks;
struct
{
gint red;
gint green;
gint blue;
} bits;
gulong max_entry;
gulong black_pixel;
gulong white_pixel;
};
GdkColorContext *gdk_color_context_new (GdkVisual *visual,
GdkColormap *colormap);
GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual,
GdkColormap *colormap);
void gdk_color_context_free (GdkColorContext *cc);
gulong gdk_color_context_get_pixel (GdkColorContext *cc,
gushort red,
gushort green,
gushort blue,
gint *failed);
void gdk_color_context_get_pixels (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gulong *colors,
gint *nallocated);
void gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
gushort *reds,
gushort *greens,
gushort *blues,
gint ncolors,
gint *used,
gulong *colors,
gint *nallocated);
gint gdk_color_context_query_color (GdkColorContext *cc,
GdkColor *color);
gint gdk_color_context_query_colors (GdkColorContext *cc,
GdkColor *colors,
gint num_colors);
gint gdk_color_context_add_palette (GdkColorContext *cc,
GdkColor *palette,
gint num_palette);
void gdk_color_context_init_dither (GdkColorContext *cc);
void gdk_color_context_free_dither (GdkColorContext *cc);
gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
gushort *red,
gushort *green,
gushort *blue,
gint *failed);
guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc,
gint *red,
gint *green,
gint *blue,
gint *failed);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_CC_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,123 +0,0 @@
#ifndef __GDK_COLOR_H__
#define __GDK_COLOR_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* The color type.
* A color consists of red, green and blue values in the
* range 0-65535 and a pixel value. The pixel value is highly
* dependent on the depth and colormap which this color will
* be used to draw into. Therefore, sharing colors between
* colormaps is a bad idea.
*/
struct _GdkColor
{
gulong pixel;
gushort red;
gushort green;
gushort blue;
};
/* The colormap type.
*/
typedef struct _GdkColormapClass GdkColormapClass;
#define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
#define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
#define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
#define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
#define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
#define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
struct _GdkColormap
{
GObject parent_instance;
/*< public >*/
gint size;
GdkColor *colors;
/*< private >*/
GdkVisual *visual;
gpointer windowing_data;
};
struct _GdkColormapClass
{
GObjectClass parent_class;
};
GType gdk_colormap_get_type (void);
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);
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);
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
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);
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,
gboolean 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);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_COLOR_H__ */

View File

@@ -1,48 +0,0 @@
#ifndef __GDK_COMPAT_H__
#define __GDK_COMPAT_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* use -DGDK_DISABLE_COMPAT_H to compile your code and asure that it
* works with future GTK+ versions as well.
*/
#ifndef GDK_DISABLE_COMPAT_H
#define gdk_draw_pixmap gdk_draw_drawable
#define gdk_draw_bitmap gdk_draw_drawable
#define gdk_window_get_size gdk_drawable_get_size
/* We can't really be compatible here, due to GObject */
/* #define gdk_window_get_type gdk_drawable_get_type */
#define gdk_window_get_colormap gdk_drawable_get_colormap
#define gdk_window_set_colormap gdk_drawable_set_colormap
#define gdk_window_get_visual gdk_drawable_get_visual
#define gdk_window_ref gdk_drawable_ref
#define gdk_window_unref gdk_drawable_unref
#define gdk_bitmap_ref gdk_drawable_ref
#define gdk_bitmap_unref gdk_drawable_unref
#define gdk_pixmap_ref gdk_drawable_ref
#define gdk_pixmap_unref gdk_drawable_unref
#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \
gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height)
#define gdk_gc_destroy gdk_gc_unref
#define gdk_image_destroy gdk_image_unref
#define gdk_cursor_destroy gdk_cursor_unref
#define GDK_WINDOW_PIXMAP GDK_DRAWABLE_PIXMAP
#endif /* GDK_DISABLE_COMPAT_H */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_COMPAT_H__ */

View File

@@ -1,9 +0,0 @@
/* Handcrafted for Win32 */
#define GDK_WINDOWING_WIN32
#define GDK_HAVE_WCHAR_H 1
#ifdef _MSC_VER
#define GDK_HAVE_WCTYPE_H 1
#endif
#define GDK_USE_UTF8_MBS 1

View File

@@ -24,29 +24,69 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdkcursor.h"
#include "gdkinternals.h"
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include "gdk.h"
#include "gdkprivate.h"
GdkCursor*
gdk_cursor_ref (GdkCursor *cursor)
gdk_cursor_new (GdkCursorType cursor_type)
{
g_return_val_if_fail (cursor != NULL, NULL);
g_return_val_if_fail (cursor->ref_count > 0, NULL);
GdkCursorPrivate *private;
GdkCursor *cursor;
Cursor xcursor;
cursor->ref_count += 1;
xcursor = XCreateFontCursor (gdk_display, cursor_type);
private = g_new (GdkCursorPrivate, 1);
private->xdisplay = gdk_display;
private->xcursor = xcursor;
cursor = (GdkCursor*) private;
cursor->type = cursor_type;
return cursor;
}
GdkCursor*
gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, GdkColor *bg, gint x, gint y)
{
GdkCursorPrivate *private;
GdkCursor *cursor;
Pixmap source_pixmap, mask_pixmap;
Cursor xcursor;
XColor xfg, xbg;
source_pixmap = ((GdkPixmapPrivate *) source)->xwindow;
mask_pixmap = ((GdkPixmapPrivate *) mask)->xwindow;
xfg.pixel = fg->pixel;
xfg.red = fg->red;
xfg.blue = fg->blue;
xfg.green = fg->green;
xbg.pixel = bg->pixel;
xbg.red = bg->red;
xbg.blue = bg->blue;
xbg.green = bg->green;
xcursor = XCreatePixmapCursor (gdk_display, source_pixmap, mask_pixmap, &xfg, &xbg, x, y);
private = g_new (GdkCursorPrivate, 1);
private->xdisplay = gdk_display;
private->xcursor = xcursor;
cursor = (GdkCursor *) private;
cursor->type = GDK_CURSOR_IS_PIXMAP;
return cursor;
}
void
gdk_cursor_unref (GdkCursor *cursor)
gdk_cursor_destroy (GdkCursor *cursor)
{
GdkCursorPrivate *private;
g_return_if_fail (cursor != NULL);
g_return_if_fail (cursor->ref_count > 0);
cursor->ref_count -= 1;
private = (GdkCursorPrivate *) cursor;
XFreeCursor (private->xdisplay, private->xcursor);
if (cursor->ref_count == 0)
_gdk_cursor_destroy (cursor);
g_free (private);
}

View File

@@ -1,41 +0,0 @@
#ifndef __GDK_CURSOR_H__
#define __GDK_CURSOR_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Cursor types.
*/
typedef enum
{
#include <gdk/gdkcursors.h>
GDK_LAST_CURSOR,
GDK_CURSOR_IS_PIXMAP = -1
} GdkCursorType;
struct _GdkCursor
{
GdkCursorType type;
guint ref_count;
};
/* Cursors
*/
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkPixmap *mask,
GdkColor *fg,
GdkColor *bg,
gint x,
gint y);
GdkCursor* gdk_cursor_ref (GdkCursor *cursor);
void gdk_cursor_unref (GdkCursor *cursor);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_CURSOR_H__ */

View File

@@ -27,14 +27,11 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
#include "gdkx.h"
#include "gdk/gdkprivate.h"
#include "gdk.h"
#include "gdk.h" /* For gdk_flush() */
#include "gdkdnd.h"
#include "gdkproperty.h"
#include "gdkinternals.h"
#include "gdkprivate-x11.h"
typedef struct _GdkDragContextPrivateData GdkDragContextPrivateData;
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
typedef enum {
GDK_DRAG_STATUS_DRAG,
@@ -58,7 +55,7 @@ typedef struct {
/* Structure that holds information about a drag in progress.
* this is used on both source and destination sides.
*/
struct _GdkDragContextPrivateData {
struct _GdkDragContextPrivate {
GdkDragContext context;
GdkAtom motif_selection;
@@ -82,8 +79,6 @@ struct _GdkDragContextPrivateData {
GdkWindowCache *window_cache;
};
#define PRIVATE_DATA(context) ((GdkDragContextPrivateData *) GDK_DRAG_CONTEXT (context)->windowing_data)
GdkDragContext *current_dest_drag = NULL;
/* Forward declarations */
@@ -123,115 +118,66 @@ static void xdnd_manage_source_filter (GdkDragContext *context,
GdkWindow *window,
gboolean add_filter);
static void gdk_drag_context_init (GdkDragContext *dragcontext);
static void gdk_drag_context_class_init (GdkDragContextClass *klass);
static void gdk_drag_context_finalize (GObject *object);
static gpointer parent_class = NULL;
static GList *contexts;
GType
gdk_drag_context_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkDragContextClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_drag_context_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkDragContext),
0, /* n_preallocs */
(GInstanceInitFunc) gdk_drag_context_init,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkDragContext",
&object_info);
}
return object_type;
}
static void
gdk_drag_context_init (GdkDragContext *dragcontext)
{
GdkDragContextPrivateData *private;
private = g_new0 (GdkDragContextPrivateData, 1);
dragcontext->windowing_data = private;
contexts = g_list_prepend (contexts, dragcontext);
}
static void
gdk_drag_context_class_init (GdkDragContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_drag_context_finalize;
}
static void
gdk_drag_context_finalize (GObject *object)
{
GdkDragContext *context = GDK_DRAG_CONTEXT (object);
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
g_list_free (context->targets);
if (context->source_window)
{
if ((context->protocol == GDK_DRAG_PROTO_XDND) &&
!context->is_source)
xdnd_manage_source_filter (context, context->source_window, FALSE);
gdk_window_unref (context->source_window);
}
if (context->dest_window)
gdk_window_unref (context->dest_window);
if (private->window_cache)
gdk_window_cache_destroy (private->window_cache);
contexts = g_list_remove (contexts, context);
g_free (private);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* Drag Contexts */
static GList *contexts;
GdkDragContext *
gdk_drag_context_new (void)
{
return GDK_DRAG_CONTEXT (g_type_create_instance (gdk_drag_context_get_type ()));
GdkDragContextPrivate *result;
result = g_new0 (GdkDragContextPrivate, 1);
result->ref_count = 1;
contexts = g_list_prepend (contexts, result);
return (GdkDragContext *)result;
}
void
gdk_drag_context_ref (GdkDragContext *context)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
g_return_if_fail (context != NULL);
g_object_ref (G_OBJECT (context));
((GdkDragContextPrivate *)context)->ref_count++;
}
void
gdk_drag_context_unref (GdkDragContext *context)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
g_object_unref (G_OBJECT (context));
g_return_if_fail (context != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count--;
if (private->ref_count == 0)
{
g_dataset_destroy (private);
g_list_free (context->targets);
if (context->source_window)
{
if ((context->protocol == GDK_DRAG_PROTO_XDND) &&
!context->is_source)
xdnd_manage_source_filter (context, context->source_window, FALSE);
gdk_window_unref (context->source_window);
}
if (context->dest_window)
gdk_window_unref (context->dest_window);
if (private->window_cache)
gdk_window_cache_destroy (private->window_cache);
contexts = g_list_remove (contexts, private);
g_free (private);
}
}
static GdkDragContext *
@@ -241,23 +187,23 @@ gdk_drag_context_find (gboolean is_source,
{
GList *tmp_list = contexts;
GdkDragContext *context;
GdkDragContextPrivateData *private;
GdkDragContextPrivate *private;
Window context_dest_xid;
while (tmp_list)
{
context = (GdkDragContext *)tmp_list->data;
private = PRIVATE_DATA (context);
private = (GdkDragContextPrivate *)context;
context_dest_xid = context->dest_window ?
(private->drop_xid ?
private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window)) :
(private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window)) :
None;
if ((!context->is_source == !is_source) &&
((source_xid == None) || (context->source_window &&
(GDK_DRAWABLE_XID (context->source_window) == source_xid))) &&
(GDK_WINDOW_XWINDOW (context->source_window) == source_xid))) &&
((dest_xid == None) || (context_dest_xid == dest_xid)))
return context;
@@ -423,7 +369,7 @@ gdk_window_cache_new (void)
result->old_event_mask = xwa.your_event_mask;
XSelectInput (gdk_display, gdk_root_window,
result->old_event_mask | SubstructureNotifyMask);
gdk_window_add_filter (gdk_parent_root,
gdk_window_add_filter ((GdkWindow *)&gdk_root_parent,
gdk_window_cache_filter, result);
gdk_error_code = 0;
@@ -462,7 +408,7 @@ static void
gdk_window_cache_destroy (GdkWindowCache *cache)
{
XSelectInput (gdk_display, gdk_root_window, cache->old_event_mask);
gdk_window_remove_filter (gdk_parent_root,
gdk_window_remove_filter ((GdkWindow *)&gdk_root_parent,
gdk_window_cache_filter, cache);
g_list_foreach (cache->children, (GFunc)g_free, NULL);
@@ -1301,7 +1247,7 @@ motif_dnd_get_flags (GdkDragContext *context)
static void
motif_set_targets (GdkDragContext *context)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
MotifDragInitiatorInfo info;
gint i;
static GdkAtom motif_drag_initiator_info = GDK_NONE;
@@ -1326,8 +1272,8 @@ motif_set_targets (GdkDragContext *context)
info.selection_atom = private->motif_selection;
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
GDK_DRAWABLE_XID (context->source_window),
XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
GDK_WINDOW_XWINDOW (context->source_window),
private->motif_selection,
motif_drag_initiator_info, 8, PropModeReplace,
(guchar *)&info, sizeof (info));
@@ -1385,29 +1331,29 @@ motif_send_enter (GdkDragContext *context,
guint32 time)
{
XEvent xev;
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_ENTER;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
MOTIF_XCLIENT_SHORT (&xev, 1) = 0;
MOTIF_XCLIENT_LONG (&xev, 1) = time;
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_DRAWABLE_XID (context->source_window);
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_WINDOW_XWINDOW (context->source_window);
if (!private->motif_targets_set)
motif_set_targets (context);
MOTIF_XCLIENT_LONG (&xev, 3) = private->motif_selection;
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
}
static void
@@ -1419,20 +1365,20 @@ motif_send_leave (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmTOP_LEVEL_LEAVE;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
MOTIF_XCLIENT_SHORT (&xev, 1) = 0;
MOTIF_XCLIENT_LONG (&xev, 1) = time;
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_DRAWABLE_XID (context->source_window);
MOTIF_XCLIENT_LONG (&xev, 2) = GDK_WINDOW_XWINDOW (context->source_window);
MOTIF_XCLIENT_LONG (&xev, 3) = 0;
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
}
static gboolean
@@ -1444,12 +1390,12 @@ motif_send_motion (GdkDragContext *context,
{
gboolean retval;
XEvent xev;
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
MOTIF_XCLIENT_SHORT (&xev, 1) = motif_dnd_get_flags (context);
@@ -1474,11 +1420,11 @@ motif_send_motion (GdkDragContext *context,
retval = FALSE;
}
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
return retval;
}
@@ -1487,12 +1433,12 @@ static void
motif_send_drop (GdkDragContext *context, guint32 time)
{
XEvent xev;
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
MOTIF_XCLIENT_BYTE (&xev, 0) = XmDROP_START;
MOTIF_XCLIENT_BYTE (&xev, 1) = local_byte_order;
@@ -1503,13 +1449,13 @@ motif_send_drop (GdkDragContext *context, guint32 time)
MOTIF_XCLIENT_SHORT (&xev, 5) = private->last_y;
MOTIF_XCLIENT_LONG (&xev, 3) = private->motif_selection;
MOTIF_XCLIENT_LONG (&xev, 4) = GDK_DRAWABLE_XID (context->source_window);
MOTIF_XCLIENT_LONG (&xev, 4) = GDK_WINDOW_XWINDOW (context->source_window);
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
}
/* Target Side */
@@ -1588,7 +1534,7 @@ motif_drag_context_new (GdkWindow *dest_window,
guint32 atom)
{
GdkDragContext *new_context;
GdkDragContextPrivateData *private;
GdkDragContextPrivate *private;
/* FIXME, current_dest_drag really shouldn't be NULL'd
* if we error below.
@@ -1605,7 +1551,7 @@ motif_drag_context_new (GdkWindow *dest_window,
}
new_context = gdk_drag_context_new ();
private = PRIVATE_DATA (new_context);
private = (GdkDragContextPrivate *)new_context;
new_context->protocol = GDK_DRAG_PROTO_MOTIF;
new_context->is_source = FALSE;
@@ -1702,7 +1648,7 @@ motif_motion (GdkEvent *event,
gint16 x_root,
gint16 y_root)
{
GdkDragContextPrivateData *private;
GdkDragContextPrivate *private;
GDK_NOTE(DND, g_message ("Motif DND motion: flags: %#4x time: %d (%d, %d)",
flags, timestamp, x_root, y_root));
@@ -1711,7 +1657,7 @@ motif_motion (GdkEvent *event,
(current_dest_drag->protocol == GDK_DRAG_PROTO_MOTIF) &&
(timestamp >= current_dest_drag->start_time))
{
private = PRIVATE_DATA (current_dest_drag);
private = (GdkDragContextPrivate *)current_dest_drag;
event->dnd.type = GDK_DRAG_MOTION;
event->dnd.context = current_dest_drag;
@@ -1740,7 +1686,7 @@ motif_operation_changed (GdkEvent *event,
guint16 flags,
guint32 timestamp)
{
GdkDragContextPrivateData *private;
GdkDragContextPrivate *private;
GDK_NOTE(DND, g_message ("Motif DND operation changed: flags: %#4x time: %d",
flags, timestamp));
@@ -1755,7 +1701,7 @@ motif_operation_changed (GdkEvent *event,
gdk_drag_context_ref (current_dest_drag);
event->dnd.time = timestamp;
private = PRIVATE_DATA (current_dest_drag);
private = (GdkDragContextPrivate *)current_dest_drag;
motif_dnd_translate_flags (current_dest_drag, flags);
@@ -1814,12 +1760,12 @@ motif_drag_status (GdkEvent *event,
g_message ("Motif status message: flags %x", flags));
context = gdk_drag_context_find (TRUE,
GDK_DRAWABLE_XID (event->any.window),
GDK_WINDOW_XWINDOW (event->any.window),
None);
if (context)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
if ((private->drag_status == GDK_DRAG_STATUS_MOTION_WAIT) ||
(private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT))
private->drag_status = GDK_DRAG_STATUS_DRAG;
@@ -2018,7 +1964,7 @@ xdnd_status_filter (GdkXEvent *xev,
context = gdk_drag_context_find (TRUE, xevent->xclient.window, dest_window);
if (context)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
if (private->drag_status == GDK_DRAG_STATUS_MOTION_WAIT)
private->drag_status = GDK_DRAG_STATUS_DRAG;
@@ -2071,7 +2017,7 @@ xdnd_finished_filter (GdkXEvent *xev,
static void
xdnd_set_targets (GdkDragContext *context)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
GdkAtom *atomlist;
GList *tmp_list = context->targets;
gint i;
@@ -2086,8 +2032,8 @@ xdnd_set_targets (GdkDragContext *context)
i++;
}
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
GDK_DRAWABLE_XID (context->source_window),
XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
GDK_WINDOW_XWINDOW (context->source_window),
gdk_atom_intern ("XdndTypeList", FALSE),
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
@@ -2100,7 +2046,7 @@ xdnd_set_targets (GdkDragContext *context)
static void
xdnd_set_actions (GdkDragContext *context)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
GdkAtom *atomlist;
gint i;
gint n_atoms;
@@ -2134,8 +2080,8 @@ xdnd_set_actions (GdkDragContext *context)
}
}
XChangeProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
GDK_DRAWABLE_XID (context->source_window),
XChangeProperty (GDK_WINDOW_XDISPLAY (context->source_window),
GDK_WINDOW_XWINDOW (context->source_window),
gdk_atom_intern ("XdndActionList", FALSE),
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
@@ -2170,15 +2116,15 @@ static void
xdnd_send_enter (GdkDragContext *context)
{
XEvent xev;
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
GDK_WINDOW_XWINDOW (context->dest_window);
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;
xev.xclient.data.l[3] = 0;
@@ -2206,12 +2152,12 @@ xdnd_send_enter (GdkDragContext *context)
}
}
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
gdk_window_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2222,26 +2168,26 @@ xdnd_send_leave (GdkDragContext *context)
{
XEvent xev;
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
GDK_WINDOW_XWINDOW (context->dest_window);
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
gdk_window_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2250,7 +2196,7 @@ xdnd_send_leave (GdkDragContext *context)
static void
xdnd_send_drop (GdkDragContext *context, guint32 time)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
XEvent xev;
xev.xclient.type = ClientMessage;
@@ -2258,19 +2204,19 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
GDK_WINDOW_XWINDOW (context->dest_window);
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
gdk_window_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2283,7 +2229,7 @@ xdnd_send_motion (GdkDragContext *context,
GdkDragAction action,
guint32 time)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
XEvent xev;
xev.xclient.type = ClientMessage;
@@ -2291,19 +2237,19 @@ xdnd_send_motion (GdkDragContext *context,
xev.xclient.format = 32;
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->source_window);
GDK_WINDOW_XWINDOW (context->dest_window);
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;
xev.xclient.data.l[3] = time;
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->dest_window),
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->dest_window),
FALSE, &xev))
{
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->dest_window)));
GDK_WINDOW_XWINDOW (context->dest_window)));
gdk_window_unref (context->dest_window);
context->dest_window = NULL;
}
@@ -2403,8 +2349,8 @@ xdnd_read_actions (GdkDragContext *context)
/* Get the XdndActionList, if set */
XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (context->source_window),
GDK_DRAWABLE_XID (context->source_window),
XGetWindowProperty (GDK_WINDOW_XDISPLAY (context->source_window),
GDK_WINDOW_XWINDOW (context->source_window),
gdk_atom_intern ("XdndActionList", FALSE), 0, 65536,
False, XA_ATOM, &type, &format, &nitems,
&after, (guchar **)&data);
@@ -2416,7 +2362,7 @@ xdnd_read_actions (GdkDragContext *context)
for (i=0; i<nitems; i++)
context->actions |= xdnd_action_from_atom (data[i]);
(PRIVATE_DATA (context))->xdnd_have_actions = TRUE;
((GdkDragContextPrivate *)context)->xdnd_have_actions = TRUE;
#ifdef G_ENABLE_DEBUG
if (gdk_debug_flags & GDK_DEBUG_DND)
@@ -2474,10 +2420,17 @@ xdnd_manage_source_filter (GdkDragContext *context,
gboolean add_filter)
{
gint old_warnings = 0; /* quiet gcc */
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
gboolean is_foreign = (private->window_type == GDK_WINDOW_FOREIGN);
gdk_error_trap_push ();
if (is_foreign)
{
old_warnings = gdk_error_warnings;
gdk_error_warnings = 0;
}
if (!GDK_WINDOW_DESTROYED (window))
if (!private->destroyed)
{
if (add_filter)
{
@@ -2499,8 +2452,11 @@ xdnd_manage_source_filter (GdkDragContext *context,
}
}
gdk_flush ();
gdk_error_trap_pop ();
if (is_foreign)
{
gdk_flush();
gdk_error_warnings = old_warnings;
}
}
static GdkFilterReturn
@@ -2561,7 +2517,7 @@ xdnd_enter_filter (GdkXEvent *xev,
if (get_types)
{
gdk_error_trap_push ();
XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (event->any.window),
XGetWindowProperty (GDK_WINDOW_XDISPLAY (event->any.window),
source_window,
gdk_atom_intern ("XdndTypeList", FALSE), 0, 65536,
False, XA_ATOM, &type, &format, &nitems,
@@ -2600,7 +2556,7 @@ xdnd_enter_filter (GdkXEvent *xev,
gdk_drag_context_ref (new_context);
current_dest_drag = new_context;
(PRIVATE_DATA (new_context))->xdnd_selection =
((GdkDragContextPrivate *)new_context)->xdnd_selection =
gdk_atom_intern ("XdndSelection", FALSE);
return GDK_FILTER_TRANSLATE;
@@ -2620,7 +2576,7 @@ xdnd_leave_filter (GdkXEvent *xev,
if ((current_dest_drag != NULL) &&
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
(GDK_WINDOW_XWINDOW (current_dest_drag->source_window) == source_window))
{
event->dnd.type = GDK_DRAG_LEAVE;
/* Pass ownership of context to the event */
@@ -2653,7 +2609,7 @@ xdnd_position_filter (GdkXEvent *xev,
if ((current_dest_drag != NULL) &&
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
(GDK_WINDOW_XWINDOW (current_dest_drag->source_window) == source_window))
{
event->dnd.type = GDK_DRAG_MOTION;
event->dnd.context = current_dest_drag;
@@ -2662,14 +2618,14 @@ xdnd_position_filter (GdkXEvent *xev,
event->dnd.time = time;
current_dest_drag->suggested_action = xdnd_action_from_atom (action);
if (!(PRIVATE_DATA (current_dest_drag))->xdnd_have_actions)
if (!((GdkDragContextPrivate *)current_dest_drag)->xdnd_have_actions)
current_dest_drag->actions = current_dest_drag->suggested_action;
event->dnd.x_root = x_root;
event->dnd.y_root = y_root;
(PRIVATE_DATA (current_dest_drag))->last_x = x_root;
(PRIVATE_DATA (current_dest_drag))->last_y = y_root;
((GdkDragContextPrivate *)current_dest_drag)->last_x = x_root;
((GdkDragContextPrivate *)current_dest_drag)->last_y = y_root;
return GDK_FILTER_TRANSLATE;
}
@@ -2692,10 +2648,10 @@ xdnd_drop_filter (GdkXEvent *xev,
if ((current_dest_drag != NULL) &&
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
(GDK_WINDOW_XWINDOW (current_dest_drag->source_window) == source_window))
{
GdkDragContextPrivateData *private;
private = PRIVATE_DATA (current_dest_drag);
GdkDragContextPrivate *private;
private = (GdkDragContextPrivate *)current_dest_drag;
event->dnd.type = GDK_DROP_START;
@@ -2885,7 +2841,7 @@ gdk_drag_find_window (GdkDragContext *context,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
Window dest;
g_return_if_fail (context != NULL);
@@ -2895,7 +2851,7 @@ gdk_drag_find_window (GdkDragContext *context,
dest = get_client_window_at_coords (private->window_cache,
drag_window ?
GDK_DRAWABLE_XID (drag_window) : GDK_NONE,
GDK_WINDOW_XWINDOW (drag_window) : GDK_NONE,
x_root, y_root);
if (private->dest_xid != dest)
@@ -2941,7 +2897,7 @@ gdk_drag_motion (GdkDragContext *context,
GdkDragAction possible_actions,
guint32 time)
{
GdkDragContextPrivateData *private = PRIVATE_DATA (context);
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
g_return_val_if_fail (context != NULL, FALSE);
@@ -3115,12 +3071,12 @@ gdk_drag_status (GdkDragContext *context,
GdkDragAction action,
guint32 time)
{
GdkDragContextPrivateData *private;
GdkDragContextPrivate *private;
XEvent xev;
g_return_if_fail (context != NULL);
private = PRIVATE_DATA (context);
private = (GdkDragContextPrivate *)context;
context->action = action;
@@ -3129,7 +3085,7 @@ gdk_drag_status (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
xev.xclient.format = 8;
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
xev.xclient.window = GDK_WINDOW_XWINDOW (context->source_window);
if (private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT)
{
@@ -3175,30 +3131,30 @@ gdk_drag_status (GdkDragContext *context,
MOTIF_XCLIENT_SHORT (&xev, 4) = private->last_x;
MOTIF_XCLIENT_SHORT (&xev, 5) = private->last_y;
if (!gdk_send_xevent (GDK_DRAWABLE_XID (context->source_window),
if (!gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
FALSE, 0, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->source_window)));
GDK_WINDOW_XWINDOW (context->source_window)));
}
else if (context->protocol == GDK_DRAG_PROTO_XDND)
{
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndStatus", FALSE);
xev.xclient.format = 32;
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
xev.xclient.window = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->dest_window);
xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = xdnd_action_to_atom (action);
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->source_window),
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->source_window)));
GDK_WINDOW_XWINDOW (context->source_window)));
}
private->old_action = action;
@@ -3209,11 +3165,11 @@ gdk_drop_reply (GdkDragContext *context,
gboolean ok,
guint32 time)
{
GdkDragContextPrivateData *private;
GdkDragContextPrivate *private;
g_return_if_fail (context != NULL);
private = PRIVATE_DATA (context);
private = (GdkDragContextPrivate *)context;
if (context->protocol == GDK_DRAG_PROTO_MOTIF)
{
@@ -3238,7 +3194,7 @@ gdk_drop_reply (GdkDragContext *context,
MOTIF_XCLIENT_SHORT (&xev, 2) = private->last_x;
MOTIF_XCLIENT_SHORT (&xev, 3) = private->last_y;
gdk_send_xevent (GDK_DRAWABLE_XID (context->source_window),
gdk_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
FALSE, 0, &xev);
}
}
@@ -3257,19 +3213,19 @@ gdk_drop_finish (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndFinished", FALSE);
xev.xclient.format = 32;
xev.xclient.window = GDK_DRAWABLE_XID (context->source_window);
xev.xclient.window = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[0] = GDK_DRAWABLE_XID (context->dest_window);
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->dest_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
xev.xclient.data.l[3] = 0;
xev.xclient.data.l[4] = 0;
if (!xdnd_send_xevent (GDK_DRAWABLE_XID (context->source_window),
if (!xdnd_send_xevent (GDK_WINDOW_XWINDOW (context->source_window),
FALSE, &xev))
GDK_NOTE (DND,
g_message ("Send event to %lx failed",
GDK_DRAWABLE_XID (context->source_window)));
GDK_WINDOW_XWINDOW (context->source_window)));
}
}
@@ -3282,11 +3238,6 @@ gdk_window_register_dnd (GdkWindow *window)
g_return_if_fail (window != NULL);
if (GPOINTER_TO_INT (gdk_drawable_get_data (window, "gdk-dnd-registered")))
return;
else
gdk_drawable_set_data (window, "gdk-dnd-registered", GINT_TO_POINTER(TRUE), NULL);
/* Set Motif drag receiver information property */
if (!motif_drag_receiver_info_atom)
@@ -3299,7 +3250,7 @@ gdk_window_register_dnd (GdkWindow *window)
info.num_drop_sites = 0;
info.total_size = sizeof(info);
XChangeProperty (gdk_display, GDK_DRAWABLE_XID (window),
XChangeProperty (gdk_display, GDK_WINDOW_XWINDOW (window),
motif_drag_receiver_info_atom,
motif_drag_receiver_info_atom,
8, PropModeReplace,
@@ -3312,8 +3263,8 @@ gdk_window_register_dnd (GdkWindow *window)
xdnd_aware_atom = gdk_atom_intern ("XdndAware", FALSE);
/* The property needs to be of type XA_ATOM, not XA_INTEGER. Blech */
XChangeProperty (GDK_DRAWABLE_XDISPLAY (window),
GDK_DRAWABLE_XID (window),
XChangeProperty (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XWINDOW (window),
xdnd_aware_atom, XA_ATOM,
32, PropModeReplace,
(guchar *)&xdnd_version, 1);
@@ -3333,9 +3284,9 @@ gdk_drag_get_selection (GdkDragContext *context)
g_return_val_if_fail (context != NULL, GDK_NONE);
if (context->protocol == GDK_DRAG_PROTO_MOTIF)
return (PRIVATE_DATA (context))->motif_selection;
return ((GdkDragContextPrivate *)context)->motif_selection;
else if (context->protocol == GDK_DRAG_PROTO_XDND)
return (PRIVATE_DATA (context))->xdnd_selection;
return ((GdkDragContextPrivate *)context)->xdnd_selection;
else
return GDK_NONE;
}

View File

@@ -1,125 +0,0 @@
#ifndef __GDK_DND_H__
#define __GDK_DND_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkDragContext GdkDragContext;
typedef enum
{
GDK_ACTION_DEFAULT = 1 << 0,
GDK_ACTION_COPY = 1 << 1,
GDK_ACTION_MOVE = 1 << 2,
GDK_ACTION_LINK = 1 << 3,
GDK_ACTION_PRIVATE = 1 << 4,
GDK_ACTION_ASK = 1 << 5
} GdkDragAction;
typedef enum
{
GDK_DRAG_PROTO_MOTIF,
GDK_DRAG_PROTO_XDND,
GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming
* drags */
GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
GDK_DRAG_PROTO_OLE2 /* The complex OLE2 dnd (not implemented) */
} GdkDragProtocol;
/* Object that holds information about a drag in progress.
* this is used on both source and destination sides.
*/
typedef struct _GdkDragContextClass GdkDragContextClass;
#define GDK_TYPE_DRAG_CONTEXT (gdk_drag_context_get_type ())
#define GDK_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext))
#define GDK_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
#define GDK_IS_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG_CONTEXT))
#define GDK_IS_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
#define GDK_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
struct _GdkDragContext {
GObject parent_instance;
/*< public >*/
GdkDragProtocol protocol;
gboolean is_source;
GdkWindow *source_window;
GdkWindow *dest_window;
GList *targets;
GdkDragAction actions;
GdkDragAction suggested_action;
GdkDragAction action;
guint32 start_time;
/*< private >*/
gpointer windowing_data;
};
struct _GdkDragContextClass {
GObjectClass parent_class;
};
/* Drag and Drop */
GType gdk_drag_context_get_type (void);
GdkDragContext * gdk_drag_context_new (void);
void gdk_drag_context_ref (GdkDragContext *context);
void gdk_drag_context_unref (GdkDragContext *context);
/* Destination side */
void gdk_drag_status (GdkDragContext *context,
GdkDragAction action,
guint32 time);
void gdk_drop_reply (GdkDragContext *context,
gboolean ok,
guint32 time);
void gdk_drop_finish (GdkDragContext *context,
gboolean success,
guint32 time);
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
/* Source side */
GdkDragContext * gdk_drag_begin (GdkWindow *window,
GList *targets);
guint32 gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol);
void gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window,
gint x_root,
gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol);
gboolean gdk_drag_motion (GdkDragContext *context,
GdkWindow *dest_window,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
GdkDragAction suggested_action,
GdkDragAction possible_actions,
guint32 time);
void gdk_drag_drop (GdkDragContext *context,
guint32 time);
void gdk_drag_abort (GdkDragContext *context,
guint32 time);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif __GDK_DND_H__

View File

@@ -24,171 +24,31 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdkdrawable.h"
#include "gdkinternals.h"
#include "gdkwindow.h"
static void gdk_drawable_init (GdkDrawable *drawable);
static void gdk_drawable_class_init (GdkDrawableClass *klass);
static void gdk_drawable_finalize (GObject *object);
static gpointer parent_class = NULL;
GType
gdk_drawable_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkDrawableClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_drawable_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkDrawable),
0, /* n_preallocs */
(GInstanceInitFunc) gdk_drawable_init,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkDrawable",
&object_info);
}
return object_type;
}
static void
gdk_drawable_init (GdkDrawable *drawable)
{
#include <X11/Xlib.h>
#include <X11/Xos.h>
#include "gdk.h"
#include "gdkprivate.h"
}
static void
gdk_drawable_class_init (GdkDrawableClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_drawable_finalize;
}
static void
gdk_drawable_finalize (GObject *object)
{
GdkDrawable *drawable = GDK_DRAWABLE (object);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* Manipulation of drawables
*/
void
gdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,
gpointer data,
GDestroyNotify destroy_func)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_object_set_qdata_full (G_OBJECT (drawable),
g_quark_from_string (key),
data,
destroy_func);
}
gpointer
gdk_drawable_get_data (GdkDrawable *drawable,
const gchar *key)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
return g_object_get_qdata (G_OBJECT (drawable),
g_quark_try_string (key));
}
void
gdk_drawable_get_size (GdkDrawable *drawable,
gint *width,
gint *height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GDK_DRAWABLE_GET_CLASS (drawable)->get_size (drawable, width, height);
}
GdkVisual*
gdk_drawable_get_visual (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
return GDK_DRAWABLE_GET_CLASS (drawable)->get_visual (drawable);
}
gint
gdk_drawable_get_depth (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), 0);
return GDK_DRAWABLE_GET_CLASS (drawable)->get_depth (drawable);
}
void
gdk_drawable_set_colormap (GdkDrawable *drawable,
GdkColormap *cmap)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GDK_DRAWABLE_GET_CLASS (drawable)->set_colormap (drawable, cmap);
}
GdkColormap*
gdk_drawable_get_colormap (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
return GDK_DRAWABLE_GET_CLASS (drawable)->get_colormap (drawable);
}
GdkDrawable*
gdk_drawable_ref (GdkDrawable *drawable)
{
return (GdkDrawable *) g_object_ref (G_OBJECT (drawable));
}
void
gdk_drawable_unref (GdkDrawable *drawable)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_object_unref (G_OBJECT (drawable));
}
/* Drawing
*/
void
gdk_draw_point (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y)
{
GdkPoint point;
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
point.x = x;
point.y = y;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, &point, 1);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawPoint (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y);
}
void
@@ -199,16 +59,19 @@ gdk_draw_line (GdkDrawable *drawable,
gint x2,
gint y2)
{
GdkSegment segment;
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
segment.x1 = x1;
segment.y1 = y1;
segment.x2 = x2;
segment.y2 = y2;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, &segment, 1);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawLine (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x1, y1, x2, y2);
}
void
@@ -219,25 +82,29 @@ gdk_draw_rectangle (GdkDrawable *drawable,
gint y,
gint width,
gint height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
{
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
if (width < 0 || height < 0)
{
gint real_width;
gint real_height;
gdk_drawable_get_size (drawable, &real_width, &real_height);
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
if (width < 0)
width = real_width;
if (height < 0)
height = real_height;
}
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_rectangle (drawable, gc, filled, x, y,
width, height);
if (width == -1)
width = drawable_private->width;
if (height == -1)
height = drawable_private->height;
if (filled)
XFillRectangle (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, width, height);
else
XDrawRectangle (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, width, height);
}
void
@@ -250,25 +117,29 @@ gdk_draw_arc (GdkDrawable *drawable,
gint height,
gint angle1,
gint angle2)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
{
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
if (width < 0 || height < 0)
{
gint real_width;
gint real_height;
gdk_drawable_get_size (drawable, &real_width, &real_height);
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
if (width < 0)
width = real_width;
if (height < 0)
height = real_height;
}
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_arc (drawable, gc, filled,
x, y, width, height, angle1, angle2);
if (width == -1)
width = drawable_private->width;
if (height == -1)
height = drawable_private->height;
if (filled)
XFillArc (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, width, height, angle1, angle2);
else
XDrawArc (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, width, height, angle1, angle2);
}
void
@@ -278,11 +149,46 @@ gdk_draw_polygon (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (GDK_IS_GC (gc));
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
GdkPoint *local_points = points;
gint local_npoints = npoints;
gint local_alloc = 0;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_polygon (drawable, gc, filled,
points, npoints);
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
if (filled)
{
XFillPolygon (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, (XPoint*) points, npoints, Complex, CoordModeOrigin);
}
else
{
if ((points[0].x != points[npoints-1].x) ||
(points[0].y != points[npoints-1].y))
{
local_alloc = 1;
++local_npoints;
local_points = (GdkPoint*) g_malloc (local_npoints * sizeof(GdkPoint));
memcpy (local_points, points, npoints * sizeof(GdkPoint));
local_points[npoints].x = points[0].x;
local_points[npoints].y = points[0].y;
}
XDrawLines (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc,
(XPoint*) local_points, local_npoints,
CoordModeOrigin);
if (local_alloc)
g_free (local_points);
}
}
/* gdk_draw_string
@@ -299,7 +205,45 @@ gdk_draw_string (GdkDrawable *drawable,
gint y,
const gchar *string)
{
gdk_draw_text (drawable, font, gc, x, y, string, _gdk_font_strlen (font, string));
GdkWindowPrivate *drawable_private;
GdkFontPrivate *font_private;
GdkGCPrivate *gc_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (font != NULL);
g_return_if_fail (gc != NULL);
g_return_if_fail (string != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
XFontStruct *xfont = (XFontStruct *) font_private->xfont;
XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
XDrawString (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, string, strlen (string));
}
else
{
XDrawString16 (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, (XChar2b *) string,
strlen (string) / 2);
}
}
else if (font->type == GDK_FONT_FONTSET)
{
XFontSet fontset = (XFontSet) font_private->xfont;
XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
fontset, gc_private->xgc, x, y, string, strlen (string));
}
else
g_error("undefined font type\n");
}
/* gdk_draw_text
@@ -317,12 +261,44 @@ gdk_draw_text (GdkDrawable *drawable,
const gchar *text,
gint text_length)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GdkWindowPrivate *drawable_private;
GdkFontPrivate *font_private;
GdkGCPrivate *gc_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (font != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_text (drawable, font, gc, x, y, text, text_length);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
XFontStruct *xfont = (XFontStruct *) font_private->xfont;
XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
XDrawString (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, text, text_length);
}
else
{
XDrawString16 (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, (XChar2b *) text, text_length / 2);
}
}
else if (font->type == GDK_FONT_FONTSET)
{
XFontSet fontset = (XFontSet) font_private->xfont;
XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
fontset, gc_private->xgc, x, y, text, text_length);
}
else
g_error("undefined font type\n");
}
void
@@ -334,45 +310,94 @@ gdk_draw_text_wc (GdkDrawable *drawable,
const GdkWChar *text,
gint text_length)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GdkWindowPrivate *drawable_private;
GdkFontPrivate *font_private;
GdkGCPrivate *gc_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (font != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (text != NULL);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_text_wc (drawable, font, gc, x, y, text, text_length);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
XFontStruct *xfont = (XFontStruct *) font_private->xfont;
gchar *text_8bit;
gint i;
XSetFont(drawable_private->xdisplay, gc_private->xgc, xfont->fid);
text_8bit = g_new (gchar, text_length);
for (i=0; i<text_length; i++) text_8bit[i] = text[i];
XDrawString (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, text_8bit, text_length);
g_free (text_8bit);
}
else if (font->type == GDK_FONT_FONTSET)
{
if (sizeof(GdkWChar) == sizeof(wchar_t))
{
XwcDrawString (drawable_private->xdisplay, drawable_private->xwindow,
(XFontSet) font_private->xfont,
gc_private->xgc, x, y, (wchar_t *)text, text_length);
}
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];
XwcDrawString (drawable_private->xdisplay, drawable_private->xwindow,
(XFontSet) font_private->xfont,
gc_private->xgc, x, y, text_wchar, text_length);
g_free (text_wchar);
}
}
else
g_error("undefined font type\n");
}
void
gdk_draw_drawable (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
gdk_draw_pixmap (GdkDrawable *drawable,
GdkGC *gc,
GdkPixmap *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GdkWindowPrivate *drawable_private;
GdkWindowPrivate *src_private;
GdkGCPrivate *gc_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (src != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
if (width < 0 || height < 0)
{
gint real_width;
gint real_height;
gdk_drawable_get_size (drawable, &real_width, &real_height);
drawable_private = (GdkWindowPrivate*) drawable;
src_private = (GdkWindowPrivate*) src;
if (drawable_private->destroyed || src_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
if (width < 0)
width = real_width;
if (height < 0)
height = real_height;
}
if (width == -1)
width = src_private->width;
if (height == -1)
height = src_private->height;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc, src,
xsrc, ysrc, xdest, ydest,
width, height);
XCopyArea (drawable_private->xdisplay,
src_private->xwindow,
drawable_private->xwindow,
gc_private->xgc,
xsrc, ysrc,
width, height,
xdest, ydest);
}
void
@@ -386,17 +411,23 @@ gdk_draw_image (GdkDrawable *drawable,
gint width,
gint height)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GdkImagePrivate *image_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (image != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
image_private = (GdkImagePrivate*) image;
g_return_if_fail (image_private->image_put != NULL);
if (width == -1)
width = image->width;
if (height == -1)
height = image->height;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_image (drawable, gc, image, xsrc, ysrc,
xdest, ydest, width, height);
(* image_private->image_put) (drawable, gc, image, xsrc, ysrc,
xdest, ydest, width, height);
}
void
@@ -405,15 +436,24 @@ gdk_draw_points (GdkDrawable *drawable,
GdkPoint *points,
gint npoints)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail ((points != NULL) && (npoints > 0));
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (npoints >= 0);
g_return_if_fail (gc != NULL);
if (npoints == 0)
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_points (drawable, gc, points, npoints);
XDrawPoints (drawable_private->xdisplay,
drawable_private->xwindow,
gc_private->xgc,
(XPoint *) points,
npoints,
CoordModeOrigin);
}
void
@@ -422,32 +462,53 @@ gdk_draw_segments (GdkDrawable *drawable,
GdkSegment *segs,
gint nsegs)
{
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
if (nsegs == 0)
if (nsegs <= 0)
return;
g_return_if_fail (drawable != NULL);
g_return_if_fail (segs != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (nsegs >= 0);
g_return_if_fail (gc != NULL);
GDK_DRAWABLE_GET_CLASS (drawable)->draw_segments (drawable, gc, segs, nsegs);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawSegments (drawable_private->xdisplay,
drawable_private->xwindow,
gc_private->xgc,
(XSegment *) segs,
nsegs);
}
void
gdk_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints)
GdkGC *gc,
GdkPoint *points,
gint npoints)
{
GdkWindowPrivate *drawable_private;
GdkGCPrivate *gc_private;
g_return_if_fail (GDK_IS_DRAWABLE (drawable));
g_return_if_fail (points != NULL);
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (npoints >= 0);
if (npoints == 0)
if (npoints <= 0)
return;
GDK_DRAWABLE_GET_CLASS (drawable)->draw_lines (drawable, gc, points, npoints);
g_return_if_fail (drawable != NULL);
g_return_if_fail (points != NULL);
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);
}

View File

@@ -1,222 +0,0 @@
#ifndef __GDK_DRAWABLE_H__
#define __GDK_DRAWABLE_H__
#include <gdk/gdktypes.h>
#include <gdk/gdkgc.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkDrawableClass GdkDrawableClass;
#define GDK_TYPE_DRAWABLE (gdk_drawable_get_type ())
#define GDK_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE, GdkDrawable))
#define GDK_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE, GdkDrawableClass))
#define GDK_IS_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE))
#define GDK_IS_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE))
#define GDK_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE, GdkDrawableClass))
struct _GdkDrawable
{
GObject parent_instance;
};
struct _GdkDrawableClass
{
GObjectClass parent_class;
GdkGC *(*create_gc) (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask mask);
void (*draw_rectangle) (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
void (*draw_arc) (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
void (*draw_polygon) (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
void (*draw_text) (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
void (*draw_text_wc) (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
void (*draw_drawable) (GdkDrawable *drawable,
GdkGC *gc,
GdkDrawable *src,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void (*draw_points) (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void (*draw_segments) (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
void (*draw_lines) (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void (*draw_image) (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
gint (*get_depth) (GdkDrawable *drawable);
void (*get_size) (GdkDrawable *drawable,
gint *width,
gint *height);
void (*set_colormap) (GdkDrawable *drawable,
GdkColormap *cmap);
GdkColormap* (*get_colormap) (GdkDrawable *drawable);
GdkVisual* (*get_visual) (GdkDrawable *drawable);
};
GType gdk_drawable_get_type (void);
/* Manipulation of drawables
*/
void gdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,
gpointer data,
GDestroyNotify destroy_func);
gpointer gdk_drawable_get_data (GdkDrawable *drawable,
const gchar *key);
void gdk_drawable_get_size (GdkDrawable *drawable,
gint *width,
gint *height);
void gdk_drawable_set_colormap (GdkDrawable *drawable,
GdkColormap *colormap);
GdkColormap* gdk_drawable_get_colormap (GdkDrawable *drawable);
GdkVisual* gdk_drawable_get_visual (GdkDrawable *drawable);
gint gdk_drawable_get_depth (GdkDrawable *drawable);
GdkDrawable* gdk_drawable_ref (GdkDrawable *drawable);
void gdk_drawable_unref (GdkDrawable *drawable);
/* Drawing
*/
void gdk_draw_point (GdkDrawable *drawable,
GdkGC *gc,
gint x,
gint y);
void gdk_draw_line (GdkDrawable *drawable,
GdkGC *gc,
gint x1,
gint y1,
gint x2,
gint y2);
void gdk_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height);
void gdk_draw_arc (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height,
gint angle1,
gint angle2);
void gdk_draw_polygon (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
GdkPoint *points,
gint npoints);
void gdk_draw_string (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *string);
void gdk_draw_text (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const gchar *text,
gint text_length);
void gdk_draw_text_wc (GdkDrawable *drawable,
GdkFont *font,
GdkGC *gc,
gint x,
gint y,
const GdkWChar *text,
gint text_length);
void gdk_draw_drawable (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,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
void gdk_draw_points (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
void gdk_draw_segments (GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs);
void gdk_draw_lines (GdkDrawable *drawable,
GdkGC *gc,
GdkPoint *points,
gint npoints);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_DRAWABLE_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,438 +0,0 @@
#ifndef __GDK_EVENTS_H__
#define __GDK_EVENTS_H__
#include <gdk/gdktypes.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkinput.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
typedef struct _GdkEventAny GdkEventAny;
typedef struct _GdkEventExpose GdkEventExpose;
typedef struct _GdkEventNoExpose GdkEventNoExpose;
typedef struct _GdkEventVisibility GdkEventVisibility;
typedef struct _GdkEventMotion GdkEventMotion;
typedef struct _GdkEventButton GdkEventButton;
typedef struct _GdkEventScroll GdkEventScroll;
typedef struct _GdkEventKey GdkEventKey;
typedef struct _GdkEventFocus GdkEventFocus;
typedef struct _GdkEventCrossing GdkEventCrossing;
typedef struct _GdkEventConfigure GdkEventConfigure;
typedef struct _GdkEventProperty GdkEventProperty;
typedef struct _GdkEventSelection GdkEventSelection;
typedef struct _GdkEventProximity GdkEventProximity;
typedef struct _GdkEventClient GdkEventClient;
typedef struct _GdkEventDND GdkEventDND;
typedef union _GdkEvent GdkEvent;
typedef void (*GdkEventFunc) (GdkEvent *event,
gpointer data);
/* Event filtering */
typedef void GdkXEvent; /* Can be cast to XEvent */
typedef enum {
GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */
GDK_FILTER_TRANSLATE, /* Translated event stored */
GDK_FILTER_REMOVE /* Terminate processing, removing event */
} GdkFilterReturn;
typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
GdkEvent *event,
gpointer data);
/* Event types.
* Nothing: No event occurred.
* Delete: A window delete event was sent by the window manager.
* The specified window should be deleted.
* Destroy: A window has been destroyed.
* Expose: Part of a window has been uncovered.
* NoExpose: Same as expose, but no expose event was generated.
* VisibilityNotify: A window has become fully/partially/not obscured.
* MotionNotify: The mouse has moved.
* ButtonPress: A mouse button was pressed.
* ButtonRelease: A mouse button was release.
* KeyPress: A key was pressed.
* KeyRelease: A key was released.
* EnterNotify: A window was entered.
* LeaveNotify: A window was exited.
* FocusChange: The focus window has changed. (The focus window gets
* keyboard events).
* Resize: A window has been resized.
* Map: A window has been mapped. (It is now visible on the screen).
* Unmap: A window has been unmapped. (It is no longer visible on
* the screen).
* Scroll: A mouse wheel was scrolled either up or down.
*/
typedef enum
{
GDK_NOTHING = -1,
GDK_DELETE = 0,
GDK_DESTROY = 1,
GDK_EXPOSE = 2,
GDK_MOTION_NOTIFY = 3,
GDK_BUTTON_PRESS = 4,
GDK_2BUTTON_PRESS = 5,
GDK_3BUTTON_PRESS = 6,
GDK_BUTTON_RELEASE = 7,
GDK_KEY_PRESS = 8,
GDK_KEY_RELEASE = 9,
GDK_ENTER_NOTIFY = 10,
GDK_LEAVE_NOTIFY = 11,
GDK_FOCUS_CHANGE = 12,
GDK_CONFIGURE = 13,
GDK_MAP = 14,
GDK_UNMAP = 15,
GDK_PROPERTY_NOTIFY = 16,
GDK_SELECTION_CLEAR = 17,
GDK_SELECTION_REQUEST = 18,
GDK_SELECTION_NOTIFY = 19,
GDK_PROXIMITY_IN = 20,
GDK_PROXIMITY_OUT = 21,
GDK_DRAG_ENTER = 22,
GDK_DRAG_LEAVE = 23,
GDK_DRAG_MOTION = 24,
GDK_DRAG_STATUS = 25,
GDK_DROP_START = 26,
GDK_DROP_FINISHED = 27,
GDK_CLIENT_EVENT = 28,
GDK_VISIBILITY_NOTIFY = 29,
GDK_NO_EXPOSE = 30,
GDK_SCROLL = 31
} GdkEventType;
/* Event masks. (Used to select what types of events a window
* will receive).
*/
typedef enum
{
GDK_EXPOSURE_MASK = 1 << 1,
GDK_POINTER_MOTION_MASK = 1 << 2,
GDK_POINTER_MOTION_HINT_MASK = 1 << 3,
GDK_BUTTON_MOTION_MASK = 1 << 4,
GDK_BUTTON1_MOTION_MASK = 1 << 5,
GDK_BUTTON2_MOTION_MASK = 1 << 6,
GDK_BUTTON3_MOTION_MASK = 1 << 7,
GDK_BUTTON_PRESS_MASK = 1 << 8,
GDK_BUTTON_RELEASE_MASK = 1 << 9,
GDK_KEY_PRESS_MASK = 1 << 10,
GDK_KEY_RELEASE_MASK = 1 << 11,
GDK_ENTER_NOTIFY_MASK = 1 << 12,
GDK_LEAVE_NOTIFY_MASK = 1 << 13,
GDK_FOCUS_CHANGE_MASK = 1 << 14,
GDK_STRUCTURE_MASK = 1 << 15,
GDK_PROPERTY_CHANGE_MASK = 1 << 16,
GDK_VISIBILITY_NOTIFY_MASK = 1 << 17,
GDK_PROXIMITY_IN_MASK = 1 << 18,
GDK_PROXIMITY_OUT_MASK = 1 << 19,
GDK_SUBSTRUCTURE_MASK = 1 << 20,
GDK_SCROLL_MASK = 1 << 21,
GDK_ALL_EVENTS_MASK = 0x3FFFFE
} GdkEventMask;
typedef enum
{
GDK_VISIBILITY_UNOBSCURED,
GDK_VISIBILITY_PARTIAL,
GDK_VISIBILITY_FULLY_OBSCURED
} GdkVisibilityState;
typedef enum
{
GDK_SCROLL_UP,
GDK_SCROLL_DOWN,
GDK_SCROLL_LEFT,
GDK_SCROLL_RIGHT
} GdkScrollDirection;
/* Types of enter/leave notifications.
* Ancestor:
* Virtual:
* Inferior:
* Nonlinear:
* NonlinearVirtual:
* Unknown: An unknown type of enter/leave event occurred.
*/
typedef enum
{
GDK_NOTIFY_ANCESTOR = 0,
GDK_NOTIFY_VIRTUAL = 1,
GDK_NOTIFY_INFERIOR = 2,
GDK_NOTIFY_NONLINEAR = 3,
GDK_NOTIFY_NONLINEAR_VIRTUAL = 4,
GDK_NOTIFY_UNKNOWN = 5
} GdkNotifyType;
/* Enter/leave event modes.
* NotifyNormal
* NotifyGrab
* NotifyUngrab
*/
typedef enum
{
GDK_CROSSING_NORMAL,
GDK_CROSSING_GRAB,
GDK_CROSSING_UNGRAB
} GdkCrossingMode;
typedef enum
{
GDK_PROPERTY_NEW_VALUE,
GDK_PROPERTY_DELETE
} GdkPropertyState;
struct _GdkEventAny
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
};
struct _GdkEventExpose
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkRectangle area;
gint count; /* If non-zero, how many more events follow. */
};
struct _GdkEventNoExpose
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
/* XXX: does anyone need the X major_code or minor_code fields? */
};
struct _GdkEventVisibility
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkVisibilityState state;
};
struct _GdkEventMotion
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble pressure;
gdouble xtilt;
gdouble ytilt;
guint state;
gint16 is_hint;
GdkInputSource source;
guint32 deviceid;
gdouble x_root, y_root;
};
struct _GdkEventButton
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble pressure;
gdouble xtilt;
gdouble ytilt;
guint state;
guint button;
GdkInputSource source;
guint32 deviceid;
gdouble x_root, y_root;
};
struct _GdkEventScroll
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
gdouble x;
gdouble y;
gdouble pressure;
gdouble xtilt;
gdouble ytilt;
guint state;
GdkScrollDirection direction;
GdkInputSource source;
guint32 deviceid;
gdouble x_root, y_root;
};
struct _GdkEventKey
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
guint state;
guint keyval;
gint length;
gchar *string;
};
struct _GdkEventCrossing
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkWindow *subwindow;
guint32 time;
gdouble x;
gdouble y;
gdouble x_root;
gdouble y_root;
GdkCrossingMode mode;
GdkNotifyType detail;
gboolean focus;
guint state;
};
struct _GdkEventFocus
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
gint16 in;
};
struct _GdkEventConfigure
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
gint x, y;
gint width;
gint height;
};
struct _GdkEventProperty
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkAtom atom;
guint32 time;
guint state;
};
struct _GdkEventSelection
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkAtom selection;
GdkAtom target;
GdkAtom property;
guint32 requestor;
guint32 time;
};
/* This event type will be used pretty rarely. It only is important
for XInput aware programs that are drawing their own cursor */
struct _GdkEventProximity
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
guint32 time;
GdkInputSource source;
guint32 deviceid;
};
struct _GdkEventClient
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkAtom message_type;
gushort data_format;
union {
char b[20];
short s[10];
long l[5];
} data;
};
/* Event types for DND */
struct _GdkEventDND {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkDragContext *context;
guint32 time;
gshort x_root, y_root;
};
union _GdkEvent
{
GdkEventType type;
GdkEventAny any;
GdkEventExpose expose;
GdkEventNoExpose no_expose;
GdkEventVisibility visibility;
GdkEventMotion motion;
GdkEventButton button;
GdkEventScroll scroll;
GdkEventKey key;
GdkEventCrossing crossing;
GdkEventFocus focus_change;
GdkEventConfigure configure;
GdkEventProperty property;
GdkEventSelection selection;
GdkEventProximity proximity;
GdkEventClient client;
GdkEventDND dnd;
};
gboolean gdk_events_pending (void);
GdkEvent* gdk_event_get (void);
GdkEvent* gdk_event_peek (void);
GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window);
void gdk_event_put (GdkEvent *event);
GdkEvent* gdk_event_copy (GdkEvent *event);
void gdk_event_free (GdkEvent *event);
guint32 gdk_event_get_time (GdkEvent *event);
void gdk_event_handler_set (GdkEventFunc func,
gpointer data,
GDestroyNotify notify);
void gdk_set_show_events (gboolean show_events);
gboolean gdk_get_show_events (void);
/*
* The following function adds a global filter for all client
* messages of type message_type
*/
void gdk_add_client_message_filter (GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_EVENTS_H__ */

View File

@@ -24,8 +24,178 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdkfont.h"
#include "gdkinternals.h"
#include <X11/Xlib.h>
#include <X11/Xos.h>
#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;
g_return_val_if_fail (font_name != NULL, NULL);
font = gdk_font_hash_lookup (GDK_FONT_FONT, font_name);
if (font)
return font;
xfont = XLoadQueryFont (gdk_display, font_name);
if (xfont == NULL)
return NULL;
font = gdk_font_lookup (xfont->fid);
if (font != 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 = xfont->ascent;
font->descent = xfont->descent;
gdk_xid_table_insert (&xfont->fid, font);
}
gdk_font_hash_insert (GDK_FONT_FONT, font, font_name);
return font;
}
GdkFont*
gdk_fontset_load (const gchar *fontset_name)
{
GdkFont *font;
GdkFontPrivate *private;
XFontSet fontset;
gint missing_charset_count;
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;
private->xdisplay = gdk_display;
fontset = XCreateFontSet (gdk_display, fontset_name,
&missing_charset_list, &missing_charset_count,
&def_string);
if (missing_charset_count)
{
gint i;
g_warning ("Missing charsets in FontSet creation\n");
for (i=0;i<missing_charset_count;i++)
g_warning (" %s\n", missing_charset_list[i]);
XFreeStringList (missing_charset_list);
}
private->ref_count = 1;
if (!fontset)
{
g_free (font);
return NULL;
}
else
{
gint num_fonts;
gint i;
XFontStruct **font_structs;
gchar **font_names;
private->xfont = fontset;
font->type = GDK_FONT_FONTSET;
num_fonts = XFontsOfFontSet (fontset, &font_structs, &font_names);
font->ascent = font->descent = 0;
for (i = 0; i < num_fonts; i++)
{
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;
}
}
GdkFont*
gdk_font_ref (GdkFont *font)
@@ -50,35 +220,304 @@ gdk_font_unref (GdkFont *font)
private->ref_count -= 1;
if (private->ref_count == 0)
_gdk_font_destroy (font);
{
gdk_font_hash_remove (font->type, font);
switch (font->type)
{
case GDK_FONT_FONT:
gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
break;
case GDK_FONT_FONTSET:
XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
break;
default:
g_error ("unknown font type.");
break;
}
g_free (font);
}
}
gint
gdk_font_id (const GdkFont *font)
{
const GdkFontPrivate *font_private;
g_return_val_if_fail (font != NULL, 0);
font_private = (const GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
return ((XFontStruct *) font_private->xfont)->fid;
}
else
{
return 0;
}
}
gboolean
gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb)
{
const GdkFontPrivate *privatea;
const GdkFontPrivate *privateb;
g_return_val_if_fail (fonta != NULL, FALSE);
g_return_val_if_fail (fontb != NULL, FALSE);
privatea = (const GdkFontPrivate*) fonta;
privateb = (const GdkFontPrivate*) fontb;
if (fonta->type == GDK_FONT_FONT && fontb->type == GDK_FONT_FONT)
{
return (((XFontStruct *) privatea->xfont)->fid ==
((XFontStruct *) privateb->xfont)->fid);
}
else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
{
gchar *namea, *nameb;
namea = XBaseFontNameListOfFontSet((XFontSet) privatea->xfont);
nameb = XBaseFontNameListOfFontSet((XFontSet) privateb->xfont);
return (strcmp(namea, nameb) == 0);
}
else
/* fontset != font */
return FALSE;
}
gint
gdk_string_width (GdkFont *font,
const gchar *string)
{
GdkFontPrivate *font_private;
gint width;
XFontStruct *xfont;
XFontSet fontset;
g_return_val_if_fail (font != NULL, -1);
g_return_val_if_fail (string != NULL, -1);
return gdk_text_width (font, string, _gdk_font_strlen (font, string));
font_private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
xfont = (XFontStruct *) font_private->xfont;
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
width = XTextWidth (xfont, string, strlen (string));
}
else
{
width = XTextWidth16 (xfont, (XChar2b *) string, strlen (string) / 2);
}
break;
case GDK_FONT_FONTSET:
fontset = (XFontSet) font_private->xfont;
width = XmbTextEscapement (fontset, string, strlen(string));
break;
default:
width = 0;
}
return width;
}
gint
gdk_text_width (GdkFont *font,
const gchar *text,
gint text_length)
{
GdkFontPrivate *private;
gint width;
XFontStruct *xfont;
XFontSet fontset;
g_return_val_if_fail (font != NULL, -1);
g_return_val_if_fail (text != NULL, -1);
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
xfont = (XFontStruct *) private->xfont;
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
width = XTextWidth (xfont, text, text_length);
}
else
{
width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
}
break;
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
width = XmbTextEscapement (fontset, text, text_length);
break;
default:
width = 0;
}
return width;
}
gint
gdk_text_width_wc (GdkFont *font,
const GdkWChar *text,
gint text_length)
{
GdkFontPrivate *private;
gint width;
XFontStruct *xfont;
XFontSet fontset;
g_return_val_if_fail (font != NULL, -1);
g_return_val_if_fail (text != NULL, -1);
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
xfont = (XFontStruct *) private->xfont;
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
gchar *text_8bit;
gint i;
text_8bit = g_new (gchar, text_length);
for (i=0; i<text_length; i++) text_8bit[i] = text[i];
width = XTextWidth (xfont, text_8bit, text_length);
g_free (text_8bit);
}
else
{
width = 0;
}
break;
case GDK_FONT_FONTSET:
if (sizeof(GdkWChar) == sizeof(wchar_t))
{
fontset = (XFontSet) private->xfont;
width = XwcTextEscapement (fontset, (wchar_t *)text, text_length);
}
else
{
wchar_t *text_wchar;
gint i;
fontset = (XFontSet) private->xfont;
text_wchar = g_new(wchar_t, text_length);
for (i=0; i<text_length; i++) text_wchar[i] = text[i];
width = XwcTextEscapement (fontset, text_wchar, text_length);
g_free (text_wchar);
}
break;
default:
width = 0;
}
return width;
}
/* Problem: What if a character is a 16 bits character ?? */
gint
gdk_char_width (GdkFont *font,
gchar character)
{
GdkFontPrivate *private;
XCharStruct *chars;
gint width;
guint ch = character & 0xff; /* get rid of sign-extension */
XFontStruct *xfont;
XFontSet fontset;
g_return_val_if_fail (font != NULL, -1);
return gdk_text_width (font, &character, 1);
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
/* only 8 bits characters are considered here */
xfont = (XFontStruct *) private->xfont;
if ((xfont->min_byte1 == 0) &&
(xfont->max_byte1 == 0) &&
(ch >= xfont->min_char_or_byte2) &&
(ch <= xfont->max_char_or_byte2))
{
chars = xfont->per_char;
if (chars)
width = chars[ch - xfont->min_char_or_byte2].width;
else
width = xfont->min_bounds.width;
}
else
{
width = XTextWidth (xfont, &character, 1);
}
break;
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
width = XmbTextEscapement (fontset, &character, 1) ;
break;
default:
width = 0;
}
return width;
}
gint
gdk_char_width_wc (GdkFont *font,
GdkWChar character)
{
GdkFontPrivate *private;
XCharStruct *chars;
gint width;
guint ch = character & 0xff; /* get rid of sign-extension */
XFontStruct *xfont;
XFontSet fontset;
g_return_val_if_fail (font != NULL, -1);
return gdk_text_width_wc (font, &character, 1);
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
/* only 8 bits characters are considered here */
xfont = (XFontStruct *) private->xfont;
if ((xfont->min_byte1 == 0) &&
(xfont->max_byte1 == 0) &&
(ch >= xfont->min_char_or_byte2) &&
(ch <= xfont->max_char_or_byte2))
{
chars = xfont->per_char;
if (chars)
width = chars[ch - xfont->min_char_or_byte2].width;
else
width = xfont->min_bounds.width;
}
else
{
char ch2 = character;
width = XTextWidth (xfont, &ch2, 1);
}
break;
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
{
wchar_t char_wc = character;
width = XwcTextEscapement (fontset, &char_wc, 1) ;
}
break;
default:
width = 0;
}
return width;
}
gint
@@ -88,7 +527,162 @@ gdk_string_measure (GdkFont *font,
g_return_val_if_fail (font != NULL, -1);
g_return_val_if_fail (string != NULL, -1);
return gdk_text_measure (font, string, _gdk_font_strlen (font, string));
return gdk_text_measure (font, string, strlen (string));
}
void
gdk_text_extents (GdkFont *font,
const gchar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent)
{
GdkFontPrivate *private;
XCharStruct overall;
XFontStruct *xfont;
XFontSet fontset;
XRectangle ink, logical;
int direction;
int font_ascent;
int font_descent;
g_return_if_fail (font != NULL);
g_return_if_fail (text != NULL);
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
xfont = (XFontStruct *) private->xfont;
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
XTextExtents (xfont, text, text_length,
&direction, &font_ascent, &font_descent,
&overall);
}
else
{
XTextExtents16 (xfont, (XChar2b *) text, text_length / 2,
&direction, &font_ascent, &font_descent,
&overall);
}
if (lbearing)
*lbearing = overall.lbearing;
if (rbearing)
*rbearing = overall.rbearing;
if (width)
*width = overall.width;
if (ascent)
*ascent = overall.ascent;
if (descent)
*descent = overall.descent;
break;
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XmbTextExtents (fontset, text, text_length, &ink, &logical);
if (lbearing)
*lbearing = ink.x;
if (rbearing)
*rbearing = ink.x + ink.width;
if (width)
*width = logical.width;
if (ascent)
*ascent = -ink.y;
if (descent)
*descent = ink.y + ink.height;
break;
}
}
void
gdk_text_extents_wc (GdkFont *font,
const GdkWChar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent)
{
GdkFontPrivate *private;
XCharStruct overall;
XFontStruct *xfont;
XFontSet fontset;
XRectangle ink, logical;
int direction;
int font_ascent;
int font_descent;
g_return_if_fail (font != NULL);
g_return_if_fail (text != NULL);
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
{
gchar *text_8bit;
gint i;
xfont = (XFontStruct *) private->xfont;
g_return_if_fail ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0));
text_8bit = g_new (gchar, text_length);
for (i=0; i<text_length; i++)
text_8bit[i] = text[i];
XTextExtents (xfont, text_8bit, text_length,
&direction, &font_ascent, &font_descent,
&overall);
g_free (text_8bit);
if (lbearing)
*lbearing = overall.lbearing;
if (rbearing)
*rbearing = overall.rbearing;
if (width)
*width = overall.width;
if (ascent)
*ascent = overall.ascent;
if (descent)
*descent = overall.descent;
break;
}
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
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)
*rbearing = ink.x + ink.width;
if (width)
*width = logical.width;
if (ascent)
*ascent = -ink.y;
if (descent)
*descent = ink.y + ink.height;
break;
}
}
void
@@ -103,7 +697,7 @@ gdk_string_extents (GdkFont *font,
g_return_if_fail (font != NULL);
g_return_if_fail (string != NULL);
gdk_text_extents (font, string, _gdk_font_strlen (font, string),
gdk_text_extents (font, string, strlen (string),
lbearing, rbearing, width, ascent, descent);
}
@@ -113,14 +707,50 @@ gdk_text_measure (GdkFont *font,
const gchar *text,
gint text_length)
{
gint rbearing;
GdkFontPrivate *private;
XCharStruct overall;
XFontStruct *xfont;
XFontSet fontset;
XRectangle ink, log;
int direction;
int font_ascent;
int font_descent;
gint width;
g_return_val_if_fail (font != NULL, -1);
g_return_val_if_fail (text != NULL, -1);
gdk_text_extents (font, text, text_length, NULL, &rbearing, NULL, NULL, NULL);
return rbearing;
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
xfont = (XFontStruct *) private->xfont;
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
XTextExtents (xfont, text, text_length,
&direction, &font_ascent, &font_descent,
&overall);
}
else
{
XTextExtents16 (xfont, (XChar2b *) text, text_length / 2,
&direction, &font_ascent, &font_descent,
&overall);
}
width = overall.rbearing;
break;
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XmbTextExtents (fontset, text, text_length, &ink, &log);
width = ink.x + ink.width;
break;
default:
width = 0;
}
return width;
}
gint
gdk_char_measure (GdkFont *font,
gchar character)
@@ -137,7 +767,7 @@ gdk_string_height (GdkFont *font,
g_return_val_if_fail (font != NULL, -1);
g_return_val_if_fail (string != NULL, -1);
return gdk_text_height (font, string, _gdk_font_strlen (font, string));
return gdk_text_height (font, string, strlen (string));
}
gint
@@ -145,13 +775,48 @@ gdk_text_height (GdkFont *font,
const gchar *text,
gint text_length)
{
gint ascent, descent;
GdkFontPrivate *private;
XCharStruct overall;
XFontStruct *xfont;
XFontSet fontset;
XRectangle ink, log;
int direction;
int font_ascent;
int font_descent;
gint height;
g_return_val_if_fail (font != NULL, -1);
g_return_val_if_fail (text != NULL, -1);
gdk_text_extents (font, text, text_length, NULL, NULL, NULL, &ascent, &descent);
return ascent + descent;
private = (GdkFontPrivate*) font;
switch (font->type)
{
case GDK_FONT_FONT:
xfont = (XFontStruct *) private->xfont;
if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
{
XTextExtents (xfont, text, text_length,
&direction, &font_ascent, &font_descent,
&overall);
}
else
{
XTextExtents16 (xfont, (XChar2b *) text, text_length / 2,
&direction, &font_ascent, &font_descent,
&overall);
}
height = overall.ascent + overall.descent;
break;
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XmbTextExtents (fontset, text, text_length, &ink, &log);
height = log.height;
break;
default:
height = 0;
}
return height;
}
gint

View File

@@ -1,103 +0,0 @@
#ifndef __GDK_FONT_H__
#define __GDK_FONT_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Types of font.
* GDK_FONT_FONT: the font is an XFontStruct.
* GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
*/
typedef enum
{
GDK_FONT_FONT,
GDK_FONT_FONTSET
} GdkFontType;
struct _GdkFont
{
GdkFontType type;
gint ascent;
gint descent;
};
#ifdef GDK_WINDOWING_WIN32
/* Temporary functions, will be replaced by something else for all backends
* eventually. Don't use!
*/
gchar** gdk_font_list_new (const gchar *font_pattern, gint *n_returned);
void gdk_font_list_free (gchar **font_list);
#endif
GdkFont* gdk_font_load (const gchar *font_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);
gboolean gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb);
gint gdk_string_width (GdkFont *font,
const gchar *string);
gint gdk_text_width (GdkFont *font,
const gchar *text,
gint text_length);
gint gdk_text_width_wc (GdkFont *font,
const GdkWChar *text,
gint text_length);
gint gdk_char_width (GdkFont *font,
gchar character);
gint gdk_char_width_wc (GdkFont *font,
GdkWChar character);
gint gdk_string_measure (GdkFont *font,
const gchar *string);
gint gdk_text_measure (GdkFont *font,
const gchar *text,
gint text_length);
gint gdk_char_measure (GdkFont *font,
gchar character);
gint gdk_string_height (GdkFont *font,
const gchar *string);
gint gdk_text_height (GdkFont *font,
const gchar *text,
gint text_length);
gint gdk_char_height (GdkFont *font,
gchar character);
void gdk_text_extents (GdkFont *font,
const gchar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent);
void gdk_text_extents_wc (GdkFont *font,
const GdkWChar *text,
gint text_length,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent);
void gdk_string_extents (GdkFont *font,
const gchar *string,
gint *lbearing,
gint *rbearing,
gint *width,
gint *ascent,
gint *descent);
#ifdef GDK_WINDOWING_WIN32
/* Ditto temporary */
gchar* gdk_font_full_name_get (GdkFont *font);
void gdk_font_full_name_free (gchar *name);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_FONT_H__ */

View File

@@ -25,233 +25,603 @@
*/
#include <string.h>
#include "gdkgc.h"
#include <X11/Xlib.h>
#include "gdk.h"
#include "gdkprivate.h"
static void gdk_gc_init (GdkGC *gc);
static void gdk_gc_class_init (GdkGCClass *klass);
static void gdk_gc_finalize (GObject *object);
static gpointer parent_class = NULL;
GType
gdk_gc_get_type (void)
GdkGC*
gdk_gc_new (GdkWindow *window)
{
static GType object_type = 0;
if (!object_type)
{
static const GTypeInfo object_info =
{
sizeof (GdkGCClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gdk_gc_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkGC),
0, /* n_preallocs */
(GInstanceInitFunc) gdk_gc_init,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkGC",
&object_info);
}
return object_type;
}
static void
gdk_gc_init (GdkGC *gc)
{
}
static void
gdk_gc_class_init (GdkGCClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_gc_finalize;
}
static void
gdk_gc_finalize (GObject *object)
{
GdkGC *gc = GDK_GC (object);
G_OBJECT_CLASS (parent_class)->finalize (object);
return gdk_gc_new_with_values (window, NULL, 0);
}
GdkGC*
gdk_gc_new (GdkDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
if (GDK_IS_WINDOW (drawable) && GDK_WINDOW_DESTROYED (drawable))
return NULL;
return gdk_gc_new_with_values (drawable, NULL, 0);
}
GdkGC*
gdk_gc_new_with_values (GdkDrawable *drawable,
gdk_gc_new_with_values (GdkWindow *window,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
GdkWindowPrivate *window_private;
GdkGC *gc;
GdkGCPrivate *private;
Window xwindow;
XGCValues xvalues;
unsigned long xvalues_mask;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (window != NULL, NULL);
if (GDK_IS_WINDOW (drawable) && GDK_WINDOW_DESTROYED (drawable))
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return NULL;
gc = GDK_DRAWABLE_GET_CLASS (drawable)->create_gc (drawable,
values,
values_mask);
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
gc->clip_x_origin = values->clip_x_origin;
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
gc->clip_y_origin = values->clip_y_origin;
private = g_new (GdkGCPrivate, 1);
gc = (GdkGC*) private;
xwindow = window_private->xwindow;
private->xdisplay = window_private->xdisplay;
private->ref_count = 1;
xvalues.function = GXcopy;
xvalues.fill_style = FillSolid;
xvalues.arc_mode = ArcPieSlice;
xvalues.subwindow_mode = ClipByChildren;
xvalues.graphics_exposures = True;
xvalues_mask = GCFunction | GCFillStyle | GCArcMode | GCSubwindowMode | GCGraphicsExposures;
if (values_mask & GDK_GC_FOREGROUND)
{
xvalues.foreground = values->foreground.pixel;
xvalues_mask |= GCForeground;
}
if (values_mask & GDK_GC_BACKGROUND)
{
xvalues.background = values->background.pixel;
xvalues_mask |= GCBackground;
}
if ((values_mask & GDK_GC_FONT) && (values->font->type == GDK_FONT_FONT))
{
xvalues.font = ((XFontStruct *) ((GdkFontPrivate*) values->font)->xfont)->fid;
xvalues_mask |= GCFont;
}
if (values_mask & GDK_GC_FUNCTION)
{
switch (values->function)
{
case GDK_COPY:
xvalues.function = GXcopy;
break;
case GDK_INVERT:
xvalues.function = GXinvert;
break;
case GDK_XOR:
xvalues.function = GXxor;
break;
case GDK_CLEAR:
xvalues.function = GXclear;
break;
case GDK_AND:
xvalues.function = GXand;
break;
case GDK_AND_REVERSE:
xvalues.function = GXandReverse;
break;
case GDK_AND_INVERT:
xvalues.function = GXandInverted;
break;
case GDK_NOOP:
xvalues.function = GXnoop;
break;
case GDK_OR:
xvalues.function = GXor;
break;
case GDK_EQUIV:
xvalues.function = GXequiv;
break;
case GDK_OR_REVERSE:
xvalues.function = GXorReverse;
break;
case GDK_COPY_INVERT:
xvalues.function = GXcopyInverted;
break;
case GDK_OR_INVERT:
xvalues.function = GXorInverted;
break;
case GDK_NAND:
xvalues.function = GXnand;
break;
case GDK_SET:
xvalues.function = GXset;
break;
}
xvalues_mask |= GCFunction;
}
if (values_mask & GDK_GC_FILL)
{
switch (values->fill)
{
case GDK_SOLID:
xvalues.fill_style = FillSolid;
break;
case GDK_TILED:
xvalues.fill_style = FillTiled;
break;
case GDK_STIPPLED:
xvalues.fill_style = FillStippled;
break;
case GDK_OPAQUE_STIPPLED:
xvalues.fill_style = FillOpaqueStippled;
break;
}
xvalues_mask |= GCFillStyle;
}
if (values_mask & GDK_GC_TILE)
{
xvalues.tile = ((GdkPixmapPrivate*) values->tile)->xwindow;
xvalues_mask |= GCTile;
}
if (values_mask & GDK_GC_STIPPLE)
{
xvalues.stipple = ((GdkPixmapPrivate*) values->stipple)->xwindow;
xvalues_mask |= GCStipple;
}
if (values_mask & GDK_GC_CLIP_MASK)
{
xvalues.clip_mask = ((GdkPixmapPrivate*) values->clip_mask)->xwindow;
xvalues_mask |= GCClipMask;
}
if (values_mask & GDK_GC_SUBWINDOW)
{
xvalues.subwindow_mode = values->subwindow_mode;
xvalues_mask |= GCSubwindowMode;
}
if (values_mask & GDK_GC_TS_X_ORIGIN)
gc->ts_x_origin = values->ts_x_origin;
{
xvalues.ts_x_origin = values->ts_x_origin;
xvalues_mask |= GCTileStipXOrigin;
}
if (values_mask & GDK_GC_TS_Y_ORIGIN)
gc->ts_y_origin = values->ts_y_origin;
{
xvalues.ts_y_origin = values->ts_y_origin;
xvalues_mask |= GCTileStipYOrigin;
}
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
{
xvalues.clip_x_origin = values->clip_x_origin;
xvalues_mask |= GCClipXOrigin;
}
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
{
xvalues.clip_y_origin = values->clip_y_origin;
xvalues_mask |= GCClipYOrigin;
}
if (values_mask & GDK_GC_EXPOSURES)
xvalues.graphics_exposures = values->graphics_exposures;
else
xvalues.graphics_exposures = False;
xvalues_mask |= GCGraphicsExposures;
if (values_mask & GDK_GC_LINE_WIDTH)
{
xvalues.line_width = values->line_width;
xvalues_mask |= GCLineWidth;
}
if (values_mask & GDK_GC_LINE_STYLE)
{
switch (values->line_style)
{
case GDK_LINE_SOLID:
xvalues.line_style = LineSolid;
break;
case GDK_LINE_ON_OFF_DASH:
xvalues.line_style = LineOnOffDash;
break;
case GDK_LINE_DOUBLE_DASH:
xvalues.line_style = LineDoubleDash;
break;
}
xvalues_mask |= GCLineStyle;
}
if (values_mask & GDK_GC_CAP_STYLE)
{
switch (values->cap_style)
{
case GDK_CAP_NOT_LAST:
xvalues.cap_style = CapNotLast;
break;
case GDK_CAP_BUTT:
xvalues.cap_style = CapButt;
break;
case GDK_CAP_ROUND:
xvalues.cap_style = CapRound;
break;
case GDK_CAP_PROJECTING:
xvalues.cap_style = CapProjecting;
break;
}
xvalues_mask |= GCCapStyle;
}
if (values_mask & GDK_GC_JOIN_STYLE)
{
switch (values->join_style)
{
case GDK_JOIN_MITER:
xvalues.join_style = JoinMiter;
break;
case GDK_JOIN_ROUND:
xvalues.join_style = JoinRound;
break;
case GDK_JOIN_BEVEL:
xvalues.join_style = JoinBevel;
break;
}
xvalues_mask |= GCJoinStyle;
}
private->xgc = XCreateGC (private->xdisplay, xwindow, xvalues_mask, &xvalues);
return gc;
}
void
gdk_gc_destroy (GdkGC *gc)
{
gdk_gc_unref (gc);
}
GdkGC *
gdk_gc_ref (GdkGC *gc)
{
return (GdkGC *) g_object_ref (G_OBJECT (gc));
GdkGCPrivate *private = (GdkGCPrivate*) gc;
g_return_val_if_fail (gc != NULL, NULL);
private->ref_count += 1;
return gc;
}
void
gdk_gc_unref (GdkGC *gc)
{
g_object_unref (G_OBJECT (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;
else
{
XFreeGC (private->xdisplay, private->xgc);
memset (gc, 0, sizeof (GdkGCPrivate));
g_free (gc);
}
}
void
gdk_gc_get_values (GdkGC *gc,
GdkGCValues *values)
{
g_return_if_fail (GDK_IS_GC (gc));
GdkGCPrivate *private;
XGCValues xvalues;
g_return_if_fail (gc != NULL);
g_return_if_fail (values != NULL);
GDK_GC_GET_CLASS (gc)->get_values (gc, values);
}
private = (GdkGCPrivate*) gc;
void
gdk_gc_set_values (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask values_mask)
{
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (values != NULL);
if (XGetGCValues (private->xdisplay, private->xgc,
GCForeground | GCBackground | GCFont |
GCFunction | GCTile | GCStipple | /* GCClipMask | */
GCSubwindowMode | GCGraphicsExposures |
GCTileStipXOrigin | GCTileStipYOrigin |
GCClipXOrigin | GCClipYOrigin |
GCLineWidth | GCLineStyle | GCCapStyle |
GCFillStyle | GCJoinStyle, &xvalues))
{
values->foreground.pixel = xvalues.foreground;
values->background.pixel = xvalues.background;
values->font = gdk_font_lookup (xvalues.font);
if (values_mask & GDK_GC_CLIP_X_ORIGIN)
gc->clip_x_origin = values->clip_x_origin;
if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
gc->clip_y_origin = values->clip_y_origin;
if (values_mask & GDK_GC_TS_X_ORIGIN)
gc->ts_x_origin = values->ts_x_origin;
if (values_mask & GDK_GC_TS_Y_ORIGIN)
gc->ts_y_origin = values->ts_y_origin;
GDK_GC_GET_CLASS (gc)->set_values (gc, values, values_mask);
switch (xvalues.function)
{
case GXcopy:
values->function = GDK_COPY;
break;
case GXinvert:
values->function = GDK_INVERT;
break;
case GXxor:
values->function = GDK_XOR;
break;
case GXclear:
values->function = GDK_CLEAR;
break;
case GXand:
values->function = GDK_AND;
break;
case GXandReverse:
values->function = GDK_AND_REVERSE;
break;
case GXandInverted:
values->function = GDK_AND_INVERT;
break;
case GXnoop:
values->function = GDK_NOOP;
break;
case GXor:
values->function = GDK_OR;
break;
case GXequiv:
values->function = GDK_EQUIV;
break;
case GXorReverse:
values->function = GDK_OR_REVERSE;
break;
case GXcopyInverted:
values->function =GDK_COPY_INVERT;
break;
case GXorInverted:
values->function = GDK_OR_INVERT;
break;
case GXnand:
values->function = GDK_NAND;
break;
case GXset:
values->function = GDK_SET;
break;
}
switch (xvalues.fill_style)
{
case FillSolid:
values->fill = GDK_SOLID;
break;
case FillTiled:
values->fill = GDK_TILED;
break;
case FillStippled:
values->fill = GDK_STIPPLED;
break;
case FillOpaqueStippled:
values->fill = GDK_OPAQUE_STIPPLED;
break;
}
values->tile = gdk_pixmap_lookup (xvalues.tile);
values->stipple = gdk_pixmap_lookup (xvalues.stipple);
values->clip_mask = NULL;
values->subwindow_mode = xvalues.subwindow_mode;
values->ts_x_origin = xvalues.ts_x_origin;
values->ts_y_origin = xvalues.ts_y_origin;
values->clip_x_origin = xvalues.clip_x_origin;
values->clip_y_origin = xvalues.clip_y_origin;
values->graphics_exposures = xvalues.graphics_exposures;
values->line_width = xvalues.line_width;
switch (xvalues.line_style)
{
case LineSolid:
values->line_style = GDK_LINE_SOLID;
break;
case LineOnOffDash:
values->line_style = GDK_LINE_ON_OFF_DASH;
break;
case LineDoubleDash:
values->line_style = GDK_LINE_DOUBLE_DASH;
break;
}
switch (xvalues.cap_style)
{
case CapNotLast:
values->cap_style = GDK_CAP_NOT_LAST;
break;
case CapButt:
values->cap_style = GDK_CAP_BUTT;
break;
case CapRound:
values->cap_style = GDK_CAP_ROUND;
break;
case CapProjecting:
values->cap_style = GDK_CAP_PROJECTING;
break;
}
switch (xvalues.join_style)
{
case JoinMiter:
values->join_style = GDK_JOIN_MITER;
break;
case JoinRound:
values->join_style = GDK_JOIN_ROUND;
break;
case JoinBevel:
values->join_style = GDK_JOIN_BEVEL;
break;
}
}
else
{
memset (values, 0, sizeof (GdkGCValues));
}
}
void
gdk_gc_set_foreground (GdkGC *gc,
GdkColor *color)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (color != NULL);
values.foreground = *color;
gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
private = (GdkGCPrivate*) gc;
XSetForeground (private->xdisplay, private->xgc, color->pixel);
}
void
gdk_gc_set_background (GdkGC *gc,
GdkColor *color)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (color != NULL);
values.background = *color;
gdk_gc_set_values (gc, &values, GDK_GC_BACKGROUND);
private = (GdkGCPrivate*) gc;
XSetBackground (private->xdisplay, private->xgc, color->pixel);
}
void
gdk_gc_set_font (GdkGC *gc,
GdkFont *font)
{
GdkGCValues values;
GdkGCPrivate *gc_private;
GdkFontPrivate *font_private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
g_return_if_fail (font != NULL);
values.font = font;
gdk_gc_set_values (gc, &values, GDK_GC_FONT);
if (font->type == GDK_FONT_FONT)
{
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
XSetFont (gc_private->xdisplay, gc_private->xgc,
((XFontStruct *) font_private->xfont)->fid);
}
}
void
gdk_gc_set_function (GdkGC *gc,
GdkFunction function)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.function = function;
gdk_gc_set_values (gc, &values, GDK_GC_FUNCTION);
private = (GdkGCPrivate*) gc;
switch (function)
{
case GDK_COPY:
XSetFunction (private->xdisplay, private->xgc, GXcopy);
break;
case GDK_INVERT:
XSetFunction (private->xdisplay, private->xgc, GXinvert);
break;
case GDK_XOR:
XSetFunction (private->xdisplay, private->xgc, GXxor);
break;
case GDK_CLEAR:
XSetFunction (private->xdisplay, private->xgc, GXclear);
break;
case GDK_AND:
XSetFunction (private->xdisplay, private->xgc, GXand);
break;
case GDK_AND_REVERSE:
XSetFunction (private->xdisplay, private->xgc, GXandReverse);
break;
case GDK_AND_INVERT:
XSetFunction (private->xdisplay, private->xgc, GXandInverted);
break;
case GDK_NOOP:
XSetFunction (private->xdisplay, private->xgc, GXnoop);
break;
case GDK_OR:
XSetFunction (private->xdisplay, private->xgc, GXor);
break;
case GDK_EQUIV:
XSetFunction (private->xdisplay, private->xgc, GXequiv);
break;
case GDK_OR_REVERSE:
XSetFunction (private->xdisplay, private->xgc, GXorReverse);
break;
case GDK_COPY_INVERT:
XSetFunction (private->xdisplay, private->xgc, GXcopyInverted);
break;
case GDK_OR_INVERT:
XSetFunction (private->xdisplay, private->xgc, GXorInverted);
break;
case GDK_NAND:
XSetFunction (private->xdisplay, private->xgc, GXnand);
break;
case GDK_SET:
XSetFunction (private->xdisplay, private->xgc, GXset);
break;
}
}
void
gdk_gc_set_fill (GdkGC *gc,
GdkFill fill)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.fill = fill;
gdk_gc_set_values (gc, &values, GDK_GC_FILL);
private = (GdkGCPrivate*) gc;
switch (fill)
{
case GDK_SOLID:
XSetFillStyle (private->xdisplay, private->xgc, FillSolid);
break;
case GDK_TILED:
XSetFillStyle (private->xdisplay, private->xgc, FillTiled);
break;
case GDK_STIPPLED:
XSetFillStyle (private->xdisplay, private->xgc, FillStippled);
break;
case GDK_OPAQUE_STIPPLED:
XSetFillStyle (private->xdisplay, private->xgc, FillOpaqueStippled);
break;
}
}
void
gdk_gc_set_tile (GdkGC *gc,
GdkPixmap *tile)
{
GdkGCValues values;
GdkGCPrivate *private;
GdkPixmapPrivate *pixmap_private;
Pixmap pixmap;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.tile = tile;
gdk_gc_set_values (gc, &values, GDK_GC_TILE);
private = (GdkGCPrivate*) gc;
pixmap = None;
if (tile)
{
pixmap_private = (GdkPixmapPrivate*) tile;
pixmap = pixmap_private->xwindow;
}
XSetTile (private->xdisplay, private->xgc, pixmap);
}
void
gdk_gc_set_stipple (GdkGC *gc,
GdkPixmap *stipple)
{
GdkGCValues values;
GdkGCPrivate *private;
GdkPixmapPrivate *pixmap_private;
Pixmap pixmap;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.stipple = stipple;
gdk_gc_set_values (gc, &values, GDK_GC_STIPPLE);
private = (GdkGCPrivate*) gc;
pixmap = None;
if (stipple)
{
pixmap_private = (GdkPixmapPrivate*) stipple;
pixmap = pixmap_private->xwindow;
}
XSetStipple (private->xdisplay, private->xgc, pixmap);
}
void
@@ -259,15 +629,13 @@ gdk_gc_set_ts_origin (GdkGC *gc,
gint x,
gint y)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.ts_x_origin = x;
values.ts_y_origin = y;
gdk_gc_set_values (gc, &values,
GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN);
private = (GdkGCPrivate*) gc;
XSetTSOrigin (private->xdisplay, private->xgc, x, y);
}
void
@@ -275,52 +643,112 @@ gdk_gc_set_clip_origin (GdkGC *gc,
gint x,
gint y)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.clip_x_origin = x;
values.clip_y_origin = y;
gdk_gc_set_values (gc, &values,
GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
private = (GdkGCPrivate*) gc;
XSetClipOrigin (private->xdisplay, private->xgc, x, y);
}
void
gdk_gc_set_clip_mask (GdkGC *gc,
GdkBitmap *mask)
{
GdkGCValues values;
GdkGCPrivate *private;
Pixmap xmask;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.clip_mask = mask;
gdk_gc_set_values (gc, &values, GDK_GC_CLIP_MASK);
if (mask)
{
GdkWindowPrivate *mask_private;
mask_private = (GdkWindowPrivate*) mask;
if (mask_private->destroyed)
return;
xmask = mask_private->xwindow;
}
else
xmask = None;
private = (GdkGCPrivate*) gc;
XSetClipMask (private->xdisplay, private->xgc, xmask);
}
void
gdk_gc_set_clip_rectangle (GdkGC *gc,
GdkRectangle *rectangle)
{
GdkGCPrivate *private;
XRectangle xrectangle;
g_return_if_fail (gc != NULL);
private = (GdkGCPrivate*) gc;
if (rectangle)
{
xrectangle.x = rectangle->x;
xrectangle.y = rectangle->y;
xrectangle.width = rectangle->width;
xrectangle.height = rectangle->height;
XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
&xrectangle, 1, Unsorted);
}
else
XSetClipMask (private->xdisplay, private->xgc, None);
}
void
gdk_gc_set_clip_region (GdkGC *gc,
GdkRegion *region)
{
GdkGCPrivate *private;
g_return_if_fail (gc != NULL);
private = (GdkGCPrivate*) gc;
if (region)
{
GdkRegionPrivate *region_private;
region_private = (GdkRegionPrivate*) region;
XSetRegion (private->xdisplay, private->xgc, region_private->xregion);
}
else
XSetClipMask (private->xdisplay, private->xgc, None);
}
void
gdk_gc_set_subwindow (GdkGC *gc,
GdkSubwindowMode mode)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.subwindow_mode = mode;
gdk_gc_set_values (gc, &values, GDK_GC_SUBWINDOW);
private = (GdkGCPrivate*) gc;
XSetSubwindowMode (private->xdisplay, private->xgc, mode);
}
void
gdk_gc_set_exposures (GdkGC *gc,
gboolean exposures)
{
GdkGCValues values;
GdkGCPrivate *private;
g_return_if_fail (GDK_IS_GC (gc));
g_return_if_fail (gc != NULL);
values.graphics_exposures = exposures;
gdk_gc_set_values (gc, &values, GDK_GC_EXPOSURES);
private = (GdkGCPrivate*) gc;
XSetGraphicsExposures (private->xdisplay, private->xgc, exposures);
}
void
@@ -330,28 +758,91 @@ gdk_gc_set_line_attributes (GdkGC *gc,
GdkCapStyle cap_style,
GdkJoinStyle join_style)
{
GdkGCValues values;
GdkGCPrivate *private;
int xline_style;
int xcap_style;
int xjoin_style;
values.line_width = line_width;
values.line_style = line_style;
values.cap_style = cap_style;
values.join_style = join_style;
g_return_if_fail (gc != NULL);
gdk_gc_set_values (gc, &values,
GDK_GC_LINE_WIDTH |
GDK_GC_LINE_STYLE |
GDK_GC_CAP_STYLE |
GDK_GC_JOIN_STYLE);
private = (GdkGCPrivate*) gc;
switch (line_style)
{
case GDK_LINE_SOLID:
xline_style = LineSolid;
break;
case GDK_LINE_ON_OFF_DASH:
xline_style = LineOnOffDash;
break;
case GDK_LINE_DOUBLE_DASH:
xline_style = LineDoubleDash;
break;
default:
xline_style = None;
}
switch (cap_style)
{
case GDK_CAP_NOT_LAST:
xcap_style = CapNotLast;
break;
case GDK_CAP_BUTT:
xcap_style = CapButt;
break;
case GDK_CAP_ROUND:
xcap_style = CapRound;
break;
case GDK_CAP_PROJECTING:
xcap_style = CapProjecting;
break;
default:
xcap_style = None;
}
switch (join_style)
{
case GDK_JOIN_MITER:
xjoin_style = JoinMiter;
break;
case GDK_JOIN_ROUND:
xjoin_style = JoinRound;
break;
case GDK_JOIN_BEVEL:
xjoin_style = JoinBevel;
break;
default:
xjoin_style = None;
}
XSetLineAttributes (private->xdisplay, private->xgc, line_width,
xline_style, xcap_style, xjoin_style);
}
void
gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gint n)
gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gint n)
{
g_return_if_fail (GDK_IS_GC (gc));
GdkGCPrivate *private;
g_return_if_fail (gc != NULL);
g_return_if_fail (dash_list != NULL);
GDK_GC_GET_CLASS (gc)->set_dashes (gc, dash_offset, dash_list, n);
private = (GdkGCPrivate*) gc;
XSetDashes (private->xdisplay, private->xgc, dash_offset, dash_list, n);
}
void
gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
{
GdkGCPrivate *dst_private, *src_private;
src_private = (GdkGCPrivate *) src_gc;
dst_private = (GdkGCPrivate *) dst_gc;
XCopyGC (src_private->xdisplay, src_private->xgc, ~((~1) << GCLastBit),
dst_private->xgc);
}

View File

@@ -1,244 +0,0 @@
#ifndef __GDK_GC_H__
#define __GDK_GC_H__
#include <gdk/gdkcolor.h>
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkGCValues GdkGCValues;
typedef struct _GdkGCClass GdkGCClass;
/* GC cap styles
* CapNotLast:
* CapButt:
* CapRound:
* CapProjecting:
*/
typedef enum
{
GDK_CAP_NOT_LAST,
GDK_CAP_BUTT,
GDK_CAP_ROUND,
GDK_CAP_PROJECTING
} GdkCapStyle;
/* GC fill types.
* Solid:
* Tiled:
* Stippled:
* OpaqueStippled:
*/
typedef enum
{
GDK_SOLID,
GDK_TILED,
GDK_STIPPLED,
GDK_OPAQUE_STIPPLED
} GdkFill;
/* GC function types.
* Copy: Overwrites destination pixels with the source pixels.
* Invert: Inverts the destination pixels.
* Xor: Xor's the destination pixels with the source pixels.
* Clear: set pixels to 0
* And: source AND destination
* And Reverse: source AND (NOT destination)
* And Invert: (NOT source) AND destination
* Noop: destination
* Or: source OR destination
* Nor: (NOT source) AND (NOT destination)
* Equiv: (NOT source) XOR destination
* Xor Reverse: source OR (NOT destination)
* Copy Inverted: NOT source
* Xor Inverted: (NOT source) OR destination
* Nand: (NOT source) OR (NOT destination)
* Set: set pixels to 1
*/
typedef enum
{
GDK_COPY,
GDK_INVERT,
GDK_XOR,
GDK_CLEAR,
GDK_AND,
GDK_AND_REVERSE,
GDK_AND_INVERT,
GDK_NOOP,
GDK_OR,
GDK_EQUIV,
GDK_OR_REVERSE,
GDK_COPY_INVERT,
GDK_OR_INVERT,
GDK_NAND,
GDK_SET
} GdkFunction;
/* GC join styles
* JoinMiter:
* JoinRound:
* JoinBevel:
*/
typedef enum
{
GDK_JOIN_MITER,
GDK_JOIN_ROUND,
GDK_JOIN_BEVEL
} GdkJoinStyle;
/* GC line styles
* Solid:
* OnOffDash:
* DoubleDash:
*/
typedef enum
{
GDK_LINE_SOLID,
GDK_LINE_ON_OFF_DASH,
GDK_LINE_DOUBLE_DASH
} GdkLineStyle;
typedef enum
{
GDK_CLIP_BY_CHILDREN = 0,
GDK_INCLUDE_INFERIORS = 1
} GdkSubwindowMode;
typedef enum
{
GDK_GC_FOREGROUND = 1 << 0,
GDK_GC_BACKGROUND = 1 << 1,
GDK_GC_FONT = 1 << 2,
GDK_GC_FUNCTION = 1 << 3,
GDK_GC_FILL = 1 << 4,
GDK_GC_TILE = 1 << 5,
GDK_GC_STIPPLE = 1 << 6,
GDK_GC_CLIP_MASK = 1 << 7,
GDK_GC_SUBWINDOW = 1 << 8,
GDK_GC_TS_X_ORIGIN = 1 << 9,
GDK_GC_TS_Y_ORIGIN = 1 << 10,
GDK_GC_CLIP_X_ORIGIN = 1 << 11,
GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
GDK_GC_EXPOSURES = 1 << 13,
GDK_GC_LINE_WIDTH = 1 << 14,
GDK_GC_LINE_STYLE = 1 << 15,
GDK_GC_CAP_STYLE = 1 << 16,
GDK_GC_JOIN_STYLE = 1 << 17
} GdkGCValuesMask;
struct _GdkGCValues
{
GdkColor foreground;
GdkColor background;
GdkFont *font;
GdkFunction function;
GdkFill fill;
GdkPixmap *tile;
GdkPixmap *stipple;
GdkPixmap *clip_mask;
GdkSubwindowMode subwindow_mode;
gint ts_x_origin;
gint ts_y_origin;
gint clip_x_origin;
gint clip_y_origin;
gint graphics_exposures;
gint line_width;
GdkLineStyle line_style;
GdkCapStyle cap_style;
GdkJoinStyle join_style;
};
#define GDK_TYPE_GC (gdk_gc_get_type ())
#define GDK_GC(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC))
#define GDK_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass))
#define GDK_IS_GC(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC))
#define GDK_IS_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC))
#define GDK_GC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass))
struct _GdkGC
{
GObject parent_instance;
gint clip_x_origin;
gint clip_y_origin;
gint ts_x_origin;
gint ts_y_origin;
};
struct _GdkGCClass
{
GObjectClass parent_class;
void (*get_values) (GdkGC *gc,
GdkGCValues *values);
void (*set_values) (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask mask);
void (*set_dashes) (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gint n);
};
GType gdk_gc_get_type (void);
GdkGC *gdk_gc_new (GdkDrawable *drawable);
GdkGC *gdk_gc_new_with_values (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask values_mask);
GdkGC *gdk_gc_ref (GdkGC *gc);
void gdk_gc_unref (GdkGC *gc);
void gdk_gc_get_values (GdkGC *gc,
GdkGCValues *values);
void gdk_gc_set_values (GdkGC *gc,
GdkGCValues *values,
GdkGCValuesMask values_mask);
void gdk_gc_set_foreground (GdkGC *gc,
GdkColor *color);
void gdk_gc_set_background (GdkGC *gc,
GdkColor *color);
void gdk_gc_set_font (GdkGC *gc,
GdkFont *font);
void gdk_gc_set_function (GdkGC *gc,
GdkFunction function);
void gdk_gc_set_fill (GdkGC *gc,
GdkFill fill);
void gdk_gc_set_tile (GdkGC *gc,
GdkPixmap *tile);
void gdk_gc_set_stipple (GdkGC *gc,
GdkPixmap *stipple);
void gdk_gc_set_ts_origin (GdkGC *gc,
gint x,
gint y);
void gdk_gc_set_clip_origin (GdkGC *gc,
gint x,
gint y);
void gdk_gc_set_clip_mask (GdkGC *gc,
GdkBitmap *mask);
void gdk_gc_set_clip_rectangle (GdkGC *gc,
GdkRectangle *rectangle);
void gdk_gc_set_clip_region (GdkGC *gc,
GdkRegion *region);
void gdk_gc_set_subwindow (GdkGC *gc,
GdkSubwindowMode mode);
void gdk_gc_set_exposures (GdkGC *gc,
gboolean exposures);
void gdk_gc_set_line_attributes (GdkGC *gc,
gint line_width,
GdkLineStyle line_style,
GdkCapStyle cap_style,
GdkJoinStyle join_style);
void gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gint8 dash_list[],
gint n);
void gdk_gc_copy (GdkGC *dst_gc,
GdkGC *src_gc);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_DRAWABLE_H__ */

View File

@@ -25,17 +25,57 @@
*/
#include <stdio.h>
#include <X11/Xlib.h>
#include "gdktypes.h"
#include "gdkprivate.h"
#include "config.h"
guint gdk_debug_flags = 0;
GdkWindow *gdk_parent_root = NULL;
gint gdk_use_xshm = TRUE;
gchar *gdk_display_name = NULL;
Display *gdk_display = NULL;
gint gdk_screen;
Window gdk_root_window;
Window gdk_leader_window;
GdkWindowPrivate gdk_root_parent = { { NULL, }, NULL, };
Atom gdk_wm_delete_window;
Atom gdk_wm_take_focus;
Atom gdk_wm_protocols;
Atom gdk_wm_window_protocols[2];
Atom gdk_selection_property;
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
{0,0}, {0,0}, NULL};
GdkDndGlobals gdk_dnd = {None,None,None,
None,None,None,
None,
&gdk_dnd_cursorinfo,
NULL,
0,
FALSE, FALSE, FALSE,
None,
{0,0},
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
gchar *gdk_progclass = NULL;
gint gdk_error_code = 0;
gint gdk_error_warnings = TRUE;
gint gdk_null_window_warnings = TRUE;
GList *gdk_default_filters = NULL;
GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
GList *gdk_queued_events = NULL;
GList *gdk_queued_tail = NULL;
gboolean gdk_xim_using; /* using XIM Protocol if TRUE */
#ifdef USE_XIM
GdkICPrivate *gdk_xim_ic; /* currently using IC */
#endif /* USE_XIM */
GdkWindow *gdk_xim_window; /* currently using Widow */
GdkWindowPrivate *gdk_xgrab_window = NULL; /* Window that currently holds the
* x pointer grab
*/
GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
#ifdef USE_XIM
GdkICPrivate *gdk_xim_ic; /* currently using IC */
GdkWindow *gdk_xim_window; /* currently using Window */
#endif

View File

@@ -30,17 +30,16 @@
/* GDK uses "glib". (And so does GTK).
*/
#include <glib.h>
#include <gdkconfig.h>
/* international string support */
#include <stdlib.h>
#if !defined(GDK_HAVE_BROKEN_WCTYPE) && (defined(GDK_HAVE_WCTYPE_H) || defined(GDK_HAVE_WCHAR_H)) && !defined(X_LOCALE)
# ifdef GDK_HAVE_WCTYPE_H
#if !defined(G_HAVE_BROKEN_WCTYPE) && (defined(G_HAVE_WCTYPE_H) || defined(G_HAVE_WCHAR_H)) && !defined(X_LOCALE)
# ifdef G_HAVE_WCTYPE_H
# include <wctype.h>
# else
# ifdef GDK_HAVE_WCHAR_H
# ifdef G_HAVE_WCHAR_H
# include <wchar.h>
# endif
# endif

View File

@@ -25,13 +25,10 @@
*/
#include <X11/Xlocale.h>
#include "gdk.h" /* For gdk_flush() */
#include "gdkim.h"
#include "gdkpixmap.h"
#include "gdk.h"
#include "gdkprivate.h"
#include "gdki18n.h"
#include "gdkinternals.h"
#include "gdkprivate-x11.h"
#include "gdkx.h"
#if HAVE_CONFIG_H
# include <config.h>
@@ -625,7 +622,7 @@ gdk_ic_new (GdkICAttr *attr, GdkICAttributesType mask)
}
if (attr->client_window == NULL ||
GDK_WINDOW_DESTROYED (attr->client_window))
((GdkWindowPrivate *)attr->client_window)->destroyed)
{
g_warning ("Client_window is null or already destroyed.\n");
return NULL;
@@ -1084,7 +1081,7 @@ gdk_ic_set_attr (GdkIC *ic,
if (mask & GDK_IC_PREEDIT_PIXMAP)
{
if (attr->preedit_pixmap != NULL &&
GDK_WINDOW_DESTROYED (attr->preedit_pixmap))
((GdkPixmapPrivate *)attr->preedit_pixmap)->destroyed)
{
g_warning ("Preedit pixmap is already destroyed.\n");
error |= GDK_IC_PREEDIT_PIXMAP;
@@ -1171,7 +1168,7 @@ gdk_ic_set_attr (GdkIC *ic,
if (mask & GDK_IC_STATUS_PIXMAP)
{
if (attr->status_pixmap != NULL &&
GDK_WINDOW_DESTROYED (attr->status_pixmap))
((GdkPixmapPrivate *)attr->status_pixmap)->destroyed)
{
g_warning ("Preedit pixmap is already destroyed.\n");
error |= GDK_IC_STATUS_PIXMAP;
@@ -1591,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

@@ -1,126 +0,0 @@
/* International Input Method Support Functions
*/
#ifndef __GDK_IM_H__
#define __GDK_IM_H__
#include <gdk/gdkcolor.h>
#include <gdk/gdkevents.h>
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkIC GdkIC;
typedef struct _GdkICAttr GdkICAttr;
typedef enum /*< flags >*/
{
GDK_IM_PREEDIT_AREA = 0x0001,
GDK_IM_PREEDIT_CALLBACKS = 0x0002,
GDK_IM_PREEDIT_POSITION = 0x0004,
GDK_IM_PREEDIT_NOTHING = 0x0008,
GDK_IM_PREEDIT_NONE = 0x0010,
GDK_IM_PREEDIT_MASK = 0x001f,
GDK_IM_STATUS_AREA = 0x0100,
GDK_IM_STATUS_CALLBACKS = 0x0200,
GDK_IM_STATUS_NOTHING = 0x0400,
GDK_IM_STATUS_NONE = 0x0800,
GDK_IM_STATUS_MASK = 0x0f00
} GdkIMStyle;
typedef enum
{
GDK_IC_STYLE = 1 << 0,
GDK_IC_CLIENT_WINDOW = 1 << 1,
GDK_IC_FOCUS_WINDOW = 1 << 2,
GDK_IC_FILTER_EVENTS = 1 << 3,
GDK_IC_SPOT_LOCATION = 1 << 4,
GDK_IC_LINE_SPACING = 1 << 5,
GDK_IC_CURSOR = 1 << 6,
GDK_IC_PREEDIT_FONTSET = 1 << 10,
GDK_IC_PREEDIT_AREA = 1 << 11,
GDK_IC_PREEDIT_AREA_NEEDED = 1 << 12,
GDK_IC_PREEDIT_FOREGROUND = 1 << 13,
GDK_IC_PREEDIT_BACKGROUND = 1 << 14,
GDK_IC_PREEDIT_PIXMAP = 1 << 15,
GDK_IC_PREEDIT_COLORMAP = 1 << 16,
GDK_IC_STATUS_FONTSET = 1 << 21,
GDK_IC_STATUS_AREA = 1 << 22,
GDK_IC_STATUS_AREA_NEEDED = 1 << 23,
GDK_IC_STATUS_FOREGROUND = 1 << 24,
GDK_IC_STATUS_BACKGROUND = 1 << 25,
GDK_IC_STATUS_PIXMAP = 1 << 26,
GDK_IC_STATUS_COLORMAP = 1 << 27,
GDK_IC_ALL_REQ = GDK_IC_STYLE |
GDK_IC_CLIENT_WINDOW,
GDK_IC_PREEDIT_AREA_REQ = GDK_IC_PREEDIT_AREA |
GDK_IC_PREEDIT_FONTSET,
GDK_IC_PREEDIT_POSITION_REQ = GDK_IC_PREEDIT_AREA | GDK_IC_SPOT_LOCATION |
GDK_IC_PREEDIT_FONTSET,
GDK_IC_STATUS_AREA_REQ = GDK_IC_STATUS_AREA |
GDK_IC_STATUS_FONTSET
} GdkICAttributesType;
struct _GdkICAttr
{
GdkIMStyle style;
GdkWindow *client_window;
GdkWindow *focus_window;
GdkEventMask filter_events;
GdkPoint spot_location;
gint line_spacing;
GdkCursor *cursor;
GdkFont *preedit_fontset;
GdkRectangle preedit_area;
GdkRectangle preedit_area_needed;
GdkColor preedit_foreground;
GdkColor preedit_background;
GdkPixmap *preedit_pixmap;
GdkColormap *preedit_colormap;
GdkFont *status_fontset;
GdkRectangle status_area;
GdkRectangle status_area_needed;
GdkColor status_foreground;
GdkColor status_background;
GdkPixmap *status_pixmap;
GdkColormap *status_colormap;
};
gboolean gdk_im_ready (void);
void gdk_im_begin (GdkIC *ic,
GdkWindow *window);
void gdk_im_end (void);
GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style);
GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style);
GdkIC* gdk_ic_new (GdkICAttr *attr,
GdkICAttributesType mask);
void gdk_ic_destroy (GdkIC *ic);
GdkIMStyle gdk_ic_get_style (GdkIC *ic);
GdkEventMask gdk_ic_get_events (GdkIC *ic);
GdkICAttr* gdk_ic_attr_new (void);
void gdk_ic_attr_destroy (GdkICAttr *attr);
GdkICAttributesType gdk_ic_set_attr (GdkIC *ic,
GdkICAttr *attr,
GdkICAttributesType mask);
GdkICAttributesType gdk_ic_get_attr (GdkIC *ic,
GdkICAttr *attr,
GdkICAttributesType mask);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_IM_H__ */

View File

@@ -24,22 +24,482 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include <config.h>
/* gcc -ansi -pedantic on GNU/Linux causes warnings and errors
* unless this is defined:
* warning: #warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
*/
#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 1
#endif
#include <stdlib.h>
#include <sys/types.h>
#include "gdkimage.h"
#if defined (HAVE_IPC_H) && defined (HAVE_SHM_H) && defined (HAVE_XSHM_H)
#define USE_SHM
#endif
#ifdef USE_SHM
#include <sys/ipc.h>
#include <sys/shm.h>
#endif /* USE_SHM */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef USE_SHM
#include <X11/extensions/XShm.h>
#endif /* USE_SHM */
#include "gdk.h"
#include "gdkprivate.h"
GdkImage *
gdk_image_ref (GdkImage *image)
static void gdk_image_put_normal (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static void gdk_image_put_shared (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
static GList *image_list = NULL;
void
gdk_image_exit (void)
{
return (GdkImage *) g_object_ref (G_OBJECT (image));
GdkImage *image;
while (image_list)
{
image = image_list->data;
gdk_image_destroy (image);
}
}
GdkImage *
gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h)
/*
* Desc: create a new bitmap image
*/
{
Visual *xvisual;
GdkImage *image;
GdkImagePrivate *private;
private = g_new(GdkImagePrivate, 1);
image = (GdkImage *) private;
private->xdisplay = gdk_display;
private->image_put = gdk_image_put_normal;
image->type = GDK_IMAGE_NORMAL;
image->visual = visual;
image->width = w;
image->height = h;
image->depth = 1;
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
private->ximage = XCreateImage(private->xdisplay, xvisual, 1, XYBitmap,
0, 0, w ,h, 8, 0);
private->ximage->data = data;
private->ximage->bitmap_bit_order = MSBFirst;
private->ximage->byte_order = MSBFirst;
image->byte_order = MSBFirst;
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
image->bpp = 1;
return(image);
} /* gdk_image_new_bitmap() */
static int
gdk_image_check_xshm(Display *display)
/*
* Desc: query the server for support for the MIT_SHM extension
* Return: 0 = not available
* 1 = shared XImage support available
* 2 = shared Pixmap support available also
*/
{
#ifdef USE_SHM
int major, minor, ignore;
Bool pixmaps;
if (XQueryExtension(display, "MIT-SHM", &ignore, &ignore, &ignore))
{
if (XShmQueryVersion(display, &major, &minor, &pixmaps )==True)
{
return (pixmaps==True) ? 2 : 1;
}
}
#endif /* USE_SHM */
return 0;
}
void
gdk_image_unref (GdkImage *image)
gdk_image_init (void)
{
g_return_if_fail (GDK_IS_IMAGE (image));
g_object_unref (G_OBJECT (image));
if (gdk_use_xshm)
{
if (!gdk_image_check_xshm (gdk_display))
{
gdk_use_xshm = False;
}
}
}
GdkImage*
gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height)
{
GdkImage *image;
GdkImagePrivate *private;
#ifdef USE_SHM
XShmSegmentInfo *x_shm_info;
#endif /* USE_SHM */
Visual *xvisual;
switch (type)
{
case GDK_IMAGE_FASTEST:
image = gdk_image_new (GDK_IMAGE_SHARED, visual, width, height);
if (!image)
image = gdk_image_new (GDK_IMAGE_NORMAL, visual, width, height);
break;
default:
private = g_new (GdkImagePrivate, 1);
image = (GdkImage*) private;
private->xdisplay = gdk_display;
private->image_put = NULL;
image->type = type;
image->visual = visual;
image->width = width;
image->height = height;
image->depth = visual->depth;
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
switch (type)
{
case GDK_IMAGE_SHARED:
#ifdef USE_SHM
if (gdk_use_xshm)
{
private->image_put = gdk_image_put_shared;
private->x_shm_info = g_new (XShmSegmentInfo, 1);
x_shm_info = private->x_shm_info;
private->ximage = XShmCreateImage (private->xdisplay, xvisual, visual->depth,
ZPixmap, NULL, x_shm_info, width, height);
if (private->ximage == NULL)
{
g_warning ("XShmCreateImage failed");
g_free (image);
gdk_use_xshm = False;
return NULL;
}
x_shm_info->shmid = shmget (IPC_PRIVATE,
private->ximage->bytes_per_line * private->ximage->height,
IPC_CREAT | 0777);
if (x_shm_info->shmid == -1)
{
g_warning ("shmget failed!");
XDestroyImage (private->ximage);
g_free (private->x_shm_info);
g_free (image);
gdk_use_xshm = False;
return NULL;
}
x_shm_info->readOnly = False;
x_shm_info->shmaddr = shmat (x_shm_info->shmid, 0, 0);
private->ximage->data = x_shm_info->shmaddr;
if (x_shm_info->shmaddr == (char*) -1)
{
g_warning ("shmat failed!");
XDestroyImage (private->ximage);
shmctl (x_shm_info->shmid, IPC_RMID, 0);
g_free (private->x_shm_info);
g_free (image);
return NULL;
}
gdk_error_trap_push ();
XShmAttach (private->xdisplay, x_shm_info);
XSync (private->xdisplay, False);
if (gdk_error_trap_pop ())
{
/* this is the common failure case so omit warning */
XDestroyImage (private->ximage);
shmdt (x_shm_info->shmaddr);
shmctl (x_shm_info->shmid, IPC_RMID, 0);
g_free (private->x_shm_info);
g_free (image);
gdk_use_xshm = False;
return NULL;
}
/* We mark the segment as destroyed so that when
* the last process detaches, it will be deleted.
* There is a small possibility of leaking if
* we die in XShmAttach. In theory, a signal handler
* could be set up.
*/
shmctl (x_shm_info->shmid, IPC_RMID, 0);
if (image)
image_list = g_list_prepend (image_list, image);
}
else
{
g_free (image);
return NULL;
}
break;
#else /* USE_SHM */
g_free (image);
return NULL;
#endif /* USE_SHM */
case GDK_IMAGE_NORMAL:
private->image_put = gdk_image_put_normal;
private->ximage = XCreateImage (private->xdisplay, xvisual, visual->depth,
ZPixmap, 0, 0, width, height, 32, 0);
/* Use malloc, not g_malloc here, because X will call free()
* on this data
*/
private->ximage->data = malloc (private->ximage->bytes_per_line *
private->ximage->height);
break;
case GDK_IMAGE_FASTEST:
g_assert_not_reached ();
}
if (image)
{
image->byte_order = private->ximage->byte_order;
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
image->bpp = (private->ximage->bits_per_pixel + 7) / 8;
}
}
return image;
}
GdkImage*
gdk_image_get (GdkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
GdkImage *image;
GdkImagePrivate *private;
GdkWindowPrivate *win_private;
g_return_val_if_fail (window != NULL, NULL);
win_private = (GdkWindowPrivate *) window;
if (win_private->destroyed)
return NULL;
private = g_new (GdkImagePrivate, 1);
image = (GdkImage*) private;
private->xdisplay = gdk_display;
private->image_put = gdk_image_put_normal;
private->ximage = XGetImage (private->xdisplay,
win_private->xwindow,
x, y, width, height,
AllPlanes, ZPixmap);
image->type = GDK_IMAGE_NORMAL;
image->visual = gdk_window_get_visual (window);
image->width = width;
image->height = height;
image->depth = private->ximage->depth;
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
image->bpp = private->ximage->bits_per_pixel;
image->byte_order = private->ximage->byte_order;
return image;
}
guint32
gdk_image_get_pixel (GdkImage *image,
gint x,
gint y)
{
guint32 pixel;
GdkImagePrivate *private;
g_return_val_if_fail (image != NULL, 0);
private = (GdkImagePrivate *) image;
pixel = XGetPixel (private->ximage, x, y);
return pixel;
}
void
gdk_image_put_pixel (GdkImage *image,
gint x,
gint y,
guint32 pixel)
{
GdkImagePrivate *private;
g_return_if_fail (image != NULL);
private = (GdkImagePrivate *) image;
pixel = XPutPixel (private->ximage, x, y, pixel);
}
void
gdk_image_destroy (GdkImage *image)
{
GdkImagePrivate *private;
#ifdef USE_SHM
XShmSegmentInfo *x_shm_info;
#endif /* USE_SHM */
g_return_if_fail (image != NULL);
private = (GdkImagePrivate*) image;
switch (image->type)
{
case GDK_IMAGE_NORMAL:
XDestroyImage (private->ximage);
break;
case GDK_IMAGE_SHARED:
#ifdef USE_SHM
gdk_flush();
XShmDetach (private->xdisplay, private->x_shm_info);
XDestroyImage (private->ximage);
x_shm_info = private->x_shm_info;
shmdt (x_shm_info->shmaddr);
g_free (private->x_shm_info);
image_list = g_list_remove (image_list, image);
#else /* USE_SHM */
g_error ("trying to destroy shared memory image when gdk was compiled without shared memory support");
#endif /* USE_SHM */
break;
case GDK_IMAGE_FASTEST:
g_assert_not_reached ();
}
g_free (image);
}
static void
gdk_image_put_normal (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
GdkWindowPrivate *drawable_private;
GdkImagePrivate *image_private;
GdkGCPrivate *gc_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (image != NULL);
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
image_private = (GdkImagePrivate*) image;
gc_private = (GdkGCPrivate*) gc;
g_return_if_fail (image->type == GDK_IMAGE_NORMAL);
XPutImage (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, image_private->ximage,
xsrc, ysrc, xdest, ydest, width, height);
}
static void
gdk_image_put_shared (GdkDrawable *drawable,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height)
{
#ifdef USE_SHM
GdkWindowPrivate *drawable_private;
GdkImagePrivate *image_private;
GdkGCPrivate *gc_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (image != NULL);
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
image_private = (GdkImagePrivate*) image;
gc_private = (GdkGCPrivate*) gc;
g_return_if_fail (image->type == GDK_IMAGE_SHARED);
XShmPutImage (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, image_private->ximage,
xsrc, ysrc, xdest, ydest, width, height, False);
#else /* USE_SHM */
g_error ("trying to draw shared memory image when gdk was compiled without shared memory support");
#endif /* USE_SHM */
}

View File

@@ -1,101 +0,0 @@
#ifndef __GDK_IMAGE_H__
#define __GDK_IMAGE_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Types of images.
* Normal: Normal X image type. These are slow as they involve passing
* the entire image through the X connection each time a draw
* request is required. On Win32, a bitmap.
* Shared: Shared memory X image type. These are fast as the X server
* and the program actually use the same piece of memory. They
* should be used with care though as there is the possibility
* for both the X server and the program to be reading/writing
* the image simultaneously and producing undesired results.
* On Win32, also a bitmap.
* Shared Pixmap: Also a shared memory image, which also has a
* pixmap using the same memory. Used by gdk_imlib with the
* Win32 backend.
*/
typedef enum
{
GDK_IMAGE_NORMAL,
GDK_IMAGE_SHARED,
GDK_IMAGE_FASTEST,
GDK_IMAGE_SHARED_PIXMAP
} GdkImageType;
typedef struct _GdkImageClass GdkImageClass;
#define GDK_TYPE_IMAGE (gdk_image_get_type ())
#define GDK_IMAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_IMAGE, GdkImage))
#define GDK_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_IMAGE, GdkImageClass))
#define GDK_IS_IMAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_IMAGE))
#define GDK_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_IMAGE))
#define GDK_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_IMAGE, GdkImageClass))
struct _GdkImage
{
GObject parent_instance;
GdkImageType type;
GdkVisual *visual; /* visual used to create the image */
GdkByteOrder byte_order;
gint width;
gint height;
guint16 depth;
guint16 bpp; /* bytes per pixel */
guint16 bpl; /* bytes per line */
gpointer mem;
gpointer windowing_data;
};
struct _GdkImageClass
{
GObjectClass parent_class;
};
GType gdk_image_get_type (void);
GdkImage* gdk_image_new_bitmap (GdkVisual *visual,
gpointer data,
gint width,
gint height);
GdkImage* gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height);
#ifdef GDK_WINDOWING_WIN32
GdkImage* gdk_image_bitmap_new(GdkImageType type,
GdkVisual *visual,
gint width,
gint height);
#endif
GdkImage* gdk_image_get (GdkDrawable *drawable,
gint x,
gint y,
gint width,
gint height);
GdkImage * gdk_image_ref (GdkImage *image);
void gdk_image_unref (GdkImage *image);
void gdk_image_put_pixel (GdkImage *image,
gint x,
gint y,
guint32 pixel);
guint32 gdk_image_get_pixel (GdkImage *image,
gint x,
gint y);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_IMAGE_H__ */

View File

@@ -28,15 +28,27 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "config.h"
#include "gdk.h"
#include "gdkx.h"
#include "gdkinput.h"
#include "gdkprivate.h"
#include "gdkinputprivate.h"
#include "gdkinput.h"
/* Forward declarations */
static gint gdk_input_enable_window (GdkWindow *window,
GdkDevicePrivate *gdkdev);
static gint gdk_input_disable_window (GdkWindow *window,
GdkDevicePrivate *gdkdev);
static GdkInputWindow *gdk_input_window_find (GdkWindow *window);
static GdkDevicePrivate *gdk_input_find_device (guint32 id);
/* Incorporate the specific routines depending on compilation options */
static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
const GdkDeviceInfo gdk_input_core_info =
static const GdkDeviceInfo gdk_input_core_info =
{
GDK_CORE_POINTER,
"Core Pointer",
@@ -55,8 +67,15 @@ gchar *gdk_input_gxid_host;
gint gdk_input_gxid_port;
gint gdk_input_ignore_core;
GList *gdk_input_devices;
GList *gdk_input_windows;
/* Local variables */
static GList *gdk_input_devices;
static GList *gdk_input_windows;
#include "gdkinputnone.h"
#include "gdkinputcommon.h"
#include "gdkinputxfree.h"
#include "gdkinputgxi.h"
GList *
gdk_input_list_devices (void)
@@ -108,20 +127,20 @@ gdk_input_motion_events (GdkWindow *window,
guint32 stop,
gint *nevents_return)
{
GdkWindowPrivate *window_private;
XTimeCoord *xcoords;
GdkTimeCoord *coords;
int i;
g_return_val_if_fail (window != NULL, NULL);
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
if (GDK_WINDOW_DESTROYED (window))
window_private = (GdkWindowPrivate *) window;
if (window_private->destroyed)
return NULL;
if (deviceid == GDK_CORE_POINTER)
{
xcoords = XGetMotionEvents (GDK_DRAWABLE_XDISPLAY (window),
GDK_DRAWABLE_XID (window),
xcoords = XGetMotionEvents (gdk_display,
window_private->xwindow,
start, stop, nevents_return);
if (xcoords)
{
@@ -159,7 +178,7 @@ gdk_input_motion_events (GdkWindow *window,
}
}
gint
static gint
gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
{
if (gdk_input_vtable.enable_window)
@@ -168,7 +187,7 @@ gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
return TRUE;
}
gint
static gint
gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
{
if (gdk_input_vtable.disable_window)
@@ -178,7 +197,7 @@ gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
}
GdkInputWindow *
static GdkInputWindow *
gdk_input_window_find(GdkWindow *window)
{
GList *tmp_list;
@@ -200,15 +219,13 @@ void
gdk_input_set_extension_events (GdkWindow *window, gint mask,
GdkExtensionMode mode)
{
GdkWindowObject *window_private;
GdkWindowPrivate *window_private;
GList *tmp_list;
GdkInputWindow *iw;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
window_private = (GdkWindowObject*) window;
if (GDK_WINDOW_DESTROYED (window))
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mode == GDK_EXTENSION_EVENTS_NONE)
@@ -305,7 +322,7 @@ gdk_input_exit (void)
g_list_free(gdk_input_windows);
}
GdkDevicePrivate *
static GdkDevicePrivate *
gdk_input_find_device(guint32 id)
{
GList *tmp_list = gdk_input_devices;

View File

@@ -1,108 +1,160 @@
/* GDK - The GIMP Drawing Kit
* 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.
*/
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_INPUT_H__
#define __GDK_INPUT_H__
#include <gdk/gdktypes.h>
#ifndef XINPUT_NONE
#include <X11/extensions/XInput.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkAxisInfo GdkAxisInfo;
typedef struct _GdkInputVTable GdkInputVTable;
typedef struct _GdkDevicePrivate GdkDevicePrivate;
typedef struct _GdkInputWindow GdkInputWindow;
typedef struct _GdkDeviceKey GdkDeviceKey;
typedef struct _GdkDeviceInfo GdkDeviceInfo;
typedef struct _GdkTimeCoord GdkTimeCoord;
struct _GdkInputVTable {
gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
void (*set_key) (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers);
GdkTimeCoord* (*motion_events) (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return);
void (*get_pointer) (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
gint (*grab_pointer) (GdkWindow * window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow * confine_to,
guint32 time);
void (*ungrab_pointer) (guint32 time);
typedef enum
{
GDK_EXTENSION_EVENTS_NONE,
GDK_EXTENSION_EVENTS_ALL,
GDK_EXTENSION_EVENTS_CURSOR
} GdkExtensionMode;
typedef enum
{
GDK_SOURCE_MOUSE,
GDK_SOURCE_PEN,
GDK_SOURCE_ERASER,
GDK_SOURCE_CURSOR
} GdkInputSource;
typedef enum
{
GDK_MODE_DISABLED,
GDK_MODE_SCREEN,
GDK_MODE_WINDOW
} GdkInputMode;
typedef enum
{
GDK_AXIS_IGNORE,
GDK_AXIS_X,
GDK_AXIS_Y,
GDK_AXIS_PRESSURE,
GDK_AXIS_XTILT,
GDK_AXIS_YTILT,
GDK_AXIS_LAST
} GdkAxisUse;
struct _GdkDeviceInfo
{
guint32 deviceid;
gchar *name;
GdkInputSource source;
GdkInputMode mode;
gint has_cursor; /* TRUE if the X pointer follows device motion */
gint num_axes;
GdkAxisUse *axes; /* Specifies use for each axis */
gint num_keys;
GdkDeviceKey *keys;
void (*configure_event) (XConfigureEvent *xevent, GdkWindow *window);
void (*enter_event) (XCrossingEvent *xevent, GdkWindow *window);
gint (*other_event) (GdkEvent *event, XEvent *xevent, GdkWindow *window);
/* Handle an unidentified event. Returns TRUE if handled, FALSE
otherwise */
gint (*window_none_event) (GdkEvent *event, XEvent *xevent);
gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
};
struct _GdkDeviceKey
/* information about a device axis */
struct _GdkAxisInfo
{
guint keyval;
GdkModifierType modifiers;
/* reported x resolution */
gint xresolution;
/* reported x minimum/maximum values */
gint xmin_value, xmax_value;
/* calibrated resolution (for aspect ration) - only relative values
between axes used */
gint resolution;
/* calibrated minimum/maximum values */
gint min_value, max_value;
};
struct _GdkTimeCoord
{
guint32 time;
gdouble x;
gdouble y;
gdouble pressure;
gdouble xtilt;
gdouble ytilt;
#define GDK_INPUT_NUM_EVENTC 6
struct _GdkDevicePrivate {
GdkDeviceInfo info;
#ifndef XINPUT_NONE
/* information about the axes */
GdkAxisInfo *axes;
/* reverse lookup on axis use type */
gint axis_for_use[GDK_AXIS_LAST];
/* Information about XInput device */
XDevice *xdevice;
/* minimum key code for device */
gint min_keycode;
int buttonpress_type, buttonrelease_type, keypress_type,
keyrelease_type, motionnotify_type, proximityin_type,
proximityout_type, changenotify_type;
/* true if we need to select a different set of events, but
can't because this is the core pointer */
gint needs_update;
/* Mask of buttons (used for button grabs) */
gint button_state;
/* true if we've claimed the device as active. (used only for XINPUT_GXI) */
gint claimed;
#endif /* !XINPUT_NONE */
};
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);
struct _GdkInputWindow
{
/* gdk window */
GdkWindow *window;
#ifdef __cplusplus
}
#endif /* __cplusplus */
/* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
GdkExtensionMode mode;
/* position relative to root window */
gint16 root_x;
gint16 root_y;
/* rectangles relative to window of windows obscuring this one */
GdkRectangle *obscuring;
gint num_obscuring;
/* Is there a pointer grab for this window ? */
gint grabbed;
};
/* Global data */
extern GdkInputVTable gdk_input_vtable;
/* information about network port and host for gxid daemon */
extern gchar *gdk_input_gxid_host;
extern gint gdk_input_gxid_port;
extern gint gdk_input_ignore_core;
/* Function declarations */
void gdk_input_window_destroy (GdkWindow *window);
#endif /* __GDK_INPUT_H__ */

View File

@@ -24,13 +24,22 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdkinputprivate.h"
#include "gdkinternals.h"
#include "gdkx.h"
#if defined(XINPUT_GXI) || defined(XINPUT_XFREE)
/* Forward declarations */
static void gdk_input_get_root_relative_geometry (Display *dpy, Window w,
int *x_ret, int *y_ret,
int *width_ret,
int *height_ret);
static GdkDevicePrivate *gdk_input_device_new(XDeviceInfo *device,
gint include_core);
static void gdk_input_common_find_events(GdkWindow *window,
GdkDevicePrivate *gdkdev,
gint mask,
XEventClass *classes,
int *num_classes);
static void gdk_input_common_select_events(GdkWindow *window,
GdkDevicePrivate *gdkdev);
static void gdk_input_translate_coordinates(GdkDevicePrivate *gdkdev,
GdkInputWindow *input_window,
gint *axis_data,
@@ -38,21 +47,34 @@ static void gdk_input_translate_coordinates(GdkDevicePrivate *gdkdev,
gdouble *pressure,
gdouble *xtilt, gdouble *ytilt);
static guint gdk_input_translate_state(guint state, guint device_state);
void gdk_input_common_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
static gint gdk_input_common_init(gint include_core);
static gint gdk_input_common_other_event (GdkEvent *event,
XEvent *xevent,
GdkInputWindow *input_window,
GdkDevicePrivate *gdkdev);
static void gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes);
static GdkTimeCoord * gdk_input_common_motion_events (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return);
static void gdk_input_common_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
#define GDK_MAX_DEVICE_CLASSES 13
/* Global variables */
static gint gdk_input_root_width;
static gint gdk_input_root_height;
void
static void
gdk_input_get_root_relative_geometry(Display *dpy, Window w, int *x_ret, int *y_ret,
int *width_ret, int *height_ret)
{
@@ -282,7 +304,7 @@ gdk_input_device_new(XDeviceInfo *device, gint include_core)
return gdkdev;
}
void
static void
gdk_input_common_find_events(GdkWindow *window,
GdkDevicePrivate *gdkdev,
gint mask,
@@ -384,7 +406,7 @@ gdk_input_common_find_events(GdkWindow *window,
*num_classes = i;
}
void
static void
gdk_input_common_select_events(GdkWindow *window,
GdkDevicePrivate *gdkdev)
{
@@ -441,7 +463,7 @@ gdk_input_common_init(gint include_core)
XFreeDeviceList(devices);
}
gdk_input_devices = g_list_append (gdk_input_devices, (gpointer)&gdk_input_core_info);
gdk_input_devices = g_list_append (gdk_input_devices, &gdk_input_core_info);
return TRUE;
}
@@ -453,14 +475,14 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
gdouble *x, gdouble *y, gdouble *pressure,
gdouble *xtilt, gdouble *ytilt)
{
GdkDrawablePrivate *drawable_priv;
GdkWindowPrivate *win_priv;
int x_axis, y_axis, pressure_axis, xtilt_axis, ytilt_axis;
double device_width, device_height;
double x_offset, y_offset, x_scale, y_scale;
drawable_priv = (GdkDrawablePrivate *) input_window->window;
win_priv = (GdkWindowPrivate *) input_window->window;
x_axis = gdkdev->axis_for_use[GDK_AXIS_X];
y_axis = gdkdev->axis_for_use[GDK_AXIS_Y];
@@ -486,26 +508,26 @@ gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
double device_aspect = (device_height*gdkdev->axes[y_axis].resolution) /
(device_width*gdkdev->axes[x_axis].resolution);
if (device_aspect * drawable_priv->width >= drawable_priv->height)
if (device_aspect * win_priv->width >= win_priv->height)
{
/* device taller than window */
x_scale = drawable_priv->width / device_width;
x_scale = win_priv->width / device_width;
y_scale = (x_scale * gdkdev->axes[x_axis].resolution)
/ gdkdev->axes[y_axis].resolution;
x_offset = 0;
y_offset = -(device_height * y_scale -
drawable_priv->height)/2;
win_priv->height)/2;
}
else
{
/* window taller than device */
y_scale = drawable_priv->height / device_height;
y_scale = win_priv->height / device_height;
x_scale = (y_scale * gdkdev->axes[y_axis].resolution)
/ gdkdev->axes[x_axis].resolution;
y_offset = 0;
x_offset = - (device_width * x_scale - drawable_priv->width)/2;
x_offset = - (device_width * x_scale - win_priv->width)/2;
}
}
@@ -562,11 +584,10 @@ gdk_input_translate_state(guint state, guint device_state)
return device_state | (state & 0xFF);
}
gint
gdk_input_common_other_event (GdkEvent *event,
XEvent *xevent,
GdkInputWindow *input_window,
static gint
gdk_input_common_other_event (GdkEvent *event,
XEvent *xevent,
GdkInputWindow *input_window,
GdkDevicePrivate *gdkdev)
{
if ((xevent->type == gdkdev->buttonpress_type) ||
@@ -718,7 +739,7 @@ gdk_input_common_other_event (GdkEvent *event,
return -1; /* wasn't one of our event types */
}
void
static void
gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes)
{
int i;
@@ -737,11 +758,10 @@ gdk_input_common_set_axes (guint32 deviceid, GdkAxisUse *axes)
}
}
void
gdk_input_common_set_key (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers)
void gdk_input_common_set_key (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers)
{
GdkDevicePrivate *gdkdev = gdk_input_find_device(deviceid);
@@ -753,7 +773,7 @@ gdk_input_common_set_key (guint32 deviceid,
gdkdev->info.keys[index].modifiers = modifiers;
}
GdkTimeCoord *
static GdkTimeCoord *
gdk_input_common_motion_events (GdkWindow *window,
guint32 deviceid,
guint32 start,
@@ -802,7 +822,7 @@ gdk_input_common_motion_events (GdkWindow *window,
return NULL;
}
void
static void
gdk_input_common_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
@@ -869,6 +889,9 @@ gdk_input_common_get_pointer (GdkWindow *window,
}
input_class = (XInputClass *)(((char *)input_class)+input_class->length);
}
XFreeDeviceState (state);
XFreeDeviceState (state);
}
}
#endif

View File

@@ -24,10 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include <stdlib.h>
#include "gdkinputprivate.h"
#include "gdkx.h"
#ifdef XINPUT_GXI
/* #define DEBUG_SWITCHING */
@@ -317,8 +314,8 @@ gdk_input_gxi_other_event (GdkEvent *event,
if (return_val > 0 && event->type == GDK_MOTION_NOTIFY &&
(!gdkdev->button_state) && (!input_window->grabbed) &&
((event->motion.x < 0) || (event->motion.y < 0) ||
(event->motion.x > ((GdkDrawablePrivate *)window)->width) ||
(event->motion.y > ((GdkDrawablePrivate *)window)->height) ||
(event->motion.x > ((GdkWindowPrivate *)window)->width) ||
(event->motion.y > ((GdkWindowPrivate *)window)->height) ||
gdk_input_is_obscured(input_window,event->motion.x,event->motion.y)))
{
#ifdef DEBUG_SWITCHING
@@ -648,3 +645,5 @@ gdk_input_gxi_ungrab_pointer (guint32 time)
tmp_list = tmp_list->next;
}
}
#endif /* XINPUT_GXI */

View File

@@ -17,8 +17,6 @@
* Boston, MA 02111-1307, USA.
*/
#include "gdkinputprivate.h"
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
@@ -26,6 +24,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifdef XINPUT_NONE
static void gdk_input_none_get_pointer (GdkWindow *window,
guint32 deviceid,
gdouble *x,
@@ -77,3 +77,5 @@ gdk_input_none_get_pointer (GdkWindow *window,
if (xtilt) *xtilt = 0;
if (ytilt) *ytilt = 0;
}
#endif /* XINPUT_NONE */

View File

@@ -17,8 +17,6 @@
* Boston, MA 02111-1307, USA.
*/
#include "gdkinputprivate.h"
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
@@ -26,6 +24,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifdef XINPUT_XFREE
/* forward declarations */
static gint gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode);
@@ -42,10 +42,10 @@ static gint gdk_input_xfree_enable_window(GdkWindow *window,
static gint gdk_input_xfree_disable_window(GdkWindow *window,
GdkDevicePrivate *gdkdev);
static gint gdk_input_xfree_grab_pointer (GdkWindow * window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow * confine_to,
guint32 time);
gint owner_events,
GdkEventMask event_mask,
GdkWindow * confine_to,
guint32 time);
static void gdk_input_xfree_ungrab_pointer (guint32 time);
void
@@ -155,7 +155,7 @@ gdk_input_check_proximity (void)
xic = (XInputClass *)((char *)xic + xic->length);
}
XFreeDeviceState (state);
XFreeDeviceState (state);
}
tmp_list = tmp_list->next;
}
@@ -372,3 +372,5 @@ gdk_input_xfree_ungrab_pointer (guint32 time)
}
}
}
#endif /* XINPUT_XFREE */

View File

@@ -1,216 +0,0 @@
/* GDK - The GIMP Drawing Kit
* 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.
*/
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/* Uninstalled header defining types and functions internal to GDK */
#include <gdk/gdktypes.h>
#include <gdk/gdkprivate.h>
#ifndef __GDK_INTERNALS_H__
#define __GDK_INTERNALS_H__
/**********************
* General Facilities *
**********************/
/* Debugging support */
typedef enum {
GDK_DEBUG_MISC = 1 << 0,
GDK_DEBUG_EVENTS = 1 << 1,
GDK_DEBUG_DND = 1 << 2,
GDK_DEBUG_COLOR_CONTEXT = 1 << 3,
GDK_DEBUG_XIM = 1 << 4
} GdkDebugFlag;
extern gint gdk_debug_level;
extern gboolean gdk_show_events;
extern GList *gdk_default_filters;
GDKVAR guint gdk_debug_flags;
#ifdef G_ENABLE_DEBUG
#define GDK_NOTE(type,action) G_STMT_START { \
if (gdk_debug_flags & GDK_DEBUG_##type) \
{ action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
#define GDK_NOTE(type,action)
#endif /* G_ENABLE_DEBUG */
/* Arg parsing */
typedef enum
{
GDK_ARG_STRING,
GDK_ARG_INT,
GDK_ARG_BOOL,
GDK_ARG_NOBOOL,
GDK_ARG_CALLBACK
} GdkArgType;
typedef struct _GdkArgContext GdkArgContext;
typedef struct _GdkArgDesc GdkArgDesc;
typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
struct _GdkArgContext
{
GPtrArray *tables;
gpointer cb_data;
};
struct _GdkArgDesc
{
const char *name;
GdkArgType type;
gpointer location;
GdkArgFunc callback;
};
/* Event handling */
extern GdkEventFunc gdk_event_func; /* Callback for events */
extern gpointer gdk_event_data;
extern GDestroyNotify gdk_event_notify;
/* FIFO's for event queue, and for events put back using
* gdk_event_put().
*/
extern GList *gdk_queued_events;
extern GList *gdk_queued_tail;
GdkEvent* gdk_event_new (void);
void gdk_events_init (void);
void gdk_events_queue (void);
GdkEvent* gdk_event_unqueue (void);
GList* gdk_event_queue_find_first (void);
void gdk_event_queue_remove_link (GList *node);
void gdk_event_queue_append (GdkEvent *event);
void gdk_event_button_generate (GdkEvent *event);
/*************************************
* Interfaces used by windowing code *
*************************************/
#ifdef USE_XIM
/* XIM support */
gint gdk_im_open (void);
void gdk_im_close (void);
void gdk_ic_cleanup (void);
#endif /* USE_XIM */
void _gdk_window_destroy (GdkWindow *window,
gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window);
/*****************************************
* Interfaces provided by windowing code *
*****************************************/
/* Font/string functions implemented in module-specific code */
gint _gdk_font_strlen (GdkFont *font, const char *str);
void _gdk_font_destroy (GdkFont *font);
void _gdk_colormap_real_destroy (GdkColormap *colormap);
void _gdk_cursor_destroy (GdkCursor *cursor);
extern GdkArgDesc _gdk_windowing_args[];
gboolean _gdk_windowing_init_check (int argc,
char **argv);
void _gdk_windowing_window_get_offsets (GdkWindow *window,
gint *x_offset,
gint *y_offset);
void _gdk_windowing_window_clear_area (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void _gdk_windowing_window_clear_area_e (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
/* Called before processing updates for a window. This gives the windowing
* layer a chance to save the region for later use in avoiding duplicate
* exposes. The return value indicates whether the function has a saved
* the region; if the result is TRUE, then the windowing layer is responsible
* for destroying the region later.
*/
gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
GdkRegion *area);
/* Called to do the windowing system specific part of gdk_window_destroy(),
*
* window: The window being destroyed
* recursing: If TRUE, then this is being called because a parent
* was destroyed. This generally means that the call to the windowing system
* to destroy the window can be omitted, since it will be destroyed as a result
* of the parent being destroyed. Unless @foreign_destroy
*
* foreign_destroy: If TRUE, the window or a parent was destroyed by some external
* agency. The window has already been destroyed and no windowing
* system calls should be made. (This may never happen for some
* windowing systems.)
*/
void _gdk_windowing_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy);
/* Implementation types */
GType gdk_window_impl_get_type (void);
GType gdk_pixmap_impl_get_type (void);
/************************************
* Initialization and exit routines *
************************************/
void gdk_windowing_window_init (void);
void gdk_visual_init (void);
void gdk_dnd_init (void);
void gdk_windowing_image_init (void);
void gdk_image_exit (void);
void gdk_input_init (void);
void gdk_input_exit (void);
void gdk_windowing_exit (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_INTERNALS_H__ */

View File

@@ -10,7 +10,6 @@
#define GDK_Escape 0xFF1B
#define GDK_Delete 0xFFFF
#define GDK_Multi_key 0xFF20
#define GDK_Codeinput 0xFF37
#define GDK_SingleCandidate 0xFF3C
#define GDK_MultipleCandidate 0xFF3D
#define GDK_PreviousCandidate 0xFF3E
@@ -31,7 +30,6 @@
#define GDK_Kana_Shift 0xFF2E
#define GDK_Eisu_Shift 0xFF2F
#define GDK_Eisu_toggle 0xFF30
#define GDK_Kanji_Bangou 0xFF37
#define GDK_Zen_Koho 0xFF3D
#define GDK_Mae_Koho 0xFF3E
#define GDK_Home 0xFF50
@@ -610,9 +608,6 @@
#define GDK_uogonek 0x3f9
#define GDK_utilde 0x3fd
#define GDK_umacron 0x3fe
#define GDK_OE 0x13bc
#define GDK_oe 0x13bd
#define GDK_Ydiaeresis 0x13be
#define GDK_overline 0x47e
#define GDK_kana_fullstop 0x4a1
#define GDK_kana_openingbracket 0x4a2
@@ -1320,16 +1315,3 @@
#define GDK_Hangul_J_KkogjiDalrinIeung 0xef9
#define GDK_Hangul_J_YeorinHieuh 0xefa
#define GDK_Korean_Won 0xeff
#define GDK_EcuSign 0x20a0
#define GDK_ColonSign 0x20a1
#define GDK_CruzeiroSign 0x20a2
#define GDK_FFrancSign 0x20a3
#define GDK_LiraSign 0x20a4
#define GDK_MillSign 0x20a5
#define GDK_NairaSign 0x20a6
#define GDK_PesetaSign 0x20a7
#define GDK_RupeeSign 0x20a8
#define GDK_WonSign 0x20a9
#define GDK_NewSheqelSign 0x20aa
#define GDK_DongSign 0x20ab
#define GDK_EuroSign 0x20ac

File diff suppressed because it is too large Load Diff

View File

@@ -1,89 +0,0 @@
#ifndef __GDK_PIXMAP_H__
#define __GDK_PIXMAP_H__
#include <gdk/gdktypes.h>
#include <gdk/gdkdrawable.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkPixmapObject GdkPixmapObject;
typedef struct _GdkPixmapObjectClass GdkPixmapObjectClass;
#define GDK_TYPE_PIXMAP (gdk_pixmap_get_type ())
#define GDK_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXMAP, GdkPixmap))
#define GDK_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXMAP, GdkPixmapObjectClass))
#define GDK_IS_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXMAP))
#define GDK_IS_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXMAP))
#define GDK_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXMAP, GdkPixmapClass))
struct _GdkPixmapObject
{
GdkDrawable parent_instance;
GdkDrawable *impl; /* window-system-specific delegate object */
gint depth;
};
struct _GdkPixmapObjectClass
{
GdkDrawableClass parent_class;
};
GType gdk_pixmap_get_type (void);
/* Pixmaps
*/
GdkPixmap* gdk_pixmap_new (GdkWindow *window,
gint width,
gint height,
gint depth);
#ifdef GDK_WINDOWING_WIN32
GdkPixmap* gdk_pixmap_create_on_shared_image
(GdkImage **image_return,
GdkWindow *window,
GdkVisual *visual,
gint width,
gint height,
gint depth);
#endif
GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window,
const gchar *data,
gint width,
gint height);
GdkPixmap* gdk_pixmap_create_from_data (GdkWindow *window,
const gchar *data,
gint width,
gint height,
gint depth,
GdkColor *fg,
GdkColor *bg);
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,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename);
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,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_PIXMAP_H__ */

View File

@@ -1,291 +0,0 @@
/* $TOG: poly.h /main/5 1998/02/06 17:47:27 kaleb $ */
/************************************************************************
Copyright 1987, 1998 The Open Group
All Rights Reserved.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
/*
* This file contains a few macros to help track
* the edge of a filled object. The object is assumed
* to be filled in scanline order, and thus the
* algorithm used is an extension of Bresenham's line
* drawing algorithm which assumes that y is always the
* major axis.
* Since these pieces of code are the same for any filled shape,
* it is more convenient to gather the library in one
* place, but since these pieces of code are also in
* the inner loops of output primitives, procedure call
* overhead is out of the question.
* See the author for a derivation if needed.
*/
/*
* In scan converting polygons, we want to choose those pixels
* which are inside the polygon. Thus, we add .5 to the starting
* x coordinate for both left and right edges. Now we choose the
* first pixel which is inside the pgon for the left edge and the
* first pixel which is outside the pgon for the right edge.
* Draw the left pixel, but not the right.
*
* How to add .5 to the starting x coordinate:
* If the edge is moving to the right, then subtract dy from the
* error term from the general form of the algorithm.
* If the edge is moving to the left, then add dy to the error term.
*
* The reason for the difference between edges moving to the left
* and edges moving to the right is simple: If an edge is moving
* to the right, then we want the algorithm to flip immediately.
* If it is moving to the left, then we don't want it to flip until
* we traverse an entire pixel.
*/
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
int dx; /* local storage */ \
\
/* \
* if the edge is horizontal, then it is ignored \
* and assumed not to be processed. Otherwise, do this stuff. \
*/ \
if ((dy) != 0) { \
xStart = (x1); \
dx = (x2) - xStart; \
if (dx < 0) { \
m = dx / (dy); \
m1 = m - 1; \
incr1 = -2 * dx + 2 * (dy) * m1; \
incr2 = -2 * dx + 2 * (dy) * m; \
d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
} else { \
m = dx / (dy); \
m1 = m + 1; \
incr1 = 2 * dx - 2 * (dy) * m1; \
incr2 = 2 * dx - 2 * (dy) * m; \
d = -2 * m * (dy) + 2 * dx; \
} \
} \
}
#define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \
if (m1 > 0) { \
if (d > 0) { \
minval += m1; \
d += incr1; \
} \
else { \
minval += m; \
d += incr2; \
} \
} else {\
if (d >= 0) { \
minval += m1; \
d += incr1; \
} \
else { \
minval += m; \
d += incr2; \
} \
} \
}
/*
* This structure contains all of the information needed
* to run the bresenham algorithm.
* The variables may be hardcoded into the declarations
* instead of using this structure to make use of
* register declarations.
*/
typedef struct {
int minor_axis; /* minor axis */
int d; /* decision variable */
int m, m1; /* slope and slope+1 */
int incr1, incr2; /* error increments */
} BRESINFO;
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \
BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \
bres.m, bres.m1, bres.incr1, bres.incr2)
#define BRESINCRPGONSTRUCT(bres) \
BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2)
/*
* These are the data structures needed to scan
* convert regions. Two different scan conversion
* methods are available -- the even-odd method, and
* the winding number method.
* The even-odd rule states that a point is inside
* the polygon if a ray drawn from that point in any
* direction will pass through an odd number of
* path segments.
* By the winding number rule, a point is decided
* to be inside the polygon if a ray drawn from that
* point in any direction passes through a different
* number of clockwise and counter-clockwise path
* segments.
*
* These data structures are adapted somewhat from
* the algorithm in (Foley/Van Dam) for scan converting
* polygons.
* The basic algorithm is to start at the top (smallest y)
* of the polygon, stepping down to the bottom of
* the polygon by incrementing the y coordinate. We
* keep a list of edges which the current scanline crosses,
* sorted by x. This list is called the Active Edge Table (AET)
* As we change the y-coordinate, we update each entry in
* in the active edge table to reflect the edges new xcoord.
* This list must be sorted at each scanline in case
* two edges intersect.
* We also keep a data structure known as the Edge Table (ET),
* which keeps track of all the edges which the current
* scanline has not yet reached. The ET is basically a
* list of ScanLineList structures containing a list of
* edges which are entered at a given scanline. There is one
* ScanLineList per scanline at which an edge is entered.
* When we enter a new edge, we move it from the ET to the AET.
*
* From the AET, we can implement the even-odd rule as in
* (Foley/Van Dam).
* The winding number rule is a little trickier. We also
* keep the EdgeTableEntries in the AET linked by the
* nextWETE (winding EdgeTableEntry) link. This allows
* the edges to be linked just as before for updating
* purposes, but only uses the edges linked by the nextWETE
* link as edges representing spans of the polygon to
* drawn (as with the even-odd rule).
*/
/*
* for the winding number rule
*/
#define CLOCKWISE 1
#define COUNTERCLOCKWISE -1
typedef struct _EdgeTableEntry {
int ymax; /* ycoord at which we exit this edge. */
BRESINFO bres; /* Bresenham info to run the edge */
struct _EdgeTableEntry *next; /* next in the list */
struct _EdgeTableEntry *back; /* for insertion sort */
struct _EdgeTableEntry *nextWETE; /* for winding num rule */
int ClockWise; /* flag for winding number rule */
} EdgeTableEntry;
typedef struct _ScanLineList{
int scanline; /* the scanline represented */
EdgeTableEntry *edgelist; /* header node */
struct _ScanLineList *next; /* next in the list */
} ScanLineList;
typedef struct {
int ymax; /* ymax for the polygon */
int ymin; /* ymin for the polygon */
ScanLineList scanlines; /* header node */
} EdgeTable;
/*
* Here is a struct to help with storage allocation
* so we can allocate a big chunk at a time, and then take
* pieces from this heap when we need to.
*/
#define SLLSPERBLOCK 25
typedef struct _ScanLineListBlock {
ScanLineList SLLs[SLLSPERBLOCK];
struct _ScanLineListBlock *next;
} ScanLineListBlock;
/*
*
* a few macros for the inner loops of the fill code where
* performance considerations don't allow a procedure call.
*
* Evaluate the given edge at the given scanline.
* If the edge has expired, then we leave it and fix up
* the active edge table; otherwise, we increment the
* x value to be ready for the next scanline.
* The winding number rule is in effect, so we must notify
* the caller when the edge has been removed so he
* can reorder the Winding Active Edge Table.
*/
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \
if (pAET->ymax == y) { /* leaving this edge */ \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
fixWAET = 1; \
if (pAET) \
pAET->back = pPrevAET; \
} \
else { \
BRESINCRPGONSTRUCT(pAET->bres); \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}
/*
* Evaluate the given edge at the given scanline.
* If the edge has expired, then we leave it and fix up
* the active edge table; otherwise, we increment the
* x value to be ready for the next scanline.
* The even-odd rule is in effect.
*/
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
if (pAET->ymax == y) { /* leaving this edge */ \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
if (pAET) \
pAET->back = pPrevAET; \
} \
else { \
BRESINCRPGONSTRUCT(pAET->bres); \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}

View File

@@ -1,616 +0,0 @@
/* $TOG: PolyReg.c /main/15 1998/02/06 17:47:08 kaleb $ */
/************************************************************************
Copyright 1987, 1998 The Open Group
All Rights Reserved.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
/* $XFree86: xc/lib/X11/PolyReg.c,v 1.4 1998/10/03 08:41:21 dawes Exp $ */
#define LARGE_COORDINATE 1000000
#define SMALL_COORDINATE -LARGE_COORDINATE
#include <gdkregion.h>
#include "gdkregion-generic.h"
#include "gdkpoly-generic.h"
/*
* InsertEdgeInET
*
* Insert the given edge into the edge table.
* First we must find the correct bucket in the
* Edge table, then find the right slot in the
* bucket. Finally, we can insert it.
*
*/
static void
InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
EdgeTable *ET;
EdgeTableEntry *ETE;
int scanline;
ScanLineListBlock **SLLBlock;
int *iSLLBlock;
{
EdgeTableEntry *start, *prev;
ScanLineList *pSLL, *pPrevSLL;
ScanLineListBlock *tmpSLLBlock;
/*
* find the right bucket to put the edge into
*/
pPrevSLL = &ET->scanlines;
pSLL = pPrevSLL->next;
while (pSLL && (pSLL->scanline < scanline))
{
pPrevSLL = pSLL;
pSLL = pSLL->next;
}
/*
* reassign pSLL (pointer to ScanLineList) if necessary
*/
if ((!pSLL) || (pSLL->scanline > scanline))
{
if (*iSLLBlock > SLLSPERBLOCK-1)
{
tmpSLLBlock =
(ScanLineListBlock *)g_malloc(sizeof(ScanLineListBlock));
(*SLLBlock)->next = tmpSLLBlock;
tmpSLLBlock->next = (ScanLineListBlock *)NULL;
*SLLBlock = tmpSLLBlock;
*iSLLBlock = 0;
}
pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
pSLL->next = pPrevSLL->next;
pSLL->edgelist = (EdgeTableEntry *)NULL;
pPrevSLL->next = pSLL;
}
pSLL->scanline = scanline;
/*
* now insert the edge in the right bucket
*/
prev = (EdgeTableEntry *)NULL;
start = pSLL->edgelist;
while (start && (start->bres.minor_axis < ETE->bres.minor_axis))
{
prev = start;
start = start->next;
}
ETE->next = start;
if (prev)
prev->next = ETE;
else
pSLL->edgelist = ETE;
}
/*
* CreateEdgeTable
*
* This routine creates the edge table for
* scan converting polygons.
* The Edge Table (ET) looks like:
*
* EdgeTable
* --------
* | ymax | ScanLineLists
* |scanline|-->------------>-------------->...
* -------- |scanline| |scanline|
* |edgelist| |edgelist|
* --------- ---------
* | |
* | |
* V V
* list of ETEs list of ETEs
*
* where ETE is an EdgeTableEntry data structure,
* and there is one ScanLineList per scanline at
* which an edge is initially entered.
*
*/
static void
CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
int count;
GdkPoint *pts;
EdgeTable *ET;
EdgeTableEntry *AET;
EdgeTableEntry *pETEs;
ScanLineListBlock *pSLLBlock;
{
GdkPoint *top, *bottom;
GdkPoint *PrevPt, *CurrPt;
int iSLLBlock = 0;
int dy;
if (count < 2) return;
/*
* initialize the Active Edge Table
*/
AET->next = (EdgeTableEntry *)NULL;
AET->back = (EdgeTableEntry *)NULL;
AET->nextWETE = (EdgeTableEntry *)NULL;
AET->bres.minor_axis = SMALL_COORDINATE;
/*
* initialize the Edge Table.
*/
ET->scanlines.next = (ScanLineList *)NULL;
ET->ymax = SMALL_COORDINATE;
ET->ymin = LARGE_COORDINATE;
pSLLBlock->next = (ScanLineListBlock *)NULL;
PrevPt = &pts[count-1];
/*
* for each vertex in the array of points.
* In this loop we are dealing with two vertices at
* a time -- these make up one edge of the polygon.
*/
while (count--)
{
CurrPt = pts++;
/*
* find out which point is above and which is below.
*/
if (PrevPt->y > CurrPt->y)
{
bottom = PrevPt, top = CurrPt;
pETEs->ClockWise = 0;
}
else
{
bottom = CurrPt, top = PrevPt;
pETEs->ClockWise = 1;
}
/*
* don't add horizontal edges to the Edge table.
*/
if (bottom->y != top->y)
{
pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
/*
* initialize integer edge algorithm
*/
dy = bottom->y - top->y;
BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock);
if (PrevPt->y > ET->ymax)
ET->ymax = PrevPt->y;
if (PrevPt->y < ET->ymin)
ET->ymin = PrevPt->y;
pETEs++;
}
PrevPt = CurrPt;
}
}
/*
* loadAET
*
* This routine moves EdgeTableEntries from the
* EdgeTable into the Active Edge Table,
* leaving them sorted by smaller x coordinate.
*
*/
static void
loadAET(AET, ETEs)
EdgeTableEntry *AET, *ETEs;
{
EdgeTableEntry *pPrevAET;
EdgeTableEntry *tmp;
pPrevAET = AET;
AET = AET->next;
while (ETEs)
{
while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis))
{
pPrevAET = AET;
AET = AET->next;
}
tmp = ETEs->next;
ETEs->next = AET;
if (AET)
AET->back = ETEs;
ETEs->back = pPrevAET;
pPrevAET->next = ETEs;
pPrevAET = ETEs;
ETEs = tmp;
}
}
/*
* computeWAET
*
* This routine links the AET by the
* nextWETE (winding EdgeTableEntry) link for
* use by the winding number rule. The final
* Active Edge Table (AET) might look something
* like:
*
* AET
* ---------- --------- ---------
* |ymax | |ymax | |ymax |
* | ... | |... | |... |
* |next |->|next |->|next |->...
* |nextWETE| |nextWETE| |nextWETE|
* --------- --------- ^--------
* | | |
* V-------------------> V---> ...
*
*/
static void
computeWAET(AET)
EdgeTableEntry *AET;
{
EdgeTableEntry *pWETE;
int inside = 1;
int isInside = 0;
AET->nextWETE = (EdgeTableEntry *)NULL;
pWETE = AET;
AET = AET->next;
while (AET)
{
if (AET->ClockWise)
isInside++;
else
isInside--;
if ((!inside && !isInside) ||
( inside && isInside))
{
pWETE->nextWETE = AET;
pWETE = AET;
inside = !inside;
}
AET = AET->next;
}
pWETE->nextWETE = (EdgeTableEntry *)NULL;
}
/*
* InsertionSort
*
* Just a simple insertion sort using
* pointers and back pointers to sort the Active
* Edge Table.
*
*/
static int
InsertionSort(AET)
EdgeTableEntry *AET;
{
EdgeTableEntry *pETEchase;
EdgeTableEntry *pETEinsert;
EdgeTableEntry *pETEchaseBackTMP;
int changed = 0;
AET = AET->next;
while (AET)
{
pETEinsert = AET;
pETEchase = AET;
while (pETEchase->back->bres.minor_axis > AET->bres.minor_axis)
pETEchase = pETEchase->back;
AET = AET->next;
if (pETEchase != pETEinsert)
{
pETEchaseBackTMP = pETEchase->back;
pETEinsert->back->next = AET;
if (AET)
AET->back = pETEinsert->back;
pETEinsert->next = pETEchase;
pETEchase->back->next = pETEinsert;
pETEchase->back = pETEinsert;
pETEinsert->back = pETEchaseBackTMP;
changed = 1;
}
}
return(changed);
}
/*
* Clean up our act.
*/
static void
FreeStorage(pSLLBlock)
ScanLineListBlock *pSLLBlock;
{
ScanLineListBlock *tmpSLLBlock;
while (pSLLBlock)
{
tmpSLLBlock = pSLLBlock->next;
g_free (pSLLBlock);
pSLLBlock = tmpSLLBlock;
}
}
/*
* Create an array of rectangles from a list of points.
* If indeed these things (POINTS, RECTS) are the same,
* then this proc is still needed, because it allocates
* storage for the array, which was allocated on the
* stack by the calling procedure.
*
*/
static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg)
int numFullPtBlocks, iCurPtBlock;
POINTBLOCK *FirstPtBlock;
GdkRegion *reg;
{
GdkRegionBox *rects;
GdkPoint *pts;
POINTBLOCK *CurPtBlock;
int i;
GdkRegionBox *extents;
int numRects;
extents = &reg->extents;
numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
reg->rects = g_renew (GdkRegionBox, reg->rects, numRects);
reg->size = numRects;
CurPtBlock = FirstPtBlock;
rects = reg->rects - 1;
numRects = 0;
extents->x1 = G_MAXSHORT, extents->x2 = G_MINSHORT;
for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) {
/* the loop uses 2 points per iteration */
i = NUMPTSTOBUFFER >> 1;
if (!numFullPtBlocks)
i = iCurPtBlock >> 1;
for (pts = CurPtBlock->pts; i--; pts += 2) {
if (pts->x == pts[1].x)
continue;
if (numRects && pts->x == rects->x1 && pts->y == rects->y2 &&
pts[1].x == rects->x2 &&
(numRects == 1 || rects[-1].y1 != rects->y1) &&
(i && pts[2].y > pts[1].y)) {
rects->y2 = pts[1].y + 1;
continue;
}
numRects++;
rects++;
rects->x1 = pts->x; rects->y1 = pts->y;
rects->x2 = pts[1].x; rects->y2 = pts[1].y + 1;
if (rects->x1 < extents->x1)
extents->x1 = rects->x1;
if (rects->x2 > extents->x2)
extents->x2 = rects->x2;
}
CurPtBlock = CurPtBlock->next;
}
if (numRects) {
extents->y1 = reg->rects->y1;
extents->y2 = rects->y2;
} else {
extents->x1 = 0;
extents->y1 = 0;
extents->x2 = 0;
extents->y2 = 0;
}
reg->numRects = numRects;
return(TRUE);
}
/*
* polytoregion
*
* Scan converts a polygon by returning a run-length
* encoding of the resultant bitmap -- the run-length
* encoding is in the form of an array of rectangles.
*/
GdkRegion *
gdk_region_polygon(GdkPoint *Pts, gint Count, GdkFillRule rule)
{
GdkRegion *region;
EdgeTableEntry *pAET; /* Active Edge Table */
int y; /* current scanline */
int iPts = 0; /* number of pts in buffer */
EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/
ScanLineList *pSLL; /* current scanLineList */
GdkPoint *pts; /* output buffer */
EdgeTableEntry *pPrevAET; /* ptr to previous AET */
EdgeTable ET; /* header node for ET */
EdgeTableEntry AET; /* header node for AET */
EdgeTableEntry *pETEs; /* EdgeTableEntries pool */
ScanLineListBlock SLLBlock; /* header for scanlinelist */
int fixWAET = FALSE;
POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
POINTBLOCK *tmpPtBlock;
int numFullPtBlocks = 0;
region = gdk_region_new ();
/* special case a rectangle */
pts = Pts;
if (((Count == 4) ||
((Count == 5) && (pts[4].x == pts[0].x) && (pts[4].y == pts[0].y))) &&
(((pts[0].y == pts[1].y) &&
(pts[1].x == pts[2].x) &&
(pts[2].y == pts[3].y) &&
(pts[3].x == pts[0].x)) ||
((pts[0].x == pts[1].x) &&
(pts[1].y == pts[2].y) &&
(pts[2].x == pts[3].x) &&
(pts[3].y == pts[0].y)))) {
region->extents.x1 = MIN(pts[0].x, pts[2].x);
region->extents.y1 = MIN(pts[0].y, pts[2].y);
region->extents.x2 = MAX(pts[0].x, pts[2].x);
region->extents.y2 = MAX(pts[0].y, pts[2].y);
if ((region->extents.x1 != region->extents.x2) &&
(region->extents.y1 != region->extents.y2)) {
region->numRects = 1;
*(region->rects) = region->extents;
}
return(region);
}
pETEs = g_new (EdgeTableEntry, Count);
pts = FirstPtBlock.pts;
CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock);
pSLL = ET.scanlines.next;
curPtBlock = &FirstPtBlock;
if (rule == GDK_EVEN_ODD_RULE) {
/*
* for each scanline
*/
for (y = ET.ymin; y < ET.ymax; y++) {
/*
* Add a new edge to the active edge table when we
* get to the next edge.
*/
if (pSLL != NULL && y == pSLL->scanline) {
loadAET(&AET, pSLL->edgelist);
pSLL = pSLL->next;
}
pPrevAET = &AET;
pAET = AET.next;
/*
* for each active edge
*/
while (pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++;
/*
* send out the buffer
*/
if (iPts == NUMPTSTOBUFFER) {
tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
curPtBlock->next = tmpPtBlock;
curPtBlock = tmpPtBlock;
pts = curPtBlock->pts;
numFullPtBlocks++;
iPts = 0;
}
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
}
(void) InsertionSort(&AET);
}
}
else {
/*
* for each scanline
*/
for (y = ET.ymin; y < ET.ymax; y++) {
/*
* Add a new edge to the active edge table when we
* get to the next edge.
*/
if (pSLL != NULL && y == pSLL->scanline) {
loadAET(&AET, pSLL->edgelist);
computeWAET(&AET);
pSLL = pSLL->next;
}
pPrevAET = &AET;
pAET = AET.next;
pWETE = pAET;
/*
* for each active edge
*/
while (pAET) {
/*
* add to the buffer only those edges that
* are in the Winding active edge table.
*/
if (pWETE == pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++;
/*
* send out the buffer
*/
if (iPts == NUMPTSTOBUFFER) {
tmpPtBlock = (POINTBLOCK *)g_malloc(sizeof(POINTBLOCK));
curPtBlock->next = tmpPtBlock;
curPtBlock = tmpPtBlock;
pts = curPtBlock->pts;
numFullPtBlocks++; iPts = 0;
}
pWETE = pWETE->nextWETE;
}
EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
}
/*
* recompute the winding active edge table if
* we just resorted or have exited an edge.
*/
if (InsertionSort(&AET) || fixWAET) {
computeWAET(&AET);
fixWAET = FALSE;
}
}
}
FreeStorage(SLLBlock.next);
(void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
tmpPtBlock = curPtBlock->next;
g_free (curPtBlock);
curPtBlock = tmpPtBlock;
}
g_free (pETEs);
return(region);
}

View File

@@ -27,38 +27,83 @@
#ifndef __GDK_PRIVATE_H__
#define __GDK_PRIVATE_H__
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkfont.h>
#include <gdk/gdkgc.h>
#include <gdk/gdkim.h>
#include <gdk/gdkimage.h>
#include <gdk/gdkregion.h>
#include <gdk/gdkvisual.h>
#include <gdk/gdkwindow.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GDK_PARENT_RELATIVE_BG ((GdkPixmap *)1L)
#define GDK_NO_BG ((GdkPixmap *)2L)
#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkWindowPrivate GdkWindowPrivate;
typedef struct _GdkWindowPrivate GdkPixmapPrivate;
typedef struct _GdkImagePrivate GdkImagePrivate;
typedef struct _GdkGCPrivate GdkGCPrivate;
typedef struct _GdkColormapPrivate GdkColormapPrivate;
typedef struct _GdkColorInfo GdkColorInfo;
typedef struct _GdkVisualPrivate GdkVisualPrivate;
typedef struct _GdkFontPrivate GdkFontPrivate;
typedef struct _GdkCursorPrivate GdkCursorPrivate;
typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkClientFilter GdkClientFilter;
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
typedef struct _GdkRegionPrivate GdkRegionPrivate;
struct _GdkFontPrivate
struct _GdkWindowPrivate
{
GdkFont font;
GdkWindow window;
GdkWindow *parent;
Window xwindow;
Display *xdisplay;
gint16 x;
gint16 y;
guint16 width;
guint16 height;
guint8 resize_count;
guint8 window_type;
guint ref_count;
guint destroyed : 2;
guint mapped : 1;
guint guffaw_gravity : 1;
gint extension_events;
GList *filters;
GdkColormap *colormap;
GList *children;
};
struct _GdkImagePrivate
{
GdkImage image;
XImage *ximage;
Display *xdisplay;
gpointer x_shm_info;
void (*image_put) (GdkDrawable *window,
GdkGC *gc,
GdkImage *image,
gint xsrc,
gint ysrc,
gint xdest,
gint ydest,
gint width,
gint height);
};
struct _GdkGCPrivate
{
GdkGC gc;
GC xgc;
Display *xdisplay;
guint ref_count;
};
@@ -72,6 +117,74 @@ struct _GdkColorInfo
guint ref_count;
};
struct _GdkColormapPrivate
{
GdkColormap colormap;
Colormap xcolormap;
Display *xdisplay;
GdkVisual *visual;
gint private_val;
GHashTable *hash;
GdkColorInfo *info;
time_t last_sync_time;
guint ref_count;
};
struct _GdkVisualPrivate
{
GdkVisual visual;
Visual *xvisual;
};
struct _GdkFontPrivate
{
GdkFont font;
/* XFontStruct *xfont; */
/* generic pointer point to XFontStruct or XFontSet */
gpointer xfont;
Display *xdisplay;
guint ref_count;
GSList *names;
};
struct _GdkCursorPrivate
{
GdkCursor cursor;
Cursor xcursor;
Display *xdisplay;
};
struct _GdkDndCursorInfo {
Cursor gdk_cursor_dragdefault, gdk_cursor_dragok;
GdkWindow *drag_pm_default, *drag_pm_ok;
GdkPoint default_hotspot, ok_hotspot;
GList *xids;
};
typedef struct _GdkDndCursorInfo GdkDndCursorInfo;
struct _GdkDndGlobals {
GdkAtom gdk_XdeEnter, gdk_XdeLeave, gdk_XdeRequest;
GdkAtom gdk_XdeDataAvailable, gdk_XdeDataShow, gdk_XdeCancel;
GdkAtom gdk_XdeTypelist;
GdkDndCursorInfo *c;
GdkWindow **drag_startwindows;
guint drag_numwindows;
gboolean drag_really, drag_perhaps, dnd_grabbed;
Window dnd_drag_target;
GdkPoint drag_dropcoords;
GdkPoint dnd_drag_start, dnd_drag_oldpos;
GdkRectangle dnd_drag_dropzone;
GdkWindowPrivate *real_sw;
Window dnd_drag_curwin;
Time last_drop_time; /* An incredible hack, sosumi miguel */
};
typedef struct _GdkDndGlobals GdkDndGlobals;
struct _GdkEventFilter {
GdkFilterFunc function;
gpointer data;
@@ -83,11 +196,131 @@ struct _GdkClientFilter {
gpointer data;
};
#ifdef USE_XIM
typedef struct _GdkICPrivate GdkICPrivate;
struct _GdkICPrivate
{
XIC xic;
GdkICAttr *attr;
GdkICAttributesType mask;
};
#endif /* USE_XIM */
struct _GdkColorContextPrivate
{
GdkColorContext color_context;
Display *xdisplay;
XStandardColormap std_cmap;
};
struct _GdkRegionPrivate
{
GdkRegion region;
Region xregion;
};
typedef enum {
GDK_DEBUG_MISC = 1 << 0,
GDK_DEBUG_EVENTS = 1 << 1,
GDK_DEBUG_DND = 1 << 2,
GDK_DEBUG_COLOR_CONTEXT = 1 << 3,
GDK_DEBUG_XIM = 1 << 4
} GdkDebugFlag;
void gdk_events_init (void);
void gdk_window_init (void);
void gdk_visual_init (void);
void gdk_dnd_init (void);
void gdk_image_init (void);
void gdk_image_exit (void);
GdkColormap* gdk_colormap_lookup (Colormap xcolormap);
GdkVisual* gdk_visual_lookup (Visual *xvisual);
void gdk_window_add_colormap_windows (GdkWindow *window);
void gdk_window_destroy_notify (GdkWindow *window);
GDKVAR GdkWindow *gdk_parent_root;
GDKVAR gint gdk_error_code;
GDKVAR gint gdk_error_warnings;
void gdk_xid_table_insert (XID *xid,
gpointer data);
void gdk_xid_table_remove (XID xid);
gpointer gdk_xid_table_lookup (XID xid);
gint gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
XEvent *event_send);
/* If you pass x = y = -1, it queries the pointer
to find out where it currently is.
If you pass x = y = -2, it does anything necessary
to know that the drag is ending.
*/
void gdk_dnd_display_drag_cursor(gint x,
gint y,
gboolean drag_ok,
gboolean change_made);
/* Please see gdkwindow.c for comments on how to use */
Window gdk_window_xid_at(Window base, gint bx, gint by, gint x, gint y, GList *excludes, gboolean excl_child);
Window gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child);
extern gint gdk_debug_level;
extern gint gdk_show_events;
extern gint gdk_use_xshm;
extern gint gdk_stack_trace;
extern gchar *gdk_display_name;
extern Display *gdk_display;
extern gint gdk_screen;
extern Window gdk_root_window;
extern Window gdk_leader_window;
extern GdkWindowPrivate gdk_root_parent;
extern Atom gdk_wm_delete_window;
extern Atom gdk_wm_take_focus;
extern Atom gdk_wm_protocols;
extern Atom gdk_wm_window_protocols[];
extern Atom gdk_selection_property;
extern GdkDndGlobals gdk_dnd;
extern GdkWindow *selection_owner[];
extern gchar *gdk_progclass;
extern gint gdk_error_code;
extern gint gdk_error_warnings;
extern gint gdk_null_window_warnings;
extern GList *gdk_default_filters;
extern const int gdk_nevent_masks;
extern const int gdk_event_mask_table[];
extern GdkWindowPrivate *gdk_xgrab_window; /* Window that currently holds the
* x pointer grab
*/
#ifdef USE_XIM
/* XIM support */
gint gdk_im_open (void);
void gdk_im_close (void);
void gdk_ic_cleanup (void);
extern GdkICPrivate *gdk_xim_ic; /* currently using IC */
extern GdkWindow *gdk_xim_window; /* currently using Window */
#endif /* USE_XIM */
/* Debugging support */
#ifdef G_ENABLE_DEBUG
#define GDK_NOTE(type,action) G_STMT_START { \
if (gdk_debug_flags & GDK_DEBUG_##type) \
{ action; }; } G_STMT_END
#else /* !G_ENABLE_DEBUG */
#define GDK_NOTE(type,action)
#endif /* G_ENABLE_DEBUG */
extern guint gdk_debug_flags;
#ifdef __cplusplus
}
@@ -95,8 +328,3 @@ GDKVAR gint gdk_error_warnings;
#endif /* __GDK_PRIVATE_H__ */

View File

@@ -27,20 +27,16 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
#include "gdkx.h"
#include "gdkproperty.h"
#include "gdk.h"
#include "gdkprivate.h"
GdkAtom
gdk_atom_intern (const gchar *atom_name,
gboolean only_if_exists)
gint only_if_exists)
{
GdkAtom retval;
static GHashTable *atom_hash = NULL;
g_return_val_if_fail (atom_name != NULL, GDK_NONE);
if (!atom_hash)
atom_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -112,16 +108,16 @@ gdk_property_get (GdkWindow *window,
gulong ret_length;
guchar *ret_data;
g_return_val_if_fail (window != NULL, FALSE);
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
if (window)
{
if (GDK_WINDOW_DESTROYED (window))
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return FALSE;
xdisplay = GDK_WINDOW_XDISPLAY (window);
xwindow = GDK_WINDOW_XID (window);
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
else
{
@@ -190,27 +186,27 @@ gdk_property_get (GdkWindow *window,
}
void
gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
const guchar *data,
gint nelements)
gdk_property_change (GdkWindow *window,
GdkAtom property,
GdkAtom type,
gint format,
GdkPropMode mode,
guchar *data,
gint nelements)
{
Display *xdisplay;
Window xwindow;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (window)
{
if (GDK_WINDOW_DESTROYED (window))
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xdisplay = GDK_WINDOW_XDISPLAY (window);
xwindow = GDK_WINDOW_XID (window);
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
else
{
@@ -219,7 +215,7 @@ gdk_property_change (GdkWindow *window,
}
XChangeProperty (xdisplay, xwindow, property, type,
format, mode, (guchar *)data, nelements);
format, mode, data, nelements);
}
void
@@ -229,16 +225,16 @@ gdk_property_delete (GdkWindow *window,
Display *xdisplay;
Window xwindow;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
if (window)
{
if (GDK_WINDOW_DESTROYED (window))
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
xdisplay = GDK_WINDOW_XDISPLAY (window);
xwindow = GDK_WINDOW_XID (window);
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
else
{

View File

@@ -1,58 +0,0 @@
#ifndef __GDK_PROPERTY_H__
#define __GDK_PROPERTY_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef enum
{
GDK_PROP_MODE_REPLACE,
GDK_PROP_MODE_PREPEND,
GDK_PROP_MODE_APPEND
} GdkPropMode;
GdkAtom gdk_atom_intern (const gchar *atom_name,
gboolean 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,
const guchar *data,
gint nelements);
void gdk_property_delete (GdkWindow *window,
GdkAtom property);
gint gdk_text_property_to_text_list (GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list);
void gdk_free_text_list (gchar **list);
gint gdk_string_to_compound_text (const gchar *str,
GdkAtom *encoding,
gint *format,
guchar **ctext,
gint *length);
void gdk_free_compound_text (guchar *ctext);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_PROPERTY_H__ */

View File

@@ -24,25 +24,23 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include <gdk/gdk.h>
#include "gdk.h"
void
gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest)
{
gint dest_x, dest_y;
g_return_if_fail (src1 != NULL);
g_return_if_fail (src2 != NULL);
g_return_if_fail (dest != NULL);
dest_x = MIN (src1->x, src2->x);
dest_y = MIN (src1->y, src2->y);
dest->width = MAX (src1->x + src1->width, src2->x + src2->width) - dest_x;
dest->height = MAX (src1->y + src1->height, src2->y + src2->height) - dest_y;
dest->x = dest_x;
dest->y = dest_y;
dest->x = MIN (src1->x, src2->x);
dest->y = MIN (src1->y, src2->y);
dest->width = MAX (src1->x + src1->width, src2->x + src2->width) - dest->x;
dest->height = MAX (src1->y + src1->height, src2->y + src2->height) - dest->y;
}
gboolean
@@ -67,13 +65,13 @@ gdk_rectangle_intersect (GdkRectangle *src1,
src1 = src2;
src2 = temp;
}
dest->x = src2->x;
src1_x2 = src1->x + src1->width;
src2_x2 = src2->x + src2->width;
if (src2->x < src1_x2)
{
dest->x = src2->x;
if (src1_x2 < src2_x2)
dest->width = src1_x2 - dest->x;
else
@@ -85,6 +83,8 @@ gdk_rectangle_intersect (GdkRectangle *src1,
src1 = src2;
src2 = temp;
}
dest->y = src2->y;
src1_y2 = src1->y + src1->height;
src2_y2 = src2->y + src2->height;
@@ -92,8 +92,6 @@ gdk_rectangle_intersect (GdkRectangle *src1,
{
return_val = TRUE;
dest->y = src2->y;
if (src1_y2 < src2_y2)
dest->height = src1_y2 - dest->y;
else
@@ -106,11 +104,5 @@ gdk_rectangle_intersect (GdkRectangle *src1,
}
}
if (!return_val)
{
dest->width = 0;
dest->height = 0;
}
return return_val;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,167 +0,0 @@
/* $TOG: region.h /main/9 1998/02/06 17:50:30 kaleb $ */
/************************************************************************
Copyright 1987, 1998 The Open Group
All Rights Reserved.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
#ifndef __GDK_REGION_GENERIC_H__
#define __GDK_REGION_GENERIC_H__
typedef struct _GdkRegionBox GdkRegionBox;
struct _GdkRegionBox
{
int x1, x2, y1, y2;
};
/*
* clip region
*/
struct _GdkRegion
{
long size;
long numRects;
GdkRegionBox *rects;
GdkRegionBox extents;
};
/* 1 if two BOXs overlap.
* 0 if two BOXs do not overlap.
* Remember, x2 and y2 are not in the region
*/
#define EXTENTCHECK(r1, r2) \
((r1)->x2 > (r2)->x1 && \
(r1)->x1 < (r2)->x2 && \
(r1)->y2 > (r2)->y1 && \
(r1)->y1 < (r2)->y2)
/*
* update region extents
*/
#define EXTENTS(r,idRect){\
if((r)->x1 < (idRect)->extents.x1)\
(idRect)->extents.x1 = (r)->x1;\
if((r)->y1 < (idRect)->extents.y1)\
(idRect)->extents.y1 = (r)->y1;\
if((r)->x2 > (idRect)->extents.x2)\
(idRect)->extents.x2 = (r)->x2;\
if((r)->y2 > (idRect)->extents.y2)\
(idRect)->extents.y2 = (r)->y2;\
}
/*
* Check to see if there is enough memory in the present region.
*/
#define MEMCHECK(reg, rect, firstrect){ \
if ((reg)->numRects >= ((reg)->size - 1)) { \
(firstrect) = g_renew (GdkRegionBox, (firstrect), 2 * (reg)->size); \
(reg)->size *= 2; \
(rect) = &(firstrect)[(reg)->numRects]; \
} \
}
/* this routine checks to see if the previous rectangle is the same
* or subsumes the new rectangle to add.
*/
#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\
(!(((Reg)->numRects > 0)&&\
((R-1)->y1 == (Ry1)) &&\
((R-1)->y2 == (Ry2)) &&\
((R-1)->x1 <= (Rx1)) &&\
((R-1)->x2 >= (Rx2))))
/* add a rectangle to the given Region */
#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\
if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
(r)->x1 = (rx1);\
(r)->y1 = (ry1);\
(r)->x2 = (rx2);\
(r)->y2 = (ry2);\
EXTENTS((r), (reg));\
(reg)->numRects++;\
(r)++;\
}\
}
/* add a rectangle to the given Region */
#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\
if ((rx1 < rx2) && (ry1 < ry2) &&\
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
(r)->x1 = (rx1);\
(r)->y1 = (ry1);\
(r)->x2 = (rx2);\
(r)->y2 = (ry2);\
(reg)->numRects++;\
(r)++;\
}\
}
#define EMPTY_REGION(pReg) pReg->numRects = 0
#define REGION_NOT_EMPTY(pReg) pReg->numRects
#define INBOX(r, x, y) \
( ( ((r).x2 > x)) && \
( ((r).x1 <= x)) && \
( ((r).y2 > y)) && \
( ((r).y1 <= y)) )
/*
* number of points to buffer before sending them off
* to scanlines() : Must be an even number
*/
#define NUMPTSTOBUFFER 200
/*
* used to allocate buffers for points and link
* the buffers together
*/
typedef struct _POINTBLOCK {
GdkPoint pts[NUMPTSTOBUFFER];
struct _POINTBLOCK *next;
} POINTBLOCK;
#endif /* __GDK_REGION_GENERIC_H__ */

View File

@@ -26,7 +26,11 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "gdkprivate-x11.h"
#include "gdk.h"
#include "gdkprivate.h"
GdkRegion*
gdk_region_new (void)
@@ -89,19 +93,19 @@ void
gdk_region_get_clipbox(GdkRegion *region,
GdkRectangle *rectangle)
{
GdkRegionPrivate *rp;
XRectangle r;
g_return_if_fail(region != NULL);
g_return_if_fail(rectangle != NULL);
rp = (GdkRegionPrivate *)region;
XClipBox(rp->xregion, &r);
rectangle->x = r.x;
rectangle->y = r.y;
rectangle->width = r.width;
rectangle->height = r.height;
GdkRegionPrivate *rp;
XRectangle r;
g_return_if_fail(region != NULL);
g_return_if_fail(rectangle != NULL);
rp = (GdkRegionPrivate *)region;
XClipBox(rp->xregion, &r);
rectangle->x = r.x;
rectangle->y = r.y;
rectangle->width = r.width;
rectangle->height = r.height;
}
gboolean

View File

@@ -1,73 +0,0 @@
#ifndef __GDK_REGION_H__
#define __GDK_REGION_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* GC fill rule for polygons
* EvenOddRule
* WindingRule
*/
typedef enum
{
GDK_EVEN_ODD_RULE,
GDK_WINDING_RULE
} GdkFillRule;
/* Types of overlapping between a rectangle and a region
* GDK_OVERLAP_RECTANGLE_IN: rectangle is in region
* GDK_OVERLAP_RECTANGLE_OUT: rectangle in not in region
* GDK_OVERLAP_RECTANGLE_PART: rectangle in partially in region
*/
typedef enum
{
GDK_OVERLAP_RECTANGLE_IN,
GDK_OVERLAP_RECTANGLE_OUT,
GDK_OVERLAP_RECTANGLE_PART
} GdkOverlapType;
GdkRegion *gdk_region_new (void);
GdkRegion *gdk_region_polygon (GdkPoint *points,
gint npoints,
GdkFillRule fill_rule);
GdkRegion *gdk_region_copy (GdkRegion *region);
GdkRegion *gdk_region_rectangle (GdkRectangle *rectangle);
void gdk_region_destroy (GdkRegion *region);
void gdk_region_get_clipbox (GdkRegion *region,
GdkRectangle *rectangle);
gboolean gdk_region_empty (GdkRegion *region);
gboolean gdk_region_equal (GdkRegion *region1,
GdkRegion *region2);
gboolean gdk_region_point_in (GdkRegion *region,
int x,
int y);
GdkOverlapType gdk_region_rect_in (GdkRegion *region,
GdkRectangle *rect);
void gdk_region_offset (GdkRegion *region,
gint dx,
gint dy);
void gdk_region_shrink (GdkRegion *region,
gint dx,
gint dy);
void gdk_region_union_with_rect (GdkRegion *region,
GdkRectangle *rect);
void gdk_region_intersect (GdkRegion *source1,
GdkRegion *source2);
void gdk_region_union (GdkRegion *source1,
GdkRegion *source2);
void gdk_region_subtract (GdkRegion *source1,
GdkRegion *source2);
void gdk_region_xor (GdkRegion *source1,
GdkRegion *source2);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_REGION_H__ */

View File

@@ -56,12 +56,12 @@
#else
/* Compiling as a part of Gtk 1.1 or later */
#include "config.h"
#include "../config.h"
#include "gdk.h"
#include "gdkprivate.h"
#endif
#include "gdk.h" /* For gdk_flush() */
#include "gdkrgb.h"
typedef struct _GdkRgbInfo GdkRgbInfo;
@@ -73,16 +73,6 @@ typedef void (*GdkRgbConvFunc) (GdkImage *image,
gint x_align, gint y_align,
GdkRgbCmap *cmap);
static const gchar* visual_names[] =
{
"static gray",
"grayscale",
"static color",
"pseudo color",
"true color",
"direct color",
};
/* Some of these fields should go, as they're not being used at all.
Globals should generally migrate into here - it's very likely that
we'll want to run more than one GdkRgbInfo context at the same time
@@ -226,7 +216,7 @@ gdk_rgb_try_colormap (gint nr, gint ng, gint nb)
gint idx;
gint best[256];
if (nr * ng * nb < gdk_rgb_min_colors)
if (!image_info->cmap_alloced && nr * ng * nb < gdk_rgb_min_colors)
return FALSE;
if (image_info->cmap_alloced)
@@ -415,6 +405,16 @@ static guint32
gdk_rgb_score_visual (GdkVisual *visual)
{
guint32 quality, speed, sys, pseudo;
static const gchar* visual_names[] =
{
"static gray",
"grayscale",
"static color",
"pseudo color",
"true color",
"direct color",
};
quality = 0;
speed = 1;
@@ -466,7 +466,8 @@ gdk_rgb_score_visual (GdkVisual *visual)
pseudo = (visual->type == GDK_VISUAL_PSEUDO_COLOR || visual->type == GDK_VISUAL_TRUE_COLOR);
if (gdk_rgb_verbose)
g_print ("Visual type = %s, depth = %d, %x:%x:%x%s; score=%x\n",
g_print ("Visual 0x%x, type = %s, depth = %d, %x:%x:%x%s; score=%x\n",
(gint)(((GdkVisualPrivate *)visual)->xvisual->visualid),
visual_names[visual->type],
visual->depth,
visual->red_mask,
@@ -2680,19 +2681,12 @@ gdk_rgb_select_conv (GdkImage *image)
gboolean mask_rgb, mask_bgr;
depth = image_info->visual->depth;
/* FIXME: save the bpp in the image; this is hack that works for
* common visuals, not otherwise.
*/
if (depth <= 8)
bpp = depth;
else
bpp = 8 * image->bpp;
bpp = ((GdkImagePrivate *)image)->ximage->bits_per_pixel;
byte_order = image->byte_order;
if (gdk_rgb_verbose)
g_print ("Chose visual type=%s depth=%d, image bpp=%d, %s first\n",
visual_names[image_info->visual->type], image_info->visual->depth,
g_print ("Chose visual 0x%x, image bpp=%d, %s first\n",
(gint)(((GdkVisualPrivate *)image_info->visual)->xvisual->visualid),
bpp, byte_order == GDK_LSB_FIRST ? "lsb" : "msb");
#if G_BYTE_ORDER == G_BIG_ENDIAN

View File

@@ -27,8 +27,6 @@
#ifndef __GDK_RGB_H__
#define __GDK_RGB_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

View File

@@ -27,29 +27,30 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <string.h>
#include "gdkproperty.h"
#include "gdkselection.h"
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkprivate-x11.h"
#include "gdkx.h"
gboolean
gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gboolean send_event)
gint send_event)
{
Display *xdisplay;
Window xwindow;
if (owner)
{
if (GDK_WINDOW_DESTROYED (owner))
GdkWindowPrivate *private;
private = (GdkWindowPrivate*) owner;
if (private->destroyed)
return FALSE;
xdisplay = GDK_WINDOW_XDISPLAY (owner);
xwindow = GDK_WINDOW_XID (owner);
xdisplay = private->xdisplay;
xwindow = private->xwindow;
}
else
{
@@ -80,11 +81,16 @@ gdk_selection_convert (GdkWindow *requestor,
GdkAtom target,
guint32 time)
{
if (GDK_WINDOW_DESTROYED (requestor))
GdkWindowPrivate *private;
g_return_if_fail (requestor != NULL);
private = (GdkWindowPrivate*) requestor;
if (private->destroyed)
return;
XConvertSelection (GDK_WINDOW_XDISPLAY (requestor), selection, target,
gdk_selection_property, GDK_WINDOW_XID (requestor), time);
XConvertSelection (private->xdisplay, selection, target,
gdk_selection_property, private->xwindow, time);
}
gint
@@ -93,6 +99,7 @@ gdk_selection_property_get (GdkWindow *requestor,
GdkAtom *ret_type,
gint *ret_format)
{
GdkWindowPrivate *private;
gulong nitems;
gulong nbytes;
gulong length;
@@ -101,18 +108,17 @@ gdk_selection_property_get (GdkWindow *requestor,
guchar *t = NULL;
g_return_val_if_fail (requestor != NULL, 0);
g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0);
/* If retrieved chunks are typically small, (and the ICCCM says the
should be) it would be a win to try first with a buffer of
moderate length, to avoid two round trips to the server */
if (GDK_WINDOW_DESTROYED (requestor))
private = (GdkWindowPrivate*) requestor;
if (private->destroyed)
return 0;
t = NULL;
XGetWindowProperty (GDK_WINDOW_XDISPLAY (requestor),
GDK_WINDOW_XID (requestor),
XGetWindowProperty (private->xdisplay, private->xwindow,
gdk_selection_property, 0, 0, False,
AnyPropertyType, &prop_type, &prop_format,
&nitems, &nbytes, &t);
@@ -142,8 +148,7 @@ gdk_selection_property_get (GdkWindow *requestor,
protocol, in which case the client has to make sure they'll be
notified of PropertyChange events _before_ the property is deleted.
Otherwise there's no guarantee we'll win the race ... */
XGetWindowProperty (GDK_DRAWABLE_XDISPLAY (requestor),
GDK_DRAWABLE_XID (requestor),
XGetWindowProperty (private->xdisplay, private->xwindow,
gdk_selection_property, 0, (nbytes + 3) / 4, False,
AnyPropertyType, &prop_type, &prop_format,
&nitems, &nbytes, &t);
@@ -187,11 +192,9 @@ gdk_selection_send_notify (guint32 requestor,
}
gint
gdk_text_property_to_text_list (GdkAtom encoding,
gint format,
const guchar *text,
gint length,
gchar ***list)
gdk_text_property_to_text_list (GdkAtom encoding, gint format,
guchar *text, gint length,
gchar ***list)
{
XTextProperty property;
gint count = 0;
@@ -200,7 +203,7 @@ gdk_text_property_to_text_list (GdkAtom encoding,
if (!list)
return 0;
property.value = (guchar *)text;
property.value = text;
property.encoding = encoding;
property.format = format;
property.nitems = length;
@@ -223,10 +226,8 @@ gdk_free_text_list (gchar **list)
gint
gdk_string_to_compound_text (const gchar *str,
GdkAtom *encoding,
gint *format,
guchar **ctext,
gint *length)
GdkAtom *encoding, gint *format,
guchar **ctext, gint *length)
{
gint res;
XTextProperty property;

View File

@@ -1,65 +0,0 @@
#ifndef __GDK_SELECTION_H__
#define __GDK_SELECTION_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* The next three types define enums for predefined atoms relating
to selections. In general, one will need to use gdk_intern_atom */
typedef enum
{
GDK_SELECTION_PRIMARY = 1,
GDK_SELECTION_SECONDARY = 2
} GdkSelection;
typedef enum
{
GDK_TARGET_BITMAP = 5,
GDK_TARGET_COLORMAP = 7,
GDK_TARGET_DRAWABLE = 17,
GDK_TARGET_PIXMAP = 20,
GDK_TARGET_STRING = 31
} GdkTarget;
typedef enum
{
GDK_SELECTION_TYPE_ATOM = 4,
GDK_SELECTION_TYPE_BITMAP = 5,
GDK_SELECTION_TYPE_COLORMAP = 7,
GDK_SELECTION_TYPE_DRAWABLE = 17,
GDK_SELECTION_TYPE_INTEGER = 19,
GDK_SELECTION_TYPE_PIXMAP = 20,
GDK_SELECTION_TYPE_WINDOW = 33,
GDK_SELECTION_TYPE_STRING = 31
} GdkSelectionType;
/* Selections
*/
gboolean gdk_selection_owner_set (GdkWindow *owner,
GdkAtom selection,
guint32 time,
gboolean send_event);
GdkWindow* gdk_selection_owner_get (GdkAtom selection);
void gdk_selection_convert (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target,
guint32 time);
gboolean gdk_selection_property_get (GdkWindow *requestor,
guchar **data,
GdkAtom *prop_type,
gint *prop_format);
void gdk_selection_send_notify (guint32 requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
guint32 time);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_SELECTION_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -26,10 +26,10 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "gdk.h"
#include "gdkprivate.h"
#include "gdkx.h"
#include "gdkvisual.h"
#include "gdkprivate-x11.h"
#include "gdkinternals.h"
static void gdk_visual_add (GdkVisual *visual);
static void gdk_visual_decompose_mask (gulong mask,

View File

@@ -1,85 +0,0 @@
#ifndef __GDK_VISUAL_H__
#define __GDK_VISUAL_H__
#include <gdk/gdktypes.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Types of visuals.
* StaticGray:
* Grayscale:
* StaticColor:
* PseudoColor:
* TrueColor:
* DirectColor:
*/
typedef enum
{
GDK_VISUAL_STATIC_GRAY,
GDK_VISUAL_GRAYSCALE,
GDK_VISUAL_STATIC_COLOR,
GDK_VISUAL_PSEUDO_COLOR,
GDK_VISUAL_TRUE_COLOR,
GDK_VISUAL_DIRECT_COLOR
} GdkVisualType;
/* The visual type.
* "type" is the type of visual this is (PseudoColor, TrueColor, etc).
* "depth" is the bit depth of this visual.
* "colormap_size" is the size of a colormap for this visual.
* "bits_per_rgb" is the number of significant bits per red, green and blue.
* The red, green and blue masks, shifts and precisions refer
* to value needed to calculate pixel values in TrueColor and DirectColor
* visuals. The "mask" is the significant bits within the pixel. The
* "shift" is the number of bits left we must shift a primary for it
* to be in position (according to the "mask"). "prec" refers to how
* much precision the pixel value contains for a particular primary.
*/
struct _GdkVisual
{
GdkVisualType type;
gint depth;
GdkByteOrder byte_order;
gint colormap_size;
gint bits_per_rgb;
guint32 red_mask;
gint red_shift;
gint red_prec;
guint32 green_mask;
gint green_shift;
gint green_prec;
guint32 blue_mask;
gint blue_shift;
gint blue_prec;
};
gint gdk_visual_get_best_depth (void);
GdkVisualType gdk_visual_get_best_type (void);
GdkVisual* gdk_visual_get_system (void);
GdkVisual* gdk_visual_get_best (void);
GdkVisual* gdk_visual_get_best_with_depth (gint depth);
GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type);
GdkVisual* gdk_visual_get_best_with_both (gint depth,
GdkVisualType visual_type);
/* Actually, these are no-ops... */
GdkVisual* gdk_visual_ref (GdkVisual *visual);
void gdk_visual_unref (GdkVisual *visual);
void gdk_query_depths (gint **depths,
gint *count);
void gdk_query_visual_types (GdkVisualType **visual_types,
gint *count);
GList* gdk_list_visuals (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_VISUAL_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,407 +0,0 @@
#ifndef __GDK_WINDOW_H__
#define __GDK_WINDOW_H__
#include <gdk/gdkdrawable.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkwindow.h>
#include <gdk/gdkevents.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _GdkGeometry GdkGeometry;
typedef struct _GdkWindowAttr GdkWindowAttr;
/* Classes of windows.
* InputOutput: Almost every window should be of this type. Such windows
* receive events and are also displayed on screen.
* InputOnly: Used only in special circumstances when events need to be
* stolen from another window or windows. Input only windows
* have no visible output, so they are handy for placing over
* top of a group of windows in order to grab the events (or
* filter the events) from those windows.
*/
typedef enum
{
GDK_INPUT_OUTPUT,
GDK_INPUT_ONLY
} GdkWindowClass;
/* Types of windows.
* Root: There is only 1 root window and it is initialized
* at startup. Creating a window of type GDK_WINDOW_ROOT
* is an error.
* Toplevel: Windows which interact with the window manager.
* Child: Windows which are children of some other type of window.
* (Any other type of window). Most windows are child windows.
* Dialog: A special kind of toplevel window which interacts with
* the window manager slightly differently than a regular
* toplevel window. Dialog windows should be used for any
* transient window.
* Pixmap: Pixmaps are really just another kind of window which
* doesn't actually appear on the screen. It can't have
* children, either and is really just a convenience so
* that the drawing functions can work on both windows
* and pixmaps transparently. (ie. You shouldn't pass a
* pixmap to any procedure which accepts a window with the
* exception of the drawing functions).
* Foreign: A window that actually belongs to another application
*/
typedef enum
{
GDK_WINDOW_ROOT,
GDK_WINDOW_TOPLEVEL,
GDK_WINDOW_CHILD,
GDK_WINDOW_DIALOG,
GDK_WINDOW_TEMP,
GDK_WINDOW_FOREIGN
} GdkWindowType;
/* Window attribute mask values.
* GDK_WA_TITLE: The "title" field is valid.
* GDK_WA_X: The "x" field is valid.
* GDK_WA_Y: The "y" field is valid.
* GDK_WA_CURSOR: The "cursor" field is valid.
* GDK_WA_COLORMAP: The "colormap" field is valid.
* GDK_WA_VISUAL: The "visual" field is valid.
*/
typedef enum
{
GDK_WA_TITLE = 1 << 1,
GDK_WA_X = 1 << 2,
GDK_WA_Y = 1 << 3,
GDK_WA_CURSOR = 1 << 4,
GDK_WA_COLORMAP = 1 << 5,
GDK_WA_VISUAL = 1 << 6,
GDK_WA_WMCLASS = 1 << 7,
GDK_WA_NOREDIR = 1 << 8
} GdkWindowAttributesType;
/* Size restriction enumeration.
*/
typedef enum
{
GDK_HINT_POS = 1 << 0,
GDK_HINT_MIN_SIZE = 1 << 1,
GDK_HINT_MAX_SIZE = 1 << 2,
GDK_HINT_BASE_SIZE = 1 << 3,
GDK_HINT_ASPECT = 1 << 4,
GDK_HINT_RESIZE_INC = 1 << 5
} GdkWindowHints;
/* The next two enumeration values current match the
* Motif constants. If this is changed, the implementation
* of gdk_window_set_decorations/gdk_window_set_functions
* will need to change as well.
*/
typedef enum
{
GDK_DECOR_ALL = 1 << 0,
GDK_DECOR_BORDER = 1 << 1,
GDK_DECOR_RESIZEH = 1 << 2,
GDK_DECOR_TITLE = 1 << 3,
GDK_DECOR_MENU = 1 << 4,
GDK_DECOR_MINIMIZE = 1 << 5,
GDK_DECOR_MAXIMIZE = 1 << 6
} GdkWMDecoration;
typedef enum
{
GDK_FUNC_ALL = 1 << 0,
GDK_FUNC_RESIZE = 1 << 1,
GDK_FUNC_MOVE = 1 << 2,
GDK_FUNC_MINIMIZE = 1 << 3,
GDK_FUNC_MAXIMIZE = 1 << 4,
GDK_FUNC_CLOSE = 1 << 5
} GdkWMFunction;
struct _GdkWindowAttr
{
gchar *title;
gint event_mask;
gint x, y;
gint width;
gint height;
GdkWindowClass wclass;
GdkVisual *visual;
GdkColormap *colormap;
GdkWindowType window_type;
GdkCursor *cursor;
gchar *wmclass_name;
gchar *wmclass_class;
gboolean override_redirect;
};
struct _GdkGeometry {
gint min_width;
gint min_height;
gint max_width;
gint max_height;
gint base_width;
gint base_height;
gint width_inc;
gint height_inc;
gdouble min_aspect;
gdouble max_aspect;
/* GdkGravity gravity; */
};
typedef struct _GdkWindowObject GdkWindowObject;
typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
#define GDK_TYPE_WINDOW (gdk_window_get_type ())
#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass))
#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
struct _GdkWindowObject
{
GdkDrawable parent_instance;
gpointer user_data;
GdkDrawable *impl; /* window-system-specific delegate object */
GdkWindowObject *parent;
gint x;
gint y;
gint extension_events;
GList *filters;
GList *children;
GdkColor bg_color;
GdkPixmap *bg_pixmap;
GSList *paint_stack;
GdkRegion *update_area;
guint update_freeze_count;
guint8 window_type;
guint8 depth;
guint8 resize_count;
guint mapped : 1;
guint guffaw_gravity : 1;
guint input_only : 1;
guint destroyed : 2;
};
struct _GdkWindowObjectClass
{
GdkDrawableClass parent_class;
};
/* Windows
*/
GType gdk_window_get_type (void);
GdkWindow* gdk_window_new (GdkWindow *parent,
GdkWindowAttr *attributes,
gint attributes_mask);
void gdk_window_destroy (GdkWindow *window);
GdkWindowType gdk_window_get_window_type (GdkWindow *window);
GdkWindow* gdk_window_at_pointer (gint *win_x,
gint *win_y);
void gdk_window_show (GdkWindow *window);
void gdk_window_hide (GdkWindow *window);
void gdk_window_withdraw (GdkWindow *window);
void gdk_window_move (GdkWindow *window,
gint x,
gint y);
void gdk_window_resize (GdkWindow *window,
gint width,
gint height);
void gdk_window_move_resize (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,
gint x,
gint y);
void gdk_window_clear (GdkWindow *window);
void gdk_window_clear_area (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_clear_area_e(GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gdk_window_raise (GdkWindow *window);
void gdk_window_lower (GdkWindow *window);
void gdk_window_set_user_data (GdkWindow *window,
gpointer user_data);
void gdk_window_set_override_redirect(GdkWindow *window,
gboolean override_redirect);
void gdk_window_add_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
void gdk_window_remove_filter (GdkWindow *window,
GdkFilterFunc function,
gpointer data);
/*
* This allows for making shaped (partially transparent) windows
* - cool feature, needed for Drag and Drag for example.
* The shape_mask can be the mask
* from gdk_pixmap_create_from_xpm. Stefan Wille
*/
void gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *shape_mask,
gint offset_x,
gint offset_y);
/*
* This routine allows you to quickly take the shapes of all the child windows
* of a window and use their shapes as the shape mask for this window - useful
* for container windows that dont want to look like a big box
*
* - Raster
*/
void gdk_window_set_child_shapes (GdkWindow *window);
/*
* This routine allows you to merge (ie ADD) child shapes to your
* own window's shape keeping its current shape and ADDING the child
* shapes to it.
*
* - Raster
*/
void gdk_window_merge_child_shapes (GdkWindow *window);
/*
* Check if a window has been shown, and whether all its
* parents up to a toplevel have been shown, respectively.
* Note that a window that is_viewable below is not necessarily
* viewable in the X sense.
*/
gboolean gdk_window_is_visible (GdkWindow *window);
gboolean gdk_window_is_viewable (GdkWindow *window);
/* Set static bit gravity on the parent, and static
* window gravity on all children.
*/
gboolean gdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static);
/* GdkWindow */
void gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags);
void gdk_window_set_geometry_hints (GdkWindow *window,
GdkGeometry *geometry,
GdkWindowHints flags);
void gdk_set_sm_client_id (const gchar *sm_client_id);
void gdk_window_begin_paint_rect (GdkWindow *window,
GdkRectangle *rectangle);
void gdk_window_begin_paint_region (GdkWindow *window,
GdkRegion *region);
void gdk_window_end_paint (GdkWindow *window);
void gdk_window_set_title (GdkWindow *window,
const gchar *title);
void gdk_window_set_role (GdkWindow *window,
const gchar *role);
void gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *leader);
void gdk_window_set_background (GdkWindow *window,
GdkColor *color);
void gdk_window_set_back_pixmap (GdkWindow *window,
GdkPixmap *pixmap,
gboolean parent_relative);
void gdk_window_set_cursor (GdkWindow *window,
GdkCursor *cursor);
void gdk_window_get_user_data (GdkWindow *window,
gpointer *data);
void gdk_window_get_geometry (GdkWindow *window,
gint *x,
gint *y,
gint *width,
gint *height,
gint *depth);
void gdk_window_get_position (GdkWindow *window,
gint *x,
gint *y);
gint gdk_window_get_origin (GdkWindow *window,
gint *x,
gint *y);
gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
gint *x,
gint *y);
void gdk_window_get_root_origin (GdkWindow *window,
gint *x,
gint *y);
GdkWindow* gdk_window_get_pointer (GdkWindow *window,
gint *x,
gint *y,
GdkModifierType *mask);
GdkWindow * gdk_window_get_parent (GdkWindow *window);
GdkWindow * gdk_window_get_toplevel (GdkWindow *window);
GList * gdk_window_get_children (GdkWindow *window);
GdkEventMask gdk_window_get_events (GdkWindow *window);
void gdk_window_set_events (GdkWindow *window,
GdkEventMask event_mask);
void gdk_window_set_icon (GdkWindow *window,
GdkWindow *icon_window,
GdkPixmap *pixmap,
GdkBitmap *mask);
void gdk_window_set_icon_name (GdkWindow *window,
const gchar *name);
void gdk_window_set_group (GdkWindow *window,
GdkWindow *leader);
void gdk_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations);
void gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions);
GList * gdk_window_get_toplevels (void);
void gdk_window_register_dnd (GdkWindow *window);
/* Interface for dirty-region queueing */
void gdk_window_invalidate_rect (GdkWindow *window,
GdkRectangle *rect,
gboolean invalidate_children);
void gdk_window_invalidate_region (GdkWindow *window,
GdkRegion *region,
gboolean invalidate_children);
GdkRegion *gdk_window_get_update_area (GdkWindow *window);
void gdk_window_freeze_updates (GdkWindow *window);
void gdk_window_thaw_updates (GdkWindow *window);
void gdk_window_process_all_updates (void);
void gdk_window_process_updates (GdkWindow *window,
gboolean update_children);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_WINDOW_H__ */

72
gdk/gdkx.h Normal file
View File

@@ -0,0 +1,72 @@
/* GDK - The GIMP Drawing Kit
* 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.
*/
/*
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_X_H__
#define __GDK_X_H__
#include <gdk/gdkprivate.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GDK_ROOT_WINDOW() gdk_root_window
#define GDK_ROOT_PARENT() ((GdkWindow *)&gdk_root_parent)
#define GDK_DISPLAY() gdk_display
#define GDK_WINDOW_XDISPLAY(win) (((GdkWindowPrivate*) win)->xdisplay)
#define GDK_WINDOW_XWINDOW(win) (((GdkWindowPrivate*) win)->xwindow)
#define GDK_IMAGE_XDISPLAY(image) (((GdkImagePrivate*) image)->xdisplay)
#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivate*) image)->ximage)
#define GDK_GC_XDISPLAY(gc) (((GdkGCPrivate*) gc)->xdisplay)
#define GDK_GC_XGC(gc) (((GdkGCPrivate*) gc)->xgc)
#define GDK_COLORMAP_XDISPLAY(cmap) (((GdkColormapPrivate*) cmap)->xdisplay)
#define GDK_COLORMAP_XCOLORMAP(cmap) (((GdkColormapPrivate*) cmap)->xcolormap)
#define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate*) vis)->xvisual)
#define GDK_FONT_XDISPLAY(font) (((GdkFontPrivate*) font)->xdisplay)
#define GDK_FONT_XFONT(font) (((GdkFontPrivate*) font)->xfont)
GdkVisual* gdkx_visual_get (VisualID xvisualid);
/* XXX: Do not use this function until it is fixed. An X Colormap
* is useless unless we also have the visual. */
GdkColormap* gdkx_colormap_get (Colormap xcolormap);
/* Utility function in gdk.c - not sure where it belongs, but it's
needed in more than one place, so make it public */
Window gdk_get_client_window (Display *dpy,
Window win);
/* Functions to create pixmaps and windows from their X equivalents */
GdkPixmap *gdk_pixmap_foreign_new (guint32 anid);
GdkWindow *gdk_window_foreign_new (guint32 anid);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_X_H__ */

View File

@@ -24,7 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdkprivate-x11.h"
#include "gdkprivate.h"
#include <stdio.h>
static guint gdk_xid_hash (XID *xid);

View File

@@ -355,7 +355,7 @@ handle_claim_device(GxidClaimDevice *msg)
{
/* FIXME: this is a bit improper. We probably should do this only
when a window is first claimed. But we might be fooled if
an old client died without releasing it's windows. So until
an old client died without releasing its windows. So until
we look for client-window closings, do it here
(We do look for closings now...)

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