Compare commits

...

131 Commits

Author SHA1 Message Date
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
183 changed files with 25734 additions and 7780 deletions
+2
View File
@@ -13,3 +13,5 @@ gtk-config
config.cache
ABOUT-NLS
intl
stamp-h.in
gtk+.spec
+1195 -1
View File
File diff suppressed because it is too large Load Diff
+1195 -1
View File
File diff suppressed because it is too large Load Diff
+1195 -1
View File
File diff suppressed because it is too large Load Diff
+1195 -1
View File
File diff suppressed because it is too large Load Diff
+1195 -1
View File
File diff suppressed because it is too large Load Diff
+1195 -1
View File
File diff suppressed because it is too large Load Diff
+1195 -1
View File
File diff suppressed because it is too large Load Diff
+42 -11
View File
@@ -7,12 +7,12 @@ you got this package.
Simple install procedure
========================
% gzip -cd gtk+-1.2.0.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.0 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
% gzip -cd gtk+-1.2.4.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.2.4 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
% make install # install GTK
% make install # install GTK
The Nitty-Gritty
================
@@ -43,6 +43,13 @@ which form of support to use:
For more information, follow the link from http://www.gtk.org
* --disable-nls do not use Native Language Support
If this flag is not specified, GTK+ will try to find
and use the gettext() set of functions to provide translations
of the strings in the standard dialogs into the
user's native language.
* --enable-xim support XIM [default=yes]
Specifying --disable-xim will disable support for entering
@@ -50,7 +57,7 @@ internationalized text using X Input Methods. This will give some
slight savings in speed and memory use and might be necessary
with older versions of X.
* --with-locale=LOCALE locale name you want to use
* --with-locale=LOCALE locale name you want to use
The --with-locale options is used to determine if your operating
system has support for the locale you will be using. If not, X's
@@ -84,19 +91,43 @@ or,
setenv CFLAGS -O2 ; ./configure # csh and variants
Native-Language Support and gettext()
=====================================
Using an uninstalled copy of GLIB
=================================
To provide native-language support (NLS) GTK+ uses the
gettext() set of functions. These functions are found
in the C library on many systems, such as the Solaris
C library and the GNU C Library, version 2.
If your C library does not provide the necessary functionality,
you may wish to install the GNU gettext package. You'll
need version 0.10.35 or better. Version 0.10.35 is
available from ftp://alpha.gnu.org/pub/gnu
Generally, GTK+ will properly detect what is installed
on your system and enable or disable NLS as appropriate.
However, in rare cases, it may be necessary to disable
NLS manually to get GTK+ to compile. You can do this
by specifying the --disable-nls flag when configuring
GTK+.
Using an uninstalled copy of GLIB [ Unsupported ]
=================================================
You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-1.2.0
./configure --with-glib=../glib-1.2.4
This, however, will not work if you built GLIB with different
source and build directories.
It is recommended that you install GLIB before compiling
GTK+. The --with-glib option is not regularly tested
and may not function correctly. In addition,
inter-library dependencies won't be generated when
using --with-glib=.
Installation directories
========================
@@ -126,7 +157,7 @@ For complete details, see the file docs/gtk-config.txt
Notes for using XIM support for Japanese input
==============================================
* There is a bug in older versions of kinput2 that will cause GTK
* There is a bug in older versions of kinput2 that will cause GTK+
to hang when destroying a text entry. The latest versions of
kinput is available from:
@@ -138,7 +169,7 @@ C library multibyte functions. Unless your C library has support
for Japanese locales, this is incorrect, and will cause problems
for GTK's internationalization.
(In particular, this occurs with GNU libc 2.0 and 2.1, in which
(In particular, this occurs with GNU libc 2.0 in which
the multibyte functions always translate to and from UTF-8; but
the problem may occur for other C libraries, and other operating
systems as well.)
+187
View File
@@ -0,0 +1,187 @@
Prerequisites
=============
GTK+ requires the GLIB library, available at the same location as
you got this package.
Simple install procedure
========================
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
% make install # install GTK
The Nitty-Gritty
================
The 'configure' script can be given a number of options to enable
and disable various features. For a complete list, type:
./configure --help
A few of the more important ones:
* --prefix=PREFIX install architecture-independent files in PREFIX
[ Defaults to /usr/local ]
* --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[ Defaults to the value given to --prefix ]
* --with-xinput=[no/gxi/xfree] support XInput [default=no]
The --with-xinput flag specifies whether to compile with support
for the XInput extension (mainly used for graphics tablets), and
which form of support to use:
no : no support
gxi : Use generic XInput support
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
and later.
For more information, follow the link from http://www.gtk.org
* --disable-nls do not use Native Language Support
If this flag is not specified, GTK+ will try to find
and use the gettext() set of functions to provide translations
of the strings in the standard dialogs into the
user's native language.
* --enable-xim support XIM [default=yes]
Specifying --disable-xim will disable support for entering
internationalized text using X Input Methods. This will give some
slight savings in speed and memory use and might be necessary
with older versions of X.
* --with-locale=LOCALE locale name you want to use
The --with-locale options is used to determine if your operating
system has support for the locale you will be using. If not, X's
built in locale support will be used.
Because of bugs in autoconf, it is necessary to specify this
option even if your LANG environment variable is correctly set.
This option does not determine which locale GTK will use at
runtime. That will be determined from the usual environment
variables. If you will be using multiple locales with GTK,
specify the one for which your operating system has the worst
support for the --with-locale option.
Options can be given to the compiler and linker by setting
environment variables before running configure. A few of the more
important ones:
CC : The C compiler to use
CPPFLAGS : Flags for the C preprocesser such as -I and -D
CFLAGS : C compiler flags
The most important use of this is to set the
optimization/debugging flags. For instance, to compile with no
debugging information at all, run configure as:
CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh)
or,
setenv CFLAGS -O2 ; ./configure # csh and variants
Native-Language Support and gettext()
=====================================
To provide native-language support (NLS) GTK+ uses the
gettext() set of functions. These functions are found
in the C library on many systems, such as the Solaris
C library and the GNU C Library, version 2.
If your C library does not provide the necessary functionality,
you may wish to install the GNU gettext package. You'll
need version 0.10.35 or better. Version 0.10.35 is
available from ftp://alpha.gnu.org/pub/gnu
Generally, GTK+ will properly detect what is installed
on your system and enable or disable NLS as appropriate.
However, in rare cases, it may be necessary to disable
NLS manually to get GTK+ to compile. You can do this
by specifying the --disable-nls flag when configuring
GTK+.
Using an uninstalled copy of GLIB [ Unsupported ]
=================================================
You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-@GTK_VERSION@
This, however, will not work if you built GLIB with different
source and build directories.
It is recommended that you install GLIB before compiling
GTK+. The --with-glib option is not regularly tested
and may not function correctly. In addition,
inter-library dependencies won't be generated when
using --with-glib=.
Installation directories
========================
The location of the installed files is determined by the --prefix
and --exec-prefix options given to configure. There are also more
detailed flags to control individual directories. However, the
use of these flags is not tested.
One particular detail to note, is that the architecture-dependent
include file glibconfig.h is installed in:
$exec_pref/lib/glib/include/
if you have a version in $prefix/include, this is out of date
and should be deleted.
A shell script gtk-config is created during the configure
process, and installed in the bin/ directory
($exec_prefix/bin). This is used to determine the location of GTK
when building applications. If you move GTK after installation,
it will be necessary to edit this file.
For complete details, see the file docs/gtk-config.txt
Notes for using XIM support for Japanese input
==============================================
* There is a bug in older versions of kinput2 that will cause GTK+
to hang when destroying a text entry. The latest versions of
kinput is available from:
ftp://ftp.sra.co.jp/pub/x11/kinput2
* The locale information file for the ja_JP EUC locale
distributed with some recent versions of X11 specifies to use the
C library multibyte functions. Unless your C library has support
for Japanese locales, this is incorrect, and will cause problems
for GTK's internationalization.
(In particular, this occurs with GNU libc 2.0 in which
the multibyte functions always translate to and from UTF-8; but
the problem may occur for other C libraries, and other operating
systems as well.)
To fix this, change the line:
use_stdc_env True
to
use_stdc_env False
in the file /usr/X11R6/lib/X11/locale/ja_JP/XLC_LOCALE.
+1
View File
@@ -0,0 +1 @@
Email: gtk-bugs@gimp.org
+11 -2
View File
@@ -1,10 +1,13 @@
## Process this file with automake to produce Makefile.in
## Makefile.am for GTK+
SRC_SUBDIRS = gdk gtk
SUBDIRS = po $(SRC_SUBDIRS) docs
bin_SCRIPTS = gtk-config
# require automake 1.4
AUTOMAKE_OPTIONS = 1.4
EXTRA_DIST = \
HACKING \
gtk+.spec.in \
@@ -98,7 +101,13 @@ EXTRA_DIST = \
examples/find-examples.sh
dist-hook:
cp gtk+.spec $(distdir)
if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \
CONFIG_FILES="INSTALL:$(srcdir)/INSTALL.in README:$(srcdir)/README.in" \
CONFIG_HEADERS= \
$(SHELL) config.status \
&& cp INSTALL README $(distdir) ; \
fi \
&& cp gtk+.spec $(distdir)
m4datadir = $(datadir)/aclocal
m4data_DATA = gtk.m4
+49
View File
@@ -1,3 +1,52 @@
Overview of Changes in GTK+ 1.2.4:
* DnD improvements (drags can be canceled with Esc now).
* suppressed configure event reordering in Gdk.
* rewrite of Gtk's configure event handling.
* major improvements for the object argument system (Elena Devdariani).
* major bugfixes for threading, GtkNotebook, GtkItemFactory, GtkCList and
GtkCTree.
* tutorial/FAQ updates, new file generation.txt on autogenerated sources.
* configure's --with-glib= is "officially" unsupported.
* upgrade to libtool 1.3.3.
* various buglets fixed.
Overview of Changes in GTK+ 1.2.3:
* Upgrade to libtool 1.3
* Check for dgettext (for systems with old versions of GNU Gettext)
* Many bug fixes (see ChangeLog for details)
Overview of Changes in GTK+ 1.2.2:
* Improved Dnd behaviour with Motif applications.
* Bug fixes for the Gtk selection code.
* Minor bug fixes to the Gdk Atom cache and Dnd code (with --display option).
* Bug fixes and leak plugs for the Gdk IM code.
* Added gtk_object_get() facility to retrive object arguments easily.
The var args list expects ("arg-name", &value) pairs.
* Fixed mapping for GdkInputCondition<->GIOCondition, this should fix
problems where closed pipes were no longer signalling GDK_INPUT_READ on
systems with a native poll().
* Some cleanups to GtkLabel's memory allocation code (shouldn't leak memory
anymore).
* We don't attempt to lookup xpm color "None" anymore, this should prevent
eXodus (commercial X windows server) from popping up a color dialog every
time a transparent pixmap is created.
* Fixed bug where Gtk timout/idle handlers would execute without the global
Gdk lock being held.
* Other minor bug fixes.
Overview of Changes in GTK+ 1.2.1:
* Many Bug fixes have been applied to the menu and accelerator code.
* GtkItemFactory can "adopt" foreign menu items now and manage their
accelerator installation. This is often required to get GtkItemFactory
like accelerator propagation between different windows with the same
menu heirarchy and for centralized parsing and saving of accelerators.
* GtkCList/GtkCTree buttons should always display correctly now.
* Miscellaneous other bug fixes.
What's New in GTK+ 1.2.0 (since 1.0.x):
* New widgets: GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree,
+4 -4
View File
@@ -1,7 +1,7 @@
General Information
===================
This is GTK+ version 1.2.0. GTK+, which stands for the Gimp ToolKit,
This is GTK+ version 1.2.4. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
@@ -37,9 +37,9 @@ version number. This should be separated by a blank
line from the actual headers.
Package: gtk+
Version: 1.2.0
Version: 1.2.4
[ Please substitute 1.2.0 with the version of GTK+ that
[ Please substitute 1.2.4 with the version of GTK+ that
you have installed ]
Then describe the bug. Include:
@@ -82,7 +82,7 @@ From: yourname@your.address.org
Subject: handlebox test in testgtk is misnamed.
Package: gtk+
Version: 1.2.0
Version: 1.2.4
When I run gtk/testgtk, the button "handle box"
is misnamed. There are multiple handle boxes in
+101
View File
@@ -0,0 +1,101 @@
General Information
===================
This is GTK+ version @GTK_VERSION@. GTK+, which stands for the Gimp ToolKit,
is a library for creating graphical user interfaces for the X Window
System. It is designed to be small, efficient, and flexible. GTK+ is
written in C with a very object-oriented approach.
The official ftp site is:
ftp://ftp.gtk.org/pub/gtk
The official web site is:
http://www.gtk.org/
A mailing list is located at:
gtk-list@redhat.com
To subscribe: mail -s subscribe gtk-list-request@redhat.com < /dev/null
(Send mail to gtk-list-request@redhat.com with the subject "subscribe")
Installation
============
See the file 'INSTALL'
How to report bugs
==================
Bugs should be reported to the GNOME bug tracking
system. (http://bugs.gnome.org). To report a problem
about GTK+, send mail to submit@bugs.gnome.org.
The subject of the mail should describe your problem.
In the body of the mail, you should first include
a "pseudo-header" that gives the package and
version number. This should be separated by a blank
line from the actual headers.
Package: gtk+
Version: @GTK_VERSION@
[ Please substitute @GTK_VERSION@ with the version of GTK+ that
you have installed ]
Then describe the bug. Include:
* Information about your system. For instance:
- What operating system and version
- What version of X
- For Linux, what version of the C library
And anything else you think is relevant.
* How to reproduce the bug.
If you can reproduce it with the testgtk program that is built
in the gtk/ subdirectory, that will be most convenient. Otherwise,
please include a short test program that exhibits the behavior.
As a last resort, you can also provide a pointer to a larger piece
of software that can be downloaded.
(Bugs that can be reproduced within the GIMP are almost as good
as bugs that can be reproduced in testgtk. If you are reporting a
bug found with the GIMP, please include the version number of the GIMP
you are using)
* If the bug was a crash, the exact text that was printed out
when the crash occured.
* Further information such as stack traces may be useful, but
is not necessary. If you do send a stack trace, and the error
is an X error, it will be more useful if the stacktrace
is produced running the test program with the --sync command
line option.
An example of a bug report:
====
To: submit@bugs.gnome.org
From: yourname@your.address.org
Subject: handlebox test in testgtk is misnamed.
Package: gtk+
Version: @GTK_VERSION@
When I run gtk/testgtk, the button "handle box"
is misnamed. There are multiple handle boxes in
the demo, so it should be "handle boxes", to
be like "buttons" or "check buttons".
===
Patches
=======
Patches can be uploaded to the incoming/ directory on
ftp.gtk.org. Please follow the instructions there, and include
your name and email address in the README file.
If the patch fixes a bug, it is usually a good idea to include
all the information described in "How to Report Bugs".
+7 -9
View File
@@ -12,21 +12,14 @@ Outstanding items:
* Make all widget attributes configurable after the widget is created (timj).
* Radio buttons need to display CAN/HAS_DEFAULT correctly, if draw_inidicator
is TRUE.
is TRUE. (Radio buttons do not need to CAN_DEFAULT! OWT)
* gdk_expose_compress: ala-Xt, this would really help for opaque moves and
such
* More dialogs: Print, GtkFontSelector, maybe others...
* More dialogs: Print, maybe others...
* make the gtk_main callbacks consistent in their add/remove behaviour.
* Check return values on all calls to XIC[Get/Set]Values
* Rewrite the interface to the i18n stuff so GTK widgets don't need to
retrieve X values, and so they don't have to know the value of the
XNxxx character constants.
* The "--geometry" option should be supported
- Having gdk_init() parse the geometry option. (putting it into
@@ -70,6 +63,11 @@ Outstanding items:
cause confusing presses to be sent to containers that actually
want to get events on themselves.
* The menu code should skip separators during keyboard navigation,
whether they are sensitive or insensitive.
* OwnerButtonPressGrab needs to go!
Text/Edit widget:
Bugs:
-2
View File
@@ -29,8 +29,6 @@
#undef HAVE_SYS_SELECT_H
#undef HAVE_XCONVERTCASE
#undef WITH_SYMBOL_UNDERSCORE
#undef NO_FD_SET
#undef RESOURCE_BASE
+217 -333
View File
@@ -1,6 +1,6 @@
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1998 Free Software Foundation, Inc.
## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -21,31 +21,66 @@
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 29 AM_PROG_LIBTOOL
AC_DEFUN(AM_PROG_LIBTOOL,
[AC_REQUIRE([AM_ENABLE_SHARED])dnl
AC_REQUIRE([AM_ENABLE_STATIC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AM_PROG_LD])dnl
AC_REQUIRE([AM_PROG_NM])dnl
AC_REQUIRE([AM_SYS_NM_PARSE])dnl
AC_REQUIRE([AM_SYS_SYMBOL_UNDERSCORE])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
AC_DEFUN(AC_LIBTOOL_SETUP,
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
# Check for any special flags to pass to ltconfig.
libtool_flags=
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
@@ -81,46 +116,31 @@ case "$host" in
fi
;;
*-*-cygwin32*)
AM_SYS_LIBTOOL_CYGWIN32
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
])
esac
# enable the --disable-libtool-lock switch
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock force libtool not to do file locking],
need_locks=$enableval,
need_locks=yes)
if test x"$need_locks" = xno; then
libtool_flags="$libtool_flags --disable-lock"
fi
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
DLLTOOL="$DLLTOOL" AS="$AS" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| AC_MSG_ERROR([libtool configure failed])
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
# AM_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AM_ENABLE_SHARED[(DEFAULT)]
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AM_ENABLE_SHARED,
[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_DEFUN(AC_ENABLE_SHARED, [dnl
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -138,26 +158,22 @@ no) enable_shared=no ;;
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AM_DISABLE_SHARED,
[AM_ENABLE_SHARED(no)])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AM_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AM_DISABLE_STATIC,
[AM_ENABLE_STATIC(no)])
# AM_ENABLE_STATIC - implement the --enable-static flag
# Usage: AM_ENABLE_STATIC[(DEFAULT)]
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AM_ENABLE_STATIC,
[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_DEFUN(AC_ENABLE_STATIC, [dnl
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
@@ -175,12 +191,49 @@ no) enable_static=no ;;
IFS="$ac_save_ifs"
;;
esac],
enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AM_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AM_PROG_LD,
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
@@ -195,47 +248,15 @@ if test "$ac_cv_prog_gcc" = yes; then
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
/* | [A-Za-z]:/*)
# Canonicalize the path of ld
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
changequote([,])dnl
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
case "$host_os" in
cygwin*)
# Convert to a UNC path for cygwin
test -z "$LD" && LD=`echo X$ac_prog | sed -e "1s/^X//" -e "$sub_uncdrive"`
;;
*)
test -z "$LD" && LD="$ac_prog"
;;
esac
;;
##
## FIXME: The code fails later on if we try to use an $LD with
## '\\' path separators.
##
changequote(,)dnl
[A-Za-z]:[\\]*)
# Canonicalize the path of ld
re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
changequote([,])dnl
sub_uncdir='s%\\%/%g'
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
case "$host_os" in
cygwin*)
# Convert to a UNC path for cygwin
test -z "$LD" && LD=`echo X$ac_prog | sed -e 's%^X%%' -e "$sub_uncdrive" -e "$sub_uncdir"`
;;
*)
test -z "$LD" && LD="$ac_prog"
;;
esac
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
@@ -253,10 +274,10 @@ else
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog"; then
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
@@ -264,7 +285,7 @@ AC_CACHE_VAL(ac_cv_path_LD,
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
test "$with_gnu_ld" != yes && break
fi
fi
done
@@ -280,10 +301,10 @@ else
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
AM_PROG_LD_GNU
AC_PROG_LD_GNU
])
AC_DEFUN(AM_PROG_LD_GNU,
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
@@ -293,29 +314,31 @@ else
fi])
])
# AM_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AM_PROG_NM,
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm; then
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
ac_cv_path_NM="$ac_dir/nm -B"
break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
ac_cv_path_NM="$ac_dir/nm -p"
break
else
ac_cv_path_NM="$ac_dir/nm"
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
break
fi
done
IFS="$ac_save_ifs"
@@ -326,221 +349,82 @@ AC_MSG_RESULT([$NM])
AC_SUBST(NM)
])
# AM_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
# by C symbol name from nm.
AC_DEFUN(AM_SYS_NM_PARSE,
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AM_PROG_NM])dnl
# Check for command to grab the raw symbol name followed by C symbol from nm.
AC_MSG_CHECKING([command to parse $NM output])
AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
[# These are sane defaults that work on at least a few old systems.
# {They come from Ultrix. What could be older than Ultrix?!! ;)}
changequote(,)dnl
# Character class describing NM global symbol codes.
ac_symcode='[BCDEGRSTU]'
# Regexp to match symbols that can be accessed directly from C.
ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
# Transform the above into a raw symbol and a C symbol.
ac_symxfrm='\1 \1'
# Define system-specific variables.
case "$host_os" in
aix*)
ac_symcode='[BCDTU]'
LIBM=
case "$host" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
sunos* | cygwin32* | mingw32*)
ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
ac_symxfrm='_\1 \1'
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
irix*)
# Cannot use undefined symbols on IRIX because inlined functions mess us up.
ac_symcode='[BCDEGRST]'
;;
solaris*)
ac_symcode='[BDTU]'
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# If we're using GNU nm, then use its standard symbol codes.
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
ac_symcode='[ABCDGISTUW]'
fi
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
case "$host_os" in
cygwin32* | mingw32*)
# We do not want undefined symbols on cygwin32. The user must
# arrange to define them via -l arguments.
ac_symcode='[ABCDGISTW]'
;;
esac
changequote([,])dnl
# Write the raw and C identifiers.
ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* $ac_symcode $ac_sympat$/$ac_symxfrm/p'"
# Check to see that the pipe works correctly.
ac_pipe_works=no
cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func;return 0;}
EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
ac_nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
# Try sorting and uniquifying the output.
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
mv -f "$ac_nlist"T "$ac_nlist"
ac_wcout=`wc "$ac_nlist" 2>/dev/null`
changequote(,)dnl
ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
changequote([,])dnl
(test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
else
rm -f "$ac_nlist"T
ac_count=-1
fi
# Make sure that we snagged all the symbols we need.
if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
cat <<EOF > conftest.c
#ifdef __cplusplus
extern "C" {
#endif
EOF
# Now generate the symbol file.
sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
cat <<EOF >> conftest.c
#if defined (__STDC__) && __STDC__
# define __ptr_t void *
#else
# define __ptr_t char *
#endif
/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
int dld_preloaded_symbol_count = $ac_count;
/* The mapping between symbol names and symbols. */
struct {
char *name;
__ptr_t address;
}
changequote(,)dnl
dld_preloaded_symbols[] =
changequote([,])dnl
{
EOF
sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
cat <<\EOF >> conftest.c
{0, (__ptr_t) 0}
};
#ifdef __cplusplus
}
#endif
EOF
# Now try linking the two files.
mv conftest.$ac_objext conftestm.$ac_objext
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="conftestm.$ac_objext"
CFLAGS="$CFLAGS$no_builtin_flag"
if AC_TRY_EVAL(ac_link) && test -s conftest; then
ac_pipe_works=yes
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.c >&AC_FD_CC
fi
LIBS="$ac_save_LIBS"
CFLAGS="$ac_save_CFLAGS"
else
echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
fi
else
echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
fi
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
INCLTDL=
fi
else
echo "$progname: failed program was:" >&AC_FD_CC
cat conftest.c >&AC_FD_CC
fi
rm -rf conftest*
# Do not use the global_symbol_pipe unless it works.
test "$ac_pipe_works" = yes || ac_cv_sys_global_symbol_pipe=
])
ac_result=yes
if test -z "$ac_cv_sys_global_symbol_pipe"; then
ac_result=no
fi
AC_MSG_RESULT($ac_result)
])
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
# AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
])
# AM_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
# with an underscore?
AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE,
[AC_REQUIRE([AM_PROG_NM])dnl
AC_REQUIRE([AM_SYS_NM_PARSE])dnl
AC_MSG_CHECKING([for _ prefix in compiled symbols])
AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
[ac_cv_sys_symbol_underscore=no
cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
ac_nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
else
if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then
:
else
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
fi
fi
else
echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
fi
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.c >&AC_FD_CC
fi
rm -rf conftest*
])
AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
if test x$ac_cv_sys_symbol_underscore = xyes; then
AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1,
[define if compiled symbols have a leading underscore])
fi
])
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
@@ -589,22 +473,22 @@ AC_DEFUN(AM_GTK_WITH_NLS,
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
[AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
if test "$gt_cv_func_dgettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_CHECK_LIB(intl, gettext,
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)],
gt_cv_func_gettext_libintl=no)])
[AC_CACHE_CHECK([for dgettext in libintl],
gt_cv_func_dgettext_libintl,
[AC_CHECK_LIB(intl, dgettext,
gt_cv_func_dgettext_libintl=yes,
gt_cv_func_dgettext_libintl=no)],
gt_cv_func_dgettext_libintl=no)])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
if test "$gt_cv_func_dgettext_libc" = "yes" \
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
@@ -624,8 +508,8 @@ AC_DEFUN(AM_GTK_WITH_NLS,
fi
# Added by Martin Baulig 12/15/98 for libc5 systems
if test "$gt_cv_func_gettext_libc" != "yes" \
&& test "$gt_cv_func_gettext_libintl" = "yes"; then
if test "$gt_cv_func_dgettext_libc" != "yes" \
&& test "$gt_cv_func_dgettext_libintl" = "yes"; then
INTLLIBS=-lintl
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
fi
+1 -9
View File
@@ -20,14 +20,6 @@ DIE=0
DIE=1
}
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have libtool installed to compile $PROJECT."
echo "Get ftp://alpha.gnu.org/gnu/libtool-1.2b.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile $PROJECT."
@@ -88,7 +80,7 @@ automake -a $am_opt
autoconf
cd $ORIGDIR
$srcdir/configure "$@"
$srcdir/configure --enable-maintainer-mode "$@"
echo
echo "Now type 'make' to compile $PROJECT."
+211 -75
View File
@@ -1,6 +1,7 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -23,6 +24,7 @@
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -35,6 +37,20 @@
# (but try to keep the structure clean).
#
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
fi
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -46,7 +62,8 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
@@ -59,7 +76,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >dummy.s
cat <<EOF >$dummy.s
.globl main
.ent main
main:
@@ -76,9 +93,9 @@ main:
ret \$31,(\$26),1
.end main
EOF
${CC-cc} dummy.s -o dummy 2>/dev/null
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
@@ -97,8 +114,14 @@ EOF
;;
esac
fi
rm -f dummy.s dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
@@ -142,7 +165,7 @@ EOF
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
@@ -150,7 +173,7 @@ EOF
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE:*:*:dcosx)
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
sun4H:SunOS:5.*:*)
@@ -201,6 +224,32 @@ EOF
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit 0 ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit 0 ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
@@ -234,12 +283,16 @@ EOF
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:*)
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -254,10 +307,10 @@ EOF
exit (-1);
}
EOF
${CC-cc} dummy.c -o dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
@@ -309,7 +362,7 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
main()
@@ -320,8 +373,8 @@ EOF
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -368,25 +421,25 @@ EOF
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
sed 's/^ //' << EOF >dummy.c
9000/[678][0-9][0-9])
sed 's/^ //' << EOF >$dummy.c
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
@@ -394,20 +447,20 @@ EOF
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
rm -f dummy.c dummy
($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
rm -f $dummy.c $dummy
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
main ()
@@ -432,8 +485,8 @@ EOF
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -442,6 +495,9 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
@@ -458,6 +514,9 @@ EOF
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
hppa*:OpenBSD:*:*)
echo hppa-unknown-openbsd
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
@@ -490,11 +549,14 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*T3E:*:*:*)
echo t3e-cray-unicosmk${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
@@ -507,13 +569,22 @@ EOF
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
if test -x /usr/bin/objformat; then
if test "elf" = "`/usr/bin/objformat`"; then
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0
fi
fi
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
@@ -523,13 +594,22 @@ EOF
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin32
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
echo powerpcle-unknown-cygwin
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -541,12 +621,14 @@ EOF
# uname on the ARM produces all sorts of strangeness, and we need to
# filter it out.
case "$UNAME_MACHINE" in
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
arm* | sa110*) UNAME_MACHINE="arm" ;;
esac
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
@@ -559,11 +641,40 @@ EOF
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
elf32ppc)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
extern char __libc_release[];
#endif
main(argc, argv)
int argc;
char *argv[];
{
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unkown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >dummy.s
sed 's/^ //' <<EOF >$dummy.s
.globl main
.ent main
main:
@@ -581,9 +692,9 @@ EOF
.end main
EOF
LIBC=""
${CC-cc} dummy.s -o dummy 2>/dev/null
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./dummy
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
@@ -600,22 +711,23 @@ EOF
16)
UNAME_MACHINE="alphaev6"
;;
esac
esac
objdump --private-headers dummy | \
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f dummy.s dummy
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
cat >$dummy.c <<EOF
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
@@ -625,8 +737,8 @@ main(argc, argv)
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
@@ -645,12 +757,13 @@ EOF
;;
esac
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
cat >$dummy.c <<EOF
#include <features.h>
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __cplusplus
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
@@ -667,8 +780,8 @@ main(argc, argv)
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
@@ -690,6 +803,14 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:5:7*)
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -699,18 +820,15 @@ EOF
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i?86:UnixWare:*:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
fi
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
exit 0 ;;
pc:*:*:*)
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
@@ -752,7 +870,7 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:*)
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
@@ -764,6 +882,9 @@ EOF
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
@@ -794,7 +915,7 @@ EOF
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
@@ -810,12 +931,24 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
@@ -853,7 +986,10 @@ main ()
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
@@ -913,8 +1049,8 @@ main ()
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
Vendored
+284 -24
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -98,11 +98,21 @@ case $os in
os=
basic_machine=$1
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=vxworks
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=sco3.2v5
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
@@ -121,6 +131,9 @@ case $os in
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -151,14 +164,21 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
| mipstx39 | mipstx39el \
| sparc | sparclet | sparclite | sparc64 | v850)
| 580 | i960 | h8300 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -174,24 +194,41 @@ case $basic_machine in
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* \
| f301-*)
| f301-* | armv*-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
@@ -221,6 +258,10 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -297,6 +338,10 @@ case $basic_machine in
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
@@ -315,6 +360,14 @@ case $basic_machine in
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
@@ -330,13 +383,30 @@ case $basic_machine in
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -345,6 +415,14 @@ case $basic_machine in
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
@@ -366,6 +444,22 @@ case $basic_machine in
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -394,6 +488,10 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
*mint | *MiNT)
basic_machine=m68k-atari
os=-mint
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
@@ -408,10 +506,26 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
msdos)
basic_machine=i386-unknown
os=-msdos
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-corel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
@@ -424,6 +538,10 @@ case $basic_machine in
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
@@ -449,9 +567,25 @@ case $basic_machine in
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
np1)
basic_machine=np1-gould
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -469,19 +603,19 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | nexen)
pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc
;;
pentiumpro | p6 | k6 | 6x86)
pentiumpro | p6 | 6x86)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | nexen-*)
pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | k6-* | 6x86-*)
pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
@@ -505,12 +639,20 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sequent)
basic_machine=i386-sequent
;;
@@ -518,6 +660,10 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
@@ -525,6 +671,13 @@ case $basic_machine in
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
sun2)
basic_machine=m68000-sun
;;
@@ -569,6 +722,10 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=t3e-cray
os=-unicos
;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -586,6 +743,10 @@ case $basic_machine in
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
@@ -609,6 +770,14 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xmp)
basic_machine=xmp-cray
os=-unicos
@@ -616,6 +785,10 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
@@ -623,6 +796,15 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
@@ -645,7 +827,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sparc)
sparc | sparcv9)
basic_machine=sparc-sun
;;
cydra)
@@ -657,6 +839,16 @@ case $basic_machine in
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -710,13 +902,21 @@ case $os in
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos*)
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -741,6 +941,9 @@ case $os in
-acis*)
os=-aos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
@@ -772,9 +975,18 @@ case $os in
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -*MiNT)
os=-mint
;;
-none)
;;
*)
@@ -800,6 +1012,9 @@ case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-corel)
os=-linux
;;
arm*-semi)
os=-aout
;;
@@ -821,6 +1036,15 @@ case $basic_machine in
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -833,6 +1057,15 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
@@ -896,6 +1129,18 @@ case $basic_machine in
f301-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
@@ -917,9 +1162,15 @@ case $basic_machine in
-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
@@ -947,6 +1198,15 @@ case $basic_machine in
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -*MiNT)
vendor=atari
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
+33 -15
View File
@@ -29,9 +29,9 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
#
GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=2
GTK_MICRO_VERSION=0
GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0
GTK_MICRO_VERSION=4
GTK_INTERFACE_AGE=2
GTK_BINARY_AGE=4
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
dnl
AC_DIVERT_POP()dnl
@@ -143,6 +143,9 @@ if test "x$GCC" = "xyes"; then
fi
changequote([,])dnl
# Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
# define a MAINT-like variable REBUILD which is set if Perl
# and awk are found, so autogenerated sources can be rebuilt
@@ -160,13 +163,24 @@ if test -n "$PERL" && perl -v | grep 'version 5.' > /dev/null ; then
fi
AC_SUBST(REBUILD)
AC_MSG_CHECKING(whether make is GNU Make)
STRIP_BEGIN=
STRIP_END=
if $ac_make --version 2>/dev/null | grep '^GNU Make version ' >/dev/null ; then
STRIP_BEGIN='$(strip'
STRIP_END=')'
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(STRIP_BEGIN)
AC_SUBST(STRIP_END)
# i18n stuff
ALL_LINGUAS="cs de es fr hu it ja ko nl no pl pt ru sv"
ALL_LINGUAS="ca cs de es fi fr hr hu it ja ko nl no pl pt ru sl sk sv wa zh_TW.Big5"
AM_GTK_GNU_GETTEXT
AC_CHECK_FUNC(gettext,
,
AC_CHECK_LIB(intl, gettext)
)
LIBS="$LIBS $INTLLIBS"
# AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
gtklocaledir='${prefix}/${DATADIRNAME}/locale'
@@ -189,8 +203,10 @@ AC_TRY_RUN([#include <math.h>
AC_MSG_RESULT()
CFLAGS=$gtk_save_CFLAGS
AC_MSG_WARN(
[No ANSI prototypes found in library. (-std1 didn't work.)])
)
[No ANSI prototypes found in library. (-std1 didn't work.)]),
true
),
AC_MSG_RESULT(none needed)
)
LIBS=$gtk_save_LIBS
@@ -214,9 +230,9 @@ fi
if test x$with_glib = x ; then
# Look for separately installed glib
AM_PATH_GLIB(1.2.0,,
AM_PATH_GLIB(1.2.4,,
AC_MSG_ERROR([
*** GLIB 1.2.0 or better is required. The latest version of GLIB
*** GLIB 1.2.4 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org/.]),
gmodule gthread)
@@ -256,7 +272,7 @@ else
esac
GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule.la"
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgmodule.la"
GLIB_DEPLIBS=
AC_SUBST(GLIB_CFLAGS)
@@ -412,11 +428,12 @@ main ()
return setlocale (LC_ALL, "${with_locale}") == NULL;
}],
need_x_locale=no,
need_x_locale=yes)
need_x_locale=yes,
need_x_locale=no)
AC_MSG_RESULT($need_x_locale)
if test $need_x_locale = yes; then
GTK_LOCALE_CFLAGS="-DX_LOCALE"
GTK_LOCALE_FLAGS="-DX_LOCALE"
fi
# Checks for header files.
@@ -511,6 +528,7 @@ AC_SUBST(GTK_LOCALE_FLAGS)
AC_OUTPUT([
gtk+.spec
docs/gtk-config.1
Makefile
gtk-config
po/Makefile.in
+1
View File
@@ -18,3 +18,4 @@ Makefile.in
*.vrs
html
text
gtk-config.1
+34 -30
View File
@@ -101,36 +101,7 @@ FAQ_FILES=html/gtkfaq.html \
html/gtkfaq-7.html \
text/gtkfaq.txt
EXTRA_DIST = \
gtk-config.1 \
texinfo.tex \
macros.texi \
gtkdocs_fix \
gtkfaq.sgml \
gtk-config.txt \
gtk_tut.sgml \
gtk_tut_it.sgml \
gtk_tut_fr.sgml \
debugging.txt \
developers.txt \
refcounting.txt \
styles.txt \
text_widget.txt \
widget_system.txt \
gtk_tut_packbox1.gif \
gtk_tut_packbox2.gif \
html/gtk_tut_table.gif \
html/gtk_tut_packbox1.gif \
html/gtk_tut_packbox2.gif \
gtk_tut_table.gif \
html/gdk.html \
html/gdk_toc.html \
html/gtk.html \
html/gtk_toc.html \
$(TUTORIAL_FILES) \
$(TUTORIAL_FR_FILES) \
$(TUTORIAL_IT_FILES) \
$(FAQ_FILES)
html/gtk_tut_table.gif: gdk.html gtk.html
.PHONY: html htmldir faq tutorial tutorial_it tutorial_fr files
@@ -195,3 +166,36 @@ files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
EXTRA_DIST += \
Changes-1.2.txt \
debugging.txt \
developers.txt \
refcounting.txt \
styles.txt \
text_widget.txt \
widget_system.txt \
generation.txt \
gtk-config.txt \
gtk-config.1.in \
texinfo.tex \
macros.texi \
gtkdocs_fix \
gtkfaq.sgml \
gtk_tut.sgml \
gtk_tut_it.sgml \
gtk_tut_fr.sgml \
gtk_tut_packbox1.gif \
gtk_tut_packbox2.gif \
html/gtk_tut_table.gif \
html/gtk_tut_packbox1.gif \
html/gtk_tut_packbox2.gif \
gtk_tut_table.gif \
html/gdk.html \
html/gdk_toc.html \
html/gtk.html \
html/gtk_toc.html \
$(TUTORIAL_FILES) \
$(TUTORIAL_FR_FILES) \
$(TUTORIAL_IT_FILES) \
$(FAQ_FILES)
+1063 -220
View File
File diff suppressed because it is too large Load Diff
+177
View File
@@ -0,0 +1,177 @@
Overview:
========
This file describes the way that autogeneration
works within the GTK+ source code.
The following files in the gdk/ subdirectory
are autogenerated:
gdkkeysyms.h
gdkcursors.h
The following files in the gtk/ subdirectory
are autogenerated:
gtk.defs
Description of GTK+ types (and some functions) in a lisp-style
format.
gtktypebuiltins.h
Header file including declarations for internal types
gtktypebuiltins_vars.c
Variables for type values for internal types.
gtktypebuiltins_ids.c
Arrays holding information about each internal type.
gtktypebuiltins_evals.c
Arrays holding mapping between enumeration values
and strings.
gtkmarshal.c
gtkmarshal.h
Autogenerated signal marshallers
GDK
===
gdkkeysyms.h and gdkcursors.h are generated from
the corresponding header files
X11/cursorfont.h
X11/keysymdef.h
by some simple sed scripts. These are not actually
run automatically because we want all the keysyms
even on systems with a limited set.
So the Gdk rule to generate both files (X-derived-headers)
only needs to be rerun for every new release of the X Window
System.
GTK+ - type definitions
=======================
The type definitions are generated from several sources:
gtk-boxed.defs - definitions for boxed types
GTK+ header files
GDK header files
The makeenums.pl script does a heuristic parse of
the header files and extracts all enumerations declarations.
It also recognizes a number of pseudo-comments in the
header files:
Two of these apply to individual enumeration values:
/*< skip >*/
This enumeration value should be skipped.
/*< nick=NICK >*/
The nickname for this value should NICK instead of the
normally guessed value. For instance:
typedef enum {
GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/
} GtkTargetFlags;
makes the nicks "same-app" and "same-widget", instead of
"app" and "widget" that would normally be used.
The other two apply to entire enumeration declarations.
/*< prefix=PREFIX >*/
Specifies the prefix to be removed from the enumeration
values to generate nicknames.
/*< flags >*/
Specifies that this enumeration is used as a bitfield.
(makenums.pl normally guesses this from the presence of values
with << operators). For instance:
typedef enum /*< flags >*/
{
GDK_IM_PREEDIT_AREA = 0x0001,
GDK_IM_PREEDIT_CALLBACKS = 0x0002,
[ ... ]
} GdkIMStyle;
makeenums.pl can be run into two modes:
1) Generate the gtktypebuiltins_eval.c file (this
contains arrays holding the mapping of
string <=> enumeration value)
2) Generate the enumeration portion of gtk.defs.
The enumearation portion is added to the boxed type
declarations in gtk-boxed.defs to create gtk.defs.
The makeetypes.awk program takes the gtk.defs file, and
from that generates various files depending on the
third parameter passed to it:
macros: gtktypebuiltins.h
variables: gtktypebuiltins_vars.c
entries: gtktypebuiltins_ids.c
GTK+ - marshallers
==================
The files gtkmarshal.c and gtkmarshal.h include declarations
and definitions for the marshallers needed inside of
GTK+. The marshallers to be generated are listed in
the file gtkmashal.list, which is processed
by genmarshal.pl.
The format of this file is a list of lines:
<retval-type>:<arg1-type>,<arg2-type>,<arg3-type>
e.g.:
BOOL:POINTER,STRING,STRING,POINTER
A marshaller is generated for each line in the file.
The possible types are:
NONE
BOOL
CHAR
INT
UINT
LONG
ULONG
FLOAT
DOUBLE
STRING
ENUM
FLAGS
BOXED
POINTER
OBJECT
FOREIGN (gpointer data, GtkDestroyNotify notify)
C_CALLBACK (GtkFunction func, gpointer func_data)
SIGNAL (GtkSignalFunc f, gpointer data)
ARGS (gint n_args, GtkArg *args)
CALLBACK (GtkCallBackMarshal marshall,
gpointer data,
GtkDestroyNotify Notify)
Some of these types map to multiple return values - these
are marked above with the return types in parantheses.
NOTES
=====
When autogenerating GTK+ files, the autogenerated
files are often rebuild resulting in the same result.
To prevent unecessary rebuilds of the entire directory, some files
that multiple other source files depend on are not actually written
to directly. Instead, an intermediate file is written, which
is then compared to the old file, and only if it is different
is it copied into the final location.
+1 -1
View File
@@ -1,4 +1,4 @@
.TH GTK+ 1 "25 October 1998" Version 1.2.0
.TH GTK+ 1 "25 October 1998" Version @VERSION@
.SH NAME
gtk-config - script to get information about the installed version of GTK+
.SH SYNOPSIS
+1 -1
View File
@@ -1109,7 +1109,7 @@ opaque.
All widget creation routines in GTK return pointers to GtkWidget
structures. In reality, all widget creation routines create structures
that can be viewed as equivalent to the GtkWidget structure, but often
have contain additional information. @xref{Object Implementation}
have contain additional information. @xref{Object Implementation}.
The widgets available for use are implemented in a hierarchy. Several
widgets exist solely as common bases for more specific widgets. For
+355 -21
View File
@@ -12062,12 +12062,6 @@ to this, once you finish your widget, announce it to the world so
other people can benefit. The best place to do this is probably the
<tt>gtk-list</tt>.
Complete sources for the example widgets are available at the place you
got this tutorial, or from:
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
<!-- ----------------------------------------------------------------- -->
<sect1> The Anatomy Of A Widget
@@ -13910,13 +13904,7 @@ needs to be updated. X will eventually generate an expose event
to copy the relevant portions to the screen.
We have now covered the entire drawing program except for a few
mundane details like creating the main window. The complete
source code is available from the location from which you got
this tutorial, or from:
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
mundane details like creating the main window.
<!-- ----------------------------------------------------------------- -->
<sect1> Adding XInput support
@@ -14234,13 +14222,7 @@ print_button_press (guint32 deviceid)
}
</verb></tscreen>
That completes the changes to `XInputize' our program. As with
the first version, the complete source is available at the location
from which you got this tutorial, or from:
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
That completes the changes to `XInputize' our program.
<sect2> Further sophistications <label id="sec_Further_Sophistications">
<p>
@@ -16547,7 +16529,83 @@ gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment,
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect1> Scribble
<sect2> dial-test.c
<p>
<tscreen><verb>
/* example-start gtkdial dial-test.c */
#include &lt;stdio.h&gt;
#include &lt;gtk/gtk.h&gt;
#include "gtkdial.h"
void
value_changed (GtkAdjustment *adjustment, GtkWidget *label)
{
char buffer[16];
sprintf(buffer,"%4.2f",adjustment->value);
gtk_label_set (GTK_LABEL (label), buffer);
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkAdjustment *adjustment;
GtkWidget *dial;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *label;
gtk_init (&amp;argc, &amp;argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Dial");
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_exit), NULL);
gtk_container_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show(vbox);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX(vbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
adjustment = GTK_ADJUSTMENT(gtk_adjustment_new (0, -1.0, 1.0, 0.01, 0.1, 0));
dial = gtk_dial_new(adjustment);
gtk_dial_set_update_policy (GTK_DIAL(dial), GTK_UPDATE_DELAYED);
/* gtk_widget_set_usize (dial, 100, 100); */
gtk_container_add (GTK_CONTAINER (frame), dial);
gtk_widget_show (dial);
label = gtk_label_new("0.00");
gtk_box_pack_start (GTK_BOX(vbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
gtk_signal_connect (GTK_OBJECT(adjustment), "value_changed",
GTK_SIGNAL_FUNC (value_changed), label);
gtk_widget_show (window);
gtk_main ();
return 0;
}
/* example-end */
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect1>Scribble
<!-- ----------------------------------------------------------------- -->
<sect2> scribble-simple.c
<p>
<tscreen><verb>
/* example-start scribble-simple scribble-simple.c */
@@ -16732,6 +16790,282 @@ main (int argc, char *argv[])
/* example-end */
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect2> scribble-xinput.c
<p>
<tscreen><verb>
/* example-start scribble-xinput scribble-xinput.c */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include &lt;gtk/gtk.h&gt;
/* Backing pixmap for drawing area */
static GdkPixmap *pixmap = NULL;
/* Create a new backing pixmap of the appropriate size */
static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
gdk_pixmap_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
widget->allocation.height,
-1);
gdk_draw_rectangle (pixmap,
widget->style->white_gc,
TRUE,
0, 0,
widget->allocation.width,
widget->allocation.height);
return TRUE;
}
/* Redraw the screen from the backing pixmap */
static gint
expose_event (GtkWidget *widget, GdkEventExpose *event)
{
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
return FALSE;
}
/* Draw a rectangle on the screen, size depending on pressure,
and color on the type of device */
static void
draw_brush (GtkWidget *widget, GdkInputSource source,
gdouble x, gdouble y, gdouble pressure)
{
GdkGC *gc;
GdkRectangle update_rect;
switch (source)
{
case GDK_SOURCE_MOUSE:
gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)];
break;
case GDK_SOURCE_PEN:
gc = widget->style->black_gc;
break;
case GDK_SOURCE_ERASER:
gc = widget->style->white_gc;
break;
default:
gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)];
}
update_rect.x = x - 10 * pressure;
update_rect.y = y - 10 * pressure;
update_rect.width = 20 * pressure;
update_rect.height = 20 * pressure;
gdk_draw_rectangle (pixmap, gc, TRUE,
update_rect.x, update_rect.y,
update_rect.width, update_rect.height);
gtk_widget_draw (widget, &amp;update_rect);
}
static void
print_button_press (guint32 deviceid)
{
GList *tmp_list;
/* gdk_input_list_devices returns an internal list, so we shouldn't
free it afterwards */
tmp_list = gdk_input_list_devices();
while (tmp_list)
{
GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data;
if (info->deviceid == deviceid)
{
g_print("Button press on device '%s'\n", info->name);
return;
}
tmp_list = tmp_list->next;
}
}
static gint
button_press_event (GtkWidget *widget, GdkEventButton *event)
{
print_button_press (event->deviceid);
if (event->button == 1 &amp;&amp; pixmap != NULL)
draw_brush (widget, event->source, event->x, event->y, event->pressure);
return TRUE;
}
static gint
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
{
gdouble x, y;
gdouble pressure;
GdkModifierType state;
if (event->is_hint)
gdk_input_window_get_pointer (event->window, event->deviceid,
&amp;x, &amp;y, &amp;pressure, NULL, NULL, &amp;state);
else
{
x = event->x;
y = event->y;
pressure = event->pressure;
state = event->state;
}
if (state &amp; GDK_BUTTON1_MASK &amp;&amp; pixmap != NULL)
draw_brush (widget, event->source, x, y, pressure);
return TRUE;
}
void
input_dialog_destroy (GtkWidget *w, gpointer data)
{
*((GtkWidget **)data) = NULL;
}
void
create_input_dialog ()
{
static GtkWidget *inputd = NULL;
if (!inputd)
{
inputd = gtk_input_dialog_new();
gtk_signal_connect (GTK_OBJECT(inputd), "destroy",
(GtkSignalFunc)input_dialog_destroy, &amp;inputd);
gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button),
"clicked",
(GtkSignalFunc)gtk_widget_hide,
GTK_OBJECT(inputd));
gtk_widget_hide ( GTK_INPUT_DIALOG(inputd)->save_button);
gtk_widget_show (inputd);
}
else
{
if (!GTK_WIDGET_MAPPED(inputd))
gtk_widget_show(inputd);
else
gdk_window_raise(inputd->window);
}
}
void
quit ()
{
gtk_exit (0);
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *drawing_area;
GtkWidget *vbox;
GtkWidget *button;
gtk_init (&amp;argc, &amp;argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name (window, "Test Input");
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show (vbox);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (quit), NULL);
/* Create the drawing area */
drawing_area = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
gtk_widget_show (drawing_area);
/* Signals used to handle backing pixmap */
gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
(GtkSignalFunc) expose_event, NULL);
gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event",
(GtkSignalFunc) configure_event, NULL);
/* Event signals */
gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event",
(GtkSignalFunc) motion_notify_event, NULL);
gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event",
(GtkSignalFunc) button_press_event, NULL);
gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
| GDK_LEAVE_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
/* The following call enables tracking and processing of extension
events for the drawing area */
gtk_widget_set_extension_events (drawing_area, GDK_EXTENSION_EVENTS_CURSOR);
/* .. And some buttons */
button = gtk_button_new_with_label ("Input Dialog");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (create_input_dialog), NULL);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Quit");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (window));
gtk_widget_show (button);
gtk_widget_show (window);
gtk_main ();
return 0;
}
/* example-end */
</verb></tscreen>
<!-- ***************************************************************** -->
<sect> List Widget
<!-- ***************************************************************** -->
+1063 -220
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -240,7 +240,7 @@ Taking care of proper referencing
---------------------------------
There are some cases where referencing of widgets from outside the toolkit
(on the application side is needed).
(on the application side) is needed.
Once the application performes an operation on a widget that will cause
its reference count to drop, if it wants to take further actions on the
widget, it needs to hold a reference to it.
+355 -21
View File
@@ -12062,12 +12062,6 @@ to this, once you finish your widget, announce it to the world so
other people can benefit. The best place to do this is probably the
<tt>gtk-list</tt>.
Complete sources for the example widgets are available at the place you
got this tutorial, or from:
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
<!-- ----------------------------------------------------------------- -->
<sect1> The Anatomy Of A Widget
@@ -13910,13 +13904,7 @@ needs to be updated. X will eventually generate an expose event
to copy the relevant portions to the screen.
We have now covered the entire drawing program except for a few
mundane details like creating the main window. The complete
source code is available from the location from which you got
this tutorial, or from:
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
mundane details like creating the main window.
<!-- ----------------------------------------------------------------- -->
<sect1> Adding XInput support
@@ -14234,13 +14222,7 @@ print_button_press (guint32 deviceid)
}
</verb></tscreen>
That completes the changes to `XInputize' our program. As with
the first version, the complete source is available at the location
from which you got this tutorial, or from:
<htmlurl url="http://www.gtk.org/~otaylor/gtk/tutorial/"
name="http://www.gtk.org/~otaylor/gtk/tutorial/">
That completes the changes to `XInputize' our program.
<sect2> Further sophistications <label id="sec_Further_Sophistications">
<p>
@@ -16547,7 +16529,83 @@ gtk_dial_adjustment_value_changed (GtkAdjustment *adjustment,
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect1> Scribble
<sect2> dial-test.c
<p>
<tscreen><verb>
/* example-start gtkdial dial-test.c */
#include &lt;stdio.h&gt;
#include &lt;gtk/gtk.h&gt;
#include "gtkdial.h"
void
value_changed (GtkAdjustment *adjustment, GtkWidget *label)
{
char buffer[16];
sprintf(buffer,"%4.2f",adjustment->value);
gtk_label_set (GTK_LABEL (label), buffer);
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkAdjustment *adjustment;
GtkWidget *dial;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *label;
gtk_init (&amp;argc, &amp;argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Dial");
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_exit), NULL);
gtk_container_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show(vbox);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX(vbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
adjustment = GTK_ADJUSTMENT(gtk_adjustment_new (0, -1.0, 1.0, 0.01, 0.1, 0));
dial = gtk_dial_new(adjustment);
gtk_dial_set_update_policy (GTK_DIAL(dial), GTK_UPDATE_DELAYED);
/* gtk_widget_set_usize (dial, 100, 100); */
gtk_container_add (GTK_CONTAINER (frame), dial);
gtk_widget_show (dial);
label = gtk_label_new("0.00");
gtk_box_pack_start (GTK_BOX(vbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
gtk_signal_connect (GTK_OBJECT(adjustment), "value_changed",
GTK_SIGNAL_FUNC (value_changed), label);
gtk_widget_show (window);
gtk_main ();
return 0;
}
/* example-end */
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect1>Scribble
<!-- ----------------------------------------------------------------- -->
<sect2> scribble-simple.c
<p>
<tscreen><verb>
/* example-start scribble-simple scribble-simple.c */
@@ -16732,6 +16790,282 @@ main (int argc, char *argv[])
/* example-end */
</verb></tscreen>
<!-- ----------------------------------------------------------------- -->
<sect2> scribble-xinput.c
<p>
<tscreen><verb>
/* example-start scribble-xinput scribble-xinput.c */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include &lt;gtk/gtk.h&gt;
/* Backing pixmap for drawing area */
static GdkPixmap *pixmap = NULL;
/* Create a new backing pixmap of the appropriate size */
static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
if (pixmap)
gdk_pixmap_unref(pixmap);
pixmap = gdk_pixmap_new(widget->window,
widget->allocation.width,
widget->allocation.height,
-1);
gdk_draw_rectangle (pixmap,
widget->style->white_gc,
TRUE,
0, 0,
widget->allocation.width,
widget->allocation.height);
return TRUE;
}
/* Redraw the screen from the backing pixmap */
static gint
expose_event (GtkWidget *widget, GdkEventExpose *event)
{
gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
return FALSE;
}
/* Draw a rectangle on the screen, size depending on pressure,
and color on the type of device */
static void
draw_brush (GtkWidget *widget, GdkInputSource source,
gdouble x, gdouble y, gdouble pressure)
{
GdkGC *gc;
GdkRectangle update_rect;
switch (source)
{
case GDK_SOURCE_MOUSE:
gc = widget->style->dark_gc[GTK_WIDGET_STATE (widget)];
break;
case GDK_SOURCE_PEN:
gc = widget->style->black_gc;
break;
case GDK_SOURCE_ERASER:
gc = widget->style->white_gc;
break;
default:
gc = widget->style->light_gc[GTK_WIDGET_STATE (widget)];
}
update_rect.x = x - 10 * pressure;
update_rect.y = y - 10 * pressure;
update_rect.width = 20 * pressure;
update_rect.height = 20 * pressure;
gdk_draw_rectangle (pixmap, gc, TRUE,
update_rect.x, update_rect.y,
update_rect.width, update_rect.height);
gtk_widget_draw (widget, &amp;update_rect);
}
static void
print_button_press (guint32 deviceid)
{
GList *tmp_list;
/* gdk_input_list_devices returns an internal list, so we shouldn't
free it afterwards */
tmp_list = gdk_input_list_devices();
while (tmp_list)
{
GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data;
if (info->deviceid == deviceid)
{
g_print("Button press on device '%s'\n", info->name);
return;
}
tmp_list = tmp_list->next;
}
}
static gint
button_press_event (GtkWidget *widget, GdkEventButton *event)
{
print_button_press (event->deviceid);
if (event->button == 1 &amp;&amp; pixmap != NULL)
draw_brush (widget, event->source, event->x, event->y, event->pressure);
return TRUE;
}
static gint
motion_notify_event (GtkWidget *widget, GdkEventMotion *event)
{
gdouble x, y;
gdouble pressure;
GdkModifierType state;
if (event->is_hint)
gdk_input_window_get_pointer (event->window, event->deviceid,
&amp;x, &amp;y, &amp;pressure, NULL, NULL, &amp;state);
else
{
x = event->x;
y = event->y;
pressure = event->pressure;
state = event->state;
}
if (state &amp; GDK_BUTTON1_MASK &amp;&amp; pixmap != NULL)
draw_brush (widget, event->source, x, y, pressure);
return TRUE;
}
void
input_dialog_destroy (GtkWidget *w, gpointer data)
{
*((GtkWidget **)data) = NULL;
}
void
create_input_dialog ()
{
static GtkWidget *inputd = NULL;
if (!inputd)
{
inputd = gtk_input_dialog_new();
gtk_signal_connect (GTK_OBJECT(inputd), "destroy",
(GtkSignalFunc)input_dialog_destroy, &amp;inputd);
gtk_signal_connect_object (GTK_OBJECT(GTK_INPUT_DIALOG(inputd)->close_button),
"clicked",
(GtkSignalFunc)gtk_widget_hide,
GTK_OBJECT(inputd));
gtk_widget_hide ( GTK_INPUT_DIALOG(inputd)->save_button);
gtk_widget_show (inputd);
}
else
{
if (!GTK_WIDGET_MAPPED(inputd))
gtk_widget_show(inputd);
else
gdk_window_raise(inputd->window);
}
}
void
quit ()
{
gtk_exit (0);
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *drawing_area;
GtkWidget *vbox;
GtkWidget *button;
gtk_init (&amp;argc, &amp;argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name (window, "Test Input");
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_widget_show (vbox);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (quit), NULL);
/* Create the drawing area */
drawing_area = gtk_drawing_area_new ();
gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area), 200, 200);
gtk_box_pack_start (GTK_BOX (vbox), drawing_area, TRUE, TRUE, 0);
gtk_widget_show (drawing_area);
/* Signals used to handle backing pixmap */
gtk_signal_connect (GTK_OBJECT (drawing_area), "expose_event",
(GtkSignalFunc) expose_event, NULL);
gtk_signal_connect (GTK_OBJECT(drawing_area),"configure_event",
(GtkSignalFunc) configure_event, NULL);
/* Event signals */
gtk_signal_connect (GTK_OBJECT (drawing_area), "motion_notify_event",
(GtkSignalFunc) motion_notify_event, NULL);
gtk_signal_connect (GTK_OBJECT (drawing_area), "button_press_event",
(GtkSignalFunc) button_press_event, NULL);
gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK
| GDK_LEAVE_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
/* The following call enables tracking and processing of extension
events for the drawing area */
gtk_widget_set_extension_events (drawing_area, GDK_EXTENSION_EVENTS_CURSOR);
/* .. And some buttons */
button = gtk_button_new_with_label ("Input Dialog");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (create_input_dialog), NULL);
gtk_widget_show (button);
button = gtk_button_new_with_label ("Quit");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (window));
gtk_widget_show (button);
gtk_widget_show (window);
gtk_main ();
return 0;
}
/* example-end */
</verb></tscreen>
<!-- ***************************************************************** -->
<sect> List Widget
<!-- ***************************************************************** -->
+1 -1
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
+1 -1
View File
@@ -81,7 +81,7 @@ main (int argv, char **argc)
info = g_malloc(sizeof(Info));
window = gtk_window_new(GTK_TOPLEVEL);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy), NULL);
View File
-22
View File
@@ -1,22 +0,0 @@
lib_LTLIBRARIES = \
libgdk-pixbuf.la \
libpixbuf-png.la
#
# The GdkPixBuf library
#
libgdk_pixbufincludedir = $(includedir)/gdk-pixbuf
libgdk_pixbuf_la_SOURCES = \
gdk-pixbuf.c \
gdk-pixbuf-io.c
libgdk_pixbufinclude_HEADERS = \
gdk-pixbuf.h
#
# The PNG plugin.
#
libpixbuf_png_la_SOURCES = \
io-png.c
-15
View File
@@ -1,15 +0,0 @@
#ifndef _GDK_PIXBUF_CACHE_H_
#define _GDK_PIXBUF_CACHE_H_
/* The optional cache interface */
typedef struct {
int dummy;
} GdkPixBufCache;
GdkPixBufCache *gdk_pixbuf_cache_new (long image_cache_limit,
long pixmap_bitmap_cache_limit);
void gdk_pixbuf_cache_destroy (GdkPixBufCache *cache);
GdkPixBuf *gdk_pixbuf_cache_load_image (GdkPixBufCache *cache,
const char *file);
#endif
-199
View File
@@ -1,199 +0,0 @@
/*
* gdk-pixbuf-io.c: Code to load images into GdkPixBufs
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*/
#include <config.h>
#include <stdio.h>
#include "gdk-pixbuf.h"
static gboolean
pixbuf_check_png (unsigned char *buffer, int size)
{
if (size < 28)
return FALSE;
if (buffer [0] != 0x89 ||
buffer [1] != 'P' ||
buffer [2] != 'N' ||
buffer [3] != 'G' ||
buffer [4] != 0x0d ||
buffer [5] != 0x0a ||
buffer [6] != 0x1a ||
buffer [7] != 0x0a)
return FALSE;
return TRUE;
}
static gboolean
pixbuf_check_jpeg (unsigned char *buffer, int size)
{
if (size < 10)
return FALSE;
if (buffer [0] != 0xff || buffer [1] != 0xd8)
return FALSE;
return TRUE;
}
static gboolean
pixbuf_check_tiff (unsigned char *buffer, int size)
{
if (size < 10)
return FALSE;
if (buffer [0] == 'M' && buffer [1] == 'M' && buffer [2] == 0 && buffer [3] == 0x2a)
return TRUE;
if (buffer [0] == 'I' && buffer [1] == 'I' && buffer [2] == 0x2a && buffer [3] == 0)
return TRUE;
return FALSE;
}
static gboolean
pixbuf_check_gif (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (strncmp (buffer, "GIF8", 4) == 0)
return TRUE;
return FALSE;
}
static gboolean
pixbuf_check_xpm (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (strncmp (buffer, "/* XPM */", 9) == 0)
return TRUE;
return FALSE;
}
static gboolean
pixbuf_check_bmp (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (buffer [0] != 'B' || buffer [1] != 'M')
return FALSE;
return TRUE;
}
static gboolean
pixbuf_check_ppm (unsigned char *buffer, int size)
{
if (size < 20)
return FALSE;
if (buffer [0] == 'P'){
if (buffer [1] == '1' ||
buffer [1] == '2' ||
buffer [1] == '3' ||
buffer [1] == '4' ||
buffer [1] == '5' ||
buffer [1] == '6')
return TRUE;
}
return FALSE;
}
static struct {
char *module_name;
gboolean (*format_check)(unsigned char *buffer, int size);
GModule *module;
GdkPixBuf *(*load)(FILE *f)
int (*save)(char *filename, ...);
} file_formats [] = {
{ "png", pixbuf_check_png, NULL, NULL, NULL },
{ "jpeg", pixbuf_check_jpeg, NULL, NULL, NULL },
{ "tiff", pixbuf_check_tiff, NULL, NULL, NULL },
{ "gif", pixbuf_check_gif, NULL, NULL, NULL },
{ "xpm", pixbuf_check_xpm, NULL, NULL, NULL }
{ "bmp", pixbuf_check_bmp, NULL, NULL, NULL },
{ "ppm", pixbuf_check_ppm, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL, NULL },
};
static int
image_file_format (const char *file)
{
FILE *f = fopen (file);
if (!f)
return -1;
}
static void
image_handler_load (int idx)
{
char *module_name = g_strconcat ("pixbuf-", file_formats [idx].module_name, NULL);
char *path;
GModule *module;
void *load_sym, *save_sym;
path = g_module_build_path (PIXBUF_LIBDIR, module_name);
g_free (module_name);
module = g_module_open (path, G_MODULE_BIND_LAZY);
if (!module)
return;
file_formats [idx].module = module;
if (g_module_symbol (module, "image_load", &load_sym))
file_formats [idx].load = load_sym;
if (g_module_symbol (module, "image_save", &save_sym))
file_formats [idx].save = save_sym;
}
GdkPixBuf *
gdk_pixbuf_load_image (const char *file)
{
GdkPixBuf *pixbuf;
FormatLoader format_loader;
FILE *f;
char buffer [128];
f = fopen (file);
if (!f)
return NULL;
n = fread (&buffer, 1, sizeof (buffer), f);
if (n == 0){
fclose (f);
return NULL;
}
for (i = 0; file_formats [i].module_name; i++){
if ((*file_formats [i].format_check)(buffer, n)){
if (!file_formats [i].load)
image_handler_load (i);
if (!file_formats [i].load){
fclose (f);
return NULL;
}
rewind (f);
pixbuf = (*file_formats [i].load)(f);
fclose (f);
return pixbuf;
}
}
fclose (f);
return NULL;
}
-36
View File
@@ -1,36 +0,0 @@
/*
* gdk-pixbuf.c: Resource management.
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*/
#include <config.h>
#include "gdk-pixbuf.h"
static void
gdk_pixbuf_destroy (GdkPixBuf *pixbuf)
{
art_pixbuf_free (pixbuf->art_pixbuf);
g_free (pixbuf);
}
void
gdk_pixbuf_ref (GdkPixBuf *pixbuf)
{
g_return_if_fail (pixbuf != NULL);
pixbuf->ref_count++;
}
void
gdk_pixbuf_unref (GdkPixBuf *pixbuf)
{
g_return_if_fail (pixbuf != NULL);
g_return_if_fail (pixbuf->ref_count == 0);
pixbuf->ref_count--;
if (pixbuf->ref_count)
gdk_pixbuf_destroy (pixbuf);
}
-19
View File
@@ -1,19 +0,0 @@
#ifndef _GDK_PIXBUF_H_
#define _GDK_PIXBUF_H_
#include <libart_lgpl/art_misc.h>
#include <libart_lgpl/art_pixbuf.h>
typedef struct {
int ref_count;
ArtPixBuf *art_pixbuf;
void (*unref_func)(void *gdkpixbuf);
} GdkPixBuf;
GdkPixBuf *gdk_pixbuf_load_image (const char *file);
void gdk_pixbuf_save_image (const char *format_id, const char *file, ...);
void gdk_pixbuf_ref (GdkPixBuf *pixbuf);
void gdk_pixbuf_unref (GdkPixBuf *pixbuf);
GdkPixBuf gdk_pixbuf_duplicate (GdkPixBuf *pixbuf);
#endif /* _GDK_PIXBUF_H_ */
-90
View File
@@ -1,90 +0,0 @@
/*
* io-png.c: GdkPixBuf image loader for PNG files.
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*
*/
#include <config.h>
#include <stdio.h>
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-io.h"
#include <png.h>
/* Shared library entry point */
GdkPixBuf *
image_load (FILE *f);
{
png_structp png;
png_infop info_ptr, end_info;
int width, height, depth, color_type, interlace_type;
int have_alpha, number_passes;
art_u8 *data;
g_return_val_if_fail (filename != NULL, NULL);
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png)
return NULL;
info_ptr = png_create_info_struct (png);
if (!info_ptr){
png_destroy_read_struct (&png, NULL, NULL);
return NULL;
}
end_info = png_create_info_struct (png);
if (!end_info){
png_destroy_read_struct (&png, &info_ptr, NULL);
return NULL:
}
if (setjmp (png->jmpbuf)){
png_destroy_read_struct (&png, &info_ptr, &end_info);
return NULL;
}
png_init_io (pngptr, f);
png_read_info (png, info_ptr);
png_get_IHDR (png, info_ptr, &width, &height, &depth, &color_type, &interlace_type, NULL, NULL);
if (color_type == color_type == PNG_COLOR_TYPE_PALETTE)
png_set_expand (png);
/*
* Strip 16 bit information to 8 bit
*/
png_set_strip_16 (png);
/*
* Extract multiple pixels with bit depths 1, 2 and 4 from a single
* byte into separate bytes
*/
png_set_packing (png);
/*
* Makes the PNG file to be rendered into RGB or RGBA
* modes (no matter of the bit depth nor the image
* mode
*/
png_set_expand (png);
/*
* Simplify loading by always having 4 bytes
*/
png_set_filler (png, 0xff, PNG_FILLER_AFTER);
if (color_type & PNG_COLOR_MASK_ALPHA)
have_alpha = 1
else
have_alpha = 0;
data = art_alloc (width * height * (3 + have_alpha));
if (!data){
png_destroy_read_struct (&png, &info_ptr, &end_info);
return NULL;
}
number_passes = png_set_interlace_handling (png);
}
-18
View File
@@ -1,18 +0,0 @@
#ifndef _GDK_PIXBUF_H_
#define _GDK_PIXBUF_H_
#include <libart_lgpl/art_pixbuf.h>
typedef struct {
int ref_count;
ArtPixBuf *pixbuf;
void (*unref_func)(void *gdkpixbuf);
} GdkPixBuf;
GdkPixBuf *gdk_pixbuf_load_image (const char *file);
void gdk_pixbuf_save_image (const char *format_id, const char *file, ...);
void gdk_pixbuf_ref (GdkPixBuf *pixbuf);
void gdk_pixbuf_unref (GdkPixBuf *pixbuf);
GdkPixBuf gdk_pixbuf_duplicate (GdkPixBuf *pixbuf);
#endif /* _GDK_PIXBUF_H_ */
+504
View File
@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+66 -42
View File
@@ -1,19 +1,47 @@
## Process this file with automake to produce Makefile.in
## Makefile.am for gtk+/gdk
gdkincludedir = $(includedir)/gdk
lib_LTLIBRARIES = libgdk.la
INCLUDES = \
INCLUDES = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gdk\" \
-I$(top_srcdir) \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@
@x_cflags@ \
@STRIP_END@
libgdk_la_SOURCES = \
#
# libraries to compile and install
#
lib_LTLIBRARIES = libgdk.la
# libtool stuff: set version and export symbols for resolving
libgdkincludedir = $(includedir)/gdk
libgdk_la_LDFLAGS = @STRIP_BEGIN@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE) \
-export-dynamic \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
-lm \
@STRIP_END@
#
# setup source file variables
#
# GDK header files for public installation (non-generated)
gdk_public_h_sources = @STRIP_BEGIN@ \
gdk.h \
gdkcursors.h \
gdkrgb.h \
gdki18n.h \
gdkkeysyms.h \
gdkprivate.h \
gdktypes.h \
gdkx.h \
@STRIP_END@
gdk_c_sources = @STRIP_BEGIN@ \
gdk.c \
gdkcc.c \
gdkcolor.c \
@@ -44,42 +72,23 @@ libgdk_la_SOURCES = \
MwmUtil.h \
gxid_lib.h \
gxid_proto.h \
gxid_lib.c
## this last one is ifdef'd out unless XINPUT_GXI is defined
## It's easier than trying to get automake to handle compiling
## it conditionally
gxid_lib.c \
@STRIP_END@
gdkinclude_HEADERS = \
gdk.h \
gdkcursors.h \
gdkrgb.h \
gdki18n.h \
gdkkeysyms.h \
gdkprivate.h \
gdktypes.h \
gdkx.h
LDADDS = \
@x_ldflags@ \
@x_libs@ \
@GLIB_LIBS@ \
-lm
libgdk_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
-lm
EXTRA_PROGRAMS = gxid
bin_PROGRAMS = @xinput_progs@
gxid_SOURCES = gxid.c
gxid_LDADD = $(LDADDS)
#
# setup GDK sources and their dependancies
#
libgdkinclude_HEADERS = $(gdk_public_h_sources)
libgdk_la_SOURCES = $(gdk_c_sources)
MAINTAINERCLEANFILES +=
EXTRA_HEADERS +=
EXTRA_DIST +=
EXTRA_DIST +=
#
# rules to generate built sources
#
# we only need to remake these headers once a new X version is released
X-derived-headers:
sed -e 's/^#define[ ]*XC\([^ ]*\)[ ]*\([^ ]*\)[ ]*.*$$/GDK\1 = \2,/' \
-e 'tb' -e 'd' -e ':b' \
@@ -89,6 +98,21 @@ X-derived-headers:
-e 'tb' -e 'd' -e ':b' -e 's/ 0X/ 0x/' \
< @x_includes@/X11/keysymdef.h > gdkkeysyms.h
#
# extra programs
#
EXTRA_PROGRAMS = gxid
bin_PROGRAMS = @xinput_progs@
LDADDS = @STRIP_BEGIN@ \
@x_ldflags@ \
@x_libs@ \
@GLIB_LIBS@ \
-lm \
@STRIP_END@
gxid_SOURCES = gxid.c
gxid_LDADD = $(LDADDS)
.PHONY: files
files:
+56 -18
View File
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
@@ -48,6 +49,7 @@
#include "gdkinput.h"
#include "gdkx.h"
#include "gdki18n.h"
#include "gdkkeysyms.h"
#ifndef X_GETTIMEOFDAY
#define X_GETTIMEOFDAY(tv) gettimeofday (tv, NULL)
@@ -333,6 +335,7 @@ gdk_init_check (int *argc,
gdk_im_set_best_style (GDK_IM_PREEDIT_POSITION);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
(*argv)[i] = NULL;
}
}
else if (strcmp ("--xim-status", (*argv)[i]) == 0)
@@ -348,6 +351,7 @@ gdk_init_check (int *argc,
gdk_im_set_best_style (GDK_IM_STATUS_AREA);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
(*argv)[i] = NULL;
}
}
#endif
@@ -406,9 +410,9 @@ gdk_init_check (int *argc,
g_free(argv_orig[i]);
g_free(argv_orig);
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", True);
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", True);
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", True);
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", False);
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", False);
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", False);
gdk_wm_window_protocols[0] = gdk_wm_delete_window;
gdk_wm_window_protocols[1] = gdk_wm_take_focus;
gdk_selection_property = XInternAtom (gdk_display, "GDK_SELECTION", False);
@@ -1032,20 +1036,35 @@ static int
gdk_x_error (Display *display,
XErrorEvent *error)
{
char buf[64];
if (gdk_error_warnings)
if (error->error_code)
{
XGetErrorText (display, error->error_code, buf, 63);
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
if (gdk_error_warnings)
{
char buf[64];
XGetErrorText (display, error->error_code, buf, 63);
#ifdef G_ENABLE_DEBUG
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
#else /* !G_ENABLE_DEBUG */
fprintf (stderr, "Gdk-ERROR **: %s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
exit(1);
#endif /* G_ENABLE_DEBUG */
}
gdk_error_code = error->error_code;
}
gdk_error_code = -1;
return 0;
}
@@ -1071,8 +1090,27 @@ gdk_x_error (Display *display,
static int
gdk_x_io_error (Display *display)
{
g_error ("an x io error occurred");
return 0;
/* This is basically modelled after the code in XLib. We need
* an explicit error handler here, so we can disable our atexit()
* which would otherwise cause a nice segfault.
* We fprintf(stderr, instead of g_warning() because g_warning()
* could possibly be redirected to a dialog
*/
if (errno == EPIPE)
{
fprintf (stderr, "Gdk-ERROR **: X connection to %s broken (explicit kill or server shutdown).\n", gdk_display ? DisplayString (gdk_display) : gdk_get_display());
}
else
{
fprintf (stderr, "Gdk-ERROR **: Fatal IO error %d (%s) on X server %s.\n",
errno, g_strerror (errno),
gdk_display ? DisplayString (gdk_display) : gdk_get_display());
}
/* Disable the atexit shutdown for GDK */
gdk_initialized = 0;
exit(1);
}
gchar *
@@ -1104,7 +1142,7 @@ gdk_error_trap_push (void)
}
else
{
node = g_slist_alloc();
node = g_slist_alloc ();
node->data = g_new (GdkErrorTrap, 1);
}
@@ -1166,7 +1204,7 @@ gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
XSync (gdk_display, False);
gdk_error_warnings = old_warnings;
return result && (gdk_error_code != -1);
return result && !gdk_error_code;
}
#ifndef HAVE_XCONVERTCASE
+4 -4
View File
@@ -479,8 +479,8 @@ GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
const gchar *filename);
GdkPixmap* gdk_pixmap_colormap_create_from_xpm
(GdkWindow *window,
GdkPixmap* gdk_pixmap_colormap_create_from_xpm (
GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
@@ -489,8 +489,8 @@ GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window,
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data);
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d
(GdkWindow *window,
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (
GdkWindow *window,
GdkColormap *colormap,
GdkBitmap **mask,
GdkColor *transparent_color,
+101 -99
View File
@@ -70,7 +70,7 @@ gdk_colormap_new (GdkVisual *visual,
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
colormap->size = visual->colormap_size;
colormap->colors = g_new (GdkColor, colormap->size);
colormap->colors = NULL;
switch (visual->type)
{
@@ -117,6 +117,7 @@ gdk_colormap_new (GdkVisual *visual,
private->private_val = TRUE;
private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window,
xvisual, AllocAll);
colormap->colors = g_new (GdkColor, colormap->size);
size = 1 << visual->red_prec;
for (i = 0; i < size; i++)
@@ -432,55 +433,6 @@ gdk_colors_alloc (GdkColormap *colormap,
return return_val;
}
/* This is almost identical to gdk_colormap_free_colors.
* Keep them in sync!
*/
void
gdk_colors_free (GdkColormap *colormap,
gulong *in_pixels,
gint in_npixels,
gulong planes)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (in_pixels != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, in_npixels);
for (i=0; i<in_npixels; i++)
{
gulong pixel = in_pixels[i];
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[in_pixels[i]]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, planes);
g_free (pixels);
}
/*
*--------------------------------------------------------------
* gdk_color_copy
@@ -609,6 +561,104 @@ gdk_color_parse (const gchar *spec,
return return_val;
}
/* This is almost identical to gdk_colormap_free_colors.
* Keep them in sync!
*/
void
gdk_colors_free (GdkColormap *colormap,
gulong *in_pixels,
gint in_npixels,
gulong planes)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (in_pixels != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, in_npixels);
for (i=0; i<in_npixels; i++)
{
gulong pixel = in_pixels[i];
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, planes);
g_free (pixels);
}
/* This is almost identical to gdk_colors_free.
* Keep them in sync!
*/
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (colors != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, ncolors);
for (i=0; i<ncolors; i++)
{
gulong pixel = colors[i].pixel;
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, 0);
g_free (pixels);
}
/********************
* Color allocation *
********************/
@@ -649,6 +699,7 @@ gdk_colormap_alloc1 (GdkColormap *colormap,
else
{
colormap->colors[ret->pixel] = *color;
colormap->colors[ret->pixel].pixel = ret->pixel;
private->info[ret->pixel].ref_count = 1;
g_hash_table_insert (private->hash,
@@ -1026,55 +1077,6 @@ gdk_colormap_alloc_color (GdkColormap *colormap,
return success;
}
/* This is almost identical to gdk_colors_free.
* Keep them in sync!
*/
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (colors != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, ncolors);
for (i=0; i<ncolors; i++)
{
gulong pixel = colors[i].pixel;
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colors[i]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, 0);
g_free (pixels);
}
gboolean
gdk_color_alloc (GdkColormap *colormap,
GdkColor *color)
+38 -38
View File
@@ -31,8 +31,6 @@
#include "gdk/gdkprivate.h"
#include "gdk.h"
#define NEW_DRAGS
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
typedef enum {
@@ -70,7 +68,8 @@ struct _GdkDragContextPrivate {
GdkDragAction old_actions; /* The last actions we sent to the source */
GdkDragAction xdnd_actions; /* What is currently set in XdndActionList */
Window dest_xid;
Window dest_xid; /* The last window we looked up */
Window drop_xid; /* The (non-proxied) window that is receiving drops */
guint xdnd_targets_set : 1; /* Whether we've already set XdndTypeList */
guint xdnd_actions_set : 1; /* Whether we've already set XdndActionList */
guint xdnd_have_actions : 1; /* Whether an XdndActionList was provided */
@@ -151,6 +150,7 @@ gdk_drag_context_unref (GdkDragContext *context)
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
g_return_if_fail (context != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count--;
@@ -196,8 +196,8 @@ gdk_drag_context_find (gboolean is_source,
private = (GdkDragContextPrivate *)context;
context_dest_xid = context->dest_window ?
(private->dest_xid ?
private->dest_xid :
(private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window)) :
None;
@@ -387,7 +387,7 @@ gdk_window_cache_new (void)
xwa.x, xwa.y, xwa.width, xwa.height,
xwa.map_state != IsUnmapped);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else
{
@@ -441,9 +441,10 @@ get_client_window_at_coords_recurse (Window win,
wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -458,9 +459,10 @@ get_client_window_at_coords_recurse (Window win,
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -469,7 +471,7 @@ get_client_window_at_coords_recurse (Window win,
&root, &tmp_parent, &children, &nchildren) == 0)
return 0;
if (gdk_error_code == 0)
if (!gdk_error_code)
{
for (i = nchildren - 1; (i >= 0) && (child == None); i--)
{
@@ -477,7 +479,7 @@ get_client_window_at_coords_recurse (Window win,
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
(x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
@@ -566,9 +568,10 @@ get_client_window_at_coords_recurse (Window win,
wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -581,9 +584,10 @@ get_client_window_at_coords_recurse (Window win,
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -620,7 +624,7 @@ get_client_window_at_coords (Window ignore,
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) &&
(x_root >= xwa.x) && (x_root < xwa.x + (gint)xwa.width) &&
@@ -869,7 +873,7 @@ motif_find_drag_window (gboolean create)
Display *display;
XSetWindowAttributes attr;
display = XOpenDisplay (NULL);
display = XOpenDisplay (gdk_display_name);
XSetCloseDownMode (display, RetainPermanent);
XGrabServer (display);
@@ -2027,6 +2031,8 @@ xdnd_set_targets (GdkDragContext *context)
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
g_free (atomlist);
private->xdnd_targets_set = 1;
}
@@ -2073,6 +2079,8 @@ xdnd_set_actions (GdkDragContext *context)
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
g_free (atomlist);
private->xdnd_actions_set = 1;
private->xdnd_actions = context->actions;
}
@@ -2106,13 +2114,9 @@ xdnd_send_enter (GdkDragContext *context)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = (3 << 24); /* version */
xev.xclient.data.l[2] = 0;
@@ -2162,13 +2166,9 @@ xdnd_send_leave (GdkDragContext *context)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
@@ -2195,13 +2195,9 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
@@ -2232,13 +2228,9 @@ xdnd_send_motion (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root;
@@ -2859,6 +2851,12 @@ gdk_drag_find_window (GdkDragContext *context,
/* Check if new destination accepts drags, and which protocol */
/* There is some ugliness here. We actually need to pass
* _three_ pieces of information to drag_motion - dest_window,
* protocol, and the XID of the unproxied window. The first
* two are passed explicitely, the third implicitly through
* protocol->dest_xid.
*/
if ((recipient = gdk_drag_get_protocol (dest, protocol)))
{
*dest_window = gdk_window_lookup (recipient);
@@ -2917,6 +2915,7 @@ gdk_drag_motion (GdkDragContext *context,
if (dest_window)
{
context->dest_window = dest_window;
private->drop_xid = private->dest_xid;
gdk_window_ref (context->dest_window);
context->protocol = protocol;
@@ -2941,6 +2940,7 @@ gdk_drag_motion (GdkDragContext *context,
else
{
context->dest_window = NULL;
private->drop_xid = None;
context->action = 0;
}
+7 -5
View File
@@ -501,12 +501,14 @@ gdk_draw_lines (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
gc_private = (GdkGCPrivate*) gc;
XDrawLines (drawable_private->xdisplay,
drawable_private->xwindow,
gc_private->xgc,
(XPoint *) points,
npoints,
CoordModeOrigin);
drawable_private->xwindow,
gc_private->xgc,
(XPoint *) points,
npoints,
CoordModeOrigin);
}
+66 -43
View File
@@ -27,7 +27,6 @@
#include "gdk.h"
#include "gdkx.h"
#include "gdkprivate.h"
#include "gdkinput.h"
#include "gdkkeysyms.h"
#if HAVE_CONFIG_H
@@ -37,6 +36,7 @@
# endif
#endif
#include "gdkinput.h"
typedef struct _GdkIOClosure GdkIOClosure;
typedef struct _GdkEventPrivate GdkEventPrivate;
@@ -88,9 +88,11 @@ static GdkEvent* gdk_event_unqueue (void);
static gboolean gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout);
gint *timeout,
gpointer user_data);
static gboolean gdk_event_check (gpointer source_data,
GTimeVal *current_time);
GTimeVal *current_time,
gpointer user_data);
static gboolean gdk_event_dispatch (gpointer source_data,
GTimeVal *current_time,
gpointer user_data);
@@ -449,6 +451,8 @@ gdk_compress_exposures (XEvent *xevent,
&tmp_event,
expose_predicate,
(XPointer)&info);
event.any.window = window;
/* We apply filters here, and if it was filtered, completely
* ignore the return
@@ -849,6 +853,12 @@ gdk_io_destroy (gpointer data)
g_free (closure);
}
/* What do we do with G_IO_NVAL?
*/
#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
#define EXCEPTION_CONDITION (G_IO_PRI)
static gboolean
gdk_io_invoke (GIOChannel *source,
GIOCondition condition,
@@ -857,11 +867,11 @@ gdk_io_invoke (GIOChannel *source,
GdkIOClosure *closure = data;
GdkInputCondition gdk_cond = 0;
if (condition & (G_IO_IN | G_IO_PRI))
if (condition & READ_CONDITION)
gdk_cond |= GDK_INPUT_READ;
if (condition & G_IO_OUT)
if (condition & WRITE_CONDITION)
gdk_cond |= GDK_INPUT_WRITE;
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
if (condition & EXCEPTION_CONDITION)
gdk_cond |= GDK_INPUT_EXCEPTION;
if (closure->condition & gdk_cond)
@@ -888,11 +898,11 @@ gdk_input_add_full (gint source,
closure->data = data;
if (condition & GDK_INPUT_READ)
cond |= (G_IO_IN | G_IO_PRI);
cond |= READ_CONDITION;
if (condition & GDK_INPUT_WRITE)
cond |= G_IO_OUT;
cond |= WRITE_CONDITION;
if (condition & GDK_INPUT_EXCEPTION)
cond |= G_IO_ERR|G_IO_HUP|G_IO_NVAL;
cond |= EXCEPTION_CONDITION;
channel = g_io_channel_unix_new (source);
result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, cond,
@@ -923,7 +933,6 @@ gdk_event_apply_filters (XEvent *xevent,
GdkEvent *event,
GList *filters)
{
GdkEventFilter *filter;
GList *tmp_list;
GdkFilterReturn result;
@@ -931,13 +940,12 @@ gdk_event_apply_filters (XEvent *xevent,
while (tmp_list)
{
filter = (GdkEventFilter*) tmp_list->data;
result = (*filter->function) (xevent, event, filter->data);
if (result != GDK_FILTER_CONTINUE)
return result;
GdkEventFilter *filter = (GdkEventFilter*) tmp_list->data;
tmp_list = tmp_list->next;
result = filter->function (xevent, event, filter->data);
if (result != GDK_FILTER_CONTINUE)
return result;
}
return GDK_FILTER_CONTINUE;
@@ -1057,9 +1065,6 @@ gdk_event_translate (GdkEvent *event,
}
#endif
if (window == NULL)
g_message ("Got event for unknown window: %#lx\n", xevent->xany.window);
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
* the conversion is fairly straightforward. We also
@@ -1661,9 +1666,10 @@ gdk_event_translate (GdkEvent *event,
case ConfigureNotify:
/* Print debugging info.
*/
while ((XPending (gdk_display) > 0) &&
XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
ConfigureNotify, xevent))
while (0 && /* don't reorder ConfigureNotify events at all */
XPending (gdk_display) > 0 &&
XCheckTypedWindowEvent (gdk_display, xevent->xany.window,
ConfigureNotify, xevent))
{
GdkFilterReturn result;
@@ -1690,7 +1696,7 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS,
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d",
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s",
xevent->xconfigure.window,
xevent->xconfigure.x,
xevent->xconfigure.y,
@@ -1698,14 +1704,19 @@ gdk_event_translate (GdkEvent *event,
xevent->xconfigure.height,
xevent->xconfigure.border_width,
xevent->xconfigure.above,
xevent->xconfigure.override_redirect));
if (!window_private->destroyed &&
xevent->xconfigure.override_redirect,
!window
? " (discarding)"
: window_private->window_type == GDK_WINDOW_CHILD
? " (discarding child)"
: ""));
if (window &&
!window_private->destroyed &&
(window_private->extension_events != 0) &&
gdk_input_vtable.configure_event)
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
if (window_private->window_type == GDK_WINDOW_CHILD)
if (!window || window_private->window_type == GDK_WINDOW_CHILD)
return_val = FALSE;
else
{
@@ -1751,8 +1762,14 @@ gdk_event_translate (GdkEvent *event,
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("property notify:\twindow: %ld",
xevent->xproperty.window));
gchar *atom = gdk_atom_name (xevent->xproperty.atom);
g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s",
xevent->xproperty.window,
xevent->xproperty.atom,
atom ? "\"" : "",
atom ? atom : "unknown",
atom ? "\"" : "");
);
event->property.type = GDK_PROPERTY_NOTIFY;
event->property.window = window;
@@ -2017,7 +2034,8 @@ gdk_events_queue (void)
static gboolean
gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout)
gint *timeout,
gpointer user_data)
{
gboolean retval;
@@ -2034,7 +2052,8 @@ gdk_event_prepare (gpointer source_data,
static gboolean
gdk_event_check (gpointer source_data,
GTimeVal *current_time)
GTimeVal *current_time,
gpointer user_data)
{
gboolean retval;
@@ -2133,29 +2152,29 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
guint level)
{
static GdkAtom wm_state_atom = GDK_NONE;
Atom type = None;
int format;
unsigned long nitems, after;
unsigned char *data;
Window *ret_children, ret_root, ret_parent;
unsigned int ret_nchildren;
int i;
gint old_warnings = gdk_error_warnings;
gboolean send = FALSE;
gboolean found = FALSE;
int i;
if (!wm_state_atom)
wm_state_atom = gdk_atom_intern ("WM_STATE", FALSE);
gdk_error_warnings = FALSE;
gdk_error_code = 0;
XGetWindowProperty (gdk_display, xid, wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code)
{
gdk_error_code = 0;
gdk_error_warnings = old_warnings;
return FALSE;
}
@@ -2167,18 +2186,20 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
else
{
/* OK, we're all set, now let's find some windows to send this to */
if (XQueryTree(gdk_display, xid, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True)
return FALSE;
if (gdk_error_code)
return FALSE;
if (XQueryTree (gdk_display, xid, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True ||
gdk_error_code)
{
gdk_error_warnings = old_warnings;
return FALSE;
}
for(i = 0; i < ret_nchildren; i++)
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
if (gdk_event_send_client_message_to_all_recurse (xev, ret_children[i], level + 1))
found = TRUE;
XFree(ret_children);
XFree (ret_children);
}
if (send || (!found && (level == 1)))
@@ -2187,6 +2208,8 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
gdk_send_xevent (xid, False, NoEventMask, xev);
}
gdk_error_warnings = old_warnings;
return (send || found);
}
+40 -17
View File
@@ -34,27 +34,37 @@ gdk_font_load (const gchar *font_name)
{
GdkFont *font;
GdkFontPrivate *private;
XFontStruct *xfont;
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
g_return_val_if_fail (font_name != NULL, NULL);
private->xdisplay = gdk_display;
private->xfont = XLoadQueryFont (private->xdisplay, font_name);
private->ref_count = 1;
xfont = XLoadQueryFont (gdk_display, font_name);
if (xfont == NULL)
return NULL;
if (!private->xfont)
font = gdk_font_lookup (xfont->fid);
if (font != NULL)
{
g_free (font);
return NULL;
private = (GdkFontPrivate *) font;
if (xfont != private->xfont)
XFreeFont (gdk_display, xfont);
gdk_font_ref (font);
}
else
{
font->type = GDK_FONT_FONT;
font->ascent = ((XFontStruct *) private->xfont)->ascent;
font->descent = ((XFontStruct *) private->xfont)->descent;
}
private = g_new (GdkFontPrivate, 1);
private->xdisplay = gdk_display;
private->xfont = xfont;
private->ref_count = 1;
gdk_xid_table_insert (&((XFontStruct *) private->xfont)->fid, font);
font = (GdkFont*) private;
font->type = GDK_FONT_FONT;
font->ascent = xfont->ascent;
font->descent = xfont->descent;
gdk_xid_table_insert (&xfont->fid, font);
}
return font;
}
@@ -131,10 +141,10 @@ void
gdk_font_unref (GdkFont *font)
{
GdkFontPrivate *private;
private = (GdkFontPrivate*) font;
g_return_if_fail (font != NULL);
private = (GdkFontPrivate*) font;
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
@@ -568,7 +578,20 @@ gdk_text_extents_wc (GdkFont *font,
}
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XwcTextExtents (fontset, text, text_length, &ink, &logical);
if (sizeof(GdkWChar) == sizeof(wchar_t))
XwcTextExtents (fontset, (wchar_t *)text, text_length, &ink, &logical);
else
{
wchar_t *text_wchar;
gint i;
text_wchar = g_new (wchar_t, text_length);
for (i = 0; i < text_length; i++)
text_wchar[i] = text[i];
XwcTextExtents (fontset, text_wchar, text_length, &ink, &logical);
g_free (text_wchar);
}
if (lbearing)
*lbearing = ink.x;
if (rbearing)
@@ -642,7 +665,7 @@ gdk_text_measure (GdkFont *font,
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XmbTextExtents (fontset, text, text_length, &ink, &log);
width = log.width;
width = ink.x + ink.width;
break;
default:
width = 0;
+1
View File
@@ -286,6 +286,7 @@ gdk_gc_unref (GdkGC *gc)
GdkGCPrivate *private = (GdkGCPrivate*) gc;
g_return_if_fail (gc != NULL);
g_return_if_fail (private->ref_count > 0);
if (private->ref_count > 1)
private->ref_count -= 1;
+1 -1
View File
@@ -57,7 +57,7 @@ GdkDndGlobals gdk_dnd = {None,None,None,
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
gchar *gdk_progclass = NULL;
gint gdk_error_code;
gint gdk_error_code = 0;
gint gdk_error_warnings = TRUE;
gint gdk_null_window_warnings = TRUE;
GList *gdk_default_filters = NULL;
+19 -11
View File
@@ -386,7 +386,7 @@ gdk_im_real_open (void)
destroy_cb.callback = gdk_im_destroy_cb;
destroy_cb.client_data = NULL;
if (NULL != XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
if (NULL != (void *) XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
GDK_NOTE (XIM, g_warning ("Could not set destroy callback to IM. Be careful to not destroy your input method."));
#endif
@@ -469,7 +469,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_PREEDIT_AREA_REQ;
preedit_area.x = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.y;
preedit_area.width = attr->preedit_area.width;
preedit_area.height = attr->preedit_area.height;
@@ -484,7 +484,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_PREEDIT_POSITION_REQ;
preedit_area.x = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.y;
preedit_area.width = attr->preedit_area.width;
preedit_area.height = attr->preedit_area.height;
@@ -506,7 +506,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_STATUS_AREA_REQ;
status_area.x = attr->status_area.x;
status_area.y = attr->status_area.x;
status_area.y = attr->status_area.y;
status_area.width = attr->status_area.width;
status_area.height = attr->status_area.height;
@@ -518,6 +518,12 @@ gdk_ic_real_new (GdkIC *ic)
break;
}
/* We have to ensure that the client window is actually created on
* the X server, or XCreateIC fails because the XIM server can't get
* information about the client window.
*/
gdk_flush();
if (preedit_attr != NULL && status_attr != NULL)
private->xic = XCreateIC (xim_im,
XNInputStyle,
@@ -871,7 +877,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNFontSet;
arg->value = (gpointer) GDK_FONT_XFONT(attr->status_fontset);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_FONTSET;
}
@@ -887,7 +893,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNArea;
arg->value = (gpointer) &rect;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_AREA;
}
@@ -903,7 +909,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNArea;
arg->value = (gpointer) &rect;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_AREA_NEEDED;
else
private->mask &= ~GDK_IC_STATUS_AREA_NEEDED;
@@ -914,7 +920,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNForeground;
arg->value = (gpointer) attr->status_foreground.pixel;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_FOREGROUND;
}
@@ -923,7 +929,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNBackground;
arg->value = (gpointer) attr->status_background.pixel;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_BACKGROUND;
}
@@ -932,7 +938,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNBackgroundPixmap;
arg->value = (gpointer) GDK_WINDOW_XWINDOW(attr->status_pixmap);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_PIXMAP;
}
@@ -941,7 +947,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNColormap;
arg->value = (gpointer) GDK_COLORMAP_XCOLORMAP(attr->status_colormap);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_COLORMAP;
}
@@ -1565,8 +1571,10 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
!= Success)
{
/* InvalidChar */
XFree(tpr.value);
return -1;
}
XFree(tpr.value);
if (num_wstrs == 0)
return 0;
wstr_src = wstrs[0];
+2 -1
View File
@@ -258,7 +258,7 @@ gdk_image_new (GdkImageType type,
XSync (private->xdisplay, False);
gdk_error_warnings = 1;
if (gdk_error_code == -1)
if (gdk_error_code)
{
/* this is the common failure case so omit warning */
XDestroyImage (private->ximage);
@@ -269,6 +269,7 @@ gdk_image_new (GdkImageType type,
g_free (image);
gdk_use_xshm = False;
return NULL;
}
+3 -2
View File
@@ -518,7 +518,7 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
color_name = gdk_pixmap_extract_color (buffer);
if (color_name == NULL ||
if (color_name == NULL || g_strcasecmp (color_name, "None") == 0 ||
gdk_color_parse (color_name, &color->color) == FALSE)
{
color->color = *transparent_color;
@@ -817,7 +817,8 @@ void
gdk_pixmap_unref (GdkPixmap *pixmap)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
g_return_if_fail(pixmap != NULL);
g_return_if_fail (pixmap != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
+8 -7
View File
@@ -45,15 +45,16 @@ gdk_atom_intern (const gchar *atom_name,
{
retval = XInternAtom (gdk_display, atom_name, only_if_exists);
g_hash_table_insert (atom_hash,
g_strdup (atom_name),
GUINT_TO_POINTER (retval));
if (retval != None || !only_if_exists)
g_hash_table_insert (atom_hash,
g_strdup (atom_name),
GUINT_TO_POINTER (retval));
}
return retval;
}
gchar *
gchar*
gdk_atom_name (GdkAtom atom)
{
gchar *t;
@@ -69,7 +70,7 @@ gdk_atom_name (GdkAtom atom)
t = XGetAtomName (gdk_display, atom);
gdk_error_warnings = old_error_warnings;
if (gdk_error_code == -1)
if (gdk_error_code)
{
if (t)
XFree (t);
@@ -162,10 +163,10 @@ gdk_property_get (GdkWindow *window,
ret_length = ret_nitems;
break;
case 16:
ret_length = 2 * ret_nitems;
ret_length = sizeof(short) * ret_nitems;
break;
case 32:
ret_length = 4 * ret_nitems;
ret_length = sizeof(long) * ret_nitems;
break;
default:
g_warning ("unknown property return format: %d", ret_format);
+9 -6
View File
@@ -482,27 +482,30 @@ gdk_rgb_score_visual (GdkVisual *visual)
static void
gdk_rgb_choose_visual (void)
{
GList *visuals;
GList *visuals, *tmp_list;
guint32 score, best_score;
GdkVisual *visual, *best_visual;
visuals = gdk_list_visuals ();
tmp_list = visuals;
best_visual = visuals->data;
best_visual = tmp_list->data;
best_score = gdk_rgb_score_visual (best_visual);
visuals = visuals->next;
while (visuals)
tmp_list = tmp_list->next;
while (tmp_list)
{
visual = visuals->data;
visual = tmp_list->data;
score = gdk_rgb_score_visual (visual);
if (score > best_score)
{
best_score = score;
best_visual = visual;
}
visuals = visuals->next;
tmp_list = tmp_list->next;
}
g_list_free (visuals);
image_info->visual = best_visual;
}
+4 -4
View File
@@ -105,7 +105,7 @@ gdk_selection_property_get (GdkWindow *requestor,
gulong length;
GdkAtom prop_type;
gint prop_format;
guchar *t;
guchar *t = NULL;
g_return_val_if_fail (requestor != NULL, 0);
@@ -133,11 +133,11 @@ gdk_selection_property_get (GdkWindow *requestor,
*data = NULL;
return 0;
}
if (t)
{
t = NULL;
XFree (t);
t = NULL;
}
/* Add on an extra byte to handle null termination. X guarantees
@@ -188,7 +188,7 @@ gdk_selection_send_notify (guint32 requestor,
xevent.property = property;
xevent.time = time;
XSendEvent (gdk_display, requestor, False, NoEventMask, (XEvent*) &xevent);
gdk_send_xevent (requestor, False, NoEventMask, (XEvent*) &xevent);
}
gint
+22 -21
View File
@@ -34,17 +34,9 @@
#include "gdkprivate.h"
#include "MwmUtil.h"
#if HAVE_CONFIG_H
# include <config.h>
# if STDC_HEADERS
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# endif
#else
# include <stdlib.h>
# include <stdio.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_SHAPE_EXT
@@ -732,6 +724,7 @@ gdk_window_unref (GdkWindow *window)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
@@ -1110,7 +1103,15 @@ gdk_window_set_geometry_hints (GdkWindow *window,
size_hints.flags = 0;
if (geom_mask & GDK_HINT_POS)
size_hints.flags |= PPosition;
{
size_hints.flags |= PPosition;
/* We need to initialize the following obsolete fields because KWM
* apparently uses these fields if they are non-zero.
* #@#!#!$!.
*/
size_hints.x = 0;
size_hints.y = 0;
}
if (geom_mask & GDK_HINT_MIN_SIZE)
{
@@ -1145,23 +1146,23 @@ gdk_window_set_geometry_hints (GdkWindow *window,
size_hints.flags |= PAspect;
if (geometry->min_aspect <= 1)
{
size_hints.min_aspect.x = G_MAXINT * geometry->min_aspect;
size_hints.min_aspect.y = G_MAXINT;
size_hints.min_aspect.x = 65536 * geometry->min_aspect;
size_hints.min_aspect.y = 65536;
}
else
{
size_hints.min_aspect.x = G_MAXINT;
size_hints.min_aspect.y = G_MAXINT / geometry->min_aspect;;
size_hints.min_aspect.x = 65536;
size_hints.min_aspect.y = 65536 / geometry->min_aspect;;
}
if (geometry->max_aspect <= 1)
{
size_hints.max_aspect.x = G_MAXINT * geometry->max_aspect;
size_hints.max_aspect.y = G_MAXINT;
size_hints.max_aspect.x = 65536 * geometry->max_aspect;
size_hints.max_aspect.y = 65536;
}
else
{
size_hints.max_aspect.x = G_MAXINT;
size_hints.max_aspect.y = G_MAXINT / geometry->max_aspect;;
size_hints.max_aspect.x = 65536;
size_hints.max_aspect.y = 65536 / geometry->max_aspect;;
}
}
@@ -1988,7 +1989,7 @@ gdk_window_remove_filter (GdkWindow *window,
if (private)
private->filters = g_list_remove_link (private->filters, node);
else
gdk_default_filters = g_list_remove_link (gdk_default_filters, tmp_list);
gdk_default_filters = g_list_remove_link (gdk_default_filters, node);
g_list_free_1 (node);
g_free (filter);
+101 -99
View File
@@ -70,7 +70,7 @@ gdk_colormap_new (GdkVisual *visual,
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
colormap->size = visual->colormap_size;
colormap->colors = g_new (GdkColor, colormap->size);
colormap->colors = NULL;
switch (visual->type)
{
@@ -117,6 +117,7 @@ gdk_colormap_new (GdkVisual *visual,
private->private_val = TRUE;
private->xcolormap = XCreateColormap (private->xdisplay, gdk_root_window,
xvisual, AllocAll);
colormap->colors = g_new (GdkColor, colormap->size);
size = 1 << visual->red_prec;
for (i = 0; i < size; i++)
@@ -432,55 +433,6 @@ gdk_colors_alloc (GdkColormap *colormap,
return return_val;
}
/* This is almost identical to gdk_colormap_free_colors.
* Keep them in sync!
*/
void
gdk_colors_free (GdkColormap *colormap,
gulong *in_pixels,
gint in_npixels,
gulong planes)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (in_pixels != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, in_npixels);
for (i=0; i<in_npixels; i++)
{
gulong pixel = in_pixels[i];
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[in_pixels[i]]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, planes);
g_free (pixels);
}
/*
*--------------------------------------------------------------
* gdk_color_copy
@@ -609,6 +561,104 @@ gdk_color_parse (const gchar *spec,
return return_val;
}
/* This is almost identical to gdk_colormap_free_colors.
* Keep them in sync!
*/
void
gdk_colors_free (GdkColormap *colormap,
gulong *in_pixels,
gint in_npixels,
gulong planes)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (in_pixels != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, in_npixels);
for (i=0; i<in_npixels; i++)
{
gulong pixel = in_pixels[i];
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, planes);
g_free (pixels);
}
/* This is almost identical to gdk_colors_free.
* Keep them in sync!
*/
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (colors != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, ncolors);
for (i=0; i<ncolors; i++)
{
gulong pixel = colors[i].pixel;
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colormap->colors[pixel]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, 0);
g_free (pixels);
}
/********************
* Color allocation *
********************/
@@ -649,6 +699,7 @@ gdk_colormap_alloc1 (GdkColormap *colormap,
else
{
colormap->colors[ret->pixel] = *color;
colormap->colors[ret->pixel].pixel = ret->pixel;
private->info[ret->pixel].ref_count = 1;
g_hash_table_insert (private->hash,
@@ -1026,55 +1077,6 @@ gdk_colormap_alloc_color (GdkColormap *colormap,
return success;
}
/* This is almost identical to gdk_colors_free.
* Keep them in sync!
*/
void
gdk_colormap_free_colors (GdkColormap *colormap,
GdkColor *colors,
gint ncolors)
{
GdkColormapPrivate *private;
gulong *pixels;
gint npixels = 0;
gint i;
g_return_if_fail (colormap != NULL);
g_return_if_fail (colors != NULL);
private = (GdkColormapPrivate*) colormap;
if ((private->visual->type != GDK_VISUAL_PSEUDO_COLOR) &&
(private->visual->type != GDK_VISUAL_GRAYSCALE))
return;
pixels = g_new (gulong, ncolors);
for (i=0; i<ncolors; i++)
{
gulong pixel = colors[i].pixel;
if (private->info[pixel].ref_count)
{
private->info[pixel].ref_count--;
if (private->info[pixel].ref_count == 0)
{
pixels[npixels++] = pixel;
if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE))
g_hash_table_remove (private->hash, &colors[i]);
private->info[pixel].flags = 0;
}
}
}
if (npixels)
XFreeColors (private->xdisplay, private->xcolormap,
pixels, npixels, 0);
g_free (pixels);
}
gboolean
gdk_color_alloc (GdkColormap *colormap,
GdkColor *color)
+38 -38
View File
@@ -31,8 +31,6 @@
#include "gdk/gdkprivate.h"
#include "gdk.h"
#define NEW_DRAGS
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
typedef enum {
@@ -70,7 +68,8 @@ struct _GdkDragContextPrivate {
GdkDragAction old_actions; /* The last actions we sent to the source */
GdkDragAction xdnd_actions; /* What is currently set in XdndActionList */
Window dest_xid;
Window dest_xid; /* The last window we looked up */
Window drop_xid; /* The (non-proxied) window that is receiving drops */
guint xdnd_targets_set : 1; /* Whether we've already set XdndTypeList */
guint xdnd_actions_set : 1; /* Whether we've already set XdndActionList */
guint xdnd_have_actions : 1; /* Whether an XdndActionList was provided */
@@ -151,6 +150,7 @@ gdk_drag_context_unref (GdkDragContext *context)
GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
g_return_if_fail (context != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count--;
@@ -196,8 +196,8 @@ gdk_drag_context_find (gboolean is_source,
private = (GdkDragContextPrivate *)context;
context_dest_xid = context->dest_window ?
(private->dest_xid ?
private->dest_xid :
(private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window)) :
None;
@@ -387,7 +387,7 @@ gdk_window_cache_new (void)
xwa.x, xwa.y, xwa.width, xwa.height,
xwa.map_state != IsUnmapped);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else
{
@@ -441,9 +441,10 @@ get_client_window_at_coords_recurse (Window win,
wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -458,9 +459,10 @@ get_client_window_at_coords_recurse (Window win,
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -469,7 +471,7 @@ get_client_window_at_coords_recurse (Window win,
&root, &tmp_parent, &children, &nchildren) == 0)
return 0;
if (gdk_error_code == 0)
if (!gdk_error_code)
{
for (i = nchildren - 1; (i >= 0) && (child == None); i--)
{
@@ -477,7 +479,7 @@ get_client_window_at_coords_recurse (Window win,
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
(x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
@@ -566,9 +568,10 @@ get_client_window_at_coords_recurse (Window win,
wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -581,9 +584,10 @@ get_client_window_at_coords_recurse (Window win,
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
if (gdk_error_code != 0)
if (gdk_error_code)
{
gdk_error_code = 0;
return None;
}
@@ -620,7 +624,7 @@ get_client_window_at_coords (Window ignore,
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
if (gdk_error_code)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) &&
(x_root >= xwa.x) && (x_root < xwa.x + (gint)xwa.width) &&
@@ -869,7 +873,7 @@ motif_find_drag_window (gboolean create)
Display *display;
XSetWindowAttributes attr;
display = XOpenDisplay (NULL);
display = XOpenDisplay (gdk_display_name);
XSetCloseDownMode (display, RetainPermanent);
XGrabServer (display);
@@ -2027,6 +2031,8 @@ xdnd_set_targets (GdkDragContext *context)
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
g_free (atomlist);
private->xdnd_targets_set = 1;
}
@@ -2073,6 +2079,8 @@ xdnd_set_actions (GdkDragContext *context)
XA_ATOM, 32, PropModeReplace,
(guchar *)atomlist, n_atoms);
g_free (atomlist);
private->xdnd_actions_set = 1;
private->xdnd_actions = context->actions;
}
@@ -2106,13 +2114,9 @@ xdnd_send_enter (GdkDragContext *context)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = (3 << 24); /* version */
xev.xclient.data.l[2] = 0;
@@ -2162,13 +2166,9 @@ xdnd_send_leave (GdkDragContext *context)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
@@ -2195,13 +2195,9 @@ xdnd_send_drop (GdkDragContext *context, guint32 time)
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndDrop", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = time;
@@ -2232,13 +2228,9 @@ xdnd_send_motion (GdkDragContext *context,
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndPosition", FALSE);
xev.xclient.format = 32;
#ifdef NEW_DRAGS
xev.xclient.window = private->dest_xid ?
private->dest_xid :
xev.xclient.window = private->drop_xid ?
private->drop_xid :
GDK_WINDOW_XWINDOW (context->dest_window);
#else
xev.xclient.window = GDK_WINDOW_XWINDOW (context->dest_window);
#endif
xev.xclient.data.l[0] = GDK_WINDOW_XWINDOW (context->source_window);
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = (x_root << 16) | y_root;
@@ -2859,6 +2851,12 @@ gdk_drag_find_window (GdkDragContext *context,
/* Check if new destination accepts drags, and which protocol */
/* There is some ugliness here. We actually need to pass
* _three_ pieces of information to drag_motion - dest_window,
* protocol, and the XID of the unproxied window. The first
* two are passed explicitely, the third implicitly through
* protocol->dest_xid.
*/
if ((recipient = gdk_drag_get_protocol (dest, protocol)))
{
*dest_window = gdk_window_lookup (recipient);
@@ -2917,6 +2915,7 @@ gdk_drag_motion (GdkDragContext *context,
if (dest_window)
{
context->dest_window = dest_window;
private->drop_xid = private->dest_xid;
gdk_window_ref (context->dest_window);
context->protocol = protocol;
@@ -2941,6 +2940,7 @@ gdk_drag_motion (GdkDragContext *context,
else
{
context->dest_window = NULL;
private->drop_xid = None;
context->action = 0;
}
+66 -43
View File
@@ -27,7 +27,6 @@
#include "gdk.h"
#include "gdkx.h"
#include "gdkprivate.h"
#include "gdkinput.h"
#include "gdkkeysyms.h"
#if HAVE_CONFIG_H
@@ -37,6 +36,7 @@
# endif
#endif
#include "gdkinput.h"
typedef struct _GdkIOClosure GdkIOClosure;
typedef struct _GdkEventPrivate GdkEventPrivate;
@@ -88,9 +88,11 @@ static GdkEvent* gdk_event_unqueue (void);
static gboolean gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout);
gint *timeout,
gpointer user_data);
static gboolean gdk_event_check (gpointer source_data,
GTimeVal *current_time);
GTimeVal *current_time,
gpointer user_data);
static gboolean gdk_event_dispatch (gpointer source_data,
GTimeVal *current_time,
gpointer user_data);
@@ -449,6 +451,8 @@ gdk_compress_exposures (XEvent *xevent,
&tmp_event,
expose_predicate,
(XPointer)&info);
event.any.window = window;
/* We apply filters here, and if it was filtered, completely
* ignore the return
@@ -849,6 +853,12 @@ gdk_io_destroy (gpointer data)
g_free (closure);
}
/* What do we do with G_IO_NVAL?
*/
#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
#define EXCEPTION_CONDITION (G_IO_PRI)
static gboolean
gdk_io_invoke (GIOChannel *source,
GIOCondition condition,
@@ -857,11 +867,11 @@ gdk_io_invoke (GIOChannel *source,
GdkIOClosure *closure = data;
GdkInputCondition gdk_cond = 0;
if (condition & (G_IO_IN | G_IO_PRI))
if (condition & READ_CONDITION)
gdk_cond |= GDK_INPUT_READ;
if (condition & G_IO_OUT)
if (condition & WRITE_CONDITION)
gdk_cond |= GDK_INPUT_WRITE;
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
if (condition & EXCEPTION_CONDITION)
gdk_cond |= GDK_INPUT_EXCEPTION;
if (closure->condition & gdk_cond)
@@ -888,11 +898,11 @@ gdk_input_add_full (gint source,
closure->data = data;
if (condition & GDK_INPUT_READ)
cond |= (G_IO_IN | G_IO_PRI);
cond |= READ_CONDITION;
if (condition & GDK_INPUT_WRITE)
cond |= G_IO_OUT;
cond |= WRITE_CONDITION;
if (condition & GDK_INPUT_EXCEPTION)
cond |= G_IO_ERR|G_IO_HUP|G_IO_NVAL;
cond |= EXCEPTION_CONDITION;
channel = g_io_channel_unix_new (source);
result = g_io_add_watch_full (channel, G_PRIORITY_DEFAULT, cond,
@@ -923,7 +933,6 @@ gdk_event_apply_filters (XEvent *xevent,
GdkEvent *event,
GList *filters)
{
GdkEventFilter *filter;
GList *tmp_list;
GdkFilterReturn result;
@@ -931,13 +940,12 @@ gdk_event_apply_filters (XEvent *xevent,
while (tmp_list)
{
filter = (GdkEventFilter*) tmp_list->data;
result = (*filter->function) (xevent, event, filter->data);
if (result != GDK_FILTER_CONTINUE)
return result;
GdkEventFilter *filter = (GdkEventFilter*) tmp_list->data;
tmp_list = tmp_list->next;
result = filter->function (xevent, event, filter->data);
if (result != GDK_FILTER_CONTINUE)
return result;
}
return GDK_FILTER_CONTINUE;
@@ -1057,9 +1065,6 @@ gdk_event_translate (GdkEvent *event,
}
#endif
if (window == NULL)
g_message ("Got event for unknown window: %#lx\n", xevent->xany.window);
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
* the conversion is fairly straightforward. We also
@@ -1661,9 +1666,10 @@ gdk_event_translate (GdkEvent *event,
case ConfigureNotify:
/* Print debugging info.
*/
while ((XPending (gdk_display) > 0) &&
XCheckTypedWindowEvent(gdk_display, xevent->xany.window,
ConfigureNotify, xevent))
while (0 && /* don't reorder ConfigureNotify events at all */
XPending (gdk_display) > 0 &&
XCheckTypedWindowEvent (gdk_display, xevent->xany.window,
ConfigureNotify, xevent))
{
GdkFilterReturn result;
@@ -1690,7 +1696,7 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS,
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d",
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s",
xevent->xconfigure.window,
xevent->xconfigure.x,
xevent->xconfigure.y,
@@ -1698,14 +1704,19 @@ gdk_event_translate (GdkEvent *event,
xevent->xconfigure.height,
xevent->xconfigure.border_width,
xevent->xconfigure.above,
xevent->xconfigure.override_redirect));
if (!window_private->destroyed &&
xevent->xconfigure.override_redirect,
!window
? " (discarding)"
: window_private->window_type == GDK_WINDOW_CHILD
? " (discarding child)"
: ""));
if (window &&
!window_private->destroyed &&
(window_private->extension_events != 0) &&
gdk_input_vtable.configure_event)
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
if (window_private->window_type == GDK_WINDOW_CHILD)
if (!window || window_private->window_type == GDK_WINDOW_CHILD)
return_val = FALSE;
else
{
@@ -1751,8 +1762,14 @@ gdk_event_translate (GdkEvent *event,
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("property notify:\twindow: %ld",
xevent->xproperty.window));
gchar *atom = gdk_atom_name (xevent->xproperty.atom);
g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s",
xevent->xproperty.window,
xevent->xproperty.atom,
atom ? "\"" : "",
atom ? atom : "unknown",
atom ? "\"" : "");
);
event->property.type = GDK_PROPERTY_NOTIFY;
event->property.window = window;
@@ -2017,7 +2034,8 @@ gdk_events_queue (void)
static gboolean
gdk_event_prepare (gpointer source_data,
GTimeVal *current_time,
gint *timeout)
gint *timeout,
gpointer user_data)
{
gboolean retval;
@@ -2034,7 +2052,8 @@ gdk_event_prepare (gpointer source_data,
static gboolean
gdk_event_check (gpointer source_data,
GTimeVal *current_time)
GTimeVal *current_time,
gpointer user_data)
{
gboolean retval;
@@ -2133,29 +2152,29 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
guint level)
{
static GdkAtom wm_state_atom = GDK_NONE;
Atom type = None;
int format;
unsigned long nitems, after;
unsigned char *data;
Window *ret_children, ret_root, ret_parent;
unsigned int ret_nchildren;
int i;
gint old_warnings = gdk_error_warnings;
gboolean send = FALSE;
gboolean found = FALSE;
int i;
if (!wm_state_atom)
wm_state_atom = gdk_atom_intern ("WM_STATE", FALSE);
gdk_error_warnings = FALSE;
gdk_error_code = 0;
XGetWindowProperty (gdk_display, xid, wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (gdk_error_code)
{
gdk_error_code = 0;
gdk_error_warnings = old_warnings;
return FALSE;
}
@@ -2167,18 +2186,20 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
else
{
/* OK, we're all set, now let's find some windows to send this to */
if (XQueryTree(gdk_display, xid, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True)
return FALSE;
if (gdk_error_code)
return FALSE;
if (XQueryTree (gdk_display, xid, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True ||
gdk_error_code)
{
gdk_error_warnings = old_warnings;
return FALSE;
}
for(i = 0; i < ret_nchildren; i++)
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
if (gdk_event_send_client_message_to_all_recurse (xev, ret_children[i], level + 1))
found = TRUE;
XFree(ret_children);
XFree (ret_children);
}
if (send || (!found && (level == 1)))
@@ -2187,6 +2208,8 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
gdk_send_xevent (xid, False, NoEventMask, xev);
}
gdk_error_warnings = old_warnings;
return (send || found);
}
+40 -17
View File
@@ -34,27 +34,37 @@ gdk_font_load (const gchar *font_name)
{
GdkFont *font;
GdkFontPrivate *private;
XFontStruct *xfont;
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
g_return_val_if_fail (font_name != NULL, NULL);
private->xdisplay = gdk_display;
private->xfont = XLoadQueryFont (private->xdisplay, font_name);
private->ref_count = 1;
xfont = XLoadQueryFont (gdk_display, font_name);
if (xfont == NULL)
return NULL;
if (!private->xfont)
font = gdk_font_lookup (xfont->fid);
if (font != NULL)
{
g_free (font);
return NULL;
private = (GdkFontPrivate *) font;
if (xfont != private->xfont)
XFreeFont (gdk_display, xfont);
gdk_font_ref (font);
}
else
{
font->type = GDK_FONT_FONT;
font->ascent = ((XFontStruct *) private->xfont)->ascent;
font->descent = ((XFontStruct *) private->xfont)->descent;
}
private = g_new (GdkFontPrivate, 1);
private->xdisplay = gdk_display;
private->xfont = xfont;
private->ref_count = 1;
gdk_xid_table_insert (&((XFontStruct *) private->xfont)->fid, font);
font = (GdkFont*) private;
font->type = GDK_FONT_FONT;
font->ascent = xfont->ascent;
font->descent = xfont->descent;
gdk_xid_table_insert (&xfont->fid, font);
}
return font;
}
@@ -131,10 +141,10 @@ void
gdk_font_unref (GdkFont *font)
{
GdkFontPrivate *private;
private = (GdkFontPrivate*) font;
g_return_if_fail (font != NULL);
private = (GdkFontPrivate*) font;
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
@@ -568,7 +578,20 @@ gdk_text_extents_wc (GdkFont *font,
}
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XwcTextExtents (fontset, text, text_length, &ink, &logical);
if (sizeof(GdkWChar) == sizeof(wchar_t))
XwcTextExtents (fontset, (wchar_t *)text, text_length, &ink, &logical);
else
{
wchar_t *text_wchar;
gint i;
text_wchar = g_new (wchar_t, text_length);
for (i = 0; i < text_length; i++)
text_wchar[i] = text[i];
XwcTextExtents (fontset, text_wchar, text_length, &ink, &logical);
g_free (text_wchar);
}
if (lbearing)
*lbearing = ink.x;
if (rbearing)
@@ -642,7 +665,7 @@ gdk_text_measure (GdkFont *font,
case GDK_FONT_FONTSET:
fontset = (XFontSet) private->xfont;
XmbTextExtents (fontset, text, text_length, &ink, &log);
width = log.width;
width = ink.x + ink.width;
break;
default:
width = 0;
+1 -1
View File
@@ -57,7 +57,7 @@ GdkDndGlobals gdk_dnd = {None,None,None,
{0,0}, {0,0},
{0,0,0,0}, NULL, None, 0};
gchar *gdk_progclass = NULL;
gint gdk_error_code;
gint gdk_error_code = 0;
gint gdk_error_warnings = TRUE;
gint gdk_null_window_warnings = TRUE;
GList *gdk_default_filters = NULL;
+19 -11
View File
@@ -386,7 +386,7 @@ gdk_im_real_open (void)
destroy_cb.callback = gdk_im_destroy_cb;
destroy_cb.client_data = NULL;
if (NULL != XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
if (NULL != (void *) XSetIMValues (xim_im, XNDestroyCallback, &destroy_cb, NULL))
GDK_NOTE (XIM, g_warning ("Could not set destroy callback to IM. Be careful to not destroy your input method."));
#endif
@@ -469,7 +469,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_PREEDIT_AREA_REQ;
preedit_area.x = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.y;
preedit_area.width = attr->preedit_area.width;
preedit_area.height = attr->preedit_area.height;
@@ -484,7 +484,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_PREEDIT_POSITION_REQ;
preedit_area.x = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.x;
preedit_area.y = attr->preedit_area.y;
preedit_area.width = attr->preedit_area.width;
preedit_area.height = attr->preedit_area.height;
@@ -506,7 +506,7 @@ gdk_ic_real_new (GdkIC *ic)
mask |= GDK_IC_STATUS_AREA_REQ;
status_area.x = attr->status_area.x;
status_area.y = attr->status_area.x;
status_area.y = attr->status_area.y;
status_area.width = attr->status_area.width;
status_area.height = attr->status_area.height;
@@ -518,6 +518,12 @@ gdk_ic_real_new (GdkIC *ic)
break;
}
/* We have to ensure that the client window is actually created on
* the X server, or XCreateIC fails because the XIM server can't get
* information about the client window.
*/
gdk_flush();
if (preedit_attr != NULL && status_attr != NULL)
private->xic = XCreateIC (xim_im,
XNInputStyle,
@@ -871,7 +877,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNFontSet;
arg->value = (gpointer) GDK_FONT_XFONT(attr->status_fontset);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_FONTSET;
}
@@ -887,7 +893,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNArea;
arg->value = (gpointer) &rect;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_AREA;
}
@@ -903,7 +909,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNArea;
arg->value = (gpointer) &rect;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_AREA_NEEDED;
else
private->mask &= ~GDK_IC_STATUS_AREA_NEEDED;
@@ -914,7 +920,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNForeground;
arg->value = (gpointer) attr->status_foreground.pixel;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_FOREGROUND;
}
@@ -923,7 +929,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNBackground;
arg->value = (gpointer) attr->status_background.pixel;
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_BACKGROUND;
}
@@ -932,7 +938,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNBackgroundPixmap;
arg->value = (gpointer) GDK_WINDOW_XWINDOW(attr->status_pixmap);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_PIXMAP;
}
@@ -941,7 +947,7 @@ gdk_ic_real_set_attr (GdkIC *ic,
arg->name = XNColormap;
arg->value = (gpointer) GDK_COLORMAP_XCOLORMAP(attr->status_colormap);
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
if (XSetICValues (xic, XNStatusAttributes, arg, NULL))
error |= GDK_IC_STATUS_COLORMAP;
}
@@ -1565,8 +1571,10 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
!= Success)
{
/* InvalidChar */
XFree(tpr.value);
return -1;
}
XFree(tpr.value);
if (num_wstrs == 0)
return 0;
wstr_src = wstrs[0];
+2 -1
View File
@@ -258,7 +258,7 @@ gdk_image_new (GdkImageType type,
XSync (private->xdisplay, False);
gdk_error_warnings = 1;
if (gdk_error_code == -1)
if (gdk_error_code)
{
/* this is the common failure case so omit warning */
XDestroyImage (private->ximage);
@@ -269,6 +269,7 @@ gdk_image_new (GdkImageType type,
g_free (image);
gdk_use_xshm = False;
return NULL;
}
+56 -18
View File
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
@@ -48,6 +49,7 @@
#include "gdkinput.h"
#include "gdkx.h"
#include "gdki18n.h"
#include "gdkkeysyms.h"
#ifndef X_GETTIMEOFDAY
#define X_GETTIMEOFDAY(tv) gettimeofday (tv, NULL)
@@ -333,6 +335,7 @@ gdk_init_check (int *argc,
gdk_im_set_best_style (GDK_IM_PREEDIT_POSITION);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
(*argv)[i] = NULL;
}
}
else if (strcmp ("--xim-status", (*argv)[i]) == 0)
@@ -348,6 +351,7 @@ gdk_init_check (int *argc,
gdk_im_set_best_style (GDK_IM_STATUS_AREA);
else if (strcmp ("callbacks", (*argv)[i]) == 0)
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
(*argv)[i] = NULL;
}
}
#endif
@@ -406,9 +410,9 @@ gdk_init_check (int *argc,
g_free(argv_orig[i]);
g_free(argv_orig);
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", True);
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", True);
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", True);
gdk_wm_delete_window = XInternAtom (gdk_display, "WM_DELETE_WINDOW", False);
gdk_wm_take_focus = XInternAtom (gdk_display, "WM_TAKE_FOCUS", False);
gdk_wm_protocols = XInternAtom (gdk_display, "WM_PROTOCOLS", False);
gdk_wm_window_protocols[0] = gdk_wm_delete_window;
gdk_wm_window_protocols[1] = gdk_wm_take_focus;
gdk_selection_property = XInternAtom (gdk_display, "GDK_SELECTION", False);
@@ -1032,20 +1036,35 @@ static int
gdk_x_error (Display *display,
XErrorEvent *error)
{
char buf[64];
if (gdk_error_warnings)
if (error->error_code)
{
XGetErrorText (display, error->error_code, buf, 63);
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
if (gdk_error_warnings)
{
char buf[64];
XGetErrorText (display, error->error_code, buf, 63);
#ifdef G_ENABLE_DEBUG
g_error ("%s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
#else /* !G_ENABLE_DEBUG */
fprintf (stderr, "Gdk-ERROR **: %s\n serial %ld error_code %d request_code %d minor_code %d\n",
buf,
error->serial,
error->error_code,
error->request_code,
error->minor_code);
exit(1);
#endif /* G_ENABLE_DEBUG */
}
gdk_error_code = error->error_code;
}
gdk_error_code = -1;
return 0;
}
@@ -1071,8 +1090,27 @@ gdk_x_error (Display *display,
static int
gdk_x_io_error (Display *display)
{
g_error ("an x io error occurred");
return 0;
/* This is basically modelled after the code in XLib. We need
* an explicit error handler here, so we can disable our atexit()
* which would otherwise cause a nice segfault.
* We fprintf(stderr, instead of g_warning() because g_warning()
* could possibly be redirected to a dialog
*/
if (errno == EPIPE)
{
fprintf (stderr, "Gdk-ERROR **: X connection to %s broken (explicit kill or server shutdown).\n", gdk_display ? DisplayString (gdk_display) : gdk_get_display());
}
else
{
fprintf (stderr, "Gdk-ERROR **: Fatal IO error %d (%s) on X server %s.\n",
errno, g_strerror (errno),
gdk_display ? DisplayString (gdk_display) : gdk_get_display());
}
/* Disable the atexit shutdown for GDK */
gdk_initialized = 0;
exit(1);
}
gchar *
@@ -1104,7 +1142,7 @@ gdk_error_trap_push (void)
}
else
{
node = g_slist_alloc();
node = g_slist_alloc ();
node->data = g_new (GdkErrorTrap, 1);
}
@@ -1166,7 +1204,7 @@ gdk_send_xevent (Window window, gboolean propagate, glong event_mask,
XSync (gdk_display, False);
gdk_error_warnings = old_warnings;
return result && (gdk_error_code != -1);
return result && !gdk_error_code;
}
#ifndef HAVE_XCONVERTCASE
+3 -2
View File
@@ -518,7 +518,7 @@ _gdk_pixmap_create_from_xpm (GdkWindow *window,
color_name = gdk_pixmap_extract_color (buffer);
if (color_name == NULL ||
if (color_name == NULL || g_strcasecmp (color_name, "None") == 0 ||
gdk_color_parse (color_name, &color->color) == FALSE)
{
color->color = *transparent_color;
@@ -817,7 +817,8 @@ void
gdk_pixmap_unref (GdkPixmap *pixmap)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)pixmap;
g_return_if_fail(pixmap != NULL);
g_return_if_fail (pixmap != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
+8 -7
View File
@@ -45,15 +45,16 @@ gdk_atom_intern (const gchar *atom_name,
{
retval = XInternAtom (gdk_display, atom_name, only_if_exists);
g_hash_table_insert (atom_hash,
g_strdup (atom_name),
GUINT_TO_POINTER (retval));
if (retval != None || !only_if_exists)
g_hash_table_insert (atom_hash,
g_strdup (atom_name),
GUINT_TO_POINTER (retval));
}
return retval;
}
gchar *
gchar*
gdk_atom_name (GdkAtom atom)
{
gchar *t;
@@ -69,7 +70,7 @@ gdk_atom_name (GdkAtom atom)
t = XGetAtomName (gdk_display, atom);
gdk_error_warnings = old_error_warnings;
if (gdk_error_code == -1)
if (gdk_error_code)
{
if (t)
XFree (t);
@@ -162,10 +163,10 @@ gdk_property_get (GdkWindow *window,
ret_length = ret_nitems;
break;
case 16:
ret_length = 2 * ret_nitems;
ret_length = sizeof(short) * ret_nitems;
break;
case 32:
ret_length = 4 * ret_nitems;
ret_length = sizeof(long) * ret_nitems;
break;
default:
g_warning ("unknown property return format: %d", ret_format);
+4 -4
View File
@@ -105,7 +105,7 @@ gdk_selection_property_get (GdkWindow *requestor,
gulong length;
GdkAtom prop_type;
gint prop_format;
guchar *t;
guchar *t = NULL;
g_return_val_if_fail (requestor != NULL, 0);
@@ -133,11 +133,11 @@ gdk_selection_property_get (GdkWindow *requestor,
*data = NULL;
return 0;
}
if (t)
{
t = NULL;
XFree (t);
t = NULL;
}
/* Add on an extra byte to handle null termination. X guarantees
@@ -188,7 +188,7 @@ gdk_selection_send_notify (guint32 requestor,
xevent.property = property;
xevent.time = time;
XSendEvent (gdk_display, requestor, False, NoEventMask, (XEvent*) &xevent);
gdk_send_xevent (requestor, False, NoEventMask, (XEvent*) &xevent);
}
gint
+22 -21
View File
@@ -34,17 +34,9 @@
#include "gdkprivate.h"
#include "MwmUtil.h"
#if HAVE_CONFIG_H
# include <config.h>
# if STDC_HEADERS
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# endif
#else
# include <stdlib.h>
# include <stdio.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_SHAPE_EXT
@@ -732,6 +724,7 @@ gdk_window_unref (GdkWindow *window)
{
GdkWindowPrivate *private = (GdkWindowPrivate *)window;
g_return_if_fail (window != NULL);
g_return_if_fail (private->ref_count > 0);
private->ref_count -= 1;
if (private->ref_count == 0)
@@ -1110,7 +1103,15 @@ gdk_window_set_geometry_hints (GdkWindow *window,
size_hints.flags = 0;
if (geom_mask & GDK_HINT_POS)
size_hints.flags |= PPosition;
{
size_hints.flags |= PPosition;
/* We need to initialize the following obsolete fields because KWM
* apparently uses these fields if they are non-zero.
* #@#!#!$!.
*/
size_hints.x = 0;
size_hints.y = 0;
}
if (geom_mask & GDK_HINT_MIN_SIZE)
{
@@ -1145,23 +1146,23 @@ gdk_window_set_geometry_hints (GdkWindow *window,
size_hints.flags |= PAspect;
if (geometry->min_aspect <= 1)
{
size_hints.min_aspect.x = G_MAXINT * geometry->min_aspect;
size_hints.min_aspect.y = G_MAXINT;
size_hints.min_aspect.x = 65536 * geometry->min_aspect;
size_hints.min_aspect.y = 65536;
}
else
{
size_hints.min_aspect.x = G_MAXINT;
size_hints.min_aspect.y = G_MAXINT / geometry->min_aspect;;
size_hints.min_aspect.x = 65536;
size_hints.min_aspect.y = 65536 / geometry->min_aspect;;
}
if (geometry->max_aspect <= 1)
{
size_hints.max_aspect.x = G_MAXINT * geometry->max_aspect;
size_hints.max_aspect.y = G_MAXINT;
size_hints.max_aspect.x = 65536 * geometry->max_aspect;
size_hints.max_aspect.y = 65536;
}
else
{
size_hints.max_aspect.x = G_MAXINT;
size_hints.max_aspect.y = G_MAXINT / geometry->max_aspect;;
size_hints.max_aspect.x = 65536;
size_hints.max_aspect.y = 65536 / geometry->max_aspect;;
}
}
@@ -1988,7 +1989,7 @@ gdk_window_remove_filter (GdkWindow *window,
if (private)
private->filters = g_list_remove_link (private->filters, node);
else
gdk_default_filters = g_list_remove_link (gdk_default_filters, tmp_list);
gdk_default_filters = g_list_remove_link (gdk_default_filters, node);
g_list_free_1 (node);
g_free (filter);
+6 -5
View File
@@ -1,6 +1,7 @@
# Note that this is NOT a relocatable package
%define ver @VERSION@
%define rel SNAP
%define RELEASE 1
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define prefix /usr
Summary: The Gimp Toolkit
@@ -148,10 +149,10 @@ fi
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{prefix}/lib/libgtk-1.1.so.*
%{prefix}/lib/libgdk-1.1.so.*
{prefix}/share/themes/Default
+%{prefix}/share/locale/*/*/*
%{prefix}/lib/libgtk-1.2.so.*
%{prefix}/lib/libgdk-1.2.so.*
%{prefix}/share/themes/Default
%{prefix}/share/locale/*/*/*
%files devel
+3 -4
View File
@@ -22,7 +22,6 @@ gtktypebuiltins_vars.c
gtktypebuiltins_evals.c
gtk.defs
testdnd
stamp-d
stamp-t
stamp-m
s-*
stamp-gtktypebuiltins.h
stamp-gtkmarshal.h
stamp-gtk.defs
+504
View File
@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+302 -267
View File
@@ -1,124 +1,45 @@
### Process this file with automake to produce Makefile.in
## Makefile.am for gtk+/gtk
gtkincludedir = $(includedir)/gtk
INCLUDES = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gtk\" \
-DGTK_DISABLE_COMPAT_H \
-DGTK_EXE_PREFIX=\"$(exec_prefix)\" \
-DGTK_DATA_PREFIX=\"$(prefix)\" \
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
-DGTK_LOCALEDIR=\"$(gtklocaledir)\" \
-I$(top_srcdir) \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@ \
@STRIP_END@
#
# libraries to compile and install
#
lib_LTLIBRARIES = libgtk.la
static_SOURCES = \
gtkaccelgroup.c \
gtkaccellabel.c \
gtkadjustment.c \
gtkalignment.c \
gtkarg.c \
gtkarrow.c \
gtkaspectframe.c \
gtkbin.c \
gtkbindings.c \
gtkbbox.c \
gtkbox.c \
gtkbutton.c \
gtkcalendar.c \
gtkcheckbutton.c \
gtkcheckmenuitem.c \
gtkclist.c \
gtkcolorsel.c \
gtkcombo.c \
gtkcontainer.c \
gtkctree.c \
gtkcurve.c \
gtkdata.c \
gtkdialog.c \
gtkdnd.c \
gtkdrawingarea.c \
gtkeditable.c \
gtkentry.c \
gtkeventbox.c \
gtkfilesel.c \
gtkfixed.c \
gtkfontsel.c \
gtkframe.c \
gtkgamma.c \
gtkgc.c \
gtkhandlebox.c \
gtkhbbox.c \
gtkhbox.c \
gtkhpaned.c \
gtkhruler.c \
gtkhscale.c \
gtkhscrollbar.c \
gtkhseparator.c \
gtkimage.c \
gtkinputdialog.c \
gtkintl.h \
gtkinvisible.c \
gtkitem.c \
gtkitemfactory.c \
gtklabel.c \
gtklayout.c \
gtklist.c \
gtklistitem.c \
gtkmain.c \
gtkmenu.c \
gtkmenubar.c \
gtkmenufactory.c \
gtkmenuitem.c \
gtkmenushell.c \
gtkmisc.c \
gtknotebook.c \
gtkobject.c \
gtkoptionmenu.c \
gtkpacker.c \
gtkpaned.c \
gtkpixmap.c \
gtkplug.c \
gtkpreview.c \
gtkprogress.c \
gtkprogressbar.c \
gtkradiobutton.c \
gtkradiomenuitem.c \
gtkrange.c \
gtkrc.c \
gtkruler.c \
gtkscale.c \
gtkscrollbar.c \
gtkscrolledwindow.c \
gtkselection.c \
gtkseparator.c \
gtksignal.c \
gtksocket.c \
gtkspinbutton.c \
gtkstyle.c \
gtkstatusbar.c \
gtktable.c \
gtktearoffmenuitem.c \
gtktext.c \
gtkthemes.c \
gtktipsquery.c \
gtktogglebutton.c \
gtktoolbar.c \
gtktooltips.c \
gtktree.c \
gtktreeitem.c \
gtktypeutils.c \
gtkvbbox.c \
gtkvbox.c \
gtkviewport.c \
gtkvpaned.c \
gtkvruler.c \
gtkvscale.c \
gtkvscrollbar.c \
gtkvseparator.c \
gtkwidget.c \
gtkwindow.c \
fnmatch.c \
fnmatch.h
# libtool stuff: set version and export symbols for resolving
libgtkincludedir = $(includedir)/gtk
libgtk_la_LDFLAGS = @STRIP_BEGIN@ \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE) \
-export-dynamic \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
-lm \
@STRIP_END@
# $(top_builddir)/gdk/libgdk.la
libgtk_la_SOURCES = \
$(static_SOURCES) \
gtkmarshal.c
# Source headers which are non-autogenerated headers
source_headers = \
#
# setup source file variables
#
# GTK+ header files for public installation (non-generated)
gtk_public_h_sources = @STRIP_BEGIN@ \
gtk.h \
gtkaccelgroup.h \
gtkaccellabel.h \
@@ -151,6 +72,7 @@ source_headers = \
gtkentry.h \
gtkenums.h \
gtkeventbox.h \
gtkfeatures.h \
gtkfilesel.h \
gtkfixed.h \
gtkfontsel.h \
@@ -227,185 +149,272 @@ source_headers = \
gtkvscrollbar.h \
gtkvseparator.h \
gtkwidget.h \
gtkwindow.h
gtkinclude_HEADERS = \
$(source_headers) \
gtkfeatures.h \
gtkwindow.h \
@STRIP_END@
# GTK+ header files that don't get installed
gtk_private_h_sources = @STRIP_BEGIN@ \
@STRIP_END@
# GTK+ C sources to build the library from
gtk_c_sources = @STRIP_BEGIN@ \
gtkaccelgroup.c \
gtkaccellabel.c \
gtkadjustment.c \
gtkalignment.c \
gtkarg.c \
gtkarrow.c \
gtkaspectframe.c \
gtkbin.c \
gtkbindings.c \
gtkbbox.c \
gtkbox.c \
gtkbutton.c \
gtkcalendar.c \
gtkcheckbutton.c \
gtkcheckmenuitem.c \
gtkclist.c \
gtkcolorsel.c \
gtkcombo.c \
gtkcontainer.c \
gtkctree.c \
gtkcurve.c \
gtkdata.c \
gtkdialog.c \
gtkdnd.c \
gtkdrawingarea.c \
gtkeditable.c \
gtkentry.c \
gtkeventbox.c \
gtkfilesel.c \
gtkfixed.c \
gtkfontsel.c \
gtkframe.c \
gtkgamma.c \
gtkgc.c \
gtkhandlebox.c \
gtkhbbox.c \
gtkhbox.c \
gtkhpaned.c \
gtkhruler.c \
gtkhscale.c \
gtkhscrollbar.c \
gtkhseparator.c \
gtkimage.c \
gtkinputdialog.c \
gtkintl.h \
gtkinvisible.c \
gtkitem.c \
gtkitemfactory.c \
gtklabel.c \
gtklayout.c \
gtklist.c \
gtklistitem.c \
gtkmain.c \
gtkmarshal.c \
gtkmenu.c \
gtkmenubar.c \
gtkmenufactory.c \
gtkmenuitem.c \
gtkmenushell.c \
gtkmisc.c \
gtknotebook.c \
gtkobject.c \
gtkoptionmenu.c \
gtkpacker.c \
gtkpaned.c \
gtkpixmap.c \
gtkplug.c \
gtkpreview.c \
gtkprogress.c \
gtkprogressbar.c \
gtkradiobutton.c \
gtkradiomenuitem.c \
gtkrange.c \
gtkrc.c \
gtkruler.c \
gtkscale.c \
gtkscrollbar.c \
gtkscrolledwindow.c \
gtkselection.c \
gtkseparator.c \
gtksignal.c \
gtksocket.c \
gtkspinbutton.c \
gtkstyle.c \
gtkstatusbar.c \
gtktable.c \
gtktearoffmenuitem.c \
gtktext.c \
gtkthemes.c \
gtktipsquery.c \
gtktogglebutton.c \
gtktoolbar.c \
gtktooltips.c \
gtktree.c \
gtktreeitem.c \
gtktypeutils.c \
gtkvbbox.c \
gtkvbox.c \
gtkviewport.c \
gtkvpaned.c \
gtkvruler.c \
gtkvscale.c \
gtkvscrollbar.c \
gtkvseparator.c \
gtkwidget.c \
gtkwindow.c \
fnmatch.c \
fnmatch.h \
@STRIP_END@
# we use our own built_sources variable rules to avoid automake's
# BUILT_SOURCES oddities
# we generate frequently rebuild files piggyback on a stamp file, so sources
# depending on them only get rebuild when the built source actually changed
# content
#
# built sources that don't get installed
gtk_built_sources = @STRIP_BEGIN@ \
stamp-gtktypebuiltins.h \
stamp-gtkmarshal.h \
gtktypebuiltins_vars.c \
gtktypebuiltins_ids.c \
gtktypebuiltins_evals.c \
gtkmarshal.c \
stamp-gtk.defs \
gtk.defs \
@STRIP_END@
# built sources that get installed with the header files
gtk_built_public_sources = @STRIP_BEGIN@ \
gtkmarshal.h \
gtktypebuiltins.h
# note gtk.defs, gtktypebuiltin* and gtkmarshal.[ch] aren't here, but
# their stamps are. Another trick is to use the temporary output files as
# the stamp files.
BUILT_SOURCES = \
s-gd s-gtb s-gtbv s-gtbi s-gtbe \
stamp-m
# cause the built sources to be rebuild when possible, even with --include-deps
$(static_sources): $(BUILT_SOURCES)
# More headers to use when autogenerating.
gdk_headers = \
../gdk/gdktypes.h \
../gdk/gdkrgb.h
# generate gtk.defs file from gtk-boxed.defs and *.h
gtk.defs: @REBUILD@ s-gd
@:
s-gd: @REBUILD@ makeenums.pl gtk-boxed.defs $(source_headers) $(gdk_headers)
cd $(srcdir) \
&& $(PERL) makeenums.pl defs $(source_headers) $(gdk_headers) > s-gd \
&& cat gtk-boxed.defs >> s-gd \
&& (cmp -s s-gd gtk.defs || cp s-gd gtk.defs)
# generate type identifier header (GTK_TYPE_WIDGET_FLAGS)
gtktypebuiltins.h: @REBUILD@ s-gtb
@:
s-gtb: @REBUILD@ s-gd maketypes.awk
cd $(srcdir) \
&& $(AWK) -f maketypes.awk gtk.defs macros > s-gtb \
&& (cmp -s s-gtb gtktypebuiltins.h || cp s-gtb gtktypebuiltins.h)
# generate type identifier variables (GTK_TYPE_WIDGET_FLAGS)
gtktypebuiltins_vars.c: @REBUILD@ s-gtbv
@:
s-gtbv: @REBUILD@ s-gd maketypes.awk
cd $(srcdir) \
&& $(AWK) -f maketypes.awk gtk.defs variables > s-gtbv \
&& (cmp -s s-gtbv gtktypebuiltins_vars.c || cp s-gtbv gtktypebuiltins_vars.c)
# generate type entries for type-id registration
gtktypebuiltins_ids.c: @REBUILD@ s-gtbi
@:
s-gtbi: @REBUILD@ s-gd maketypes.awk
cd $(srcdir) \
&& $(AWK) -f maketypes.awk gtk.defs entries > s-gtbi \
&& (cmp -s s-gtbi gtktypebuiltins_ids.c || cp s-gtbi gtktypebuiltins_ids.c)
# generate enum value arrays
gtktypebuiltins_evals.c: @REBUILD@ s-gtbe
@:
s-gtbe: @REBUILD@ makeenums.pl s-gd
cd $(srcdir) \
&& $(PERL) makeenums.pl arrays $(source_headers) $(gdk_headers) > \
s-gtbe \
&& (cmp -s s-gtbe gtktypebuiltins_evals.c || cp s-gtbe gtktypebuiltins_evals.c)
$(srcdir)/gtkmarshal.c $(srcdir)/gtkmarshal.h: @REBUILD@ stamp-m
@:
stamp-m: @REBUILD@ $(srcdir)/gtkmarshal.list $(srcdir)/genmarshal.pl
(srcdir=$(srcdir) INDENT=$(INDENT) $(PERL) $(srcdir)/genmarshal.pl \
&& (cmp -s s-gmc gtkmarshal.c || mv s-gmc gtkmarshal.c) \
&& rm -f s-gmc \
&& (cmp -s s-gmh gtkmarshal.h || mv s-gmh gtkmarshal.h) \
&& rm -f s-gmh) \
&& echo timestamp > stamp-m
libgtk_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE) \
@GLIB_DEPLIBS@ \
@x_ldflags@ \
@x_libs@ \
-lm
# $(top_builddir)/gdk/libgdk.la
gtkconfdir = $(sysconfdir)/gtk
gtkconf_DATA = gtkrc gtkrc.ja gtkrc.ko gtkrc.ru
gtkrc:
:
# We create a dummy theme for the default GTK+ theme
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk
echo "# Empty gtkrc for default theme" > \
$(DESTDIR)$(datadir)/themes/Default/gtk/gtkrc
uninstall-local:
rm -f $(DESTDIR)$(datadir)/themes/Default/gtkrc
EXTRA_DIST = \
line-arrow.xbm \
line-wrap.xbm \
testgtk.1 \
testgtkrc \
testgtkrc2 \
gtktypebuiltins.h \
@STRIP_END@
# non-header sources (headers should be specified in the above variables)
# that don't serve as direct make target sources, i.e. they don't have
# their own .lo rules and don't get publically installed
gtk_extra_sources = @STRIP_BEGIN@ \
gtkfeatures.h.in \
makeenums.pl \
makeenums.awk \
maketypes.awk \
makeenums.h \
gtkargcollector.c \
gtktypebuiltins_vars.c \
gtktypebuiltins_ids.c \
gtktypebuiltins_evals.c \
gtk-boxed.defs \
gtk.defs \
genmarshal.pl \
gtkmarshal.list \
check-y.xpm \
check-n.xpm \
test.xpm \
marble.xpm \
3DRings.xpm \
FilesQueue.xpm \
Modeller.xpm \
tree_plus.xpm \
tree_minus.xpm \
tree_plus.xbm \
tree_minus.xbm \
circles.xbm \
gtkrc.ja \
gtkrc.ko \
gtkrc.ru
@STRIP_END@
# Extra headers that are used for enum type array/id generation
gdk_headers = @STRIP_BEGIN@ \
../gdk/gdktypes.h \
../gdk/gdkrgb.h \
@STRIP_END@
INCLUDES = \
-DGTK_DISABLE_COMPAT_H \
-DG_LOG_DOMAIN=\"Gtk\" \
-DGTK_EXE_PREFIX=\"$(exec_prefix)\" \
-DGTK_DATA_PREFIX=\"$(prefix)\" \
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
-DGTK_LOCALEDIR=\"$(gtklocaledir)\" \
-I$(top_srcdir) \
@GTK_DEBUG_FLAGS@ \
@GTK_XIM_FLAGS@ \
@GTK_LOCALE_FLAGS@ \
@GLIB_CFLAGS@ \
@x_cflags@
#
# setup GTK+ sources and their dependancies
#
libgtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_built_public_sources)
libgtk_la_SOURCES = $(gtk_c_sources)
MAINTAINERCLEANFILES += $(gtk_built_public_sources) $(gtk_built_sources)
EXTRA_HEADERS +=
EXTRA_DIST += $(gtk_private_h_sources)
EXTRA_DIST += $(gtk_built_sources) $(gtk_built_public_sources) $(gtk_extra_sources)
noinst_PROGRAMS = testgtk testinput testselection testrgb testdnd simple
# testthreads
#
# rules to generate built sources
#
gen_sources = xgen-gdef xgen-gtbh xgen-gtbvc xgen-gtbic xgen-gtbec xgen-gmh xgen-gmc
CLEANFILES += $(gen_sources)
COPYING: $(gtk_built_public_sources) $(gtk_built_sources)
$(OBJECTS): COPYING # this is our oldest-source-stamp
gtk.defs: @REBUILD@ # stamp-gtk.defs
-test -e "$(srcdir)/$@" || touch $(srcdir)/gtk.defs
stamp-gtk.defs: @REBUILD@ makeenums.pl gtk-boxed.defs $(gtk_public_h_sources) $(gdk_headers)
cd $(srcdir) \
&& $(PERL) makeenums.pl defs $(gtk_public_h_sources) $(gdk_headers) > xgen-gdef \
&& cat gtk-boxed.defs >> xgen-gdef \
&& (cmp -s xgen-gdef gtk.defs || cp xgen-gdef gtk.defs) \
&& rm -f xgen-gdef \
&& echo timestamp > $@
gtkmarshal.h: @REBUILD@ # stamp-gtkmarshal.h
-test -e "$(srcdir)/$@" || touch $(srcdir)/gtkmarshal.h
stamp-gtkmarshal.h: @REBUILD@ gtkmarshal.h
gtkmarshal.c stamp-gtkmarshal.h: @REBUILD@ genmarshal.pl gtkmarshal.list
cd $(srcdir) \
&& $(PERL) genmarshal.pl gtkmarshal.list xgen-gmh xgen-gmc \
&& (test -z "$(INDENT)" || $(INDENT) xgen-gmh) \
&& (test -z "$(INDENT)" || $(INDENT) xgen-gmc) \
&& cp xgen-gmc gtkmarshal.c \
&& (cmp -s xgen-gmh gtkmarshal.h || cp xgen-gmh gtkmarshal.h) \
&& rm -f xgen-gmh xgen-gmc \
&& echo timestamp > stamp-gtkmarshal.h
gtktypebuiltins.h: @REBUILD@ # stamp-gtktypebuiltins.h
-test -e "$(srcdir)/$@" || touch $(srcdir)/gtktypebuiltins.h
stamp-gtktypebuiltins.h: @REBUILD@ maketypes.awk gtk.defs gtktypebuiltins.h
cd $(srcdir) \
&& $(AWK) -f maketypes.awk gtk.defs macros > xgen-gtbh \
&& (cmp -s xgen-gtbh gtktypebuiltins.h || cp xgen-gtbh gtktypebuiltins.h) \
&& rm -f xgen-gtbh \
&& echo timestamp > $@
gtktypebuiltins_vars.c: @REBUILD@ maketypes.awk gtk.defs
cd $(srcdir) \
&& $(AWK) -f maketypes.awk gtk.defs variables > xgen-gtbvc \
&& cp xgen-gtbvc $@ \
&& rm -f xgen-gtbvc
gtktypebuiltins_ids.c: @REBUILD@ maketypes.awk gtk.defs
cd $(srcdir) \
&& $(AWK) -f maketypes.awk gtk.defs entries > xgen-gtbic \
&& cp xgen-gtbic $@ \
&& rm -f xgen-gtbic
gtktypebuiltins_evals.c: @REBUILD@ makeenums.pl $(gtk_public_h_sources) $(gdk_headers)
cd $(srcdir) \
&& $(PERL) makeenums.pl arrays $(gtk_public_h_sources) $(gdk_headers) > xgen-gtbec \
&& cp xgen-gtbec $@ \
&& rm -f xgen-gtbec
DEPS = \
libgtk.la \
$(top_builddir)/gdk/libgdk.la
LDADDS = \
libgtk.la \
$(top_builddir)/gdk/libgdk.la \
@x_ldflags@ \
@x_libs@ \
@GLIB_LIBS@ \
-lm
gtkconfdir = $(sysconfdir)/gtk
gtkconf_DATA = gtkrc.ja gtkrc.ko gtkrc.ru gtkrc.iso-8859-2
# We create a dummy theme for the default GTK+ theme
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk
echo "# Empty gtkrc for default theme" > \
$(DESTDIR)$(datadir)/themes/Default/gtk/gtkrc
$(mkinstalldirs) $(DESTDIR)$(gtkconfdir)
cd $(DESTDIR)$(gtkconfdir) && \
for i in cs hr hu pl sk sl ; do \
rm -f gtkrc.$$i ; \
ln -s gtkrc.iso-8859-2 gtkrc.$$i ; \
done
uninstall-local:
rm -f $(DESTDIR)$(datadir)/themes/Default/gtkrc
#
# test programs, not to be installed
#
noinst_PROGRAMS = testgtk testinput testselection testrgb testdnd simple # testthreads
DEPS = libgtk.la $(top_builddir)/gdk/libgdk.la
LDADDS = @STRIP_BEGIN@ \
libgtk.la \
$(top_builddir)/gdk/libgdk.la \
@x_ldflags@ \
@x_libs@ \
@GLIB_LIBS@ \
-lm \
@STRIP_END@
testgtk_DEPENDENCIES = $(DEPS)
testinput_DEPENDENCIES = $(DEPS)
#testthreads_DEPENDENCIES = $(DEPS)
testselection_DEPENDENCIES = $(DEPS)
testrgb_DEPENDENCIES = $(DEPS)
testdnd_DEPENDENCIES = $(DEPS)
simple_DEPENDENCIES = $(DEPS)
#testthreads_DEPENDENCIES = $(DEPS)
testgtk_LDADD = $(LDADDS)
testinput_LDADD = $(LDADDS)
#testthreads_LDADD = $(LDADDS)
testselection_LDADD = $(LDADDS)
testrgb_LDADD = $(LDADDS)
testdnd_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
#testthreads_LDADD = $(LDADDS)
.PHONY: files test test-debug
@@ -424,3 +433,29 @@ test-debug: testgtk
cd $$builddir; cd $(srcdir); \
$(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk
EXTRA_DIST += @STRIP_BEGIN@ \
testgtk.1 \
testgtkrc \
testgtkrc2 \
circles.xbm \
line-arrow.xbm \
line-wrap.xbm \
tree_plus.xbm \
tree_minus.xbm \
3DRings.xpm \
FilesQueue.xpm \
Modeller.xpm \
check-y.xpm \
check-n.xpm \
marble.xpm \
tree_minus.xpm \
tree_plus.xpm \
test.xpm \
check-y.xpm \
check-n.xpm \
test.xpm \
gtkrc.iso-8859-2 \
gtkrc.ja \
gtkrc.ko \
gtkrc.ru \
@STRIP_END@
+8 -19
View File
@@ -20,25 +20,17 @@
"CALLBACK"=>"CALLBACK"
);
$srcdir = $ENV{'srcdir'} || '.';
$indent = $ENV{'INDENT'};
sub indent {
my $filename = shift;
if (defined($indent) && $indent ne "") {
system($indent, $filename);
# we try the most likely names for backup files
system("rm", "-f", "$filename.bak", "$filename~");
}
if ($#ARGV != 2) {
die ("Wrong number of arguments given, need <source> <target.h> <target.c>");
}
open(IL, "<$srcdir/gtkmarshal.list") || die("Open failed: $!");
open(OH, ">s-gmh") || die("Open failed: $!");
open(OS, ">s-gmc") || die("Open failed: $!");
open(IL, "<" . $ARGV[0]) || die ("Open failed: $!");
open(OH, ">" . $ARGV[1]) || die ("Open failed: $!");
open(OS, ">" . $ARGV[2]) || die ("Open failed: $!");
print OH <<EOT;
#ifndef __GTKMARSHAL_H__
#define __GTKMARSHAL_H__ 1
#ifndef __GTK_MARSHAL_H__
#define __GTK_MARSHAL_H__
#include <gtk/gtktypeutils.h>
#include <gtk/gtkobject.h>
@@ -196,10 +188,7 @@ print OH <<EOT;
}
#endif /* __cplusplus */
#endif /* __GTKMARSHAL_H__ */
#endif /* __GTK_MARSHAL_H__ */
EOT
close(IL); close(OH); close(OS);
indent("s-gmh");
indent("s-gmc");
+1 -1
View File
@@ -28,7 +28,7 @@
*/
#include <ctype.h>
#include <strings.h>
#include <string.h>
#include "gtkaccelgroup.h"
#include "gdk/gdkkeysyms.h"
#include "gtksignal.h"
+23 -20
View File
@@ -83,26 +83,42 @@ struct _GtkAccelEntry
};
/* Accelerators
*/
gboolean gtk_accelerator_valid (guint keyval,
GdkModifierType modifiers);
void gtk_accelerator_parse (const gchar *accelerator,
guint *accelerator_key,
GdkModifierType *accelerator_mods);
gchar* gtk_accelerator_name (guint accelerator_key,
GdkModifierType accelerator_mods);
void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
guint gtk_accelerator_get_default_mod_mask (void);
/* Accelerator Groups
*/
GtkAccelGroup* gtk_accel_group_new (void);
GtkAccelGroup* gtk_accel_group_get_default (void);
GtkAccelGroup* gtk_accel_group_ref (GtkAccelGroup *accel_group);
void gtk_accel_group_unref (GtkAccelGroup *accel_group);
gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
void gtk_accel_group_lock (GtkAccelGroup *accel_group);
void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
gboolean gtk_accel_groups_activate (GtkObject *object,
guint accel_key,
GdkModifierType accel_mods);
gboolean gtk_accel_groups_activate (GtkObject *object,
/* internal functions
*/
gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods);
void gtk_accel_group_attach (GtkAccelGroup *accel_group,
GtkObject *object);
void gtk_accel_group_detach (GtkAccelGroup *accel_group,
GtkObject *object);
void gtk_accel_group_lock (GtkAccelGroup *accel_group);
void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
/* Accelerator Group Entries
/* Accelerator Group Entries (internal)
*/
GtkAccelEntry* gtk_accel_group_get_entry (GtkAccelGroup *accel_group,
guint accel_key,
@@ -124,7 +140,7 @@ void gtk_accel_group_remove (GtkAccelGroup *accel_group,
GdkModifierType accel_mods,
GtkObject *object);
/* Accelerator Signals
/* Accelerator Signals (internal)
*/
void gtk_accel_group_handle_add (GtkObject *object,
guint accel_signal_id,
@@ -151,25 +167,12 @@ void gtk_accel_group_marshal_remove (GtkObject *object,
gpointer func_data,
GtkArg *args);
/* Miscellaneous
/* Miscellaneous (internal)
*/
GSList* gtk_accel_groups_from_object (GtkObject *object);
GSList* gtk_accel_group_entries_from_object (GtkObject *object);
/* Accelerators
*/
gboolean gtk_accelerator_valid (guint keyval,
GdkModifierType modifiers);
void gtk_accelerator_parse (const gchar *accelerator,
guint *accelerator_key,
GdkModifierType *accelerator_mods);
gchar* gtk_accelerator_name (guint accelerator_key,
GdkModifierType accelerator_mods);
void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
guint gtk_accelerator_get_default_mod_mask (void);
#ifdef __cplusplus
}
+220 -5
View File
@@ -422,17 +422,40 @@ gtk_arg_copy (GtkArg *src_arg,
}
void
gtk_arg_free (GtkArg *arg,
gboolean free_contents)
gtk_arg_free (GtkArg *arg,
gboolean free_contents)
{
g_return_if_fail (arg != NULL);
if (free_contents &&
GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_STRING)
g_free (GTK_VALUE_STRING (*arg));
if (free_contents)
gtk_arg_reset (arg);
g_free (arg);
}
void
gtk_arg_reset (GtkArg *arg)
{
GtkType fundamental_type;
g_return_if_fail (arg != NULL);
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
{
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
if (!fundamental_type)
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
}
if (fundamental_type == GTK_TYPE_STRING)
{
g_free (GTK_VALUE_STRING (*arg));
arg->type = GTK_TYPE_INVALID;
}
else if (arg->type != GTK_TYPE_INVALID)
arg->type = GTK_TYPE_INVALID;
}
gint
gtk_arg_info_equal (gconstpointer arg_info_1,
gconstpointer arg_info_2)
@@ -466,3 +489,195 @@ gtk_arg_info_hash (gconstpointer arg_info)
return h;
}
gboolean
gtk_arg_values_equal (const GtkArg *arg1,
const GtkArg *arg2)
{
GtkType fundamental_type;
gboolean equal;
g_return_val_if_fail (arg1 != NULL, FALSE);
g_return_val_if_fail (arg2 != NULL, FALSE);
g_return_val_if_fail (GTK_FUNDAMENTAL_TYPE (arg1->type) ==
GTK_FUNDAMENTAL_TYPE (arg2->type), FALSE);
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg1->type);
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
{
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
if (!fundamental_type)
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg1->type);
}
switch (fundamental_type)
{
case GTK_TYPE_INVALID:
equal = TRUE;
break;
case GTK_TYPE_CHAR:
equal = GTK_VALUE_CHAR (*arg1) == GTK_VALUE_CHAR (*arg2);
break;
case GTK_TYPE_BOOL:
equal = (GTK_VALUE_BOOL (*arg1) != FALSE) == (GTK_VALUE_BOOL (*arg2) != FALSE);
break;
case GTK_TYPE_INT:
equal = GTK_VALUE_INT (*arg1) == GTK_VALUE_INT (*arg2);
break;
case GTK_TYPE_UINT:
equal = GTK_VALUE_UINT (*arg1) == GTK_VALUE_UINT (*arg2);
break;
case GTK_TYPE_LONG:
equal = GTK_VALUE_LONG (*arg1) == GTK_VALUE_LONG (*arg2);
break;
case GTK_TYPE_ULONG:
equal = GTK_VALUE_ULONG (*arg1) == GTK_VALUE_ULONG (*arg2);
break;
case GTK_TYPE_FLOAT:
equal = GTK_VALUE_FLOAT (*arg1) == GTK_VALUE_FLOAT (*arg2);
break;
case GTK_TYPE_DOUBLE:
equal = GTK_VALUE_DOUBLE (*arg1) == GTK_VALUE_DOUBLE (*arg2);
break;
case GTK_TYPE_STRING:
if (!GTK_VALUE_STRING (*arg1) ||
!GTK_VALUE_STRING (*arg2))
equal = GTK_VALUE_STRING (*arg1) == GTK_VALUE_STRING (*arg2);
else
equal = g_str_equal (GTK_VALUE_STRING (*arg1), GTK_VALUE_STRING (*arg2));
break;
case GTK_TYPE_ENUM:
equal = GTK_VALUE_ENUM (*arg1) == GTK_VALUE_ENUM (*arg2);
break;
case GTK_TYPE_FLAGS:
equal = GTK_VALUE_FLAGS (*arg1) == GTK_VALUE_FLAGS (*arg2);
break;
case GTK_TYPE_BOXED:
equal = GTK_VALUE_BOXED (*arg1) == GTK_VALUE_BOXED (*arg2);
break;
case GTK_TYPE_FOREIGN:
equal = (GTK_VALUE_FOREIGN (*arg1).data == GTK_VALUE_FOREIGN (*arg2).data &&
GTK_VALUE_FOREIGN (*arg1).notify == GTK_VALUE_FOREIGN (*arg2).notify);
break;
case GTK_TYPE_CALLBACK:
equal = (GTK_VALUE_CALLBACK (*arg1).marshal == GTK_VALUE_CALLBACK (*arg2).marshal &&
GTK_VALUE_CALLBACK (*arg1).data == GTK_VALUE_CALLBACK (*arg2).data &&
GTK_VALUE_CALLBACK (*arg1).notify == GTK_VALUE_CALLBACK (*arg2).notify);
break;
case GTK_TYPE_ARGS:
equal = (GTK_VALUE_ARGS (*arg1).n_args == GTK_VALUE_ARGS (*arg2).n_args &&
GTK_VALUE_ARGS (*arg1).args == GTK_VALUE_ARGS (*arg2).args);
break;
case GTK_TYPE_OBJECT:
equal = GTK_VALUE_OBJECT (*arg1) == GTK_VALUE_OBJECT (*arg2);
break;
case GTK_TYPE_POINTER:
equal = GTK_VALUE_POINTER (*arg1) == GTK_VALUE_POINTER (*arg2);
break;
case GTK_TYPE_SIGNAL:
equal = (GTK_VALUE_SIGNAL (*arg1).f == GTK_VALUE_SIGNAL (*arg2).f &&
GTK_VALUE_SIGNAL (*arg1).d == GTK_VALUE_SIGNAL (*arg2).d);
break;
case GTK_TYPE_C_CALLBACK:
equal = (GTK_VALUE_C_CALLBACK (*arg1).func == GTK_VALUE_C_CALLBACK (*arg2).func &&
GTK_VALUE_C_CALLBACK (*arg1).func_data == GTK_VALUE_C_CALLBACK (*arg2).func_data);
break;
default:
g_warning ("gtk_arg_values_equal() used with unknown type `%s'", gtk_type_name (arg1->type));
equal = FALSE;
break;
}
return equal;
}
void
gtk_arg_to_valueloc (GtkArg *arg,
gpointer value_pointer)
{
GtkType fundamental_type;
g_return_if_fail (arg != NULL);
g_return_if_fail (value_pointer != NULL);
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
{
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
if (!fundamental_type)
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
}
switch (fundamental_type)
{
gchar *p_char;
guchar *p_uchar;
gboolean *p_boolean;
gint *p_int;
guint *p_uint;
glong *p_long;
gulong *p_ulong;
gfloat *p_float;
gdouble *p_double;
gpointer *p_pointer;
case GTK_TYPE_CHAR:
p_char = value_pointer;
*p_char = GTK_VALUE_CHAR (*arg);
break;
case GTK_TYPE_UCHAR:
p_uchar = value_pointer;
*p_uchar = GTK_VALUE_UCHAR (*arg);
break;
case GTK_TYPE_BOOL:
p_boolean = value_pointer;
*p_boolean = GTK_VALUE_BOOL (*arg);
break;
case GTK_TYPE_INT:
case GTK_TYPE_ENUM:
p_int = value_pointer;
*p_int = GTK_VALUE_INT (*arg);
break;
case GTK_TYPE_UINT:
case GTK_TYPE_FLAGS:
p_uint = value_pointer;
*p_uint = GTK_VALUE_UINT (*arg);
break;
case GTK_TYPE_LONG:
p_long = value_pointer;
*p_long = GTK_VALUE_LONG (*arg);
break;
case GTK_TYPE_ULONG:
p_ulong = value_pointer;
*p_ulong = GTK_VALUE_ULONG (*arg);
break;
case GTK_TYPE_FLOAT:
p_float = value_pointer;
*p_float = GTK_VALUE_FLOAT (*arg);
break;
case GTK_TYPE_DOUBLE:
p_double = value_pointer;
*p_double = GTK_VALUE_DOUBLE (*arg);
break;
case GTK_TYPE_STRING:
case GTK_TYPE_POINTER:
case GTK_TYPE_BOXED:
case GTK_TYPE_OBJECT:
p_pointer = value_pointer;
*p_pointer = GTK_VALUE_POINTER (*arg);
break;
case GTK_TYPE_SIGNAL:
case GTK_TYPE_ARGS:
case GTK_TYPE_FOREIGN:
case GTK_TYPE_CALLBACK:
case GTK_TYPE_C_CALLBACK:
case GTK_TYPE_NONE:
case GTK_TYPE_INVALID:
/* it doesn't make much sense to retrive these values,
* they either are always read-only args, or require
* multiple pointers.
*/
g_warning ("gtk_arg_fill_retloc(): unsupported argument type `%s'",
gtk_type_name (arg->type));
break;
}
}
+9 -4
View File
@@ -63,6 +63,9 @@ GtkArg* gtk_arg_copy (GtkArg *src_arg,
GtkArg *dest_arg);
void gtk_arg_free (GtkArg *arg,
gboolean free_contents);
void gtk_arg_reset (GtkArg *arg);
gboolean gtk_arg_values_equal (const GtkArg *arg1,
const GtkArg *arg2);
gchar* gtk_args_collect (GtkType object_type,
GHashTable *arg_info_hash_table,
GSList **arg_list_p,
@@ -87,10 +90,12 @@ GtkArg* gtk_args_query (GtkType class_type,
guint32 **arg_flags,
guint *n_args_p);
gchar* gtk_arg_name_strip_type (const gchar *arg_name);
gint gtk_arg_info_equal (gconstpointer arg_info_1,
gconstpointer arg_info_2);
guint gtk_arg_info_hash (gconstpointer arg_info);
gint gtk_arg_info_equal (gconstpointer arg_info_1,
gconstpointer arg_info_2);
guint gtk_arg_info_hash (gconstpointer arg_info);
void gtk_arg_to_valueloc (GtkArg *arg,
gpointer value_pointer);
+130 -33
View File
@@ -31,8 +31,22 @@
#include "gtkaspectframe.h"
enum {
ARG_0,
ARG_XALIGN,
ARG_YALIGN,
ARG_RATIO,
ARG_OBEY_CHILD
};
static void gtk_aspect_frame_class_init (GtkAspectFrameClass *klass);
static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame);
static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame);
static void gtk_aspect_frame_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_aspect_frame_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_aspect_frame_draw (GtkWidget *widget,
GdkRectangle *area);
static void gtk_aspect_frame_paint (GtkWidget *widget,
@@ -49,7 +63,7 @@ GtkType
gtk_aspect_frame_get_type (void)
{
static GtkType aspect_frame_type = 0;
if (!aspect_frame_type)
{
static const GtkTypeInfo aspect_frame_info =
@@ -63,23 +77,37 @@ gtk_aspect_frame_get_type (void)
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
aspect_frame_type = gtk_type_unique (gtk_frame_get_type (), &aspect_frame_info);
aspect_frame_type = gtk_type_unique (GTK_TYPE_FRAME, &aspect_frame_info);
}
return aspect_frame_type;
}
static void
gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
widget_class = (GtkWidgetClass*) class;
object_class = GTK_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
object_class->set_arg = gtk_aspect_frame_set_arg;
object_class->get_arg = gtk_aspect_frame_get_arg;
widget_class->draw = gtk_aspect_frame_draw;
widget_class->expose_event = gtk_aspect_frame_expose;
widget_class->size_allocate = gtk_aspect_frame_size_allocate;
gtk_object_add_arg_type ("GtkAspectFrame::xalign", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_XALIGN);
gtk_object_add_arg_type ("GtkAspectFrame::yalign", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_YALIGN);
gtk_object_add_arg_type ("GtkAspectFrame::ratio", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_RATIO);
gtk_object_add_arg_type ("GtkAspectFrame::obey_child", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_OBEY_CHILD);
}
static void
@@ -88,19 +116,86 @@ gtk_aspect_frame_init (GtkAspectFrame *aspect_frame)
aspect_frame->xalign = 0.5;
aspect_frame->yalign = 0.5;
aspect_frame->ratio = 1.0;
aspect_frame->obey_child = 1;
aspect_frame->obey_child = TRUE;
aspect_frame->center_allocation.x = -1;
aspect_frame->center_allocation.y = -1;
aspect_frame->center_allocation.width = 1;
aspect_frame->center_allocation.height = 1;
}
static void
gtk_aspect_frame_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
switch (arg_id)
{
case ARG_XALIGN:
gtk_aspect_frame_set (aspect_frame,
GTK_VALUE_FLOAT (*arg),
aspect_frame->yalign,
aspect_frame->ratio,
aspect_frame->obey_child);
break;
case ARG_YALIGN:
gtk_aspect_frame_set (aspect_frame,
aspect_frame->xalign,
GTK_VALUE_FLOAT (*arg),
aspect_frame->ratio,
aspect_frame->obey_child);
break;
case ARG_RATIO:
gtk_aspect_frame_set (aspect_frame,
aspect_frame->xalign,
aspect_frame->yalign,
GTK_VALUE_FLOAT (*arg),
aspect_frame->obey_child);
break;
case ARG_OBEY_CHILD:
gtk_aspect_frame_set (aspect_frame,
aspect_frame->xalign,
aspect_frame->yalign,
aspect_frame->ratio,
GTK_VALUE_BOOL (*arg));
break;
}
}
static void
gtk_aspect_frame_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
switch (arg_id)
{
case ARG_XALIGN:
GTK_VALUE_FLOAT (*arg) = aspect_frame->xalign;
break;
case ARG_YALIGN:
GTK_VALUE_FLOAT (*arg) = aspect_frame->yalign;
break;
case ARG_RATIO:
GTK_VALUE_FLOAT (*arg) = aspect_frame->ratio;
break;
case ARG_OBEY_CHILD:
GTK_VALUE_BOOL (*arg) = aspect_frame->obey_child;
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
GtkWidget*
gtk_aspect_frame_new (const gchar *label,
gfloat xalign,
gfloat yalign,
gfloat ratio,
gint obey_child)
gfloat xalign,
gfloat yalign,
gfloat ratio,
gboolean obey_child)
{
GtkAspectFrame *aspect_frame;
@@ -109,7 +204,7 @@ gtk_aspect_frame_new (const gchar *label,
aspect_frame->xalign = CLAMP (xalign, 0.0, 1.0);
aspect_frame->yalign = CLAMP (yalign, 0.0, 1.0);
aspect_frame->ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
aspect_frame->obey_child = obey_child;
aspect_frame->obey_child = obey_child != FALSE;
gtk_frame_set_label (GTK_FRAME(aspect_frame), label);
@@ -118,33 +213,34 @@ gtk_aspect_frame_new (const gchar *label,
void
gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
gfloat xalign,
gfloat yalign,
gfloat ratio,
gint obey_child)
gfloat xalign,
gfloat yalign,
gfloat ratio,
gboolean obey_child)
{
g_return_if_fail (aspect_frame != NULL);
g_return_if_fail (GTK_IS_ASPECT_FRAME (aspect_frame));
xalign = CLAMP (xalign, 0.0, 1.0);
yalign = CLAMP (yalign, 0.0, 1.0);
ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
obey_child = obey_child != FALSE;
if ((aspect_frame->xalign != xalign) ||
(aspect_frame->yalign != yalign) ||
(aspect_frame->ratio != ratio) ||
(aspect_frame->obey_child != obey_child))
{
GtkWidget *widget = GTK_WIDGET(aspect_frame);
aspect_frame->xalign = xalign;
aspect_frame->yalign = yalign;
aspect_frame->ratio = ratio;
aspect_frame->obey_child = obey_child;
if (GTK_WIDGET_DRAWABLE(widget))
gtk_widget_queue_clear (widget);
gtk_widget_queue_resize (widget);
}
}
@@ -308,9 +404,10 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
gtk_widget_get_child_requisition (bin->child, &child_requisition);
if (child_requisition.height != 0)
{
ratio = (gdouble)child_requisition.width /
child_requisition.height;
if (ratio < MIN_RATIO) ratio = MIN_RATIO;
ratio = ((gdouble) child_requisition.width /
child_requisition.height);
if (ratio < MIN_RATIO)
ratio = MIN_RATIO;
}
else if (child_requisition.width != 0)
ratio = MAX_RATIO;
@@ -319,22 +416,22 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
}
else
ratio = aspect_frame->ratio;
x = (GTK_CONTAINER (frame)->border_width +
GTK_WIDGET (frame)->style->klass->xthickness);
width = allocation->width - x * 2;
y = (GTK_CONTAINER (frame)->border_width +
MAX (frame->label_height, GTK_WIDGET (frame)->style->klass->ythickness));
MAX (frame->label_height, GTK_WIDGET (frame)->style->klass->ythickness));
height = (allocation->height - y -
GTK_CONTAINER (frame)->border_width -
GTK_WIDGET (frame)->style->klass->ythickness);
GTK_CONTAINER (frame)->border_width -
GTK_WIDGET (frame)->style->klass->ythickness);
/* make sure we don't allocate a negative width or height,
* since that will be cast to a (very big) guint16 */
width = MAX (1, width);
height = MAX (1, height);
if (ratio * height > width)
{
child_allocation.width = width;
@@ -345,7 +442,7 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
child_allocation.width = ratio*height + 0.5;
child_allocation.height = height;
}
child_allocation.x = aspect_frame->xalign * (width - child_allocation.width) + allocation->x + x;
child_allocation.y = aspect_frame->yalign * (height - child_allocation.height) + allocation->y + y;
+10 -10
View File
@@ -67,16 +67,16 @@ struct _GtkAspectFrameClass
GtkType gtk_aspect_frame_get_type (void);
GtkWidget* gtk_aspect_frame_new (const gchar *label,
gfloat xalign,
gfloat yalign,
gfloat ratio,
gint obey_child);
void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
gfloat xalign,
gfloat yalign,
gfloat ratio,
gint obey_child);
GtkWidget* gtk_aspect_frame_new (const gchar *label,
gfloat xalign,
gfloat yalign,
gfloat ratio,
gint obey_child);
void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
gfloat xalign,
gfloat yalign,
gfloat ratio,
gboolean obey_child);
#ifdef __cplusplus
+15 -15
View File
@@ -167,10 +167,13 @@ gtk_bin_draw (GtkWidget *widget,
g_return_if_fail (GTK_IS_BIN (widget));
bin = GTK_BIN (widget);
if (bin->child && GTK_WIDGET_VISIBLE (bin->child) &&
gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
if (GTK_WIDGET_DRAWABLE (bin))
{
if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
}
}
static gint
@@ -189,7 +192,7 @@ gtk_bin_expose (GtkWidget *widget,
bin = GTK_BIN (widget);
child_event = *event;
if (bin->child &&
if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
GTK_WIDGET_NO_WINDOW (bin->child) &&
gtk_widget_intersect (bin->child, &event->area, &child_event.area))
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
@@ -216,19 +219,16 @@ gtk_bin_add (GtkContainer *container,
gtk_widget_set_parent (child, GTK_WIDGET (bin));
bin->child = child;
if (GTK_WIDGET_VISIBLE (child->parent))
if (GTK_WIDGET_REALIZED (child->parent))
gtk_widget_realize (child);
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
{
if (GTK_WIDGET_REALIZED (child->parent) &&
!GTK_WIDGET_REALIZED (child))
gtk_widget_realize (child);
if (GTK_WIDGET_MAPPED (child->parent) &&
!GTK_WIDGET_MAPPED (child))
if (GTK_WIDGET_MAPPED (child->parent))
gtk_widget_map (child);
gtk_widget_queue_resize (child);
}
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (child);
}
static void
+2 -1
View File
@@ -28,7 +28,7 @@
*/
#include <ctype.h>
#include <strings.h>
#include <string.h>
#include <stdarg.h>
#include "gtkbindings.h"
#include "gtksignal.h"
@@ -1136,6 +1136,7 @@ gtk_pattern_spec_init (GtkPatternSpec *pspec,
t = pspec->pattern_reversed;
pspec->pattern_reversed = g_strdup (p);
g_free (t);
g_free (pspec->pattern);
pspec->pattern = g_strdup (pspec->pattern_reversed);
g_strreverse (pspec->pattern);
pspec->pattern_length = strlen (pspec->pattern);
+18 -22
View File
@@ -341,20 +341,17 @@ gtk_box_pack_start (GtkBox *box,
box->children = g_list_append (box->children, child_info);
gtk_widget_set_parent (child, GTK_WIDGET (box));
if (GTK_WIDGET_REALIZED (box))
gtk_widget_realize (child);
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (box)))
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
{
if (GTK_WIDGET_REALIZED (GTK_WIDGET (box)) &&
!GTK_WIDGET_REALIZED (child))
gtk_widget_realize (child);
if (GTK_WIDGET_MAPPED (GTK_WIDGET (box)) &&
!GTK_WIDGET_MAPPED (child))
if (GTK_WIDGET_MAPPED (box))
gtk_widget_map (child);
}
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
gtk_widget_queue_resize (child);
gtk_widget_queue_resize (child);
}
}
void
@@ -382,19 +379,16 @@ gtk_box_pack_end (GtkBox *box,
gtk_widget_set_parent (child, GTK_WIDGET (box));
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (box)))
if (GTK_WIDGET_REALIZED (box))
gtk_widget_realize (child);
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
{
if (GTK_WIDGET_REALIZED (GTK_WIDGET (box)) &&
!GTK_WIDGET_REALIZED (child))
gtk_widget_realize (child);
if (GTK_WIDGET_MAPPED (GTK_WIDGET (box)) &&
!GTK_WIDGET_MAPPED (child))
if (GTK_WIDGET_MAPPED (box))
gtk_widget_map (child);
gtk_widget_queue_resize (child);
}
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
gtk_widget_queue_resize (child);
}
void
@@ -660,7 +654,8 @@ gtk_box_draw (GtkWidget *widget,
child = children->data;
children = children->next;
if (gtk_widget_intersect (child->widget, area, &child_area))
if (GTK_WIDGET_DRAWABLE (child->widget) &&
gtk_widget_intersect (child->widget, area, &child_area))
gtk_widget_draw (child->widget, &child_area);
}
}
@@ -691,7 +686,8 @@ gtk_box_expose (GtkWidget *widget,
child = children->data;
children = children->next;
if (GTK_WIDGET_NO_WINDOW (child->widget) &&
if (GTK_WIDGET_DRAWABLE (child->widget) &&
GTK_WIDGET_NO_WINDOW (child->widget) &&
gtk_widget_intersect (child->widget, &event->area, &child_event.area))
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
}
+1 -1
View File
@@ -646,7 +646,7 @@ static gint
gtk_button_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkButton *bin;
GtkBin *bin;
GdkEventExpose child_event;
g_return_val_if_fail (widget != NULL, FALSE);
+35 -37
View File
@@ -74,16 +74,49 @@ gtk_check_menu_item_get_type (void)
(GtkClassInitFunc) NULL,
};
check_menu_item_type = gtk_type_unique (gtk_menu_item_get_type (), &check_menu_item_info);
check_menu_item_type = gtk_type_unique (GTK_TYPE_MENU_ITEM, &check_menu_item_info);
}
return check_menu_item_type;
}
static void
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkMenuItemClass *menu_item_class;
object_class = (GtkObjectClass*) klass;
widget_class = (GtkWidgetClass*) klass;
menu_item_class = (GtkMenuItemClass*) klass;
parent_class = gtk_type_class (GTK_TYPE_MENU_ITEM);
widget_class->draw = gtk_check_menu_item_draw;
widget_class->expose_event = gtk_check_menu_item_expose;
menu_item_class->activate = gtk_check_menu_item_activate;
menu_item_class->toggle_size = 12;
menu_item_class->hide_on_activate = FALSE;
klass->toggled = NULL;
klass->draw_indicator = gtk_real_check_menu_item_draw_indicator;
check_menu_item_signals[TOGGLED] =
gtk_signal_new ("toggled",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkCheckMenuItemClass, toggled),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, check_menu_item_signals, LAST_SIGNAL);
}
GtkWidget*
gtk_check_menu_item_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_check_menu_item_get_type ()));
return GTK_WIDGET (gtk_type_new (GTK_TYPE_CHECK_MENU_ITEM));
}
GtkWidget*
@@ -132,41 +165,6 @@ gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item)
gtk_signal_emit (GTK_OBJECT (check_menu_item), check_menu_item_signals[TOGGLED]);
}
static void
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkMenuItemClass *menu_item_class;
object_class = (GtkObjectClass*) klass;
widget_class = (GtkWidgetClass*) klass;
menu_item_class = (GtkMenuItemClass*) klass;
parent_class = gtk_type_class (gtk_menu_item_get_type ());
check_menu_item_signals[TOGGLED] =
gtk_signal_new ("toggled",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkCheckMenuItemClass, toggled),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, check_menu_item_signals, LAST_SIGNAL);
widget_class->draw = gtk_check_menu_item_draw;
widget_class->expose_event = gtk_check_menu_item_expose;
menu_item_class->activate = gtk_check_menu_item_activate;
menu_item_class->toggle_size = 12;
menu_item_class->hide_on_activate = FALSE;
klass->toggled = NULL;
klass->draw_indicator = gtk_real_check_menu_item_draw_indicator;
}
static void
gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
{
+294 -226
View File
@@ -39,7 +39,7 @@
#define MAX_BUTTON 5
/* the number rows memchunk expands at a time */
#define CLIST_OPTIMUM_SIZE 512
#define CLIST_OPTIMUM_SIZE 64
/* the width of the column resize windows */
#define DRAG_WIDTH 6
@@ -134,8 +134,7 @@ LIST_WIDTH (GtkCList * clist)
/* Signals */
enum
{
enum {
SELECT_ROW,
UNSELECT_ROW,
ROW_MOVE,
@@ -155,8 +154,7 @@ enum
LAST_SIGNAL
};
enum
{
enum {
SYNC_REMOVE,
SYNC_INSERT
};
@@ -169,7 +167,8 @@ enum {
ARG_ROW_HEIGHT,
ARG_TITLES_ACTIVE,
ARG_REORDERABLE,
ARG_USE_DRAG_ICONS
ARG_USE_DRAG_ICONS,
ARG_SORT_TYPE
};
/* GtkCList Methods */
@@ -438,11 +437,18 @@ static GList *gtk_clist_mergesort (GtkCList *clist,
GList *list,
gint num);
/* Misc */
static gboolean title_focus (GtkCList *clist,
gint dir);
static void real_row_move (GtkCList *clist,
gint source_row,
gint dest_row);
static gboolean title_focus (GtkCList *clist,
gint dir);
static void real_row_move (GtkCList *clist,
gint source_row,
gint dest_row);
static gint column_title_passive_func (GtkWidget *widget,
GdkEvent *event,
gpointer data);
static void drag_dest_cell (GtkCList *clist,
gint x,
gint y,
GtkCListDestInfo *dest_info);
@@ -518,7 +524,10 @@ gtk_clist_class_init (GtkCListClass *klass)
GTK_TYPE_BOOL,
GTK_ARG_READWRITE,
ARG_USE_DRAG_ICONS);
gtk_object_add_arg_type ("GtkCList::sort_type",
GTK_TYPE_SORT_TYPE,
GTK_ARG_READWRITE,
ARG_SORT_TYPE);
object_class->set_arg = gtk_clist_set_arg;
object_class->get_arg = gtk_clist_get_arg;
object_class->destroy = gtk_clist_destroy;
@@ -847,7 +856,8 @@ gtk_clist_set_arg (GtkObject *object,
case ARG_USE_DRAG_ICONS:
gtk_clist_set_use_drag_icons (clist, GTK_VALUE_BOOL (*arg));
break;
default:
case ARG_SORT_TYPE:
gtk_clist_set_sort_type (clist, GTK_VALUE_ENUM (*arg));
break;
}
}
@@ -893,6 +903,9 @@ gtk_clist_get_arg (GtkObject *object,
case ARG_USE_DRAG_ICONS:
GTK_VALUE_BOOL (*arg) = GTK_CLIST_USE_DRAG_ICONS (clist);
break;
case ARG_SORT_TYPE:
GTK_VALUE_ENUM (*arg) = clist->sort_type;
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
@@ -1296,39 +1309,49 @@ gtk_clist_column_title_active (GtkCList *clist,
if (column < 0 || column >= clist->columns)
return;
if (!clist->column[column].button)
if (!clist->column[column].button || !clist->column[column].button_passive)
return;
if (!GTK_WIDGET_SENSITIVE (clist->column[column].button) ||
!GTK_WIDGET_CAN_FOCUS (clist->column[column].button))
{
GTK_WIDGET_SET_FLAGS (clist->column[column].button,
GTK_SENSITIVE | GTK_CAN_FOCUS);
if (GTK_WIDGET_VISIBLE (clist))
gtk_widget_queue_draw (clist->column[column].button);
}
clist->column[column].button_passive = FALSE;
gtk_signal_disconnect_by_func (GTK_OBJECT (clist->column[column].button),
(GtkSignalFunc) column_title_passive_func,
NULL);
GTK_WIDGET_SET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
if (GTK_WIDGET_VISIBLE (clist))
gtk_widget_queue_draw (clist->column[column].button);
}
void
gtk_clist_column_title_passive (GtkCList *clist,
gint column)
{
GtkButton *button;
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CLIST (clist));
if (column < 0 || column >= clist->columns)
return;
if (!clist->column[column].button)
if (!clist->column[column].button || clist->column[column].button_passive)
return;
if (GTK_WIDGET_SENSITIVE (clist->column[column].button) ||
GTK_WIDGET_CAN_FOCUS (clist->column[column].button))
{
GTK_WIDGET_UNSET_FLAGS (clist->column[column].button,
GTK_SENSITIVE | GTK_CAN_FOCUS);
if (GTK_WIDGET_VISIBLE (clist))
gtk_widget_queue_draw (clist->column[column].button);
}
button = GTK_BUTTON (clist->column[column].button);
clist->column[column].button_passive = TRUE;
if (button->button_down)
gtk_button_released (button);
if (button->in_button)
gtk_button_leave (button);
gtk_signal_connect (GTK_OBJECT (clist->column[column].button), "event",
(GtkSignalFunc) column_title_passive_func, NULL);
GTK_WIDGET_UNSET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
if (GTK_WIDGET_VISIBLE (clist))
gtk_widget_queue_draw (clist->column[column].button);
}
void
@@ -1764,6 +1787,7 @@ gtk_clist_set_column_max_width (GtkCList *clist,
* new_column_width
* column_button_create
* column_button_clicked
* column_title_passive_func
*/
static void
column_auto_resize (GtkCList *clist,
@@ -2079,7 +2103,6 @@ column_button_create (GtkCList *clist,
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) column_button_clicked,
(gpointer) clist);
gtk_widget_show (button);
}
@@ -2103,84 +2126,29 @@ column_button_clicked (GtkWidget *widget,
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[CLICK_COLUMN], i);
}
void
gtk_clist_set_row_height (GtkCList *clist,
guint height)
static gint
column_title_passive_func (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
GtkWidget *widget;
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CLIST (clist));
widget = GTK_WIDGET (clist);
if (height > 0)
g_return_val_if_fail (event != NULL, FALSE);
switch (event->type)
{
clist->row_height = height;
GTK_CLIST_SET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
return TRUE;
default:
break;
}
else
{
GTK_CLIST_UNSET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
clist->row_height = 0;
}
if (GTK_WIDGET_REALIZED (clist))
{
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
{
clist->row_height = (widget->style->font->ascent +
widget->style->font->descent + 1);
clist->row_center_offset = widget->style->font->ascent + 1.5;
}
else
clist->row_center_offset = 1.5 + (clist->row_height +
widget->style->font->ascent -
widget->style->font->descent - 1) / 2;
}
CLIST_REFRESH (clist);
return FALSE;
}
void
gtk_clist_moveto (GtkCList *clist,
gint row,
gint column,
gfloat row_align,
gfloat col_align)
{
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CLIST (clist));
if (row < -1 || row >= clist->rows)
return;
if (column < -1 || column >= clist->columns)
return;
row_align = CLAMP (row_align, 0, 1);
col_align = CLAMP (col_align, 0, 1);
/* adjust horizontal scrollbar */
if (clist->hadjustment && column >= 0)
{
gint x;
x = (COLUMN_LEFT (clist, column) - CELL_SPACING - COLUMN_INSET -
(col_align * (clist->clist_window_width - 2 * COLUMN_INSET -
CELL_SPACING - clist->column[column].area.width)));
if (x < 0)
gtk_adjustment_set_value (clist->hadjustment, 0.0);
else if (x > LIST_WIDTH (clist) - clist->clist_window_width)
gtk_adjustment_set_value
(clist->hadjustment, LIST_WIDTH (clist) - clist->clist_window_width);
else
gtk_adjustment_set_value (clist->hadjustment, x);
}
/* adjust vertical scrollbar */
if (clist->vadjustment && row >= 0)
move_vertical (clist, row, row_align);
}
/* PUBLIC CELL FUNCTIONS
* gtk_clist_get_cell_type
@@ -2413,7 +2381,7 @@ gtk_clist_set_shift (GtkCList *clist,
gint vertical,
gint horizontal)
{
GtkRequisition requisition;
GtkRequisition requisition = { 0 };
GtkCListRow *clist_row;
g_return_if_fail (clist != NULL);
@@ -2774,8 +2742,7 @@ real_remove_row (GtkCList *clist,
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
row, -1, NULL);
/* reset the row end pointer if we're removing at the
* end of the list */
/* reset the row end pointer if we're removing at the end of the list */
clist->rows--;
if (clist->row_list == list)
clist->row_list = g_list_next (list);
@@ -2934,6 +2901,8 @@ real_row_move (GtkCList *clist,
}
/* PUBLIC ROW FUNCTIONS
* gtk_clist_moveto
* gtk_clist_set_row_height
* gtk_clist_set_row_data
* gtk_clist_set_row_data_full
* gtk_clist_get_row_data
@@ -2944,6 +2913,85 @@ real_row_move (GtkCList *clist,
* gtk_clist_set_foreground
* gtk_clist_set_background
*/
void
gtk_clist_moveto (GtkCList *clist,
gint row,
gint column,
gfloat row_align,
gfloat col_align)
{
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CLIST (clist));
if (row < -1 || row >= clist->rows)
return;
if (column < -1 || column >= clist->columns)
return;
row_align = CLAMP (row_align, 0, 1);
col_align = CLAMP (col_align, 0, 1);
/* adjust horizontal scrollbar */
if (clist->hadjustment && column >= 0)
{
gint x;
x = (COLUMN_LEFT (clist, column) - CELL_SPACING - COLUMN_INSET -
(col_align * (clist->clist_window_width - 2 * COLUMN_INSET -
CELL_SPACING - clist->column[column].area.width)));
if (x < 0)
gtk_adjustment_set_value (clist->hadjustment, 0.0);
else if (x > LIST_WIDTH (clist) - clist->clist_window_width)
gtk_adjustment_set_value
(clist->hadjustment, LIST_WIDTH (clist) - clist->clist_window_width);
else
gtk_adjustment_set_value (clist->hadjustment, x);
}
/* adjust vertical scrollbar */
if (clist->vadjustment && row >= 0)
move_vertical (clist, row, row_align);
}
void
gtk_clist_set_row_height (GtkCList *clist,
guint height)
{
GtkWidget *widget;
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CLIST (clist));
widget = GTK_WIDGET (clist);
if (height > 0)
{
clist->row_height = height;
GTK_CLIST_SET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
}
else
{
GTK_CLIST_UNSET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
clist->row_height = 0;
}
if (GTK_WIDGET_REALIZED (clist))
{
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
{
clist->row_height = (widget->style->font->ascent +
widget->style->font->descent + 1);
clist->row_center_offset = widget->style->font->ascent + 1.5;
}
else
clist->row_center_offset = 1.5 + (clist->row_height +
widget->style->font->ascent -
widget->style->font->descent - 1) / 2;
}
CLIST_REFRESH (clist);
}
void
gtk_clist_set_row_data (GtkCList *clist,
gint row,
@@ -3152,7 +3200,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
gint column,
GtkStyle *style)
{
GtkRequisition requisition;
GtkRequisition requisition = { 0 };
GtkCListRow *clist_row;
g_return_if_fail (clist != NULL);
@@ -3827,8 +3875,11 @@ real_undo_selection (GtkCList *clist)
GPOINTER_TO_INT (work->data), -1, NULL);
for (work = clist->undo_unselection; work; work = work->next)
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
GPOINTER_TO_INT (work->data), -1, NULL);
{
g_print ("unselect %d\n",GPOINTER_TO_INT (work->data));
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
GPOINTER_TO_INT (work->data), -1, NULL);
}
if (GTK_WIDGET_HAS_FOCUS(clist) && clist->focus_row != clist->undo_anchor)
{
@@ -3984,9 +4035,9 @@ resync_selection (GtkCList *clist,
}
}
}
for (list = g_list_reverse (clist->undo_unselection); list;
list = list->next)
clist->undo_unselection = g_list_reverse (clist->undo_unselection);
for (list = clist->undo_unselection; list; list = list->next)
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
GPOINTER_TO_INT (list->data), -1, event);
@@ -4465,7 +4516,8 @@ gtk_clist_realize (GtkWidget *widget)
/* We'll use this gc to do scrolling as well */
gdk_gc_set_exposures (clist->fg_gc, TRUE);
values.foreground = widget->style->white;
values.foreground = (widget->style->white.pixel==0 ?
widget->style->black:widget->style->white);
values.function = GDK_XOR;
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
clist->xor_gc = gdk_gc_new_with_values (widget->window,
@@ -4517,8 +4569,12 @@ gtk_clist_unrealize (GtkWidget *widget)
/* freeze the list */
clist->freeze_count++;
/* detach optional row/cell styles */
if (GTK_WIDGET_MAPPED (widget))
gtk_clist_unmap (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
/* detach optional row/cell styles */
if (GTK_WIDGET_REALIZED (widget))
{
GtkCListRow *clist_row;
@@ -4545,12 +4601,16 @@ gtk_clist_unrealize (GtkWidget *widget)
gdk_gc_destroy (clist->bg_gc);
for (i = 0; i < clist->columns; i++)
if (clist->column[i].window)
{
gdk_window_set_user_data (clist->column[i].window, NULL);
gdk_window_destroy (clist->column[i].window);
clist->column[i].window = NULL;
}
{
if (clist->column[i].button)
gtk_widget_unrealize (clist->column[i].button);
if (clist->column[i].window)
{
gdk_window_set_user_data (clist->column[i].window, NULL);
gdk_window_destroy (clist->column[i].window);
clist->column[i].window = NULL;
}
}
gdk_window_set_user_data (clist->clist_window, NULL);
gdk_window_destroy (clist->clist_window);
@@ -4586,10 +4646,12 @@ gtk_clist_map (GtkWidget *widget)
/* map column buttons */
for (i = 0; i < clist->columns; i++)
if (clist->column[i].button &&
GTK_WIDGET_VISIBLE (clist->column[i].button) &&
!GTK_WIDGET_MAPPED (clist->column[i].button))
gtk_widget_map (clist->column[i].button);
{
if (clist->column[i].button &&
GTK_WIDGET_VISIBLE (clist->column[i].button) &&
!GTK_WIDGET_MAPPED (clist->column[i].button))
gtk_widget_map (clist->column[i].button);
}
for (i = 0; i < clist->columns; i++)
if (clist->column[i].window && clist->column[i].button)
@@ -4699,7 +4761,7 @@ gtk_clist_draw (GtkWidget *widget,
(2 * widget->style->klass->ythickness) +
clist->column_title_area.height);
gdk_window_clear_area (clist->clist_window, 0, 0, -1, -1);
gdk_window_clear_area (clist->clist_window, 0, 0, 0, 0);
draw_rows (clist, NULL);
for (i = 0; i < clist->columns; i++)
@@ -5107,6 +5169,7 @@ gtk_clist_button_release (GtkWidget *widget,
{
case GTK_SELECTION_EXTENDED:
if (!(event->state & GDK_SHIFT_MASK) ||
!GTK_WIDGET_CAN_FOCUS (widget) ||
event->x < 0 || event->x >= clist->clist_window_width ||
event->y < 0 || event->y >= clist->clist_window_height)
GTK_CLIST_CLASS_FW (clist)->resync_selection
@@ -5891,8 +5954,8 @@ draw_rows (GtkCList *clist,
}
if (!area)
gdk_window_clear_area (clist->clist_window,
0, ROW_TOP_YPIXEL (clist, i), -1, -1);
gdk_window_clear_area (clist->clist_window, 0,
ROW_TOP_YPIXEL (clist, i), 0, 0);
}
static void
@@ -5992,7 +6055,8 @@ adjust_adjustments (GtkCList *clist,
clist->vadjustment->lower = 0;
clist->vadjustment->upper = LIST_HEIGHT (clist);
if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist))
if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist) ||
(clist->voffset + (gint)clist->vadjustment->value) != 0)
{
clist->vadjustment->value = MAX (0, (LIST_HEIGHT (clist) -
clist->clist_window_height));
@@ -6010,7 +6074,8 @@ adjust_adjustments (GtkCList *clist,
clist->hadjustment->lower = 0;
clist->hadjustment->upper = LIST_WIDTH (clist);
if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist))
if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist) ||
(clist->hoffset + (gint)clist->hadjustment->value) != 0)
{
clist->hadjustment->value = MAX (0, (LIST_WIDTH (clist) -
clist->clist_window_width));
@@ -6356,6 +6421,7 @@ columns_new (GtkCList *clist)
column[i].width_set = FALSE;
column[i].resizeable = TRUE;
column[i].auto_resize = FALSE;
column[i].button_passive = FALSE;
column[i].justification = GTK_JUSTIFY_LEFT;
}
@@ -7038,19 +7104,14 @@ move_vertical (GtkCList *clist,
static gint
horizontal_timeout (GtkCList *clist)
{
gint x, y;
GdkEventMotion event;
GdkModifierType mask;
GdkEventMotion event = { 0 };
GDK_THREADS_ENTER ();
clist->htimer = 0;
gdk_window_get_pointer (clist->clist_window, &x, &y, &mask);
event.is_hint = 0;
event.x = x;
event.y = y;
event.state = mask;
event.type = GDK_MOTION_NOTIFY;
event.send_event = TRUE;
gtk_clist_motion (GTK_WIDGET (clist), &event);
@@ -7062,19 +7123,14 @@ horizontal_timeout (GtkCList *clist)
static gint
vertical_timeout (GtkCList *clist)
{
gint x, y;
GdkEventMotion event;
GdkModifierType mask;
GdkEventMotion event = { 0 };
GDK_THREADS_ENTER ();
clist->vtimer = 0;
gdk_window_get_pointer (clist->clist_window, &x, &y, &mask);
event.is_hint = 0;
event.x = x;
event.y = y;
event.state = mask;
event.type = GDK_MOTION_NOTIFY;
event.send_event = TRUE;
gtk_clist_motion (GTK_WIDGET (clist), &event);
@@ -7369,6 +7425,62 @@ drag_dest_info_destroy (gpointer data)
g_free (info);
}
static void
drag_dest_cell (GtkCList *clist,
gint x,
gint y,
GtkCListDestInfo *dest_info)
{
GtkWidget *widget;
widget = GTK_WIDGET (clist);
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
y -= (GTK_CONTAINER (clist)->border_width +
widget->style->klass->ythickness +
clist->column_title_area.height);
dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
if (dest_info->cell.row >= clist->rows)
{
dest_info->cell.row = clist->rows - 1;
y = ROW_TOP_YPIXEL (clist, dest_info->cell.row) + clist->row_height;
}
if (dest_info->cell.row < -1)
dest_info->cell.row = -1;
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
if (dest_info->cell.row >= 0)
{
gint y_delta;
gint h = 0;
y_delta = y - ROW_TOP_YPIXEL (clist, dest_info->cell.row);
if (GTK_CLIST_DRAW_DRAG_RECT(clist))
{
dest_info->insert_pos = GTK_CLIST_DRAG_INTO;
h = clist->row_height / 4;
}
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
h = clist->row_height / 2;
}
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
if (y_delta < h)
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
else if (clist->row_height - y_delta < h)
dest_info->insert_pos = GTK_CLIST_DRAG_AFTER;
}
}
}
static void
gtk_clist_drag_begin (GtkWidget *widget,
GdkDragContext *context)
@@ -7486,56 +7598,14 @@ gtk_clist_drag_motion (GtkWidget *widget,
guint time)
{
GtkCList *clist;
gint row, column;
GtkCListDestInfo new_info;
GtkCListDestInfo *dest_info;
gint h = 0;
gint insert_pos = GTK_CLIST_DRAG_NONE;
gint y_delta;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
clist = GTK_CLIST (widget);
y -= (GTK_CONTAINER (widget)->border_width +
widget->style->klass->ythickness + clist->column_title_area.height);
row = ROW_FROM_YPIXEL (clist, y);
if (row >= clist->rows)
{
row = clist->rows - 1;
y = ROW_TOP_YPIXEL (clist, row) + clist->row_height;
}
if (row < -1)
row = -1;
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
column = COLUMN_FROM_XPIXEL (clist, x);
if (row >= 0)
{
y_delta = y - ROW_TOP_YPIXEL (clist, row);
if (GTK_CLIST_DRAW_DRAG_RECT(clist))
{
insert_pos = GTK_CLIST_DRAG_INTO;
h = clist->row_height / 4;
}
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
insert_pos = GTK_CLIST_DRAG_BEFORE;
h = clist->row_height / 2;
}
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
if (y_delta < h)
insert_pos = GTK_CLIST_DRAG_BEFORE;
else if (clist->row_height - y_delta < h)
insert_pos = GTK_CLIST_DRAG_AFTER;
}
}
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
if (!dest_info)
@@ -7550,6 +7620,8 @@ gtk_clist_drag_motion (GtkWidget *widget,
drag_dest_info_destroy);
}
drag_dest_cell (clist, x, y, &new_info);
if (GTK_CLIST_REORDERABLE (clist))
{
GList *list;
@@ -7566,12 +7638,12 @@ gtk_clist_drag_motion (GtkWidget *widget,
if (list)
{
if (gtk_drag_get_source_widget (context) != widget ||
insert_pos == GTK_CLIST_DRAG_NONE ||
row == clist->click_cell.row ||
(row == clist->click_cell.row - 1 &&
insert_pos == GTK_CLIST_DRAG_AFTER) ||
(row == clist->click_cell.row + 1 &&
insert_pos == GTK_CLIST_DRAG_BEFORE))
new_info.insert_pos == GTK_CLIST_DRAG_NONE ||
new_info.cell.row == clist->click_cell.row ||
(new_info.cell.row == clist->click_cell.row - 1 &&
new_info.insert_pos == GTK_CLIST_DRAG_AFTER) ||
(new_info.cell.row == clist->click_cell.row + 1 &&
new_info.insert_pos == GTK_CLIST_DRAG_BEFORE))
{
if (dest_info->cell.row < 0)
{
@@ -7581,9 +7653,9 @@ gtk_clist_drag_motion (GtkWidget *widget,
return TRUE;
}
if (row != dest_info->cell.row ||
(row == dest_info->cell.row &&
dest_info->insert_pos != insert_pos))
if (new_info.cell.row != dest_info->cell.row ||
(new_info.cell.row == dest_info->cell.row &&
dest_info->insert_pos != new_info.insert_pos))
{
if (dest_info->cell.row >= 0)
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
@@ -7591,9 +7663,9 @@ gtk_clist_drag_motion (GtkWidget *widget,
dest_info->cell.row)->data,
dest_info->cell.row, dest_info->insert_pos);
dest_info->insert_pos = insert_pos;
dest_info->cell.row = row;
dest_info->cell.column = column;
dest_info->insert_pos = new_info.insert_pos;
dest_info->cell.row = new_info.cell.row;
dest_info->cell.column = new_info.cell.column;
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
(clist, g_list_nth (clist->row_list,
@@ -7606,9 +7678,9 @@ gtk_clist_drag_motion (GtkWidget *widget,
}
}
dest_info->insert_pos = insert_pos;
dest_info->cell.row = row;
dest_info->cell.column = column;
dest_info->insert_pos = new_info.insert_pos;
dest_info->cell.row = new_info.cell.row;
dest_info->cell.column = new_info.cell.column;
return TRUE;
}
@@ -7666,22 +7738,21 @@ gtk_clist_drag_data_received (GtkWidget *widget,
selection_data->length == sizeof (GtkCListCellInfo))
{
GtkCListCellInfo *source_info;
GtkCListDestInfo *dest_info;
source_info = (GtkCListCellInfo *)(selection_data->data);
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
if (dest_info && source_info)
if (source_info)
{
if (dest_info->insert_pos == GTK_CLIST_DRAG_AFTER)
dest_info->cell.row++;
if (source_info->row < dest_info->cell.row)
dest_info->cell.row--;
GtkCListDestInfo dest_info;
drag_dest_cell (clist, x, y, &dest_info);
if (dest_info.insert_pos == GTK_CLIST_DRAG_AFTER)
dest_info.cell.row++;
if (source_info->row < dest_info.cell.row)
dest_info.cell.row--;
if (dest_info.cell.row != source_info->row)
gtk_clist_row_move (clist, source_info->row, dest_info.cell.row);
if (dest_info->cell.row != source_info->row)
gtk_clist_row_move (GTK_CLIST (widget),
source_info->row,
dest_info->cell.row);
g_dataset_remove_data (context, "gtk-clist-drag-dest");
}
}
@@ -7708,21 +7779,18 @@ gtk_clist_drag_data_get (GtkWidget *widget,
if (info)
{
GtkCListCellInfo *ret_info;
GtkCListCellInfo ret_info;
ret_info = g_new (GtkCListCellInfo, 1);
ret_info->row = info->row;
ret_info->column = info->column;
ret_info.row = info->row;
ret_info.column = info->column;
gtk_selection_data_set (selection_data,
selection_data->target,
GTK_TYPE_POINTER,
(guchar *) ret_info,
gtk_selection_data_set (selection_data, selection_data->target,
GTK_TYPE_POINTER, (guchar *) &ret_info,
sizeof (GtkCListCellInfo));
}
else
gtk_selection_data_set (selection_data, selection_data->target,
GTK_TYPE_POINTER, NULL, 0);
GTK_TYPE_POINTER, NULL, 0);
}
}
+6 -6
View File
@@ -42,8 +42,7 @@ extern "C" {
#endif /* __cplusplus */
/* clist flags */
enum
{
enum {
GTK_CLIST_IN_DRAG = 1 << 0,
GTK_CLIST_ROW_HEIGHT_SET = 1 << 1,
GTK_CLIST_SHOW_TITLES = 1 << 2,
@@ -330,10 +329,11 @@ struct _GtkCListColumn
gint max_width;
GtkJustification justification;
guint visible : 1;
guint width_set : 1;
guint resizeable : 1;
guint auto_resize : 1;
guint visible : 1;
guint width_set : 1;
guint resizeable : 1;
guint auto_resize : 1;
guint button_passive : 1;
};
struct _GtkCListRow
+84 -25
View File
@@ -62,32 +62,34 @@
#define SAMPLE_HEIGHT 28
static void gtk_color_selection_class_init (GtkColorSelectionClass *klass);
static void gtk_color_selection_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_color_selection_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_color_selection_init (GtkColorSelection *colorsel);
static void gtk_color_selection_dialog_class_init(GtkColorSelectionDialogClass *klass);
static void gtk_color_selection_dialog_init(GtkColorSelectionDialog *colorseldiag);
static void gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass);
static void gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag);
enum
{
enum {
COLOR_CHANGED,
LAST_SIGNAL
};
enum
{
enum {
RGB_INPUTS = 1 << 0,
HSV_INPUTS = 1 << 1,
OPACITY_INPUTS = 1 << 2
};
enum
{
enum {
SCALE,
ENTRY,
BOTH
};
enum
{
enum {
HUE,
SATURATION,
VALUE,
@@ -98,6 +100,12 @@ enum
NUM_CHANNELS
};
enum {
ARG_0,
ARG_UPDATE_POLICY,
ARG_USE_OPACITY
};
typedef struct
{
gchar *label;
@@ -219,10 +227,10 @@ static const scale_val_type scale_vals[NUM_CHANNELS] =
{N_("Opacity:"), 0.0, 1.0, 0.01, 0.01, (SF) gtk_color_selection_opacity_updater}
};
guint
GtkType
gtk_color_selection_get_type (void)
{
static guint color_selection_type = 0;
static GtkType color_selection_type = 0;
if (!color_selection_type)
{
@@ -238,7 +246,7 @@ gtk_color_selection_get_type (void)
(GtkClassInitFunc) NULL,
};
color_selection_type = gtk_type_unique (gtk_vbox_get_type (), &colorsel_info);
color_selection_type = gtk_type_unique (GTK_TYPE_VBOX, &colorsel_info);
}
return color_selection_type;
@@ -255,8 +263,13 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
widget_class = (GtkWidgetClass*) klass;
container_class = (GtkContainerClass*) klass;
color_selection_parent_class = gtk_type_class (gtk_vbox_get_type ());
color_selection_parent_class = gtk_type_class (GTK_TYPE_VBOX);
gtk_object_add_arg_type ("GtkColorSelection::policy", GTK_TYPE_UPDATE_TYPE,
GTK_ARG_READWRITE, ARG_UPDATE_POLICY);
gtk_object_add_arg_type ("GtkColorSelection::use_opacity", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_USE_OPACITY);
color_selection_signals[COLOR_CHANGED] =
gtk_signal_new ("color_changed",
GTK_RUN_FIRST,
@@ -266,6 +279,8 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
gtk_object_class_add_signals (object_class, color_selection_signals, LAST_SIGNAL);
object_class->set_arg = gtk_color_selection_set_arg;
object_class->get_arg = gtk_color_selection_get_arg;
object_class->finalize = gtk_color_selection_finalize;
widget_class->realize = gtk_color_selection_realize;
@@ -440,17 +455,57 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
}
colorsel->opacity_label = label;
gtk_widget_show (table);
gtk_widget_show (hbox);
}
GtkWidget *
static void
gtk_color_selection_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkColorSelection *color_selection = GTK_COLOR_SELECTION (object);
switch (arg_id)
{
case ARG_UPDATE_POLICY:
gtk_color_selection_set_update_policy (color_selection, GTK_VALUE_ENUM (*arg));
break;
case ARG_USE_OPACITY:
gtk_color_selection_set_opacity (color_selection, GTK_VALUE_BOOL (*arg));
break;
}
}
static void
gtk_color_selection_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkColorSelection *color_selection;
color_selection = GTK_COLOR_SELECTION (object);
switch (arg_id)
{
case ARG_UPDATE_POLICY:
GTK_VALUE_ENUM (*arg) = color_selection->policy;
break;
case ARG_USE_OPACITY:
GTK_VALUE_BOOL (*arg) = color_selection->use_opacity;
break;
default:
break;
}
}
GtkWidget*
gtk_color_selection_new (void)
{
GtkColorSelection *colorsel;
colorsel = gtk_type_new (gtk_color_selection_get_type ());
colorsel = gtk_type_new (GTK_TYPE_COLOR_SELECTION);
return GTK_WIDGET (colorsel);
}
@@ -1145,10 +1200,14 @@ gtk_color_selection_wheel_timeout (GtkColorSelection *colorsel)
{
gint x, y;
GDK_THREADS_ENTER ();
gdk_window_get_pointer (colorsel->wheel_area->window, &x, &y, NULL);
gtk_color_selection_update_wheel (colorsel, x, y);
gtk_color_selection_color_changed (colorsel);
GDK_THREADS_LEAVE ();
return (TRUE);
}
@@ -1255,7 +1314,7 @@ gtk_color_selection_draw_value_bar (GtkColorSelection *colorsel,
}
v = 1.0;
sv = 1.0 / (gdouble) (heig - 1);
sv = 1.0 / (gdouble) MAX (heig - 1, 0);
for (y = 0; y < heig; y++)
{
@@ -1599,10 +1658,10 @@ gtk_color_selection_rgb_to_hsv (gdouble r, gdouble g, gdouble b,
/* GtkColorSelectionDialog */
/***************************/
guint
GtkType
gtk_color_selection_dialog_get_type (void)
{
static guint color_selection_dialog_type = 0;
static GtkType color_selection_dialog_type = 0;
if (!color_selection_dialog_type)
{
@@ -1618,7 +1677,7 @@ gtk_color_selection_dialog_get_type (void)
(GtkClassInitFunc) NULL,
};
color_selection_dialog_type = gtk_type_unique (gtk_window_get_type (), &colorsel_diag_info);
color_selection_dialog_type = gtk_type_unique (GTK_TYPE_WINDOW, &colorsel_diag_info);
}
return color_selection_dialog_type;
@@ -1631,7 +1690,7 @@ gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
object_class = (GtkObjectClass*) klass;
color_selection_dialog_parent_class = gtk_type_class (gtk_window_get_type ());
color_selection_dialog_parent_class = gtk_type_class (GTK_TYPE_WINDOW);
}
static void
@@ -1685,12 +1744,12 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
gtk_widget_pop_visual ();
}
GtkWidget *
GtkWidget*
gtk_color_selection_dialog_new (const gchar *title)
{
GtkColorSelectionDialog *colorseldiag;
colorseldiag = gtk_type_new (gtk_color_selection_dialog_get_type ());
colorseldiag = gtk_type_new (GTK_TYPE_COLOR_SELECTION_DIALOG);
gtk_window_set_title (GTK_WINDOW (colorseldiag), title);
return GTK_WIDGET (colorseldiag);
+12 -9
View File
@@ -50,14 +50,17 @@ extern "C" {
#endif /* __cplusplus */
#define GTK_COLOR_SELECTION(obj) GTK_CHECK_CAST (obj, gtk_color_selection_get_type (), GtkColorSelection)
#define GTK_COLOR_SELECTION_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_get_type (), GtkColorSelectionClass)
#define GTK_IS_COLOR_SELECTION(obj) GTK_CHECK_TYPE (obj, gtk_color_selection_get_type ())
#define GTK_COLOR_SELECTION_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialog)
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialogClass)
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_color_selection_dialog_get_type ())
#define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ())
#define GTK_COLOR_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection))
#define GTK_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
#define GTK_IS_COLOR_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
#define GTK_IS_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION))
#define GTK_TYPE_COLOR_SELECTION_DIALOG (gtk_color_selection_dialog_get_type ())
#define GTK_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialog))
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass))
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG))
#define GTK_IS_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG))
typedef struct _GtkColorSelection GtkColorSelection;
typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
@@ -122,7 +125,7 @@ struct _GtkColorSelectionDialogClass
/* ColorSelection */
guint gtk_color_selection_get_type (void);
GtkType gtk_color_selection_get_type (void);
GtkWidget* gtk_color_selection_new (void);
@@ -140,7 +143,7 @@ void gtk_color_selection_get_color (GtkColorSelection *colorse
/* ColorSelectionDialog */
guint gtk_color_selection_dialog_get_type (void);
GtkType gtk_color_selection_dialog_get_type (void);
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
+8 -21
View File
@@ -264,6 +264,8 @@ gtk_container_add_with_args (GtkContainer *container,
gtk_widget_ref (GTK_WIDGET (container));
gtk_widget_ref (widget);
if (!GTK_OBJECT_CONSTRUCTED (widget))
gtk_object_default_construct (GTK_OBJECT (widget));
gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
if (widget->parent)
@@ -322,6 +324,8 @@ gtk_container_addv (GtkContainer *container,
gtk_widget_ref (GTK_WIDGET (container));
gtk_widget_ref (widget);
if (!GTK_OBJECT_CONSTRUCTED (widget))
gtk_object_default_construct (GTK_OBJECT (widget));
gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
if (widget->parent)
@@ -703,6 +707,8 @@ gtk_container_add (GtkContainer *container,
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (widget->parent == NULL);
if (!GTK_OBJECT_CONSTRUCTED (widget))
gtk_object_default_construct (GTK_OBJECT (widget));
gtk_signal_emit (GTK_OBJECT (container), container_signals[ADD], widget);
}
@@ -729,11 +735,6 @@ gtk_container_clear_resize_widgets (GtkContainer *container)
node = container->resize_widgets;
if (node)
gtk_signal_disconnect_by_func (GTK_OBJECT (container),
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
NULL);
while (node)
{
GtkWidget *widget = node->data;
@@ -854,29 +855,19 @@ gtk_container_queue_resize (GtkContainer *container)
}
GTK_PRIVATE_SET_FLAG (container, GTK_RESIZE_NEEDED);
if (!resize_container->resize_widgets)
gtk_signal_connect (GTK_OBJECT (resize_container),
"size_allocate",
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
NULL);
resize_container->resize_widgets =
g_slist_prepend (resize_container->resize_widgets, container);
break;
case GTK_RESIZE_IMMEDIATE:
GTK_PRIVATE_SET_FLAG (container, GTK_RESIZE_NEEDED);
if (!resize_container->resize_widgets)
gtk_signal_connect (GTK_OBJECT (resize_container),
"size_allocate",
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
NULL);
resize_container->resize_widgets =
g_slist_prepend (resize_container->resize_widgets, container);
gtk_container_check_resize (resize_container);
break;
case GTK_RESIZE_PARENT:
/* Ignore */
/* Ignore, should not be reached */
break;
}
}
@@ -884,7 +875,7 @@ gtk_container_queue_resize (GtkContainer *container)
{
/* We need to let hidden toplevels know that something
* changed while they where hidden. For other resize containers,
* they will get resized when they are shown.
* they will get resized after they are shown.
*/
if (GTK_WIDGET_TOPLEVEL (resize_container))
gtk_container_check_resize (resize_container);
@@ -1000,10 +991,6 @@ gtk_container_resize_children (GtkContainer *container)
* is insufficient, since we don't need to reallocate below that.
*/
resize_widgets = container->resize_widgets;
if (resize_widgets)
gtk_signal_disconnect_by_func (GTK_OBJECT (container),
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
NULL);
container->resize_widgets = NULL;
for (node = resize_widgets; node; node = node->next)
{
+99 -86
View File
@@ -294,6 +294,10 @@ static void gtk_ctree_drag_data_received (GtkWidget *widget,
guint info,
guint32 time);
static void remove_grab (GtkCList *clist);
static void drag_dest_cell (GtkCList *clist,
gint x,
gint y,
GtkCListDestInfo *dest_info);
enum
@@ -988,8 +992,12 @@ draw_cell_pixmap (GdkWindow *window,
if (width > 0 && height > 0)
gdk_draw_pixmap (window, fg_gc, pixmap, xsrc, ysrc, x, y, width, height);
gdk_gc_set_clip_origin (fg_gc, 0, 0);
if (mask)
{
gdk_gc_set_clip_rectangle (fg_gc, NULL);
gdk_gc_set_clip_origin (fg_gc, 0, 0);
}
return x + MAX (width, 0);
}
@@ -3065,24 +3073,7 @@ tree_delete (GtkCTree *ctree,
GtkCTreeNode *node,
gpointer data)
{
GtkCList *clist;
clist = GTK_CLIST (ctree);
if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED)
{
GList *work;
work = g_list_find (clist->selection, node);
if (work)
{
if (clist->selection_end && clist->selection_end == work)
clist->selection_end = clist->selection_end->prev;
clist->selection = g_list_remove_link (clist->selection, work);
g_list_free_1 (work);
}
}
tree_unselect (ctree, node, NULL);
row_delete (ctree, GTK_CTREE_ROW (node));
g_list_free_1 ((GList *)node);
}
@@ -5729,8 +5720,8 @@ resync_selection (GtkCList *clist, GdkEvent *event)
}
}
for (list = g_list_reverse (clist->undo_unselection); list;
list = list->next)
clist->undo_unselection = g_list_reverse (clist->undo_unselection);
for (list = clist->undo_unselection; list; list = list->next)
gtk_ctree_select (ctree, list->data);
clist->anchor = -1;
@@ -5860,6 +5851,63 @@ drag_dest_info_destroy (gpointer data)
g_free (info);
}
static void
drag_dest_cell (GtkCList *clist,
gint x,
gint y,
GtkCListDestInfo *dest_info)
{
GtkWidget *widget;
widget = GTK_WIDGET (clist);
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
y -= (GTK_CONTAINER (widget)->border_width +
widget->style->klass->ythickness + clist->column_title_area.height);
dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
if (dest_info->cell.row >= clist->rows)
{
dest_info->cell.row = clist->rows - 1;
y = ROW_TOP_YPIXEL (clist, dest_info->cell.row) + clist->row_height;
}
if (dest_info->cell.row < -1)
dest_info->cell.row = -1;
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
if (dest_info->cell.row >= 0)
{
gint y_delta;
gint h = 0;
y_delta = y - ROW_TOP_YPIXEL (clist, dest_info->cell.row);
if (GTK_CLIST_DRAW_DRAG_RECT(clist) &&
!GTK_CTREE_ROW (g_list_nth (clist->row_list,
dest_info->cell.row))->is_leaf)
{
dest_info->insert_pos = GTK_CLIST_DRAG_INTO;
h = clist->row_height / 4;
}
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
h = clist->row_height / 2;
}
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
if (y_delta < h)
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
else if (clist->row_height - y_delta < h)
dest_info->insert_pos = GTK_CLIST_DRAG_AFTER;
}
}
}
static void
gtk_ctree_drag_begin (GtkWidget *widget,
GdkDragContext *context)
@@ -5915,11 +5963,8 @@ gtk_ctree_drag_motion (GtkWidget *widget,
{
GtkCList *clist;
GtkCTree *ctree;
gint row, column;
GtkCListDestInfo new_info;
GtkCListDestInfo *dest_info;
gint h = 0;
gint insert_pos = GTK_CLIST_DRAG_NONE;
gint y_delta;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CTREE (widget), FALSE);
@@ -5927,45 +5972,6 @@ gtk_ctree_drag_motion (GtkWidget *widget,
clist = GTK_CLIST (widget);
ctree = GTK_CTREE (widget);
y -= (GTK_CONTAINER (widget)->border_width +
widget->style->klass->ythickness + clist->column_title_area.height);
row = ROW_FROM_YPIXEL (clist, y);
if (row >= clist->rows)
{
row = clist->rows - 1;
y = ROW_TOP_YPIXEL (clist, row) + clist->row_height;
}
if (row < -1)
row = -1;
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
column = COLUMN_FROM_XPIXEL (clist, x);
if (row >= 0)
{
y_delta = y - ROW_TOP_YPIXEL (clist, row);
if (GTK_CLIST_DRAW_DRAG_RECT(clist))
{
insert_pos = GTK_CLIST_DRAG_INTO;
h = clist->row_height / 4;
}
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
insert_pos = GTK_CLIST_DRAG_BEFORE;
h = clist->row_height / 2;
}
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
{
if (y_delta < h)
insert_pos = GTK_CLIST_DRAG_BEFORE;
else if (clist->row_height - y_delta < h)
insert_pos = GTK_CLIST_DRAG_AFTER;
}
}
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
if (!dest_info)
@@ -5980,6 +5986,8 @@ gtk_ctree_drag_motion (GtkWidget *widget,
drag_dest_info_destroy);
}
drag_dest_cell (clist, x, y, &new_info);
if (GTK_CLIST_REORDERABLE (clist))
{
GList *list;
@@ -6000,10 +6008,12 @@ gtk_ctree_drag_motion (GtkWidget *widget,
drag_source = GTK_CTREE_NODE (g_list_nth (clist->row_list,
clist->click_cell.row));
drag_target = GTK_CTREE_NODE (g_list_nth (clist->row_list, row));
drag_target = GTK_CTREE_NODE (g_list_nth (clist->row_list,
new_info.cell.row));
if (gtk_drag_get_source_widget (context) != widget ||
!check_drag (ctree, drag_source, drag_target, insert_pos))
!check_drag (ctree, drag_source, drag_target,
new_info.insert_pos))
{
if (dest_info->cell.row < 0)
{
@@ -6013,9 +6023,9 @@ gtk_ctree_drag_motion (GtkWidget *widget,
return TRUE;
}
if (row != dest_info->cell.row ||
(row == dest_info->cell.row &&
dest_info->insert_pos != insert_pos))
if (new_info.cell.row != dest_info->cell.row ||
(new_info.cell.row == dest_info->cell.row &&
dest_info->insert_pos != new_info.insert_pos))
{
if (dest_info->cell.row >= 0)
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
@@ -6023,9 +6033,9 @@ gtk_ctree_drag_motion (GtkWidget *widget,
g_list_nth (clist->row_list, dest_info->cell.row)->data,
dest_info->cell.row, dest_info->insert_pos);
dest_info->insert_pos = insert_pos;
dest_info->cell.row = row;
dest_info->cell.column = column;
dest_info->insert_pos = new_info.insert_pos;
dest_info->cell.row = new_info.cell.row;
dest_info->cell.column = new_info.cell.column;
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
(clist,
@@ -6038,9 +6048,9 @@ gtk_ctree_drag_motion (GtkWidget *widget,
}
}
dest_info->insert_pos = insert_pos;
dest_info->cell.row = row;
dest_info->cell.column = column;
dest_info->insert_pos = new_info.insert_pos;
dest_info->cell.row = new_info.cell.row;
dest_info->cell.column = new_info.cell.column;
return TRUE;
}
@@ -6072,45 +6082,48 @@ gtk_ctree_drag_data_received (GtkWidget *widget,
selection_data->length == sizeof (GtkCListCellInfo))
{
GtkCListCellInfo *source_info;
GtkCListDestInfo *dest_info;
source_info = (GtkCListCellInfo *)(selection_data->data);
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
if (dest_info && source_info)
if (source_info)
{
GtkCListDestInfo dest_info;
GtkCTreeNode *source_node;
GtkCTreeNode *dest_node;
drag_dest_cell (clist, x, y, &dest_info);
source_node = GTK_CTREE_NODE (g_list_nth (clist->row_list,
source_info->row));
dest_node = GTK_CTREE_NODE (g_list_nth (clist->row_list,
dest_info->cell.row));
dest_info.cell.row));
if (!source_info || !dest_info)
if (!source_node || !dest_node)
return;
switch (dest_info->insert_pos)
switch (dest_info.insert_pos)
{
case GTK_CLIST_DRAG_NONE:
break;
case GTK_CLIST_DRAG_INTO:
g_print ("drag into\n");
if (check_drag (ctree, source_node, dest_node,
dest_info->insert_pos))
dest_info.insert_pos))
gtk_ctree_move (ctree, source_node, dest_node,
GTK_CTREE_ROW (dest_node)->children);
g_dataset_remove_data (context, "gtk-clist-drag-dest");
break;
case GTK_CLIST_DRAG_BEFORE:
g_print ("drag before\n");
if (check_drag (ctree, source_node, dest_node,
dest_info->insert_pos))
dest_info.insert_pos))
gtk_ctree_move (ctree, source_node,
GTK_CTREE_ROW (dest_node)->parent, dest_node);
g_dataset_remove_data (context, "gtk-clist-drag-dest");
break;
case GTK_CLIST_DRAG_AFTER:
g_print ("drag after\n");
if (check_drag (ctree, source_node, dest_node,
dest_info->insert_pos))
dest_info.insert_pos))
gtk_ctree_move (ctree, source_node,
GTK_CTREE_ROW (dest_node)->parent,
GTK_CTREE_ROW (dest_node)->sibling);
+96 -7
View File
@@ -46,6 +46,15 @@
GDK_BUTTON_RELEASE_MASK | \
GDK_BUTTON1_MOTION_MASK)
enum {
ARG_0,
ARG_CURVE_TYPE,
ARG_MIN_X,
ARG_MAX_X,
ARG_MIN_Y,
ARG_MAX_Y
};
static GtkDrawingAreaClass *parent_class = NULL;
static guint curve_type_changed_signal = 0;
@@ -53,6 +62,12 @@ static guint curve_type_changed_signal = 0;
/* forward declarations: */
static void gtk_curve_class_init (GtkCurveClass *class);
static void gtk_curve_init (GtkCurve *curve);
static void gtk_curve_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_curve_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_curve_finalize (GtkObject *object);
static gint gtk_curve_graph_events (GtkWidget *widget,
GdkEvent *event,
@@ -78,7 +93,7 @@ gtk_curve_get_type (void)
(GtkClassInitFunc) NULL,
};
curve_type = gtk_type_unique (gtk_drawing_area_get_type (), &curve_info);
curve_type = gtk_type_unique (GTK_TYPE_DRAWING_AREA, &curve_info);
}
return curve_type;
}
@@ -87,18 +102,31 @@ static void
gtk_curve_class_init (GtkCurveClass *class)
{
GtkObjectClass *object_class;
parent_class = gtk_type_class (gtk_drawing_area_get_type ());
parent_class = gtk_type_class (GTK_TYPE_DRAWING_AREA);
object_class = (GtkObjectClass *) class;
object_class->set_arg = gtk_curve_set_arg;
object_class->get_arg = gtk_curve_get_arg;
object_class->finalize = gtk_curve_finalize;
curve_type_changed_signal =
gtk_signal_new ("curve_type_changed", GTK_RUN_FIRST, object_class->type,
GTK_SIGNAL_OFFSET (GtkCurveClass, curve_type_changed),
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, &curve_type_changed_signal, 1);
object_class->finalize = gtk_curve_finalize;
gtk_object_add_arg_type ("GtkCurve::curve_type", GTK_TYPE_CURVE_TYPE,
GTK_ARG_READWRITE, ARG_CURVE_TYPE);
gtk_object_add_arg_type ("GtkCurve::min_x", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_MIN_X);
gtk_object_add_arg_type ("GtkCurve::max_x", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_MAX_X);
gtk_object_add_arg_type ("GtkCurve::min_y", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_MIN_Y);
gtk_object_add_arg_type ("GtkCurve::max_y", GTK_TYPE_FLOAT,
GTK_ARG_READWRITE, ARG_MAX_Y);
}
static void
@@ -130,6 +158,67 @@ gtk_curve_init (GtkCurve *curve)
gtk_curve_size_graph (curve);
}
static void
gtk_curve_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkCurve *curve = GTK_CURVE (object);
switch (arg_id)
{
case ARG_CURVE_TYPE:
gtk_curve_set_curve_type (curve, GTK_VALUE_ENUM (*arg));
break;
case ARG_MIN_X:
gtk_curve_set_range (curve, GTK_VALUE_FLOAT (*arg), curve->max_x,
curve->min_y, curve->max_y);
break;
case ARG_MAX_X:
gtk_curve_set_range (curve, curve->min_x, GTK_VALUE_FLOAT (*arg),
curve->min_y, curve->max_y);
break;
case ARG_MIN_Y:
gtk_curve_set_range (curve, curve->min_x, curve->max_x,
GTK_VALUE_FLOAT (*arg), curve->max_y);
break;
case ARG_MAX_Y:
gtk_curve_set_range (curve, curve->min_x, curve->max_x,
curve->min_y, GTK_VALUE_FLOAT (*arg));
break;
}
}
static void
gtk_curve_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkCurve *curve = GTK_CURVE (object);
switch (arg_id)
{
case ARG_CURVE_TYPE:
GTK_VALUE_ENUM (*arg) = curve->curve_type;
break;
case ARG_MIN_X:
GTK_VALUE_FLOAT (*arg) = curve->min_x;
break;
case ARG_MAX_X:
GTK_VALUE_FLOAT (*arg) = curve->max_x;
break;
case ARG_MIN_Y:
GTK_VALUE_FLOAT (*arg) = curve->min_y;
break;
case ARG_MAX_Y:
GTK_VALUE_FLOAT (*arg) = curve->max_y;
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
static int
project (gfloat value, gfloat min, gfloat max, int norm)
{
+267 -117
View File
@@ -25,6 +25,7 @@
*/
#include "gdk/gdkx.h"
#include "gdk/gdkkeysyms.h"
#include "gtkdnd.h"
#include "gtkinvisible.h"
@@ -228,9 +229,16 @@ static void gtk_drag_selection_get (GtkWidget *widget,
static gint gtk_drag_anim_timeout (gpointer data);
static void gtk_drag_remove_icon (GtkDragSourceInfo *info);
static void gtk_drag_source_info_destroy (gpointer data);
static void gtk_drag_update (GtkDragSourceInfo *info,
gint x_root,
gint y_root,
GdkEvent *event);
static gint gtk_drag_motion_cb (GtkWidget *widget,
GdkEventMotion *event,
gpointer data);
static gint gtk_drag_key_cb (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
static gint gtk_drag_button_release_cb (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
@@ -416,6 +424,43 @@ gtk_drag_release_ipc_widget (GtkWidget *widget)
drag_widgets = g_slist_prepend (drag_widgets, widget);
}
static guint32
gtk_drag_get_event_time (GdkEvent *event)
{
guint32 tm = GDK_CURRENT_TIME;
if (event)
switch (event->type)
{
case GDK_MOTION_NOTIFY:
tm = event->motion.time; break;
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
tm = event->button.time; break;
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
tm = event->key.time; break;
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
tm = event->crossing.time; break;
case GDK_PROPERTY_NOTIFY:
tm = event->property.time; break;
case GDK_SELECTION_CLEAR:
case GDK_SELECTION_REQUEST:
case GDK_SELECTION_NOTIFY:
tm = event->selection.time; break;
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT:
tm = event->proximity.time; break;
default: /* use current time */
break;
}
return tm;
}
static void
gtk_drag_get_event_actions (GdkEvent *event,
gint button,
@@ -744,10 +789,10 @@ void
gtk_drag_highlight (GtkWidget *widget)
{
gtk_signal_connect_after (GTK_OBJECT (widget), "draw",
GTK_SIGNAL_FUNC (gtk_drag_highlight_expose),
GTK_SIGNAL_FUNC (gtk_drag_highlight_paint),
NULL);
gtk_signal_connect (GTK_OBJECT (widget), "expose_event",
GTK_SIGNAL_FUNC (gtk_drag_highlight_paint),
GTK_SIGNAL_FUNC (gtk_drag_highlight_expose),
NULL);
gtk_widget_queue_draw (widget);
@@ -953,7 +998,17 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
gint tx, ty;
if (event->type == GDK_DROP_START)
info->dropped = TRUE;
{
info->dropped = TRUE;
/* We send a leave here so that the widget unhighlights
* properly.
*/
if (info->widget)
{
gtk_drag_dest_leave (info->widget, context, event->dnd.time);
info->widget = NULL;
}
}
gdk_window_get_origin (toplevel->window, &tx, &ty);
@@ -969,11 +1024,7 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
gtk_drag_find_widget (toplevel, &data);
/* We send a leave here so that the widget unhighlights
* properly
*/
if (info->widget &&
((event->type == GDK_DROP_START) || (!data.found)))
if (info->widget && !data.found)
{
gtk_drag_dest_leave (info->widget, context, event->dnd.time);
info->widget = NULL;
@@ -986,7 +1037,7 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
if (!data.found)
gdk_drag_status (context, 0, event->dnd.time);
}
else if (event->type == GDK_DROP_START)
else if (event->type == GDK_DROP_START && !info->proxy_source)
{
gdk_drop_reply (context, data.found, event->dnd.time);
if ((context->protocol == GDK_DRAG_PROTO_MOTIF) && !data.found)
@@ -1332,7 +1383,7 @@ gtk_drag_dest_leave (GtkWidget *widget,
}
else
{
if (site->flags & GTK_DEST_DEFAULT_HIGHLIGHT)
if ((site->flags & GTK_DEST_DEFAULT_HIGHLIGHT) && site->have_drag)
gtk_drag_unhighlight (widget);
if (!(site->flags & GTK_DEST_DEFAULT_MOTION) || site->have_drag)
@@ -1645,16 +1696,6 @@ gtk_drag_begin (GtkWidget *widget,
gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_begin",
info->context);
/* We use a GTK grab here to override any grabs that the widget
* we are dragging from might have held
*/
gtk_grab_add (info->ipc_widget);
gdk_pointer_grab (info->ipc_widget->window, FALSE,
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_RELEASE_MASK, NULL,
info->cursor, time);
if (event->type == GDK_MOTION_NOTIFY)
gtk_drag_motion_cb (info->ipc_widget, (GdkEventMotion *)event, info);
@@ -1665,9 +1706,37 @@ gtk_drag_begin (GtkWidget *widget,
GTK_SIGNAL_FUNC (gtk_drag_button_release_cb), info);
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "motion_notify_event",
GTK_SIGNAL_FUNC (gtk_drag_motion_cb), info);
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "key_press_event",
GTK_SIGNAL_FUNC (gtk_drag_key_cb), info);
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "key_release_event",
GTK_SIGNAL_FUNC (gtk_drag_key_cb), info);
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "selection_get",
GTK_SIGNAL_FUNC (gtk_drag_selection_get), info);
/* We use a GTK grab here to override any grabs that the widget
* we are dragging from might have held
*/
gtk_grab_add (info->ipc_widget);
if (gdk_pointer_grab (info->ipc_widget->window, FALSE,
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_RELEASE_MASK, NULL,
info->cursor, time) == 0)
{
if (gdk_keyboard_grab (info->ipc_widget->window, FALSE, time) != 0)
{
/* FIXME: This should be cleaned up... */
GdkEventButton ev;
ev.time = time;
ev.type = GDK_BUTTON_RELEASE;
ev.button = info->button;
gtk_drag_button_release_cb (widget, &ev, info);
return NULL;
}
}
return info->context;
}
@@ -1937,7 +2006,7 @@ gtk_drag_set_icon_default (GdkDragContext *context)
gdk_pixmap_colormap_create_from_xpm_d (NULL,
default_icon_colormap,
&default_icon_mask,
NULL, drag_default_xpm);
NULL, (gchar **)drag_default_xpm);
default_icon_hot_x = -2;
default_icon_hot_y = -2;
}
@@ -2032,8 +2101,14 @@ gtk_drag_source_handle_event (GtkWidget *widget,
{
if (info->proxy_dest->proxy_drop_wait)
{
gboolean result = context->action != 0;
/* Aha - we can finally pass the MOTIF DROP on... */
gdk_drag_drop (info->context, info->proxy_dest->proxy_drop_time);
gdk_drop_reply (info->proxy_dest->context, result, info->proxy_dest->proxy_drop_time);
if (result)
gdk_drag_drop (info->context, info->proxy_dest->proxy_drop_time);
else
gtk_drag_finish (info->proxy_dest->context, FALSE, FALSE, info->proxy_dest->proxy_drop_time);
}
else
{
@@ -2057,9 +2132,9 @@ gtk_drag_source_handle_event (GtkWidget *widget,
if (info->last_event)
{
gtk_drag_motion_cb (info->widget,
(GdkEventMotion *)info->last_event,
info);
gtk_drag_update (info,
info->cur_x, info->cur_y,
info->last_event);
info->last_event = NULL;
}
}
@@ -2498,6 +2573,124 @@ gtk_drag_source_info_destroy (gpointer data)
g_free (info);
}
/*************************************************************
* gtk_drag_update:
* Function to update the status of the drag when the
* cursor moves or the modifier changes
* arguments:
* info: DragSourceInfo for the drag
* x_root, y_root: position of darg
* event: The event that triggered this call
* results:
*************************************************************/
static void
gtk_drag_update (GtkDragSourceInfo *info,
gint x_root,
gint y_root,
GdkEvent *event)
{
GdkDragAction action;
GdkDragAction possible_actions;
GdkWindow *window = NULL;
GdkWindow *dest_window;
GdkDragProtocol protocol;
GdkAtom selection;
guint32 time = gtk_drag_get_event_time (event);
gtk_drag_get_event_actions (event,
info->button,
info->possible_actions,
&action, &possible_actions);
info->cur_x = x_root;
info->cur_y = y_root;
if (info->icon_window)
{
gdk_window_raise (info->icon_window->window);
gtk_widget_set_uposition (info->icon_window,
info->cur_x - info->hot_x,
info->cur_y - info->hot_y);
window = info->icon_window->window;
}
gdk_drag_find_window (info->context,
window, x_root, y_root,
&dest_window, &protocol);
if (gdk_drag_motion (info->context, dest_window, protocol,
x_root, y_root, action,
possible_actions,
time))
{
if (info->last_event)
gdk_event_free ((GdkEvent *)info->last_event);
info->last_event = gdk_event_copy ((GdkEvent *)event);
}
if (dest_window)
gdk_window_unref (dest_window);
selection = gdk_drag_get_selection (info->context);
if (selection)
gtk_drag_source_check_selection (info, selection, time);
}
/*************************************************************
* gtk_drag_end:
* Called when the user finishes to drag, either by
* releasing the mouse, or by pressing Esc.
* arguments:
* widget: GtkInvisible widget for this drag
* info:
* results:
*************************************************************/
static void
gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
{
GdkEvent send_event;
GtkWidget *source_widget = info->widget;
gdk_pointer_ungrab (time);
gdk_keyboard_ungrab (time);
gtk_grab_remove (info->ipc_widget);
gtk_signal_disconnect_by_func (GTK_OBJECT (info->ipc_widget),
GTK_SIGNAL_FUNC (gtk_drag_button_release_cb),
info);
gtk_signal_disconnect_by_func (GTK_OBJECT (info->ipc_widget),
GTK_SIGNAL_FUNC (gtk_drag_motion_cb),
info);
/* Send on a release pair to the the original
* widget to convince it to release its grab. We need to
* call gtk_propagate_event() here, instead of
* gtk_widget_event() because widget like GtkList may
* expect propagation.
*/
send_event.button.type = GDK_BUTTON_RELEASE;
send_event.button.window = GDK_ROOT_PARENT ();
send_event.button.send_event = TRUE;
send_event.button.time = time;
send_event.button.x = 0;
send_event.button.y = 0;
send_event.button.pressure = 0.;
send_event.button.xtilt = 0.;
send_event.button.ytilt = 0.;
send_event.button.state = 0;
send_event.button.button = info->button;
send_event.button.source = GDK_SOURCE_PEN;
send_event.button.deviceid = GDK_CORE_POINTER;
send_event.button.x_root = 0;
send_event.button.y_root = 0;
gtk_propagate_event (source_widget, &send_event);
}
/*************************************************************
* gtk_drag_motion_cb:
* "motion_notify_event" callback during drag.
@@ -2512,12 +2705,6 @@ gtk_drag_motion_cb (GtkWidget *widget,
gpointer data)
{
GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
GdkAtom selection;
GdkDragAction action;
GdkDragAction possible_actions;
GdkWindow *window = NULL;
GdkWindow *dest_window;
GdkDragProtocol protocol;
gint x_root, y_root;
if (event->is_hint)
@@ -2527,57 +2714,55 @@ gtk_drag_motion_cb (GtkWidget *widget,
event->y_root = y_root;
}
gtk_drag_get_event_actions ((GdkEvent *)event,
info->button,
info->possible_actions,
&action, &possible_actions);
info->cur_x = event->x_root;
info->cur_y = event->y_root;
if (info->icon_window)
{
gdk_window_raise (info->icon_window->window);
gtk_widget_set_uposition (info->icon_window,
info->cur_x - info->hot_x,
info->cur_y - info->hot_y);
window = info->icon_window->window;
}
gdk_drag_find_window (info->context,
window, event->x_root, event->y_root,
&dest_window, &protocol);
if (gdk_drag_motion (info->context, dest_window, protocol,
event->x_root, event->y_root, action,
possible_actions,
event->time))
{
if (info->last_event)
gdk_event_free ((GdkEvent *)info->last_event);
info->last_event = gdk_event_copy ((GdkEvent *)event);
}
if (dest_window)
gdk_window_unref (dest_window);
selection = gdk_drag_get_selection (info->context);
if (selection)
gtk_drag_source_check_selection (info, selection, event->time);
#if 0
/* We ignore the response, so we can respond precisely to the drop
*/
if (event->is_hint)
gdk_window_get_pointer (widget->window, NULL, NULL, NULL);
#endif
gtk_drag_update (info, event->x_root, event->y_root, (GdkEvent *)event);
return TRUE;
}
/*************************************************************
* gtk_drag_motion_cb:
* gtk_drag_key_cb:
* "key_press/release_event" callback during drag.
* arguments:
*
* results:
*************************************************************/
static gint
gtk_drag_key_cb (GtkWidget *widget,
GdkEventKey *event,
gpointer data)
{
GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
GdkModifierType state;
if (event->type == GDK_KEY_PRESS)
{
if (event->keyval == GDK_Escape)
{
gtk_drag_end (info, event->time);
gdk_drag_abort (info->context, event->time);
gtk_drag_drop_finished (info, FALSE, event->time);
return TRUE;
}
}
/* Now send a "motion" so that the modifier state is updated */
/* The state is not yet updated in the event, so we need
* to query it here. We could use XGetModifierMapping, but
* that would be overkill.
*/
gdk_window_get_pointer (GDK_ROOT_PARENT(), NULL, NULL, &state);
event->state = state;
gtk_drag_update (info, info->cur_x, info->cur_y, (GdkEvent *)event);
return TRUE;
}
/*************************************************************
* gtk_drag_button_release_cb:
* "button_release_event" callback during drag.
* arguments:
*
@@ -2590,23 +2775,11 @@ gtk_drag_button_release_cb (GtkWidget *widget,
gpointer data)
{
GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
GtkWidget *source_widget = info->widget;
GdkEvent send_event;
gtk_widget_ref (source_widget);
if (event->button != info->button)
return FALSE;
gdk_pointer_ungrab (event->time);
gtk_grab_remove (widget);
gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
GTK_SIGNAL_FUNC (gtk_drag_button_release_cb),
info);
gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
GTK_SIGNAL_FUNC (gtk_drag_motion_cb),
info);
gtk_drag_end (info, event->time);
if ((info->context->action != 0) && (info->context->dest_window != NULL))
{
@@ -2618,33 +2791,6 @@ gtk_drag_button_release_cb (GtkWidget *widget,
gtk_drag_drop_finished (info, FALSE, event->time);
}
/* Send on a release pair to the the original
* widget to convince it to release its grab. We need to
* call gtk_propagate_event() here, instead of
* gtk_widget_event() because widget like GtkList may
* expect propagation.
*/
send_event.button.type = GDK_BUTTON_RELEASE;
send_event.button.window = GDK_ROOT_PARENT ();
send_event.button.send_event = TRUE;
send_event.button.time = event->time;
send_event.button.x = 0;
send_event.button.y = 0;
send_event.button.pressure = 0.;
send_event.button.xtilt = 0.;
send_event.button.ytilt = 0.;
send_event.button.state = event->state;
send_event.button.button = event->button;
send_event.button.source = GDK_SOURCE_PEN;
send_event.button.deviceid = GDK_CORE_POINTER;
send_event.button.x_root = 0;
send_event.button.y_root = 0;
gtk_propagate_event (source_widget, &send_event);
gtk_widget_unref (source_widget);
return TRUE;
}
@@ -2654,11 +2800,15 @@ gtk_drag_abort_timeout (gpointer data)
GtkDragSourceInfo *info = data;
guint32 time = GDK_CURRENT_TIME;
GDK_THREADS_ENTER ();
if (info->proxy_dest)
time = info->proxy_dest->proxy_drop_time;
info->drop_timeout = 0;
gtk_drag_drop_finished (info, FALSE, time);
GDK_THREADS_LEAVE ();
return FALSE;
}
+10 -5
View File
@@ -35,10 +35,10 @@ static void gtk_drawing_area_size_allocate (GtkWidget *widget,
static void gtk_drawing_area_send_configure (GtkDrawingArea *darea);
guint
GtkType
gtk_drawing_area_get_type (void)
{
static guint drawing_area_type = 0;
static GtkType drawing_area_type = 0;
if (!drawing_area_type)
{
@@ -54,7 +54,7 @@ gtk_drawing_area_get_type (void)
(GtkClassInitFunc) NULL,
};
drawing_area_type = gtk_type_unique (gtk_widget_get_type (), &drawing_area_info);
drawing_area_type = gtk_type_unique (GTK_TYPE_WIDGET, &drawing_area_info);
}
return drawing_area_type;
@@ -65,7 +65,7 @@ gtk_drawing_area_class_init (GtkDrawingAreaClass *class)
{
GtkWidgetClass *widget_class;
widget_class = (GtkWidgetClass*) class;
widget_class = GTK_WIDGET_CLASS (class);
widget_class->realize = gtk_drawing_area_realize;
widget_class->size_allocate = gtk_drawing_area_size_allocate;
@@ -89,11 +89,12 @@ gtk_drawing_area_size (GtkDrawingArea *darea,
gint width,
gint height)
{
g_return_if_fail (darea != NULL);
g_return_if_fail (GTK_IS_DRAWING_AREA (darea));
GTK_WIDGET (darea)->requisition.width = width;
GTK_WIDGET (darea)->requisition.height = height;
gtk_widget_queue_resize (GTK_WIDGET (darea));
}
static void
@@ -139,6 +140,9 @@ gtk_drawing_area_size_allocate (GtkWidget *widget,
g_return_if_fail (allocation != NULL);
widget->allocation = *allocation;
/* FIXME, TODO-1.3: back out the MAX() statements */
widget->allocation.width = MAX (1, widget->allocation.width);
widget->allocation.height = MAX (1, widget->allocation.height);
if (GTK_WIDGET_REALIZED (widget))
{
@@ -160,6 +164,7 @@ gtk_drawing_area_send_configure (GtkDrawingArea *darea)
event.type = GDK_CONFIGURE;
event.window = widget->window;
event.send_event = TRUE;
event.x = widget->allocation.x;
event.y = widget->allocation.y;
event.width = widget->allocation.width;
+6 -4
View File
@@ -37,9 +37,11 @@ extern "C" {
#endif /* __cplusplus */
#define GTK_DRAWING_AREA(obj) GTK_CHECK_CAST (obj, gtk_drawing_area_get_type (), GtkDrawingArea)
#define GTK_DRAWING_AREA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_drawing_area_get_type (), GtkDrawingAreaClass)
#define GTK_IS_DRAWING_AREA(obj) GTK_CHECK_TYPE (obj, gtk_drawing_area_get_type ())
#define GTK_TYPE_DRAWING_AREA (gtk_drawing_area_get_type ())
#define GTK_DRAWING_AREA(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_DRAWING_AREA, GtkDrawingArea))
#define GTK_DRAWING_AREA_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_DRAWING_AREA, GtkDrawingAreaClass))
#define GTK_IS_DRAWING_AREA(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_DRAWING_AREA))
#define GTK_IS_DRAWING_AREA_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DRAWING_AREA))
typedef struct _GtkDrawingArea GtkDrawingArea;
@@ -58,7 +60,7 @@ struct _GtkDrawingAreaClass
};
guint gtk_drawing_area_get_type (void);
GtkType gtk_drawing_area_get_type (void);
GtkWidget* gtk_drawing_area_new (void);
void gtk_drawing_area_size (GtkDrawingArea *darea,
gint width,
+9 -1
View File
@@ -186,6 +186,7 @@ gtk_editable_class_init (GtkEditableClass *class)
GTK_SIGNAL_OFFSET (GtkEditableClass, activate),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
widget_class->activate_signal = editable_signals[ACTIVATE];
editable_signals[SET_EDITABLE] =
gtk_signal_new ("set-editable",
@@ -416,13 +417,14 @@ gtk_editable_insert_text (GtkEditable *editable,
gint *position)
{
GtkEditableClass *klass;
gchar buf[64];
gchar *text;
g_return_if_fail (editable != NULL);
g_return_if_fail (GTK_IS_EDITABLE (editable));
gtk_widget_ref (GTK_WIDGET (editable));
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
if (new_text_length <= 64)
@@ -437,6 +439,8 @@ gtk_editable_insert_text (GtkEditable *editable,
if (new_text_length > 64)
g_free (text);
gtk_widget_unref (GTK_WIDGET (editable));
}
void
@@ -449,10 +453,14 @@ gtk_editable_delete_text (GtkEditable *editable,
g_return_if_fail (editable != NULL);
g_return_if_fail (GTK_IS_EDITABLE (editable));
gtk_widget_ref (GTK_WIDGET (editable));
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
gtk_signal_emit (GTK_OBJECT (editable), editable_signals[DELETE_TEXT], start_pos, end_pos);
gtk_signal_emit (GTK_OBJECT (editable), editable_signals[CHANGED]);
gtk_widget_unref (GTK_WIDGET (editable));
}
static void
+4 -1
View File
@@ -53,16 +53,19 @@ struct _GtkEditable
{
GtkWidget widget;
/*< public >*/
guint current_pos;
guint selection_start_pos;
guint selection_end_pos;
guint has_selection : 1;
/*< private >*/
guint editable : 1;
guint visible : 1;
GdkIC *ic;
GdkICAttr *ic_attr;
gchar *clipboard_text;
};

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