Compare commits

..

85 Commits

Author SHA1 Message Date
Owen Taylor 093032a4c1 Queue a clear/redraw, not just a redraw, so the focus gets undrawn
Thu Nov  5 12:06:16 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
	a clear/redraw, not just a redraw, so the focus
	gets undrawn properly.

	* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
	Chain to gtk_widget_unrealize() instead of duplicating
	code.

Wed Nov  4 14:34:51 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
	last vestiges of old DND.

Tue Nov  3 12:27:52 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c: Restored inner border to entries,
	erase cursors to background image.

Fri Oct 30 12:09:21 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
	it was identical to paint_flat_box().

	* gtk/gtkstyle.c: Coding style fixups.

	* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
	test.

	* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
	Change 'side' for paint_[box/shadow]_gap and paint_extension
	to be GtkPositionType instead of a random int.

	* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
	"frame" as detail - an aspectframe should draw identical
	to a frame.

Tue Oct 27 09:58:11 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
	from combine_child_shapes().

	* gdk/gdkwindow.c: Merge propagate_shapes() and
	propagate_combine_shapes() to remove code duplication.
1998-11-06 16:03:17 +00:00
Manish Singh 4b0e615fc5 sometimes we get a KeyRelease before a KeyPress in gdk_event_translate,
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.

* clist scrollbar merges from HEAD

-Yosh
1998-11-05 22:41:18 +00:00
Manish Singh 97d42326ac Sync with HEAD
-Yosh
1998-11-05 00:52:24 +00:00
Manish Singh 0a5b61a4da remove explict -ldl, gmodule takes care of that
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that

* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)

* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden

* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that

* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }

-Yosh
1998-11-03 21:17:52 +00:00
Manish Singh 33dc032aa2 Okay, so we need the X11R6 keysyms so programs don't have to worry about
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c

* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)

-Yosh
1998-11-02 04:16:28 +00:00
Manish Singh f1bad6c4fe changed the awk scripts to generate gdkcursors.h and gdkkeysyms.h into sed
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.

* makecursors.awk
* makekeysyms.awk: bye bye

* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there

-Yosh
1998-11-01 13:35:41 +00:00
Manish Singh f310b7625e Merges from HEAD
-Yosh
1998-11-01 06:03:38 +00:00
Manish Singh 452eddb0e9 do the same built sources trick for gdkcursors.h and gdkkeysyms.h. Remove
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.

-Yosh
1998-10-31 23:26:20 +00:00
Manish Singh 7733977e00 After this, themes-2 and HEAD should have all outstanding changes merged
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef

* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c

* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD

* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups

-Yosh
1998-10-31 22:57:01 +00:00
Manish Singh 15431456d0 Oops. s/BIGENDIAN/BIG_ENDIAN/
-Yosh
1998-10-29 07:40:01 +00:00
Manish Singh 960e195d6c AIX has libpthreads, to make sure you can have more than one thread. Also
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it

* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get

* gtk/testdnd.c: removed unused variable "buf"

-Yosh
1998-10-29 03:06:48 +00:00
Owen Taylor 78d7b416bf remove_link(), not remove()
Mon Oct 26 16:46:15 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
	remove_link(), not remove()
1998-10-28 03:23:51 +00:00
Tim Janik bd10681b95 Another HEAD merge
-Yosh

Sun Oct 25 20:27:02 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkmain.c (gtk_init): support an environment variable
        GTK_MODULES= which takes a colon sperated list of module names
        automatically loaded at gtk_init() startup.
1998-10-25 20:27:52 +00:00
Tim Janik a2eed4c206 This is really a HEAD merge, I want GLE to work ;)
-Yosh

Thu Oct 22 02:29:53 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkfilesel.h: GtkType and macro fixups
        * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
        for the file selection widget to try a completion on (set the
        initial filter).

Wed Oct 14 14:34:04 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkmain.c: implement idle functions via GHook. this gives a
        slight speed improvement and lessens code duplication.
1998-10-25 11:33:11 +00:00
Manish Singh 137cb68380 use glib endian stuff
* gdk/gdkrgb.c: use glib endian stuff

* configure.in: don't need to check for endianness anymore

* gtk/gtkstyle.h: removed #pragma }, causing a silly warning

-Yosh
1998-10-22 09:29:54 +00:00
Owen Taylor 1995cdf3ff Reset all toplevel widgets, not toplevel windows. (I.e., plugs should be
Wed Oct 21 17:44:27 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
	all toplevel widgets, not toplevel windows. (I.e.,
	plugs should be reset)

	* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
	_do_ need to notify the other toplevels - by the time
	the get the client messages, the RC file dates will
	have been updated.

	* gtk/gtkcontainer.h: Added a function call to list
	every toplevel widget.

	* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
	Don't send client messages to _every_ window on display!

Tue Oct 20 16:21:04 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
	when dragging across widgets, only in drags
	starting in widget.

Tue Oct 20 15:59:49 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
	Emit "drag_end" signal at end of drag.

Tue Oct 20 14:53:28 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c: Always send "drag_leave" to dests
	without GTK_DEST_DEFAULT_MOTION.
1998-10-22 00:33:41 +00:00
Owen Taylor f88651ba08 Maintain the null-termintation guarantee, even when data = NULL, length =
Tue Oct 20 12:43:04 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkselection.c (gtk_selection_data_set):
	Maintain the null-termintation guarantee, even when
	data = NULL, length = 0. (Warn on data = NULL,
	length > 0)

Mon Oct 19 08:31:36 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
	typo - look for right atom on transfer failures.
1998-10-20 18:40:14 +00:00
Owen Taylor 6114b7943a Handle DestroyNotify on destroyed windows so we clear the XID table
Tue Oct 20 11:55:24 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
	on destroyed windows so we clear the XID table properly.
	Finish up restructure of return value handling that
	was half-done before.

Mon Oct 19 16:41:44 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
	into function prototype for drag_data_received.
1998-10-20 15:45:48 +00:00
Owen Taylor bcdb4d3368 Add in coordinates into function prototype for drag_data_received.
Mon Oct 19 16:41:44 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
	into function prototype for drag_data_received.

Mon Oct 19 16:40:40 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
	client window finding code so that it works with
	WM's other than fvwm.
1998-10-19 20:31:57 +00:00
Owen Taylor 7a78b7fcc8 Added the "GtkDrawWindow" class, which is a descendent of the Window class
Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
	the "GtkDrawWindow" class, which is a descendent
	of the Window class which leaves its background alone.
	Essentially, a toplevel drawing area, though it does
	allow adding a child.
1998-10-19 15:03:32 +00:00
Owen Taylor 347d0bf76a Merges from head.
Sun Oct 18 22:48:27 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
	the "GtkDrawWindow" class, which is a descendent
	of the Window class which leaves its background alone.
	Essentially, a toplevel drawing area, though it does
	allow adding a child.
1998-10-19 14:20:52 +00:00
Owen Taylor b20db730ea Duplicate bg_pixmap_name when merging RC styles. Report new share/themes
Sat Oct 17 00:40:51 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
	merging RC styles. Report new share/themes path for
	themes directory. Deref theme engines when appropriate.

	* gtk/gtkclist.c: Set all backgrounds in _style_set().
	Make sure that pixel for xor_gc is never 0.

	* gtk/gtkctree.c: Choose colors for plus/minus more
	carefully, in a hopefully style-independent fashion.
	(Still needs a bit more work)

	* gtk/gtkwidget.c: Don't send expose events to widgets
	which are about to be resized and redrawn. (Needs a
	bit more thought.)

	* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
	drawing on tabs for newly allocated, un-sized
	pages - we'll get the size wrong.
1998-10-17 04:39:35 +00:00
Owen Taylor 55f17ae647 Files have been moved to gtk-themes module. 1998-10-16 15:02:31 +00:00
Owen Taylor 46bc8c89a6 Fixed up stupidities in last commit.
Thu Oct  1 17:38:07 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
 	up stupidities in last commit.
1998-10-01 21:32:58 +00:00
Owen Taylor 1c20239548 When handling queued resizes, account for handleboxes, where the widget
Thu Oct  1 14:25:43 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c: When handling queued resizes, account
	for handleboxes, where the widget heirarchy is different
	than the window heirarchy by just queueing a resize on
	the entire handlebox if the detached child is changed.

	- Remove widgets from the redraw queue when reparenting,
	even if not unrealizing. We queue a resize/redraw in
	any case.
1998-10-01 18:19:50 +00:00
EDT 1998 The Rasterman bf9d172707 added check to see if the widget has been shaped byt the app via
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
        * gtk/gtkstyle.c: added check to see if the widget has been shaped
	 byt the app via gtk_widget_shape_combine_mask and if it has does
	 not reset the shape on theme change.
1998-09-29 00:57:41 +00:00
Owen Taylor 18f4510ef7 Merges from HEAD. 1998-09-15 15:58:19 +00:00
Owen Taylor ec576b8f55 Keep a list of directories in which we never want to stat the entries
Tue Sep 15 11:30:03 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkfilesel.c: Keep a list of directories in which we never
	want to stat the entries (like /afs), and assume everything in
	those directories is a subdirectory.

	- When following a path, try to open components even when
	we don't find them in their parent's directory to
	support automounters.

Mon Sep 14 14:28:24 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (adjust_adj): Change the way we
	set the adjustments on resize so that it tries to
	keep the beginning of the text in approximately
	the same place.

	Removed assertion that the above change made invalid.

Fri Sep 11 15:36:33 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
	now at least compiles again.

	* gdk/gdk.c (gdk_event_translate): Don't pass events
	on destroyed widgets to the gdk_input layer.
1998-09-15 15:25:26 +00:00
Owen Taylor 8aa4520763 Fixed use of unitialized variable.
Thu Sep 10 07:35:39 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Fixed
	use of unitialized variable.
1998-09-10 13:32:54 +00:00
Owen Taylor 32139f5020 When the pointer is grabbed on an input window, either explicitely, or
Sat Sep  5 16:01:19 1998  Owen Taylor  <otaylor@gtk.org>

	* gdk/gdkinputxfree.h gdk/gdk.c gdk/gdkinputgxi.h:
	When the pointer is grabbed on an input window,
	either explicitely, or through press-grab, and
	then grabbed on a non-input window, ungrab the
	devices.
1998-09-05 20:24:54 +00:00
Owen Taylor e9c260180c Merges from HEAD.
Thu Sep  3 19:45:34 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkthemes.c: Use g_module instead of dlopen()

Thu Sep  3 19:30:11 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktooltips.c (gtk_tooltips_expose): Check
	if we've changed widgets since the expose event
	was queued.
1998-09-04 15:02:08 +00:00
Carsten Haitzler 9d4587fc54 forogot to commit this mod....
forogot to commit this mod....
1998-09-01 19:04:21 +00:00
EDT 1998 The Rasterman 6014dbc289 several files - basically drawing and code cleanups, few minor fixes -
Tue Sep  1 14:52:10 EDT 1998 The Rasterman <raster@redhat.com>
        * several files - basically drawing and code cleanups, few
	minor fixes - basically maintinence.
1998-09-01 18:45:47 +00:00
Owen Taylor fb3d48b7b9 Unref the adjustment.
Tue Sep  1 10:53:52 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkprogress.c (gtk_progress_finalize): Unref
	the adjustment.

	* gtk/gtkmenu.c: Modified reference counting so
	that the reference count from the toplevel that
	the menu creates to the menu is invisible to the
	application.

Mon Aug 31 15:33:13 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
	to restore approximate bin compatibility with the
	non-themes branch. (This does break bin compat
	within the themes branch.)
1998-09-01 16:52:54 +00:00
Frank Belew (Myth) 283cc5a0ce just some annoying things weren't ignored :) 1998-09-01 05:20:20 +00:00
Frank Belew (Myth) b6449d3dce see ChangeLog 1998-09-01 05:10:55 +00:00
Owen Taylor d213168f12 Eliminate a gdk_window_clear_area() that snuck in with the menu underlines
Sun Aug 30 16:48:27 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtklabel.c (gtk_label_set): Eliminate a
	gdk_window_clear_area() that snuck in with the
	menu underlines merge.
1998-08-30 20:46:30 +00:00
Owen Taylor 69746cb4d5 Make sure the mark we pass to line start is the beginning of a real line,
Tue Aug 25 16:52:47 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (recompute_geometry): Make sure the
	mark we pass to line start is the beginning of a
	real line, not a wrapped one.
1998-08-25 22:19:33 +00:00
Owen Taylor dfccba3826 Lot's of merges from main branch.
Mon Aug 24 23:37:26 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c: Fixed some remaining background drawing,
	  merges from main branch, cleanups.
1998-08-25 03:35:02 +00:00
Owen Taylor 4d24cab4f9 Don't dereference NULL focus tab.
Mon Aug 24 10:55:51 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
	  dereference NULL focus tab.

	* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
	  functions since we need to both show/hide and
	  queue a redraw. (There's some duplication of drawing here,
	  we probably should only be queuing a redraw on the
	  "value" portion of the scale.)
1998-08-24 14:49:58 +00:00
Carsten Haitzler b3f01550bc Allrighty then... :)
Allrighty then... :)
1998-08-22 01:29:55 +00:00
Owen Taylor 4ccce42527 More files. 1998-08-22 00:13:35 +00:00
Owen Taylor 7839d25a17 More adding files, added .cvsignore's 1998-08-21 23:47:22 +00:00
Owen Taylor 2b547db814 Cleanups to the set of active files. 1998-08-21 23:41:07 +00:00
Owen Taylor 375eea1317 Fit scales into the theme-drawing framework. We do this by making them,
Fri Aug 21 19:02:30 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
	  into the theme-drawing framework. We do this by making them,
	  like check/radio-buttons, no-window widgets with subwindows. We
	  then move the value by calling gtk_widget_queue_clear() and only
	  redraw the value in our draw() / expose() handler.  A virtual
	  function clear_background is added which queues a clear on the
	  "background" portion of the widget.

Fri Aug 21 13:04:27 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c (mark_bg_gc): Make background colors work
	  again. (We can't always paint the background with a
	  paint() function - only do that for selected text)

Mon Aug 17 20:31:01 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
	  gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.

	* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
	  the themes can't be built as part of the same build since
	  they depend on gdk_imlib.

Fri Aug 14 12:44:30 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
	  from gtkthemes.c.

	* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
	  gtk/

	  - Upgrade to libtool-1.2b + patch to add shared library dependencies
	    for Linux. (Needs to be extended to other platforms where they
	    are safe)

	 - Check for -ldl so this branch should build on all platforms, though
	   themes will work on all platforms they could work on.

	 - Use -version and -release simultaneously: sonames stay as they are
	   in the current scheme, but -lgtk-1.1 changes to -lgtk.

	 - Added in extra -l flags to library LDFLAGS so we get shared library
	   dependencies against X libs and -ldl. (But not libgtk against
	   libgdk or libglib yet, since dependencies against uninstalled
	   libraries aren't portable)

Fri Aug 21 19:08:25 1998  Owen Taylor  <otaylor@redhat.com>

	* Makefile.am: Added support for metal theme.
	  Install/distribute gtkrc's for each theme.

Mon Aug 17 20:32:53 1998  Owen Taylor  <otaylor@redhat.com>

	* Makefile.am, pixmap/Makefile.am: Switch back to using automake,
	  fix things up to make dist properly.

	* pixmap_theme.h: Rationalized.
	* win95_theme.h motif_theme.h: Removed

	* Started ChangeLog.
1998-08-21 23:38:47 +00:00
EDT 1998 The Rasterman 82765c7aa4 gtkrc.c - added api calls to find module and theme paths from gtk. nuked
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
        * gtkrc.c - added api calls to find module and theme paths from gtk.
	nuked gtk_install_prefix global.
1998-08-21 20:08:09 +00:00
EDT 1998 The Rasterman 66bbad7838 fixed gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
        * fixed gtk_install_prefix global.
1998-08-21 16:30:09 +00:00
EDT 1998 The Rasterman 6c29fb342b added ~/.gtk/lib/themes/engines/ to the defautl searchpath for gtk theme
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
        * added ~/.gtk/lib/themes/engines/ to the defautl searchpath for
	gtk theme engines
1998-08-20 22:27:16 +00:00
EDT 1998 The Rasterman 4d675735b0 made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
        * made gtkrc scanner append dir that gtkrc is read from to pixmap path.
1998-08-20 22:21:41 +00:00
EDT 1998 The Rasterman d9e68d7ac3 added metal theme, fixed pixmap theme now to use pixmap path - and removed
Thu Aug 20 18:25:07 EDT 1998 The Rasterman <raster@redhat.com>
        * added metal theme, fixed pixmap theme now to use pixmap path - and
	removed lots of annoying print's, added gtkr's for each
	theme data.. all your rc needs to do is include these rc's.
1998-08-20 22:20:49 +00:00
The Rasterman f54298e6dc Fixed minor problem in gtkhandlebox.c with drawing, and some notebook
Mon Aug 10 23:03:55 1998  The Rasterman <raster@redhat.com>
        * Fixed minor problem in gtkhandlebox.c with drawing, and some
	  notebook stuff. Also pixmap theme is now "clean" again.
1998-08-19 03:04:34 +00:00
Jaka Mocnik 2660911fd7 added themes to SRC_SUBDIRS
1998-08-15  Jaka Mocnik  <jaka.mocnik@kiss.uni-lj.si>

	* added themes to SRC_SUBDIRS
1998-08-15 11:02:12 +00:00
Carsten Haitzler d7022170c7 damn - left some debugging printf's!
damn - left some debugging printf's!
1998-08-11 03:25:06 +00:00
Owen Taylor ec42a2fd24 Fixed up queued area resizing once more.
Mon Aug 10 23:03:55 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
	  queued area resizing once more.
1998-08-11 03:15:46 +00:00
Carsten Haitzler 2d4bb49ed2 Mon Aug 10 23:09:30 EDT 1998 Added a few drawing fixes for notebook and
Mon Aug 10 23:09:30 EDT 1998
        * Added a few drawing fixes for notebook and other widgets. finished
	pixmap theme up to the level that can be supported so far. (need to
	add path discovery 9ie where is the rc fiel from - add to pixmap
	path so we can get theimages from there too). then we can package
	themes. After that need to add to theme seartch path stuff in users
	home dir.
1998-08-11 03:06:26 +00:00
Owen Taylor 13e1213e9a Draw into a drawing area, draw in an expose handler.
Thu Aug  6 16:49:25 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
	  drawing area, draw in an expose handler.

	* gtk/gtknotebook.c (gtk_notebook_expose): Check for
	  empty current page.
1998-08-06 20:44:44 +00:00
Owen Taylor 89f7a5a848 Moved creation of GC's so that they will be set before they are used for
Wed Aug  5 16:13:15 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
	  creation of GC's so that they will be set before
	  they are used for map events (why are they used there?)

	* gtk/gtkwidget.c: Fixed mistake that caused widgets to
	  be queued in multiple times in the queue.
1998-08-05 20:23:18 +00:00
Owen Taylor b163129911 Merges from main. (Hmm most of those files are unmodified...) 1998-08-05 13:38:16 +00:00
Owen Taylor 976849f090 Fixed up handling of partially clipped areas.
Tue Aug  4 19:12:14 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
	  handling of partially clipped areas.

Merges from main branch.
1998-08-04 23:16:19 +00:00
EDT 1998 EDT 1998 The Rasterman e1722f3d15 Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Sat Aug  1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
        * Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
1998-08-01 21:45:05 +00:00
EDT 1998 The Rasterman a1a5ef5800 YES YES YES YES YES clist borders work again! YES! YES YES! gimme more
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
        * YES YES YES YES YES clist borders work again! YES! YES YES! gimme
	more baby oooh yeah more more MORE YES YES.
1998-07-31 23:58:10 +00:00
EDT 1998 The Rasterman 8654cf632e hopefulyl fixed problem wiht togglebuttons acting like radiobuttons in
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
        * hopefulyl fixed problem wiht togglebuttons acting like
	radiobuttons in gtktogglebutton.c
1998-07-31 23:41:39 +00:00
Owen Taylor 607f7ddde9 Added missed case into draw code. (Thanks Tim!)
Fri Jul 31 13:23:50 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Added
	  missed case into draw code. (Thanks Tim!)

	* gtk/gtkrc.c gtk/gtkstyle.c: When unrealizing/destroying
	  call engine-specific code first. Misc cleanups.

	* themes/Makefile.in themes/configure.in: Fixups with
	  GTK_CFLAGS.

Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups

	* gtk/gtktooltips.c: Pass a widget (the window) to the
	  drawing function instead of the GtkTooltips.

Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: Abstract out checking for shape
	  extension into a function.

	* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
	  Remove extra callls to gtk_window_draw().
1998-07-31 18:27:00 +00:00
Carsten Haitzler 257ef68381 ???????????
???????????
1998-07-31 17:02:42 +00:00
Carsten Haitzler 798e25b6f7 DAMN CVS!
DAMN CVS!
1998-07-31 16:47:51 +00:00
Carsten Haitzler 8f3e4424bf blah
blah
1998-07-31 16:20:34 +00:00
Carsten Haitzler f22d8e2248 missed 2 files form lats commit
missed 2 files form lats commit
1998-07-31 04:01:36 +00:00
EDT 1998 The Rasterman ea278eb5bb fixed another drawing buglet in the frame drawing code (actually in the
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
        * fixed another drawing buglet in the frame drawing code (actually
	in the clearing code but anyway in gtkstyle.c)
1998-07-31 03:46:11 +00:00
EDT 1998 The Rasterman bef62ec152 Fixed warning from colorsel widget...
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
        * Fixed warning from colorsel widget...
1998-07-30 23:21:02 +00:00
EDT 1998 The Rasterman 38c30244bb Fixed defautl drawing code to no longer clobber the original style pixmap
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
        * Fixed defautl drawing code to no longer clobber the original style
	pixmap bgs as it did and added a helper funciton in gtkstyle.c to
	help with this.
1998-07-30 23:11:06 +00:00
Owen Taylor e439315d93 More mm fixups
Thu Jul 30 18:09:21 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups

	* gtk/gtktooltips.c: Pass a widget (the window) to the
	  drawing function instead of the GtkTooltips.
1998-07-30 22:04:38 +00:00
Owen Taylor 1b1aa9d98d Abstract out checking for shape extension into a function.
Thu Jul 30 17:27:10 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkwindow.c: Abstract out checking for shape
	  extension into a function.

	* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
	  Remove extra callls to gtk_window_draw().

Miscellaneous indentation fixes.
1998-07-30 21:21:43 +00:00
EDT 1998 The Rasterman 70b7979df8 Moved all the themes to install cleanly the engine *.so's in
Thu Jul 30 14:51:34 EDT 1998 The Rasterman <raster@redhat.com>
        * Moved all the themes to install cleanly the engine *.so's in
	$(exec_prefix)/lib/gtk/themes/engines/ .
	All the data for themes is now installed in
	$(exec_prefix)/share/gtk/themes/theme_name/
	All things build using GNU configure and autoconf and libtool now.
	I have created a win95, motif and pixmap theme setup - i have to
	work on the motif and win95 ones - pixmap theme also need work -
	it partially parses a gtkrc for itself. This is goign to be a good
	sample base to work from if you wish to write your own theme engines.
1998-07-30 18:53:11 +00:00
Owen Taylor ac4aaf0def Fixed mistaken deletion of a line; updates from main branch 1998-07-30 16:30:27 +00:00
Owen Taylor 8461f6e3eb Memory management fixups.
Thu Jul 30 11:18:43 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.

	* themes/th_main.c: Moved messages around so they are
	  printed before destroying strings.
1998-07-30 15:14:36 +00:00
Owen Taylor 798d7ca2da Fairly implementation of expose compression. (No GraphicsExpose
Wed Jul 29 16:56:07 1998  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdk.c: Fairly implementation of expose compression.
	  (No GraphicsExpose compression yet, always compress
	  with the equivalent of XtCompressMultiple - no compression
	  of Expose events across non-Expose events)

	* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
	  Find rectangle bounding two rectangles.

	* gtk/gtkstyle.c: Set clip rects for a few extra GC's
	  in gdk_default_draw_shadow()
1998-07-29 21:07:00 +00:00
EDT 1998 The Rasterman 8fc624c81b Fixed drawing functions to handle switching themes on the fly gracefully
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
        * Fixed drawing functions to handle switching themes on the fly
	  gracefully and look decent.
1998-07-29 19:59:53 +00:00
EDT 1998 The Rasterman 513de4171a Added all the theme drawing code to all widgets, fixed up minor nigglies
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
        * Added all the theme drawing code to all widgets, fixed up minor
  	  nigglies in some widgets when it comes to themes, seem to be
 	  running into some funky behavior with clipping rects in GC's. Too
	  many files to list here. (all files that now use gtk_paint_* are
	  affected).
1998-07-29 03:29:17 +00:00
Owen Taylor 842d668599 Set up the demo theme so it is loaded from the RC file.
Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>

	* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
	  Set up the demo theme so it is loaded from the RC file.

	* themes/th_draw.c: Alleviate the hardcoded paths a wee
	  bit. (use $HOME/themes/)
1998-07-29 03:10:22 +00:00
Owen Taylor 79ba0b2aed Set up the demo theme so it is loaded from the RC file.
Tue Jul 28 22:49:16 1998  Owen Taylor  <otaylor@redhat.com>

	* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
	  Set up the demo theme so it is loaded from the RC file.

	* themes/th_draw.c: Alleviate the hardcoded paths a wee
	  bit. (use $HOME/themes/)

	* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
	  the RC file via dlopen()
1998-07-29 02:47:01 +00:00
Owen Taylor d0f68a5c1f nternal handling of styles and RC styles pretty much completely reworked
nternal handling of styles and RC styles pretty much
	completely reworked for Theme work.

	* gtkthemes.[ch]:
	 - Added routines for virtualization of RcStyle and Style handling.
	 - Temporary "sample" inline theme-engine. (Does nothing
	   but print out a few messages.

	* gtkrc.[ch]
	 - Made GtkRcStyle public, added flags to tell if particular
	   colors have been set.
	 - RC Styles are "transparent", and the final style for
	   a widget is the composition of all matching styles
	 - Added pointer to GtkThemeEngine, and gpointer engine_data
	   to RC style and style.
	 - Parse "engine" keyword, load the appropriate theme engine
	   and call the engine's parser.

	*  gtkstyle.[ch]
	 - Keep a GtkRcStyle * in styles created from Rc Styles.
	 - Load up images from RC file at style attachment time.
         - Call ->engine->foo() at appropriate times.
	 - Don't use a GCache. All incarnations for a style are
	   just linked together in a list, depend on the RC style
	   code to find the existing copy.
1998-07-29 01:29:30 +00:00
Owen Taylor b01d52b537 Single line change to fix window redraws. 1998-07-28 23:25:22 +00:00
Carsten Haitzler 78a42b742e oops missed them
oops missed them
1998-07-28 20:53:25 +00:00
Carsten Haitzler 742c12580d GTK theme revision 2 now in CVS themes 2 branch........ WHEEEEEEEEEEE!
GTK theme revision 2 now in CVS themes 2 branch........ WHEEEEEEEEEEE!
1998-07-28 20:39:26 +00:00
Owen Taylor b6c34a8190 Added the concept of queued redraws of partial areas. This can be done
Tue Jul 28 14:41:54 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.[ch]: Added the concept of queued redraws
	  of partial areas. This can be done either relative
	  to the existing windows (gtk_widget_queue_clear[_area]())
	  or relative to the future allocation of the widget
	  (gtk_widget_queue_draw[_area]).

	  The initial implementation is pretty braindead, but
	  can be improved.

	* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
	  in favor of gtk_widget_queue_clear().

	* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
	  flags in favor of gtk_widget_queue_clear()

[ Began a new branch for ongoing RHAD themes work ]
1998-07-28 19:26:21 +00:00
143 changed files with 16529 additions and 13719 deletions
-1
View File
@@ -10,4 +10,3 @@ aclocal.m4
configure
gtk-config
config.cache
+606 -247
View File
@@ -1,91 +1,447 @@
Fri, 13 Nov 1998 18:54:13 +0100 Paolo Molaro <lupus@debian.org>
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com>
* gdk/Makefile.am: added poly.h to EXTRA_DIST.
* gdk/gdkgc.c: support dashes in GdkGCPrivate
* gdk/gdkprivate.h: move here GdkPsDrawable definition
* gdk/gdkdrawable.c: gdk_drawable_register returns an int
* gdk/gdkps.c: beginning support for pixmaps, better
guessing of postscript font name, beginning of downloading
function, better emulation of dashed lines,
* gtk/testps.c: better example to show pixmaps, dashes,
font size and a4 page size.
* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
a clear/redraw, not just a redraw, so the focus
gets undrawn properly.
Wed, 21 Oct 1998 19:29:03 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
Chain to gtk_widget_unrealize() instead of duplicating
code.
* gdk/gdkps.c: fixed silly error.
* gtk/testps.c: test for string length (X<->PS).
Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
last vestiges of old DND.
Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c: Restored inner border to entries,
erase cursors to background image.
Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
it was identical to paint_flat_box().
* gtk/gtkstyle.c: Coding style fixups.
* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
test.
* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
Change 'side' for paint_[box/shadow]_gap and paint_extension
to be GtkPositionType instead of a random int.
* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
"frame" as detail - an aspectframe should draw identical
to a frame.
Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
from combine_child_shapes().
* gdk/gdkwindow.c: Merge propagate_shapes() and
propagate_combine_shapes() to remove code duplication.
Thu Nov 5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.
* clist scrollbar merges from HEAD
Tue Nov 3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)
* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden
* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that
* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }
Sun Nov 1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c
* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)
Sun Nov 1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.
* makecursors.awk
* makekeysyms.awk: bye bye
* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.
Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef
* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c
* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD
* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups
Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it
* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get
* gtk/testdnd.c: removed unused variable "buf"
Mon Oct 26 16:46:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
remove_link(), not remove()
Sun Oct 25 20:27:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): support an environment variable
GTK_MODULES= which takes a colon sperated list of module names
automatically loaded at gtk_init() startup.
Thu Oct 22 02:29:53 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.h: GtkType and macro fixups
* gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
for the file selection widget to try a completion on (set the
initial filter).
Wed Oct 14 14:34:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c: implement idle functions via GHook. this gives a
slight speed improvement and lessens code duplication.
Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: use glib endian stuff
* configure.in: don't need to check for endianness anymore
* gtk/gtkstyle.h: removed #pragma }, causing a silly warning
Wed Oct 21 17:44:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
all toplevel widgets, not toplevel windows. (I.e.,
plugs should be reset)
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
_do_ need to notify the other toplevels - by the time
the get the client messages, the RC file dates will
have been updated.
* gtk/gtkcontainer.h: Added a function call to list
every toplevel widget.
* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
Don't send client messages to _every_ window on display!
Wed, 21 Oct 1998 19:10:02 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 16:21:04 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkps.c: better guessing of postscript font name.
* gtk/Makefile.am: compile testps.c
* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
when dragging across widgets, only in drags
starting in widget.
Tue, 20 Oct 1998 12:03:46 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 15:59:49 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkprivate.h: GdkGCPrivate now stores complete info
about color, clip-rectangles (not for bitmaps yet) and
dashes.
GdkWindowPrivate now has a GdkDrawableClass member to allow
for customized draw operations.
* gdk/gdktypes.h: GdkFont now has a name member; new
GDK_WINDOW_DRAWABLE type for GdkWindow; new structure
GdkDrawableClass.
* gdk/gdkdraw.c: use engine-specific functions to draw.
* gdk/gdkwindow.c: handle destroy of GDK_WINDOW_DRAWABLE.
* gdk/gdkps.[ch]: postscript drawable engine.
* gdk/gdkdrawable.c: drawable engine registration.
* gdk/gdk.h: include drawable engine headers and declare
engine registration function.
New function: gdk_region_get_rectangles().
* gdk/gdkfont.c: store the name of the font loaded (needs
work for fontset).
* gdk/gdkgc.c: handle changes to GdkGCPrivate.
* gdk/gdkregion.c: use our own functions for Region handling
(stolen from X 6.3: Region.c region.h poly.h PolyReg.c).
* gtk/testps.c: test postscript backend.
* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
Emit "drag_end" signal at end of drag.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
* gtk/gtkdnd.c: Always send "drag_leave" to dests
without GTK_DEST_DEFAULT_MOTION.
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
Tue Oct 20 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c: rearranged some functions
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
flag of column
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
(gtk_clist_set_border): deprecated function, use
gtk_clist_set_shadow_type instead.
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
(adjust_scrollbars): some cleanups
(select_row) (unselect_row): removed. replaced by equivalent
gtk_signal_emit calls
(add_style_data): removed, use gtk_clist_style_set instead
(gtk_clist_style_set): fill in size data, after style was set.
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
(gtk_clist_set_cell_style): auto_resize columns if needed
(column_auto_resize): resize column if needed for auto_resize
(real_clear): disable auto_resize while list destroy
(resize_column): removed
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
for "gtk-embedded" data currently set by
GtkSocket, and use that to forward client message
on to embedded windows. Only reset our own toplevel -
the others will handle themselves. (Now that
GtkMenus live in GtkWindows)
* gtk/gtkctree.c : (gtk_ctree_remove_node)
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
auto_resize columns if needed
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
(real_clear): disable auto_resize while processing the tree
Tue Oct 20 12:57:10 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
for one column
* gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt
the window tree more comprehensively, so that we find
client windows hidden under non-toplevels.
Tue Oct 20 12:43:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_data_set):
Maintain the null-termintation guarantee, even when
data = NULL, length = 0. (Warn on data = NULL,
length > 0)
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
Tue Oct 20 11:55:24 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
on destroyed windows so we clear the XID table properly.
Finish up restructure of return value handling that
was half-done before.
Mon Oct 19 16:41:44 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
into function prototype for drag_data_received.
Mon Oct 19 16:40:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
client window finding code so that it works with
WM's other than fvwm.
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Sun Oct 18 22:48:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
the "GtkDrawWindow" class, which is a descendent
of the Window class which leaves its background alone.
Essentially, a toplevel drawing area, though it does
allow adding a child.
Sat Oct 17 00:40:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
merging RC styles. Report new share/themes path for
themes directory. Deref theme engines when appropriate.
* gtk/gtkclist.c: Set all backgrounds in _style_set().
Make sure that pixel for xor_gc is never 0.
* gtk/gtkctree.c: Choose colors for plus/minus more
carefully, in a hopefully style-independent fashion.
(Still needs a bit more work)
* gtk/gtkwidget.c: Don't send expose events to widgets
which are about to be resized and redrawn. (Needs a
bit more thought.)
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
drawing on tabs for newly allocated, un-sized
pages - we'll get the size wrong.
Thu Oct 1 17:38:07 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
up stupidities in last commit.
Thu Oct 1 14:25:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: When handling queued resizes, account
for handleboxes, where the widget heirarchy is different
than the window heirarchy by just queueing a resize on
the entire handlebox if the detached child is changed.
- Remove widgets from the redraw queue when reparenting,
even if not unrealizing. We queue a resize/redraw in
any case.
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
* gtk/gtkstyle.c: added check to see if the widget has been shaped
byt the app via gtk_widget_shape_combine_mask and if it has does
not reset the shape on theme change.
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c: Use g_module instead of dlopen()
Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_expose): Check
if we've changed widgets since the expose event
was queued.
Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
to restore approximate bin compatibility with the
non-themes branch. (This does break bin compat
within the themes branch.)
Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklabel.c (gtk_label_set): Eliminate a
gdk_window_clear_area() that snuck in with the
menu underlines merge.
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 23:37:26 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Fixed some remaining background drawing,
merges from main branch, cleanups.
Mon Aug 24 10:55:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
dereference NULL focus tab.
* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
functions since we need to both show/hide and
queue a redraw. (There's some duplication of drawing here,
we probably should only be queuing a redraw on the
"value" portion of the scale.)
Fri Aug 21 19:02:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
into the theme-drawing framework. We do this by making them,
like check/radio-buttons, no-window widgets with subwindows. We
then move the value by calling gtk_widget_queue_clear() and only
redraw the value in our draw() / expose() handler. A virtual
function clear_background is added which queues a clear on the
"background" portion of the widget.
Fri Aug 21 13:04:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (mark_bg_gc): Make background colors work
again. (We can't always paint the background with a
paint() function - only do that for selected text)
Mon Aug 17 20:31:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
the themes can't be built as part of the same build since
they depend on gdk_imlib.
Fri Aug 14 12:44:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
from gtkthemes.c.
* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
gtk/
- Upgrade to libtool-1.2b + patch to add shared library dependencies
for Linux. (Needs to be extended to other platforms where they
are safe)
- Check for -ldl so this branch should build on all platforms, though
themes will work on all platforms they could work on.
- Use -version and -release simultaneously: sonames stay as they are
in the current scheme, but -lgtk-1.1 changes to -lgtk.
- Added in extra -l flags to library LDFLAGS so we get shared library
dependencies against X libs and -ldl. (But not libgtk against
libgdk or libglib yet, since dependencies against uninstalled
libraries aren't portable)
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
* gtkrc.c - added api calls to find module and theme paths from gtk.
nuked gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed gtk_install_prefix global.
Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
* added gtk_install_prefix global const variabel to find where gtk is
installed.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* added ~/.gtk/lib/themes/engines/ to the default searchpath for
gtk theme engines
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Sun Oct 18 20:52:22 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwidget.c gtkmarshal.list: Change signal
@@ -669,15 +1025,6 @@ Tue Sep 15 11:06:13 1998 Owen Taylor <otaylor@redhat.com>
with unchanged dimensions, send a synthetic expose
since ForgetGravity won't expose our window.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: - Save first_cut_pixels when switching
@@ -984,12 +1331,6 @@ Sat Aug 29 14:50:56 PDT 1998 Manish Singh <yosh@gimp.org>
* gtk/testthreads.c: add #include <unistd.h> for sleep()
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
@@ -1088,187 +1429,74 @@ Fri Aug 21 13:06:04 1998 Stuart Parmenter <pavlov@gimp.org>
* gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes
such as GtkCTree function name changes
Fri Aug 21 02:31:26 1998 Tim Janik <timj@gtk.org>
Mon Aug 10 23:03:55 1998 The Rasterman <raster@redhat.com>
* Fixed minor problem in gtkhandlebox.c with drawing, and some
notebook stuff. Also pixmap theme is now "clean" again.
Mon Aug 10 23:03:55 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.h:
* gtk/gtkmain.c (gtk_check_version): added a function to perform a
binary version check, returning a static string for error descriptions,
or NULL on success.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com>
Mon Aug 10 23:09:30 EDT 1998
* Added a few drawing fixes for notebook and other widgets. finished
pixmap theme up to the level that can be supported so far. (need to
add path discovery 9ie where is the rc fiel from - add to pixmap
path so we can get theimages from there too). then we can package
themes. After that need to add to theme seartch path stuff in users
home dir.
Thu Aug 6 16:49:25 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.
* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
drawing area, draw in an expose handler.
* gtk/gtktext.c (correct_cache_insert): Fiddled around
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)
* gtk/gtknotebook.c (gtk_notebook_expose): Check for
empty current page.
Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
Wed Aug 5 16:13:15 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: silly visual fixes
* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
creation of GC's so that they will be set before
they are used for map events (why are they used there?)
* gtk/testgtk.c: call gdk_rgb_init so color preview test actually
works
* gtk/gtkwidget.c: Fixed mistake that caused widgets to
be queued in multiple times in the queue.
1998-08-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do
anything if the event's window is not the bin window.
(gtk_handle_box_motion): Likewise.
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
1998-08-19 Raph Levien <raph@gimp.org>
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_color_preview): pushed the colormap and
visual so it would work better with GdkRgb.
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
1998-08-19 Raph Levien <raph@gimp.org>
Tue Aug 4 19:12:14 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a
4bpp static_color mode (for vga displays). Also fixed a '64' value
in the dither matrix, which was causing one pixel out of 16k to be
dithered wrong.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
handling of partially clipped areas.
* gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting
most of the contents. This is an API change - any apps that relied
on the internal structure of GtkPreview will need some change -
most notably in the use of reserved colors. The Gimp needed
changes in this regard.
Wed Aug 5 02:57:20 1998 Lars Hamann <lars@gtk.org>
Wed Aug 19 00:11:14 1998 Tim Janik <timj@gtk.org>
* gtk/gtkctree.h:
* gtk/gtkctree.c:
(gtk_ctree_find): changed to return a gboolean
(gtk_ctree_insert_gnode): new function for recursive insertion of a
GNode tree.
(gtk_ctree_real_select_recursive): fix for extended selection
(gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too.
(gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag
* gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without
G_ENABLE_DEBUG being defined (specifically --gtk-module= and
--g-fatal-warnings), noticed by miguel.
Tue Aug 4 16:18:26 1998 Tim Janik <timj@gtk.org>
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 0, interface age 0.
GLib version 1.1.1 is now required at minimum.
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
* gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv
in case of show_tabs == NULL
Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments
to --g-fatal-warnings again. this option now causes log levels of
WARNING and CRITICAL to abort().
* gdk/gdk.c:
* gdk/gdkdnd.c:
* gdk/gdkcc.c:
* gdk/gdkfont.c:
* gdk/gdkwindow.c:
* gdk/gdkvisual.c:
* gtk/gtkwidget.c:
* gtk/gtktypeutils.c:
* gtk/gtktree.c:
* gtk/gtkfontsel.c:
* gtk/gtkmain.c:
* gtk/gtkobject.c:
* gtk/gtkpreview.c:
* gtk/gtkselection.c:
* gtk/gtktext.c:
* gtk/gtktree.c:
* gtk/gtktreeitem.c:
did a global search&replace to substitute g_print() calls with
g_message(). libraries shouldn't use printf(), g_print() or
g_printerr() at all.
a bunch of the replacements should probably be wrapped into the
G{D|T}K_NOTE() macros, so they are special cased for debugging
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
* gdk/gdkrgb.c: Further speedups of the 565_d case. It's
impressively fast now - about 4.65 Mpix/s on an IBM TP 600
running a PII 233. It's synced with the 0.0.5 release of
GdkRgb.
Tue Aug 18 00:29:13 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h:
(struct _GtkCListClass): new class methods:
(sort_list) (insert_row) (remove_row) (set_cell_contents)
* gtk/gtkclist.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): fix to avoid problems with cell types != CELL_TEXT
* gtk/gtkctree.h :
(gtk_ctree_export_to_gnode): new function to export a ctree as gnode
(gtk_ctree_node_is_visible): new function to return visibility state
of a node
(gtk_ctree_show_stub): new function to set visibility of root stub
renamed functions :
(gtk_ctree_insert) -> (gtk_ctree_insert_node)
(gtk_ctree_remove) -> (gtk_ctree_remove_node)
(gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr)
(gtk_ctree_set_text) -> (gtk_ctree_node_set_text)
(gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap)
(gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext)
(gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift)
(gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type)
(gtk_ctree_get_text) -> (gtk_ctree_node_get_text)
(gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap)
(gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext)
(gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground)
(gtk_ctree_set_background) -> (gtk_ctree_node_set_background)
(gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data)
(gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full)
(gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data)
(gtk_ctree_moveto) -> (gtk_ctree_node_moveto)
(gtk_ctree_sort) -> (gtk_ctree_sort_node)
(gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable)
* gtk/gtkctree.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): removed. CTree now also compares two GtkCTreeRows
instead of two GtkCTreeNodes.
(gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after
unlinking the node
(real_tree_expand) (real_tree_collapse): fix for refcounting of
node pixmaps
(set_node_info): call gtk_ctree_node_set_pixtext instead of
manipulating the row itself
* gtk/testgtk.c: use renamed functions of GtkCTree.
new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode
at work.
* docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version
of the Gtk+ tutorial, contributed by Eric Jacoboni <jaco@dotcom.fr>.
Mon Aug 17 15:31:38 1998 Tim Janik <timj@gtk.org>
@@ -1673,6 +1901,137 @@ Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* gtk/docs/man: new directory
* gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page
Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
* Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* YES YES YES YES YES clist borders work again! YES! YES YES! gimme
more baby oooh yeah more more MORE YES YES.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* hopefully fixed problem wiht togglebuttons acting like
radiobuttons in gtktogglebutton.c
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed another drawing buglet in the frame drawing code (actually
in the clearing code but anyway in gtkstyle.c)
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed warning from colorsel widget...
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed defautl drawing code to no longer clobber the original style
pixmap bgs as it did and added a helper funciton og gtkstyle.c to
help with this.
Thu Jul 30 18:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
* gtk/gtktooltips.c: Pass a widget (the window) to the
drawing function instead of the GtkTooltips.
Thu Jul 30 17:27:10 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c: Abstract out checking for shape
extension into a function.
* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
Remove extra callls to gtk_window_draw().
Thu Jul 30 11:18:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
* themes/th_main.c: Moved messages around so they are
printed before destroying strings.
Wed Jul 29 16:56:07 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c: Fairly simple implementation of expose compression.
(No GraphicsExpose compression yet, always compress
with the equivalent of XtCompressMultiple - no compression
of Expose events across non-Expose events)
* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
Find rectangle bounding two rectangles.
* gtk/gtkstyle.c: Set clip rects for a few extra GC's
in gdk_default_draw_shadow()
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed drawing functions to handle switching themes on the fly
gracefully and look decent.
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
* Added all the theme drawing code to all widgets, fixed up minor
nigglies in some widgets when it comes to themes, seem to be
running into some funky behavior with clipping rects in GC's. Too
many files to list here. (all files that now use gtk_paint_* are
affected).
Tue Jul 28 22:49:16 1998 Owen Taylor <otaylor@redhat.com>
* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
Set up the demo theme so it is loaded from the RC file.
* themes/th_draw.c: Alleviate the hardcoded paths a wee
bit. (use $HOME/themes/)
* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
the RC file via dlopen()
Tue Jul 28 20:30:56 1998 Owen Taylor <otaylor@redhat.com>
Internal handling of styles and RC styles pretty much
completely reworked for Theme work.
* gtkthemes.[ch]:
- Added routines for virtualization of RcStyle and Style handling.
- Temporary "sample" inline theme-engine. (Does nothing
but print out a few messages.
* gtkrc.[ch]
- Made GtkRcStyle public, added flags to tell if particular
colors have been set.
- RC Styles are "transparent", and the final style for
a widget is the composition of all matching styles
- Added pointer to GtkThemeEngine, and gpointer engine_data
to RC style and style.
- Parse "engine" keyword, load the appropriate theme engine
and call the engine's parser.
* gtkstyle.[ch]
- Keep a GtkRcStyle * in styles created from Rc Styles.
- Load up images from RC file at style attachment time.
- Call ->engine->foo() at appropriate times.
- Don't use a GCache. All incarnations for a style are
just linked together in a list, depend on the RC style
code to find the existing copy.
Tue Jul 28 14:41:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch]: Added the concept of queued redraws
of partial areas. This can be done either relative
to the existing windows (gtk_widget_queue_clear[_area]())
or relative to the future allocation of the widget
(gtk_widget_queue_draw[_area]).
The initial implementation is pretty braindead, but
can be improved.
* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
in favor of gtk_widget_queue_clear().
* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
flags in favor of gtk_widget_queue_clear()
Tue Jul 28 00:15:28 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* docs/gdk.sgml: new format for GDK documentation. Eventually
plan to remove gdk.texi, but not quite yet. Just getting
started.
Tue Jul 28 00:03:20 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing
+606 -247
View File
@@ -1,91 +1,447 @@
Fri, 13 Nov 1998 18:54:13 +0100 Paolo Molaro <lupus@debian.org>
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com>
* gdk/Makefile.am: added poly.h to EXTRA_DIST.
* gdk/gdkgc.c: support dashes in GdkGCPrivate
* gdk/gdkprivate.h: move here GdkPsDrawable definition
* gdk/gdkdrawable.c: gdk_drawable_register returns an int
* gdk/gdkps.c: beginning support for pixmaps, better
guessing of postscript font name, beginning of downloading
function, better emulation of dashed lines,
* gtk/testps.c: better example to show pixmaps, dashes,
font size and a4 page size.
* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
a clear/redraw, not just a redraw, so the focus
gets undrawn properly.
Wed, 21 Oct 1998 19:29:03 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
Chain to gtk_widget_unrealize() instead of duplicating
code.
* gdk/gdkps.c: fixed silly error.
* gtk/testps.c: test for string length (X<->PS).
Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
last vestiges of old DND.
Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c: Restored inner border to entries,
erase cursors to background image.
Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
it was identical to paint_flat_box().
* gtk/gtkstyle.c: Coding style fixups.
* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
test.
* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
Change 'side' for paint_[box/shadow]_gap and paint_extension
to be GtkPositionType instead of a random int.
* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
"frame" as detail - an aspectframe should draw identical
to a frame.
Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
from combine_child_shapes().
* gdk/gdkwindow.c: Merge propagate_shapes() and
propagate_combine_shapes() to remove code duplication.
Thu Nov 5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.
* clist scrollbar merges from HEAD
Tue Nov 3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)
* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden
* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that
* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }
Sun Nov 1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c
* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)
Sun Nov 1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.
* makecursors.awk
* makekeysyms.awk: bye bye
* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.
Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef
* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c
* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD
* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups
Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it
* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get
* gtk/testdnd.c: removed unused variable "buf"
Mon Oct 26 16:46:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
remove_link(), not remove()
Sun Oct 25 20:27:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): support an environment variable
GTK_MODULES= which takes a colon sperated list of module names
automatically loaded at gtk_init() startup.
Thu Oct 22 02:29:53 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.h: GtkType and macro fixups
* gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
for the file selection widget to try a completion on (set the
initial filter).
Wed Oct 14 14:34:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c: implement idle functions via GHook. this gives a
slight speed improvement and lessens code duplication.
Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: use glib endian stuff
* configure.in: don't need to check for endianness anymore
* gtk/gtkstyle.h: removed #pragma }, causing a silly warning
Wed Oct 21 17:44:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
all toplevel widgets, not toplevel windows. (I.e.,
plugs should be reset)
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
_do_ need to notify the other toplevels - by the time
the get the client messages, the RC file dates will
have been updated.
* gtk/gtkcontainer.h: Added a function call to list
every toplevel widget.
* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
Don't send client messages to _every_ window on display!
Wed, 21 Oct 1998 19:10:02 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 16:21:04 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkps.c: better guessing of postscript font name.
* gtk/Makefile.am: compile testps.c
* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
when dragging across widgets, only in drags
starting in widget.
Tue, 20 Oct 1998 12:03:46 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 15:59:49 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkprivate.h: GdkGCPrivate now stores complete info
about color, clip-rectangles (not for bitmaps yet) and
dashes.
GdkWindowPrivate now has a GdkDrawableClass member to allow
for customized draw operations.
* gdk/gdktypes.h: GdkFont now has a name member; new
GDK_WINDOW_DRAWABLE type for GdkWindow; new structure
GdkDrawableClass.
* gdk/gdkdraw.c: use engine-specific functions to draw.
* gdk/gdkwindow.c: handle destroy of GDK_WINDOW_DRAWABLE.
* gdk/gdkps.[ch]: postscript drawable engine.
* gdk/gdkdrawable.c: drawable engine registration.
* gdk/gdk.h: include drawable engine headers and declare
engine registration function.
New function: gdk_region_get_rectangles().
* gdk/gdkfont.c: store the name of the font loaded (needs
work for fontset).
* gdk/gdkgc.c: handle changes to GdkGCPrivate.
* gdk/gdkregion.c: use our own functions for Region handling
(stolen from X 6.3: Region.c region.h poly.h PolyReg.c).
* gtk/testps.c: test postscript backend.
* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
Emit "drag_end" signal at end of drag.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
* gtk/gtkdnd.c: Always send "drag_leave" to dests
without GTK_DEST_DEFAULT_MOTION.
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
Tue Oct 20 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c: rearranged some functions
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
flag of column
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
(gtk_clist_set_border): deprecated function, use
gtk_clist_set_shadow_type instead.
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
(adjust_scrollbars): some cleanups
(select_row) (unselect_row): removed. replaced by equivalent
gtk_signal_emit calls
(add_style_data): removed, use gtk_clist_style_set instead
(gtk_clist_style_set): fill in size data, after style was set.
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
(gtk_clist_set_cell_style): auto_resize columns if needed
(column_auto_resize): resize column if needed for auto_resize
(real_clear): disable auto_resize while list destroy
(resize_column): removed
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
for "gtk-embedded" data currently set by
GtkSocket, and use that to forward client message
on to embedded windows. Only reset our own toplevel -
the others will handle themselves. (Now that
GtkMenus live in GtkWindows)
* gtk/gtkctree.c : (gtk_ctree_remove_node)
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
auto_resize columns if needed
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
(real_clear): disable auto_resize while processing the tree
Tue Oct 20 12:57:10 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
for one column
* gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt
the window tree more comprehensively, so that we find
client windows hidden under non-toplevels.
Tue Oct 20 12:43:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_data_set):
Maintain the null-termintation guarantee, even when
data = NULL, length = 0. (Warn on data = NULL,
length > 0)
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
Tue Oct 20 11:55:24 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
on destroyed windows so we clear the XID table properly.
Finish up restructure of return value handling that
was half-done before.
Mon Oct 19 16:41:44 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
into function prototype for drag_data_received.
Mon Oct 19 16:40:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
client window finding code so that it works with
WM's other than fvwm.
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Sun Oct 18 22:48:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
the "GtkDrawWindow" class, which is a descendent
of the Window class which leaves its background alone.
Essentially, a toplevel drawing area, though it does
allow adding a child.
Sat Oct 17 00:40:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
merging RC styles. Report new share/themes path for
themes directory. Deref theme engines when appropriate.
* gtk/gtkclist.c: Set all backgrounds in _style_set().
Make sure that pixel for xor_gc is never 0.
* gtk/gtkctree.c: Choose colors for plus/minus more
carefully, in a hopefully style-independent fashion.
(Still needs a bit more work)
* gtk/gtkwidget.c: Don't send expose events to widgets
which are about to be resized and redrawn. (Needs a
bit more thought.)
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
drawing on tabs for newly allocated, un-sized
pages - we'll get the size wrong.
Thu Oct 1 17:38:07 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
up stupidities in last commit.
Thu Oct 1 14:25:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: When handling queued resizes, account
for handleboxes, where the widget heirarchy is different
than the window heirarchy by just queueing a resize on
the entire handlebox if the detached child is changed.
- Remove widgets from the redraw queue when reparenting,
even if not unrealizing. We queue a resize/redraw in
any case.
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
* gtk/gtkstyle.c: added check to see if the widget has been shaped
byt the app via gtk_widget_shape_combine_mask and if it has does
not reset the shape on theme change.
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c: Use g_module instead of dlopen()
Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_expose): Check
if we've changed widgets since the expose event
was queued.
Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
to restore approximate bin compatibility with the
non-themes branch. (This does break bin compat
within the themes branch.)
Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklabel.c (gtk_label_set): Eliminate a
gdk_window_clear_area() that snuck in with the
menu underlines merge.
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 23:37:26 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Fixed some remaining background drawing,
merges from main branch, cleanups.
Mon Aug 24 10:55:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
dereference NULL focus tab.
* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
functions since we need to both show/hide and
queue a redraw. (There's some duplication of drawing here,
we probably should only be queuing a redraw on the
"value" portion of the scale.)
Fri Aug 21 19:02:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
into the theme-drawing framework. We do this by making them,
like check/radio-buttons, no-window widgets with subwindows. We
then move the value by calling gtk_widget_queue_clear() and only
redraw the value in our draw() / expose() handler. A virtual
function clear_background is added which queues a clear on the
"background" portion of the widget.
Fri Aug 21 13:04:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (mark_bg_gc): Make background colors work
again. (We can't always paint the background with a
paint() function - only do that for selected text)
Mon Aug 17 20:31:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
the themes can't be built as part of the same build since
they depend on gdk_imlib.
Fri Aug 14 12:44:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
from gtkthemes.c.
* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
gtk/
- Upgrade to libtool-1.2b + patch to add shared library dependencies
for Linux. (Needs to be extended to other platforms where they
are safe)
- Check for -ldl so this branch should build on all platforms, though
themes will work on all platforms they could work on.
- Use -version and -release simultaneously: sonames stay as they are
in the current scheme, but -lgtk-1.1 changes to -lgtk.
- Added in extra -l flags to library LDFLAGS so we get shared library
dependencies against X libs and -ldl. (But not libgtk against
libgdk or libglib yet, since dependencies against uninstalled
libraries aren't portable)
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
* gtkrc.c - added api calls to find module and theme paths from gtk.
nuked gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed gtk_install_prefix global.
Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
* added gtk_install_prefix global const variabel to find where gtk is
installed.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* added ~/.gtk/lib/themes/engines/ to the default searchpath for
gtk theme engines
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Sun Oct 18 20:52:22 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwidget.c gtkmarshal.list: Change signal
@@ -669,15 +1025,6 @@ Tue Sep 15 11:06:13 1998 Owen Taylor <otaylor@redhat.com>
with unchanged dimensions, send a synthetic expose
since ForgetGravity won't expose our window.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: - Save first_cut_pixels when switching
@@ -984,12 +1331,6 @@ Sat Aug 29 14:50:56 PDT 1998 Manish Singh <yosh@gimp.org>
* gtk/testthreads.c: add #include <unistd.h> for sleep()
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
@@ -1088,187 +1429,74 @@ Fri Aug 21 13:06:04 1998 Stuart Parmenter <pavlov@gimp.org>
* gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes
such as GtkCTree function name changes
Fri Aug 21 02:31:26 1998 Tim Janik <timj@gtk.org>
Mon Aug 10 23:03:55 1998 The Rasterman <raster@redhat.com>
* Fixed minor problem in gtkhandlebox.c with drawing, and some
notebook stuff. Also pixmap theme is now "clean" again.
Mon Aug 10 23:03:55 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.h:
* gtk/gtkmain.c (gtk_check_version): added a function to perform a
binary version check, returning a static string for error descriptions,
or NULL on success.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com>
Mon Aug 10 23:09:30 EDT 1998
* Added a few drawing fixes for notebook and other widgets. finished
pixmap theme up to the level that can be supported so far. (need to
add path discovery 9ie where is the rc fiel from - add to pixmap
path so we can get theimages from there too). then we can package
themes. After that need to add to theme seartch path stuff in users
home dir.
Thu Aug 6 16:49:25 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.
* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
drawing area, draw in an expose handler.
* gtk/gtktext.c (correct_cache_insert): Fiddled around
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)
* gtk/gtknotebook.c (gtk_notebook_expose): Check for
empty current page.
Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
Wed Aug 5 16:13:15 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: silly visual fixes
* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
creation of GC's so that they will be set before
they are used for map events (why are they used there?)
* gtk/testgtk.c: call gdk_rgb_init so color preview test actually
works
* gtk/gtkwidget.c: Fixed mistake that caused widgets to
be queued in multiple times in the queue.
1998-08-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do
anything if the event's window is not the bin window.
(gtk_handle_box_motion): Likewise.
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
1998-08-19 Raph Levien <raph@gimp.org>
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_color_preview): pushed the colormap and
visual so it would work better with GdkRgb.
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
1998-08-19 Raph Levien <raph@gimp.org>
Tue Aug 4 19:12:14 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a
4bpp static_color mode (for vga displays). Also fixed a '64' value
in the dither matrix, which was causing one pixel out of 16k to be
dithered wrong.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
handling of partially clipped areas.
* gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting
most of the contents. This is an API change - any apps that relied
on the internal structure of GtkPreview will need some change -
most notably in the use of reserved colors. The Gimp needed
changes in this regard.
Wed Aug 5 02:57:20 1998 Lars Hamann <lars@gtk.org>
Wed Aug 19 00:11:14 1998 Tim Janik <timj@gtk.org>
* gtk/gtkctree.h:
* gtk/gtkctree.c:
(gtk_ctree_find): changed to return a gboolean
(gtk_ctree_insert_gnode): new function for recursive insertion of a
GNode tree.
(gtk_ctree_real_select_recursive): fix for extended selection
(gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too.
(gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag
* gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without
G_ENABLE_DEBUG being defined (specifically --gtk-module= and
--g-fatal-warnings), noticed by miguel.
Tue Aug 4 16:18:26 1998 Tim Janik <timj@gtk.org>
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 0, interface age 0.
GLib version 1.1.1 is now required at minimum.
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
* gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv
in case of show_tabs == NULL
Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments
to --g-fatal-warnings again. this option now causes log levels of
WARNING and CRITICAL to abort().
* gdk/gdk.c:
* gdk/gdkdnd.c:
* gdk/gdkcc.c:
* gdk/gdkfont.c:
* gdk/gdkwindow.c:
* gdk/gdkvisual.c:
* gtk/gtkwidget.c:
* gtk/gtktypeutils.c:
* gtk/gtktree.c:
* gtk/gtkfontsel.c:
* gtk/gtkmain.c:
* gtk/gtkobject.c:
* gtk/gtkpreview.c:
* gtk/gtkselection.c:
* gtk/gtktext.c:
* gtk/gtktree.c:
* gtk/gtktreeitem.c:
did a global search&replace to substitute g_print() calls with
g_message(). libraries shouldn't use printf(), g_print() or
g_printerr() at all.
a bunch of the replacements should probably be wrapped into the
G{D|T}K_NOTE() macros, so they are special cased for debugging
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
* gdk/gdkrgb.c: Further speedups of the 565_d case. It's
impressively fast now - about 4.65 Mpix/s on an IBM TP 600
running a PII 233. It's synced with the 0.0.5 release of
GdkRgb.
Tue Aug 18 00:29:13 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h:
(struct _GtkCListClass): new class methods:
(sort_list) (insert_row) (remove_row) (set_cell_contents)
* gtk/gtkclist.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): fix to avoid problems with cell types != CELL_TEXT
* gtk/gtkctree.h :
(gtk_ctree_export_to_gnode): new function to export a ctree as gnode
(gtk_ctree_node_is_visible): new function to return visibility state
of a node
(gtk_ctree_show_stub): new function to set visibility of root stub
renamed functions :
(gtk_ctree_insert) -> (gtk_ctree_insert_node)
(gtk_ctree_remove) -> (gtk_ctree_remove_node)
(gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr)
(gtk_ctree_set_text) -> (gtk_ctree_node_set_text)
(gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap)
(gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext)
(gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift)
(gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type)
(gtk_ctree_get_text) -> (gtk_ctree_node_get_text)
(gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap)
(gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext)
(gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground)
(gtk_ctree_set_background) -> (gtk_ctree_node_set_background)
(gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data)
(gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full)
(gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data)
(gtk_ctree_moveto) -> (gtk_ctree_node_moveto)
(gtk_ctree_sort) -> (gtk_ctree_sort_node)
(gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable)
* gtk/gtkctree.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): removed. CTree now also compares two GtkCTreeRows
instead of two GtkCTreeNodes.
(gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after
unlinking the node
(real_tree_expand) (real_tree_collapse): fix for refcounting of
node pixmaps
(set_node_info): call gtk_ctree_node_set_pixtext instead of
manipulating the row itself
* gtk/testgtk.c: use renamed functions of GtkCTree.
new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode
at work.
* docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version
of the Gtk+ tutorial, contributed by Eric Jacoboni <jaco@dotcom.fr>.
Mon Aug 17 15:31:38 1998 Tim Janik <timj@gtk.org>
@@ -1673,6 +1901,137 @@ Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* gtk/docs/man: new directory
* gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page
Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
* Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* YES YES YES YES YES clist borders work again! YES! YES YES! gimme
more baby oooh yeah more more MORE YES YES.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* hopefully fixed problem wiht togglebuttons acting like
radiobuttons in gtktogglebutton.c
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed another drawing buglet in the frame drawing code (actually
in the clearing code but anyway in gtkstyle.c)
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed warning from colorsel widget...
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed defautl drawing code to no longer clobber the original style
pixmap bgs as it did and added a helper funciton og gtkstyle.c to
help with this.
Thu Jul 30 18:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
* gtk/gtktooltips.c: Pass a widget (the window) to the
drawing function instead of the GtkTooltips.
Thu Jul 30 17:27:10 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c: Abstract out checking for shape
extension into a function.
* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
Remove extra callls to gtk_window_draw().
Thu Jul 30 11:18:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
* themes/th_main.c: Moved messages around so they are
printed before destroying strings.
Wed Jul 29 16:56:07 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c: Fairly simple implementation of expose compression.
(No GraphicsExpose compression yet, always compress
with the equivalent of XtCompressMultiple - no compression
of Expose events across non-Expose events)
* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
Find rectangle bounding two rectangles.
* gtk/gtkstyle.c: Set clip rects for a few extra GC's
in gdk_default_draw_shadow()
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed drawing functions to handle switching themes on the fly
gracefully and look decent.
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
* Added all the theme drawing code to all widgets, fixed up minor
nigglies in some widgets when it comes to themes, seem to be
running into some funky behavior with clipping rects in GC's. Too
many files to list here. (all files that now use gtk_paint_* are
affected).
Tue Jul 28 22:49:16 1998 Owen Taylor <otaylor@redhat.com>
* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
Set up the demo theme so it is loaded from the RC file.
* themes/th_draw.c: Alleviate the hardcoded paths a wee
bit. (use $HOME/themes/)
* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
the RC file via dlopen()
Tue Jul 28 20:30:56 1998 Owen Taylor <otaylor@redhat.com>
Internal handling of styles and RC styles pretty much
completely reworked for Theme work.
* gtkthemes.[ch]:
- Added routines for virtualization of RcStyle and Style handling.
- Temporary "sample" inline theme-engine. (Does nothing
but print out a few messages.
* gtkrc.[ch]
- Made GtkRcStyle public, added flags to tell if particular
colors have been set.
- RC Styles are "transparent", and the final style for
a widget is the composition of all matching styles
- Added pointer to GtkThemeEngine, and gpointer engine_data
to RC style and style.
- Parse "engine" keyword, load the appropriate theme engine
and call the engine's parser.
* gtkstyle.[ch]
- Keep a GtkRcStyle * in styles created from Rc Styles.
- Load up images from RC file at style attachment time.
- Call ->engine->foo() at appropriate times.
- Don't use a GCache. All incarnations for a style are
just linked together in a list, depend on the RC style
code to find the existing copy.
Tue Jul 28 14:41:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch]: Added the concept of queued redraws
of partial areas. This can be done either relative
to the existing windows (gtk_widget_queue_clear[_area]())
or relative to the future allocation of the widget
(gtk_widget_queue_draw[_area]).
The initial implementation is pretty braindead, but
can be improved.
* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
in favor of gtk_widget_queue_clear().
* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
flags in favor of gtk_widget_queue_clear()
Tue Jul 28 00:15:28 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* docs/gdk.sgml: new format for GDK documentation. Eventually
plan to remove gdk.texi, but not quite yet. Just getting
started.
Tue Jul 28 00:03:20 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing
+606 -247
View File
@@ -1,91 +1,447 @@
Fri, 13 Nov 1998 18:54:13 +0100 Paolo Molaro <lupus@debian.org>
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com>
* gdk/Makefile.am: added poly.h to EXTRA_DIST.
* gdk/gdkgc.c: support dashes in GdkGCPrivate
* gdk/gdkprivate.h: move here GdkPsDrawable definition
* gdk/gdkdrawable.c: gdk_drawable_register returns an int
* gdk/gdkps.c: beginning support for pixmaps, better
guessing of postscript font name, beginning of downloading
function, better emulation of dashed lines,
* gtk/testps.c: better example to show pixmaps, dashes,
font size and a4 page size.
* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
a clear/redraw, not just a redraw, so the focus
gets undrawn properly.
Wed, 21 Oct 1998 19:29:03 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
Chain to gtk_widget_unrealize() instead of duplicating
code.
* gdk/gdkps.c: fixed silly error.
* gtk/testps.c: test for string length (X<->PS).
Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
last vestiges of old DND.
Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c: Restored inner border to entries,
erase cursors to background image.
Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
it was identical to paint_flat_box().
* gtk/gtkstyle.c: Coding style fixups.
* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
test.
* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
Change 'side' for paint_[box/shadow]_gap and paint_extension
to be GtkPositionType instead of a random int.
* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
"frame" as detail - an aspectframe should draw identical
to a frame.
Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
from combine_child_shapes().
* gdk/gdkwindow.c: Merge propagate_shapes() and
propagate_combine_shapes() to remove code duplication.
Thu Nov 5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.
* clist scrollbar merges from HEAD
Tue Nov 3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)
* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden
* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that
* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }
Sun Nov 1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c
* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)
Sun Nov 1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.
* makecursors.awk
* makekeysyms.awk: bye bye
* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.
Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef
* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c
* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD
* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups
Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it
* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get
* gtk/testdnd.c: removed unused variable "buf"
Mon Oct 26 16:46:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
remove_link(), not remove()
Sun Oct 25 20:27:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): support an environment variable
GTK_MODULES= which takes a colon sperated list of module names
automatically loaded at gtk_init() startup.
Thu Oct 22 02:29:53 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.h: GtkType and macro fixups
* gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
for the file selection widget to try a completion on (set the
initial filter).
Wed Oct 14 14:34:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c: implement idle functions via GHook. this gives a
slight speed improvement and lessens code duplication.
Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: use glib endian stuff
* configure.in: don't need to check for endianness anymore
* gtk/gtkstyle.h: removed #pragma }, causing a silly warning
Wed Oct 21 17:44:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
all toplevel widgets, not toplevel windows. (I.e.,
plugs should be reset)
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
_do_ need to notify the other toplevels - by the time
the get the client messages, the RC file dates will
have been updated.
* gtk/gtkcontainer.h: Added a function call to list
every toplevel widget.
* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
Don't send client messages to _every_ window on display!
Wed, 21 Oct 1998 19:10:02 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 16:21:04 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkps.c: better guessing of postscript font name.
* gtk/Makefile.am: compile testps.c
* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
when dragging across widgets, only in drags
starting in widget.
Tue, 20 Oct 1998 12:03:46 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 15:59:49 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkprivate.h: GdkGCPrivate now stores complete info
about color, clip-rectangles (not for bitmaps yet) and
dashes.
GdkWindowPrivate now has a GdkDrawableClass member to allow
for customized draw operations.
* gdk/gdktypes.h: GdkFont now has a name member; new
GDK_WINDOW_DRAWABLE type for GdkWindow; new structure
GdkDrawableClass.
* gdk/gdkdraw.c: use engine-specific functions to draw.
* gdk/gdkwindow.c: handle destroy of GDK_WINDOW_DRAWABLE.
* gdk/gdkps.[ch]: postscript drawable engine.
* gdk/gdkdrawable.c: drawable engine registration.
* gdk/gdk.h: include drawable engine headers and declare
engine registration function.
New function: gdk_region_get_rectangles().
* gdk/gdkfont.c: store the name of the font loaded (needs
work for fontset).
* gdk/gdkgc.c: handle changes to GdkGCPrivate.
* gdk/gdkregion.c: use our own functions for Region handling
(stolen from X 6.3: Region.c region.h poly.h PolyReg.c).
* gtk/testps.c: test postscript backend.
* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
Emit "drag_end" signal at end of drag.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
* gtk/gtkdnd.c: Always send "drag_leave" to dests
without GTK_DEST_DEFAULT_MOTION.
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
Tue Oct 20 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c: rearranged some functions
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
flag of column
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
(gtk_clist_set_border): deprecated function, use
gtk_clist_set_shadow_type instead.
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
(adjust_scrollbars): some cleanups
(select_row) (unselect_row): removed. replaced by equivalent
gtk_signal_emit calls
(add_style_data): removed, use gtk_clist_style_set instead
(gtk_clist_style_set): fill in size data, after style was set.
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
(gtk_clist_set_cell_style): auto_resize columns if needed
(column_auto_resize): resize column if needed for auto_resize
(real_clear): disable auto_resize while list destroy
(resize_column): removed
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
for "gtk-embedded" data currently set by
GtkSocket, and use that to forward client message
on to embedded windows. Only reset our own toplevel -
the others will handle themselves. (Now that
GtkMenus live in GtkWindows)
* gtk/gtkctree.c : (gtk_ctree_remove_node)
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
auto_resize columns if needed
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
(real_clear): disable auto_resize while processing the tree
Tue Oct 20 12:57:10 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
for one column
* gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt
the window tree more comprehensively, so that we find
client windows hidden under non-toplevels.
Tue Oct 20 12:43:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_data_set):
Maintain the null-termintation guarantee, even when
data = NULL, length = 0. (Warn on data = NULL,
length > 0)
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
Tue Oct 20 11:55:24 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
on destroyed windows so we clear the XID table properly.
Finish up restructure of return value handling that
was half-done before.
Mon Oct 19 16:41:44 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
into function prototype for drag_data_received.
Mon Oct 19 16:40:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
client window finding code so that it works with
WM's other than fvwm.
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Sun Oct 18 22:48:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
the "GtkDrawWindow" class, which is a descendent
of the Window class which leaves its background alone.
Essentially, a toplevel drawing area, though it does
allow adding a child.
Sat Oct 17 00:40:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
merging RC styles. Report new share/themes path for
themes directory. Deref theme engines when appropriate.
* gtk/gtkclist.c: Set all backgrounds in _style_set().
Make sure that pixel for xor_gc is never 0.
* gtk/gtkctree.c: Choose colors for plus/minus more
carefully, in a hopefully style-independent fashion.
(Still needs a bit more work)
* gtk/gtkwidget.c: Don't send expose events to widgets
which are about to be resized and redrawn. (Needs a
bit more thought.)
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
drawing on tabs for newly allocated, un-sized
pages - we'll get the size wrong.
Thu Oct 1 17:38:07 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
up stupidities in last commit.
Thu Oct 1 14:25:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: When handling queued resizes, account
for handleboxes, where the widget heirarchy is different
than the window heirarchy by just queueing a resize on
the entire handlebox if the detached child is changed.
- Remove widgets from the redraw queue when reparenting,
even if not unrealizing. We queue a resize/redraw in
any case.
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
* gtk/gtkstyle.c: added check to see if the widget has been shaped
byt the app via gtk_widget_shape_combine_mask and if it has does
not reset the shape on theme change.
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c: Use g_module instead of dlopen()
Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_expose): Check
if we've changed widgets since the expose event
was queued.
Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
to restore approximate bin compatibility with the
non-themes branch. (This does break bin compat
within the themes branch.)
Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklabel.c (gtk_label_set): Eliminate a
gdk_window_clear_area() that snuck in with the
menu underlines merge.
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 23:37:26 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Fixed some remaining background drawing,
merges from main branch, cleanups.
Mon Aug 24 10:55:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
dereference NULL focus tab.
* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
functions since we need to both show/hide and
queue a redraw. (There's some duplication of drawing here,
we probably should only be queuing a redraw on the
"value" portion of the scale.)
Fri Aug 21 19:02:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
into the theme-drawing framework. We do this by making them,
like check/radio-buttons, no-window widgets with subwindows. We
then move the value by calling gtk_widget_queue_clear() and only
redraw the value in our draw() / expose() handler. A virtual
function clear_background is added which queues a clear on the
"background" portion of the widget.
Fri Aug 21 13:04:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (mark_bg_gc): Make background colors work
again. (We can't always paint the background with a
paint() function - only do that for selected text)
Mon Aug 17 20:31:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
the themes can't be built as part of the same build since
they depend on gdk_imlib.
Fri Aug 14 12:44:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
from gtkthemes.c.
* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
gtk/
- Upgrade to libtool-1.2b + patch to add shared library dependencies
for Linux. (Needs to be extended to other platforms where they
are safe)
- Check for -ldl so this branch should build on all platforms, though
themes will work on all platforms they could work on.
- Use -version and -release simultaneously: sonames stay as they are
in the current scheme, but -lgtk-1.1 changes to -lgtk.
- Added in extra -l flags to library LDFLAGS so we get shared library
dependencies against X libs and -ldl. (But not libgtk against
libgdk or libglib yet, since dependencies against uninstalled
libraries aren't portable)
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
* gtkrc.c - added api calls to find module and theme paths from gtk.
nuked gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed gtk_install_prefix global.
Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
* added gtk_install_prefix global const variabel to find where gtk is
installed.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* added ~/.gtk/lib/themes/engines/ to the default searchpath for
gtk theme engines
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Sun Oct 18 20:52:22 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwidget.c gtkmarshal.list: Change signal
@@ -669,15 +1025,6 @@ Tue Sep 15 11:06:13 1998 Owen Taylor <otaylor@redhat.com>
with unchanged dimensions, send a synthetic expose
since ForgetGravity won't expose our window.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: - Save first_cut_pixels when switching
@@ -984,12 +1331,6 @@ Sat Aug 29 14:50:56 PDT 1998 Manish Singh <yosh@gimp.org>
* gtk/testthreads.c: add #include <unistd.h> for sleep()
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
@@ -1088,187 +1429,74 @@ Fri Aug 21 13:06:04 1998 Stuart Parmenter <pavlov@gimp.org>
* gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes
such as GtkCTree function name changes
Fri Aug 21 02:31:26 1998 Tim Janik <timj@gtk.org>
Mon Aug 10 23:03:55 1998 The Rasterman <raster@redhat.com>
* Fixed minor problem in gtkhandlebox.c with drawing, and some
notebook stuff. Also pixmap theme is now "clean" again.
Mon Aug 10 23:03:55 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.h:
* gtk/gtkmain.c (gtk_check_version): added a function to perform a
binary version check, returning a static string for error descriptions,
or NULL on success.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com>
Mon Aug 10 23:09:30 EDT 1998
* Added a few drawing fixes for notebook and other widgets. finished
pixmap theme up to the level that can be supported so far. (need to
add path discovery 9ie where is the rc fiel from - add to pixmap
path so we can get theimages from there too). then we can package
themes. After that need to add to theme seartch path stuff in users
home dir.
Thu Aug 6 16:49:25 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.
* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
drawing area, draw in an expose handler.
* gtk/gtktext.c (correct_cache_insert): Fiddled around
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)
* gtk/gtknotebook.c (gtk_notebook_expose): Check for
empty current page.
Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
Wed Aug 5 16:13:15 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: silly visual fixes
* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
creation of GC's so that they will be set before
they are used for map events (why are they used there?)
* gtk/testgtk.c: call gdk_rgb_init so color preview test actually
works
* gtk/gtkwidget.c: Fixed mistake that caused widgets to
be queued in multiple times in the queue.
1998-08-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do
anything if the event's window is not the bin window.
(gtk_handle_box_motion): Likewise.
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
1998-08-19 Raph Levien <raph@gimp.org>
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_color_preview): pushed the colormap and
visual so it would work better with GdkRgb.
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
1998-08-19 Raph Levien <raph@gimp.org>
Tue Aug 4 19:12:14 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a
4bpp static_color mode (for vga displays). Also fixed a '64' value
in the dither matrix, which was causing one pixel out of 16k to be
dithered wrong.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
handling of partially clipped areas.
* gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting
most of the contents. This is an API change - any apps that relied
on the internal structure of GtkPreview will need some change -
most notably in the use of reserved colors. The Gimp needed
changes in this regard.
Wed Aug 5 02:57:20 1998 Lars Hamann <lars@gtk.org>
Wed Aug 19 00:11:14 1998 Tim Janik <timj@gtk.org>
* gtk/gtkctree.h:
* gtk/gtkctree.c:
(gtk_ctree_find): changed to return a gboolean
(gtk_ctree_insert_gnode): new function for recursive insertion of a
GNode tree.
(gtk_ctree_real_select_recursive): fix for extended selection
(gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too.
(gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag
* gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without
G_ENABLE_DEBUG being defined (specifically --gtk-module= and
--g-fatal-warnings), noticed by miguel.
Tue Aug 4 16:18:26 1998 Tim Janik <timj@gtk.org>
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 0, interface age 0.
GLib version 1.1.1 is now required at minimum.
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
* gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv
in case of show_tabs == NULL
Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments
to --g-fatal-warnings again. this option now causes log levels of
WARNING and CRITICAL to abort().
* gdk/gdk.c:
* gdk/gdkdnd.c:
* gdk/gdkcc.c:
* gdk/gdkfont.c:
* gdk/gdkwindow.c:
* gdk/gdkvisual.c:
* gtk/gtkwidget.c:
* gtk/gtktypeutils.c:
* gtk/gtktree.c:
* gtk/gtkfontsel.c:
* gtk/gtkmain.c:
* gtk/gtkobject.c:
* gtk/gtkpreview.c:
* gtk/gtkselection.c:
* gtk/gtktext.c:
* gtk/gtktree.c:
* gtk/gtktreeitem.c:
did a global search&replace to substitute g_print() calls with
g_message(). libraries shouldn't use printf(), g_print() or
g_printerr() at all.
a bunch of the replacements should probably be wrapped into the
G{D|T}K_NOTE() macros, so they are special cased for debugging
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
* gdk/gdkrgb.c: Further speedups of the 565_d case. It's
impressively fast now - about 4.65 Mpix/s on an IBM TP 600
running a PII 233. It's synced with the 0.0.5 release of
GdkRgb.
Tue Aug 18 00:29:13 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h:
(struct _GtkCListClass): new class methods:
(sort_list) (insert_row) (remove_row) (set_cell_contents)
* gtk/gtkclist.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): fix to avoid problems with cell types != CELL_TEXT
* gtk/gtkctree.h :
(gtk_ctree_export_to_gnode): new function to export a ctree as gnode
(gtk_ctree_node_is_visible): new function to return visibility state
of a node
(gtk_ctree_show_stub): new function to set visibility of root stub
renamed functions :
(gtk_ctree_insert) -> (gtk_ctree_insert_node)
(gtk_ctree_remove) -> (gtk_ctree_remove_node)
(gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr)
(gtk_ctree_set_text) -> (gtk_ctree_node_set_text)
(gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap)
(gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext)
(gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift)
(gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type)
(gtk_ctree_get_text) -> (gtk_ctree_node_get_text)
(gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap)
(gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext)
(gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground)
(gtk_ctree_set_background) -> (gtk_ctree_node_set_background)
(gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data)
(gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full)
(gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data)
(gtk_ctree_moveto) -> (gtk_ctree_node_moveto)
(gtk_ctree_sort) -> (gtk_ctree_sort_node)
(gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable)
* gtk/gtkctree.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): removed. CTree now also compares two GtkCTreeRows
instead of two GtkCTreeNodes.
(gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after
unlinking the node
(real_tree_expand) (real_tree_collapse): fix for refcounting of
node pixmaps
(set_node_info): call gtk_ctree_node_set_pixtext instead of
manipulating the row itself
* gtk/testgtk.c: use renamed functions of GtkCTree.
new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode
at work.
* docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version
of the Gtk+ tutorial, contributed by Eric Jacoboni <jaco@dotcom.fr>.
Mon Aug 17 15:31:38 1998 Tim Janik <timj@gtk.org>
@@ -1673,6 +1901,137 @@ Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* gtk/docs/man: new directory
* gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page
Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
* Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* YES YES YES YES YES clist borders work again! YES! YES YES! gimme
more baby oooh yeah more more MORE YES YES.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* hopefully fixed problem wiht togglebuttons acting like
radiobuttons in gtktogglebutton.c
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed another drawing buglet in the frame drawing code (actually
in the clearing code but anyway in gtkstyle.c)
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed warning from colorsel widget...
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed defautl drawing code to no longer clobber the original style
pixmap bgs as it did and added a helper funciton og gtkstyle.c to
help with this.
Thu Jul 30 18:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
* gtk/gtktooltips.c: Pass a widget (the window) to the
drawing function instead of the GtkTooltips.
Thu Jul 30 17:27:10 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c: Abstract out checking for shape
extension into a function.
* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
Remove extra callls to gtk_window_draw().
Thu Jul 30 11:18:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
* themes/th_main.c: Moved messages around so they are
printed before destroying strings.
Wed Jul 29 16:56:07 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c: Fairly simple implementation of expose compression.
(No GraphicsExpose compression yet, always compress
with the equivalent of XtCompressMultiple - no compression
of Expose events across non-Expose events)
* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
Find rectangle bounding two rectangles.
* gtk/gtkstyle.c: Set clip rects for a few extra GC's
in gdk_default_draw_shadow()
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed drawing functions to handle switching themes on the fly
gracefully and look decent.
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
* Added all the theme drawing code to all widgets, fixed up minor
nigglies in some widgets when it comes to themes, seem to be
running into some funky behavior with clipping rects in GC's. Too
many files to list here. (all files that now use gtk_paint_* are
affected).
Tue Jul 28 22:49:16 1998 Owen Taylor <otaylor@redhat.com>
* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
Set up the demo theme so it is loaded from the RC file.
* themes/th_draw.c: Alleviate the hardcoded paths a wee
bit. (use $HOME/themes/)
* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
the RC file via dlopen()
Tue Jul 28 20:30:56 1998 Owen Taylor <otaylor@redhat.com>
Internal handling of styles and RC styles pretty much
completely reworked for Theme work.
* gtkthemes.[ch]:
- Added routines for virtualization of RcStyle and Style handling.
- Temporary "sample" inline theme-engine. (Does nothing
but print out a few messages.
* gtkrc.[ch]
- Made GtkRcStyle public, added flags to tell if particular
colors have been set.
- RC Styles are "transparent", and the final style for
a widget is the composition of all matching styles
- Added pointer to GtkThemeEngine, and gpointer engine_data
to RC style and style.
- Parse "engine" keyword, load the appropriate theme engine
and call the engine's parser.
* gtkstyle.[ch]
- Keep a GtkRcStyle * in styles created from Rc Styles.
- Load up images from RC file at style attachment time.
- Call ->engine->foo() at appropriate times.
- Don't use a GCache. All incarnations for a style are
just linked together in a list, depend on the RC style
code to find the existing copy.
Tue Jul 28 14:41:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch]: Added the concept of queued redraws
of partial areas. This can be done either relative
to the existing windows (gtk_widget_queue_clear[_area]())
or relative to the future allocation of the widget
(gtk_widget_queue_draw[_area]).
The initial implementation is pretty braindead, but
can be improved.
* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
in favor of gtk_widget_queue_clear().
* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
flags in favor of gtk_widget_queue_clear()
Tue Jul 28 00:15:28 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* docs/gdk.sgml: new format for GDK documentation. Eventually
plan to remove gdk.texi, but not quite yet. Just getting
started.
Tue Jul 28 00:03:20 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing
+606 -247
View File
@@ -1,91 +1,447 @@
Fri, 13 Nov 1998 18:54:13 +0100 Paolo Molaro <lupus@debian.org>
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com>
* gdk/Makefile.am: added poly.h to EXTRA_DIST.
* gdk/gdkgc.c: support dashes in GdkGCPrivate
* gdk/gdkprivate.h: move here GdkPsDrawable definition
* gdk/gdkdrawable.c: gdk_drawable_register returns an int
* gdk/gdkps.c: beginning support for pixmaps, better
guessing of postscript font name, beginning of downloading
function, better emulation of dashed lines,
* gtk/testps.c: better example to show pixmaps, dashes,
font size and a4 page size.
* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
a clear/redraw, not just a redraw, so the focus
gets undrawn properly.
Wed, 21 Oct 1998 19:29:03 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
Chain to gtk_widget_unrealize() instead of duplicating
code.
* gdk/gdkps.c: fixed silly error.
* gtk/testps.c: test for string length (X<->PS).
Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
last vestiges of old DND.
Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c: Restored inner border to entries,
erase cursors to background image.
Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
it was identical to paint_flat_box().
* gtk/gtkstyle.c: Coding style fixups.
* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
test.
* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
Change 'side' for paint_[box/shadow]_gap and paint_extension
to be GtkPositionType instead of a random int.
* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
"frame" as detail - an aspectframe should draw identical
to a frame.
Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
from combine_child_shapes().
* gdk/gdkwindow.c: Merge propagate_shapes() and
propagate_combine_shapes() to remove code duplication.
Thu Nov 5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.
* clist scrollbar merges from HEAD
Tue Nov 3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)
* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden
* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that
* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }
Sun Nov 1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c
* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)
Sun Nov 1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.
* makecursors.awk
* makekeysyms.awk: bye bye
* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.
Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef
* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c
* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD
* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups
Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it
* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get
* gtk/testdnd.c: removed unused variable "buf"
Mon Oct 26 16:46:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
remove_link(), not remove()
Sun Oct 25 20:27:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): support an environment variable
GTK_MODULES= which takes a colon sperated list of module names
automatically loaded at gtk_init() startup.
Thu Oct 22 02:29:53 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.h: GtkType and macro fixups
* gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
for the file selection widget to try a completion on (set the
initial filter).
Wed Oct 14 14:34:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c: implement idle functions via GHook. this gives a
slight speed improvement and lessens code duplication.
Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: use glib endian stuff
* configure.in: don't need to check for endianness anymore
* gtk/gtkstyle.h: removed #pragma }, causing a silly warning
Wed Oct 21 17:44:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
all toplevel widgets, not toplevel windows. (I.e.,
plugs should be reset)
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
_do_ need to notify the other toplevels - by the time
the get the client messages, the RC file dates will
have been updated.
* gtk/gtkcontainer.h: Added a function call to list
every toplevel widget.
* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
Don't send client messages to _every_ window on display!
Wed, 21 Oct 1998 19:10:02 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 16:21:04 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkps.c: better guessing of postscript font name.
* gtk/Makefile.am: compile testps.c
* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
when dragging across widgets, only in drags
starting in widget.
Tue, 20 Oct 1998 12:03:46 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 15:59:49 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkprivate.h: GdkGCPrivate now stores complete info
about color, clip-rectangles (not for bitmaps yet) and
dashes.
GdkWindowPrivate now has a GdkDrawableClass member to allow
for customized draw operations.
* gdk/gdktypes.h: GdkFont now has a name member; new
GDK_WINDOW_DRAWABLE type for GdkWindow; new structure
GdkDrawableClass.
* gdk/gdkdraw.c: use engine-specific functions to draw.
* gdk/gdkwindow.c: handle destroy of GDK_WINDOW_DRAWABLE.
* gdk/gdkps.[ch]: postscript drawable engine.
* gdk/gdkdrawable.c: drawable engine registration.
* gdk/gdk.h: include drawable engine headers and declare
engine registration function.
New function: gdk_region_get_rectangles().
* gdk/gdkfont.c: store the name of the font loaded (needs
work for fontset).
* gdk/gdkgc.c: handle changes to GdkGCPrivate.
* gdk/gdkregion.c: use our own functions for Region handling
(stolen from X 6.3: Region.c region.h poly.h PolyReg.c).
* gtk/testps.c: test postscript backend.
* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
Emit "drag_end" signal at end of drag.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
* gtk/gtkdnd.c: Always send "drag_leave" to dests
without GTK_DEST_DEFAULT_MOTION.
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
Tue Oct 20 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c: rearranged some functions
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
flag of column
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
(gtk_clist_set_border): deprecated function, use
gtk_clist_set_shadow_type instead.
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
(adjust_scrollbars): some cleanups
(select_row) (unselect_row): removed. replaced by equivalent
gtk_signal_emit calls
(add_style_data): removed, use gtk_clist_style_set instead
(gtk_clist_style_set): fill in size data, after style was set.
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
(gtk_clist_set_cell_style): auto_resize columns if needed
(column_auto_resize): resize column if needed for auto_resize
(real_clear): disable auto_resize while list destroy
(resize_column): removed
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
for "gtk-embedded" data currently set by
GtkSocket, and use that to forward client message
on to embedded windows. Only reset our own toplevel -
the others will handle themselves. (Now that
GtkMenus live in GtkWindows)
* gtk/gtkctree.c : (gtk_ctree_remove_node)
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
auto_resize columns if needed
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
(real_clear): disable auto_resize while processing the tree
Tue Oct 20 12:57:10 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
for one column
* gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt
the window tree more comprehensively, so that we find
client windows hidden under non-toplevels.
Tue Oct 20 12:43:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_data_set):
Maintain the null-termintation guarantee, even when
data = NULL, length = 0. (Warn on data = NULL,
length > 0)
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
Tue Oct 20 11:55:24 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
on destroyed windows so we clear the XID table properly.
Finish up restructure of return value handling that
was half-done before.
Mon Oct 19 16:41:44 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
into function prototype for drag_data_received.
Mon Oct 19 16:40:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
client window finding code so that it works with
WM's other than fvwm.
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Sun Oct 18 22:48:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
the "GtkDrawWindow" class, which is a descendent
of the Window class which leaves its background alone.
Essentially, a toplevel drawing area, though it does
allow adding a child.
Sat Oct 17 00:40:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
merging RC styles. Report new share/themes path for
themes directory. Deref theme engines when appropriate.
* gtk/gtkclist.c: Set all backgrounds in _style_set().
Make sure that pixel for xor_gc is never 0.
* gtk/gtkctree.c: Choose colors for plus/minus more
carefully, in a hopefully style-independent fashion.
(Still needs a bit more work)
* gtk/gtkwidget.c: Don't send expose events to widgets
which are about to be resized and redrawn. (Needs a
bit more thought.)
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
drawing on tabs for newly allocated, un-sized
pages - we'll get the size wrong.
Thu Oct 1 17:38:07 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
up stupidities in last commit.
Thu Oct 1 14:25:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: When handling queued resizes, account
for handleboxes, where the widget heirarchy is different
than the window heirarchy by just queueing a resize on
the entire handlebox if the detached child is changed.
- Remove widgets from the redraw queue when reparenting,
even if not unrealizing. We queue a resize/redraw in
any case.
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
* gtk/gtkstyle.c: added check to see if the widget has been shaped
byt the app via gtk_widget_shape_combine_mask and if it has does
not reset the shape on theme change.
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c: Use g_module instead of dlopen()
Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_expose): Check
if we've changed widgets since the expose event
was queued.
Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
to restore approximate bin compatibility with the
non-themes branch. (This does break bin compat
within the themes branch.)
Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklabel.c (gtk_label_set): Eliminate a
gdk_window_clear_area() that snuck in with the
menu underlines merge.
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 23:37:26 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Fixed some remaining background drawing,
merges from main branch, cleanups.
Mon Aug 24 10:55:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
dereference NULL focus tab.
* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
functions since we need to both show/hide and
queue a redraw. (There's some duplication of drawing here,
we probably should only be queuing a redraw on the
"value" portion of the scale.)
Fri Aug 21 19:02:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
into the theme-drawing framework. We do this by making them,
like check/radio-buttons, no-window widgets with subwindows. We
then move the value by calling gtk_widget_queue_clear() and only
redraw the value in our draw() / expose() handler. A virtual
function clear_background is added which queues a clear on the
"background" portion of the widget.
Fri Aug 21 13:04:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (mark_bg_gc): Make background colors work
again. (We can't always paint the background with a
paint() function - only do that for selected text)
Mon Aug 17 20:31:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
the themes can't be built as part of the same build since
they depend on gdk_imlib.
Fri Aug 14 12:44:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
from gtkthemes.c.
* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
gtk/
- Upgrade to libtool-1.2b + patch to add shared library dependencies
for Linux. (Needs to be extended to other platforms where they
are safe)
- Check for -ldl so this branch should build on all platforms, though
themes will work on all platforms they could work on.
- Use -version and -release simultaneously: sonames stay as they are
in the current scheme, but -lgtk-1.1 changes to -lgtk.
- Added in extra -l flags to library LDFLAGS so we get shared library
dependencies against X libs and -ldl. (But not libgtk against
libgdk or libglib yet, since dependencies against uninstalled
libraries aren't portable)
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
* gtkrc.c - added api calls to find module and theme paths from gtk.
nuked gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed gtk_install_prefix global.
Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
* added gtk_install_prefix global const variabel to find where gtk is
installed.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* added ~/.gtk/lib/themes/engines/ to the default searchpath for
gtk theme engines
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Sun Oct 18 20:52:22 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwidget.c gtkmarshal.list: Change signal
@@ -669,15 +1025,6 @@ Tue Sep 15 11:06:13 1998 Owen Taylor <otaylor@redhat.com>
with unchanged dimensions, send a synthetic expose
since ForgetGravity won't expose our window.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: - Save first_cut_pixels when switching
@@ -984,12 +1331,6 @@ Sat Aug 29 14:50:56 PDT 1998 Manish Singh <yosh@gimp.org>
* gtk/testthreads.c: add #include <unistd.h> for sleep()
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
@@ -1088,187 +1429,74 @@ Fri Aug 21 13:06:04 1998 Stuart Parmenter <pavlov@gimp.org>
* gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes
such as GtkCTree function name changes
Fri Aug 21 02:31:26 1998 Tim Janik <timj@gtk.org>
Mon Aug 10 23:03:55 1998 The Rasterman <raster@redhat.com>
* Fixed minor problem in gtkhandlebox.c with drawing, and some
notebook stuff. Also pixmap theme is now "clean" again.
Mon Aug 10 23:03:55 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.h:
* gtk/gtkmain.c (gtk_check_version): added a function to perform a
binary version check, returning a static string for error descriptions,
or NULL on success.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com>
Mon Aug 10 23:09:30 EDT 1998
* Added a few drawing fixes for notebook and other widgets. finished
pixmap theme up to the level that can be supported so far. (need to
add path discovery 9ie where is the rc fiel from - add to pixmap
path so we can get theimages from there too). then we can package
themes. After that need to add to theme seartch path stuff in users
home dir.
Thu Aug 6 16:49:25 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.
* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
drawing area, draw in an expose handler.
* gtk/gtktext.c (correct_cache_insert): Fiddled around
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)
* gtk/gtknotebook.c (gtk_notebook_expose): Check for
empty current page.
Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
Wed Aug 5 16:13:15 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: silly visual fixes
* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
creation of GC's so that they will be set before
they are used for map events (why are they used there?)
* gtk/testgtk.c: call gdk_rgb_init so color preview test actually
works
* gtk/gtkwidget.c: Fixed mistake that caused widgets to
be queued in multiple times in the queue.
1998-08-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do
anything if the event's window is not the bin window.
(gtk_handle_box_motion): Likewise.
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
1998-08-19 Raph Levien <raph@gimp.org>
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_color_preview): pushed the colormap and
visual so it would work better with GdkRgb.
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
1998-08-19 Raph Levien <raph@gimp.org>
Tue Aug 4 19:12:14 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a
4bpp static_color mode (for vga displays). Also fixed a '64' value
in the dither matrix, which was causing one pixel out of 16k to be
dithered wrong.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
handling of partially clipped areas.
* gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting
most of the contents. This is an API change - any apps that relied
on the internal structure of GtkPreview will need some change -
most notably in the use of reserved colors. The Gimp needed
changes in this regard.
Wed Aug 5 02:57:20 1998 Lars Hamann <lars@gtk.org>
Wed Aug 19 00:11:14 1998 Tim Janik <timj@gtk.org>
* gtk/gtkctree.h:
* gtk/gtkctree.c:
(gtk_ctree_find): changed to return a gboolean
(gtk_ctree_insert_gnode): new function for recursive insertion of a
GNode tree.
(gtk_ctree_real_select_recursive): fix for extended selection
(gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too.
(gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag
* gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without
G_ENABLE_DEBUG being defined (specifically --gtk-module= and
--g-fatal-warnings), noticed by miguel.
Tue Aug 4 16:18:26 1998 Tim Janik <timj@gtk.org>
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 0, interface age 0.
GLib version 1.1.1 is now required at minimum.
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
* gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv
in case of show_tabs == NULL
Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments
to --g-fatal-warnings again. this option now causes log levels of
WARNING and CRITICAL to abort().
* gdk/gdk.c:
* gdk/gdkdnd.c:
* gdk/gdkcc.c:
* gdk/gdkfont.c:
* gdk/gdkwindow.c:
* gdk/gdkvisual.c:
* gtk/gtkwidget.c:
* gtk/gtktypeutils.c:
* gtk/gtktree.c:
* gtk/gtkfontsel.c:
* gtk/gtkmain.c:
* gtk/gtkobject.c:
* gtk/gtkpreview.c:
* gtk/gtkselection.c:
* gtk/gtktext.c:
* gtk/gtktree.c:
* gtk/gtktreeitem.c:
did a global search&replace to substitute g_print() calls with
g_message(). libraries shouldn't use printf(), g_print() or
g_printerr() at all.
a bunch of the replacements should probably be wrapped into the
G{D|T}K_NOTE() macros, so they are special cased for debugging
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
* gdk/gdkrgb.c: Further speedups of the 565_d case. It's
impressively fast now - about 4.65 Mpix/s on an IBM TP 600
running a PII 233. It's synced with the 0.0.5 release of
GdkRgb.
Tue Aug 18 00:29:13 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h:
(struct _GtkCListClass): new class methods:
(sort_list) (insert_row) (remove_row) (set_cell_contents)
* gtk/gtkclist.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): fix to avoid problems with cell types != CELL_TEXT
* gtk/gtkctree.h :
(gtk_ctree_export_to_gnode): new function to export a ctree as gnode
(gtk_ctree_node_is_visible): new function to return visibility state
of a node
(gtk_ctree_show_stub): new function to set visibility of root stub
renamed functions :
(gtk_ctree_insert) -> (gtk_ctree_insert_node)
(gtk_ctree_remove) -> (gtk_ctree_remove_node)
(gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr)
(gtk_ctree_set_text) -> (gtk_ctree_node_set_text)
(gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap)
(gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext)
(gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift)
(gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type)
(gtk_ctree_get_text) -> (gtk_ctree_node_get_text)
(gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap)
(gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext)
(gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground)
(gtk_ctree_set_background) -> (gtk_ctree_node_set_background)
(gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data)
(gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full)
(gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data)
(gtk_ctree_moveto) -> (gtk_ctree_node_moveto)
(gtk_ctree_sort) -> (gtk_ctree_sort_node)
(gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable)
* gtk/gtkctree.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): removed. CTree now also compares two GtkCTreeRows
instead of two GtkCTreeNodes.
(gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after
unlinking the node
(real_tree_expand) (real_tree_collapse): fix for refcounting of
node pixmaps
(set_node_info): call gtk_ctree_node_set_pixtext instead of
manipulating the row itself
* gtk/testgtk.c: use renamed functions of GtkCTree.
new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode
at work.
* docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version
of the Gtk+ tutorial, contributed by Eric Jacoboni <jaco@dotcom.fr>.
Mon Aug 17 15:31:38 1998 Tim Janik <timj@gtk.org>
@@ -1673,6 +1901,137 @@ Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* gtk/docs/man: new directory
* gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page
Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
* Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* YES YES YES YES YES clist borders work again! YES! YES YES! gimme
more baby oooh yeah more more MORE YES YES.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* hopefully fixed problem wiht togglebuttons acting like
radiobuttons in gtktogglebutton.c
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed another drawing buglet in the frame drawing code (actually
in the clearing code but anyway in gtkstyle.c)
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed warning from colorsel widget...
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed defautl drawing code to no longer clobber the original style
pixmap bgs as it did and added a helper funciton og gtkstyle.c to
help with this.
Thu Jul 30 18:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
* gtk/gtktooltips.c: Pass a widget (the window) to the
drawing function instead of the GtkTooltips.
Thu Jul 30 17:27:10 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c: Abstract out checking for shape
extension into a function.
* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
Remove extra callls to gtk_window_draw().
Thu Jul 30 11:18:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
* themes/th_main.c: Moved messages around so they are
printed before destroying strings.
Wed Jul 29 16:56:07 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c: Fairly simple implementation of expose compression.
(No GraphicsExpose compression yet, always compress
with the equivalent of XtCompressMultiple - no compression
of Expose events across non-Expose events)
* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
Find rectangle bounding two rectangles.
* gtk/gtkstyle.c: Set clip rects for a few extra GC's
in gdk_default_draw_shadow()
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed drawing functions to handle switching themes on the fly
gracefully and look decent.
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
* Added all the theme drawing code to all widgets, fixed up minor
nigglies in some widgets when it comes to themes, seem to be
running into some funky behavior with clipping rects in GC's. Too
many files to list here. (all files that now use gtk_paint_* are
affected).
Tue Jul 28 22:49:16 1998 Owen Taylor <otaylor@redhat.com>
* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
Set up the demo theme so it is loaded from the RC file.
* themes/th_draw.c: Alleviate the hardcoded paths a wee
bit. (use $HOME/themes/)
* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
the RC file via dlopen()
Tue Jul 28 20:30:56 1998 Owen Taylor <otaylor@redhat.com>
Internal handling of styles and RC styles pretty much
completely reworked for Theme work.
* gtkthemes.[ch]:
- Added routines for virtualization of RcStyle and Style handling.
- Temporary "sample" inline theme-engine. (Does nothing
but print out a few messages.
* gtkrc.[ch]
- Made GtkRcStyle public, added flags to tell if particular
colors have been set.
- RC Styles are "transparent", and the final style for
a widget is the composition of all matching styles
- Added pointer to GtkThemeEngine, and gpointer engine_data
to RC style and style.
- Parse "engine" keyword, load the appropriate theme engine
and call the engine's parser.
* gtkstyle.[ch]
- Keep a GtkRcStyle * in styles created from Rc Styles.
- Load up images from RC file at style attachment time.
- Call ->engine->foo() at appropriate times.
- Don't use a GCache. All incarnations for a style are
just linked together in a list, depend on the RC style
code to find the existing copy.
Tue Jul 28 14:41:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch]: Added the concept of queued redraws
of partial areas. This can be done either relative
to the existing windows (gtk_widget_queue_clear[_area]())
or relative to the future allocation of the widget
(gtk_widget_queue_draw[_area]).
The initial implementation is pretty braindead, but
can be improved.
* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
in favor of gtk_widget_queue_clear().
* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
flags in favor of gtk_widget_queue_clear()
Tue Jul 28 00:15:28 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* docs/gdk.sgml: new format for GDK documentation. Eventually
plan to remove gdk.texi, but not quite yet. Just getting
started.
Tue Jul 28 00:03:20 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing
+606 -247
View File
@@ -1,91 +1,447 @@
Fri, 13 Nov 1998 18:54:13 +0100 Paolo Molaro <lupus@debian.org>
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com>
* gdk/Makefile.am: added poly.h to EXTRA_DIST.
* gdk/gdkgc.c: support dashes in GdkGCPrivate
* gdk/gdkprivate.h: move here GdkPsDrawable definition
* gdk/gdkdrawable.c: gdk_drawable_register returns an int
* gdk/gdkps.c: beginning support for pixmaps, better
guessing of postscript font name, beginning of downloading
function, better emulation of dashed lines,
* gtk/testps.c: better example to show pixmaps, dashes,
font size and a4 page size.
* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
a clear/redraw, not just a redraw, so the focus
gets undrawn properly.
Wed, 21 Oct 1998 19:29:03 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
Chain to gtk_widget_unrealize() instead of duplicating
code.
* gdk/gdkps.c: fixed silly error.
* gtk/testps.c: test for string length (X<->PS).
Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
last vestiges of old DND.
Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c: Restored inner border to entries,
erase cursors to background image.
Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
it was identical to paint_flat_box().
* gtk/gtkstyle.c: Coding style fixups.
* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
test.
* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
Change 'side' for paint_[box/shadow]_gap and paint_extension
to be GtkPositionType instead of a random int.
* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
"frame" as detail - an aspectframe should draw identical
to a frame.
Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
from combine_child_shapes().
* gdk/gdkwindow.c: Merge propagate_shapes() and
propagate_combine_shapes() to remove code duplication.
Thu Nov 5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.
* clist scrollbar merges from HEAD
Tue Nov 3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)
* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden
* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that
* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }
Sun Nov 1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c
* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)
Sun Nov 1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.
* makecursors.awk
* makekeysyms.awk: bye bye
* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.
Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef
* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c
* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD
* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups
Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it
* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get
* gtk/testdnd.c: removed unused variable "buf"
Mon Oct 26 16:46:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
remove_link(), not remove()
Sun Oct 25 20:27:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): support an environment variable
GTK_MODULES= which takes a colon sperated list of module names
automatically loaded at gtk_init() startup.
Thu Oct 22 02:29:53 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.h: GtkType and macro fixups
* gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
for the file selection widget to try a completion on (set the
initial filter).
Wed Oct 14 14:34:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c: implement idle functions via GHook. this gives a
slight speed improvement and lessens code duplication.
Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: use glib endian stuff
* configure.in: don't need to check for endianness anymore
* gtk/gtkstyle.h: removed #pragma }, causing a silly warning
Wed Oct 21 17:44:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
all toplevel widgets, not toplevel windows. (I.e.,
plugs should be reset)
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
_do_ need to notify the other toplevels - by the time
the get the client messages, the RC file dates will
have been updated.
* gtk/gtkcontainer.h: Added a function call to list
every toplevel widget.
* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
Don't send client messages to _every_ window on display!
Wed, 21 Oct 1998 19:10:02 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 16:21:04 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkps.c: better guessing of postscript font name.
* gtk/Makefile.am: compile testps.c
* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
when dragging across widgets, only in drags
starting in widget.
Tue, 20 Oct 1998 12:03:46 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 15:59:49 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkprivate.h: GdkGCPrivate now stores complete info
about color, clip-rectangles (not for bitmaps yet) and
dashes.
GdkWindowPrivate now has a GdkDrawableClass member to allow
for customized draw operations.
* gdk/gdktypes.h: GdkFont now has a name member; new
GDK_WINDOW_DRAWABLE type for GdkWindow; new structure
GdkDrawableClass.
* gdk/gdkdraw.c: use engine-specific functions to draw.
* gdk/gdkwindow.c: handle destroy of GDK_WINDOW_DRAWABLE.
* gdk/gdkps.[ch]: postscript drawable engine.
* gdk/gdkdrawable.c: drawable engine registration.
* gdk/gdk.h: include drawable engine headers and declare
engine registration function.
New function: gdk_region_get_rectangles().
* gdk/gdkfont.c: store the name of the font loaded (needs
work for fontset).
* gdk/gdkgc.c: handle changes to GdkGCPrivate.
* gdk/gdkregion.c: use our own functions for Region handling
(stolen from X 6.3: Region.c region.h poly.h PolyReg.c).
* gtk/testps.c: test postscript backend.
* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
Emit "drag_end" signal at end of drag.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
* gtk/gtkdnd.c: Always send "drag_leave" to dests
without GTK_DEST_DEFAULT_MOTION.
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
Tue Oct 20 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c: rearranged some functions
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
flag of column
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
(gtk_clist_set_border): deprecated function, use
gtk_clist_set_shadow_type instead.
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
(adjust_scrollbars): some cleanups
(select_row) (unselect_row): removed. replaced by equivalent
gtk_signal_emit calls
(add_style_data): removed, use gtk_clist_style_set instead
(gtk_clist_style_set): fill in size data, after style was set.
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
(gtk_clist_set_cell_style): auto_resize columns if needed
(column_auto_resize): resize column if needed for auto_resize
(real_clear): disable auto_resize while list destroy
(resize_column): removed
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
for "gtk-embedded" data currently set by
GtkSocket, and use that to forward client message
on to embedded windows. Only reset our own toplevel -
the others will handle themselves. (Now that
GtkMenus live in GtkWindows)
* gtk/gtkctree.c : (gtk_ctree_remove_node)
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
auto_resize columns if needed
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
(real_clear): disable auto_resize while processing the tree
Tue Oct 20 12:57:10 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
for one column
* gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt
the window tree more comprehensively, so that we find
client windows hidden under non-toplevels.
Tue Oct 20 12:43:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_data_set):
Maintain the null-termintation guarantee, even when
data = NULL, length = 0. (Warn on data = NULL,
length > 0)
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
Tue Oct 20 11:55:24 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
on destroyed windows so we clear the XID table properly.
Finish up restructure of return value handling that
was half-done before.
Mon Oct 19 16:41:44 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
into function prototype for drag_data_received.
Mon Oct 19 16:40:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
client window finding code so that it works with
WM's other than fvwm.
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Sun Oct 18 22:48:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
the "GtkDrawWindow" class, which is a descendent
of the Window class which leaves its background alone.
Essentially, a toplevel drawing area, though it does
allow adding a child.
Sat Oct 17 00:40:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
merging RC styles. Report new share/themes path for
themes directory. Deref theme engines when appropriate.
* gtk/gtkclist.c: Set all backgrounds in _style_set().
Make sure that pixel for xor_gc is never 0.
* gtk/gtkctree.c: Choose colors for plus/minus more
carefully, in a hopefully style-independent fashion.
(Still needs a bit more work)
* gtk/gtkwidget.c: Don't send expose events to widgets
which are about to be resized and redrawn. (Needs a
bit more thought.)
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
drawing on tabs for newly allocated, un-sized
pages - we'll get the size wrong.
Thu Oct 1 17:38:07 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
up stupidities in last commit.
Thu Oct 1 14:25:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: When handling queued resizes, account
for handleboxes, where the widget heirarchy is different
than the window heirarchy by just queueing a resize on
the entire handlebox if the detached child is changed.
- Remove widgets from the redraw queue when reparenting,
even if not unrealizing. We queue a resize/redraw in
any case.
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
* gtk/gtkstyle.c: added check to see if the widget has been shaped
byt the app via gtk_widget_shape_combine_mask and if it has does
not reset the shape on theme change.
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c: Use g_module instead of dlopen()
Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_expose): Check
if we've changed widgets since the expose event
was queued.
Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
to restore approximate bin compatibility with the
non-themes branch. (This does break bin compat
within the themes branch.)
Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklabel.c (gtk_label_set): Eliminate a
gdk_window_clear_area() that snuck in with the
menu underlines merge.
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 23:37:26 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Fixed some remaining background drawing,
merges from main branch, cleanups.
Mon Aug 24 10:55:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
dereference NULL focus tab.
* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
functions since we need to both show/hide and
queue a redraw. (There's some duplication of drawing here,
we probably should only be queuing a redraw on the
"value" portion of the scale.)
Fri Aug 21 19:02:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
into the theme-drawing framework. We do this by making them,
like check/radio-buttons, no-window widgets with subwindows. We
then move the value by calling gtk_widget_queue_clear() and only
redraw the value in our draw() / expose() handler. A virtual
function clear_background is added which queues a clear on the
"background" portion of the widget.
Fri Aug 21 13:04:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (mark_bg_gc): Make background colors work
again. (We can't always paint the background with a
paint() function - only do that for selected text)
Mon Aug 17 20:31:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
the themes can't be built as part of the same build since
they depend on gdk_imlib.
Fri Aug 14 12:44:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
from gtkthemes.c.
* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
gtk/
- Upgrade to libtool-1.2b + patch to add shared library dependencies
for Linux. (Needs to be extended to other platforms where they
are safe)
- Check for -ldl so this branch should build on all platforms, though
themes will work on all platforms they could work on.
- Use -version and -release simultaneously: sonames stay as they are
in the current scheme, but -lgtk-1.1 changes to -lgtk.
- Added in extra -l flags to library LDFLAGS so we get shared library
dependencies against X libs and -ldl. (But not libgtk against
libgdk or libglib yet, since dependencies against uninstalled
libraries aren't portable)
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
* gtkrc.c - added api calls to find module and theme paths from gtk.
nuked gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed gtk_install_prefix global.
Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
* added gtk_install_prefix global const variabel to find where gtk is
installed.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* added ~/.gtk/lib/themes/engines/ to the default searchpath for
gtk theme engines
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Sun Oct 18 20:52:22 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwidget.c gtkmarshal.list: Change signal
@@ -669,15 +1025,6 @@ Tue Sep 15 11:06:13 1998 Owen Taylor <otaylor@redhat.com>
with unchanged dimensions, send a synthetic expose
since ForgetGravity won't expose our window.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: - Save first_cut_pixels when switching
@@ -984,12 +1331,6 @@ Sat Aug 29 14:50:56 PDT 1998 Manish Singh <yosh@gimp.org>
* gtk/testthreads.c: add #include <unistd.h> for sleep()
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
@@ -1088,187 +1429,74 @@ Fri Aug 21 13:06:04 1998 Stuart Parmenter <pavlov@gimp.org>
* gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes
such as GtkCTree function name changes
Fri Aug 21 02:31:26 1998 Tim Janik <timj@gtk.org>
Mon Aug 10 23:03:55 1998 The Rasterman <raster@redhat.com>
* Fixed minor problem in gtkhandlebox.c with drawing, and some
notebook stuff. Also pixmap theme is now "clean" again.
Mon Aug 10 23:03:55 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.h:
* gtk/gtkmain.c (gtk_check_version): added a function to perform a
binary version check, returning a static string for error descriptions,
or NULL on success.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com>
Mon Aug 10 23:09:30 EDT 1998
* Added a few drawing fixes for notebook and other widgets. finished
pixmap theme up to the level that can be supported so far. (need to
add path discovery 9ie where is the rc fiel from - add to pixmap
path so we can get theimages from there too). then we can package
themes. After that need to add to theme seartch path stuff in users
home dir.
Thu Aug 6 16:49:25 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.
* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
drawing area, draw in an expose handler.
* gtk/gtktext.c (correct_cache_insert): Fiddled around
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)
* gtk/gtknotebook.c (gtk_notebook_expose): Check for
empty current page.
Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
Wed Aug 5 16:13:15 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: silly visual fixes
* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
creation of GC's so that they will be set before
they are used for map events (why are they used there?)
* gtk/testgtk.c: call gdk_rgb_init so color preview test actually
works
* gtk/gtkwidget.c: Fixed mistake that caused widgets to
be queued in multiple times in the queue.
1998-08-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do
anything if the event's window is not the bin window.
(gtk_handle_box_motion): Likewise.
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
1998-08-19 Raph Levien <raph@gimp.org>
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_color_preview): pushed the colormap and
visual so it would work better with GdkRgb.
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
1998-08-19 Raph Levien <raph@gimp.org>
Tue Aug 4 19:12:14 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a
4bpp static_color mode (for vga displays). Also fixed a '64' value
in the dither matrix, which was causing one pixel out of 16k to be
dithered wrong.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
handling of partially clipped areas.
* gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting
most of the contents. This is an API change - any apps that relied
on the internal structure of GtkPreview will need some change -
most notably in the use of reserved colors. The Gimp needed
changes in this regard.
Wed Aug 5 02:57:20 1998 Lars Hamann <lars@gtk.org>
Wed Aug 19 00:11:14 1998 Tim Janik <timj@gtk.org>
* gtk/gtkctree.h:
* gtk/gtkctree.c:
(gtk_ctree_find): changed to return a gboolean
(gtk_ctree_insert_gnode): new function for recursive insertion of a
GNode tree.
(gtk_ctree_real_select_recursive): fix for extended selection
(gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too.
(gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag
* gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without
G_ENABLE_DEBUG being defined (specifically --gtk-module= and
--g-fatal-warnings), noticed by miguel.
Tue Aug 4 16:18:26 1998 Tim Janik <timj@gtk.org>
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 0, interface age 0.
GLib version 1.1.1 is now required at minimum.
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
* gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv
in case of show_tabs == NULL
Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments
to --g-fatal-warnings again. this option now causes log levels of
WARNING and CRITICAL to abort().
* gdk/gdk.c:
* gdk/gdkdnd.c:
* gdk/gdkcc.c:
* gdk/gdkfont.c:
* gdk/gdkwindow.c:
* gdk/gdkvisual.c:
* gtk/gtkwidget.c:
* gtk/gtktypeutils.c:
* gtk/gtktree.c:
* gtk/gtkfontsel.c:
* gtk/gtkmain.c:
* gtk/gtkobject.c:
* gtk/gtkpreview.c:
* gtk/gtkselection.c:
* gtk/gtktext.c:
* gtk/gtktree.c:
* gtk/gtktreeitem.c:
did a global search&replace to substitute g_print() calls with
g_message(). libraries shouldn't use printf(), g_print() or
g_printerr() at all.
a bunch of the replacements should probably be wrapped into the
G{D|T}K_NOTE() macros, so they are special cased for debugging
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
* gdk/gdkrgb.c: Further speedups of the 565_d case. It's
impressively fast now - about 4.65 Mpix/s on an IBM TP 600
running a PII 233. It's synced with the 0.0.5 release of
GdkRgb.
Tue Aug 18 00:29:13 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h:
(struct _GtkCListClass): new class methods:
(sort_list) (insert_row) (remove_row) (set_cell_contents)
* gtk/gtkclist.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): fix to avoid problems with cell types != CELL_TEXT
* gtk/gtkctree.h :
(gtk_ctree_export_to_gnode): new function to export a ctree as gnode
(gtk_ctree_node_is_visible): new function to return visibility state
of a node
(gtk_ctree_show_stub): new function to set visibility of root stub
renamed functions :
(gtk_ctree_insert) -> (gtk_ctree_insert_node)
(gtk_ctree_remove) -> (gtk_ctree_remove_node)
(gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr)
(gtk_ctree_set_text) -> (gtk_ctree_node_set_text)
(gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap)
(gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext)
(gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift)
(gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type)
(gtk_ctree_get_text) -> (gtk_ctree_node_get_text)
(gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap)
(gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext)
(gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground)
(gtk_ctree_set_background) -> (gtk_ctree_node_set_background)
(gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data)
(gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full)
(gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data)
(gtk_ctree_moveto) -> (gtk_ctree_node_moveto)
(gtk_ctree_sort) -> (gtk_ctree_sort_node)
(gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable)
* gtk/gtkctree.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): removed. CTree now also compares two GtkCTreeRows
instead of two GtkCTreeNodes.
(gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after
unlinking the node
(real_tree_expand) (real_tree_collapse): fix for refcounting of
node pixmaps
(set_node_info): call gtk_ctree_node_set_pixtext instead of
manipulating the row itself
* gtk/testgtk.c: use renamed functions of GtkCTree.
new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode
at work.
* docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version
of the Gtk+ tutorial, contributed by Eric Jacoboni <jaco@dotcom.fr>.
Mon Aug 17 15:31:38 1998 Tim Janik <timj@gtk.org>
@@ -1673,6 +1901,137 @@ Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* gtk/docs/man: new directory
* gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page
Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
* Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* YES YES YES YES YES clist borders work again! YES! YES YES! gimme
more baby oooh yeah more more MORE YES YES.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* hopefully fixed problem wiht togglebuttons acting like
radiobuttons in gtktogglebutton.c
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed another drawing buglet in the frame drawing code (actually
in the clearing code but anyway in gtkstyle.c)
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed warning from colorsel widget...
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed defautl drawing code to no longer clobber the original style
pixmap bgs as it did and added a helper funciton og gtkstyle.c to
help with this.
Thu Jul 30 18:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
* gtk/gtktooltips.c: Pass a widget (the window) to the
drawing function instead of the GtkTooltips.
Thu Jul 30 17:27:10 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c: Abstract out checking for shape
extension into a function.
* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
Remove extra callls to gtk_window_draw().
Thu Jul 30 11:18:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
* themes/th_main.c: Moved messages around so they are
printed before destroying strings.
Wed Jul 29 16:56:07 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c: Fairly simple implementation of expose compression.
(No GraphicsExpose compression yet, always compress
with the equivalent of XtCompressMultiple - no compression
of Expose events across non-Expose events)
* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
Find rectangle bounding two rectangles.
* gtk/gtkstyle.c: Set clip rects for a few extra GC's
in gdk_default_draw_shadow()
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed drawing functions to handle switching themes on the fly
gracefully and look decent.
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
* Added all the theme drawing code to all widgets, fixed up minor
nigglies in some widgets when it comes to themes, seem to be
running into some funky behavior with clipping rects in GC's. Too
many files to list here. (all files that now use gtk_paint_* are
affected).
Tue Jul 28 22:49:16 1998 Owen Taylor <otaylor@redhat.com>
* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
Set up the demo theme so it is loaded from the RC file.
* themes/th_draw.c: Alleviate the hardcoded paths a wee
bit. (use $HOME/themes/)
* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
the RC file via dlopen()
Tue Jul 28 20:30:56 1998 Owen Taylor <otaylor@redhat.com>
Internal handling of styles and RC styles pretty much
completely reworked for Theme work.
* gtkthemes.[ch]:
- Added routines for virtualization of RcStyle and Style handling.
- Temporary "sample" inline theme-engine. (Does nothing
but print out a few messages.
* gtkrc.[ch]
- Made GtkRcStyle public, added flags to tell if particular
colors have been set.
- RC Styles are "transparent", and the final style for
a widget is the composition of all matching styles
- Added pointer to GtkThemeEngine, and gpointer engine_data
to RC style and style.
- Parse "engine" keyword, load the appropriate theme engine
and call the engine's parser.
* gtkstyle.[ch]
- Keep a GtkRcStyle * in styles created from Rc Styles.
- Load up images from RC file at style attachment time.
- Call ->engine->foo() at appropriate times.
- Don't use a GCache. All incarnations for a style are
just linked together in a list, depend on the RC style
code to find the existing copy.
Tue Jul 28 14:41:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch]: Added the concept of queued redraws
of partial areas. This can be done either relative
to the existing windows (gtk_widget_queue_clear[_area]())
or relative to the future allocation of the widget
(gtk_widget_queue_draw[_area]).
The initial implementation is pretty braindead, but
can be improved.
* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
in favor of gtk_widget_queue_clear().
* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
flags in favor of gtk_widget_queue_clear()
Tue Jul 28 00:15:28 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* docs/gdk.sgml: new format for GDK documentation. Eventually
plan to remove gdk.texi, but not quite yet. Just getting
started.
Tue Jul 28 00:03:20 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing
+606 -247
View File
@@ -1,91 +1,447 @@
Fri, 13 Nov 1998 18:54:13 +0100 Paolo Molaro <lupus@debian.org>
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com>
* gdk/Makefile.am: added poly.h to EXTRA_DIST.
* gdk/gdkgc.c: support dashes in GdkGCPrivate
* gdk/gdkprivate.h: move here GdkPsDrawable definition
* gdk/gdkdrawable.c: gdk_drawable_register returns an int
* gdk/gdkps.c: beginning support for pixmaps, better
guessing of postscript font name, beginning of downloading
function, better emulation of dashed lines,
* gtk/testps.c: better example to show pixmaps, dashes,
font size and a4 page size.
* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
a clear/redraw, not just a redraw, so the focus
gets undrawn properly.
Wed, 21 Oct 1998 19:29:03 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
Chain to gtk_widget_unrealize() instead of duplicating
code.
* gdk/gdkps.c: fixed silly error.
* gtk/testps.c: test for string length (X<->PS).
Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
last vestiges of old DND.
Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c: Restored inner border to entries,
erase cursors to background image.
Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
it was identical to paint_flat_box().
* gtk/gtkstyle.c: Coding style fixups.
* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
test.
* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
Change 'side' for paint_[box/shadow]_gap and paint_extension
to be GtkPositionType instead of a random int.
* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
"frame" as detail - an aspectframe should draw identical
to a frame.
Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
from combine_child_shapes().
* gdk/gdkwindow.c: Merge propagate_shapes() and
propagate_combine_shapes() to remove code duplication.
Thu Nov 5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.
* clist scrollbar merges from HEAD
Tue Nov 3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)
* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden
* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that
* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }
Sun Nov 1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c
* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)
Sun Nov 1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.
* makecursors.awk
* makekeysyms.awk: bye bye
* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.
Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef
* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c
* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD
* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups
Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it
* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get
* gtk/testdnd.c: removed unused variable "buf"
Mon Oct 26 16:46:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
remove_link(), not remove()
Sun Oct 25 20:27:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): support an environment variable
GTK_MODULES= which takes a colon sperated list of module names
automatically loaded at gtk_init() startup.
Thu Oct 22 02:29:53 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.h: GtkType and macro fixups
* gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
for the file selection widget to try a completion on (set the
initial filter).
Wed Oct 14 14:34:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c: implement idle functions via GHook. this gives a
slight speed improvement and lessens code duplication.
Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: use glib endian stuff
* configure.in: don't need to check for endianness anymore
* gtk/gtkstyle.h: removed #pragma }, causing a silly warning
Wed Oct 21 17:44:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
all toplevel widgets, not toplevel windows. (I.e.,
plugs should be reset)
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
_do_ need to notify the other toplevels - by the time
the get the client messages, the RC file dates will
have been updated.
* gtk/gtkcontainer.h: Added a function call to list
every toplevel widget.
* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
Don't send client messages to _every_ window on display!
Wed, 21 Oct 1998 19:10:02 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 16:21:04 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkps.c: better guessing of postscript font name.
* gtk/Makefile.am: compile testps.c
* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
when dragging across widgets, only in drags
starting in widget.
Tue, 20 Oct 1998 12:03:46 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 15:59:49 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkprivate.h: GdkGCPrivate now stores complete info
about color, clip-rectangles (not for bitmaps yet) and
dashes.
GdkWindowPrivate now has a GdkDrawableClass member to allow
for customized draw operations.
* gdk/gdktypes.h: GdkFont now has a name member; new
GDK_WINDOW_DRAWABLE type for GdkWindow; new structure
GdkDrawableClass.
* gdk/gdkdraw.c: use engine-specific functions to draw.
* gdk/gdkwindow.c: handle destroy of GDK_WINDOW_DRAWABLE.
* gdk/gdkps.[ch]: postscript drawable engine.
* gdk/gdkdrawable.c: drawable engine registration.
* gdk/gdk.h: include drawable engine headers and declare
engine registration function.
New function: gdk_region_get_rectangles().
* gdk/gdkfont.c: store the name of the font loaded (needs
work for fontset).
* gdk/gdkgc.c: handle changes to GdkGCPrivate.
* gdk/gdkregion.c: use our own functions for Region handling
(stolen from X 6.3: Region.c region.h poly.h PolyReg.c).
* gtk/testps.c: test postscript backend.
* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
Emit "drag_end" signal at end of drag.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
* gtk/gtkdnd.c: Always send "drag_leave" to dests
without GTK_DEST_DEFAULT_MOTION.
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
Tue Oct 20 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c: rearranged some functions
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
flag of column
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
(gtk_clist_set_border): deprecated function, use
gtk_clist_set_shadow_type instead.
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
(adjust_scrollbars): some cleanups
(select_row) (unselect_row): removed. replaced by equivalent
gtk_signal_emit calls
(add_style_data): removed, use gtk_clist_style_set instead
(gtk_clist_style_set): fill in size data, after style was set.
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
(gtk_clist_set_cell_style): auto_resize columns if needed
(column_auto_resize): resize column if needed for auto_resize
(real_clear): disable auto_resize while list destroy
(resize_column): removed
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
for "gtk-embedded" data currently set by
GtkSocket, and use that to forward client message
on to embedded windows. Only reset our own toplevel -
the others will handle themselves. (Now that
GtkMenus live in GtkWindows)
* gtk/gtkctree.c : (gtk_ctree_remove_node)
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
auto_resize columns if needed
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
(real_clear): disable auto_resize while processing the tree
Tue Oct 20 12:57:10 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
for one column
* gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt
the window tree more comprehensively, so that we find
client windows hidden under non-toplevels.
Tue Oct 20 12:43:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_data_set):
Maintain the null-termintation guarantee, even when
data = NULL, length = 0. (Warn on data = NULL,
length > 0)
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
Tue Oct 20 11:55:24 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
on destroyed windows so we clear the XID table properly.
Finish up restructure of return value handling that
was half-done before.
Mon Oct 19 16:41:44 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
into function prototype for drag_data_received.
Mon Oct 19 16:40:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
client window finding code so that it works with
WM's other than fvwm.
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Sun Oct 18 22:48:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
the "GtkDrawWindow" class, which is a descendent
of the Window class which leaves its background alone.
Essentially, a toplevel drawing area, though it does
allow adding a child.
Sat Oct 17 00:40:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
merging RC styles. Report new share/themes path for
themes directory. Deref theme engines when appropriate.
* gtk/gtkclist.c: Set all backgrounds in _style_set().
Make sure that pixel for xor_gc is never 0.
* gtk/gtkctree.c: Choose colors for plus/minus more
carefully, in a hopefully style-independent fashion.
(Still needs a bit more work)
* gtk/gtkwidget.c: Don't send expose events to widgets
which are about to be resized and redrawn. (Needs a
bit more thought.)
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
drawing on tabs for newly allocated, un-sized
pages - we'll get the size wrong.
Thu Oct 1 17:38:07 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
up stupidities in last commit.
Thu Oct 1 14:25:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: When handling queued resizes, account
for handleboxes, where the widget heirarchy is different
than the window heirarchy by just queueing a resize on
the entire handlebox if the detached child is changed.
- Remove widgets from the redraw queue when reparenting,
even if not unrealizing. We queue a resize/redraw in
any case.
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
* gtk/gtkstyle.c: added check to see if the widget has been shaped
byt the app via gtk_widget_shape_combine_mask and if it has does
not reset the shape on theme change.
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c: Use g_module instead of dlopen()
Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_expose): Check
if we've changed widgets since the expose event
was queued.
Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
to restore approximate bin compatibility with the
non-themes branch. (This does break bin compat
within the themes branch.)
Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklabel.c (gtk_label_set): Eliminate a
gdk_window_clear_area() that snuck in with the
menu underlines merge.
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 23:37:26 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Fixed some remaining background drawing,
merges from main branch, cleanups.
Mon Aug 24 10:55:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
dereference NULL focus tab.
* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
functions since we need to both show/hide and
queue a redraw. (There's some duplication of drawing here,
we probably should only be queuing a redraw on the
"value" portion of the scale.)
Fri Aug 21 19:02:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
into the theme-drawing framework. We do this by making them,
like check/radio-buttons, no-window widgets with subwindows. We
then move the value by calling gtk_widget_queue_clear() and only
redraw the value in our draw() / expose() handler. A virtual
function clear_background is added which queues a clear on the
"background" portion of the widget.
Fri Aug 21 13:04:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (mark_bg_gc): Make background colors work
again. (We can't always paint the background with a
paint() function - only do that for selected text)
Mon Aug 17 20:31:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
the themes can't be built as part of the same build since
they depend on gdk_imlib.
Fri Aug 14 12:44:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
from gtkthemes.c.
* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
gtk/
- Upgrade to libtool-1.2b + patch to add shared library dependencies
for Linux. (Needs to be extended to other platforms where they
are safe)
- Check for -ldl so this branch should build on all platforms, though
themes will work on all platforms they could work on.
- Use -version and -release simultaneously: sonames stay as they are
in the current scheme, but -lgtk-1.1 changes to -lgtk.
- Added in extra -l flags to library LDFLAGS so we get shared library
dependencies against X libs and -ldl. (But not libgtk against
libgdk or libglib yet, since dependencies against uninstalled
libraries aren't portable)
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
* gtkrc.c - added api calls to find module and theme paths from gtk.
nuked gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed gtk_install_prefix global.
Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
* added gtk_install_prefix global const variabel to find where gtk is
installed.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* added ~/.gtk/lib/themes/engines/ to the default searchpath for
gtk theme engines
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Sun Oct 18 20:52:22 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwidget.c gtkmarshal.list: Change signal
@@ -669,15 +1025,6 @@ Tue Sep 15 11:06:13 1998 Owen Taylor <otaylor@redhat.com>
with unchanged dimensions, send a synthetic expose
since ForgetGravity won't expose our window.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: - Save first_cut_pixels when switching
@@ -984,12 +1331,6 @@ Sat Aug 29 14:50:56 PDT 1998 Manish Singh <yosh@gimp.org>
* gtk/testthreads.c: add #include <unistd.h> for sleep()
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
@@ -1088,187 +1429,74 @@ Fri Aug 21 13:06:04 1998 Stuart Parmenter <pavlov@gimp.org>
* gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes
such as GtkCTree function name changes
Fri Aug 21 02:31:26 1998 Tim Janik <timj@gtk.org>
Mon Aug 10 23:03:55 1998 The Rasterman <raster@redhat.com>
* Fixed minor problem in gtkhandlebox.c with drawing, and some
notebook stuff. Also pixmap theme is now "clean" again.
Mon Aug 10 23:03:55 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.h:
* gtk/gtkmain.c (gtk_check_version): added a function to perform a
binary version check, returning a static string for error descriptions,
or NULL on success.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com>
Mon Aug 10 23:09:30 EDT 1998
* Added a few drawing fixes for notebook and other widgets. finished
pixmap theme up to the level that can be supported so far. (need to
add path discovery 9ie where is the rc fiel from - add to pixmap
path so we can get theimages from there too). then we can package
themes. After that need to add to theme seartch path stuff in users
home dir.
Thu Aug 6 16:49:25 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.
* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
drawing area, draw in an expose handler.
* gtk/gtktext.c (correct_cache_insert): Fiddled around
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)
* gtk/gtknotebook.c (gtk_notebook_expose): Check for
empty current page.
Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
Wed Aug 5 16:13:15 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: silly visual fixes
* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
creation of GC's so that they will be set before
they are used for map events (why are they used there?)
* gtk/testgtk.c: call gdk_rgb_init so color preview test actually
works
* gtk/gtkwidget.c: Fixed mistake that caused widgets to
be queued in multiple times in the queue.
1998-08-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do
anything if the event's window is not the bin window.
(gtk_handle_box_motion): Likewise.
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
1998-08-19 Raph Levien <raph@gimp.org>
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_color_preview): pushed the colormap and
visual so it would work better with GdkRgb.
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
1998-08-19 Raph Levien <raph@gimp.org>
Tue Aug 4 19:12:14 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a
4bpp static_color mode (for vga displays). Also fixed a '64' value
in the dither matrix, which was causing one pixel out of 16k to be
dithered wrong.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
handling of partially clipped areas.
* gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting
most of the contents. This is an API change - any apps that relied
on the internal structure of GtkPreview will need some change -
most notably in the use of reserved colors. The Gimp needed
changes in this regard.
Wed Aug 5 02:57:20 1998 Lars Hamann <lars@gtk.org>
Wed Aug 19 00:11:14 1998 Tim Janik <timj@gtk.org>
* gtk/gtkctree.h:
* gtk/gtkctree.c:
(gtk_ctree_find): changed to return a gboolean
(gtk_ctree_insert_gnode): new function for recursive insertion of a
GNode tree.
(gtk_ctree_real_select_recursive): fix for extended selection
(gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too.
(gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag
* gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without
G_ENABLE_DEBUG being defined (specifically --gtk-module= and
--g-fatal-warnings), noticed by miguel.
Tue Aug 4 16:18:26 1998 Tim Janik <timj@gtk.org>
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 0, interface age 0.
GLib version 1.1.1 is now required at minimum.
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
* gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv
in case of show_tabs == NULL
Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments
to --g-fatal-warnings again. this option now causes log levels of
WARNING and CRITICAL to abort().
* gdk/gdk.c:
* gdk/gdkdnd.c:
* gdk/gdkcc.c:
* gdk/gdkfont.c:
* gdk/gdkwindow.c:
* gdk/gdkvisual.c:
* gtk/gtkwidget.c:
* gtk/gtktypeutils.c:
* gtk/gtktree.c:
* gtk/gtkfontsel.c:
* gtk/gtkmain.c:
* gtk/gtkobject.c:
* gtk/gtkpreview.c:
* gtk/gtkselection.c:
* gtk/gtktext.c:
* gtk/gtktree.c:
* gtk/gtktreeitem.c:
did a global search&replace to substitute g_print() calls with
g_message(). libraries shouldn't use printf(), g_print() or
g_printerr() at all.
a bunch of the replacements should probably be wrapped into the
G{D|T}K_NOTE() macros, so they are special cased for debugging
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
* gdk/gdkrgb.c: Further speedups of the 565_d case. It's
impressively fast now - about 4.65 Mpix/s on an IBM TP 600
running a PII 233. It's synced with the 0.0.5 release of
GdkRgb.
Tue Aug 18 00:29:13 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h:
(struct _GtkCListClass): new class methods:
(sort_list) (insert_row) (remove_row) (set_cell_contents)
* gtk/gtkclist.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): fix to avoid problems with cell types != CELL_TEXT
* gtk/gtkctree.h :
(gtk_ctree_export_to_gnode): new function to export a ctree as gnode
(gtk_ctree_node_is_visible): new function to return visibility state
of a node
(gtk_ctree_show_stub): new function to set visibility of root stub
renamed functions :
(gtk_ctree_insert) -> (gtk_ctree_insert_node)
(gtk_ctree_remove) -> (gtk_ctree_remove_node)
(gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr)
(gtk_ctree_set_text) -> (gtk_ctree_node_set_text)
(gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap)
(gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext)
(gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift)
(gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type)
(gtk_ctree_get_text) -> (gtk_ctree_node_get_text)
(gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap)
(gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext)
(gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground)
(gtk_ctree_set_background) -> (gtk_ctree_node_set_background)
(gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data)
(gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full)
(gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data)
(gtk_ctree_moveto) -> (gtk_ctree_node_moveto)
(gtk_ctree_sort) -> (gtk_ctree_sort_node)
(gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable)
* gtk/gtkctree.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): removed. CTree now also compares two GtkCTreeRows
instead of two GtkCTreeNodes.
(gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after
unlinking the node
(real_tree_expand) (real_tree_collapse): fix for refcounting of
node pixmaps
(set_node_info): call gtk_ctree_node_set_pixtext instead of
manipulating the row itself
* gtk/testgtk.c: use renamed functions of GtkCTree.
new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode
at work.
* docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version
of the Gtk+ tutorial, contributed by Eric Jacoboni <jaco@dotcom.fr>.
Mon Aug 17 15:31:38 1998 Tim Janik <timj@gtk.org>
@@ -1673,6 +1901,137 @@ Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* gtk/docs/man: new directory
* gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page
Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
* Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* YES YES YES YES YES clist borders work again! YES! YES YES! gimme
more baby oooh yeah more more MORE YES YES.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* hopefully fixed problem wiht togglebuttons acting like
radiobuttons in gtktogglebutton.c
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed another drawing buglet in the frame drawing code (actually
in the clearing code but anyway in gtkstyle.c)
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed warning from colorsel widget...
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed defautl drawing code to no longer clobber the original style
pixmap bgs as it did and added a helper funciton og gtkstyle.c to
help with this.
Thu Jul 30 18:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
* gtk/gtktooltips.c: Pass a widget (the window) to the
drawing function instead of the GtkTooltips.
Thu Jul 30 17:27:10 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c: Abstract out checking for shape
extension into a function.
* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
Remove extra callls to gtk_window_draw().
Thu Jul 30 11:18:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
* themes/th_main.c: Moved messages around so they are
printed before destroying strings.
Wed Jul 29 16:56:07 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c: Fairly simple implementation of expose compression.
(No GraphicsExpose compression yet, always compress
with the equivalent of XtCompressMultiple - no compression
of Expose events across non-Expose events)
* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
Find rectangle bounding two rectangles.
* gtk/gtkstyle.c: Set clip rects for a few extra GC's
in gdk_default_draw_shadow()
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed drawing functions to handle switching themes on the fly
gracefully and look decent.
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
* Added all the theme drawing code to all widgets, fixed up minor
nigglies in some widgets when it comes to themes, seem to be
running into some funky behavior with clipping rects in GC's. Too
many files to list here. (all files that now use gtk_paint_* are
affected).
Tue Jul 28 22:49:16 1998 Owen Taylor <otaylor@redhat.com>
* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
Set up the demo theme so it is loaded from the RC file.
* themes/th_draw.c: Alleviate the hardcoded paths a wee
bit. (use $HOME/themes/)
* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
the RC file via dlopen()
Tue Jul 28 20:30:56 1998 Owen Taylor <otaylor@redhat.com>
Internal handling of styles and RC styles pretty much
completely reworked for Theme work.
* gtkthemes.[ch]:
- Added routines for virtualization of RcStyle and Style handling.
- Temporary "sample" inline theme-engine. (Does nothing
but print out a few messages.
* gtkrc.[ch]
- Made GtkRcStyle public, added flags to tell if particular
colors have been set.
- RC Styles are "transparent", and the final style for
a widget is the composition of all matching styles
- Added pointer to GtkThemeEngine, and gpointer engine_data
to RC style and style.
- Parse "engine" keyword, load the appropriate theme engine
and call the engine's parser.
* gtkstyle.[ch]
- Keep a GtkRcStyle * in styles created from Rc Styles.
- Load up images from RC file at style attachment time.
- Call ->engine->foo() at appropriate times.
- Don't use a GCache. All incarnations for a style are
just linked together in a list, depend on the RC style
code to find the existing copy.
Tue Jul 28 14:41:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch]: Added the concept of queued redraws
of partial areas. This can be done either relative
to the existing windows (gtk_widget_queue_clear[_area]())
or relative to the future allocation of the widget
(gtk_widget_queue_draw[_area]).
The initial implementation is pretty braindead, but
can be improved.
* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
in favor of gtk_widget_queue_clear().
* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
flags in favor of gtk_widget_queue_clear()
Tue Jul 28 00:15:28 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* docs/gdk.sgml: new format for GDK documentation. Eventually
plan to remove gdk.texi, but not quite yet. Just getting
started.
Tue Jul 28 00:03:20 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing
+606 -247
View File
@@ -1,91 +1,447 @@
Fri, 13 Nov 1998 18:54:13 +0100 Paolo Molaro <lupus@debian.org>
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com>
* gdk/Makefile.am: added poly.h to EXTRA_DIST.
* gdk/gdkgc.c: support dashes in GdkGCPrivate
* gdk/gdkprivate.h: move here GdkPsDrawable definition
* gdk/gdkdrawable.c: gdk_drawable_register returns an int
* gdk/gdkps.c: beginning support for pixmaps, better
guessing of postscript font name, beginning of downloading
function, better emulation of dashed lines,
* gtk/testps.c: better example to show pixmaps, dashes,
font size and a4 page size.
* gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue
a clear/redraw, not just a redraw, so the focus
gets undrawn properly.
Wed, 21 Oct 1998 19:29:03 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtktogglebutton.c (gtk_toggle_button_unrealize):
Chain to gtk_widget_unrealize() instead of duplicating
code.
* gdk/gdkps.c: fixed silly error.
* gtk/testps.c: test for string length (X<->PS).
Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed
last vestiges of old DND.
Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c: Restored inner border to entries,
erase cursors to background image.
Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() -
it was identical to paint_flat_box().
* gtk/gtkstyle.c: Coding style fixups.
* gtk/gtkwindow.c (gtk_window_move_resize): removed useless
test.
* gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c:
Change 'side' for paint_[box/shadow]_gap and paint_extension
to be GtkPositionType instead of a random int.
* gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use
"frame" as detail - an aspectframe should draw identical
to a frame.
Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed
from combine_child_shapes().
* gdk/gdkwindow.c: Merge propagate_shapes() and
propagate_combine_shapes() to remove code duplication.
Thu Nov 5 14:31:57 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: sometimes we get a KeyRelease before a KeyPress in
gdk_event_translate, and the USE_XIM buffer isn't allocated yet.
So allocate some mem if it's not already done.
* clist scrollbar merges from HEAD
Tue Nov 3 13:16:36 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: remove explict -ldl, gmodule takes care of that
* gtk/gtkdnd.c: start TARGET_MOTIF_SUCCESS from 0x40000000 instead
of 0x80000000, so we stay within the bounds of a postive signed
int (it broke some compilers)
* gtk/gtkmenushell.c
* gtk/gtkoptionmenu.c: merges from HEAD to make option menus work
when some of the menuitems are hidden
* gtk/gtkthemes.h: don't include dlfcn.h explictly, gmodule takes
care of that
* gtk/gtkwidget.c: add a dummy continue after the line label
next_rect, since some compilers don't like label: }
Sun Nov 1 20:05:55 PST 1998 Manish Singh <yosh@gimp.org>
* Okay, so we need the X11R6 keysyms so programs don't have to
worry about them. They don't conflict anyway. Reverted the #ifdef
changes to gtk/*.c
* gdk/Makefile.am: remove the BUILT_SOURCES rule, and make a
special rule for them (X-derived-headers)
Sun Nov 1 05:30:32 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: changed the awk scripts to generate gdkcursors.h
and gdkkeysyms.h into sed scripts, since the awk scripts weren't
portable, and we really shouldn't be using awk anyway.
* makecursors.awk
* makekeysyms.awk: bye bye
* gtk/gtkaccelgroup.c
* gtk/gtkclist.c
* gtk/gtknotebook.c
* gtk/gtkwindow.c: don't use X11R6 keysyms if they aren't there
Sat Oct 31 15:22:14 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/Makefile.am: do the same built sources trick for gdkcursors.h
and gdkkeysyms.h. Remove those files from CVS.
Sat Oct 31 14:44:01 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdk.c: move prototype of gdk_wm_protocols_filter outside
of the USE_XIM #ifdef
* gtk/Makefile.am: cause the built sources to be rebuild when possible,
even with --include-deps. Slightly different from timj's fix, to avoid
circular dependency with gtkmarshal.c
* autogen.sh
* gtk/gtkclist.[ch]
* gtk/gtkctree.c
* gtk/gtkfontsel.[ch]
* gtk/gtklist.c
* gtk/gtklistitem.c
* gtk/gtkobject.[ch]
* gtk/testgtk.c: merges from HEAD
* gtk/gtkmenubar.c
* gtk/gtkradiomenuitem.c
* gtk/gtktreeitem.c: cleanups
Wed Oct 28 23:32:19 PST 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: Oops. s/BIGENDIAN/BIG_ENDIAN/
Wed Oct 28 19:04:49 PST 1998 Manish Singh <yosh@gimp.org>
* configure.in: AIX has libpthreads, to make sure you can have
more than one thread. Also add -D_THREAD_SAFE, and reorder
configure.in so CFLAGS doesn't get clobbered when we actually
want to modify it
* gdk/gdkimage.c: initialize the bpp and byte_order fields properly
in gdk_image_get
* gtk/testdnd.c: removed unused variable "buf"
Mon Oct 26 16:46:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_unregister_toplevel):
remove_link(), not remove()
Sun Oct 25 20:27:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): support an environment variable
GTK_MODULES= which takes a colon sperated list of module names
automatically loaded at gtk_init() startup.
Thu Oct 22 02:29:53 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.h: GtkType and macro fixups
* gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern
for the file selection widget to try a completion on (set the
initial filter).
Wed Oct 14 14:34:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c: implement idle functions via GHook. this gives a
slight speed improvement and lessens code duplication.
Thu Oct 22 02:27:30 PDT 1998 Manish Singh <yosh@gimp.org>
* gdk/gdkrgb.c: use glib endian stuff
* configure.in: don't need to check for endianness anymore
* gtk/gtkstyle.h: removed #pragma }, causing a silly warning
Wed Oct 21 17:44:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Reset
all toplevel widgets, not toplevel windows. (I.e.,
plugs should be reset)
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Yes, we
_do_ need to notify the other toplevels - by the time
the get the client messages, the RC file dates will
have been updated.
* gtk/gtkcontainer.h: Added a function call to list
every toplevel widget.
* gdk/gdk.c (gdk_event_send_client_message_to_all_recurse):
Don't send client messages to _every_ window on display!
Wed, 21 Oct 1998 19:10:02 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 16:21:04 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkps.c: better guessing of postscript font name.
* gtk/Makefile.am: compile testps.c
* gtk/gtkdnd.c (gtk_drag_source_event_cb): Don't start drags
when dragging across widgets, only in drags
starting in widget.
Tue, 20 Oct 1998 12:03:46 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 15:59:49 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkprivate.h: GdkGCPrivate now stores complete info
about color, clip-rectangles (not for bitmaps yet) and
dashes.
GdkWindowPrivate now has a GdkDrawableClass member to allow
for customized draw operations.
* gdk/gdktypes.h: GdkFont now has a name member; new
GDK_WINDOW_DRAWABLE type for GdkWindow; new structure
GdkDrawableClass.
* gdk/gdkdraw.c: use engine-specific functions to draw.
* gdk/gdkwindow.c: handle destroy of GDK_WINDOW_DRAWABLE.
* gdk/gdkps.[ch]: postscript drawable engine.
* gdk/gdkdrawable.c: drawable engine registration.
* gdk/gdk.h: include drawable engine headers and declare
engine registration function.
New function: gdk_region_get_rectangles().
* gdk/gdkfont.c: store the name of the font loaded (needs
work for fontset).
* gdk/gdkgc.c: handle changes to GdkGCPrivate.
* gdk/gdkregion.c: use our own functions for Region handling
(stolen from X 6.3: Region.c region.h poly.h PolyReg.c).
* gtk/testps.c: test postscript backend.
* gtk/gtkdnd.c (gtk_drag_source_info_destroy):
Emit "drag_end" signal at end of drag.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
* gtk/gtkdnd.c: Always send "drag_leave" to dests
without GTK_DEST_DEFAULT_MOTION.
Mon Oct 19 23:44:41 1998 Lars Hamann <lars@gtk.org>
Tue Oct 20 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c: rearranged some functions
(gtk_clist_set_column_auto_resize): new function. toggle auto_resize
flag of column
(gtk_clist_set_column_resizeable): if resizeable disable auto_resize
(gtk_clist_set_border): deprecated function, use
gtk_clist_set_shadow_type instead.
(gtk_clist_set_shadow_type): replacement for gtk_clist_set_border
(adjust_scrollbars): some cleanups
(select_row) (unselect_row): removed. replaced by equivalent
gtk_signal_emit calls
(add_style_data): removed, use gtk_clist_style_set instead
(gtk_clist_style_set): fill in size data, after style was set.
(set_cell_contents) (gtk_clist_set_shift) (gtk_clist_set_row_style)
(gtk_clist_set_cell_style): auto_resize columns if needed
(column_auto_resize): resize column if needed for auto_resize
(real_clear): disable auto_resize while list destroy
(resize_column): removed
* gtk/gtkwindow.c (gtk_window_read_rcfiles): Look
for "gtk-embedded" data currently set by
GtkSocket, and use that to forward client message
on to embedded windows. Only reset our own toplevel -
the others will handle themselves. (Now that
GtkMenus live in GtkWindows)
* gtk/gtkctree.c : (gtk_ctree_remove_node)
(gtk_ctree_set_line_style) (gtk_ctree_set_expander_style)
(gtk_ctree_node_set_row_style) (gtk_ctree_node_set_cell_style)
(set_cell_contents) (gtk_ctree_node_set_shift) (gtk_ctree_set_spacing)
(real_tree_move) (gtk_ctree_set_indent) (gtk_ctree_insert_node)
(real_tree_collapse) (real_tree_expand) (column_auto_resize):
auto_resize columns if needed
(gtk_ctree_collapse_recursive) (gtk_ctree_collapse_to_depth)
(real_clear): disable auto_resize while processing the tree
Tue Oct 20 12:57:10 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_clist) (create_ctree): set auto_resize
for one column
* gdk/gdk.c (gdk_send_clientmessage_to_all): Hunt
the window tree more comprehensively, so that we find
client windows hidden under non-toplevels.
Tue Oct 20 12:43:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_data_set):
Maintain the null-termintation guarantee, even when
data = NULL, length = 0. (Warn on data = NULL,
length > 0)
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Tue, 20 Oct 1998 11:33:10 +0200 Paolo Molaro <lupus@debian.org>
* gtk/gtkdnd.h,gtk/gtkdnd.c: delete is a reserved word in c++.
Tue Oct 20 11:55:24 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Handle DestroyNotify
on destroyed windows so we clear the XID table properly.
Finish up restructure of return value handling that
was half-done before.
Mon Oct 19 16:41:44 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Add in coordinates
into function prototype for drag_data_received.
Mon Oct 19 16:40:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdnd.c (get_client_window_at_coords_recurse): Modify
client window finding code so that it works with
WM's other than fvwm.
Mon Oct 19 08:31:36 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_selection_received): Fixed
typo - look for right atom on transfer failures.
Sun Oct 18 22:48:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdrawwindow.c (gtk_draw_window_get_type): Added
the "GtkDrawWindow" class, which is a descendent
of the Window class which leaves its background alone.
Essentially, a toplevel drawing area, though it does
allow adding a child.
Sat Oct 17 00:40:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Duplicate bg_pixmap_name when
merging RC styles. Report new share/themes path for
themes directory. Deref theme engines when appropriate.
* gtk/gtkclist.c: Set all backgrounds in _style_set().
Make sure that pixel for xor_gc is never 0.
* gtk/gtkctree.c: Choose colors for plus/minus more
carefully, in a hopefully style-independent fashion.
(Still needs a bit more work)
* gtk/gtkwidget.c: Don't send expose events to widgets
which are about to be resized and redrawn. (Needs a
bit more thought.)
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Avoid
drawing on tabs for newly allocated, un-sized
pages - we'll get the size wrong.
Thu Oct 1 17:38:07 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_redraw_queue_remove): Fixed
up stupidities in last commit.
Thu Oct 1 14:25:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: When handling queued resizes, account
for handleboxes, where the widget heirarchy is different
than the window heirarchy by just queueing a resize on
the entire handlebox if the detached child is changed.
- Remove widgets from the redraw queue when reparenting,
even if not unrealizing. We queue a resize/redraw in
any case.
Mon Sep 28 21:07:01 EDT 1998 The Rasterman <raster@redhat.com>
* gtk/gtkstyle.c: added check to see if the widget has been shaped
byt the app via gtk_widget_shape_combine_mask and if it has does
not reset the shape on theme change.
Tue Sep 15 11:30:03 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c: Keep a list of directories in which we never
want to stat the entries (like /afs), and assume everything in
those directories is a subdirectory.
- When following a path, try to open components even when
we don't find them in their parent's directory to
support automounters.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Fri Sep 11 15:36:33 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputgxi.h (gdk_input_gxi_grab_pointer): Hopefully
now at least compiles again.
* gdk/gdk.c (gdk_event_translate): Don't pass events
on destroyed widgets to the gdk_input layer.
Thu Sep 3 19:45:34 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c: Use g_module instead of dlopen()
Thu Sep 3 19:30:11 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_expose): Check
if we've changed widgets since the expose event
was queued.
Mon Aug 31 15:33:13 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.h (struct _GtkStyle): Reordered a bit
to restore approximate bin compatibility with the
non-themes branch. (This does break bin compat
within the themes branch.)
Sun Aug 30 16:48:27 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklabel.c (gtk_label_set): Eliminate a
gdk_window_clear_area() that snuck in with the
menu underlines merge.
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 23:37:26 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Fixed some remaining background drawing,
merges from main branch, cleanups.
Mon Aug 24 10:55:51 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_draw_tab): Don't
dereference NULL focus tab.
* gtk/gtkscale.c (gtk_scale_[un]map): Add map/unmap
functions since we need to both show/hide and
queue a redraw. (There's some duplication of drawing here,
we probably should only be queuing a redraw on the
"value" portion of the scale.)
Fri Aug 21 19:02:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrange.[ch] gtk/gtkhscale.c gtk/gtkvscale.[ch]: Fit scales
into the theme-drawing framework. We do this by making them,
like check/radio-buttons, no-window widgets with subwindows. We
then move the value by calling gtk_widget_queue_clear() and only
redraw the value in our draw() / expose() handler. A virtual
function clear_background is added which queues a clear on the
"background" portion of the widget.
Fri Aug 21 13:04:27 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (mark_bg_gc): Make background colors work
again. (We can't always paint the background with a
paint() function - only do that for selected text)
Mon Aug 17 20:31:01 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktearoffmenuitem.c gtk/gtkclist.[ch] gtk/gtkctree.[ch]
gtk/gtklabel.c gtk/gtkmenu.c: Merges from main branch.
* Makefile.am (SRC_SUBDIRS): Removed themes from SRC_SUBDIRS.
the themes can't be built as part of the same build since
they depend on gdk_imlib.
Fri Aug 14 12:44:30 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkthemes.c (gtk_theme_engine_get): Removed sample engine code
from gtkthemes.c.
* configure.in ltconfig.in ltmain.sh gdk/Makefile.am gtk/Makefile.am
gtk/
- Upgrade to libtool-1.2b + patch to add shared library dependencies
for Linux. (Needs to be extended to other platforms where they
are safe)
- Check for -ldl so this branch should build on all platforms, though
themes will work on all platforms they could work on.
- Use -version and -release simultaneously: sonames stay as they are
in the current scheme, but -lgtk-1.1 changes to -lgtk.
- Added in extra -l flags to library LDFLAGS so we get shared library
dependencies against X libs and -ldl. (But not libgtk against
libgdk or libglib yet, since dependencies against uninstalled
libraries aren't portable)
Fri Aug 21 16:10:38 EDT 1998 The Rasterman <raster@redhat.com>
* gtkrc.c - added api calls to find module and theme paths from gtk.
nuked gtk_install_prefix global.
Fri Aug 21 12:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed gtk_install_prefix global.
Thu Aug 20 19:27:49 EDT 1998 The Rasterman <raster@redhat.com>
* added gtk_install_prefix global const variabel to find where gtk is
installed.
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* added ~/.gtk/lib/themes/engines/ to the default searchpath for
gtk theme engines
Thu Aug 20 18:27:29 EDT 1998 The Rasterman <raster@redhat.com>
* made gtkrc scanner append dir that gtkrc is read from to pixmap path.
Sun Oct 18 20:52:22 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwidget.c gtkmarshal.list: Change signal
@@ -669,15 +1025,6 @@ Tue Sep 15 11:06:13 1998 Owen Taylor <otaylor@redhat.com>
with unchanged dimensions, send a synthetic expose
since ForgetGravity won't expose our window.
Mon Sep 14 14:28:24 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (adjust_adj): Change the way we
set the adjustments on resize so that it tries to
keep the beginning of the text in approximately
the same place.
Removed assertion that the above change made invalid.
Thu Sep 10 22:19:35 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: - Save first_cut_pixels when switching
@@ -984,12 +1331,6 @@ Sat Aug 29 14:50:56 PDT 1998 Manish Singh <yosh@gimp.org>
* gtk/testthreads.c: add #include <unistd.h> for sleep()
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (recompute_geometry): Make sure the
mark we pass to line start is the beginning of a
real line, not a wrapped one.
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
@@ -1088,187 +1429,74 @@ Fri Aug 21 13:06:04 1998 Stuart Parmenter <pavlov@gimp.org>
* gtk/gtkfeatures.h.in: added GTK_HAVE_FEATURES_1_1_2 for changes
such as GtkCTree function name changes
Fri Aug 21 02:31:26 1998 Tim Janik <timj@gtk.org>
Mon Aug 10 23:03:55 1998 The Rasterman <raster@redhat.com>
* Fixed minor problem in gtkhandlebox.c with drawing, and some
notebook stuff. Also pixmap theme is now "clean" again.
Mon Aug 10 23:03:55 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.h:
* gtk/gtkmain.c (gtk_check_version): added a function to perform a
binary version check, returning a static string for error descriptions,
or NULL on success.
* gtk/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
Thu Aug 20 20:08:15 1998 Owen Taylor <otaylor@redhat.com>
Mon Aug 10 23:09:30 EDT 1998
* Added a few drawing fixes for notebook and other widgets. finished
pixmap theme up to the level that can be supported so far. (need to
add path discovery 9ie where is the rc fiel from - add to pixmap
path so we can get theimages from there too). then we can package
themes. After that need to add to theme seartch path stuff in users
home dir.
Thu Aug 6 16:49:25 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.
* gtk/gtktooltips.c (gtk_tooltips_expose): Draw into a
drawing area, draw in an expose handler.
* gtk/gtktext.c (correct_cache_insert): Fiddled around
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)
* gtk/gtknotebook.c (gtk_notebook_expose): Check for
empty current page.
Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
Wed Aug 5 16:13:15 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: silly visual fixes
* gtk/gtkcolorsel.c (gtk_color_selection_draw_wheel): Moved
creation of GC's so that they will be set before
they are used for map events (why are they used there?)
* gtk/testgtk.c: call gdk_rgb_init so color preview test actually
works
* gtk/gtkwidget.c: Fixed mistake that caused widgets to
be queued in multiple times in the queue.
1998-08-20 Federico Mena Quintero <federico@nuclecu.unam.mx>
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkhandlebox.c (gtk_handle_box_button_changed): Do not do
anything if the event's window is not the bin window.
(gtk_handle_box_motion): Likewise.
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
1998-08-19 Raph Levien <raph@gimp.org>
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_color_preview): pushed the colormap and
visual so it would work better with GdkRgb.
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
1998-08-19 Raph Levien <raph@gimp.org>
Tue Aug 4 19:12:14 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkrgb.c: fixed some bugs in the 565_d mode, and added a
4bpp static_color mode (for vga displays). Also fixed a '64' value
in the dither matrix, which was causing one pixel out of 16k to be
dithered wrong.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fixed up
handling of partially clipped areas.
* gtk/gtkpreview.{c,h}: Changed it to work with GdkRgb, gutting
most of the contents. This is an API change - any apps that relied
on the internal structure of GtkPreview will need some change -
most notably in the use of reserved colors. The Gimp needed
changes in this regard.
Wed Aug 5 02:57:20 1998 Lars Hamann <lars@gtk.org>
Wed Aug 19 00:11:14 1998 Tim Janik <timj@gtk.org>
* gtk/gtkctree.h:
* gtk/gtkctree.c:
(gtk_ctree_find): changed to return a gboolean
(gtk_ctree_insert_gnode): new function for recursive insertion of a
GNode tree.
(gtk_ctree_real_select_recursive): fix for extended selection
(gtk_ctree_sort_recursive): in case node == NULL, sort root nodes too.
(gtk_ctree_set_node_info) (set_node_info): few fixes for expanded flag
* gtk/gtkmain.c (gtk_init): allow argument parsing in gtk without
G_ENABLE_DEBUG being defined (specifically --gtk-module= and
--g-fatal-warnings), noticed by miguel.
Tue Aug 4 16:18:26 1998 Tim Janik <timj@gtk.org>
Tue Aug 18 17:54:40 1998 Tim Janik <timj@gtk.org>
* configure.in: version bump to 1.1.1, binary age 0, interface age 0.
GLib version 1.1.1 is now required at minimum.
* gtk/gtkrc.c (gtk_rc_parse_file): use g_get_current_dir() instead of
getcwd().
* gdk/gdkprivate.h:
* gdk/gdkglobals.c:
* gdk/gdkwindow.c:
* gdk/gdk.c:
* gtk/gtkwindow.c:
* gtk/gtkitemfactory.c:
dropped gdk_progname, use g_get_prgname()/g_set_prgname() instead.
* gtk/gtkselection.c:
* gtk/gtkpreview.c:
* gtk/gtkobject.c:
* gtk/gtkmain.c:
* gtk/gtktypeutils.c: indentation fixes due to g_message() use.
* gdk/gdkrgb.c: exchanged occourances of g_print with g_message.
Tue Aug 18 17:22:22 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_switch_focus_tab):
* gtk/gtknotebook.c (gtk_notebook_update_labels): fix for sigsegv
in case of show_tabs == NULL
Tue Aug 18 03:54:43 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmain.c (gtk_init): restricted the --g*fatal-* arguments
to --g-fatal-warnings again. this option now causes log levels of
WARNING and CRITICAL to abort().
* gdk/gdk.c:
* gdk/gdkdnd.c:
* gdk/gdkcc.c:
* gdk/gdkfont.c:
* gdk/gdkwindow.c:
* gdk/gdkvisual.c:
* gtk/gtkwidget.c:
* gtk/gtktypeutils.c:
* gtk/gtktree.c:
* gtk/gtkfontsel.c:
* gtk/gtkmain.c:
* gtk/gtkobject.c:
* gtk/gtkpreview.c:
* gtk/gtkselection.c:
* gtk/gtktext.c:
* gtk/gtktree.c:
* gtk/gtktreeitem.c:
did a global search&replace to substitute g_print() calls with
g_message(). libraries shouldn't use printf(), g_print() or
g_printerr() at all.
a bunch of the replacements should probably be wrapped into the
G{D|T}K_NOTE() macros, so they are special cased for debugging
purposes in a sane way, avoiding all the nasty #ifdef DEBUG_MY_TEDDY
things.
* gdk/gdkdnd.c: added copyright notice.
Mon Aug 17 17:28:00 Raph Levien <raph@gtk.org>
* gdk/gdkrgb.c: Further speedups of the 565_d case. It's
impressively fast now - about 4.65 Mpix/s on an IBM TP 600
running a PII 233. It's synced with the 0.0.5 release of
GdkRgb.
Tue Aug 18 00:29:13 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h:
(struct _GtkCListClass): new class methods:
(sort_list) (insert_row) (remove_row) (set_cell_contents)
* gtk/gtkclist.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): fix to avoid problems with cell types != CELL_TEXT
* gtk/gtkctree.h :
(gtk_ctree_export_to_gnode): new function to export a ctree as gnode
(gtk_ctree_node_is_visible): new function to return visibility state
of a node
(gtk_ctree_show_stub): new function to set visibility of root stub
renamed functions :
(gtk_ctree_insert) -> (gtk_ctree_insert_node)
(gtk_ctree_remove) -> (gtk_ctree_remove_node)
(gtk_ctree_find_glist_ptr) -> (gtk_ctree_find_node_ptr)
(gtk_ctree_set_text) -> (gtk_ctree_node_set_text)
(gtk_ctree_set_pixmap) -> (gtk_ctree_node_set_pixmap)
(gtk_ctree_set_pixtext) -> (gtk_ctree_node_set_pixtext)
(gtk_ctree_set_shift) -> (gtk_ctree_node_set_shift)
(gtk_ctree_get_cell_type) -> (gtk_ctree_node_get_cell_type)
(gtk_ctree_get_text) -> (gtk_ctree_node_get_text)
(gtk_ctree_get_pixmap) -> (gtk_ctree_node_get_pixmap)
(gtk_ctree_get_pixtext) -> (gtk_ctree_node_get_pixtext)
(gtk_ctree_set_foreground) -> (gtk_ctree_node_set_foreground)
(gtk_ctree_set_background) -> (gtk_ctree_node_set_background)
(gtk_ctree_set_row_data) -> (gtk_ctree_node_set_row_data)
(gtk_ctree_set_row_data_full) -> (gtk_ctree_node_set_row_data_full)
(gtk_ctree_get_row_data) -> (gtk_ctree_node_get_row_data)
(gtk_ctree_moveto) -> (gtk_ctree_node_moveto)
(gtk_ctree_sort) -> (gtk_ctree_sort_node)
(gtk_ctree_is_visibe) -> (gtk_ctree_is_viewable)
* gtk/gtkctree.c :
(cell_empty) (cell_set_text) (cell_set_pixmap) (cell_set_pixtext):
removed and replaced by (set_cell_contents)
(set_cell_contents): function for class method set_cell_contents
(real_insert_row): function for class method insert_row
(real_remoce_row): function for class method remove_row
(real_sort_list): function for class method sort_list
(default_compare): removed. CTree now also compares two GtkCTreeRows
instead of two GtkCTreeNodes.
(gtk_ctree_unlink): call gtk_ctree_collapse if parent is empty after
unlinking the node
(real_tree_expand) (real_tree_collapse): fix for refcounting of
node pixmaps
(set_node_info): call gtk_ctree_node_set_pixtext instead of
manipulating the row itself
* gtk/testgtk.c: use renamed functions of GtkCTree.
new sample to show gtk_ctree_export_to_gnode and gtk_ctree_insert_gnode
at work.
* docs/Makefile.am: added gtk_tut_fr.sgml to EXTRA_DIST (french version
of the Gtk+ tutorial, contributed by Eric Jacoboni <jaco@dotcom.fr>.
Mon Aug 17 15:31:38 1998 Tim Janik <timj@gtk.org>
@@ -1673,6 +1901,137 @@ Tue Jul 28 20:32:03 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* gtk/docs/man: new directory
* gtk/docs/man/gtk_button.pod: new file, initial gtk_button man page
Sat Aug 1 17:44:31 EDT 1998 EDT 1998 The Rasterman <raster@redhat.com>
* Wheeeeeeeeeeeeeeee fixed radiobittons to work in gimp again.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* YES YES YES YES YES clist borders work again! YES! YES YES! gimme
more baby oooh yeah more more MORE YES YES.
Fri Jul 31 19:45:12 EDT 1998 The Rasterman <raster@redhat.com>
* hopefully fixed problem wiht togglebuttons acting like
radiobuttons in gtktogglebutton.c
Thu Jul 30 23:36:46 EDT 1998 The Rasterman <raster@redhat.com>
* fixed another drawing buglet in the frame drawing code (actually
in the clearing code but anyway in gtkstyle.c)
Thu Jul 30 19:23:48 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed warning from colorsel widget...
Thu Jul 30 19:10:42 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed defautl drawing code to no longer clobber the original style
pixmap bgs as it did and added a helper funciton og gtkstyle.c to
help with this.
Thu Jul 30 18:09:21 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c gtk/gtkstyle.c: More mm fixups
* gtk/gtktooltips.c: Pass a widget (the window) to the
drawing function instead of the GtkTooltips.
Thu Jul 30 17:27:10 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c: Abstract out checking for shape
extension into a function.
* gtk/gtkwindow.c: Fix up gtk_window_expose()/draw().
Remove extra callls to gtk_window_draw().
Thu Jul 30 11:18:43 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c gtk/gtkrc.c: Memory management fixups.
* themes/th_main.c: Moved messages around so they are
printed before destroying strings.
Wed Jul 29 16:56:07 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c: Fairly simple implementation of expose compression.
(No GraphicsExpose compression yet, always compress
with the equivalent of XtCompressMultiple - no compression
of Expose events across non-Expose events)
* gdk/gdk.h gdk/gdkrectangle.c: gdk_rectangle_union()
Find rectangle bounding two rectangles.
* gtk/gtkstyle.c: Set clip rects for a few extra GC's
in gdk_default_draw_shadow()
Wed Jul 29 16:03:20 EDT 1998 The Rasterman <raster@redhat.com>
* Fixed drawing functions to handle switching themes on the fly
gracefully and look decent.
Tue Jul 28 22:52:10 EDT 1998 The Rasterman <raster@redhat.com>
* Added all the theme drawing code to all widgets, fixed up minor
nigglies in some widgets when it comes to themes, seem to be
running into some funky behavior with clipping rects in GC's. Too
many files to list here. (all files that now use gtk_paint_* are
affected).
Tue Jul 28 22:49:16 1998 Owen Taylor <otaylor@redhat.com>
* themes/th_main.c themes/th_draw.c gtk/testgtkrc:
Set up the demo theme so it is loaded from the RC file.
* themes/th_draw.c: Alleviate the hardcoded paths a wee
bit. (use $HOME/themes/)
* gtk/gtkthemes.[ch] gtk/gtkmain.c: Load engines specified in
the RC file via dlopen()
Tue Jul 28 20:30:56 1998 Owen Taylor <otaylor@redhat.com>
Internal handling of styles and RC styles pretty much
completely reworked for Theme work.
* gtkthemes.[ch]:
- Added routines for virtualization of RcStyle and Style handling.
- Temporary "sample" inline theme-engine. (Does nothing
but print out a few messages.
* gtkrc.[ch]
- Made GtkRcStyle public, added flags to tell if particular
colors have been set.
- RC Styles are "transparent", and the final style for
a widget is the composition of all matching styles
- Added pointer to GtkThemeEngine, and gpointer engine_data
to RC style and style.
- Parse "engine" keyword, load the appropriate theme engine
and call the engine's parser.
* gtkstyle.[ch]
- Keep a GtkRcStyle * in styles created from Rc Styles.
- Load up images from RC file at style attachment time.
- Call ->engine->foo() at appropriate times.
- Don't use a GCache. All incarnations for a style are
just linked together in a list, depend on the RC style
code to find the existing copy.
Tue Jul 28 14:41:54 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.[ch]: Added the concept of queued redraws
of partial areas. This can be done either relative
to the existing windows (gtk_widget_queue_clear[_area]())
or relative to the future allocation of the widget
(gtk_widget_queue_draw[_area]).
The initial implementation is pretty braindead, but
can be improved.
* gtk/gtkwidget.[ch]: Removed calls to gdk_window_clear_area()
in favor of gtk_widget_queue_clear().
* gtk/gtklabel.[ch] gtk/gtkpixmap.[ch]: Removed needs_clear
flags in favor of gtk_widget_queue_clear()
Tue Jul 28 00:15:28 CDT 1998 Shawn T. Amundson <amundson@gtk.org>
* docs/gdk.sgml: new format for GDK documentation. Eventually
plan to remove gdk.texi, but not quite yet. Just getting
started.
Tue Jul 28 00:03:20 1998 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_paint): small fix for border drawing
+3 -3
View File
@@ -7,8 +7,8 @@ you got this package.
Simple install procedure
========================
% gzip -cd gtk+-1.1.2.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.1.2 # change to the toplevel directory
% gzip -cd gtk+-1.1.3.tar.gz | tar xvf - # unpack the sources
% cd gtk+-1.1.3 # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK
[ Become root if necessary ]
@@ -92,7 +92,7 @@ You can compile GTK+ against a copy of GLIB that you have not
yet installed. To do this, give the --with-glib=DIR options
to ./configure. For instance:
./configure --with-glib=../glib-1.1.3
./configure --with-glib=../glib-1.1.4
This, however, will not work if you built GLIB with different
source and build directories.
+27 -36
View File
@@ -3,10 +3,6 @@ For 1.2.0 release:
non-functional ones.
Bugs:
* Widget redrawing when the window resizes sometimes messes up.
GtkLabels sometimes redraw without clearing up the underlying background on
window resizes.
* Change bitfields to guints from enums, or vice versa?
* MappingNotify events produce warnings.
@@ -17,39 +13,10 @@ Bugs:
types seperatedly from derived types, so we don't screw foreign
fundamental types with an already extensively increased seqno.
* Expose events aren't being generated correctly for DND demo
* delay dnd settings to take effect once a widget is realized, this is
to avoid force realizations. i think this goes along with owens dnd
changes?
-timj
The way DND data types are set in GtkWidget really needs to be fixed.
This is pretty high on my priority list, and I'll get to it as soon as
the column list widget is done. The correct way dnd data needs to be set
is to have a additional keyed data type with GtkWidget, which is applied to
the widget's window upon realize.
There also needs to be a way to set dnd-data on widget windows which are
not the main window (for widgets that create more than one window).
-Jay Painter
DnD seems to work for me, but yes, there needs to be some sort of
gtk_widget layer that makes it easier... Also, adding support for drop
zones might be nice.
-Elliot
This one is reproducabel for me:
testgtk --sync
popup colorselection
drag/drop works
start up preview color
drag works but not dropping
end preview color
drag/drop works
start up prewiev color
segfault in malloc
-timj
* A filter function which destroys the GDK window it is filtering
events on is bad news.
Additions:
* implement keyboard navigation in menus
* focus handling for GtkOptionMenu (needs the previous)
* GScanner: it might be good to ues stdio and getch() instead of 1-character
@@ -282,9 +249,33 @@ Text/Edit widget:
- Delete IC in editable->unrealize, not editable->finalize?
Themes
======
- When a scale gets shown/hidden only queue a redraw on the
non-window portion, not the whole area.
- In various places, to avoid shaping windows excessively,
we set parent relative backgrounds. This is an ugly
hack and needs a better solution. Plus, I don't think
these parent-relative backgrounds always persist to
when they are actually needed.
Such calls exist in: GtkButton, GtkHandeBox, GtkItem,
GtkListItem, GtkMenu, GtkMenuItem, GtkMisc,
GtkNoteBook, GtkOptionMenu, GtkPaned, GtkPreview,
GtkSpinButton and GtkTreeItem.
- For menus and for GtkWindow's, the realize() function
calls paint(), so that background pixmaps can be set
ahead of time, and prevent flashing when the window is
shown. This is an ugly hack and needs a better solution.
=======
Calendar Widget:
- The widget should be nicely resizeable vertical to.
- The widget should be nicely resizeable vertical too.
- CALENDAR_MARGIN should be removed, uses INNER_BORDER and
style->class->[xy]thickness insted.
+1 -1
View File
@@ -46,7 +46,7 @@ if test -z "$*"; then
fi
case $CC in
xlc | *lcc | *lcc\ *) am_opt=--include-deps;;
*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
esac
aclocal $ACLOCAL_FLAGS
+10 -4
View File
@@ -12,10 +12,6 @@
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
@@ -23,6 +19,7 @@
#undef GTK_COMPILED_WITH_DEBUGGING
#undef HAVE_IPC_H
#undef HAVE_LIBDL
#undef HAVE_SHM_H
#undef HAVE_XSHM_H
#undef HAVE_SHAPE_EXT
@@ -49,8 +46,17 @@
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define if you have the broken_wctype function. */
#undef HAVE_BROKEN_WCTYPE
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Define if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
+90 -23
View File
@@ -91,21 +91,26 @@ AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
changequote(,)dnl
if test "x$GCC" = "xyes"; then
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -Wall"
fi
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
if test "x$enable_ansi" = "xyes"; then
if test -z "`echo "$CFLAGS" | grep "\-ansi" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -ansi"
fi
case " $CFLAGS " in
*[\ \ ]-ansi[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -ansi" ;;
esac
if test -z "`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -pedantic"
fi
case " $CFLAGS " in
*[\ \ ]-pedantic[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -pedantic" ;;
esac
fi
fi
changequote([,])dnl
# define a MAINT-like variable REBUILD which is set if Perl
# and awk are found, so autogenerated sources can be rebuilt
@@ -170,9 +175,9 @@ fi
if test x$with_glib = x ; then
# Look for separately installed glib
AM_PATH_GLIB(1.1.3,,
AM_PATH_GLIB(1.1.4,,
AC_MSG_ERROR([
*** GLIB 1.1.3 or better is required. The latest version of GLIB
*** GLIB 1.1.4 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org.]),
gmodule)
@@ -181,17 +186,18 @@ if test x$with_glib = x ; then
else
# Use uninstalled glib (assume they got the version right)
if test -x $with_glib/glib-config ; then
GLIB_CONFIG=$with_glib/glib-config
if test -x $GLIB_CONFIG ; then
:
else
AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured])
fi
# For use in gtk-config
glib_cflags=`$with_glib/glib-config --cflags`
glib_libs=`$with_glib/glib-config --libs`
glib_cflags=`$GLIB_CONFIG --cflags`
glib_libs=`$GLIB_CONFIG --libs`
glib_release=`$with_glib/glib-config --version | sed 's%\\.[[0-9]]*$%%'`
glib_release=`$GLIB_CONFIG --version | sed 's%\\.[[0-9]]*$%%'`
# canonicalize relative paths
case $with_glib in
@@ -285,11 +291,19 @@ fi
# Threads
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
if test "x$with_threads" = "xposix" || test "x$with_threads" = "xyes"; then
AC_CHECK_LIB(pthread, pthread_attr_init,
AC_DEFINE(USE_PTHREADS)
[AC_DEFINE(USE_PTHREADS)
x_libs="$x_libs -lpthread"
CFLAGS="$CFLAGS -D_REENTRANT")
CFLAGS="$CFLAGS -D_REENTRANT"],
# AIX has libpthreads, cause they're special. Special friends (TM)
AC_CHECK_LIB(pthreads, pthread_attr_init,
[AC_DEFINE(USE_PTHREADS)
x_libs="$x_libs -lpthreads"
CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"]))
fi
AC_SUBST(x_cflags)
@@ -298,9 +312,6 @@ AC_SUBST(x_ldflags)
AC_SUBST(x_libs)
AC_SUBST(xinput_progs)
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
if test "x$enable_shm" = "xyes"; then
# Check for shared memory
AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
@@ -402,9 +413,6 @@ AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for endianness (needed by GdkRgb).
AC_C_BIGENDIAN
# Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_MMAP
@@ -426,6 +434,65 @@ else
fi
fi
# Duplicate `widechar' tests from `glib'.
# Check for wchar.h
if test x = y; then
# will not be executed
# hack so as not to update `acconfig.h'
AC_CHECK_HEADERS(wchar.h wctype.h)
AC_CHECK_FUNCS(broken_wctype)
fi
AC_MSG_CHECKING(for wchar.h)
AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
ac_kludge=HAVE_WCHAR_H
AC_DEFINE($ac_kludge)
fi
AC_MSG_RESULT($gtk_ok)
# Check for wctype.h (for iswalnum)
AC_MSG_CHECKING(for wctype.h)
AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
ac_kludge=HAVE_WCTYPE_H
AC_DEFINE($ac_kludge)
fi
AC_MSG_RESULT($gtk_ok)
# in Solaris 2.5, `iswalnum' is in -lw
GDK_WLIBS=
AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])
# The following is necessary for Linux libc-5.4.38
oLIBS="$LIBS"
LIBS="$LIBS $GDK_WLIBS"
AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
AC_TRY_LINK([#include <stdlib.h>],[
#if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
# ifdef HAVE_WCTYPE_H
# include <wctype.h>
# else
# ifdef HAVE_WCHAR_H
# include <wchar.h>
# endif
# endif
#else
# define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
#endif
iswalnum((wchar_t) 0);
], gtk_ok=yes, gtk_ok=no)
LIBS="$oLIBS"
if test $gtk_ok = no; then
ac_kludge=HAVE_BROKEN_WCTYPE
AC_DEFINE($ac_kludge)
GDK_WLIBS=
fi
AC_MSG_RESULT($gtk_ok)
AC_SUBST(GDK_WLIBS)
AC_OUTPUT([
Makefile
gtk-config
+15
View File
@@ -46,4 +46,19 @@ Incompatible Changes from GTK+-1.0 to GTK+-1.2:
* The old drag and drop API has been completely removed and replaced.
See the reference documentation for details on the new API.
* Support for Themes has been added. In general, this does
not affect application code, however, a few new rules should
be observed:
- To set a shape for a window, you must use
gtk_widget_shape_combine_mask() instead of
gdk_window_shape_combine_mask(), or the shape will be
reset when switching themes.
- It is no longer permissable to draw directly on an arbitrary
widget, or to set an arbitrary widget's background pixmap.
If you need to do that, use a GtkDrawingArea or (for a
toplevel) the new GtkDrawWindow widget.
-1
View File
@@ -1,4 +1,3 @@
CC = gcc
filesel: filesel.c
+8 -12
View File
@@ -12,7 +12,6 @@ libgdk_la_SOURCES = \
gdkcursor.c \
gdkdnd.c \
gdkdraw.c \
gdkdrawable.c \
gdkfont.c \
gdkgc.c \
gdkglobals.c \
@@ -25,7 +24,6 @@ libgdk_la_SOURCES = \
gdkinputxfree.h \
gdkpixmap.c \
gdkproperty.c \
gdkps.c \
gdkrgb.c \
gdkrectangle.c \
gdkregion.c \
@@ -49,7 +47,6 @@ gdkinclude_HEADERS = \
gdki18n.h \
gdkkeysyms.h \
gdkprivate.h \
gdkps.h \
gdktypes.h \
gdkx.h
@@ -70,15 +67,14 @@ gxid_LDADD = \
@x_libs@ \
-lm
BUILT_SOURCES = gdkcursors.h gdkkeysyms.h
EXTRA_DIST = makecursors.awk makekeysyms.awk PolyReg.c Region.c region.h poly.h
gdkcursors.h:
awk -f $(srcdir)/makecursors.awk @x_includes@/X11/cursorfont.h > $@
gdkkeysyms.h:
awk -f $(srcdir)/makekeysyms.awk @x_includes@/X11/keysymdef.h > $@
X-derived-headers:
sed -e 's/^#define[ ]*XC\([^ ]*\)[ ]*\([^ ]*\)[ ]*.*$$/GDK\1 = \2,/' \
-e 'tb' -e 'd' -e ':b' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
< @x_includes@/X11/cursorfont.h > gdkcursors.h ; \
sed -e 's/^#define[ ]*XK\([^ ]*\)[ ]*\([^ ]*\)[ ]*.*$$/#define GDK\1 \2/' \
-e 'tb' -e 'd' -e ':b' -e 's/ 0X/ 0x/' \
< @x_includes@/X11/keysymdef.h > gdkkeysyms.h
.PHONY: files
-629
View File
@@ -1,629 +0,0 @@
/* $XConsortium: PolyReg.c,v 11.23 94/11/17 21:59:37 converse Exp $ */
/************************************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
#define LARGE_COORDINATE 1000000
#define SMALL_COORDINATE -LARGE_COORDINATE
/*
#include "Xlibint.h"
#include "Xutil.h"
#include "region.h"
#include "poly.h"
*/
/*
* InsertEdgeInET
*
* Insert the given edge into the edge table.
* First we must find the correct bucket in the
* Edge table, then find the right slot in the
* bucket. Finally, we can insert it.
*
*/
static void
InsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
EdgeTable *ET;
EdgeTableEntry *ETE;
int scanline;
ScanLineListBlock **SLLBlock;
int *iSLLBlock;
{
register EdgeTableEntry *start, *prev;
register ScanLineList *pSLL, *pPrevSLL;
ScanLineListBlock *tmpSLLBlock;
/*
* find the right bucket to put the edge into
*/
pPrevSLL = &ET->scanlines;
pSLL = pPrevSLL->next;
while (pSLL && (pSLL->scanline < scanline))
{
pPrevSLL = pSLL;
pSLL = pSLL->next;
}
/*
* reassign pSLL (pointer to ScanLineList) if necessary
*/
if ((!pSLL) || (pSLL->scanline > scanline))
{
if (*iSLLBlock > SLLSPERBLOCK-1)
{
tmpSLLBlock =
(ScanLineListBlock *)Xmalloc(sizeof(ScanLineListBlock));
(*SLLBlock)->next = tmpSLLBlock;
tmpSLLBlock->next = (ScanLineListBlock *)NULL;
*SLLBlock = tmpSLLBlock;
*iSLLBlock = 0;
}
pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
pSLL->next = pPrevSLL->next;
pSLL->edgelist = (EdgeTableEntry *)NULL;
pPrevSLL->next = pSLL;
}
pSLL->scanline = scanline;
/*
* now insert the edge in the right bucket
*/
prev = (EdgeTableEntry *)NULL;
start = pSLL->edgelist;
while (start && (start->bres.minor_axis < ETE->bres.minor_axis))
{
prev = start;
start = start->next;
}
ETE->next = start;
if (prev)
prev->next = ETE;
else
pSLL->edgelist = ETE;
}
/*
* CreateEdgeTable
*
* This routine creates the edge table for
* scan converting polygons.
* The Edge Table (ET) looks like:
*
* EdgeTable
* --------
* | ymax | ScanLineLists
* |scanline|-->------------>-------------->...
* -------- |scanline| |scanline|
* |edgelist| |edgelist|
* --------- ---------
* | |
* | |
* V V
* list of ETEs list of ETEs
*
* where ETE is an EdgeTableEntry data structure,
* and there is one ScanLineList per scanline at
* which an edge is initially entered.
*
*/
static void
CreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock)
register int count;
register XPoint *pts;
EdgeTable *ET;
EdgeTableEntry *AET;
register EdgeTableEntry *pETEs;
ScanLineListBlock *pSLLBlock;
{
register XPoint *top, *bottom;
register XPoint *PrevPt, *CurrPt;
int iSLLBlock = 0;
int dy;
if (count < 2) return;
/*
* initialize the Active Edge Table
*/
AET->next = (EdgeTableEntry *)NULL;
AET->back = (EdgeTableEntry *)NULL;
AET->nextWETE = (EdgeTableEntry *)NULL;
AET->bres.minor_axis = SMALL_COORDINATE;
/*
* initialize the Edge Table.
*/
ET->scanlines.next = (ScanLineList *)NULL;
ET->ymax = SMALL_COORDINATE;
ET->ymin = LARGE_COORDINATE;
pSLLBlock->next = (ScanLineListBlock *)NULL;
PrevPt = &pts[count-1];
/*
* for each vertex in the array of points.
* In this loop we are dealing with two vertices at
* a time -- these make up one edge of the polygon.
*/
while (count--)
{
CurrPt = pts++;
/*
* find out which point is above and which is below.
*/
if (PrevPt->y > CurrPt->y)
{
bottom = PrevPt, top = CurrPt;
pETEs->ClockWise = 0;
}
else
{
bottom = CurrPt, top = PrevPt;
pETEs->ClockWise = 1;
}
/*
* don't add horizontal edges to the Edge table.
*/
if (bottom->y != top->y)
{
pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
/*
* initialize integer edge algorithm
*/
dy = bottom->y - top->y;
BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock);
if (PrevPt->y > ET->ymax)
ET->ymax = PrevPt->y;
if (PrevPt->y < ET->ymin)
ET->ymin = PrevPt->y;
pETEs++;
}
PrevPt = CurrPt;
}
}
/*
* loadAET
*
* This routine moves EdgeTableEntries from the
* EdgeTable into the Active Edge Table,
* leaving them sorted by smaller x coordinate.
*
*/
static void
loadAET(AET, ETEs)
register EdgeTableEntry *AET, *ETEs;
{
register EdgeTableEntry *pPrevAET;
register EdgeTableEntry *tmp;
pPrevAET = AET;
AET = AET->next;
while (ETEs)
{
while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis))
{
pPrevAET = AET;
AET = AET->next;
}
tmp = ETEs->next;
ETEs->next = AET;
if (AET)
AET->back = ETEs;
ETEs->back = pPrevAET;
pPrevAET->next = ETEs;
pPrevAET = ETEs;
ETEs = tmp;
}
}
/*
* computeWAET
*
* This routine links the AET by the
* nextWETE (winding EdgeTableEntry) link for
* use by the winding number rule. The final
* Active Edge Table (AET) might look something
* like:
*
* AET
* ---------- --------- ---------
* |ymax | |ymax | |ymax |
* | ... | |... | |... |
* |next |->|next |->|next |->...
* |nextWETE| |nextWETE| |nextWETE|
* --------- --------- ^--------
* | | |
* V-------------------> V---> ...
*
*/
static void
computeWAET(AET)
register EdgeTableEntry *AET;
{
register EdgeTableEntry *pWETE;
register int inside = 1;
register int isInside = 0;
AET->nextWETE = (EdgeTableEntry *)NULL;
pWETE = AET;
AET = AET->next;
while (AET)
{
if (AET->ClockWise)
isInside++;
else
isInside--;
if ((!inside && !isInside) ||
( inside && isInside))
{
pWETE->nextWETE = AET;
pWETE = AET;
inside = !inside;
}
AET = AET->next;
}
pWETE->nextWETE = (EdgeTableEntry *)NULL;
}
/*
* InsertionSort
*
* Just a simple insertion sort using
* pointers and back pointers to sort the Active
* Edge Table.
*
*/
static int
InsertionSort(AET)
register EdgeTableEntry *AET;
{
register EdgeTableEntry *pETEchase;
register EdgeTableEntry *pETEinsert;
register EdgeTableEntry *pETEchaseBackTMP;
register int changed = 0;
AET = AET->next;
while (AET)
{
pETEinsert = AET;
pETEchase = AET;
while (pETEchase->back->bres.minor_axis > AET->bres.minor_axis)
pETEchase = pETEchase->back;
AET = AET->next;
if (pETEchase != pETEinsert)
{
pETEchaseBackTMP = pETEchase->back;
pETEinsert->back->next = AET;
if (AET)
AET->back = pETEinsert->back;
pETEinsert->next = pETEchase;
pETEchase->back->next = pETEinsert;
pETEchase->back = pETEinsert;
pETEinsert->back = pETEchaseBackTMP;
changed = 1;
}
}
return(changed);
}
/*
* Clean up our act.
*/
static void
FreeStorage(pSLLBlock)
register ScanLineListBlock *pSLLBlock;
{
register ScanLineListBlock *tmpSLLBlock;
while (pSLLBlock)
{
tmpSLLBlock = pSLLBlock->next;
Xfree((char *)pSLLBlock);
pSLLBlock = tmpSLLBlock;
}
}
/*
* Create an array of rectangles from a list of points.
* If indeed these things (POINTS, RECTS) are the same,
* then this proc is still needed, because it allocates
* storage for the array, which was allocated on the
* stack by the calling procedure.
*
*/
static int PtsToRegion(numFullPtBlocks, iCurPtBlock, FirstPtBlock, reg)
register int numFullPtBlocks, iCurPtBlock;
POINTBLOCK *FirstPtBlock;
REGION *reg;
{
register BOX *rects;
register XPoint *pts;
register POINTBLOCK *CurPtBlock;
register int i;
register BOX *extents;
register int numRects;
extents = &reg->extents;
numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
if (!(reg->rects = (BOX *)Xrealloc((char *)reg->rects,
(unsigned) (sizeof(BOX) * numRects)))) return(0);
reg->size = numRects;
CurPtBlock = FirstPtBlock;
rects = reg->rects - 1;
numRects = 0;
extents->x1 = MAXSHORT, extents->x2 = MINSHORT;
for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) {
/* the loop uses 2 points per iteration */
i = NUMPTSTOBUFFER >> 1;
if (!numFullPtBlocks)
i = iCurPtBlock >> 1;
for (pts = CurPtBlock->pts; i--; pts += 2) {
if (pts->x == pts[1].x)
continue;
if (numRects && pts->x == rects->x1 && pts->y == rects->y2 &&
pts[1].x == rects->x2 &&
(numRects == 1 || rects[-1].y1 != rects->y1) &&
(i && pts[2].y > pts[1].y)) {
rects->y2 = pts[1].y + 1;
continue;
}
numRects++;
rects++;
rects->x1 = pts->x; rects->y1 = pts->y;
rects->x2 = pts[1].x; rects->y2 = pts[1].y + 1;
if (rects->x1 < extents->x1)
extents->x1 = rects->x1;
if (rects->x2 > extents->x2)
extents->x2 = rects->x2;
}
CurPtBlock = CurPtBlock->next;
}
if (numRects) {
extents->y1 = reg->rects->y1;
extents->y2 = rects->y2;
} else {
extents->x1 = 0;
extents->y1 = 0;
extents->x2 = 0;
extents->y2 = 0;
}
reg->numRects = numRects;
return(TRUE);
}
/*
* polytoregion
*
* Scan converts a polygon by returning a run-length
* encoding of the resultant bitmap -- the run-length
* encoding is in the form of an array of rectangles.
*/
static Region
GXPolygonRegion(Pts, Count, rule)
int Count; /* number of pts */
XPoint *Pts; /* the pts */
int rule; /* winding rule */
{
Region region;
register EdgeTableEntry *pAET; /* Active Edge Table */
register int y; /* current scanline */
register int iPts = 0; /* number of pts in buffer */
register EdgeTableEntry *pWETE; /* Winding Edge Table Entry*/
register ScanLineList *pSLL; /* current scanLineList */
register XPoint *pts; /* output buffer */
EdgeTableEntry *pPrevAET; /* ptr to previous AET */
EdgeTable ET; /* header node for ET */
EdgeTableEntry AET; /* header node for AET */
EdgeTableEntry *pETEs; /* EdgeTableEntries pool */
ScanLineListBlock SLLBlock; /* header for scanlinelist */
int fixWAET = FALSE;
POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
POINTBLOCK *tmpPtBlock;
int numFullPtBlocks = 0;
if (! (region = GXCreateRegion())) return (Region) NULL;
/* special case a rectangle */
pts = Pts;
if (((Count == 4) ||
((Count == 5) && (pts[4].x == pts[0].x) && (pts[4].y == pts[0].y))) &&
(((pts[0].y == pts[1].y) &&
(pts[1].x == pts[2].x) &&
(pts[2].y == pts[3].y) &&
(pts[3].x == pts[0].x)) ||
((pts[0].x == pts[1].x) &&
(pts[1].y == pts[2].y) &&
(pts[2].x == pts[3].x) &&
(pts[3].y == pts[0].y)))) {
region->extents.x1 = MIN(pts[0].x, pts[2].x);
region->extents.y1 = MIN(pts[0].y, pts[2].y);
region->extents.x2 = MAX(pts[0].x, pts[2].x);
region->extents.y2 = MAX(pts[0].y, pts[2].y);
if ((region->extents.x1 != region->extents.x2) &&
(region->extents.y1 != region->extents.y2)) {
region->numRects = 1;
*(region->rects) = region->extents;
}
return(region);
}
if (! (pETEs = (EdgeTableEntry *)
Xmalloc((unsigned) (sizeof(EdgeTableEntry) * Count))))
return (Region) NULL;
pts = FirstPtBlock.pts;
CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock);
pSLL = ET.scanlines.next;
curPtBlock = &FirstPtBlock;
if (rule == EvenOddRule) {
/*
* for each scanline
*/
for (y = ET.ymin; y < ET.ymax; y++) {
/*
* Add a new edge to the active edge table when we
* get to the next edge.
*/
if (pSLL != NULL && y == pSLL->scanline) {
loadAET(&AET, pSLL->edgelist);
pSLL = pSLL->next;
}
pPrevAET = &AET;
pAET = AET.next;
/*
* for each active edge
*/
while (pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++;
/*
* send out the buffer
*/
if (iPts == NUMPTSTOBUFFER) {
tmpPtBlock = (POINTBLOCK *)Xmalloc(sizeof(POINTBLOCK));
curPtBlock->next = tmpPtBlock;
curPtBlock = tmpPtBlock;
pts = curPtBlock->pts;
numFullPtBlocks++;
iPts = 0;
}
EVALUATEEDGEEVENODD(pAET, pPrevAET, y);
}
(void) InsertionSort(&AET);
}
}
else {
/*
* for each scanline
*/
for (y = ET.ymin; y < ET.ymax; y++) {
/*
* Add a new edge to the active edge table when we
* get to the next edge.
*/
if (pSLL != NULL && y == pSLL->scanline) {
loadAET(&AET, pSLL->edgelist);
computeWAET(&AET);
pSLL = pSLL->next;
}
pPrevAET = &AET;
pAET = AET.next;
pWETE = pAET;
/*
* for each active edge
*/
while (pAET) {
/*
* add to the buffer only those edges that
* are in the Winding active edge table.
*/
if (pWETE == pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++;
/*
* send out the buffer
*/
if (iPts == NUMPTSTOBUFFER) {
tmpPtBlock = (POINTBLOCK *)Xmalloc(sizeof(POINTBLOCK));
curPtBlock->next = tmpPtBlock;
curPtBlock = tmpPtBlock;
pts = curPtBlock->pts;
numFullPtBlocks++; iPts = 0;
}
pWETE = pWETE->nextWETE;
}
EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
}
/*
* recompute the winding active edge table if
* we just resorted or have exited an edge.
*/
if (InsertionSort(&AET) || fixWAET) {
computeWAET(&AET);
fixWAET = FALSE;
}
}
}
FreeStorage(SLLBlock.next);
(void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
tmpPtBlock = curPtBlock->next;
Xfree((char *)curPtBlock);
curPtBlock = tmpPtBlock;
}
Xfree((char *)pETEs);
return(region);
}
-1683
View File
File diff suppressed because it is too large Load Diff
+366 -252
View File
@@ -116,10 +116,6 @@ static Bool gdk_event_get_type (Display *display,
static void gdk_synthesize_click (GdkEvent *event,
gint nclicks);
#ifdef DEBUG_DND
static void gdk_print_atom (GdkAtom anatom);
#endif
#ifndef HAVE_XCONVERTCASE
static void gdkx_XConvertCase (KeySym symbol,
KeySym *lower,
@@ -156,12 +152,12 @@ static gint gdk_im_open (XrmDatabase db,
static void gdk_im_close (void);
static void gdk_ic_cleanup (void);
#endif /* USE_XIM */
GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev,
GdkEvent *event,
gpointer data);
#endif /* USE_XIM */
/* Private variable declarations
*/
static int gdk_initialized = 0; /* 1 if the library is initialized,
@@ -740,7 +736,195 @@ gdk_event_get_graphics_expose (GdkWindow *window)
gdk_event_free (event);
}
return NULL;
return NULL;
}
/************************
* Exposure compression *
************************/
/*
* The following implements simple exposure compression. It is
* modelled after the way Xt does exposure compression - in
* particular compress_expose = XtExposeCompressMultiple.
* It compress consecutive sequences of exposure events,
* but not sequences that cross other events. (This is because
* if it crosses a ConfigureNotify, we could screw up and
* mistakenly compress the exposures generated for the new
* size - could we just check for ConfigureNotify?)
*
* Xt compresses to a region / bounding rectangle, we compress
* to two rectangles, and try find the two rectangles of minimal
* area for this - this is supposed to handle the typical
* L-shaped regions generated by OpaqueMove.
*/
/* Given three rectangles, find the two rectangles that cover
* them with the smallest area.
*/
static void
gdk_add_rect_to_rects (GdkRectangle *rect1,
GdkRectangle *rect2,
GdkRectangle *new_rect)
{
GdkRectangle t1, t2, t3;
gint size1, size2, size3;
gdk_rectangle_union (rect1, rect2, &t1);
gdk_rectangle_union (rect1, new_rect, &t2);
gdk_rectangle_union (rect2, new_rect, &t3);
size1 = t1.width * t1.height + new_rect->width * new_rect->height;
size2 = t2.width * t2.height + rect2->width * rect2->height;
size3 = t1.width * t1.height + rect1->width * rect1->height;
if (size1 < size2)
{
if (size1 < size3)
{
*rect1 = t1;
*rect2 = *new_rect;
}
else
*rect2 = t3;
}
else
{
if (size2 < size3)
*rect1 = t2;
else
*rect2 = t3;
}
}
typedef struct _GdkExposeInfo GdkExposeInfo;
struct _GdkExposeInfo {
Window window;
gboolean seen_nonmatching;
};
Bool
expose_predicate (Display *display, XEvent *xevent, XPointer arg)
{
GdkExposeInfo *info = (GdkExposeInfo *)arg;
if (xevent->xany.type != Expose)
{
info->seen_nonmatching = TRUE;
}
if (info->seen_nonmatching || (xevent->xany.window != info->window))
return FALSE;
else
return TRUE;
}
void
gdk_compress_exposures (XEvent *xevent, GdkWindow *window)
{
gint nrects = 1;
gint count = 0;
GdkRectangle rect1;
GdkRectangle rect2;
GdkRectangle tmp_rect;
XEvent tmp_event;
GdkFilterReturn result;
GdkExposeInfo info;
GdkEvent event;
info.window = xevent->xany.window;
info.seen_nonmatching = FALSE;
rect1.x = xevent->xexpose.x;
rect1.y = xevent->xexpose.y;
rect1.width = xevent->xexpose.width;
rect1.height = xevent->xexpose.height;
while (1)
{
if (count == 0)
{
if (!XCheckIfEvent (gdk_display,
&tmp_event,
expose_predicate,
(XPointer)&info))
break;
}
else
XIfEvent (gdk_display,
&tmp_event,
expose_predicate,
(XPointer)&info);
/* We apply filters here, and if it was filtered, completely
* ignore the return
*/
result = gdk_event_apply_filters (xevent, &event,
window ?
((GdkWindowPrivate *)window)->filters
: gdk_default_filters);
if (result != GDK_FILTER_CONTINUE)
{
if (result == GDK_FILTER_TRANSLATE)
gdk_event_put (&event);
continue;
}
if (nrects == 1)
{
rect2.x = tmp_event.xexpose.x;
rect2.y = tmp_event.xexpose.y;
rect2.width = tmp_event.xexpose.width;
rect2.height = tmp_event.xexpose.height;
nrects++;
}
else
{
tmp_rect.x = tmp_event.xexpose.x;
tmp_rect.y = tmp_event.xexpose.y;
tmp_rect.width = tmp_event.xexpose.width;
tmp_rect.height = tmp_event.xexpose.height;
gdk_add_rect_to_rects (&rect1, &rect2, &tmp_rect);
}
count = tmp_event.xexpose.count;
}
if (nrects == 2)
{
gdk_rectangle_union (&rect1, &rect2, &tmp_rect);
if ((tmp_rect.width * tmp_rect.height) <
2 * (rect1.height * rect1.width +
rect2.height * rect2.width))
{
rect1 = tmp_rect;
nrects = 1;
}
}
if (nrects == 2)
{
event.expose.type = GDK_EXPOSE;
event.expose.window = window;
event.expose.area.x = rect2.x;
event.expose.area.y = rect2.y;
event.expose.area.width = rect2.width;
event.expose.area.height = rect2.height;
event.expose.count = 0;
gdk_event_put (&event);
}
xevent->xexpose.count = nrects - 1;
xevent->xexpose.x = rect1.x;
xevent->xexpose.y = rect1.y;
xevent->xexpose.width = rect1.width;
xevent->xexpose.height = rect1.height;
}
/*
@@ -834,6 +1018,7 @@ gdk_event_get (void)
#else
XNextEvent (gdk_display, &xevent);
#endif
event = gdk_event_new ();
event->any.type = GDK_NOTHING;
@@ -989,7 +1174,6 @@ gdk_event_free (GdkEvent *event)
gdk_drag_context_unref (event->dnd.context);
break;
default:
break;
}
@@ -1894,22 +2078,25 @@ gdk_event_translate (GdkEvent *event,
event->any.send_event = xevent->xany.send_event;
if (window_private && window_private->destroyed)
return FALSE;
/* Check for filters for this window */
{
if (xevent->type != DestroyNotify)
return FALSE;
}
else
{
/* Check for filters for this window */
{
GdkFilterReturn result;
result = gdk_event_apply_filters (xevent, event,
window_private
?window_private->filters
:gdk_default_filters);
if (result != GDK_FILTER_CONTINUE)
{
return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
}
}
GdkFilterReturn result;
result = gdk_event_apply_filters (xevent, event,
window_private
?window_private->filters
:gdk_default_filters);
if (result != GDK_FILTER_CONTINUE)
{
return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
}
}
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
@@ -1917,10 +2104,9 @@ gdk_event_translate (GdkEvent *event,
* optionally print debugging info regarding events
* received.
*/
/* Addendum:
* During drag & drop you get events where the pointer is
* in other windows. Need to just do finer-grained checking
*/
return_val = TRUE;
switch (xevent->type)
{
case KeyPress:
@@ -1998,16 +2184,18 @@ gdk_event_translate (GdkEvent *event,
event->key.string = g_strdup (buf);
event->key.length = charcount;
return_val = window_private && !window_private->destroyed;
if (!return_val)
g_free (event->key.string);
break;
case KeyRelease:
/* Lookup the string corresponding to the given keysym.
*/
#ifdef USE_XIM
if (buf_len == 0)
{
buf_len = 128;
buf = g_new (gchar, buf_len);
}
#endif
keysym = GDK_VoidSymbol;
charcount = XLookupString (&xevent->xkey, buf, 16,
&keysym, &compose);
@@ -2028,15 +2216,13 @@ gdk_event_translate (GdkEvent *event,
event->key.length = 0;
event->key.string = NULL;
return_val = window_private && !window_private->destroyed;
break;
case ButtonPress:
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("button press[%d]:\t\twindow: %ld x,y: %d %d button: %d",
window_private?window_private->dnd_drag_enabled:0,
g_message ("button press:\t\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window - base_id,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
@@ -2044,7 +2230,10 @@ gdk_event_translate (GdkEvent *event,
if (window_private &&
(window_private->extension_events != 0) &&
gdk_input_ignore_core)
break;
{
return_val = FALSE;
break;
}
event->button.type = GDK_BUTTON_PRESS;
event->button.window = window;
@@ -2097,15 +2286,13 @@ gdk_event_translate (GdkEvent *event,
button_number[0] = event->button.button;
}
return_val = window_private && !window_private->destroyed;
break;
case ButtonRelease:
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("button release[%d]:\twindow: %ld x,y: %d %d button: %d",
window_private?window_private->dnd_drag_enabled:0,
g_message ("button release:\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window - base_id,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
@@ -2113,7 +2300,10 @@ gdk_event_translate (GdkEvent *event,
if (window_private &&
(window_private->extension_events != 0) &&
gdk_input_ignore_core)
break;
{
return_val = FALSE;
break;
}
event->button.type = GDK_BUTTON_RELEASE;
event->button.window = window;
@@ -2130,8 +2320,6 @@ gdk_event_translate (GdkEvent *event,
event->button.source = GDK_SOURCE_MOUSE;
event->button.deviceid = GDK_CORE_POINTER;
return_val = window_private && !window_private->destroyed;
break;
case MotionNotify:
@@ -2146,7 +2334,10 @@ gdk_event_translate (GdkEvent *event,
if (window_private &&
(window_private->extension_events != 0) &&
gdk_input_ignore_core)
break;
{
return_val = FALSE;
break;
}
event->motion.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
@@ -2163,7 +2354,6 @@ gdk_event_translate (GdkEvent *event,
event->motion.source = GDK_SOURCE_MOUSE;
event->motion.deviceid = GDK_CORE_POINTER;
return_val = window_private && !window_private->destroyed;
break;
case EnterNotify:
@@ -2177,6 +2367,7 @@ gdk_event_translate (GdkEvent *event,
/* Tell XInput stuff about it if appropriate */
if (window_private &&
!window_private->destroyed &&
(window_private->extension_events != 0) &&
gdk_input_vtable.enter_event)
gdk_input_vtable.enter_event (&xevent->xcrossing, window);
@@ -2240,7 +2431,6 @@ gdk_event_translate (GdkEvent *event,
event->crossing.focus = xevent->xcrossing.focus;
event->crossing.state = xevent->xcrossing.state;
return_val = window_private && !window_private->destroyed;
break;
case LeaveNotify:
@@ -2310,7 +2500,6 @@ gdk_event_translate (GdkEvent *event,
event->crossing.focus = xevent->xcrossing.focus;
event->crossing.state = xevent->xcrossing.state;
return_val = window_private && !window_private->destroyed;
break;
case FocusIn:
@@ -2333,11 +2522,10 @@ gdk_event_translate (GdkEvent *event,
event->focus_change.type = GDK_FOCUS_CHANGE;
event->focus_change.window = window;
event->focus_change.in = (xevent->xany.type == FocusIn);
return_val = window_private && !window_private->destroyed;
break;
default:
;
return_val = FALSE;
}
break;
@@ -2346,8 +2534,9 @@ gdk_event_translate (GdkEvent *event,
*/
GDK_NOTE (EVENTS,
g_message ("keymap notify"));
/* Not currently handled */
return_val = FALSE;
break;
case Expose:
@@ -2358,6 +2547,7 @@ gdk_event_translate (GdkEvent *event,
xevent->xexpose.window - base_id, xevent->xexpose.count,
xevent->xexpose.x, xevent->xexpose.y,
xevent->xexpose.width, xevent->xexpose.height));
gdk_compress_exposures (xevent, window);
event->expose.type = GDK_EXPOSE;
event->expose.window = window;
@@ -2367,7 +2557,6 @@ gdk_event_translate (GdkEvent *event,
event->expose.area.height = xevent->xexpose.height;
event->expose.count = xevent->xexpose.count;
return_val = window_private && !window_private->destroyed;
break;
case GraphicsExpose:
@@ -2385,7 +2574,6 @@ gdk_event_translate (GdkEvent *event,
event->expose.area.height = xevent->xgraphicsexpose.height;
event->expose.count = xevent->xexpose.count;
return_val = window_private && !window_private->destroyed;
break;
case NoExpose:
@@ -2398,7 +2586,6 @@ gdk_event_translate (GdkEvent *event,
event->no_expose.type = GDK_NO_EXPOSE;
event->no_expose.window = window;
return_val = window_private && !window_private->destroyed;
break;
case VisibilityNotify:
@@ -2441,7 +2628,6 @@ gdk_event_translate (GdkEvent *event,
break;
}
return_val = window_private && !window_private->destroyed;
break;
case CreateNotify:
@@ -2477,7 +2663,6 @@ gdk_event_translate (GdkEvent *event,
if (xgrab_window == window_private)
xgrab_window = NULL;
return_val = window_private && !window_private->destroyed;
break;
case MapNotify:
@@ -2490,7 +2675,6 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_MAP;
event->any.window = window;
return_val = window_private && !window_private->destroyed;
break;
case ReparentNotify:
@@ -2499,8 +2683,9 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS,
g_message ("reparent notify:\twindow: %ld",
xevent->xreparent.window - base_id));
/* Not currently handled */
return_val = FALSE;
break;
case ConfigureNotify:
@@ -2545,52 +2730,50 @@ gdk_event_translate (GdkEvent *event,
xevent->xconfigure.above - base_id,
xevent->xconfigure.override_redirect));
if (window_private)
if (!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)
return_val = FALSE;
else
{
if ((window_private->extension_events != 0) &&
gdk_input_vtable.configure_event)
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
event->configure.width = xevent->xconfigure.width;
event->configure.height = xevent->xconfigure.height;
if (window_private->window_type != GDK_WINDOW_CHILD)
if (!xevent->xconfigure.x &&
!xevent->xconfigure.y &&
!window_private->destroyed)
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
event->configure.width = xevent->xconfigure.width;
event->configure.height = xevent->xconfigure.height;
gint tx = 0;
gint ty = 0;
Window child_window = 0;
if (!xevent->xconfigure.x &&
!xevent->xconfigure.y &&
!window_private->destroyed)
{
gint tx = 0;
gint ty = 0;
Window child_window = 0;
if (!XTranslateCoordinates (window_private->xdisplay,
window_private->xwindow,
gdk_root_window,
0, 0,
&tx, &ty,
&child_window))
g_warning ("GdkWindow %ld doesn't share root windows display?",
window_private->xwindow - base_id);
event->configure.x = tx;
event->configure.y = ty;
}
else
{
event->configure.x = xevent->xconfigure.x;
event->configure.y = xevent->xconfigure.y;
}
window_private->x = event->configure.x;
window_private->y = event->configure.y;
window_private->width = xevent->xconfigure.width;
window_private->height = xevent->xconfigure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
return_val = !window_private->destroyed;
if (!XTranslateCoordinates (window_private->xdisplay,
window_private->xwindow,
gdk_root_window,
0, 0,
&tx, &ty,
&child_window))
g_warning ("GdkWindow %ld doesn't share root windows display?",
window_private->xwindow - base_id);
event->configure.x = tx;
event->configure.y = ty;
}
else
{
event->configure.x = xevent->xconfigure.x;
event->configure.y = xevent->xconfigure.y;
}
window_private->x = event->configure.x;
window_private->y = event->configure.y;
window_private->width = xevent->xconfigure.width;
window_private->height = xevent->xconfigure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
}
break;
@@ -2607,7 +2790,6 @@ gdk_event_translate (GdkEvent *event,
event->property.time = xevent->xproperty.time;
event->property.state = xevent->xproperty.state;
return_val = window_private && !window_private->destroyed;
break;
case SelectionClear:
@@ -2620,7 +2802,6 @@ gdk_event_translate (GdkEvent *event,
event->selection.selection = xevent->xselectionclear.selection;
event->selection.time = xevent->xselectionclear.time;
return_val = window_private && !window_private->destroyed;
break;
case SelectionRequest:
@@ -2636,7 +2817,6 @@ gdk_event_translate (GdkEvent *event,
event->selection.requestor = xevent->xselectionrequest.requestor;
event->selection.time = xevent->xselectionrequest.time;
return_val = window_private && !window_private->destroyed;
break;
case SelectionNotify:
@@ -2652,7 +2832,6 @@ gdk_event_translate (GdkEvent *event,
event->selection.property = xevent->xselection.property;
event->selection.time = xevent->xselection.time;
return_val = window_private && !window_private->destroyed;
break;
case ColormapNotify:
@@ -2663,6 +2842,7 @@ gdk_event_translate (GdkEvent *event,
xevent->xcolormap.window - base_id));
/* Not currently handled */
return_val = FALSE;
break;
case ClientMessage:
@@ -2705,13 +2885,9 @@ gdk_event_translate (GdkEvent *event,
event->client.data_format = xevent->xclient.format;
memcpy(&event->client.data, &xevent->xclient.data,
sizeof(event->client.data));
return_val = (window != NULL);
}
}
if(window_private)
return_val = return_val && !window_private->destroyed;
break;
case MappingNotify:
@@ -2723,20 +2899,20 @@ gdk_event_translate (GdkEvent *event,
/* Let XLib know that there is a new keyboard mapping.
*/
XRefreshKeyboardMapping (&xevent->xmapping);
return_val = FALSE;
break;
default:
/* something else - (e.g., a Xinput event) */
if (window_private &&
!window_private->destroyed &&
(window_private->extension_events != 0) &&
gdk_input_vtable.other_event)
return_val = gdk_input_vtable.other_event(event, xevent, window);
else
return_val = FALSE;
return_val = return_val && !window_private->destroyed;
break;
}
@@ -3655,145 +3831,95 @@ _g_mbtowc (wchar_t *wstr, const char *str, size_t len)
#endif /* X_LOCALE */
/*
* used for debugging only
*/
#ifdef DEBUG_DND
static void
gdk_print_atom (GdkAtom anatom)
/* Sends a ClientMessage to all toplevel client windows */
gboolean
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
{
gchar *tmpstr = NULL;
tmpstr = (anatom!=None)?gdk_atom_name(anatom):"(none)";
g_message("Atom %lu has name %s", anatom, tmpstr);
if(tmpstr)
g_free(tmpstr);
}
#endif
#ifdef WE_HAVE_MOTIF_DROPS_DONE
static GdkWindow *
gdk_drop_get_real_window (GdkWindow *w,
guint16 *x,
guint16 *y)
{
GdkWindow *retval = w;
GdkWindowPrivate *awin;
GList *children;
gint16 myx = *x, myy = *y;
XEvent sev;
g_return_val_if_fail (w != NULL && x != NULL && y != NULL, NULL);
g_return_val_if_fail(event != NULL, FALSE);
myx = *x;
myy = *y;
/* Set up our event to send, with the exception of its target window */
sev.xclient.type = ClientMessage;
sev.xclient.display = gdk_display;
sev.xclient.format = event->client.data_format;
sev.xclient.window = xid;
memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
sev.xclient.message_type = event->client.message_type;
descend:
for (children = gdk_window_get_children(retval);
children && children->next;
children = children->next)
{
awin = (GdkWindowPrivate *) children->data;
if ((myx >= awin->x) && (myy >= awin->y)
&& (myx < (awin->x + awin->width))
&& (myy < (awin->y + awin->height)))
{
retval = (GdkWindow *) awin;
myx -= awin->x;
myy -= awin->y;
goto descend;
}
}
*x = myx;
*y = myy;
return retval;
}
#endif
/*
* used only by below routine and itself
*/
static Window
getchildren (Display *dpy,
Window win,
Atom wm_state_atom)
{
Window root, parent, *children, inf = 0;
Atom type = None;
unsigned int nchildren, i;
int format;
unsigned long nitems, after;
unsigned char *data;
if (XQueryTree(dpy, win, &root, &parent, &children, &nchildren) == 0)
return 0;
for (i = 0; !inf && (i < nchildren); i++)
{
XGetWindowProperty (dpy, children[i], wm_state_atom, 0, 0, False,
AnyPropertyType, &type, &format, &nitems,
&after, &data);
if (type != 0)
inf = children[i];
XFree(data);
}
for (i = 0; !inf && (i < nchildren); i++)
inf = getchildren (dpy, children[i], wm_state_atom);
if (children != None)
XFree ((char *) children);
return inf;
}
/*
* find a window with WM_STATE, else return win itself, as per ICCCM
*
* modification of the XmuClientWindow() routine from X11R6.3
*/
Window
gdk_get_client_window (Display *dpy,
Window win)
{
static Atom wm_state_atom = None;
Atom type = None;
int format;
unsigned long nitems, after;
unsigned char *data;
Window inf;
if (win == 0)
return DefaultRootWindow(dpy);
if ((wm_state_atom = XInternAtom (dpy, "WM_STATE", True)) == 0)
return win;
XGetWindowProperty (dpy, win, wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (type)
{
XFree (data);
return win;
}
inf = getchildren (dpy, win, wm_state_atom);
if (inf == 0)
return win;
else
return inf;
return gdk_send_xevent (xid, False, NoEventMask, &sev);
}
/* Sends a ClientMessage to all toplevel client windows */
gboolean
gdk_event_send_client_message_to_all_recurse (XEvent *xev,
guint32 xid,
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;
gboolean send = FALSE;
gboolean found = FALSE;
if (!wm_state_atom)
wm_state_atom = gdk_atom_intern ("WM_STATE", 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;
return FALSE;
}
if (type)
{
send = TRUE;
XFree (data);
}
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;
for(i = 0; i < ret_nchildren; i++)
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
found = TRUE;
XFree(ret_children);
}
if (send || (!found && (level == 1)))
{
xev->xclient.window = xid;
gdk_send_xevent (xid, False, NoEventMask, xev);
}
return (send || found);
}
void
gdk_event_send_clientmessage_toall (GdkEvent *event)
{
XEvent sev;
Window *ret_children, ret_root, ret_parent, curwin;
unsigned int ret_nchildren;
int i;
gint old_warnings = gdk_error_warnings;
g_return_if_fail(event != NULL);
/* Set up our event to send, with the exception of its target window */
@@ -3802,22 +3928,10 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
sev.xclient.format = event->client.data_format;
memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
sev.xclient.message_type = event->client.message_type;
/* OK, we're all set, now let's find some windows to send this to */
if(XQueryTree(gdk_display, gdk_root_window, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True)
return;
/* foreach true child window of the root window, send an event to it */
for(i = 0; i < ret_nchildren; i++) {
curwin = gdk_get_client_window(gdk_display, ret_children[i]);
sev.xclient.window = curwin;
if (!gdk_send_xevent (curwin, False, NoEventMask, &sev))
GDK_NOTE (MISC, g_message ("Sending client message %ld to %#lx failed",
event->client.message_type, curwin));
}
XFree(ret_children);
gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, 0);
gdk_error_warnings = old_warnings;
}
gchar *
+22 -5
View File
@@ -196,6 +196,23 @@ void gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *shape_mask,
gint offset_x,
gint offset_y);
/*
* This routine allows you to quickly take the shapes of all the child windows
* of a window and use their shapes as the shape mask for this window - useful
* for container windows that dont want to look like a big box
*
* - Raster
*/
void gdk_window_set_child_shapes (GdkWindow *window);
/*
* This routine allows you to merge (ie ADD) child shapes to your
* own window's shape keeping its current shape and ADDING the shild
* shapes to it.
*
* - Raster
*/
void gdk_window_merge_child_shapes (GdkWindow *window);
/*
* The following function adds a global filter for all client
@@ -726,6 +743,9 @@ void gdk_property_delete (GdkWindow *window,
gint gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
void gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest);
/* XInput support
*/
@@ -849,9 +869,6 @@ void gdk_region_destroy (GdkRegion *region);
void gdk_region_get_clipbox(GdkRegion *region,
GdkRectangle *rectangle);
GdkRectangle* gdk_region_get_rectangles(GdkRegion *region,
gint *nrects);
gboolean gdk_region_empty (GdkRegion *region);
gboolean gdk_region_equal (GdkRegion *region1,
GdkRegion *region2);
@@ -897,6 +914,8 @@ void gdk_threads_wake (void);
/* Miscellaneous */
void gdk_event_send_clientmessage_toall (GdkEvent *event);
gboolean gdk_event_send_client_message (GdkEvent *event,
guint32 xid);
/* Key values
*/
@@ -907,9 +926,7 @@ guint gdk_keyval_to_lower (guint keyval);
gboolean gdk_keyval_is_upper (guint keyval);
gboolean gdk_keyval_is_lower (guint keyval);
gint gdk_drawable_register (GdkDrawableClass* draw_class);
#include <gdk/gdkps.h>
#include <gdk/gdkrgb.h>
#ifdef __cplusplus
-18
View File
@@ -1,21 +1,3 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
GDK_NUM_GLYPHS = 154,
GDK_X_CURSOR = 0,
GDK_ARROW = 2,
+68 -21
View File
@@ -377,15 +377,17 @@ gdk_window_cache_destroy (GdkWindowCache *cache)
static Window
get_client_window_at_coords_recurse (Window win,
gint x_root,
gint y_root)
gint x,
gint y)
{
Window child;
Window root, tmp_parent, *children;
unsigned int nchildren;
int i;
Window child = None;
Atom type = None;
int format;
unsigned long nitems, after;
unsigned char *data;
int dest_x, dest_y;
static Atom wm_state_atom = None;
@@ -408,6 +410,8 @@ get_client_window_at_coords_recurse (Window win,
return win;
}
#if 0
/* This is beautiful! Damn Enlightenment and click-to-focus */
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
@@ -416,18 +420,49 @@ get_client_window_at_coords_recurse (Window win,
gdk_error_code = 0;
return None;
}
#else
if (XQueryTree(gdk_display, win,
&root, &tmp_parent, &children, &nchildren) == 0)
return 0;
if (gdk_error_code == 0)
{
for (i = nchildren - 1; (i >= 0) && (child == None); i--)
{
XWindowAttributes xwa;
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
(x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
(y >= xwa.y) && (y < xwa.y + (gint)xwa.height))
{
x -= xwa.x;
y -= xwa.y;
child = children[i];
}
}
XFree (children);
}
else
gdk_error_code = 0;
#endif
if (child)
return get_client_window_at_coords_recurse (child, x_root, y_root);
return get_client_window_at_coords_recurse (child, x, y);
else
return None;
}
Window
get_client_window_at_coords (GdkWindowCache *cache,
Window ignore,
gint x_root,
gint y_root)
Window ignore,
gint x_root,
gint y_root)
{
GList *tmp_list;
Window retval = None;
@@ -449,7 +484,8 @@ get_client_window_at_coords (GdkWindowCache *cache,
(y_root >= child->y) && (y_root < child->y + child->height))
{
retval = get_client_window_at_coords_recurse (child->xid,
x_root, y_root);
x_root - child->x,
y_root - child->y);
if (!retval)
retval = child->xid;
}
@@ -532,7 +568,7 @@ get_client_window_at_coords (Window ignore,
if (XQueryTree(gdk_display, gdk_root_window,
&root, &parent, &children, &nchildren) == 0)
return 0;
for (i = nchildren - 1; (i >= 0) && (retval == None); i--)
{
if (children[i] != ignore)
@@ -883,7 +919,12 @@ motif_read_target_table (void)
goto error;
n_targets = card16_to_host (*(gushort *)p, header->byte_order);
targets = (guint32 *)(p + sizeof(guint16));
/* We need to make a copy of the targets, since it may
* be unaligned
*/
targets = g_new (guint32, n_targets);
memcpy (targets, p + sizeof(guint16), sizeof(guint32) * n_targets);
p += sizeof(guint16) + n_targets * sizeof(guint32);
if (p - target_bytes > nitems)
@@ -894,7 +935,7 @@ motif_read_target_table (void)
g_list_prepend (motif_target_lists[i],
GUINT_TO_POINTER (card32_to_host (targets[j],
header->byte_order)));
g_free (targets);
motif_target_lists[i] = g_list_reverse (motif_target_lists[i]);
}
@@ -1001,7 +1042,6 @@ motif_add_to_target_table (GList *targets)
guchar *data;
guchar *p;
guint16 *p16;
guint32 *p32;
MotifTargetTableHeader *header;
if (!motif_target_lists)
@@ -1035,20 +1075,27 @@ motif_add_to_target_table (GList *targets)
for (i = 0; i < motif_n_target_lists ; i++)
{
guint16 count = 0;
guint16 n_targets = g_list_length (motif_target_lists[i]);
guint32 *targets = g_new (guint32, n_targets);
guint32 *p32 = targets;
p16 = (guint16 *)p;
p += sizeof(guint16);
p32 = (guint32 *)p;
tmp_list = motif_target_lists[i];
while (tmp_list)
{
*p32++ = GPOINTER_TO_UINT (tmp_list->data);
*p32 = GPOINTER_TO_UINT (tmp_list->data);
tmp_list = tmp_list->next;
count++;
p32++;
}
*p16 = count;
p = (guchar *)p32;
p16 = (guint16 *)p;
p += sizeof(guint16);
memcpy (p, targets, n_targets * sizeof(guint32));
*p16 = n_targets;
p += sizeof(guint32) * n_targets;
g_free (targets);
}
XChangeProperty (gdk_display, motif_drag_window,
-53
View File
@@ -37,11 +37,6 @@ gdk_draw_point (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_point(drawable, gc, x, y);
return;
}
gc_private = (GdkGCPrivate*) gc;
XDrawPoint (drawable_private->xdisplay, drawable_private->xwindow,
@@ -65,10 +60,6 @@ gdk_draw_line (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_line(drawable, gc, x1, y1, x2, y2);
return;
}
gc_private = (GdkGCPrivate*) gc;
XDrawLine (drawable_private->xdisplay, drawable_private->xwindow,
@@ -100,10 +91,6 @@ gdk_draw_rectangle (GdkDrawable *drawable,
if (height == -1)
height = drawable_private->height;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_rectangle(drawable, gc, filled, x, y, width, height);
return;
}
if (filled)
XFillRectangle (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, width, height);
@@ -139,10 +126,6 @@ gdk_draw_arc (GdkDrawable *drawable,
if (height == -1)
height = drawable_private->height;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_arc(drawable, gc, filled, x, y, width, height, angle1, angle2);
return;
}
if (filled)
XFillArc (drawable_private->xdisplay, drawable_private->xwindow,
gc_private->xgc, x, y, width, height, angle1, angle2);
@@ -170,10 +153,6 @@ gdk_draw_polygon (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_polygon(drawable, gc, filled, points, npoints);
return;
}
gc_private = (GdkGCPrivate*) gc;
if (filled)
@@ -230,10 +209,6 @@ gdk_draw_string (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_text(drawable, font, gc, x, y, string, strlen(string));
return;
}
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@@ -290,10 +265,6 @@ gdk_draw_text (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_text(drawable, font, gc, x, y, text, text_length);
return;
}
gc_private = (GdkGCPrivate*) gc;
font_private = (GdkFontPrivate*) font;
@@ -352,10 +323,6 @@ gdk_draw_pixmap (GdkDrawable *drawable,
if (height == -1)
height = src_private->height;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_pixmap(drawable, gc, src, xsrc, ysrc, xdest, ydest, width, height);
return;
}
XCopyArea (drawable_private->xdisplay,
src_private->xwindow,
drawable_private->xwindow,
@@ -377,14 +344,12 @@ gdk_draw_image (GdkDrawable *drawable,
gint height)
{
GdkImagePrivate *image_private;
GdkWindowPrivate *drawable_private;
g_return_if_fail (drawable != NULL);
g_return_if_fail (image != NULL);
g_return_if_fail (gc != NULL);
image_private = (GdkImagePrivate*) image;
drawable_private = (GdkWindowPrivate*) drawable;
g_return_if_fail (image_private->image_put != NULL);
@@ -393,10 +358,6 @@ gdk_draw_image (GdkDrawable *drawable,
if (height == -1)
height = image->height;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_image(drawable, gc, image, xsrc, ysrc, xdest, ydest, width, height);
return;
}
(* image_private->image_put) (drawable, gc, image, xsrc, ysrc,
xdest, ydest, width, height);
}
@@ -417,10 +378,6 @@ gdk_draw_points (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_points(drawable, gc, points, npoints);
return;
}
gc_private = (GdkGCPrivate*) gc;
XDrawPoints (drawable_private->xdisplay,
@@ -450,10 +407,6 @@ gdk_draw_segments (GdkDrawable *drawable,
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_segments(drawable, gc, segs, nsegs);
return;
}
gc_private = (GdkGCPrivate*) gc;
XDrawSegments (drawable_private->xdisplay,
@@ -480,12 +433,6 @@ gdk_draw_lines (GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
drawable_private = (GdkWindowPrivate*) drawable;
if (drawable_private->destroyed)
return;
if (drawable_private->window_type == GDK_WINDOW_DRAWABLE) {
drawable_private->engine->draw_lines(drawable, gc, points, npoints);
return;
}
gc_private = (GdkGCPrivate*) gc;
XDrawLines (drawable_private->xdisplay,
-40
View File
@@ -1,40 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "../config.h"
#include "gdktypes.h"
static GList* engines = NULL;
gint
gdk_drawable_register(GdkDrawableClass* d_engine)
{
gint type = 0;
g_return_val_if_fail(d_engine != NULL, 0);
if ( d_engine->type )
return d_engine->type;
type = g_list_length(engines)+1;
d_engine->type = type;
engines = g_list_append(engines, d_engine);
return type;
}
-18
View File
@@ -26,7 +26,6 @@ gdk_font_load (const gchar *font_name)
{
GdkFont *font;
GdkFontPrivate *private;
static Atom font_atom = None;
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
@@ -34,7 +33,6 @@ gdk_font_load (const gchar *font_name)
private->xdisplay = gdk_display;
private->xfont = XLoadQueryFont (private->xdisplay, font_name);
private->ref_count = 1;
font->name = NULL;
if (!private->xfont)
{
@@ -43,23 +41,9 @@ gdk_font_load (const gchar *font_name)
}
else
{
gchar* xfd = NULL;
unsigned long value;
font->type = GDK_FONT_FONT;
font->ascent = ((XFontStruct *) private->xfont)->ascent;
font->descent = ((XFontStruct *) private->xfont)->descent;
if ( font_atom != None )
font_atom = XInternAtom(private->xdisplay, "FONT", True);
if ( font_atom != None ) {
if (XGetFontProperty(private->xfont, font_atom, &value))
xfd = XGetAtomName(private->xdisplay, value);
if (xfd) {
font->name = g_strdup(xfd);
XFree(xfd);
}
}
if ( font->name == NULL )
font->name = g_strdup(font_name);
}
gdk_xid_table_insert (&((XFontStruct *) private->xfont)->fid, font);
@@ -119,7 +103,6 @@ gdk_fontset_load (gchar *fontset_name)
font->ascent = MAX (font->ascent, font_structs[i]->ascent);
font->descent = MAX (font->descent, font_structs[i]->descent);
}
font->name = g_strdup(fontset_name);
}
return font;
}
@@ -161,7 +144,6 @@ gdk_font_unref (GdkFont *font)
g_error ("unknown font type.");
break;
}
g_free(font->name);
g_free (font);
}
}
+9 -74
View File
@@ -21,21 +21,6 @@
#include "gdk.h"
#include "gdkprivate.h"
static void
gc_set_dashes(GdkGCPrivate* gc, gint offset, gchar* dashes, gint n)
{
if ( gc->dash_list)
g_free(gc->dash_list);
if ( n ) {
gc->dash_num = n;
gc->dash_offset = offset;
gc->dash_list = g_new(gchar, n);
memcpy(gc->dash_list, dashes, n);
} else {
gc->dash_list = NULL;
gc->dash_num = gc->dash_offset = 0;
}
}
GdkGC*
gdk_gc_new (GdkWindow *window)
@@ -67,10 +52,6 @@ gdk_gc_new_with_values (GdkWindow *window,
xwindow = window_private->xwindow;
private->xdisplay = window_private->xdisplay;
private->ref_count = 1;
private->nrects = 0;
private->rects = NULL;
private->dash_list = NULL;
private->dash_num = private->dash_offset = 0;
xvalues.function = GXcopy;
xvalues.fill_style = FillSolid;
@@ -83,16 +64,12 @@ gdk_gc_new_with_values (GdkWindow *window,
{
xvalues.foreground = values->foreground.pixel;
xvalues_mask |= GCForeground;
private->fg = values->foreground;
} else
private->fg.pixel = 0; /* FIXME */
}
if (values_mask & GDK_GC_BACKGROUND)
{
xvalues.background = values->background.pixel;
xvalues_mask |= GCBackground;
private->bg = values->background;
} else
private->bg.pixel = 0; /* FIXME */
}
if ((values_mask & GDK_GC_FONT) && (values->font->type == GDK_FONT_FONT))
{
xvalues.font = ((XFontStruct *) ((GdkFontPrivate*) values->font)->xfont)->fid;
@@ -183,7 +160,6 @@ gdk_gc_new_with_values (GdkWindow *window,
{
xvalues.clip_mask = ((GdkPixmapPrivate*) values->clip_mask)->xwindow;
xvalues_mask |= GCClipMask;
/* FIXME: set clip rects... */
}
if (values_mask & GDK_GC_SUBWINDOW)
{
@@ -228,15 +204,12 @@ gdk_gc_new_with_values (GdkWindow *window,
{
case GDK_LINE_SOLID:
xvalues.line_style = LineSolid;
gc_set_dashes(private, 0, NULL, 0);
break;
case GDK_LINE_ON_OFF_DASH:
xvalues.line_style = LineOnOffDash;
gc_set_dashes(private, 0, "\1\1", 2);
break;
case GDK_LINE_DOUBLE_DASH:
xvalues.line_style = LineDoubleDash;
gc_set_dashes(private, 0, "\2\1", 2); /* FIXME: is this right? */
break;
}
xvalues_mask |= GCLineStyle;
@@ -311,8 +284,6 @@ gdk_gc_unref (GdkGC *gc)
else
{
XFreeGC (private->xdisplay, private->xgc);
g_free(private->rects);
g_free(private->dash_list);
memset (gc, 0, sizeof (GdkGCPrivate));
g_free (gc);
}
@@ -339,8 +310,8 @@ gdk_gc_get_values (GdkGC *gc,
GCLineWidth | GCLineStyle | GCCapStyle |
GCFillStyle | GCJoinStyle, &xvalues))
{
values->foreground = private->fg;
values->background = private->bg;
values->foreground.pixel = xvalues.foreground;
values->background.pixel = xvalues.background;
values->font = gdk_font_lookup (xvalues.font);
switch (xvalues.function)
@@ -478,7 +449,6 @@ gdk_gc_set_foreground (GdkGC *gc,
private = (GdkGCPrivate*) gc;
XSetForeground (private->xdisplay, private->xgc, color->pixel);
private->fg = *color;
}
void
@@ -492,7 +462,6 @@ gdk_gc_set_background (GdkGC *gc,
private = (GdkGCPrivate*) gc;
XSetBackground (private->xdisplay, private->xgc, color->pixel);
private->bg = *color;
}
void
@@ -698,10 +667,6 @@ gdk_gc_set_clip_mask (GdkGC *gc,
private = (GdkGCPrivate*) gc;
XSetClipMask (private->xdisplay, private->xgc, xmask);
/* FIXME: set clip rects... */
g_free(private->rects);
private->rects = NULL;
private->nrects = 0;
}
@@ -711,25 +676,17 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
{
GdkGCPrivate *private;
XRectangle xrectangle;
g_return_if_fail (gc != NULL);
private = (GdkGCPrivate*) gc;
g_free(private->rects);
private->rects = NULL;
private->nrects = 0;
if (rectangle)
{
xrectangle.x = rectangle->x;
xrectangle.y = rectangle->y;
xrectangle.width = rectangle->width;
xrectangle.height = rectangle->height;
private->nrects = 1;
private->rects = g_new(GdkRectangle, 1);
private->rects[0] = *rectangle;
XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
&xrectangle, 1, Unsorted);
@@ -748,17 +705,12 @@ gdk_gc_set_clip_region (GdkGC *gc,
private = (GdkGCPrivate*) gc;
g_free(private->rects);
private->rects = NULL;
private->nrects = 0;
if (region)
{
private->rects = gdk_region_get_rectangles(region, &private->nrects);
/* FIXME: handle GdkRectangle ~= Rectangle? */
if ( private->rects )
XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
private->rects, private->nrects, YXBanded);
GdkRegionPrivate *region_private;
region_private = (GdkRegionPrivate*) region;
XSetRegion (private->xdisplay, private->xgc, region_private->xregion);
}
else
XSetClipMask (private->xdisplay, private->xgc, None);
@@ -810,15 +762,12 @@ gdk_gc_set_line_attributes (GdkGC *gc,
{
case GDK_LINE_SOLID:
xline_style = LineSolid;
gc_set_dashes(private, 0, NULL, 0);
break;
case GDK_LINE_ON_OFF_DASH:
xline_style = LineOnOffDash;
gc_set_dashes(private, 0, "\1\1", 2);
break;
case GDK_LINE_DOUBLE_DASH:
xline_style = LineDoubleDash;
gc_set_dashes(private, 0, "\2\1", 2);
break;
default:
xline_style = None;
@@ -875,8 +824,6 @@ gdk_gc_set_dashes (GdkGC *gc,
private = (GdkGCPrivate*) gc;
XSetDashes (private->xdisplay, private->xgc, dash_offset, dash_list, n);
gc_set_dashes(private, dash_offset, dash_list, n);
}
void
@@ -889,16 +836,4 @@ gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
XCopyGC (src_private->xdisplay, src_private->xgc, ~((~1) << GCLastBit),
dst_private->xgc);
g_free(dst_private->rects);
dst_private->nrects = src_private->nrects;
if ( dst_private->nrects ) {
dst_private->rects = g_new(GdkRectangle, dst_private->nrects);
memcpy(dst_private->rects, src_private->rects, sizeof(GdkRectangle)*dst_private->nrects);
} else
dst_private->rects = NULL;
dst_private->fg = src_private->fg;
dst_private->bg = src_private->bg;
gc_set_dashes(dst_private, src_private->dash_offset, src_private->dash_list, src_private->dash_num);
}
+3 -3
View File
@@ -146,11 +146,11 @@ extern int _g_mbtowc (wchar_t *wstr, const char *str, size_t len);
#endif /* X_LOCALE */
#if !defined(HAVE_BROKEN_WCTYPE) && (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H)) && !defined(X_LOCALE)
# ifdef HAVE_WCTYPE_H
#if !defined(G_HAVE_BROKEN_WCTYPE) && (defined(G_HAVE_WCTYPE_H) || defined(G_HAVE_WCHAR_H)) && !defined(X_LOCALE)
# ifdef G_HAVE_WCTYPE_H
# include <wctype.h>
# else
# ifdef HAVE_WCHAR_H
# ifdef G_HAVE_WCHAR_H
# include <wchar.h>
# endif
# endif
+2 -1
View File
@@ -353,7 +353,8 @@ gdk_image_get (GdkWindow *window,
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
image->bpp = 1;
image->bpp = private->ximage->bits_per_pixel;
image->byte_order = private->ximage->byte_order;
return image;
}
+1 -1
View File
@@ -173,7 +173,7 @@ gdk_input_xfree_configure_event (XConfigureEvent *xevent, GdkWindow *window)
static void
gdk_input_xfree_enter_event (XCrossingEvent *xevent,
GdkWindow *window)
GdkWindow *window)
{
GdkInputWindow *input_window;
gint root_x, root_y;
-52
View File
@@ -24,8 +24,6 @@
#include <X11/Xutil.h>
#include <gdk/gdktypes.h>
#define DND_PROTOCOL_VERSION 0
#define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
#define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
@@ -49,7 +47,6 @@ typedef struct _GdkEventFilter GdkEventFilter;
typedef struct _GdkClientFilter GdkClientFilter;
typedef struct _GdkColorContextPrivate GdkColorContextPrivate;
typedef struct _GdkRegionPrivate GdkRegionPrivate;
typedef struct _GdkPsDrawable GdkPsDrawable;
struct _GdkWindowPrivate
@@ -66,27 +63,12 @@ struct _GdkWindowPrivate
guint8 window_type;
guint ref_count;
guint destroyed : 2;
guint dnd_drag_enabled : 1,
dnd_drag_datashow : 1,
dnd_drag_destructive_op : 1,
dnd_drag_accepted : 1,
dnd_drop_enabled : 1,
dnd_drop_destructive_op : 1;
GdkAtom dnd_drag_data_type, *dnd_drag_data_typesavail;
guint dnd_drag_data_numtypesavail;
/* We have to turn on MotionMask/EnterWindowMask/LeaveWindowMask
during drags, then set it back to what it was after */
glong dnd_drag_savedeventmask, dnd_drag_eventmask;
GdkAtom *dnd_drop_data_typesavail;
guint dnd_drop_data_numtypesavail;
/* need to allow custom drag/drop cursors */
gint extension_events;
GList *filters;
GdkColormap *colormap;
GList *children;
GdkDrawableClass *engine;
};
struct _GdkImagePrivate
@@ -113,13 +95,6 @@ struct _GdkGCPrivate
GC xgc;
Display *xdisplay;
guint ref_count;
guint nrects;
GdkRectangle* rects;
GdkColor fg;
GdkColor bg;
gint dash_offset;
gint dash_num;
gchar *dash_list;
};
typedef enum {
@@ -234,33 +209,6 @@ struct _GdkRegionPrivate
Region xregion;
};
struct _GdkPsDrawable {
gint page;
gint fd;
gint width;
gint height;
GString *sbuf;
gint xoff;
gint yoff;
gint intile;
gint inframe;
GdkFont* font;
GdkColor fg;
GdkColor bg;
GdkCapStyle cap_style;
GdkJoinStyle join_style;
gint line_width;
gint valid;
gint valid_fg;
gint valid_bg;
gint nrects;
GdkRectangle *rects;
gint clipped;
gint dash_offset;
gint dash_num;
gchar* dash_list;
};
typedef enum {
GDK_DEBUG_MISC = 1 << 0,
GDK_DEBUG_EVENTS = 1 << 1,
-1400
View File
File diff suppressed because it is too large Load Diff
-72
View File
@@ -1,72 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_PS_H__
#define __GDK_PS_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*typedef struct _GdkPsDrawable GdkPsDrawable;*/
typedef struct
{
gchar* name;
gchar* face;
gchar* family;
gint download;
gchar* afm;
gchar* pfa;
} GdkPsFontInfo;
void gdk_ps_drawable_add_font_info(GdkPsFontInfo *info);
GdkDrawable* gdk_ps_drawable_new (gint fd,
gchar *title,
gchar *author);
void gdk_ps_drawable_draw_rgb (GdkDrawable *d,
GdkGC *gc,
gchar *data,
gint bpp,
gint x,
gint y,
gint width,
gint height);
void gdk_ps_drawable_put_data (GdkDrawable *d,
gchar *data,
guint len);
void gdk_ps_drawable_end (GdkDrawable *d);
void gdk_ps_drawable_page_start (GdkDrawable *d,
gint orientation,
gint count,
gint plex,
gint resolution,
gint width,
gint height);
void gdk_ps_drawable_page_end (GdkDrawable *d);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GDK_PS_H__ */
+14
View File
@@ -19,6 +19,20 @@
#include "gdk.h"
void
gdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,
GdkRectangle *dest)
{
dest->x = MIN (src1->x, src2->x);
dest->y = MIN (src1->y, src2->y);
dest->width =
MAX (src1->x + src1->width, src2->x + src2->width) - dest->x;
dest->height =
MAX (src1->y + src1->height, src2->y + src2->height) - dest->y;
}
gint
gdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,
+15 -49
View File
@@ -22,16 +22,8 @@
#include "gdk.h"
#include "gdkprivate.h"
#define Xmalloc g_malloc
#define Xfree g_free
#define Xrealloc g_realloc
#include "Region.c"
#include "PolyReg.c"
#undef Xmalloc
#undef Xfree
#undef Xrealloc
GdkRegion*
gdk_region_new (void)
@@ -40,7 +32,7 @@ gdk_region_new (void)
GdkRegion *region;
Region xregion;
xregion = GXCreateRegion();
xregion = XCreateRegion();
private = g_new (GdkRegionPrivate, 1);
private->xregion = xregion;
region = (GdkRegion*) private;
@@ -57,7 +49,7 @@ gdk_region_destroy (GdkRegion *region)
g_return_if_fail (region != NULL);
private = (GdkRegionPrivate *) region;
GXDestroyRegion (private->xregion);
XDestroyRegion (private->xregion);
g_free (private);
}
@@ -71,7 +63,7 @@ gdk_region_empty (GdkRegion *region)
private = (GdkRegionPrivate *) region;
return GXEmptyRegion (private->xregion);
return XEmptyRegion (private->xregion);
}
gboolean
@@ -87,7 +79,7 @@ gdk_region_equal (GdkRegion *region1,
private1 = (GdkRegionPrivate *) region1;
private2 = (GdkRegionPrivate *) region2;
return GXEqualRegion (private1->xregion, private2->xregion);
return XEqualRegion (private1->xregion, private2->xregion);
}
void
@@ -101,7 +93,7 @@ gdk_region_get_clipbox(GdkRegion *region,
g_return_if_fail(rectangle != NULL);
rp = (GdkRegionPrivate *)region;
GXClipBox(rp->xregion, &r);
XClipBox(rp->xregion, &r);
rectangle->x = r.x;
rectangle->y = r.y;
@@ -120,7 +112,7 @@ gdk_region_point_in (GdkRegion *region,
private = (GdkRegionPrivate *) region;
return GXPointInRegion (private->xregion, x, y);
return XPointInRegion (private->xregion, x, y);
}
GdkOverlapType
@@ -134,7 +126,7 @@ gdk_region_rect_in (GdkRegion *region,
private = (GdkRegionPrivate *) region;
res = GXRectInRegion (private->xregion, rect->x, rect->y, rect->width, rect->height);
res = XRectInRegion (private->xregion, rect->x, rect->y, rect->width, rect->height);
switch (res)
{
@@ -170,7 +162,7 @@ gdk_region_polygon (GdkPoint *points,
break;
}
xregion = GXPolygonRegion ((XPoint *) points, npoints, xfill_rule);
xregion = XPolygonRegion ((XPoint *) points, npoints, xfill_rule);
private = g_new (GdkRegionPrivate, 1);
private->xregion = xregion;
region = (GdkRegion *) private;
@@ -190,7 +182,7 @@ gdk_region_offset (GdkRegion *region,
private = (GdkRegionPrivate *) region;
GXOffsetRegion (private->xregion, dx, dy);
XOffsetRegion (private->xregion, dx, dy);
}
void
@@ -204,7 +196,7 @@ gdk_region_shrink (GdkRegion *region,
private = (GdkRegionPrivate *) region;
GXShrinkRegion (private->xregion, dx, dy);
XShrinkRegion (private->xregion, dx, dy);
}
GdkRegion*
@@ -228,7 +220,7 @@ gdk_region_union_with_rect (GdkRegion *region,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXUnionRectWithRegion (&xrect, private->xregion, res_private->xregion);
XUnionRectWithRegion (&xrect, private->xregion, res_private->xregion);
return res;
}
@@ -251,7 +243,7 @@ gdk_regions_intersect (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXIntersectRegion (private1->xregion, private2->xregion, res_private->xregion);
XIntersectRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
@@ -274,7 +266,7 @@ gdk_regions_union (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXUnionRegion (private1->xregion, private2->xregion, res_private->xregion);
XUnionRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
@@ -297,7 +289,7 @@ gdk_regions_subtract (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXSubtractRegion (private1->xregion, private2->xregion, res_private->xregion);
XSubtractRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
@@ -320,36 +312,10 @@ gdk_regions_xor (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXXorRegion (private1->xregion, private2->xregion, res_private->xregion);
XXorRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
GdkRectangle*
gdk_region_get_rectangles(GdkRegion *region, gint *nrects)
{
GdkRectangle *result;
GdkRegionPrivate *private;
struct _XRegion *r;
gint i;
g_return_val_if_fail (region != NULL, NULL);
private = (GdkRegionPrivate *) region;
r = (struct _XRegion*) private->xregion;
if (nrects)
*nrects = r->numRects;
if (!r->numRects)
return NULL;
result = g_new(GdkRectangle, r->numRects);
for ( i=0; i < r->numRects; ++i ) {
result[i].x = r->rects[i].x1;
result[i].y = r->rects[i].y1;
result[i].width = r->rects[i].x2 - r->rects[i].x1;
result[i].height = r->rects[i].y2 - r->rects[i].y1;
}
return result;
}
+9 -9
View File
@@ -538,12 +538,12 @@ gdk_rgb_init (void)
gint byte_order[1] = { 1 };
/* check endian sanity */
#ifdef WORDS_BIGENDIAN
#if G_BYTE_ORDER == G_BIG_ENDIAN
if (((char *)byte_order)[0] == 1)
g_error ("gdk_rgb_init: WORDS_BIGENDIAN is defined, but this is a little endian machine.\n\n");
g_error ("gdk_rgb_init: compiled for big endian, but this is a little endian machine.\n\n");
#else
if (((char *)byte_order)[0] != 1)
g_error ("gdk_rgb_init: WORDS_BIGENDIAN is not defined, but this is a big endian machine.\n\n");
g_error ("gdk_rgb_init: compiled for little endian, but this is a big endian machine.\n\n");
#endif
if (image_info == NULL)
@@ -649,7 +649,7 @@ gdk_rgb_init (void)
gulong
gdk_rgb_xpixel_from_rgb (guint32 rgb)
{
gulong pixel;
gulong pixel = 0;
if (image_info->bitmap)
{
@@ -722,7 +722,7 @@ gdk_rgb_gc_set_background (GdkGC *gc, guint32 rgb)
gdk_gc_set_background (gc, &color);
}
#ifndef WORDS_BIGENDIAN
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define HAIRY_CONVERT_8
#endif
@@ -1186,7 +1186,7 @@ gdk_rgb_convert_gray8_gray (GdkImage *image,
}
}
#ifndef WORDS_BIGENDIAN
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define HAIRY_CONVERT_565
#endif
@@ -1729,7 +1729,7 @@ gdk_rgb_convert_888_msb (GdkImage *image,
}
/* todo: optimize this */
#ifndef WORDS_BIGENDIAN
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define HAIRY_CONVERT_888
#endif
@@ -2668,7 +2668,7 @@ gdk_rgb_select_conv (GdkImage *image)
(gint)(((GdkVisualPrivate *)image_info->visual)->xvisual->visualid),
bpp, byte_order == GDK_LSB_FIRST ? "lsb" : "msb");
#ifdef WORDS_BIGENDIAN
#if G_BYTE_ORDER == G_BIG_ENDIAN
byterev = (byte_order == GDK_LSB_FIRST);
#else
byterev = (byte_order == GDK_MSB_FIRST);
@@ -2733,7 +2733,7 @@ gdk_rgb_select_conv (GdkImage *image)
((mask_rgb && byte_order == GDK_MSB_FIRST) ||
(mask_bgr && byte_order == GDK_LSB_FIRST)))
conv = gdk_rgb_convert_888_msb;
#ifdef WORDS_BIGENDIAN
#if G_BYTE_ORDER == G_BIG_ENDIAN
else if (bpp == 32 && depth == 24 && vtype == GDK_VISUAL_TRUE_COLOR &&
(mask_rgb && byte_order == GDK_LSB_FIRST))
conv = gdk_rgb_convert_0888_br;
+2 -31
View File
@@ -85,7 +85,6 @@ typedef struct _GdkDeviceKey GdkDeviceKey;
typedef struct _GdkDeviceInfo GdkDeviceInfo;
typedef struct _GdkTimeCoord GdkTimeCoord;
typedef struct _GdkRegion GdkRegion;
typedef struct _GdkDrawableClass GdkDrawableClass;
typedef gint (*GdkEventFunc) (GdkEvent *event,
gpointer data);
@@ -112,8 +111,6 @@ typedef void* GdkIM;
* pixmap to any procedure which accepts a window with the
* exception of the drawing functions).
* Foreign: A window that actually belongs to another application
* Drawable: A drawable window with custom draw operations such as
* GdkMetaFile and GdkPsDrawable.
*/
typedef enum
{
@@ -123,8 +120,7 @@ typedef enum
GDK_WINDOW_DIALOG,
GDK_WINDOW_TEMP,
GDK_WINDOW_PIXMAP,
GDK_WINDOW_FOREIGN,
GDK_WINDOW_DRAWABLE
GDK_WINDOW_FOREIGN
} GdkWindowType;
/* Classes of windows.
@@ -391,7 +387,7 @@ typedef enum
GDK_DROP_FINISHED = 27,
GDK_CLIENT_EVENT = 28,
GDK_VISIBILITY_NOTIFY = 29,
GDK_NO_EXPOSE = 30,
GDK_NO_EXPOSE = 30
} GdkEventType;
/* Event masks. (Used to select what types of events a window
@@ -844,7 +840,6 @@ struct _GdkFont
GdkFontType type;
gint ascent;
gint descent;
gchar *name;
};
struct _GdkCursor
@@ -1169,30 +1164,6 @@ struct _GdkRegion
};
struct _GdkDrawableClass
{
guint type;
gchar* name;
gchar* description;
gpointer user_data;
/*
GList* functions;
int (*function)(GdkDrawable* d, gchar* format, ...);
*/
void (*destroy) (GdkDrawable* d);
void (*draw_point) (GdkDrawable* d, GdkGC* gc, gint x, gint y);
void (*draw_line) (GdkDrawable* d, GdkGC* gc, gint x1, gint y1, gint x2, gint y2);
void (*draw_rectangle) (GdkDrawable* d, GdkGC* gc, gint filled, gint x, gint y, gint width, gint height);
void (*draw_arc) (GdkDrawable* d, GdkGC* gc, gint filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2);
void (*draw_polygon) (GdkDrawable* d, GdkGC* gc, gint filled, GdkPoint* points, gint npoints);
void (*draw_text) (GdkDrawable* d, GdkFont* font, GdkGC* gc, gint x, gint y, const gchar* text, gint length);
void (*draw_pixmap) (GdkDrawable* d, GdkGC* gc, GdkDrawable* src, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height);
void (*draw_image) (GdkDrawable* d, GdkGC* gc, GdkImage* src, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height);
void (*draw_points) (GdkDrawable* d, GdkGC* gc, GdkPoint* points, gint npoints);
void (*draw_segments) (GdkDrawable* d, GdkGC* gc, GdkSegment* segs, gint nsegs);
void (*draw_lines) (GdkDrawable* d, GdkGC* gc, GdkPoint* points, gint npoints);
};
#ifdef __cplusplus
}
+362 -54
View File
@@ -58,6 +58,7 @@ int event_mask_table[20] =
SubstructureNotifyMask
};
static gboolean gdk_window_have_shape_ext (void);
/* internal function created for and used by gdk_window_xid_at_coords */
Window
@@ -285,14 +286,6 @@ gdk_window_new (GdkWindow *parent,
private->height = (attributes->height > 1) ? (attributes->height) : (1);
private->window_type = attributes->window_type;
private->extension_events = FALSE;
private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail =
private->dnd_drop_data_typesavail = NULL;
private->dnd_drop_enabled = private->dnd_drag_enabled =
private->dnd_drag_accepted = private->dnd_drag_datashow =
private->dnd_drop_data_numtypesavail =
private->dnd_drag_data_numtypesavail = 0;
private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
private->filters = NULL;
private->children = NULL;
@@ -374,9 +367,6 @@ gdk_window_new (GdkWindow *parent,
case GDK_WINDOW_PIXMAP:
g_error ("cannot make windows of type GDK_WINDOW_PIXMAP (use gdk_pixmap_new)");
break;
case GDK_WINDOW_DRAWABLE:
g_error ("cannot make windows of type GDK_WINDOW_DRAWABLE (use the drawable-specific functions)");
break;
}
}
else
@@ -509,15 +499,6 @@ gdk_window_foreign_new (guint32 anid)
private->colormap = NULL;
private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail =
private->dnd_drop_data_typesavail = NULL;
private->dnd_drop_enabled = private->dnd_drag_enabled =
private->dnd_drag_accepted = private->dnd_drag_datashow =
private->dnd_drop_data_numtypesavail =
private->dnd_drag_data_numtypesavail = 0;
private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
private->filters = NULL;
private->children = NULL;
@@ -587,17 +568,6 @@ gdk_window_internal_destroy (GdkWindow *window, gboolean xdestroy,
if (private->extension_events != 0)
gdk_input_window_destroy (window);
if(private->dnd_drag_data_numtypesavail > 0)
{
g_free (private->dnd_drag_data_typesavail);
private->dnd_drag_data_typesavail = NULL;
}
if(private->dnd_drop_data_numtypesavail > 0)
{
g_free (private->dnd_drop_data_typesavail);
private->dnd_drop_data_typesavail = NULL;
}
if (private->filters)
{
tmp = private->filters;
@@ -653,11 +623,6 @@ gdk_window_internal_destroy (GdkWindow *window, gboolean xdestroy,
case GDK_WINDOW_PIXMAP:
g_error ("called gdk_window_destroy on a pixmap (use gdk_pixmap_unref)");
break;
case GDK_WINDOW_DRAWABLE:
if (private->engine->destroy)
private->engine->destroy(window);
break;
}
}
@@ -1637,6 +1602,24 @@ gdk_window_add_colormap_windows (GdkWindow *window)
XFree (old_windows);
}
static gboolean
gdk_window_have_shape_ext (void)
{
enum { UNKNOWN, NO, YES };
static gint have_shape = UNKNOWN;
if (have_shape == UNKNOWN)
{
int ignore;
if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
have_shape = YES;
else
have_shape = NO;
}
return (have_shape == YES);
}
/*
* This needs the X11 shape extension.
* If not available, shaped windows will look
@@ -1647,31 +1630,18 @@ gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask,
gint x, gint y)
{
enum { UNKNOWN, NO, YES };
static gint have_shape = UNKNOWN;
GdkWindowPrivate *window_private;
Pixmap pixmap;
g_return_if_fail (window != NULL);
#ifdef HAVE_SHAPE_EXT
if (have_shape == UNKNOWN)
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (gdk_window_have_shape_ext())
{
int ignore;
if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
have_shape = YES;
else
have_shape = NO;
}
if (have_shape == YES)
{
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mask)
{
GdkWindowPrivate *pixmap_private;
@@ -1968,6 +1938,344 @@ gdk_window_get_toplevels (void)
return new_list;
}
/*
* propagate the shapes from all child windows of a GDK window to the parent
* window. Shamelessly ripped from Enlightenment's code
*
* - Raster
*/
struct _gdk_span
{
gint start;
gint end;
struct _gdk_span *next;
};
static void
gdk_add_to_span(struct _gdk_span **s, int x, int xx)
{
struct _gdk_span *ptr1, *ptr2, *noo, *ss;
gchar spanning;
ptr2 = NULL;
ptr1 = *s;
spanning = 0;
ss = NULL;
/* scan the spans for this line */
while (ptr1)
{
/* -- -> new span */
/* == -> existing span */
/* ## -> spans intersect */
/* if we are in the middle of spanning the span into the line */
if (spanning)
{
/* case: ---- ==== */
if (xx < ptr1->start - 1)
{
/* ends before next span - extend to here */
ss->end = xx;
return;
}
/* case: ----##=== */
else if (xx <= ptr1->end)
{
/* crosses into next span - delete next span and append */
ss->end = ptr1->end;
ss->next = ptr1->next;
g_free(ptr1);
return;
}
/* case: ---###--- */
else
{
/* overlaps next span - delete and keep checking */
ss->next = ptr1->next;
g_free(ptr1);
ptr1 = ss;
}
}
/* otherwise havent started spanning it in yet */
else
{
/* case: ---- ==== */
if (xx < ptr1->start - 1)
{
/* insert span here in list */
noo = g_malloc(sizeof(struct _gdk_span));
if (noo)
{
noo->start = x;
noo->end = xx;
noo->next = ptr1;
if (ptr2)
ptr2->next = noo;
else
*s = noo;
}
return;
}
/* case: ----##=== */
else if ((x < ptr1->start) && (xx <= ptr1->end))
{
/* expand this span to the left point of the new one */
ptr1->start = x;
return;
}
/* case: ===###=== */
else if ((x >= ptr1->start) && (xx <= ptr1->end))
{
/* throw the span away */
return;
}
/* case: ---###--- */
else if ((x < ptr1->start) && (xx > ptr1->end))
{
ss = ptr1;
spanning = 1;
ptr1->start = x;
ptr1->end = xx;
}
/* case: ===##---- */
else if ((x >= ptr1->start) && (x <= ptr1->end + 1) && (xx > ptr1->end))
{
ss = ptr1;
spanning = 1;
ptr1->end = xx;
}
/* case: ==== ---- */
/* case handled by next loop iteration - first case */
}
ptr2 = ptr1;
ptr1 = ptr1->next;
}
/* it started in the middle but spans beyond your current list */
if (spanning)
{
ptr2->end = xx;
return;
}
/* it does not start inside a span or in the middle, so add it to the end */
noo = g_malloc(sizeof(struct _gdk_span));
if (noo)
{
noo->start = x;
noo->end = xx;
if (ptr2)
{
noo->next = ptr2->next;
ptr2->next = noo;
}
else
{
noo->next = NULL;
*s = noo;
}
}
return;
}
static void
gdk_add_rectangles (Display *disp, Window win, struct _gdk_span **spans,
gint basew, gint baseh, gint x, gint y)
{
gint a, k;
gint x1, y1, x2, y2;
gint rn, ord;
XRectangle *rl;
rl = XShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord);
if (rl)
{
/* go through all clip rects in this window's shape */
for (k = 0; k < rn; k++)
{
/* for each clip rect, add it to each line's spans */
x1 = x + rl[k].x;
x2 = x + rl[k].x + (rl[k].width - 1);
y1 = y + rl[k].y;
y2 = y + rl[k].y + (rl[k].height - 1);
if (x1 < 0)
x1 = 0;
if (y1 < 0)
y1 = 0;
if (x2 >= basew)
x2 = basew - 1;
if (y2 >= baseh)
y2 = baseh - 1;
for (a = y1; a <= y2; a++)
{
if ((x2 - x1) >= 0)
gdk_add_to_span(&spans[a], x1, x2);
}
}
XFree(rl);
}
}
static void
gdk_propagate_shapes(Display *disp, Window win, gboolean merge)
{
Window rt, par, *list = NULL;
gint i, j, num = 0, num_rects = 0;
gint x, y, contig;
guint w, h, d;
gint baseh, basew;
XRectangle *rects = NULL;
struct _gdk_span **spans = NULL, *ptr1, *ptr2, *ptr3;
XWindowAttributes xatt;
XGetGeometry(disp, win, &rt, &x, &y, &w, &h, &d, &d);
if (h <= 0)
return;
basew = w;
baseh = h;
spans = g_malloc(sizeof(struct _gdk_span *) * h);
for (i = 0; i < h; i++)
spans[i] = NULL;
XQueryTree(disp, win, &rt, &par, &list, (unsigned int *)&num);
if (list)
{
/* go through all child windows and create/insert spans */
for (i = 0; i < num; i++)
{
if (XGetWindowAttributes(disp, list[i], &xatt) && (xatt.map_state != IsUnmapped))
if (XGetGeometry(disp, list[i], &rt, &x, &y, &w, &h, &d, &d))
gdk_add_rectangles (disp, list[i], spans, basew, baseh, x, y);
}
if (merge)
gdk_add_rectangles (disp, win, spans, basew, baseh, x, y);
/* go through the spans list and build a list of rects */
rects = g_malloc(sizeof(XRectangle) * 256);
num_rects = 0;
for (i = 0; i < baseh; i++)
{
ptr1 = spans[i];
/* go through the line for all spans */
while (ptr1)
{
rects[num_rects].x = ptr1->start;
rects[num_rects].y = i;
rects[num_rects].width = ptr1->end - ptr1->start + 1;
rects[num_rects].height = 1;
j = i + 1;
/* if there are more lines */
contig = 1;
/* while contigous rects (same start/end coords) exist */
while ((contig) && (j < baseh))
{
/* search next line for spans matching this one */
contig = 0;
ptr2 = spans[j];
ptr3 = NULL;
while (ptr2)
{
/* if we have an exact span match set contig */
if ((ptr2->start == ptr1->start) &&
(ptr2->end == ptr1->end))
{
contig = 1;
/* remove the span - not needed */
if (ptr3)
{
ptr3->next = ptr2->next;
g_free(ptr2);
ptr2 = NULL;
}
else
{
spans[j] = ptr2->next;
g_free(ptr2);
ptr2 = NULL;
}
break;
}
/* gone past the span point no point looking */
else if (ptr2->start < ptr1->start)
break;
if (ptr2)
{
ptr3 = ptr2;
ptr2 = ptr2->next;
}
}
/* if a contiguous span was found increase the rect h */
if (contig)
{
rects[num_rects].height++;
j++;
}
}
/* up the rect count */
num_rects++;
/* every 256 new rects increase the rect array */
if ((num_rects % 256) == 0)
rects = g_realloc(rects, sizeof(XRectangle) * (num_rects + 256));
ptr1 = ptr1->next;
}
}
/* set the rects as the shape mask */
if (rects)
{
XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, num_rects,
ShapeSet, YXSorted);
g_free(rects);
}
XFree(list);
}
/* free up all the spans we made */
for (i = 0; i < baseh; i++)
{
ptr1 = spans[i];
while (ptr1)
{
ptr2 = ptr1;
ptr1 = ptr1->next;
g_free(ptr2);
}
}
g_free(spans);
}
void
gdk_window_set_child_shapes (GdkWindow *window)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
#ifdef HAVE_SHAPE_EXT
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
if (gdk_window_have_shape_ext())
gdk_propagate_shapes (private->xdisplay, private->xwindow, FALSE);
#endif
}
void
gdk_window_merge_child_shapes (GdkWindow *window)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
#ifdef HAVE_SHAPE_EXT
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
if (gdk_window_have_shape_ext())
gdk_propagate_shapes (private->xdisplay, private->xwindow, TRUE);
#endif
}
void
gdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,
-4
View File
@@ -1,4 +0,0 @@
$1 == "#define" && NF >= 3 {
sub(/^XC/,"GDK",$2)
printf("%s = %s,\n",toupper($2),$3)
}
-5
View File
@@ -1,5 +0,0 @@
$1 == "#define" && NF >= 3 {
sub(/^XK/,"GDK",$2)
sub(/0X/,"0x",$3)
print $1,$2,$3
}
-296
View File
@@ -1,296 +0,0 @@
/* $XConsortium: poly.h,v 1.4 94/04/17 20:22:19 rws Exp $ */
/************************************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
/*
* This file contains a few macros to help track
* the edge of a filled object. The object is assumed
* to be filled in scanline order, and thus the
* algorithm used is an extension of Bresenham's line
* drawing algorithm which assumes that y is always the
* major axis.
* Since these pieces of code are the same for any filled shape,
* it is more convenient to gather the library in one
* place, but since these pieces of code are also in
* the inner loops of output primitives, procedure call
* overhead is out of the question.
* See the author for a derivation if needed.
*/
/*
* In scan converting polygons, we want to choose those pixels
* which are inside the polygon. Thus, we add .5 to the starting
* x coordinate for both left and right edges. Now we choose the
* first pixel which is inside the pgon for the left edge and the
* first pixel which is outside the pgon for the right edge.
* Draw the left pixel, but not the right.
*
* How to add .5 to the starting x coordinate:
* If the edge is moving to the right, then subtract dy from the
* error term from the general form of the algorithm.
* If the edge is moving to the left, then add dy to the error term.
*
* The reason for the difference between edges moving to the left
* and edges moving to the right is simple: If an edge is moving
* to the right, then we want the algorithm to flip immediately.
* If it is moving to the left, then we don't want it to flip until
* we traverse an entire pixel.
*/
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
int dx; /* local storage */ \
\
/* \
* if the edge is horizontal, then it is ignored \
* and assumed not to be processed. Otherwise, do this stuff. \
*/ \
if ((dy) != 0) { \
xStart = (x1); \
dx = (x2) - xStart; \
if (dx < 0) { \
m = dx / (dy); \
m1 = m - 1; \
incr1 = -2 * dx + 2 * (dy) * m1; \
incr2 = -2 * dx + 2 * (dy) * m; \
d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
} else { \
m = dx / (dy); \
m1 = m + 1; \
incr1 = 2 * dx - 2 * (dy) * m1; \
incr2 = 2 * dx - 2 * (dy) * m; \
d = -2 * m * (dy) + 2 * dx; \
} \
} \
}
#define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \
if (m1 > 0) { \
if (d > 0) { \
minval += m1; \
d += incr1; \
} \
else { \
minval += m; \
d += incr2; \
} \
} else {\
if (d >= 0) { \
minval += m1; \
d += incr1; \
} \
else { \
minval += m; \
d += incr2; \
} \
} \
}
/*
* This structure contains all of the information needed
* to run the bresenham algorithm.
* The variables may be hardcoded into the declarations
* instead of using this structure to make use of
* register declarations.
*/
typedef struct {
int minor_axis; /* minor axis */
int d; /* decision variable */
int m, m1; /* slope and slope+1 */
int incr1, incr2; /* error increments */
} BRESINFO;
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \
BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \
bres.m, bres.m1, bres.incr1, bres.incr2)
#define BRESINCRPGONSTRUCT(bres) \
BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2)
/*
* These are the data structures needed to scan
* convert regions. Two different scan conversion
* methods are available -- the even-odd method, and
* the winding number method.
* The even-odd rule states that a point is inside
* the polygon if a ray drawn from that point in any
* direction will pass through an odd number of
* path segments.
* By the winding number rule, a point is decided
* to be inside the polygon if a ray drawn from that
* point in any direction passes through a different
* number of clockwise and counter-clockwise path
* segments.
*
* These data structures are adapted somewhat from
* the algorithm in (Foley/Van Dam) for scan converting
* polygons.
* The basic algorithm is to start at the top (smallest y)
* of the polygon, stepping down to the bottom of
* the polygon by incrementing the y coordinate. We
* keep a list of edges which the current scanline crosses,
* sorted by x. This list is called the Active Edge Table (AET)
* As we change the y-coordinate, we update each entry in
* in the active edge table to reflect the edges new xcoord.
* This list must be sorted at each scanline in case
* two edges intersect.
* We also keep a data structure known as the Edge Table (ET),
* which keeps track of all the edges which the current
* scanline has not yet reached. The ET is basically a
* list of ScanLineList structures containing a list of
* edges which are entered at a given scanline. There is one
* ScanLineList per scanline at which an edge is entered.
* When we enter a new edge, we move it from the ET to the AET.
*
* From the AET, we can implement the even-odd rule as in
* (Foley/Van Dam).
* The winding number rule is a little trickier. We also
* keep the EdgeTableEntries in the AET linked by the
* nextWETE (winding EdgeTableEntry) link. This allows
* the edges to be linked just as before for updating
* purposes, but only uses the edges linked by the nextWETE
* link as edges representing spans of the polygon to
* drawn (as with the even-odd rule).
*/
/*
* for the winding number rule
*/
#define CLOCKWISE 1
#define COUNTERCLOCKWISE -1
typedef struct _EdgeTableEntry {
int ymax; /* ycoord at which we exit this edge. */
BRESINFO bres; /* Bresenham info to run the edge */
struct _EdgeTableEntry *next; /* next in the list */
struct _EdgeTableEntry *back; /* for insertion sort */
struct _EdgeTableEntry *nextWETE; /* for winding num rule */
int ClockWise; /* flag for winding number rule */
} EdgeTableEntry;
typedef struct _ScanLineList{
int scanline; /* the scanline represented */
EdgeTableEntry *edgelist; /* header node */
struct _ScanLineList *next; /* next in the list */
} ScanLineList;
typedef struct {
int ymax; /* ymax for the polygon */
int ymin; /* ymin for the polygon */
ScanLineList scanlines; /* header node */
} EdgeTable;
/*
* Here is a struct to help with storage allocation
* so we can allocate a big chunk at a time, and then take
* pieces from this heap when we need to.
*/
#define SLLSPERBLOCK 25
typedef struct _ScanLineListBlock {
ScanLineList SLLs[SLLSPERBLOCK];
struct _ScanLineListBlock *next;
} ScanLineListBlock;
/*
*
* a few macros for the inner loops of the fill code where
* performance considerations don't allow a procedure call.
*
* Evaluate the given edge at the given scanline.
* If the edge has expired, then we leave it and fix up
* the active edge table; otherwise, we increment the
* x value to be ready for the next scanline.
* The winding number rule is in effect, so we must notify
* the caller when the edge has been removed so he
* can reorder the Winding Active Edge Table.
*/
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \
if (pAET->ymax == y) { /* leaving this edge */ \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
fixWAET = 1; \
if (pAET) \
pAET->back = pPrevAET; \
} \
else { \
BRESINCRPGONSTRUCT(pAET->bres); \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}
/*
* Evaluate the given edge at the given scanline.
* If the edge has expired, then we leave it and fix up
* the active edge table; otherwise, we increment the
* x value to be ready for the next scanline.
* The even-odd rule is in effect.
*/
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
if (pAET->ymax == y) { /* leaving this edge */ \
pPrevAET->next = pAET->next; \
pAET = pPrevAET->next; \
if (pAET) \
pAET->back = pPrevAET; \
} \
else { \
BRESINCRPGONSTRUCT(pAET->bres); \
pPrevAET = pAET; \
pAET = pAET->next; \
} \
}
-195
View File
@@ -1,195 +0,0 @@
/* $XConsortium: region.h,v 11.14 94/04/17 20:22:20 rws Exp $ */
/************************************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
************************************************************************/
#ifndef _XREGION_H
#define _XREGION_H
typedef struct {
short x1, x2, y1, y2;
} Box, BOX, BoxRec, *BoxPtr;
typedef struct {
short x, y, width, height;
}RECTANGLE, RectangleRec, *RectanglePtr;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define MAXSHORT 32767
#define MINSHORT -MAXSHORT
#ifndef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
/*
* clip region
*/
typedef struct _XRegion {
long size;
long numRects;
BOX *rects;
BOX extents;
} REGION;
/* Xutil.h contains the declaration:
* typedef struct _XRegion *Region;
*/
/* 1 if two BOXs overlap.
* 0 if two BOXs do not overlap.
* Remember, x2 and y2 are not in the region
*/
#define EXTENTCHECK(r1, r2) \
((r1)->x2 > (r2)->x1 && \
(r1)->x1 < (r2)->x2 && \
(r1)->y2 > (r2)->y1 && \
(r1)->y1 < (r2)->y2)
/*
* update region extents
*/
#define EXTENTS(r,idRect){\
if((r)->x1 < (idRect)->extents.x1)\
(idRect)->extents.x1 = (r)->x1;\
if((r)->y1 < (idRect)->extents.y1)\
(idRect)->extents.y1 = (r)->y1;\
if((r)->x2 > (idRect)->extents.x2)\
(idRect)->extents.x2 = (r)->x2;\
if((r)->y2 > (idRect)->extents.y2)\
(idRect)->extents.y2 = (r)->y2;\
}
/*
* Check to see if there is enough memory in the present region.
*/
#define MEMCHECK(reg, rect, firstrect){\
if ((reg)->numRects >= ((reg)->size - 1)){\
(firstrect) = (BOX *) Xrealloc \
((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\
if ((firstrect) == 0)\
return(0);\
(reg)->size *= 2;\
(rect) = &(firstrect)[(reg)->numRects];\
}\
}
/* this routine checks to see if the previous rectangle is the same
* or subsumes the new rectangle to add.
*/
#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\
(!(((Reg)->numRects > 0)&&\
((R-1)->y1 == (Ry1)) &&\
((R-1)->y2 == (Ry2)) &&\
((R-1)->x1 <= (Rx1)) &&\
((R-1)->x2 >= (Rx2))))
/* add a rectangle to the given Region */
#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\
if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
(r)->x1 = (rx1);\
(r)->y1 = (ry1);\
(r)->x2 = (rx2);\
(r)->y2 = (ry2);\
EXTENTS((r), (reg));\
(reg)->numRects++;\
(r)++;\
}\
}
/* add a rectangle to the given Region */
#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\
if ((rx1 < rx2) && (ry1 < ry2) &&\
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
(r)->x1 = (rx1);\
(r)->y1 = (ry1);\
(r)->x2 = (rx2);\
(r)->y2 = (ry2);\
(reg)->numRects++;\
(r)++;\
}\
}
#define EMPTY_REGION(pReg) pReg->numRects = 0
#define REGION_NOT_EMPTY(pReg) pReg->numRects
#define INBOX(r, x, y) \
( ( ((r).x2 > x)) && \
( ((r).x1 <= x)) && \
( ((r).y2 > y)) && \
( ((r).y1 <= y)) )
/*
* number of points to buffer before sending them off
* to scanlines() : Must be an even number
*/
#define NUMPTSTOBUFFER 200
/*
* used to allocate buffers for points and link
* the buffers together
*/
typedef struct _POINTBLOCK {
XPoint pts[NUMPTSTOBUFFER];
struct _POINTBLOCK *next;
} POINTBLOCK;
#endif
+68 -21
View File
@@ -377,15 +377,17 @@ gdk_window_cache_destroy (GdkWindowCache *cache)
static Window
get_client_window_at_coords_recurse (Window win,
gint x_root,
gint y_root)
gint x,
gint y)
{
Window child;
Window root, tmp_parent, *children;
unsigned int nchildren;
int i;
Window child = None;
Atom type = None;
int format;
unsigned long nitems, after;
unsigned char *data;
int dest_x, dest_y;
static Atom wm_state_atom = None;
@@ -408,6 +410,8 @@ get_client_window_at_coords_recurse (Window win,
return win;
}
#if 0
/* This is beautiful! Damn Enlightenment and click-to-focus */
XTranslateCoordinates (gdk_display, gdk_root_window, win,
x_root, y_root, &dest_x, &dest_y, &child);
@@ -416,18 +420,49 @@ get_client_window_at_coords_recurse (Window win,
gdk_error_code = 0;
return None;
}
#else
if (XQueryTree(gdk_display, win,
&root, &tmp_parent, &children, &nchildren) == 0)
return 0;
if (gdk_error_code == 0)
{
for (i = nchildren - 1; (i >= 0) && (child == None); i--)
{
XWindowAttributes xwa;
XGetWindowAttributes (gdk_display, children[i], &xwa);
if (gdk_error_code != 0)
gdk_error_code = 0;
else if ((xwa.map_state == IsViewable) && (xwa.class == InputOutput) &&
(x >= xwa.x) && (x < xwa.x + (gint)xwa.width) &&
(y >= xwa.y) && (y < xwa.y + (gint)xwa.height))
{
x -= xwa.x;
y -= xwa.y;
child = children[i];
}
}
XFree (children);
}
else
gdk_error_code = 0;
#endif
if (child)
return get_client_window_at_coords_recurse (child, x_root, y_root);
return get_client_window_at_coords_recurse (child, x, y);
else
return None;
}
Window
get_client_window_at_coords (GdkWindowCache *cache,
Window ignore,
gint x_root,
gint y_root)
Window ignore,
gint x_root,
gint y_root)
{
GList *tmp_list;
Window retval = None;
@@ -449,7 +484,8 @@ get_client_window_at_coords (GdkWindowCache *cache,
(y_root >= child->y) && (y_root < child->y + child->height))
{
retval = get_client_window_at_coords_recurse (child->xid,
x_root, y_root);
x_root - child->x,
y_root - child->y);
if (!retval)
retval = child->xid;
}
@@ -532,7 +568,7 @@ get_client_window_at_coords (Window ignore,
if (XQueryTree(gdk_display, gdk_root_window,
&root, &parent, &children, &nchildren) == 0)
return 0;
for (i = nchildren - 1; (i >= 0) && (retval == None); i--)
{
if (children[i] != ignore)
@@ -883,7 +919,12 @@ motif_read_target_table (void)
goto error;
n_targets = card16_to_host (*(gushort *)p, header->byte_order);
targets = (guint32 *)(p + sizeof(guint16));
/* We need to make a copy of the targets, since it may
* be unaligned
*/
targets = g_new (guint32, n_targets);
memcpy (targets, p + sizeof(guint16), sizeof(guint32) * n_targets);
p += sizeof(guint16) + n_targets * sizeof(guint32);
if (p - target_bytes > nitems)
@@ -894,7 +935,7 @@ motif_read_target_table (void)
g_list_prepend (motif_target_lists[i],
GUINT_TO_POINTER (card32_to_host (targets[j],
header->byte_order)));
g_free (targets);
motif_target_lists[i] = g_list_reverse (motif_target_lists[i]);
}
@@ -1001,7 +1042,6 @@ motif_add_to_target_table (GList *targets)
guchar *data;
guchar *p;
guint16 *p16;
guint32 *p32;
MotifTargetTableHeader *header;
if (!motif_target_lists)
@@ -1035,20 +1075,27 @@ motif_add_to_target_table (GList *targets)
for (i = 0; i < motif_n_target_lists ; i++)
{
guint16 count = 0;
guint16 n_targets = g_list_length (motif_target_lists[i]);
guint32 *targets = g_new (guint32, n_targets);
guint32 *p32 = targets;
p16 = (guint16 *)p;
p += sizeof(guint16);
p32 = (guint32 *)p;
tmp_list = motif_target_lists[i];
while (tmp_list)
{
*p32++ = GPOINTER_TO_UINT (tmp_list->data);
*p32 = GPOINTER_TO_UINT (tmp_list->data);
tmp_list = tmp_list->next;
count++;
p32++;
}
*p16 = count;
p = (guchar *)p32;
p16 = (guint16 *)p;
p += sizeof(guint16);
memcpy (p, targets, n_targets * sizeof(guint32));
*p16 = n_targets;
p += sizeof(guint32) * n_targets;
g_free (targets);
}
XChangeProperty (gdk_display, motif_drag_window,
-18
View File
@@ -26,7 +26,6 @@ gdk_font_load (const gchar *font_name)
{
GdkFont *font;
GdkFontPrivate *private;
static Atom font_atom = None;
private = g_new (GdkFontPrivate, 1);
font = (GdkFont*) private;
@@ -34,7 +33,6 @@ gdk_font_load (const gchar *font_name)
private->xdisplay = gdk_display;
private->xfont = XLoadQueryFont (private->xdisplay, font_name);
private->ref_count = 1;
font->name = NULL;
if (!private->xfont)
{
@@ -43,23 +41,9 @@ gdk_font_load (const gchar *font_name)
}
else
{
gchar* xfd = NULL;
unsigned long value;
font->type = GDK_FONT_FONT;
font->ascent = ((XFontStruct *) private->xfont)->ascent;
font->descent = ((XFontStruct *) private->xfont)->descent;
if ( font_atom != None )
font_atom = XInternAtom(private->xdisplay, "FONT", True);
if ( font_atom != None ) {
if (XGetFontProperty(private->xfont, font_atom, &value))
xfd = XGetAtomName(private->xdisplay, value);
if (xfd) {
font->name = g_strdup(xfd);
XFree(xfd);
}
}
if ( font->name == NULL )
font->name = g_strdup(font_name);
}
gdk_xid_table_insert (&((XFontStruct *) private->xfont)->fid, font);
@@ -119,7 +103,6 @@ gdk_fontset_load (gchar *fontset_name)
font->ascent = MAX (font->ascent, font_structs[i]->ascent);
font->descent = MAX (font->descent, font_structs[i]->descent);
}
font->name = g_strdup(fontset_name);
}
return font;
}
@@ -161,7 +144,6 @@ gdk_font_unref (GdkFont *font)
g_error ("unknown font type.");
break;
}
g_free(font->name);
g_free (font);
}
}
+2 -1
View File
@@ -353,7 +353,8 @@ gdk_image_get (GdkWindow *window,
image->mem = private->ximage->data;
image->bpl = private->ximage->bytes_per_line;
image->bpp = 1;
image->bpp = private->ximage->bits_per_pixel;
image->byte_order = private->ximage->byte_order;
return image;
}
+1 -1
View File
@@ -173,7 +173,7 @@ gdk_input_xfree_configure_event (XConfigureEvent *xevent, GdkWindow *window)
static void
gdk_input_xfree_enter_event (XCrossingEvent *xevent,
GdkWindow *window)
GdkWindow *window)
{
GdkInputWindow *input_window;
gint root_x, root_y;
+366 -252
View File
@@ -116,10 +116,6 @@ static Bool gdk_event_get_type (Display *display,
static void gdk_synthesize_click (GdkEvent *event,
gint nclicks);
#ifdef DEBUG_DND
static void gdk_print_atom (GdkAtom anatom);
#endif
#ifndef HAVE_XCONVERTCASE
static void gdkx_XConvertCase (KeySym symbol,
KeySym *lower,
@@ -156,12 +152,12 @@ static gint gdk_im_open (XrmDatabase db,
static void gdk_im_close (void);
static void gdk_ic_cleanup (void);
#endif /* USE_XIM */
GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev,
GdkEvent *event,
gpointer data);
#endif /* USE_XIM */
/* Private variable declarations
*/
static int gdk_initialized = 0; /* 1 if the library is initialized,
@@ -740,7 +736,195 @@ gdk_event_get_graphics_expose (GdkWindow *window)
gdk_event_free (event);
}
return NULL;
return NULL;
}
/************************
* Exposure compression *
************************/
/*
* The following implements simple exposure compression. It is
* modelled after the way Xt does exposure compression - in
* particular compress_expose = XtExposeCompressMultiple.
* It compress consecutive sequences of exposure events,
* but not sequences that cross other events. (This is because
* if it crosses a ConfigureNotify, we could screw up and
* mistakenly compress the exposures generated for the new
* size - could we just check for ConfigureNotify?)
*
* Xt compresses to a region / bounding rectangle, we compress
* to two rectangles, and try find the two rectangles of minimal
* area for this - this is supposed to handle the typical
* L-shaped regions generated by OpaqueMove.
*/
/* Given three rectangles, find the two rectangles that cover
* them with the smallest area.
*/
static void
gdk_add_rect_to_rects (GdkRectangle *rect1,
GdkRectangle *rect2,
GdkRectangle *new_rect)
{
GdkRectangle t1, t2, t3;
gint size1, size2, size3;
gdk_rectangle_union (rect1, rect2, &t1);
gdk_rectangle_union (rect1, new_rect, &t2);
gdk_rectangle_union (rect2, new_rect, &t3);
size1 = t1.width * t1.height + new_rect->width * new_rect->height;
size2 = t2.width * t2.height + rect2->width * rect2->height;
size3 = t1.width * t1.height + rect1->width * rect1->height;
if (size1 < size2)
{
if (size1 < size3)
{
*rect1 = t1;
*rect2 = *new_rect;
}
else
*rect2 = t3;
}
else
{
if (size2 < size3)
*rect1 = t2;
else
*rect2 = t3;
}
}
typedef struct _GdkExposeInfo GdkExposeInfo;
struct _GdkExposeInfo {
Window window;
gboolean seen_nonmatching;
};
Bool
expose_predicate (Display *display, XEvent *xevent, XPointer arg)
{
GdkExposeInfo *info = (GdkExposeInfo *)arg;
if (xevent->xany.type != Expose)
{
info->seen_nonmatching = TRUE;
}
if (info->seen_nonmatching || (xevent->xany.window != info->window))
return FALSE;
else
return TRUE;
}
void
gdk_compress_exposures (XEvent *xevent, GdkWindow *window)
{
gint nrects = 1;
gint count = 0;
GdkRectangle rect1;
GdkRectangle rect2;
GdkRectangle tmp_rect;
XEvent tmp_event;
GdkFilterReturn result;
GdkExposeInfo info;
GdkEvent event;
info.window = xevent->xany.window;
info.seen_nonmatching = FALSE;
rect1.x = xevent->xexpose.x;
rect1.y = xevent->xexpose.y;
rect1.width = xevent->xexpose.width;
rect1.height = xevent->xexpose.height;
while (1)
{
if (count == 0)
{
if (!XCheckIfEvent (gdk_display,
&tmp_event,
expose_predicate,
(XPointer)&info))
break;
}
else
XIfEvent (gdk_display,
&tmp_event,
expose_predicate,
(XPointer)&info);
/* We apply filters here, and if it was filtered, completely
* ignore the return
*/
result = gdk_event_apply_filters (xevent, &event,
window ?
((GdkWindowPrivate *)window)->filters
: gdk_default_filters);
if (result != GDK_FILTER_CONTINUE)
{
if (result == GDK_FILTER_TRANSLATE)
gdk_event_put (&event);
continue;
}
if (nrects == 1)
{
rect2.x = tmp_event.xexpose.x;
rect2.y = tmp_event.xexpose.y;
rect2.width = tmp_event.xexpose.width;
rect2.height = tmp_event.xexpose.height;
nrects++;
}
else
{
tmp_rect.x = tmp_event.xexpose.x;
tmp_rect.y = tmp_event.xexpose.y;
tmp_rect.width = tmp_event.xexpose.width;
tmp_rect.height = tmp_event.xexpose.height;
gdk_add_rect_to_rects (&rect1, &rect2, &tmp_rect);
}
count = tmp_event.xexpose.count;
}
if (nrects == 2)
{
gdk_rectangle_union (&rect1, &rect2, &tmp_rect);
if ((tmp_rect.width * tmp_rect.height) <
2 * (rect1.height * rect1.width +
rect2.height * rect2.width))
{
rect1 = tmp_rect;
nrects = 1;
}
}
if (nrects == 2)
{
event.expose.type = GDK_EXPOSE;
event.expose.window = window;
event.expose.area.x = rect2.x;
event.expose.area.y = rect2.y;
event.expose.area.width = rect2.width;
event.expose.area.height = rect2.height;
event.expose.count = 0;
gdk_event_put (&event);
}
xevent->xexpose.count = nrects - 1;
xevent->xexpose.x = rect1.x;
xevent->xexpose.y = rect1.y;
xevent->xexpose.width = rect1.width;
xevent->xexpose.height = rect1.height;
}
/*
@@ -834,6 +1018,7 @@ gdk_event_get (void)
#else
XNextEvent (gdk_display, &xevent);
#endif
event = gdk_event_new ();
event->any.type = GDK_NOTHING;
@@ -989,7 +1174,6 @@ gdk_event_free (GdkEvent *event)
gdk_drag_context_unref (event->dnd.context);
break;
default:
break;
}
@@ -1894,22 +2078,25 @@ gdk_event_translate (GdkEvent *event,
event->any.send_event = xevent->xany.send_event;
if (window_private && window_private->destroyed)
return FALSE;
/* Check for filters for this window */
{
if (xevent->type != DestroyNotify)
return FALSE;
}
else
{
/* Check for filters for this window */
{
GdkFilterReturn result;
result = gdk_event_apply_filters (xevent, event,
window_private
?window_private->filters
:gdk_default_filters);
if (result != GDK_FILTER_CONTINUE)
{
return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
}
}
GdkFilterReturn result;
result = gdk_event_apply_filters (xevent, event,
window_private
?window_private->filters
:gdk_default_filters);
if (result != GDK_FILTER_CONTINUE)
{
return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
}
}
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
@@ -1917,10 +2104,9 @@ gdk_event_translate (GdkEvent *event,
* optionally print debugging info regarding events
* received.
*/
/* Addendum:
* During drag & drop you get events where the pointer is
* in other windows. Need to just do finer-grained checking
*/
return_val = TRUE;
switch (xevent->type)
{
case KeyPress:
@@ -1998,16 +2184,18 @@ gdk_event_translate (GdkEvent *event,
event->key.string = g_strdup (buf);
event->key.length = charcount;
return_val = window_private && !window_private->destroyed;
if (!return_val)
g_free (event->key.string);
break;
case KeyRelease:
/* Lookup the string corresponding to the given keysym.
*/
#ifdef USE_XIM
if (buf_len == 0)
{
buf_len = 128;
buf = g_new (gchar, buf_len);
}
#endif
keysym = GDK_VoidSymbol;
charcount = XLookupString (&xevent->xkey, buf, 16,
&keysym, &compose);
@@ -2028,15 +2216,13 @@ gdk_event_translate (GdkEvent *event,
event->key.length = 0;
event->key.string = NULL;
return_val = window_private && !window_private->destroyed;
break;
case ButtonPress:
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("button press[%d]:\t\twindow: %ld x,y: %d %d button: %d",
window_private?window_private->dnd_drag_enabled:0,
g_message ("button press:\t\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window - base_id,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
@@ -2044,7 +2230,10 @@ gdk_event_translate (GdkEvent *event,
if (window_private &&
(window_private->extension_events != 0) &&
gdk_input_ignore_core)
break;
{
return_val = FALSE;
break;
}
event->button.type = GDK_BUTTON_PRESS;
event->button.window = window;
@@ -2097,15 +2286,13 @@ gdk_event_translate (GdkEvent *event,
button_number[0] = event->button.button;
}
return_val = window_private && !window_private->destroyed;
break;
case ButtonRelease:
/* Print debugging info.
*/
GDK_NOTE (EVENTS,
g_message ("button release[%d]:\twindow: %ld x,y: %d %d button: %d",
window_private?window_private->dnd_drag_enabled:0,
g_message ("button release:\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window - base_id,
xevent->xbutton.x, xevent->xbutton.y,
xevent->xbutton.button));
@@ -2113,7 +2300,10 @@ gdk_event_translate (GdkEvent *event,
if (window_private &&
(window_private->extension_events != 0) &&
gdk_input_ignore_core)
break;
{
return_val = FALSE;
break;
}
event->button.type = GDK_BUTTON_RELEASE;
event->button.window = window;
@@ -2130,8 +2320,6 @@ gdk_event_translate (GdkEvent *event,
event->button.source = GDK_SOURCE_MOUSE;
event->button.deviceid = GDK_CORE_POINTER;
return_val = window_private && !window_private->destroyed;
break;
case MotionNotify:
@@ -2146,7 +2334,10 @@ gdk_event_translate (GdkEvent *event,
if (window_private &&
(window_private->extension_events != 0) &&
gdk_input_ignore_core)
break;
{
return_val = FALSE;
break;
}
event->motion.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
@@ -2163,7 +2354,6 @@ gdk_event_translate (GdkEvent *event,
event->motion.source = GDK_SOURCE_MOUSE;
event->motion.deviceid = GDK_CORE_POINTER;
return_val = window_private && !window_private->destroyed;
break;
case EnterNotify:
@@ -2177,6 +2367,7 @@ gdk_event_translate (GdkEvent *event,
/* Tell XInput stuff about it if appropriate */
if (window_private &&
!window_private->destroyed &&
(window_private->extension_events != 0) &&
gdk_input_vtable.enter_event)
gdk_input_vtable.enter_event (&xevent->xcrossing, window);
@@ -2240,7 +2431,6 @@ gdk_event_translate (GdkEvent *event,
event->crossing.focus = xevent->xcrossing.focus;
event->crossing.state = xevent->xcrossing.state;
return_val = window_private && !window_private->destroyed;
break;
case LeaveNotify:
@@ -2310,7 +2500,6 @@ gdk_event_translate (GdkEvent *event,
event->crossing.focus = xevent->xcrossing.focus;
event->crossing.state = xevent->xcrossing.state;
return_val = window_private && !window_private->destroyed;
break;
case FocusIn:
@@ -2333,11 +2522,10 @@ gdk_event_translate (GdkEvent *event,
event->focus_change.type = GDK_FOCUS_CHANGE;
event->focus_change.window = window;
event->focus_change.in = (xevent->xany.type == FocusIn);
return_val = window_private && !window_private->destroyed;
break;
default:
;
return_val = FALSE;
}
break;
@@ -2346,8 +2534,9 @@ gdk_event_translate (GdkEvent *event,
*/
GDK_NOTE (EVENTS,
g_message ("keymap notify"));
/* Not currently handled */
return_val = FALSE;
break;
case Expose:
@@ -2358,6 +2547,7 @@ gdk_event_translate (GdkEvent *event,
xevent->xexpose.window - base_id, xevent->xexpose.count,
xevent->xexpose.x, xevent->xexpose.y,
xevent->xexpose.width, xevent->xexpose.height));
gdk_compress_exposures (xevent, window);
event->expose.type = GDK_EXPOSE;
event->expose.window = window;
@@ -2367,7 +2557,6 @@ gdk_event_translate (GdkEvent *event,
event->expose.area.height = xevent->xexpose.height;
event->expose.count = xevent->xexpose.count;
return_val = window_private && !window_private->destroyed;
break;
case GraphicsExpose:
@@ -2385,7 +2574,6 @@ gdk_event_translate (GdkEvent *event,
event->expose.area.height = xevent->xgraphicsexpose.height;
event->expose.count = xevent->xexpose.count;
return_val = window_private && !window_private->destroyed;
break;
case NoExpose:
@@ -2398,7 +2586,6 @@ gdk_event_translate (GdkEvent *event,
event->no_expose.type = GDK_NO_EXPOSE;
event->no_expose.window = window;
return_val = window_private && !window_private->destroyed;
break;
case VisibilityNotify:
@@ -2441,7 +2628,6 @@ gdk_event_translate (GdkEvent *event,
break;
}
return_val = window_private && !window_private->destroyed;
break;
case CreateNotify:
@@ -2477,7 +2663,6 @@ gdk_event_translate (GdkEvent *event,
if (xgrab_window == window_private)
xgrab_window = NULL;
return_val = window_private && !window_private->destroyed;
break;
case MapNotify:
@@ -2490,7 +2675,6 @@ gdk_event_translate (GdkEvent *event,
event->any.type = GDK_MAP;
event->any.window = window;
return_val = window_private && !window_private->destroyed;
break;
case ReparentNotify:
@@ -2499,8 +2683,9 @@ gdk_event_translate (GdkEvent *event,
GDK_NOTE (EVENTS,
g_message ("reparent notify:\twindow: %ld",
xevent->xreparent.window - base_id));
/* Not currently handled */
return_val = FALSE;
break;
case ConfigureNotify:
@@ -2545,52 +2730,50 @@ gdk_event_translate (GdkEvent *event,
xevent->xconfigure.above - base_id,
xevent->xconfigure.override_redirect));
if (window_private)
if (!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)
return_val = FALSE;
else
{
if ((window_private->extension_events != 0) &&
gdk_input_vtable.configure_event)
gdk_input_vtable.configure_event (&xevent->xconfigure, window);
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
event->configure.width = xevent->xconfigure.width;
event->configure.height = xevent->xconfigure.height;
if (window_private->window_type != GDK_WINDOW_CHILD)
if (!xevent->xconfigure.x &&
!xevent->xconfigure.y &&
!window_private->destroyed)
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
event->configure.width = xevent->xconfigure.width;
event->configure.height = xevent->xconfigure.height;
gint tx = 0;
gint ty = 0;
Window child_window = 0;
if (!xevent->xconfigure.x &&
!xevent->xconfigure.y &&
!window_private->destroyed)
{
gint tx = 0;
gint ty = 0;
Window child_window = 0;
if (!XTranslateCoordinates (window_private->xdisplay,
window_private->xwindow,
gdk_root_window,
0, 0,
&tx, &ty,
&child_window))
g_warning ("GdkWindow %ld doesn't share root windows display?",
window_private->xwindow - base_id);
event->configure.x = tx;
event->configure.y = ty;
}
else
{
event->configure.x = xevent->xconfigure.x;
event->configure.y = xevent->xconfigure.y;
}
window_private->x = event->configure.x;
window_private->y = event->configure.y;
window_private->width = xevent->xconfigure.width;
window_private->height = xevent->xconfigure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
return_val = !window_private->destroyed;
if (!XTranslateCoordinates (window_private->xdisplay,
window_private->xwindow,
gdk_root_window,
0, 0,
&tx, &ty,
&child_window))
g_warning ("GdkWindow %ld doesn't share root windows display?",
window_private->xwindow - base_id);
event->configure.x = tx;
event->configure.y = ty;
}
else
{
event->configure.x = xevent->xconfigure.x;
event->configure.y = xevent->xconfigure.y;
}
window_private->x = event->configure.x;
window_private->y = event->configure.y;
window_private->width = xevent->xconfigure.width;
window_private->height = xevent->xconfigure.height;
if (window_private->resize_count > 1)
window_private->resize_count -= 1;
}
break;
@@ -2607,7 +2790,6 @@ gdk_event_translate (GdkEvent *event,
event->property.time = xevent->xproperty.time;
event->property.state = xevent->xproperty.state;
return_val = window_private && !window_private->destroyed;
break;
case SelectionClear:
@@ -2620,7 +2802,6 @@ gdk_event_translate (GdkEvent *event,
event->selection.selection = xevent->xselectionclear.selection;
event->selection.time = xevent->xselectionclear.time;
return_val = window_private && !window_private->destroyed;
break;
case SelectionRequest:
@@ -2636,7 +2817,6 @@ gdk_event_translate (GdkEvent *event,
event->selection.requestor = xevent->xselectionrequest.requestor;
event->selection.time = xevent->xselectionrequest.time;
return_val = window_private && !window_private->destroyed;
break;
case SelectionNotify:
@@ -2652,7 +2832,6 @@ gdk_event_translate (GdkEvent *event,
event->selection.property = xevent->xselection.property;
event->selection.time = xevent->xselection.time;
return_val = window_private && !window_private->destroyed;
break;
case ColormapNotify:
@@ -2663,6 +2842,7 @@ gdk_event_translate (GdkEvent *event,
xevent->xcolormap.window - base_id));
/* Not currently handled */
return_val = FALSE;
break;
case ClientMessage:
@@ -2705,13 +2885,9 @@ gdk_event_translate (GdkEvent *event,
event->client.data_format = xevent->xclient.format;
memcpy(&event->client.data, &xevent->xclient.data,
sizeof(event->client.data));
return_val = (window != NULL);
}
}
if(window_private)
return_val = return_val && !window_private->destroyed;
break;
case MappingNotify:
@@ -2723,20 +2899,20 @@ gdk_event_translate (GdkEvent *event,
/* Let XLib know that there is a new keyboard mapping.
*/
XRefreshKeyboardMapping (&xevent->xmapping);
return_val = FALSE;
break;
default:
/* something else - (e.g., a Xinput event) */
if (window_private &&
!window_private->destroyed &&
(window_private->extension_events != 0) &&
gdk_input_vtable.other_event)
return_val = gdk_input_vtable.other_event(event, xevent, window);
else
return_val = FALSE;
return_val = return_val && !window_private->destroyed;
break;
}
@@ -3655,145 +3831,95 @@ _g_mbtowc (wchar_t *wstr, const char *str, size_t len)
#endif /* X_LOCALE */
/*
* used for debugging only
*/
#ifdef DEBUG_DND
static void
gdk_print_atom (GdkAtom anatom)
/* Sends a ClientMessage to all toplevel client windows */
gboolean
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
{
gchar *tmpstr = NULL;
tmpstr = (anatom!=None)?gdk_atom_name(anatom):"(none)";
g_message("Atom %lu has name %s", anatom, tmpstr);
if(tmpstr)
g_free(tmpstr);
}
#endif
#ifdef WE_HAVE_MOTIF_DROPS_DONE
static GdkWindow *
gdk_drop_get_real_window (GdkWindow *w,
guint16 *x,
guint16 *y)
{
GdkWindow *retval = w;
GdkWindowPrivate *awin;
GList *children;
gint16 myx = *x, myy = *y;
XEvent sev;
g_return_val_if_fail (w != NULL && x != NULL && y != NULL, NULL);
g_return_val_if_fail(event != NULL, FALSE);
myx = *x;
myy = *y;
/* Set up our event to send, with the exception of its target window */
sev.xclient.type = ClientMessage;
sev.xclient.display = gdk_display;
sev.xclient.format = event->client.data_format;
sev.xclient.window = xid;
memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
sev.xclient.message_type = event->client.message_type;
descend:
for (children = gdk_window_get_children(retval);
children && children->next;
children = children->next)
{
awin = (GdkWindowPrivate *) children->data;
if ((myx >= awin->x) && (myy >= awin->y)
&& (myx < (awin->x + awin->width))
&& (myy < (awin->y + awin->height)))
{
retval = (GdkWindow *) awin;
myx -= awin->x;
myy -= awin->y;
goto descend;
}
}
*x = myx;
*y = myy;
return retval;
}
#endif
/*
* used only by below routine and itself
*/
static Window
getchildren (Display *dpy,
Window win,
Atom wm_state_atom)
{
Window root, parent, *children, inf = 0;
Atom type = None;
unsigned int nchildren, i;
int format;
unsigned long nitems, after;
unsigned char *data;
if (XQueryTree(dpy, win, &root, &parent, &children, &nchildren) == 0)
return 0;
for (i = 0; !inf && (i < nchildren); i++)
{
XGetWindowProperty (dpy, children[i], wm_state_atom, 0, 0, False,
AnyPropertyType, &type, &format, &nitems,
&after, &data);
if (type != 0)
inf = children[i];
XFree(data);
}
for (i = 0; !inf && (i < nchildren); i++)
inf = getchildren (dpy, children[i], wm_state_atom);
if (children != None)
XFree ((char *) children);
return inf;
}
/*
* find a window with WM_STATE, else return win itself, as per ICCCM
*
* modification of the XmuClientWindow() routine from X11R6.3
*/
Window
gdk_get_client_window (Display *dpy,
Window win)
{
static Atom wm_state_atom = None;
Atom type = None;
int format;
unsigned long nitems, after;
unsigned char *data;
Window inf;
if (win == 0)
return DefaultRootWindow(dpy);
if ((wm_state_atom = XInternAtom (dpy, "WM_STATE", True)) == 0)
return win;
XGetWindowProperty (dpy, win, wm_state_atom, 0, 0, False, AnyPropertyType,
&type, &format, &nitems, &after, &data);
if (type)
{
XFree (data);
return win;
}
inf = getchildren (dpy, win, wm_state_atom);
if (inf == 0)
return win;
else
return inf;
return gdk_send_xevent (xid, False, NoEventMask, &sev);
}
/* Sends a ClientMessage to all toplevel client windows */
gboolean
gdk_event_send_client_message_to_all_recurse (XEvent *xev,
guint32 xid,
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;
gboolean send = FALSE;
gboolean found = FALSE;
if (!wm_state_atom)
wm_state_atom = gdk_atom_intern ("WM_STATE", 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;
return FALSE;
}
if (type)
{
send = TRUE;
XFree (data);
}
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;
for(i = 0; i < ret_nchildren; i++)
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
found = TRUE;
XFree(ret_children);
}
if (send || (!found && (level == 1)))
{
xev->xclient.window = xid;
gdk_send_xevent (xid, False, NoEventMask, xev);
}
return (send || found);
}
void
gdk_event_send_clientmessage_toall (GdkEvent *event)
{
XEvent sev;
Window *ret_children, ret_root, ret_parent, curwin;
unsigned int ret_nchildren;
int i;
gint old_warnings = gdk_error_warnings;
g_return_if_fail(event != NULL);
/* Set up our event to send, with the exception of its target window */
@@ -3802,22 +3928,10 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
sev.xclient.format = event->client.data_format;
memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
sev.xclient.message_type = event->client.message_type;
/* OK, we're all set, now let's find some windows to send this to */
if(XQueryTree(gdk_display, gdk_root_window, &ret_root, &ret_parent,
&ret_children, &ret_nchildren) != True)
return;
/* foreach true child window of the root window, send an event to it */
for(i = 0; i < ret_nchildren; i++) {
curwin = gdk_get_client_window(gdk_display, ret_children[i]);
sev.xclient.window = curwin;
if (!gdk_send_xevent (curwin, False, NoEventMask, &sev))
GDK_NOTE (MISC, g_message ("Sending client message %ld to %#lx failed",
event->client.message_type, curwin));
}
XFree(ret_children);
gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, 0);
gdk_error_warnings = old_warnings;
}
gchar *
+15 -49
View File
@@ -22,16 +22,8 @@
#include "gdk.h"
#include "gdkprivate.h"
#define Xmalloc g_malloc
#define Xfree g_free
#define Xrealloc g_realloc
#include "Region.c"
#include "PolyReg.c"
#undef Xmalloc
#undef Xfree
#undef Xrealloc
GdkRegion*
gdk_region_new (void)
@@ -40,7 +32,7 @@ gdk_region_new (void)
GdkRegion *region;
Region xregion;
xregion = GXCreateRegion();
xregion = XCreateRegion();
private = g_new (GdkRegionPrivate, 1);
private->xregion = xregion;
region = (GdkRegion*) private;
@@ -57,7 +49,7 @@ gdk_region_destroy (GdkRegion *region)
g_return_if_fail (region != NULL);
private = (GdkRegionPrivate *) region;
GXDestroyRegion (private->xregion);
XDestroyRegion (private->xregion);
g_free (private);
}
@@ -71,7 +63,7 @@ gdk_region_empty (GdkRegion *region)
private = (GdkRegionPrivate *) region;
return GXEmptyRegion (private->xregion);
return XEmptyRegion (private->xregion);
}
gboolean
@@ -87,7 +79,7 @@ gdk_region_equal (GdkRegion *region1,
private1 = (GdkRegionPrivate *) region1;
private2 = (GdkRegionPrivate *) region2;
return GXEqualRegion (private1->xregion, private2->xregion);
return XEqualRegion (private1->xregion, private2->xregion);
}
void
@@ -101,7 +93,7 @@ gdk_region_get_clipbox(GdkRegion *region,
g_return_if_fail(rectangle != NULL);
rp = (GdkRegionPrivate *)region;
GXClipBox(rp->xregion, &r);
XClipBox(rp->xregion, &r);
rectangle->x = r.x;
rectangle->y = r.y;
@@ -120,7 +112,7 @@ gdk_region_point_in (GdkRegion *region,
private = (GdkRegionPrivate *) region;
return GXPointInRegion (private->xregion, x, y);
return XPointInRegion (private->xregion, x, y);
}
GdkOverlapType
@@ -134,7 +126,7 @@ gdk_region_rect_in (GdkRegion *region,
private = (GdkRegionPrivate *) region;
res = GXRectInRegion (private->xregion, rect->x, rect->y, rect->width, rect->height);
res = XRectInRegion (private->xregion, rect->x, rect->y, rect->width, rect->height);
switch (res)
{
@@ -170,7 +162,7 @@ gdk_region_polygon (GdkPoint *points,
break;
}
xregion = GXPolygonRegion ((XPoint *) points, npoints, xfill_rule);
xregion = XPolygonRegion ((XPoint *) points, npoints, xfill_rule);
private = g_new (GdkRegionPrivate, 1);
private->xregion = xregion;
region = (GdkRegion *) private;
@@ -190,7 +182,7 @@ gdk_region_offset (GdkRegion *region,
private = (GdkRegionPrivate *) region;
GXOffsetRegion (private->xregion, dx, dy);
XOffsetRegion (private->xregion, dx, dy);
}
void
@@ -204,7 +196,7 @@ gdk_region_shrink (GdkRegion *region,
private = (GdkRegionPrivate *) region;
GXShrinkRegion (private->xregion, dx, dy);
XShrinkRegion (private->xregion, dx, dy);
}
GdkRegion*
@@ -228,7 +220,7 @@ gdk_region_union_with_rect (GdkRegion *region,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXUnionRectWithRegion (&xrect, private->xregion, res_private->xregion);
XUnionRectWithRegion (&xrect, private->xregion, res_private->xregion);
return res;
}
@@ -251,7 +243,7 @@ gdk_regions_intersect (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXIntersectRegion (private1->xregion, private2->xregion, res_private->xregion);
XIntersectRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
@@ -274,7 +266,7 @@ gdk_regions_union (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXUnionRegion (private1->xregion, private2->xregion, res_private->xregion);
XUnionRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
@@ -297,7 +289,7 @@ gdk_regions_subtract (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXSubtractRegion (private1->xregion, private2->xregion, res_private->xregion);
XSubtractRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
@@ -320,36 +312,10 @@ gdk_regions_xor (GdkRegion *source1,
res = gdk_region_new ();
res_private = (GdkRegionPrivate *) res;
GXXorRegion (private1->xregion, private2->xregion, res_private->xregion);
XXorRegion (private1->xregion, private2->xregion, res_private->xregion);
return res;
}
GdkRectangle*
gdk_region_get_rectangles(GdkRegion *region, gint *nrects)
{
GdkRectangle *result;
GdkRegionPrivate *private;
struct _XRegion *r;
gint i;
g_return_val_if_fail (region != NULL, NULL);
private = (GdkRegionPrivate *) region;
r = (struct _XRegion*) private->xregion;
if (nrects)
*nrects = r->numRects;
if (!r->numRects)
return NULL;
result = g_new(GdkRectangle, r->numRects);
for ( i=0; i < r->numRects; ++i ) {
result[i].x = r->rects[i].x1;
result[i].y = r->rects[i].y1;
result[i].width = r->rects[i].x2 - r->rects[i].x1;
result[i].height = r->rects[i].y2 - r->rects[i].y1;
}
return result;
}
+362 -54
View File
@@ -58,6 +58,7 @@ int event_mask_table[20] =
SubstructureNotifyMask
};
static gboolean gdk_window_have_shape_ext (void);
/* internal function created for and used by gdk_window_xid_at_coords */
Window
@@ -285,14 +286,6 @@ gdk_window_new (GdkWindow *parent,
private->height = (attributes->height > 1) ? (attributes->height) : (1);
private->window_type = attributes->window_type;
private->extension_events = FALSE;
private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail =
private->dnd_drop_data_typesavail = NULL;
private->dnd_drop_enabled = private->dnd_drag_enabled =
private->dnd_drag_accepted = private->dnd_drag_datashow =
private->dnd_drop_data_numtypesavail =
private->dnd_drag_data_numtypesavail = 0;
private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
private->filters = NULL;
private->children = NULL;
@@ -374,9 +367,6 @@ gdk_window_new (GdkWindow *parent,
case GDK_WINDOW_PIXMAP:
g_error ("cannot make windows of type GDK_WINDOW_PIXMAP (use gdk_pixmap_new)");
break;
case GDK_WINDOW_DRAWABLE:
g_error ("cannot make windows of type GDK_WINDOW_DRAWABLE (use the drawable-specific functions)");
break;
}
}
else
@@ -509,15 +499,6 @@ gdk_window_foreign_new (guint32 anid)
private->colormap = NULL;
private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail =
private->dnd_drop_data_typesavail = NULL;
private->dnd_drop_enabled = private->dnd_drag_enabled =
private->dnd_drag_accepted = private->dnd_drag_datashow =
private->dnd_drop_data_numtypesavail =
private->dnd_drag_data_numtypesavail = 0;
private->dnd_drag_eventmask = private->dnd_drag_savedeventmask = 0;
private->filters = NULL;
private->children = NULL;
@@ -587,17 +568,6 @@ gdk_window_internal_destroy (GdkWindow *window, gboolean xdestroy,
if (private->extension_events != 0)
gdk_input_window_destroy (window);
if(private->dnd_drag_data_numtypesavail > 0)
{
g_free (private->dnd_drag_data_typesavail);
private->dnd_drag_data_typesavail = NULL;
}
if(private->dnd_drop_data_numtypesavail > 0)
{
g_free (private->dnd_drop_data_typesavail);
private->dnd_drop_data_typesavail = NULL;
}
if (private->filters)
{
tmp = private->filters;
@@ -653,11 +623,6 @@ gdk_window_internal_destroy (GdkWindow *window, gboolean xdestroy,
case GDK_WINDOW_PIXMAP:
g_error ("called gdk_window_destroy on a pixmap (use gdk_pixmap_unref)");
break;
case GDK_WINDOW_DRAWABLE:
if (private->engine->destroy)
private->engine->destroy(window);
break;
}
}
@@ -1637,6 +1602,24 @@ gdk_window_add_colormap_windows (GdkWindow *window)
XFree (old_windows);
}
static gboolean
gdk_window_have_shape_ext (void)
{
enum { UNKNOWN, NO, YES };
static gint have_shape = UNKNOWN;
if (have_shape == UNKNOWN)
{
int ignore;
if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
have_shape = YES;
else
have_shape = NO;
}
return (have_shape == YES);
}
/*
* This needs the X11 shape extension.
* If not available, shaped windows will look
@@ -1647,31 +1630,18 @@ gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask,
gint x, gint y)
{
enum { UNKNOWN, NO, YES };
static gint have_shape = UNKNOWN;
GdkWindowPrivate *window_private;
Pixmap pixmap;
g_return_if_fail (window != NULL);
#ifdef HAVE_SHAPE_EXT
if (have_shape == UNKNOWN)
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (gdk_window_have_shape_ext())
{
int ignore;
if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
have_shape = YES;
else
have_shape = NO;
}
if (have_shape == YES)
{
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mask)
{
GdkWindowPrivate *pixmap_private;
@@ -1968,6 +1938,344 @@ gdk_window_get_toplevels (void)
return new_list;
}
/*
* propagate the shapes from all child windows of a GDK window to the parent
* window. Shamelessly ripped from Enlightenment's code
*
* - Raster
*/
struct _gdk_span
{
gint start;
gint end;
struct _gdk_span *next;
};
static void
gdk_add_to_span(struct _gdk_span **s, int x, int xx)
{
struct _gdk_span *ptr1, *ptr2, *noo, *ss;
gchar spanning;
ptr2 = NULL;
ptr1 = *s;
spanning = 0;
ss = NULL;
/* scan the spans for this line */
while (ptr1)
{
/* -- -> new span */
/* == -> existing span */
/* ## -> spans intersect */
/* if we are in the middle of spanning the span into the line */
if (spanning)
{
/* case: ---- ==== */
if (xx < ptr1->start - 1)
{
/* ends before next span - extend to here */
ss->end = xx;
return;
}
/* case: ----##=== */
else if (xx <= ptr1->end)
{
/* crosses into next span - delete next span and append */
ss->end = ptr1->end;
ss->next = ptr1->next;
g_free(ptr1);
return;
}
/* case: ---###--- */
else
{
/* overlaps next span - delete and keep checking */
ss->next = ptr1->next;
g_free(ptr1);
ptr1 = ss;
}
}
/* otherwise havent started spanning it in yet */
else
{
/* case: ---- ==== */
if (xx < ptr1->start - 1)
{
/* insert span here in list */
noo = g_malloc(sizeof(struct _gdk_span));
if (noo)
{
noo->start = x;
noo->end = xx;
noo->next = ptr1;
if (ptr2)
ptr2->next = noo;
else
*s = noo;
}
return;
}
/* case: ----##=== */
else if ((x < ptr1->start) && (xx <= ptr1->end))
{
/* expand this span to the left point of the new one */
ptr1->start = x;
return;
}
/* case: ===###=== */
else if ((x >= ptr1->start) && (xx <= ptr1->end))
{
/* throw the span away */
return;
}
/* case: ---###--- */
else if ((x < ptr1->start) && (xx > ptr1->end))
{
ss = ptr1;
spanning = 1;
ptr1->start = x;
ptr1->end = xx;
}
/* case: ===##---- */
else if ((x >= ptr1->start) && (x <= ptr1->end + 1) && (xx > ptr1->end))
{
ss = ptr1;
spanning = 1;
ptr1->end = xx;
}
/* case: ==== ---- */
/* case handled by next loop iteration - first case */
}
ptr2 = ptr1;
ptr1 = ptr1->next;
}
/* it started in the middle but spans beyond your current list */
if (spanning)
{
ptr2->end = xx;
return;
}
/* it does not start inside a span or in the middle, so add it to the end */
noo = g_malloc(sizeof(struct _gdk_span));
if (noo)
{
noo->start = x;
noo->end = xx;
if (ptr2)
{
noo->next = ptr2->next;
ptr2->next = noo;
}
else
{
noo->next = NULL;
*s = noo;
}
}
return;
}
static void
gdk_add_rectangles (Display *disp, Window win, struct _gdk_span **spans,
gint basew, gint baseh, gint x, gint y)
{
gint a, k;
gint x1, y1, x2, y2;
gint rn, ord;
XRectangle *rl;
rl = XShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord);
if (rl)
{
/* go through all clip rects in this window's shape */
for (k = 0; k < rn; k++)
{
/* for each clip rect, add it to each line's spans */
x1 = x + rl[k].x;
x2 = x + rl[k].x + (rl[k].width - 1);
y1 = y + rl[k].y;
y2 = y + rl[k].y + (rl[k].height - 1);
if (x1 < 0)
x1 = 0;
if (y1 < 0)
y1 = 0;
if (x2 >= basew)
x2 = basew - 1;
if (y2 >= baseh)
y2 = baseh - 1;
for (a = y1; a <= y2; a++)
{
if ((x2 - x1) >= 0)
gdk_add_to_span(&spans[a], x1, x2);
}
}
XFree(rl);
}
}
static void
gdk_propagate_shapes(Display *disp, Window win, gboolean merge)
{
Window rt, par, *list = NULL;
gint i, j, num = 0, num_rects = 0;
gint x, y, contig;
guint w, h, d;
gint baseh, basew;
XRectangle *rects = NULL;
struct _gdk_span **spans = NULL, *ptr1, *ptr2, *ptr3;
XWindowAttributes xatt;
XGetGeometry(disp, win, &rt, &x, &y, &w, &h, &d, &d);
if (h <= 0)
return;
basew = w;
baseh = h;
spans = g_malloc(sizeof(struct _gdk_span *) * h);
for (i = 0; i < h; i++)
spans[i] = NULL;
XQueryTree(disp, win, &rt, &par, &list, (unsigned int *)&num);
if (list)
{
/* go through all child windows and create/insert spans */
for (i = 0; i < num; i++)
{
if (XGetWindowAttributes(disp, list[i], &xatt) && (xatt.map_state != IsUnmapped))
if (XGetGeometry(disp, list[i], &rt, &x, &y, &w, &h, &d, &d))
gdk_add_rectangles (disp, list[i], spans, basew, baseh, x, y);
}
if (merge)
gdk_add_rectangles (disp, win, spans, basew, baseh, x, y);
/* go through the spans list and build a list of rects */
rects = g_malloc(sizeof(XRectangle) * 256);
num_rects = 0;
for (i = 0; i < baseh; i++)
{
ptr1 = spans[i];
/* go through the line for all spans */
while (ptr1)
{
rects[num_rects].x = ptr1->start;
rects[num_rects].y = i;
rects[num_rects].width = ptr1->end - ptr1->start + 1;
rects[num_rects].height = 1;
j = i + 1;
/* if there are more lines */
contig = 1;
/* while contigous rects (same start/end coords) exist */
while ((contig) && (j < baseh))
{
/* search next line for spans matching this one */
contig = 0;
ptr2 = spans[j];
ptr3 = NULL;
while (ptr2)
{
/* if we have an exact span match set contig */
if ((ptr2->start == ptr1->start) &&
(ptr2->end == ptr1->end))
{
contig = 1;
/* remove the span - not needed */
if (ptr3)
{
ptr3->next = ptr2->next;
g_free(ptr2);
ptr2 = NULL;
}
else
{
spans[j] = ptr2->next;
g_free(ptr2);
ptr2 = NULL;
}
break;
}
/* gone past the span point no point looking */
else if (ptr2->start < ptr1->start)
break;
if (ptr2)
{
ptr3 = ptr2;
ptr2 = ptr2->next;
}
}
/* if a contiguous span was found increase the rect h */
if (contig)
{
rects[num_rects].height++;
j++;
}
}
/* up the rect count */
num_rects++;
/* every 256 new rects increase the rect array */
if ((num_rects % 256) == 0)
rects = g_realloc(rects, sizeof(XRectangle) * (num_rects + 256));
ptr1 = ptr1->next;
}
}
/* set the rects as the shape mask */
if (rects)
{
XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, num_rects,
ShapeSet, YXSorted);
g_free(rects);
}
XFree(list);
}
/* free up all the spans we made */
for (i = 0; i < baseh; i++)
{
ptr1 = spans[i];
while (ptr1)
{
ptr2 = ptr1;
ptr1 = ptr1->next;
g_free(ptr2);
}
}
g_free(spans);
}
void
gdk_window_set_child_shapes (GdkWindow *window)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
#ifdef HAVE_SHAPE_EXT
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
if (gdk_window_have_shape_ext())
gdk_propagate_shapes (private->xdisplay, private->xwindow, FALSE);
#endif
}
void
gdk_window_merge_child_shapes (GdkWindow *window)
{
GdkWindowPrivate *private;
g_return_if_fail (window != NULL);
#ifdef HAVE_SHAPE_EXT
private = (GdkWindowPrivate*) window;
if (private->destroyed)
return;
if (gdk_window_have_shape_ext())
gdk_propagate_shapes (private->xdisplay, private->xwindow, TRUE);
#endif
}
void
gdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,
+1 -1
View File
@@ -1,5 +1,5 @@
# Note that this is NOT a relocatable package
%define ver 1.1.2
%define ver 1.1.3
%define rel SNAP
%define prefix /usr
+1 -1
View File
@@ -64,7 +64,7 @@ while test $# -gt 0; do
fi
fi
done
echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @x_libs@ -lm
echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @x_libs@ @GDK_WLIBS@ -lm
;;
*)
echo "${usage}" 1>&2
-1
View File
@@ -9,7 +9,6 @@ testgtk
testinput
testselection
testrgb
testps
simple
testtree
gtkfeatures.h
+17 -12
View File
@@ -5,7 +5,7 @@ DEFS += -DG_LOG_DOMAIN=\"Gtk\"
lib_LTLIBRARIES = libgtk.la
libgtk_la_SOURCES = \
static_sources = \
gtkaccelgroup.c \
gtkaccellabel.c \
gtkadjustment.c \
@@ -31,6 +31,7 @@ libgtk_la_SOURCES = \
gtkdialog.c \
gtkdnd.c \
gtkdrawingarea.c \
gtkdrawwindow.c \
gtkeditable.c \
gtkentry.c \
gtkeventbox.c \
@@ -57,7 +58,6 @@ libgtk_la_SOURCES = \
gtklist.c \
gtklistitem.c \
gtkmain.c \
gtkmarshal.c \
gtkmenu.c \
gtkmenubar.c \
gtkmenufactory.c \
@@ -90,6 +90,7 @@ libgtk_la_SOURCES = \
gtktable.c \
gtktearoffmenuitem.c \
gtktext.c \
gtkthemes.c \
gtktipsquery.c \
gtktogglebutton.c \
gtktoolbar.c \
@@ -110,6 +111,10 @@ libgtk_la_SOURCES = \
fnmatch.c \
fnmatch.h
libgtk_la_SOURCES = \
$(static_sources) \
gtkmarshal.c
# Source headers are are non-autogenerated headers
source_headers = \
gtk.h \
@@ -139,6 +144,7 @@ source_headers = \
gtkdialog.h \
gtkdnd.h \
gtkdrawingarea.h \
gtkdrawwindow.h \
gtkeditable.h \
gtkentry.h \
gtkenums.h \
@@ -199,6 +205,7 @@ source_headers = \
gtktable.h \
gtktearoffmenuitem.h \
gtktext.h \
gtkthemes.h \
gtktipsquery.h \
gtktogglebutton.h \
gtktoolbar.h \
@@ -231,6 +238,9 @@ BUILT_SOURCES = \
gtkmarshal.c \
gtkmarshal.h
# 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 \
@@ -271,10 +281,6 @@ gtktypebuiltins_evals.c: @REBUILD@ makeenums.pl gtk.defs
gtkmarshal.c gtkmarshal.h: @REBUILD@ gtkmarshal.list genmarshal.pl
srcdir=$(srcdir) INDENT=$(INDENT) $(PERL) $(srcdir)/genmarshal.pl
# ???
# special remake rules
# makeenums.h: @REBUILD@ gtk.h gtkprivate.h
libgtk_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE)
@@ -308,11 +314,12 @@ EXTRA_DIST = \
tree_minus.xbm \
circles.xbm
INCLUDES = -I$(top_srcdir) @GLIB_CFLAGS@ @x_cflags@
INCLUDES = \
-DGTK_EXE_PREFIX=\"$(exec_prefix)\" \
-DGTK_DATA_PREFIX=\"$(prefix)\" \
-I$(top_srcdir) @GLIB_CFLAGS@ @x_cflags@
noinst_PROGRAMS = testgtk testinput testselection testthreads testrgb testdnd simple testps
# FIXME, we currently rely on linking against libglib-1.1
noinst_PROGRAMS = testgtk testinput testselection testthreads testrgb testdnd simple
DEPS = \
libgtk.la \
@@ -333,7 +340,6 @@ testselection_DEPENDENCIES = $(DEPS)
testrgb_DEPENDENCIES = $(DEPS)
testdnd_DEPENDENCIES = $(DEPS)
simple_DEPENDENCIES = $(DEPS)
testps_DEPENDENCIES = $(DEPS)
testgtk_LDADD = $(LDADDS)
testinput_LDADD = $(LDADDS)
@@ -342,7 +348,6 @@ testselection_LDADD = $(LDADDS)
testrgb_LDADD = $(LDADDS)
testdnd_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
testps_LDADD = $(LDADDS)
.PHONY: files test test-debug
-1
View File
@@ -45,7 +45,6 @@ print OH <<EOT;
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
#define gtk_signal_default_marshaller gtk_marshal_NONE__NONE
+2
View File
@@ -46,6 +46,7 @@
#include <gtk/gtkdialog.h>
#include <gtk/gtkdnd.h>
#include <gtk/gtkdrawingarea.h>
#include <gtk/gtkdrawwindow.h>
#include <gtk/gtkeditable.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkenums.h>
@@ -105,6 +106,7 @@
#include <gtk/gtktable.h>
#include <gtk/gtktearoffmenuitem.h>
#include <gtk/gtktext.h>
#include <gtk/gtkthemes.h>
#include <gtk/gtktipsquery.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtktoolbar.h>
+6 -11
View File
@@ -172,14 +172,7 @@ gtk_arrow_set (GtkArrow *arrow,
arrow->shadow_type = shadow_type;
if (GTK_WIDGET_DRAWABLE (arrow))
{
gdk_window_clear_area (GTK_WIDGET (arrow)->window,
GTK_WIDGET (arrow)->allocation.x,
GTK_WIDGET (arrow)->allocation.y,
GTK_WIDGET (arrow)->allocation.width,
GTK_WIDGET (arrow)->allocation.height);
gtk_widget_queue_draw (GTK_WIDGET (arrow));
}
gtk_widget_queue_clear (GTK_WIDGET (arrow));
}
}
@@ -227,9 +220,11 @@ gtk_arrow_expose (GtkWidget *widget,
shadow_type = GTK_SHADOW_ETCHED_IN;
}
gtk_draw_arrow (widget->style, widget->window,
widget->state, shadow_type, arrow->arrow_type, TRUE,
x, y, extent, extent);
gtk_paint_arrow (widget->style, widget->window,
widget->state, shadow_type,
&event->area, widget, "arrow",
arrow->arrow_type, TRUE,
x, y, extent, extent);
}
return TRUE;
+29 -25
View File
@@ -135,11 +135,7 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
aspect_frame->obey_child = obey_child;
if (GTK_WIDGET_DRAWABLE(widget))
gdk_window_clear_area (widget->window,
widget->allocation.x,
widget->allocation.y,
widget->allocation.width,
widget->allocation.height);
gtk_widget_queue_clear (widget);
gtk_widget_queue_resize (widget);
}
@@ -152,7 +148,7 @@ gtk_aspect_frame_paint (GtkWidget *widget,
GtkFrame *frame;
gint height_extra;
gint label_area_width;
gint x, y;
gint x, y, x2, y2;
GtkAllocation *allocation;
g_return_if_fail (widget != NULL);
@@ -170,32 +166,40 @@ gtk_aspect_frame_paint (GtkWidget *widget,
x = GTK_CONTAINER (frame)->border_width;
y = GTK_CONTAINER (frame)->border_width;
gtk_draw_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
allocation->x + x,
allocation->y + y + height_extra / 2,
allocation->width - x * 2,
allocation->height - y * 2 - height_extra / 2);
if (frame->label)
{
label_area_width = (allocation->width +
GTK_CONTAINER (frame)->border_width * 2 -
widget->style->klass->xthickness * 2);
x = ((label_area_width - frame->label_width) * frame->label_xalign +
GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
y = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
gdk_window_clear_area (widget->window,
allocation->x + x + 2,
allocation->y + GTK_CONTAINER (frame)->border_width,
frame->label_width - 4, frame->label_height);
gtk_draw_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
allocation->x + x + 3,
allocation->y + y,
frame->label);
x2 = ((label_area_width - frame->label_width) * frame->label_xalign +
GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
y2 = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
gtk_paint_shadow_gap (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
allocation->x + x,
allocation->y + y + height_extra / 2,
allocation->width - x * 2,
allocation->height - y * 2 - height_extra / 2,
GTK_POS_TOP,
x2 + 2 - x, frame->label_width - 4);
gtk_paint_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
area, widget, "frame",
allocation->x + x2 + 3,
allocation->y + y2,
frame->label);
}
else
gtk_paint_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
allocation->x + x,
allocation->y + y + height_extra / 2,
allocation->width - x * 2,
allocation->height - y * 2 - height_extra / 2);
}
}
+1 -5
View File
@@ -142,11 +142,7 @@ gtk_bin_unmap (GtkWidget *widget)
bin = GTK_BIN (widget);
if (GTK_WIDGET_NO_WINDOW (widget))
gdk_window_clear_area (widget->window,
widget->allocation.x,
widget->allocation.y,
widget->allocation.width,
widget->allocation.height);
gtk_widget_queue_clear (widget);
else
gdk_window_hide (widget->window);
+4 -4
View File
@@ -638,20 +638,20 @@ gtk_box_draw (GtkWidget *widget,
GtkBoxChild *child;
GdkRectangle child_area;
GList *children;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BOX (widget));
if (GTK_WIDGET_DRAWABLE (widget))
{
box = GTK_BOX (widget);
children = box->children;
while (children)
{
child = children->data;
children = children->next;
if (gtk_widget_intersect (child->widget, area, &child_area))
gtk_widget_draw (child->widget, &child_area);
}
+60 -188
View File
@@ -507,92 +507,73 @@ static void
gtk_button_paint (GtkWidget *widget,
GdkRectangle *area)
{
GdkRectangle restrict_area;
GdkRectangle outer_area;
GdkRectangle tmp_area;
GdkRectangle new_area;
gint xthickness;
gint ythickness;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BUTTON (widget));
xthickness = widget->style->klass->xthickness;
ythickness = widget->style->klass->ythickness;
GtkButton *button;
GtkShadowType shadow_type;
gint width, height;
gint x, y;
if (GTK_WIDGET_DRAWABLE (widget))
{
restrict_area.x = xthickness;
restrict_area.y = ythickness;
restrict_area.width = GTK_WIDGET (widget)->allocation.width -
restrict_area.x * 2 - GTK_CONTAINER (widget)->border_width * 2;
restrict_area.height = GTK_WIDGET (widget)->allocation.height -
restrict_area.y * 2 - GTK_CONTAINER (widget)->border_width * 2;
button = GTK_BUTTON (widget);
x = 0;
y = 0;
width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
outer_area = restrict_area;
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
if (GTK_WIDGET_CAN_DEFAULT (widget))
if (GTK_WIDGET_HAS_DEFAULT (widget) &&
GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL)
{
restrict_area.x += DEFAULT_LEFT_POS;
restrict_area.y += DEFAULT_TOP_POS;
restrict_area.width -= DEFAULT_SPACING;
restrict_area.height -= DEFAULT_SPACING;
}
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
{
if ((GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) &&
(GTK_BUTTON (widget)->relief != GTK_RELIEF_NORMAL))
gtk_style_set_background (widget->style, widget->window,
GTK_BUTTON (widget)->relief == GTK_RELIEF_NONE ? GTK_STATE_NORMAL : GTK_WIDGET_STATE (widget));
else
gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (widget));
gdk_window_clear_area (widget->window,
new_area.x, new_area.y,
new_area.width, new_area.height);
gtk_paint_box (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
area, widget, "buttondefault",
x, y, width, height);
}
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
/* Now fill spacing area between the default border and the button */
x += widget->style->klass->xthickness;
y += widget->style->klass->ythickness;
width -= 2 * x + DEFAULT_SPACING;
height -= 2 * y + DEFAULT_SPACING;
x += DEFAULT_LEFT_POS;
y += DEFAULT_TOP_POS;
}
if (GTK_WIDGET_HAS_FOCUS (widget))
{
x += 1;
y += 1;
width -= 2;
height -= 2;
}
if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;
/* 1 */ tmp_area = outer_area;
tmp_area.width = restrict_area.x - outer_area.x;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
/* 2 */ tmp_area.x = restrict_area.x + restrict_area.width;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
/* 3 */ tmp_area.width = restrict_area.width;
tmp_area.height = restrict_area.y - outer_area.y;
tmp_area.x = restrict_area.x;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
/* 4 */ tmp_area.y = restrict_area.y + restrict_area.height;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
if ((button->relief != GTK_RELIEF_NONE) ||
((GTK_WIDGET_STATE(widget) != GTK_STATE_NORMAL) &&
(GTK_WIDGET_STATE(widget) != GTK_STATE_INSENSITIVE)))
gtk_paint_box (widget->style, widget->window,
GTK_WIDGET_STATE (widget),
shadow_type, area, widget, "button",
x, y, width, height);
if (GTK_WIDGET_HAS_FOCUS (widget))
{
x -= 1;
y -= 1;
width += 2;
height += 2;
gtk_paint_focus (widget->style, widget->window,
area, widget, "button",
x, y, width - 1, height - 1);
}
}
}
@@ -621,125 +602,19 @@ gtk_button_draw (GtkWidget *widget,
if (GTK_BIN (button)->child && gtk_widget_intersect (GTK_BIN (button)->child, &tmp_area, &child_area))
gtk_widget_draw (GTK_BIN (button)->child, &child_area);
gtk_widget_draw_default (widget);
gtk_widget_draw_focus (widget);
}
}
static void
gtk_button_draw_focus (GtkWidget *widget)
{
GtkButton *button;
GtkShadowType shadow_type;
gint width, height;
gint x, y;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BUTTON (widget));
if (GTK_WIDGET_DRAWABLE (widget))
{
button = GTK_BUTTON (widget);
x = 0;
y = 0;
width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
x += widget->style->klass->xthickness;
y += widget->style->klass->ythickness;
width -= 2 * x + DEFAULT_SPACING;
height -= 2 * y + DEFAULT_SPACING;
x += DEFAULT_LEFT_POS;
y += DEFAULT_TOP_POS;
}
if (GTK_WIDGET_HAS_FOCUS (widget))
{
x += 1;
y += 1;
width -= 2;
height -= 2;
}
else
{
if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
x + 1, y + 1, width - 4, height - 4);
else if (button->relief == GTK_RELIEF_NORMAL)
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
x + 2, y + 2, width - 5, height - 5);
else
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
x, y, width - 1, height - 1);
}
if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;
if ((button->relief == GTK_RELIEF_NORMAL) ||
((GTK_WIDGET_STATE (widget) != GTK_STATE_NORMAL) &&
(GTK_WIDGET_STATE (widget) != GTK_STATE_INSENSITIVE)))
{
gtk_draw_shadow (widget->style, widget->window,
button->relief == GTK_RELIEF_NONE ? GTK_STATE_NORMAL : GTK_WIDGET_STATE (widget),
shadow_type,
x, y, width, height);
}
if (GTK_WIDGET_HAS_FOCUS (widget))
{
x -= 1;
y -= 1;
width += 2;
height += 2;
gdk_draw_rectangle (widget->window,
widget->style->black_gc, FALSE,
x, y, width - 1, height - 1);
}
}
gtk_widget_draw (widget, NULL);
}
static void
gtk_button_draw_default (GtkWidget *widget)
{
gint width, height;
gint x, y;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BUTTON (widget));
if (GTK_WIDGET_DRAWABLE (widget))
{
x = 0;
y = 0;
width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
height = widget->allocation.height - GTK_CONTAINER (widget)->border_width * 2;
if (GTK_WIDGET_HAS_DEFAULT (widget) &&
GTK_BUTTON (widget)->relief == GTK_RELIEF_NORMAL)
{
gtk_draw_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
x, y, width, height);
}
else
{
gdk_draw_rectangle (widget->window, widget->style->bg_gc[GTK_STATE_NORMAL],
FALSE, x, y, width - 1, height - 1);
gdk_draw_rectangle (widget->window, widget->style->bg_gc[GTK_STATE_NORMAL],
FALSE, x + 1, y + 1, width - 3, height - 3);
}
}
gtk_widget_draw (widget, NULL);
}
static gint
@@ -756,16 +631,13 @@ gtk_button_expose (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
button = GTK_BUTTON (widget);
gtk_button_paint (widget, &event->area);
child_event = *event;
if (GTK_BIN (button)->child && GTK_WIDGET_NO_WINDOW (GTK_BIN (button)->child) &&
gtk_widget_intersect (GTK_BIN (button)->child, &event->area, &child_event.area))
gtk_widget_event (GTK_BIN (button)->child, (GdkEvent*) &child_event);
gtk_widget_draw_default (widget);
gtk_widget_draw_focus (widget);
}
return FALSE;
+60 -58
View File
@@ -42,7 +42,6 @@ static void gtk_check_button_draw_indicator (GtkCheckButton *check_but
static void gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
GdkRectangle *area);
static GtkToggleButtonClass *parent_class = NULL;
@@ -84,7 +83,7 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
widget_class->size_request = gtk_check_button_size_request;
widget_class->size_allocate = gtk_check_button_size_allocate;
widget_class->expose_event = gtk_check_button_expose;
class->indicator_size = INDICATOR_SIZE;
class->indicator_spacing = INDICATOR_SPACING;
class->draw_indicator = gtk_real_check_button_draw_indicator;
@@ -93,6 +92,7 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
static void
gtk_check_button_init (GtkCheckButton *check_button)
{
GTK_WIDGET_SET_FLAGS (check_button, GTK_NO_WINDOW);
check_button->toggle_button.draw_indicator = TRUE;
}
@@ -137,15 +137,23 @@ gtk_check_button_draw (GtkWidget *widget,
if (check_button->toggle_button.draw_indicator)
{
button = GTK_BUTTON (widget);
gint border_width;
button = GTK_BUTTON (widget);
gtk_check_button_draw_indicator (check_button, area);
border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_HAS_FOCUS (widget))
gtk_paint_focus (widget->style, widget->window,
NULL, widget, "checkbutton",
border_width + widget->allocation.x,
border_width + widget->allocation.y,
widget->allocation.width - 2 * border_width - 1,
widget->allocation.height - 2 * border_width - 1);
if (GTK_BIN (button)->child && GTK_WIDGET_NO_WINDOW (GTK_BIN (button)->child) &&
gtk_widget_intersect (GTK_BIN (button)->child, area, &child_area))
gtk_widget_draw (GTK_BIN (button)->child, &child_area);
gtk_widget_draw_focus (widget);
}
else
{
@@ -158,38 +166,17 @@ gtk_check_button_draw (GtkWidget *widget,
static void
gtk_check_button_draw_focus (GtkWidget *widget)
{
GtkCheckButton *check_button;
gint border_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
if (GTK_WIDGET_DRAWABLE (widget))
{
check_button = GTK_CHECK_BUTTON (widget);
if (check_button->toggle_button.draw_indicator)
{
gint border_width;
border_width = GTK_CONTAINER (widget)->border_width;
if (GTK_WIDGET_HAS_FOCUS (widget))
gdk_draw_rectangle (widget->window,
widget->style->black_gc, FALSE,
border_width, border_width,
widget->allocation.width - 2 * border_width - 1,
widget->allocation.height - 2 * border_width - 1);
else
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL], FALSE,
border_width, border_width,
widget->allocation.width - 2 * border_width - 1,
widget->allocation.height - 2 * border_width - 1);
}
else
{
if (GTK_WIDGET_CLASS (parent_class)->draw_focus)
(* GTK_WIDGET_CLASS (parent_class)->draw_focus) (widget);
}
}
border_width = GTK_CONTAINER (widget)->border_width;
gtk_widget_queue_clear_area(widget->parent,
border_width + widget->allocation.x,
border_width + widget->allocation.y,
widget->allocation.width - 2 * border_width,
widget->allocation.height - 2 * border_width);
}
static void
@@ -227,19 +214,21 @@ gtk_check_button_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkCheckButton *check_button;
GtkToggleButton *toggle_button;
GtkButton *button;
GtkAllocation child_allocation;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
g_return_if_fail (allocation != NULL);
check_button = GTK_CHECK_BUTTON (widget);
toggle_button = GTK_TOGGLE_BUTTON (widget);
if (check_button->toggle_button.draw_indicator)
{
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (widget->window,
gdk_window_move_resize (toggle_button->event_window,
allocation->x, allocation->y,
allocation->width, allocation->height);
@@ -249,11 +238,16 @@ gtk_check_button_size_allocate (GtkWidget *widget,
{
child_allocation.x = (GTK_CONTAINER (widget)->border_width +
CHECK_BUTTON_CLASS (widget)->indicator_size +
CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1);
child_allocation.y = GTK_CONTAINER (widget)->border_width + 1;
child_allocation.width = MAX (1, allocation->width - child_allocation.x -
CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1 +
widget->allocation.x);
child_allocation.y = GTK_CONTAINER (widget)->border_width + 1 +
widget->allocation.y;
child_allocation.width = MAX (1, allocation->width -
(GTK_CONTAINER (widget)->border_width +
CHECK_BUTTON_CLASS (widget)->indicator_size +
CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1) -
GTK_CONTAINER (widget)->border_width - 1);
child_allocation.height = MAX (1, allocation->height - child_allocation.y * 2);
child_allocation.height = MAX (1, allocation->height - (GTK_CONTAINER (widget)->border_width + 1) * 2);
gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation);
}
@@ -333,34 +327,43 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
GdkRectangle new_area;
gint width, height;
gint x, y;
GdkWindow *window;
g_return_if_fail (check_button != NULL);
g_return_if_fail (GTK_IS_CHECK_BUTTON (check_button));
if (GTK_WIDGET_DRAWABLE (check_button))
{
widget = GTK_WIDGET (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);
state_type = GTK_WIDGET_STATE (widget);
window = widget->window;
if (!window)
return;
state_type = GTK_WIDGET_STATE (widget);
if ((state_type != GTK_STATE_NORMAL) &&
(state_type != GTK_STATE_PRELIGHT))
state_type = GTK_STATE_NORMAL;
restrict_area.x = GTK_CONTAINER (widget)->border_width;
restrict_area.y = restrict_area.x;
restrict_area.width = widget->allocation.width - restrict_area.x * 2;
restrict_area.height = widget->allocation.height - restrict_area.x * 2;
restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
restrict_area.width = widget->allocation.width - ( 2 * GTK_CONTAINER (widget)->border_width);
restrict_area.height = widget->allocation.height - ( 2 * GTK_CONTAINER (widget)->border_width);
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
{
gtk_style_set_background (widget->style, widget->window, state_type);
gdk_window_clear_area (widget->window, new_area.x, new_area.y,
new_area.width, new_area.height);
if (state_type != GTK_STATE_NORMAL)
gtk_paint_flat_box(widget->style, window, state_type,
GTK_SHADOW_ETCHED_OUT,
area, widget, "checkbutton",
new_area.x, new_area.y,
new_area.width, new_area.height);
}
x = CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
y = (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
x = widget->allocation.x + CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
y = widget->allocation.y + (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
width = CHECK_BUTTON_CLASS (widget)->indicator_size;
height = CHECK_BUTTON_CLASS (widget)->indicator_size;
@@ -369,11 +372,10 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
else
shadow_type = GTK_SHADOW_OUT;
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_WIDGET_STATE (widget)],
TRUE, x + 1, y + 1, width, height);
gtk_draw_shadow (widget->style, widget->window,
GTK_WIDGET_STATE (widget), shadow_type,
x + 1, y + 1, width, height);
gtk_paint_check (widget->style, window,
GTK_WIDGET_STATE (widget), shadow_type,
area, widget, "checkbutton",
x + 1, y + 1, width, height);
}
}
+2 -6
View File
@@ -244,8 +244,6 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
widget->style->klass->xthickness + 2);
y = (widget->allocation.height - height) / 2;
gdk_window_clear_area (widget->window, x, y, width, height);
if (check_menu_item->active ||
check_menu_item->always_show_toggle ||
(GTK_WIDGET_STATE (check_menu_item) == GTK_STATE_PRELIGHT))
@@ -266,11 +264,9 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
shadow_type = GTK_SHADOW_OUT;
}
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[state_type],
TRUE, x, y, width, height);
gtk_draw_shadow (widget->style, widget->window,
gtk_paint_check (widget->style, widget->window,
state_type, shadow_type,
area, widget, "check",
x, y, width, height);
}
}
+402 -508
View File
File diff suppressed because it is too large Load Diff
+89 -82
View File
@@ -156,10 +156,8 @@ struct _GtkCList
gint undo_anchor;
/* scrollbars */
GtkWidget *vscrollbar;
GtkWidget *hscrollbar;
guint8 vscrollbar_policy;
guint8 hscrollbar_policy;
GtkAdjustment *hadjustment;
GtkAdjustment *vadjustment;
/* xor GC for the vertical drag line */
GdkGC *xor_gc;
@@ -184,6 +182,8 @@ struct _GtkCList
gint htimer;
gint vtimer;
GdkWindow *dummy_window;
GtkSortType sort_type;
GtkCListCompareFunc compare;
gint sort_column;
@@ -193,69 +193,67 @@ struct _GtkCListClass
{
GtkContainerClass parent_class;
void (*select_row) (GtkCList *clist,
gint row,
gint column,
GdkEvent *event);
void (*unselect_row) (GtkCList *clist,
gint row,
gint column,
GdkEvent *event);
void (*click_column) (GtkCList *clist,
gint column);
void (*resize_column) (GtkCList *clist,
gint column,
gint width);
void (*toggle_focus_row) (GtkCList *clist);
void (*select_all) (GtkCList *clist);
void (*unselect_all) (GtkCList *clist);
void (*undo_selection) (GtkCList *clist);
void (*start_selection) (GtkCList *clist);
void (*end_selection) (GtkCList *clist);
void (*extend_selection) (GtkCList *clist,
GtkScrollType scroll_type,
gfloat position,
gboolean auto_start_selection);
void (*scroll_horizontal) (GtkCList *clist,
GtkScrollType scroll_type,
gfloat position);
void (*scroll_vertical) (GtkCList *clist,
GtkScrollType scroll_type,
gfloat position);
void (*toggle_add_mode) (GtkCList *clist);
void (*abort_column_resize) (GtkCList *clist);
void (*resync_selection) (GtkCList *clist,
GdkEvent *event);
GList* (*selection_find) (GtkCList *clist,
gint row_number,
GList *row_list_element);
void (*draw_row) (GtkCList *clist,
GdkRectangle *area,
gint row,
GtkCListRow *clist_row);
void (*clear) (GtkCList *clist);
void (*fake_unselect_all) (GtkCList *clist,
gint row);
void (*sort_list) (GtkCList *clist);
gint (*insert_row) (GtkCList *clist,
gint row,
gchar *text[]);
void (*remove_row) (GtkCList *clist,
gint row);
void (*set_cell_contents) (GtkCList *clist,
GtkCListRow *clist_row,
gint column,
GtkCellType type,
const gchar *text,
guint8 spacing,
GdkPixmap *pixmap,
GdkBitmap *mask);
void (*select_row) (GtkCList *clist,
gint row,
gint column,
GdkEvent *event);
void (*unselect_row) (GtkCList *clist,
gint row,
gint column,
GdkEvent *event);
void (*click_column) (GtkCList *clist,
gint column);
void (*resize_column) (GtkCList *clist,
gint column,
gint width);
void (*toggle_focus_row) (GtkCList *clist);
void (*select_all) (GtkCList *clist);
void (*unselect_all) (GtkCList *clist);
void (*undo_selection) (GtkCList *clist);
void (*start_selection) (GtkCList *clist);
void (*end_selection) (GtkCList *clist);
void (*extend_selection) (GtkCList *clist,
GtkScrollType scroll_type,
gfloat position,
gboolean auto_start_selection);
void (*scroll_horizontal) (GtkCList *clist,
GtkScrollType scroll_type,
gfloat position);
void (*scroll_vertical) (GtkCList *clist,
GtkScrollType scroll_type,
gfloat position);
void (*toggle_add_mode) (GtkCList *clist);
void (*abort_column_resize) (GtkCList *clist);
void (*resync_selection) (GtkCList *clist,
GdkEvent *event);
GList* (*selection_find) (GtkCList *clist,
gint row_number,
GList *row_list_element);
void (*draw_row) (GtkCList *clist,
GdkRectangle *area,
gint row,
GtkCListRow *clist_row);
void (*clear) (GtkCList *clist);
void (*fake_unselect_all) (GtkCList *clist,
gint row);
void (*sort_list) (GtkCList *clist);
gint (*insert_row) (GtkCList *clist,
gint row,
gchar *text[]);
void (*remove_row) (GtkCList *clist,
gint row);
void (*set_cell_contents) (GtkCList *clist,
GtkCListRow *clist_row,
gint column,
GtkCellType type,
const gchar *text,
guint8 spacing,
GdkPixmap *pixmap,
GdkBitmap *mask);
void (*cell_size_request) (GtkCList *clist,
GtkCListRow *clist_row,
gint column,
GtkRequisition *requisition);
gint scrollbar_spacing;
};
struct _GtkCListColumn
@@ -384,13 +382,19 @@ void gtk_clist_construct (GtkCList *clist,
gchar *titles[]);
/* create a new GtkCList */
GtkWidget *gtk_clist_new (gint columns);
GtkWidget *gtk_clist_new_with_titles (gint columns,
GtkWidget* gtk_clist_new (gint columns);
GtkWidget* gtk_clist_new_with_titles (gint columns,
gchar *titles[]);
/* deprecated function, use gtk_clist_set_shadow_type instead. */
void gtk_clist_set_border (GtkCList *clist,
GtkShadowType border);
/* set adjustments of clist */
void gtk_clist_set_hadjustment (GtkCList *clist,
GtkAdjustment *adjustment);
void gtk_clist_set_vadjustment (GtkCList *clist,
GtkAdjustment *adjustment);
/* get adjustments of clist */
GtkAdjustment* gtk_clist_get_hadjustment (GtkCList *clist);
GtkAdjustment* gtk_clist_get_vadjustment (GtkCList *clist);
/* set the border style of the clist */
void gtk_clist_set_shadow_type (GtkCList *clist,
@@ -400,14 +404,6 @@ void gtk_clist_set_shadow_type (GtkCList *clist,
void gtk_clist_set_selection_mode (GtkCList *clist,
GtkSelectionMode mode);
/* set policy on the scrollbar, to either show them all the time
* or show them only when they are needed, ie., when there is more
* than one page of information
*/
void gtk_clist_set_policy (GtkCList *clist,
GtkPolicyType vscrollbar_policy,
GtkPolicyType hscrollbar_policy);
/* freeze all visual updates of the list, and then thaw the list after
* you have made a number of changes and the updates wil occure in a
* more efficent mannor than if you made them on a unfrozen list
@@ -566,20 +562,20 @@ void gtk_clist_set_background (GtkCList *clist,
/* set / get cell styles */
void gtk_clist_set_cell_style (GtkCList *clist,
gint row,
gint column,
gint row,
gint column,
GtkStyle *style);
GtkStyle *gtk_clist_get_cell_style (GtkCList *clist,
gint row,
gint column);
gint row,
gint column);
void gtk_clist_set_row_style (GtkCList *clist,
gint row,
gint row,
GtkStyle *style);
GtkStyle *gtk_clist_get_row_style (GtkCList *clist,
gint row);
gint row);
/* this sets a horizontal and vertical shift for drawing
* the contents of a cell; it can be positive or negitive;
@@ -696,6 +692,17 @@ void gtk_clist_sort (GtkCList *clist);
void gtk_clist_set_auto_sort (GtkCList *clist,
gboolean auto_sort);
/* Deprecated methods */
/* Use gtk_clist_set_shadow_type instead. */
void gtk_clist_set_border (GtkCList *clist,
GtkShadowType border);
/* Completely non-functional */
void gtk_clist_set_policy (GtkCList *clist,
GtkPolicyType vscrollbar_policy,
GtkPolicyType hscrollbar_policy);
#ifdef __cplusplus
}
#endif /* __cplusplus */
+48 -13
View File
@@ -21,6 +21,7 @@
#include <math.h>
#include <gdk/gdk.h>
#include "gtkcolorsel.h"
#include "gtkdrawwindow.h"
#include "gtkhbbox.h"
#include "gtkdnd.h"
#include "gtkselection.h"
@@ -861,7 +862,7 @@ gtk_color_selection_drag_begin (GtkWidget *widget,
gdouble colors[4];
GdkColor bg;
window = gtk_window_new(GTK_WINDOW_POPUP);
window = gtk_draw_window_new(GTK_WINDOW_POPUP);
gtk_widget_set_usize (window, 48, 32);
gtk_widget_realize (window);
@@ -1041,14 +1042,15 @@ gtk_color_selection_value_events (GtkWidget *area,
colorsel = (GtkColorSelection*) gtk_object_get_data (GTK_OBJECT (area), "_GtkColorSelection");
if (colorsel->value_gc == NULL)
colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
switch (event->type)
{
case GDK_MAP:
gtk_color_selection_draw_value_marker (colorsel);
break;
case GDK_EXPOSE:
if (colorsel->value_gc == NULL)
colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
gtk_color_selection_draw_value_marker (colorsel);
break;
case GDK_BUTTON_PRESS:
@@ -1128,7 +1130,14 @@ gtk_color_selection_wheel_events (GtkWidget *area,
gint x, y;
colorsel = (GtkColorSelection*) gtk_object_get_data (GTK_OBJECT (area), "_GtkColorSelection");
if (colorsel->wheel_gc == NULL)
colorsel->wheel_gc = gdk_gc_new (colorsel->wheel_area->window);
if (colorsel->sample_gc == NULL)
colorsel->sample_gc = gdk_gc_new (colorsel->sample_area->window);
if (colorsel->value_gc == NULL)
colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
switch (event->type)
{
case GDK_MAP:
@@ -1137,12 +1146,6 @@ gtk_color_selection_wheel_events (GtkWidget *area,
gtk_color_selection_draw_sample (colorsel, TRUE);
break;
case GDK_EXPOSE:
if (colorsel->wheel_gc == NULL)
colorsel->wheel_gc = gdk_gc_new (colorsel->wheel_area->window);
if (colorsel->sample_gc == NULL)
colorsel->sample_gc = gdk_gc_new (colorsel->sample_area->window);
if (colorsel->value_gc == NULL)
colorsel->value_gc = gdk_gc_new (colorsel->value_area->window);
gtk_color_selection_draw_wheel_marker (colorsel);
gtk_color_selection_draw_wheel_frame (colorsel);
break;
@@ -1247,7 +1250,7 @@ gtk_color_selection_draw_value_bar (GtkColorSelection *colorsel,
v -= sv;
}
gtk_widget_draw (colorsel->value_area, NULL);
gtk_widget_queue_draw (colorsel->value_area);
}
static void
@@ -1320,7 +1323,39 @@ gtk_color_selection_draw_wheel (GtkColorSelection *colorsel,
gtk_preview_draw_row (GTK_PREVIEW (colorsel->wheel_area), colorsel->wheel_buf, 0, y, wid);
}
gtk_widget_draw (colorsel->wheel_area, NULL);
if (colorsel->wheel_area->window)
{
GdkPixmap *pm = NULL;
GdkGC *pmgc = NULL;
GdkColor col;
gint w, h;
pm = gdk_pixmap_new (colorsel->wheel_area->window, wid, heig, 1);
pmgc = gdk_gc_new (pm);
col.pixel = 0;
gdk_gc_set_foreground(pmgc, &col);
gdk_draw_rectangle(pm, pmgc, TRUE, 0, 0, wid, heig);
col.pixel = 1;
gdk_gc_set_foreground(pmgc, &col);
gdk_draw_arc (pm, pmgc, TRUE, 0, 0, wid, heig, 0, 360*64);
w = colorsel->wheel_area->allocation.width;
h = colorsel->wheel_area->allocation.height;
gdk_draw_arc (pm, pmgc,
FALSE, 1, 1, w - 1, h - 1, 30 * 64, 180 * 64);
gdk_draw_arc (pm, pmgc,
FALSE, 0, 0, w, h, 30 * 64, 180 * 64);
gdk_draw_arc (pm, pmgc,
FALSE, 1, 1, w - 1, h - 1, 210 * 64, 180 * 64);
gdk_draw_arc (pm, pmgc,
FALSE, 0, 0, w, h, 210 * 64, 180 * 64);
gdk_window_shape_combine_mask(colorsel->wheel_area->window, pm, 0, 0);
gdk_pixmap_unref(pm);
gdk_gc_destroy(pmgc);
}
}
static void
@@ -1385,7 +1420,7 @@ gtk_color_selection_draw_sample (GtkColorSelection *colorsel,
gtk_preview_draw_row (GTK_PREVIEW (colorsel->sample_area), colorsel->sample_buf, 0, y, wid);
}
gtk_widget_draw (colorsel->sample_area, NULL);
gtk_widget_queue_draw (colorsel->sample_area);
}
static gint
+26
View File
@@ -50,6 +50,9 @@ struct _GtkChildArgInfo
guint seq_id;
};
/* The global list of toplevel windows */
static GList *toplevel_list = NULL;
static void gtk_container_base_class_init (GtkContainerClass *klass);
static void gtk_container_class_init (GtkContainerClass *klass);
static void gtk_container_init (GtkContainer *container);
@@ -1235,6 +1238,10 @@ gtk_container_children (GtkContainer *container)
void
gtk_container_register_toplevel (GtkContainer *container)
{
g_return_if_fail (container != NULL);
toplevel_list = g_list_prepend (toplevel_list, container);
gtk_widget_ref (GTK_WIDGET (container));
gtk_object_sink (GTK_OBJECT (container));
}
@@ -1242,9 +1249,28 @@ gtk_container_register_toplevel (GtkContainer *container)
void
gtk_container_unregister_toplevel (GtkContainer *container)
{
GList *node;
g_return_if_fail (container != NULL);
node = g_list_find (toplevel_list, container);
g_return_if_fail (node != NULL);
toplevel_list = g_list_remove_link (toplevel_list, node);
g_list_free_1 (node);
gtk_widget_unref (GTK_WIDGET (container));
}
GList *
gtk_container_get_toplevels (void)
{
/* XXX: fixme we should ref all these widgets and duplicate
* the list.
*/
return toplevel_list;
}
void
gtk_container_real_set_focus_child (GtkContainer *container,
GtkWidget *child)
+2
View File
@@ -130,6 +130,8 @@ void gtk_container_set_focus_hadjustment (GtkContainer *container,
GtkAdjustment *adjustment);
void gtk_container_register_toplevel (GtkContainer *container);
void gtk_container_unregister_toplevel (GtkContainer *container);
GList * gtk_container_get_toplevels (void);
void gtk_container_resize_children (GtkContainer *container);
GtkType gtk_container_child_type (GtkContainer *container);
+23 -45
View File
@@ -49,7 +49,6 @@
static void gtk_ctree_class_init (GtkCTreeClass *klass);
static void gtk_ctree_init (GtkCTree *ctree);
static void gtk_ctree_destroy (GtkObject *object);
static void gtk_ctree_realize (GtkWidget *widget);
static void gtk_ctree_unrealize (GtkWidget *widget);
static gint gtk_ctree_button_press (GtkWidget *widget,
@@ -353,8 +352,6 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
gtk_object_class_add_signals (object_class, ctree_signals, LAST_SIGNAL);
object_class->destroy = gtk_ctree_destroy;
widget_class->realize = gtk_ctree_realize;
widget_class->unrealize = gtk_ctree_unrealize;
widget_class->button_press_event = gtk_ctree_button_press;
@@ -453,43 +450,6 @@ gtk_ctree_init (GtkCTree *ctree)
ctree->show_stub = TRUE;
}
static void
gtk_ctree_destroy (GtkObject *object)
{
gint i;
GtkCList *clist;
g_return_if_fail (object != NULL);
g_return_if_fail (GTK_IS_CTREE (object));
clist = GTK_CLIST (object);
GTK_CLIST_SET_FLAG (clist, CLIST_FROZEN);
gtk_clist_clear (GTK_CLIST (object));
if (clist->vscrollbar)
{
gtk_widget_unparent (clist->vscrollbar);
clist->vscrollbar = NULL;
}
if (clist->hscrollbar)
{
gtk_widget_unparent (clist->hscrollbar);
clist->hscrollbar = NULL;
}
for (i = 0; i < clist->columns; i++)
if (clist->column[i].button)
{
gtk_widget_unparent (clist->column[i].button);
clist->column[i].button = NULL;
}
if (GTK_OBJECT_CLASS (container_class)->destroy)
(*GTK_OBJECT_CLASS (container_class)->destroy) (object);
}
static void
ctree_attach_styles (GtkCTree *ctree,
GtkCTreeNode *node,
@@ -2461,10 +2421,17 @@ gtk_ctree_unlink (GtkCTree *ctree,
gint pos;
pos = g_list_position (clist->row_list, (GList *)node);
if (pos + rows + 1 < clist->focus_row)
if (pos + rows < clist->focus_row)
clist->focus_row -= (rows + 1);
else if (pos <= clist->focus_row)
clist->focus_row = pos - 1;
{
if (!GTK_CTREE_ROW (node)->sibling)
clist->focus_row = MAX (pos - 1, 0);
else
clist->focus_row = pos;
clist->focus_row = MIN (clist->focus_row, clist->rows - 1);
}
clist->undo_anchor = clist->focus_row;
}
}
@@ -3011,10 +2978,17 @@ cell_size_request (GtkCList *clist,
requisition->height = style->font->ascent + style->font->descent;
break;
case GTK_CELL_PIXTEXT:
gdk_window_get_size (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap,
&width, &height);
if (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap)
{
gdk_window_get_size (GTK_CELL_PIXTEXT
(clist_row->cell[column])->pixmap,
&width, &height);
width += GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing;
}
else
width = height = 0;
requisition->width = width +
GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing +
gdk_string_width (style->font,
GTK_CELL_TEXT (clist_row->cell[column])->text);
@@ -4082,6 +4056,10 @@ gtk_ctree_remove_node (GtkCTree *ctree,
gtk_ctree_unlink (ctree, node, TRUE);
gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_delete),
NULL);
if ((clist->selection_mode == GTK_SELECTION_BROWSE ||
clist->selection_mode == GTK_SELECTION_EXTENDED) &&
!clist->selection && clist->focus_row >= 0)
gtk_clist_select_row (clist, clist->focus_row, -1);
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist))
{
+3 -3
View File
@@ -239,9 +239,9 @@ gtk_curve_draw (GtkCurve *c, gint width, gint height)
style = GTK_WIDGET (c)->style;
/* clear the pixmap: */
gdk_draw_rectangle (c->pixmap, style->bg_gc[state], TRUE,
0, 0, width + RADIUS * 2, height + RADIUS * 2);
gtk_paint_flat_box (style, c->pixmap, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
NULL, GTK_WIDGET(c), "curve_bg",
0, 0, width + RADIUS * 2, height + RADIUS * 2);
/* draw the grid lines: (XXX make more meaningful) */
for (i = 0; i < 5; i++)
{
+73 -21
View File
@@ -23,7 +23,7 @@
#include "gtkinvisible.h"
#include "gtkmain.h"
#include "gtksignal.h"
#include "gtkwindow.h"
#include "gtkdrawwindow.h"
static GSList *drag_widgets = NULL;
@@ -83,6 +83,7 @@ struct _GtkDragDestSite {
GdkDragAction actions;
GdkWindow *proxy_window;
GdkDragProtocol proxy_protocol;
gboolean do_proxy : 1;
gboolean proxy_coords : 1;
gboolean have_drag : 1;
};
@@ -128,7 +129,7 @@ struct _GtkDragFindData {
/* Enumeration for some targets we handle internally */
enum {
TARGET_MOTIF_SUCCESS = 0x80000000,
TARGET_MOTIF_SUCCESS = 0x40000000,
TARGET_MOTIF_FAILURE,
TARGET_DELETE
};
@@ -694,7 +695,7 @@ gtk_drag_dest_set (GtkWidget *widget,
site->target_list = NULL;
site->actions = actions;
site->proxy_window = NULL;
site->do_proxy = FALSE;
gtk_object_set_data_full (GTK_OBJECT (widget), "gtk-drag-dest",
site, gtk_drag_dest_site_destroy);
@@ -741,7 +742,9 @@ gtk_drag_dest_set_proxy (GtkWidget *widget,
site->target_list = NULL;
site->actions = 0;
site->proxy_window = proxy_window;
gdk_window_ref (proxy_window);
if (proxy_window)
gdk_window_ref (proxy_window);
site->do_proxy = TRUE;
site->proxy_protocol = protocol;
site->proxy_coords = use_coordinates;
@@ -1172,7 +1175,7 @@ gtk_drag_dest_leave (GtkWidget *widget,
site = gtk_object_get_data (GTK_OBJECT (widget), "gtk-drag-dest");
g_return_if_fail (site != NULL);
if (site->proxy_window)
if (site->do_proxy)
{
GtkDragDestInfo *info = g_dataset_get_data (context, "gtk-info");
@@ -1181,15 +1184,16 @@ gtk_drag_dest_leave (GtkWidget *widget,
return;
}
else if (site->have_drag)
else
{
site->have_drag = FALSE;
if (site->flags & GTK_DEST_DEFAULT_HIGHLIGHT)
gtk_drag_unhighlight (widget);
gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_leave",
context, time);
if (!(site->flags & GTK_DEST_DEFAULT_MOTION) || site->have_drag)
gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_leave",
context, time);
site->have_drag = FALSE;
}
}
@@ -1207,10 +1211,13 @@ gtk_drag_dest_motion (GtkWidget *widget,
site = gtk_object_get_data (GTK_OBJECT (widget), "gtk-drag-dest");
g_return_val_if_fail (site != NULL, FALSE);
if (site->proxy_window)
if (site->do_proxy)
{
GdkAtom selection;
GdkEvent *current_event;
GdkWindow *dest_window;
GdkDragProtocol proto;
GtkDragDestInfo *info = g_dataset_get_data (context, "gtk-info");
if (!info->proxy_source)
@@ -1218,9 +1225,22 @@ gtk_drag_dest_motion (GtkWidget *widget,
current_event = gtk_get_current_event ();
if (site->proxy_window)
{
dest_window = site->proxy_window;
proto = site->proxy_protocol;
}
else
{
gdk_drag_find_window (info->proxy_source->context,
NULL,
current_event->dnd.x_root,
current_event->dnd.y_root,
&dest_window, &proto);
}
gdk_drag_motion (info->proxy_source->context,
site->proxy_window,
site->proxy_protocol,
dest_window, proto,
current_event->dnd.x_root,
current_event->dnd.y_root,
context->suggested_action, time);
@@ -1297,7 +1317,7 @@ gtk_drag_dest_drop (GtkWidget *widget,
info->drop_x = x;
info->drop_y = y;
if (site->proxy_window)
if (site->do_proxy)
{
if (info->proxy_source ||
(info->context->protocol == GDK_DRAG_PROTO_ROOTWIN))
@@ -1312,6 +1332,8 @@ gtk_drag_dest_drop (GtkWidget *widget,
GdkEvent *current_event;
GdkAtom selection;
GdkWindow *dest_window;
GdkDragProtocol proto;
gtk_drag_proxy_begin (widget, info);
info->proxy_drop_wait = TRUE;
@@ -1319,9 +1341,22 @@ gtk_drag_dest_drop (GtkWidget *widget,
current_event = gtk_get_current_event ();
if (site->proxy_window)
{
dest_window = site->proxy_window;
proto = site->proxy_protocol;
}
else
{
gdk_drag_find_window (info->proxy_source->context,
NULL,
current_event->dnd.x_root,
current_event->dnd.y_root,
&dest_window, &proto);
}
gdk_drag_motion (info->proxy_source->context,
site->proxy_window,
site->proxy_protocol,
dest_window, proto,
current_event->dnd.x_root,
current_event->dnd.y_root,
context->suggested_action, time);
@@ -1429,7 +1464,7 @@ gtk_drag_begin (GtkWidget *widget,
gtk_drag_get_event_action (event, info->button, actions));
gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_begin",
info->context, NULL);
info->context);
/* We use a GTK grab here to override any grabs that the widget
* we are dragging from might have held
@@ -1498,7 +1533,8 @@ gtk_drag_source_set (GtkWidget *widget,
gtk_widget_add_events (widget,
gtk_widget_get_events (widget) |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_MOTION_MASK);
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON_MOTION_MASK);
if (site)
{
@@ -1646,7 +1682,7 @@ gtk_drag_set_icon_pixmap (GdkDragContext *context,
gtk_widget_push_visual (gdk_colormap_get_visual(colormap));
gtk_widget_push_colormap (colormap);
window = gtk_window_new (GTK_WINDOW_POPUP);
window = gtk_draw_window_new (GTK_WINDOW_POPUP);
gtk_widget_pop_visual ();
gtk_widget_pop_colormap ();
@@ -2006,12 +2042,21 @@ gtk_drag_source_event_cb (GtkWidget *widget,
case GDK_BUTTON_PRESS:
if ((GDK_BUTTON1_MASK << (event->button.button - 1)) & site->start_button_mask)
{
site->state |= (GDK_BUTTON1_MASK << (event->button.button - 1));
site->x = event->button.x;
site->y = event->button.y;
}
break;
case GDK_BUTTON_RELEASE:
if ((GDK_BUTTON1_MASK << (event->button.button - 1)) & site->start_button_mask)
{
site->state &= ~(GDK_BUTTON1_MASK << (event->button.button - 1));
}
break;
case GDK_MOTION_NOTIFY:
if (event->motion.state & site->start_button_mask)
if (site->state & event->motion.state & site->start_button_mask)
{
/* FIXME: This is really broken and can leave us
* with a stuck grab
@@ -2019,7 +2064,8 @@ gtk_drag_source_event_cb (GtkWidget *widget,
int i;
for (i=1; i<6; i++)
{
if (event->motion.state & GDK_BUTTON1_MASK << (i - 1))
if (site->state & event->motion.state &
GDK_BUTTON1_MASK << (i - 1))
break;
}
@@ -2029,6 +2075,7 @@ gtk_drag_source_event_cb (GtkWidget *widget,
GtkDragSourceInfo *info;
GdkDragContext *context;
site->state = 0;
context = gtk_drag_begin (widget, site->target_list,
site->actions,
i, event);
@@ -2053,6 +2100,7 @@ gtk_drag_source_event_cb (GtkWidget *widget,
break;
default: /* hit for 2/3BUTTON_PRESS */
break;
}
return FALSE;
}
@@ -2182,6 +2230,10 @@ gtk_drag_source_info_destroy (gpointer data)
gtk_drag_remove_icon (data);
if (!info->proxy_dest)
gtk_signal_emit_by_name (GTK_OBJECT (info->widget), "drag_end",
info->context);
if (info->widget)
gtk_widget_unref (info->widget);
-1
View File
@@ -26,7 +26,6 @@
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
typedef enum {
+125
View File
@@ -0,0 +1,125 @@
/* 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 "gtkdrawwindow.h"
static void gtk_draw_window_class_init (GtkDrawWindowClass *klass);
static void gtk_draw_window_init (GtkDrawWindow *draw_window);
static void gtk_draw_window_draw (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_draw_window_expose (GtkWidget *widget,
GdkEventExpose *event);
GtkType
gtk_draw_window_get_type (void)
{
static GtkType draw_window_type = 0;
if (!draw_window_type)
{
GtkTypeInfo draw_window_info =
{
"GtkDrawWindow",
sizeof (GtkDrawWindow),
sizeof (GtkDrawWindowClass),
(GtkClassInitFunc) gtk_draw_window_class_init,
(GtkObjectInitFunc) gtk_draw_window_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
draw_window_type = gtk_type_unique (GTK_TYPE_WINDOW, &draw_window_info);
}
return draw_window_type;
}
static void
gtk_draw_window_class_init (GtkDrawWindowClass *class)
{
GtkWidgetClass *widget_class;
widget_class = (GtkWidgetClass*) class;
widget_class->draw = gtk_draw_window_draw;
widget_class->expose_event = gtk_draw_window_expose;
}
static void
gtk_draw_window_init (GtkDrawWindow *draw_window)
{
}
static gint
gtk_draw_window_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkBin *bin;
GdkEventExpose child_event;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BIN (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
{
bin = GTK_BIN (widget);
child_event = *event;
if (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);
}
return FALSE;
}
static void
gtk_draw_window_draw (GtkWidget *widget,
GdkRectangle *area)
{
GtkBin *bin;
GdkRectangle child_area;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BIN (widget));
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
{
bin = GTK_BIN (widget);
if (bin->child &&
gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
}
}
GtkWidget*
gtk_draw_window_new (GtkWindowType type)
{
GtkWindow *window;
window = gtk_type_new (GTK_TYPE_DRAW_WINDOW);
window->type = type;
return GTK_WIDGET (window);
}
+63
View File
@@ -0,0 +1,63 @@
/* 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.
*/
#ifndef __GTK_DRAW_WINDOW_H__
#define __GTK_DRAW_WINDOW_H__
#include <gdk/gdk.h>
#include <gtk/gtkwindow.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_DRAW_WINDOW (gtk_draw_window_get_type ())
#define GTK_DRAW_WINDOW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_DRAW_WINDOW, GtkDrawWindow))
#define GTK_DRAW_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_DRAW_WINDOW, GtkDrawWindowClass))
#define GTK_IS_DRAW_WINDOW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_DRAW_WINDOW))
#define GTK_IS_DRAW_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DRAW_WINDOW))
typedef struct _GtkDrawWindow GtkDrawWindow;
typedef struct _GtkDrawWindowClass GtkDrawWindowClass;
typedef struct _GtkDrawWindowButton GtkDrawWindowButton;
struct _GtkDrawWindow
{
GtkWindow window;
};
struct _GtkDrawWindowClass
{
GtkWindowClass parent_class;
};
GtkType gtk_draw_window_get_type (void);
GtkWidget* gtk_draw_window_new (GtkWindowType type);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_DRAW_WINDOW_H__ */
+69 -66
View File
@@ -27,6 +27,7 @@
#include "gtkmain.h"
#include "gtkselection.h"
#include "gtksignal.h"
#include "gtkstyle.h"
#include "gtkprivate.h"
#define MIN_ENTRY_WIDTH 150
@@ -564,8 +565,8 @@ gtk_entry_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gdk_window_set_user_data (widget->window, entry);
attributes.x = widget->style->klass->xthickness + INNER_BORDER;
attributes.y = widget->style->klass->ythickness + INNER_BORDER;
attributes.x = widget->style->klass->xthickness;
attributes.y = widget->style->klass->ythickness;
attributes.width = widget->allocation.width - attributes.x * 2;
attributes.height = widget->requisition.height - attributes.y * 2;
attributes.cursor = entry->cursor = gdk_cursor_new (GDK_XTERM);
@@ -700,22 +701,18 @@ gtk_entry_draw_focus (GtkWidget *widget)
width -= 2;
height -= 2;
}
else
{
gdk_draw_rectangle (widget->window,
widget->style->base_gc[GTK_WIDGET_STATE (widget)],
FALSE, x + 2, y + 2, width - 5, height - 5);
}
gtk_draw_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
x, y, width, height);
gtk_paint_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
NULL, widget, "entry",
x, y, width, height);
if (GTK_WIDGET_HAS_FOCUS (widget))
{
gdk_window_get_size (widget->window, &width, &height);
gdk_draw_rectangle (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
FALSE, 0, 0, width - 1, height - 1);
gdk_window_get_size (widget->window, &width, &height);
gtk_paint_focus (widget->style, widget->window,
NULL, widget, "entry",
0, 0, width - 1, height - 1);
}
if (GTK_EDITABLE (widget)->editable)
@@ -759,10 +756,10 @@ gtk_entry_size_allocate (GtkWidget *widget,
allocation->y + (allocation->height - widget->requisition.height) / 2,
allocation->width, widget->requisition.height);
gdk_window_move_resize (entry->text_area,
widget->style->klass->xthickness + INNER_BORDER,
widget->style->klass->ythickness + INNER_BORDER,
allocation->width - (widget->style->klass->xthickness + INNER_BORDER) * 2,
widget->requisition.height - (widget->style->klass->ythickness + INNER_BORDER) * 2);
widget->style->klass->xthickness,
widget->style->klass->ythickness,
allocation->width - widget->style->klass->xthickness * 2,
widget->requisition.height - widget->style->klass->ythickness * 2);
/* And make sure the cursor is on screen */
gtk_entry_adjust_scroll (entry);
@@ -1273,7 +1270,11 @@ gtk_entry_draw_text (GtkEntry *entry)
if (!entry->text)
{
gdk_window_clear (entry->text_area);
gtk_paint_flat_box (widget->style, entry->text_area,
GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE,
NULL, widget, "entry_bg",
0, 0, -1, -1);
if (editable->editable)
gtk_entry_draw_cursor (entry);
return;
@@ -1289,21 +1290,18 @@ gtk_entry_draw_text (GtkEntry *entry)
use_backing_pixmap = GTK_WIDGET_HAS_FOCUS (widget) && (entry->text != NULL);
if (use_backing_pixmap)
{
gtk_entry_make_backing_pixmap (entry, width, height);
drawable = entry->backing_pixmap;
gdk_draw_rectangle (drawable,
widget->style->base_gc[GTK_WIDGET_STATE(widget)],
TRUE,
0, 0,
width,
height);
gtk_entry_make_backing_pixmap (entry, width, height);
drawable = entry->backing_pixmap;
}
else
{
drawable = entry->text_area;
gdk_window_clear (entry->text_area);
}
else
{
drawable = entry->text_area;
}
gtk_paint_flat_box (widget->style, drawable,
GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE,
NULL, widget, "entry_bg",
0, 0, width, height);
y = (height - (widget->style->font->ascent + widget->style->font->descent)) / 2;
y += widget->style->font->ascent;
@@ -1358,37 +1356,35 @@ gtk_entry_draw_text (GtkEntry *entry)
if (selection_start_pos > start_pos)
gdk_draw_text (drawable, widget->style->font,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
start_xoffset, y,
INNER_BORDER + start_xoffset, y,
toprint,
selection_start_pos - start_pos);
if ((selection_end_pos >= start_pos) &&
(selection_start_pos < end_pos) &&
(selection_start_pos != selection_end_pos))
{
gdk_draw_rectangle (drawable,
widget->style->bg_gc[selected_state],
TRUE,
selection_start_xoffset,
0,
selection_end_xoffset - selection_start_xoffset,
-1);
gdk_draw_text (drawable, widget->style->font,
widget->style->fg_gc[selected_state],
selection_start_xoffset, y,
toprint + selection_start_pos - start_pos,
selection_end_pos - selection_start_pos);
}
if (selection_end_pos < end_pos)
gdk_draw_text (drawable, widget->style->font,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
selection_end_xoffset, y,
toprint + selection_end_pos - start_pos,
end_pos - selection_end_pos);
/* free the space allocated for the stars if it's neccessary. */
{
gtk_paint_flat_box (widget->style, drawable,
selected_state, GTK_SHADOW_NONE,
NULL, widget, "text",
INNER_BORDER + selection_start_xoffset,
INNER_BORDER,
selection_end_xoffset - selection_start_xoffset,
height - 2*INNER_BORDER);
gdk_draw_text (drawable, widget->style->font,
widget->style->fg_gc[selected_state],
INNER_BORDER + selection_start_xoffset, y,
toprint + selection_start_pos - start_pos,
selection_end_pos - selection_start_pos);
}
if (selection_end_pos < end_pos)
gdk_draw_text (drawable, widget->style->font,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
INNER_BORDER + selection_end_xoffset, y,
toprint + selection_end_pos - start_pos,
end_pos - selection_end_pos);
/* free the space allocated for the stars if it's neccessary. */
if (!entry->visible)
g_free (toprint);
@@ -1417,7 +1413,6 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable)
{
GtkWidget *widget;
GtkEditable *editable;
GdkGC *gc;
gint xoffset;
gint text_area_height;
@@ -1429,17 +1424,25 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable)
widget = GTK_WIDGET (entry);
editable = GTK_EDITABLE (entry);
xoffset = entry->char_offset[gtk_entry_find_char (entry, editable->current_pos)];
xoffset = INNER_BORDER + entry->char_offset[gtk_entry_find_char (entry, editable->current_pos)];
xoffset -= entry->scroll_offset;
gdk_window_get_size (entry->text_area, NULL, &text_area_height);
if (GTK_WIDGET_HAS_FOCUS (widget) &&
(editable->selection_start_pos == editable->selection_end_pos))
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
{
gdk_draw_line (drawable, widget->style->fg_gc[GTK_STATE_NORMAL],
xoffset, 0, xoffset, text_area_height);
}
else
gc = widget->style->base_gc[GTK_WIDGET_STATE(widget)];
{
gtk_paint_flat_box (widget->style, drawable,
GTK_WIDGET_STATE(widget), GTK_SHADOW_NONE,
NULL, widget, "entry_bg",
xoffset, 0, 1, text_area_height);
}
gdk_window_get_size (entry->text_area, NULL, &text_area_height);
gdk_draw_line (drawable, gc, xoffset, 0, xoffset, text_area_height);
#ifdef USE_XIM
if (gdk_im_ready() && editable->ic &&
gdk_ic_get_style (editable->ic) & GDK_IM_PREEDIT_POSITION)
@@ -2321,7 +2324,7 @@ gtk_entry_style_set (GtkWidget *widget,
}
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
gtk_widget_queue_clear(widget);
}
static void
@@ -2338,5 +2341,5 @@ gtk_entry_state_changed (GtkWidget *widget,
}
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
gtk_widget_queue_clear(widget);
}
-1
View File
@@ -22,7 +22,6 @@
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
+42 -17
View File
@@ -322,10 +322,10 @@ static GtkWindowClass *parent_class = NULL;
/* Saves errno when something cmpl does fails. */
static gint cmpl_errno;
guint
GtkType
gtk_file_selection_get_type (void)
{
static guint file_selection_type = 0;
static GtkType file_selection_type = 0;
if (!file_selection_type)
{
@@ -341,7 +341,7 @@ gtk_file_selection_get_type (void)
(GtkClassInitFunc) NULL,
};
file_selection_type = gtk_type_unique (gtk_window_get_type (), &filesel_info);
file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info);
}
return file_selection_type;
@@ -354,7 +354,7 @@ gtk_file_selection_class_init (GtkFileSelectionClass *class)
object_class = (GtkObjectClass*) class;
parent_class = gtk_type_class (gtk_window_get_type ());
parent_class = gtk_type_class (GTK_TYPE_WINDOW);
object_class->destroy = gtk_file_selection_destroy;
}
@@ -367,6 +367,8 @@ gtk_file_selection_init (GtkFileSelection *filesel)
GtkWidget *list_hbox;
GtkWidget *confirm_area;
GtkWidget *pulldown_hbox;
GtkWidget *scrolled_win;
char *dir_title [] = { "Directories", };
char *file_title [] = { "Files", };
@@ -410,11 +412,16 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row",
(GtkSignalFunc) gtk_file_selection_dir_button,
(gpointer) filesel);
gtk_clist_set_policy (GTK_CLIST (filesel->dir_list), GTK_POLICY_ALWAYS, GTK_POLICY_AUTOMATIC);
gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list));
gtk_container_border_width (GTK_CONTAINER (filesel->dir_list), 5);
gtk_box_pack_start (GTK_BOX (list_hbox), filesel->dir_list, TRUE, TRUE, 0);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->dir_list);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_container_border_width (GTK_CONTAINER (scrolled_win), 5);
gtk_box_pack_start (GTK_BOX (list_hbox), scrolled_win, TRUE, TRUE, 0);
gtk_widget_show (filesel->dir_list);
gtk_widget_show (scrolled_win);
/* The files clist */
filesel->file_list = gtk_clist_new_with_titles (1, file_title);
@@ -422,11 +429,16 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row",
(GtkSignalFunc) gtk_file_selection_file_button,
(gpointer) filesel);
gtk_clist_set_policy (GTK_CLIST (filesel->file_list), GTK_POLICY_ALWAYS, GTK_POLICY_AUTOMATIC);
gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list));
gtk_container_border_width (GTK_CONTAINER (filesel->file_list), 5);
gtk_box_pack_start (GTK_BOX (list_hbox), filesel->file_list, TRUE, TRUE, 0);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_container_border_width (GTK_CONTAINER (scrolled_win), 5);
gtk_box_pack_start (GTK_BOX (list_hbox), scrolled_win, TRUE, TRUE, 0);
gtk_widget_show (filesel->file_list);
gtk_widget_show (scrolled_win);
/* action area for packing buttons into. */
filesel->action_area = gtk_hbox_new (TRUE, 0);
@@ -497,7 +509,7 @@ gtk_file_selection_new (const gchar *title)
{
GtkFileSelection *filesel;
filesel = gtk_type_new (gtk_file_selection_get_type ());
filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION);
gtk_window_set_title (GTK_WINDOW (filesel), title);
return GTK_WIDGET (filesel);
@@ -627,6 +639,19 @@ gtk_file_selection_get_filename (GtkFileSelection *filesel)
return nothing;
}
void
gtk_file_selection_complete (GtkFileSelection *filesel,
const gchar *pattern)
{
g_return_if_fail (filesel != NULL);
g_return_if_fail (GTK_IS_FILE_SELECTION (filesel));
g_return_if_fail (pattern != NULL);
if (filesel->selection_entry)
gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern);
gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE);
}
static void
gtk_file_selection_destroy (GtkObject *object)
{
@@ -1696,7 +1721,7 @@ cmpl_completion_matches (gchar* text_to_complete,
prune_memory_usage(cmpl_state);
g_assert(text_to_complete);
g_assert (text_to_complete != NULL);
cmpl_state->user_completion_index = -1;
cmpl_state->last_completion_text = text_to_complete;
@@ -1706,14 +1731,14 @@ cmpl_completion_matches (gchar* text_to_complete,
cmpl_state->updated_text[0] = 0;
cmpl_state->re_complete = FALSE;
first_slash = strchr(text_to_complete, '/');
first_slash = strchr (text_to_complete, '/');
if(text_to_complete[0] == '~' && !first_slash)
if (text_to_complete[0] == '~' && !first_slash)
{
/* Text starts with ~ and there is no slash, show all the
* home directory completions.
*/
poss = attempt_homedir_completion(text_to_complete, cmpl_state);
poss = attempt_homedir_completion (text_to_complete, cmpl_state);
update_cmpl(poss, cmpl_state);
@@ -1721,13 +1746,13 @@ cmpl_completion_matches (gchar* text_to_complete,
}
cmpl_state->reference_dir =
open_ref_dir(text_to_complete, remaining_text, cmpl_state);
open_ref_dir (text_to_complete, remaining_text, cmpl_state);
if(!cmpl_state->reference_dir)
return NULL;
cmpl_state->completion_dir =
find_completion_dir(*remaining_text, remaining_text, cmpl_state);
find_completion_dir (*remaining_text, remaining_text, cmpl_state);
cmpl_state->last_valid_char = *remaining_text - text_to_complete;
+12 -8
View File
@@ -29,9 +29,11 @@ extern "C" {
#endif /* __cplusplus */
#define GTK_FILE_SELECTION(obj) GTK_CHECK_CAST (obj, gtk_file_selection_get_type (), GtkFileSelection)
#define GTK_FILE_SELECTION_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_file_selection_get_type (), GtkFileSelectionClass)
#define GTK_IS_FILE_SELECTION(obj) GTK_CHECK_TYPE (obj, gtk_file_selection_get_type ())
#define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ())
#define GTK_FILE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection))
#define GTK_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass))
#define GTK_IS_FILE_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FILE_SELECTION))
#define GTK_IS_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION))
typedef struct _GtkFileSelection GtkFileSelection;
@@ -72,11 +74,13 @@ struct _GtkFileSelectionClass
};
guint gtk_file_selection_get_type (void);
GtkWidget* gtk_file_selection_new (const gchar *title);
void gtk_file_selection_set_filename (GtkFileSelection *filesel,
const gchar *filename);
gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel);
GtkType gtk_file_selection_get_type (void);
GtkWidget* gtk_file_selection_new (const gchar *title);
void gtk_file_selection_set_filename (GtkFileSelection *filesel,
const gchar *filename);
gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel);
void gtk_file_selection_complete (GtkFileSelection *filesel,
const gchar *pattern);
void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel);
void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel);
+1 -1
View File
@@ -346,7 +346,7 @@ gtk_fixed_paint (GtkWidget *widget,
g_return_if_fail (area != NULL);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear_area (widget->window,
gdk_window_clear_area (widget->window,
area->x, area->y,
area->width, area->height);
}
+636 -332
View File
File diff suppressed because it is too large Load Diff
+108 -39
View File
@@ -68,10 +68,41 @@ typedef struct _GtkFontSelectionDialogClass GtkFontSelectionDialogClass;
/* Used to determine whether we are using point or pixel sizes. */
typedef enum
{
PIXELS_METRIC,
POINTS_METRIC
GTK_FONT_METRIC_PIXELS,
GTK_FONT_METRIC_POINTS
} GtkFontMetricType;
/* Used for determining the type of a font style, and also for setting filters.
These can be combined if a style has bitmaps and scalable fonts available.*/
typedef enum
{
GTK_FONT_BITMAP = 1 << 0,
GTK_FONT_SCALABLE = 1 << 1,
GTK_FONT_SCALABLE_BITMAP = 1 << 2,
GTK_FONT_ALL = 0x07
} GtkFontType;
/* These are the two types of filter available - base and user. The base
filter is set by the application and can't be changed by the user. */
#define GTK_NUM_FONT_FILTERS 2
typedef enum
{
GTK_FONT_FILTER_BASE,
GTK_FONT_FILTER_USER
} GtkFontFilterType;
/* These hold the arrays of current filter settings for each property.
If nfilters is 0 then all values of the property are OK. If not the
filters array contains the indexes of the valid property values. */
typedef struct _GtkFontFilter GtkFontFilter;
struct _GtkFontFilter
{
gint font_type;
guint16 *property_filters[GTK_NUM_FONT_PROPERTIES];
guint16 property_nfilters[GTK_NUM_FONT_PROPERTIES];
};
struct _GtkFontSelection
{
@@ -89,7 +120,6 @@ struct _GtkFontSelection
GtkWidget *pixels_button;
GtkWidget *points_button;
GtkWidget *filter_button;
GtkWidget *scaled_bitmaps_button;
GtkWidget *preview_entry;
GtkWidget *message_label;
@@ -101,6 +131,9 @@ struct _GtkFontSelection
/* These are on the filter page. */
GtkWidget *filter_vbox;
GtkWidget *type_bitmaps_button;
GtkWidget *type_scalable_button;
GtkWidget *type_scaled_bitmaps_button;
GtkWidget *filter_clists[GTK_NUM_FONT_PROPERTIES];
GdkFont *font;
@@ -114,22 +147,12 @@ struct _GtkFontSelection
fonts we try to find the nearest size to this. */
gint selected_size;
/* This flag determines if scaled bitmapped fonts are acceptable. */
gboolean scale_bitmapped_fonts;
/* These are the current property settings. They are indexes into the
strings in the GtkFontSelInfo properties array. */
guint16 property_values[GTK_NUM_STYLE_PROPERTIES];
/* These hold the arrays of current filter settings for each property.
If nfilters is 0 then all values of the property are OK. If not the
filters array contains the indexes of the valid property values. */
guint16 *property_filters[GTK_NUM_FONT_PROPERTIES];
guint16 property_nfilters[GTK_NUM_FONT_PROPERTIES];
/* This flags is set to scroll the clist to the selected value as soon as
it appears. There might be a better way of doing this. */
gboolean scroll_on_expose;
/* These are the base and user font filters. */
GtkFontFilter filters[GTK_NUM_FONT_FILTERS];
};
@@ -164,52 +187,98 @@ struct _GtkFontSelectionDialogClass
/* FontSelection */
/*****************************************************************************
* GtkFontSelection functions.
* see the comments in the GtkFontSelectionDialog functions.
*****************************************************************************/
GtkType gtk_font_selection_get_type (void);
GtkWidget* gtk_font_selection_new (void);
/* This returns the X Logical Font Description fontname, or NULL if no font
is selected. Note that there is a slight possibility that the font might not
have been loaded OK. You should call gtk_font_selection_get_font() to see
if it has been loaded OK.
You should g_free() the returned font name after you're done with it. */
gchar* gtk_font_selection_get_font_name (GtkFontSelection *fontsel);
/* This will return the current GdkFont, or NULL if none is selected or there
was a problem loading it. Remember to use gdk_font_ref/unref() if you want
to use the font (in a style, for example). */
GdkFont* gtk_font_selection_get_font (GtkFontSelection *fontsel);
/* This sets the currently displayed font. It should be a valid X Logical
Font Description font name (anything else will be ignored), e.g.
"-adobe-courier-bold-o-normal--25-*-*-*-*-*-*-*"
It returns TRUE on success. */
gboolean gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
const gchar *fontname);
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
void gtk_font_selection_set_filter (GtkFontSelection *fontsel,
GtkFontFilterType filter_type,
GtkFontType font_type,
gchar **foundries,
gchar **weights,
gchar **slants,
gchar **setwidths,
gchar **spacings,
gchar **charsets);
gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
/* This sets the text in the preview entry. It will be copied by the entry,
so there's no need to g_strdup() it first. */
void gtk_font_selection_set_preview_text (GtkFontSelection *fontsel,
const gchar *text);
/* FontSelectionDialog */
/*****************************************************************************
* GtkFontSelectionDialog functions.
* most of these functions simply call the corresponding function in the
* GtkFontSelection.
*****************************************************************************/
GtkType gtk_font_selection_dialog_get_type (void);
GtkWidget* gtk_font_selection_dialog_new (const gchar *title);
/* These simply call the corresponding FontSelection function. */
/* This returns the X Logical Font Description fontname, or NULL if no font
is selected. Note that there is a slight possibility that the font might not
have been loaded OK. You should call gtk_font_selection_dialog_get_font()
to see if it has been loaded OK.
You should g_free() the returned font name after you're done with it. */
gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd);
/* This will return the current GdkFont, or NULL if none is selected or there
was a problem loading it. Remember to use gdk_font_ref/unref() if you want
to use the font (in a style, for example). */
GdkFont* gtk_font_selection_dialog_get_font (GtkFontSelectionDialog *fsd);
/* This sets the currently displayed font. It should be a valid X Logical
Font Description font name (anything else will be ignored), e.g.
"-adobe-courier-bold-o-normal--25-*-*-*-*-*-*-*"
It returns TRUE on success. */
gboolean gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd,
const gchar *fontname);
/* This sets one of the font filters, to limit the fonts shown. The filter_type
is GTK_FONT_FILTER_BASE or GTK_FONT_FILTER_USER. The font type is a
combination of the bit flags GTK_FONT_BITMAP, GTK_FONT_SCALABLE and
GTK_FONT_SCALABLE_BITMAP (or GTK_FONT_ALL for all font types).
The foundries, weights etc. are arrays of strings containing property
values, e.g. 'bold', 'demibold', and *MUST* finish with a NULL.
Standard long names are also accepted, e.g. 'italic' instead of 'i'.
e.g. to allow only fixed-width fonts ('char cell' or 'monospaced') to be
selected use:
gchar *spacings[] = { "c", "m", NULL };
gtk_font_selection_dialog_set_filter (GTK_FONT_SELECTION_DIALOG (fontsel),
GTK_FONT_FILTER_BASE, GTK_FONT_ALL,
NULL, NULL, NULL, NULL, spacings, NULL);
to allow only true scalable fonts to be selected use:
gtk_font_selection_dialog_set_filter (GTK_FONT_SELECTION_DIALOG (fontsel),
GTK_FONT_FILTER_BASE, GTK_FONT_SCALABLE,
NULL, NULL, NULL, NULL, NULL, NULL);
*/
void gtk_font_selection_dialog_set_filter (GtkFontSelectionDialog *fsd,
GtkFontFilterType filter_type,
GtkFontType font_type,
gchar **foundries,
gchar **weights,
gchar **slants,
gchar **setwidths,
gchar **spacings,
gchar **charsets);
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
/* This sets the text in the preview entry. It will be copied by the entry,
so there's no need to g_strdup() it first. */
void gtk_font_selection_dialog_set_preview_text (GtkFontSelectionDialog *fsd,
const gchar *text);
+43 -44
View File
@@ -242,11 +242,11 @@ gtk_frame_set_label (GtkFrame *frame,
/* clear the old label area
*/
widget = GTK_WIDGET (frame);
gdk_window_clear_area (widget->window,
widget->allocation.x + GTK_CONTAINER (frame)->border_width,
widget->allocation.y + GTK_CONTAINER (frame)->border_width,
widget->allocation.width - GTK_CONTAINER (frame)->border_width,
widget->allocation.y + frame->label_height);
gtk_widget_queue_clear_area (widget,
widget->allocation.x + GTK_CONTAINER (frame)->border_width,
widget->allocation.y + GTK_CONTAINER (frame)->border_width,
widget->allocation.width - GTK_CONTAINER (frame)->border_width,
widget->allocation.y + frame->label_height);
}
@@ -276,11 +276,11 @@ gtk_frame_set_label_align (GtkFrame *frame,
/* clear the old label area
*/
widget = GTK_WIDGET (frame);
gdk_window_clear_area (widget->window,
widget->allocation.x + GTK_CONTAINER (frame)->border_width,
widget->allocation.y + GTK_CONTAINER (frame)->border_width,
widget->allocation.width - GTK_CONTAINER (frame)->border_width,
widget->allocation.y + frame->label_height);
gtk_widget_queue_clear_area (widget,
widget->allocation.x + GTK_CONTAINER (frame)->border_width,
widget->allocation.y + GTK_CONTAINER (frame)->border_width,
widget->allocation.width - GTK_CONTAINER (frame)->border_width,
widget->allocation.y + frame->label_height);
}
gtk_widget_queue_resize (GTK_WIDGET (frame));
@@ -300,11 +300,7 @@ gtk_frame_set_shadow_type (GtkFrame *frame,
if (GTK_WIDGET_DRAWABLE (frame))
{
gdk_window_clear_area (GTK_WIDGET (frame)->window,
GTK_WIDGET (frame)->allocation.x,
GTK_WIDGET (frame)->allocation.y,
GTK_WIDGET (frame)->allocation.width,
GTK_WIDGET (frame)->allocation.height);
gtk_widget_queue_clear (GTK_WIDGET (frame));
}
gtk_widget_queue_resize (GTK_WIDGET (frame));
}
@@ -334,7 +330,7 @@ gtk_frame_paint (GtkWidget *widget,
GtkFrame *frame;
gint height_extra;
gint label_area_width;
gint x, y;
gint x, y, x2, y2;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_FRAME (widget));
@@ -350,33 +346,40 @@ gtk_frame_paint (GtkWidget *widget,
x = GTK_CONTAINER (frame)->border_width;
y = GTK_CONTAINER (frame)->border_width;
gtk_draw_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
widget->allocation.x + x,
widget->allocation.y + y + height_extra / 2,
widget->allocation.width - x * 2,
widget->allocation.height - y * 2 - height_extra / 2);
if (frame->label)
{
label_area_width = (widget->allocation.width -
GTK_CONTAINER (frame)->border_width * 2 -
widget->style->klass->xthickness * 2);
label_area_width = (widget->allocation.width -
GTK_CONTAINER (frame)->border_width * 2 -
widget->style->klass->xthickness * 2);
x2 = ((label_area_width - frame->label_width) * frame->label_xalign +
GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
y2 = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
x = ((label_area_width - frame->label_width) * frame->label_xalign +
GTK_CONTAINER (frame)->border_width + widget->style->klass->xthickness);
y = (GTK_CONTAINER (frame)->border_width + widget->style->font->ascent);
gdk_window_clear_area (widget->window,
widget->allocation.x + x + 2,
widget->allocation.y + GTK_CONTAINER (frame)->border_width,
frame->label_width - 4,
frame->label_height);
gtk_draw_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
widget->allocation.x + x + 3,
widget->allocation.y + y,
frame->label);
gtk_paint_shadow_gap (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
widget->allocation.x + x,
widget->allocation.y + y + height_extra / 2,
widget->allocation.width - x * 2,
widget->allocation.height - y * 2 - height_extra / 2,
GTK_POS_TOP,
x2 + 2 - x, frame->label_width - 4);
gtk_paint_string (widget->style, widget->window, GTK_WIDGET_STATE (widget),
area, widget, "frame",
widget->allocation.x + x2 + 3,
widget->allocation.y + y2,
frame->label);
}
else
gtk_paint_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, frame->shadow_type,
area, widget, "frame",
widget->allocation.x + x,
widget->allocation.y + y + height_extra / 2,
widget->allocation.width - x * 2,
widget->allocation.height - y * 2 - height_extra / 2);
}
}
@@ -488,11 +491,7 @@ gtk_frame_size_allocate (GtkWidget *widget,
(widget->allocation.height != allocation->height)) &&
(widget->allocation.width != 0) &&
(widget->allocation.height != 0))
gdk_window_clear_area (widget->window,
widget->allocation.x,
widget->allocation.y,
widget->allocation.width,
widget->allocation.height);
gtk_widget_queue_clear (widget);
widget->allocation = *allocation;
+51 -78
View File
@@ -308,6 +308,7 @@ gtk_handle_box_realize (GtkWidget *widget)
gtk_style_set_background (widget->style, widget->window, GTK_WIDGET_STATE (hb));
gtk_style_set_background (widget->style, hb->bin_window, GTK_WIDGET_STATE (hb));
gtk_style_set_background (widget->style, hb->float_window, GTK_WIDGET_STATE (hb));
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
}
static void
@@ -567,77 +568,42 @@ gtk_handle_box_draw_ghost (GtkHandleBox *hb)
width = widget->allocation.width;
height = DRAG_HANDLE_SIZE;
}
gtk_draw_shadow (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
GTK_SHADOW_ETCHED_IN,
x,
y,
width,
height);
/*
if (hb->handle_position == GTK_POS_LEFT ||
hb->handle_position == GTK_POS_RIGHT)
gtk_draw_hline (widget->style,
gtk_paint_shadow (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : widget->allocation.width - DRAG_HANDLE_SIZE,
widget->allocation.width - DRAG_HANDLE_SIZE,
widget->allocation.height / 2);
else
gtk_draw_vline (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : widget->allocation.height - DRAG_HANDLE_SIZE,
widget->allocation.height - DRAG_HANDLE_SIZE,
widget->allocation.width / 2);
*/
GTK_SHADOW_ETCHED_IN,
NULL, widget, "handle",
x,
y,
width,
height);
if (hb->handle_position == GTK_POS_LEFT ||
hb->handle_position == GTK_POS_RIGHT)
gtk_paint_hline (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
NULL, widget, "handlebox",
hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : widget->allocation.width - DRAG_HANDLE_SIZE,
widget->allocation.width - DRAG_HANDLE_SIZE,
widget->allocation.height / 2);
else
gtk_paint_vline (widget->style,
widget->window,
GTK_WIDGET_STATE (widget),
NULL, widget, "handlebox",
hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : widget->allocation.height - DRAG_HANDLE_SIZE,
widget->allocation.height - DRAG_HANDLE_SIZE,
widget->allocation.width / 2);
}
static void
draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow,
GdkRectangle *clip)
{
int x, y;
int xthick, ythick;
GdkGC *light_gc, *dark_gc;
GdkRectangle dest;
if (gdk_rectangle_intersect (rect, clip, &dest))
{
gdk_draw_rectangle (window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
dest.x, dest.y,
dest.width, dest.height);
light_gc = widget->style->light_gc[GTK_STATE_NORMAL];
dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL];
xthick = widget->style->klass->xthickness;
ythick = widget->style->klass->ythickness;
gdk_gc_set_clip_rectangle (light_gc, &dest);
gdk_gc_set_clip_rectangle (dark_gc, &dest);
for (y = rect->y + ythick; y < (rect->y + rect->height - ythick); y += 3)
for (x = rect->x + xthick; x < (rect->x + rect->width - xthick); x += 6)
{
gdk_draw_point (window, light_gc, x, y);
gdk_draw_point (window, dark_gc, x + 1, y + 1);
gdk_draw_point (window, light_gc, x + 3, y + 1);
gdk_draw_point (window, dark_gc, x + 4, y + 2);
}
gdk_gc_set_clip_rectangle (light_gc, NULL);
gdk_gc_set_clip_rectangle (dark_gc, NULL);
gtk_draw_shadow (widget->style, window,
GTK_STATE_NORMAL, shadow,
rect->x, rect->y,
rect->width, rect->height);
}
gtk_paint_handle(widget->style, window, GTK_STATE_NORMAL, shadow,
NULL, widget, "handlebox",
rect->x, rect->y, rect->width, rect->height,
GTK_ORIENTATION_VERTICAL);
}
static void
@@ -673,22 +639,29 @@ gtk_handle_box_paint (GtkWidget *widget,
width = widget->allocation.width;
height = widget->allocation.height - DRAG_HANDLE_SIZE;
}
if (!event)
gdk_window_clear_area (hb->bin_window,
area->x,
area->y,
area->width,
area->height);
gtk_draw_shadow (widget->style,
hb->bin_window,
GTK_WIDGET_STATE (widget),
GTK_SHADOW_OUT,
hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : 0,
hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : 0,
width,
height);
if (!event)
gtk_paint_box(widget->style,
hb->bin_window,
GTK_WIDGET_STATE (widget),
GTK_SHADOW_OUT,
area, widget, "handlebox_bin",
0, 0, -1, -1);
else
gtk_paint_box(widget->style,
hb->bin_window,
GTK_WIDGET_STATE (widget),
GTK_SHADOW_OUT,
&event->area, widget, "handlebox_bin",
0, 0, -1, -1);
/* We currently draw the handle _above_ the relief of the handlebox.
* it could also be drawn on the same level...
hb->handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : 0,
hb->handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : 0,
width,
height);*/
rect.x = 0;
rect.y = 0;
+6 -12
View File
@@ -229,6 +229,8 @@ gtk_hpaned_draw (GtkWidget *widget,
paned = GTK_PANED (widget);
border_width = GTK_CONTAINER (paned)->border_width;
gdk_window_clear_area (widget->window,
area->x, area->y, area->width, area->height);
if (paned->child1 &&
gtk_widget_intersect (paned->child1, area, &child_area))
gtk_widget_draw (paned->child1, &child_area);
@@ -236,18 +238,10 @@ gtk_hpaned_draw (GtkWidget *widget,
gtk_widget_intersect (paned->child2, area, &child_area))
gtk_widget_draw (paned->child2, &child_area);
gdk_draw_line (widget->window,
widget->style->dark_gc[widget->state],
border_width + paned->child1_size + paned->gutter_size / 2 - 1,
0,
border_width + paned->child1_size + paned->gutter_size / 2 - 1,
widget->allocation.height - 1);
gdk_draw_line (widget->window,
widget->style->light_gc[widget->state],
border_width + paned->child1_size + paned->gutter_size / 2,
0,
border_width + paned->child1_size + paned->gutter_size / 2,
widget->allocation.height - 1);
gtk_paint_vline(widget->style, widget->window, GTK_STATE_NORMAL,
area, widget, "hpaned",
0, widget->allocation.height - 1,
border_width + paned->child1_size + paned->gutter_size / 2 - 1);
}
}
+9 -6
View File
@@ -162,7 +162,15 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
width = widget->allocation.width;
height = widget->allocation.height - ythickness * 2;
gdk_draw_line (ruler->backing_store, gc,
gtk_paint_box (widget->style, ruler->backing_store,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, widget, "hruler",
0, 0,
widget->allocation.width, widget->allocation.height);
gdk_draw_line (ruler->backing_store, gc,
xthickness,
height + ythickness,
widget->allocation.width - xthickness,
@@ -231,11 +239,6 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
if (i == 0)
{
sprintf (unit_str, "%d", (int) cur);
gdk_draw_rectangle (ruler->backing_store,
bg_gc, TRUE,
pos + 1, ythickness,
gdk_string_width(font, unit_str) + 1,
digit_height);
gdk_draw_string (ruler->backing_store, font, gc,
pos + 2, ythickness + font->ascent - 1,
unit_str);
+149 -43
View File
@@ -38,12 +38,20 @@ static void gtk_hscale_pos_trough (GtkHScale *hscale,
gint *y,
gint *w,
gint *h);
static void gtk_hscale_pos_background (GtkHScale *hscale,
gint *x,
gint *y,
gint *w,
gint *h);
static void gtk_hscale_draw_slider (GtkRange *range);
static void gtk_hscale_draw_value (GtkScale *scale);
static void gtk_hscale_draw (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_hscale_trough_keys (GtkRange *range,
GdkEventKey *key,
GtkScrollType *scroll,
GtkTroughType *pos);
static void gtk_hscale_clear_background (GtkRange *range);
guint
gtk_hscale_get_type (void)
@@ -84,12 +92,14 @@ gtk_hscale_class_init (GtkHScaleClass *class)
widget_class->realize = gtk_hscale_realize;
widget_class->size_request = gtk_hscale_size_request;
widget_class->size_allocate = gtk_hscale_size_allocate;
widget_class->draw = gtk_hscale_draw;
range_class->slider_update = gtk_range_default_hslider_update;
range_class->trough_click = gtk_range_default_htrough_click;
range_class->motion = gtk_range_default_hmotion;
range_class->draw_slider = gtk_hscale_draw_slider;
range_class->trough_keys = gtk_hscale_trough_keys;
range_class->clear_background = gtk_hscale_clear_background;
scale_class->draw_value = gtk_hscale_draw_value;
}
@@ -97,6 +107,7 @@ gtk_hscale_class_init (GtkHScaleClass *class)
static void
gtk_hscale_init (GtkHScale *hscale)
{
GTK_WIDGET_SET_FLAGS (hscale, GTK_NO_WINDOW);
}
GtkWidget*
@@ -129,28 +140,27 @@ gtk_hscale_realize (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
range = GTK_RANGE (widget);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
widget->window = gtk_widget_get_parent_window (widget);
gdk_window_ref (widget->window);
gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &w, &h);
attributes.x = x + widget->allocation.x;
attributes.y = y + widget->allocation.y;
attributes.width = w;
attributes.height = h;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
attributes.event_mask = gtk_widget_get_events (widget) |
(GDK_EXPOSURE_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &w, &h);
attributes.x = x;
attributes.y = y;
attributes.width = w;
attributes.height = h;
attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
range->trough = gdk_window_new (widget->window, &attributes, attributes_mask);
@@ -163,18 +173,75 @@ gtk_hscale_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gdk_window_set_user_data (widget->window, widget);
gdk_window_set_user_data (range->trough, widget);
gdk_window_set_user_data (range->slider, widget);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, range->trough, GTK_STATE_ACTIVE);
gtk_style_set_background (widget->style, range->slider, GTK_STATE_NORMAL);
gtk_range_slider_update (GTK_RANGE (widget));
gdk_window_show (range->slider);
gdk_window_show (range->trough);
}
static void
gtk_hscale_draw (GtkWidget *widget,
GdkRectangle *area)
{
GtkRange *range;
GdkRectangle tmp_area;
GdkRectangle child_area;
gint x, y, width, height;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_RANGE (widget));
g_return_if_fail (area != NULL);
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
{
range = GTK_RANGE (widget);
gtk_hscale_pos_background (GTK_HSCALE (widget), &x, &y, &width, &height);
tmp_area.x = x;
tmp_area.y = y;
tmp_area.width = width;
tmp_area.height = height;
if (gdk_rectangle_intersect (area, &tmp_area, &child_area))
gtk_range_draw_background (range);
gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &width, &height);
tmp_area.x = x;
tmp_area.y = y;
tmp_area.width = width;
tmp_area.height = height;
if (gdk_rectangle_intersect (area, &tmp_area, &child_area))
{
gtk_range_draw_trough (range);
gtk_range_draw_slider (range);
gtk_range_draw_step_forw (range);
gtk_range_draw_step_back (range);
}
}
}
static void
gtk_hscale_clear_background (GtkRange *range)
{
GtkWidget *widget;
gint x, y, width, height;
g_return_if_fail (range != NULL);
widget = GTK_WIDGET (range);
gtk_hscale_pos_background (GTK_HSCALE (range), &x, &y, &width, &height);
gtk_widget_queue_clear_area (GTK_WIDGET (range),
x, y, width, height);
}
static void
@@ -235,13 +302,11 @@ gtk_hscale_size_allocate (GtkWidget *widget,
range = GTK_RANGE (widget);
scale = GTK_SCALE (widget);
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &width, &height);
gdk_window_move_resize (range->trough, x, y, width, height);
gdk_window_move_resize (range->trough,
x + widget->allocation.x,
y + widget->allocation.y, width, height);
gtk_range_slider_update (GTK_RANGE (widget));
}
}
@@ -301,11 +366,55 @@ gtk_hscale_pos_trough (GtkHScale *hscale,
*w -= 2;
}
static void
gtk_hscale_pos_background (GtkHScale *hscale,
gint *x,
gint *y,
gint *w,
gint *h)
{
GtkWidget *widget;
GtkScale *scale;
gint tx, ty, twidth, theight;
g_return_if_fail (hscale != NULL);
g_return_if_fail (GTK_IS_HSCALE (hscale));
g_return_if_fail ((x != NULL) && (y != NULL) && (w != NULL) && (h != NULL));
gtk_hscale_pos_trough (hscale, &tx, &ty, &twidth, &theight);
widget = GTK_WIDGET (hscale);
scale = GTK_SCALE (hscale);
*x = widget->allocation.x;
*y = widget->allocation.y;
*w = widget->allocation.width;
*h = widget->allocation.height;
switch (scale->value_pos)
{
case GTK_POS_LEFT:
*w -= twidth;
break;
case GTK_POS_RIGHT:
*x = tx;
*w -= twidth;
break;
case GTK_POS_TOP:
*h -= theight;
break;
case GTK_POS_BOTTOM:
*y = ty;
*h -= theight;
break;
}
}
static void
gtk_hscale_draw_slider (GtkRange *range)
{
GtkStateType state_type;
gint width, height;
g_return_if_fail (range != NULL);
g_return_if_fail (GTK_IS_HSCALE (range));
@@ -318,16 +427,11 @@ gtk_hscale_draw_slider (GtkRange *range)
else
state_type = GTK_STATE_NORMAL;
gtk_style_set_background (GTK_WIDGET (range)->style, range->slider, state_type);
gdk_window_clear (range->slider);
gdk_window_get_size (range->slider, &width, &height);
gtk_draw_vline (GTK_WIDGET (range)->style, range->slider,
state_type, 1, height - 2, width / 2);
gtk_draw_shadow (GTK_WIDGET (range)->style, range->slider,
state_type, GTK_SHADOW_OUT,
0, 0, -1, -1);
gtk_paint_slider(GTK_WIDGET (range)->style, range->slider, state_type,
GTK_SHADOW_OUT,
NULL, GTK_WIDGET (range), "hscale",
0, 0, -1, -1,
GTK_ORIENTATION_HORIZONTAL);
}
}
@@ -335,6 +439,7 @@ static void
gtk_hscale_draw_value (GtkScale *scale)
{
GtkStateType state_type;
GtkWidget *widget;
gchar buffer[32];
gint text_width;
gint width, height;
@@ -343,11 +448,10 @@ gtk_hscale_draw_value (GtkScale *scale)
g_return_if_fail (scale != NULL);
g_return_if_fail (GTK_IS_HSCALE (scale));
widget = GTK_WIDGET (scale);
if (scale->draw_value)
{
gdk_window_get_size (GTK_WIDGET (scale)->window, &width, &height);
gdk_window_clear_area (GTK_WIDGET (scale)->window, 1, 1, width - 2, height - 2);
sprintf (buffer, "%0.*f", GTK_RANGE (scale)->digits, GTK_RANGE (scale)->adjustment->value);
text_width = gdk_string_measure (GTK_WIDGET (scale)->style->font, buffer);
@@ -379,7 +483,7 @@ gtk_hscale_draw_value (GtkScale *scale)
gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
x += (width - text_width) / 2;
x += widget->allocation.x + (width - text_width) / 2;
y -= GTK_WIDGET (scale)->style->font->descent;
break;
case GTK_POS_BOTTOM:
@@ -388,7 +492,7 @@ gtk_hscale_draw_value (GtkScale *scale)
gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
x += (width - text_width) / 2;
x += widget->allocation.x + (width - text_width) / 2;
y += height + GTK_WIDGET (scale)->style->font->ascent;
break;
}
@@ -397,9 +501,11 @@ gtk_hscale_draw_value (GtkScale *scale)
if (!GTK_WIDGET_IS_SENSITIVE (scale))
state_type = GTK_STATE_INSENSITIVE;
gtk_draw_string (GTK_WIDGET (scale)->style,
GTK_WIDGET (scale)->window,
state_type, x, y, buffer);
gtk_paint_string (GTK_WIDGET (scale)->style,
GTK_WIDGET (scale)->window,
state_type,
NULL, GTK_WIDGET (scale), "hscale",
x, y, buffer);
}
}
+10 -6
View File
@@ -259,9 +259,11 @@ gtk_hscrollbar_draw_step_forw (GtkRange *range)
else
shadow_type = GTK_SHADOW_OUT;
gtk_draw_arrow (GTK_WIDGET (range)->style, range->step_forw,
state_type, shadow_type, GTK_ARROW_RIGHT,
TRUE, 0, 0, -1, -1);
gtk_paint_arrow (GTK_WIDGET (range)->style, range->step_forw,
state_type, shadow_type,
NULL, GTK_WIDGET (range), "hscrollbar",
GTK_ARROW_RIGHT,
TRUE, 0, 0, -1, -1);
}
}
@@ -291,9 +293,11 @@ gtk_hscrollbar_draw_step_back (GtkRange *range)
else
shadow_type = GTK_SHADOW_OUT;
gtk_draw_arrow (GTK_WIDGET (range)->style, range->step_back,
state_type, shadow_type, GTK_ARROW_LEFT,
TRUE, 0, 0, -1, -1);
gtk_paint_arrow (GTK_WIDGET (range)->style, range->step_back,
state_type, shadow_type,
NULL, GTK_WIDGET (range), "hscrollbar",
GTK_ARROW_LEFT,
TRUE, 0, 0, -1, -1);
}
}
+6 -5
View File
@@ -83,11 +83,12 @@ gtk_hseparator_expose (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
gtk_draw_hline (widget->style, widget->window, GTK_STATE_NORMAL,
widget->allocation.x,
widget->allocation.x + widget->allocation.width,
widget->allocation.y + (widget->allocation.height -
widget->style->klass->ythickness) / 2);
gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL,
&event->area, widget, "hseparator",
widget->allocation.x,
widget->allocation.x + widget->allocation.width,
widget->allocation.y + (widget->allocation.height -
widget->style->klass->ythickness) / 2);
return FALSE;
}
-1
View File
@@ -26,7 +26,6 @@
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
+1
View File
@@ -201,6 +201,7 @@ gtk_item_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
}
static gint
+27 -89
View File
@@ -51,14 +51,9 @@ static void gtk_label_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static gint gtk_label_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_label_state_changed (GtkWidget *widget,
guint previous_state);
static void gtk_label_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_label_free_rows (GtkLabel *label);
static GtkMiscClass *parent_class = NULL;
@@ -109,8 +104,6 @@ gtk_label_class_init (GtkLabelClass *class)
widget_class->size_request = gtk_label_size_request;
widget_class->expose_event = gtk_label_expose;
widget_class->style_set = gtk_label_style_set;
widget_class->state_changed = gtk_label_state_changed;
}
static void
@@ -173,7 +166,6 @@ gtk_label_init (GtkLabel *label)
label->row = NULL;
label->max_width = 0;
label->jtype = GTK_JUSTIFY_CENTER;
label->needs_clear = FALSE;
label->pattern = NULL;
gtk_label_set (label, "");
@@ -233,12 +225,8 @@ gtk_label_set (GtkLabel *label,
if (GTK_WIDGET_VISIBLE (label))
{
if (GTK_WIDGET_MAPPED (label))
gdk_window_clear_area (GTK_WIDGET (label)->window,
GTK_WIDGET (label)->allocation.x,
GTK_WIDGET (label)->allocation.y,
GTK_WIDGET (label)->allocation.width,
GTK_WIDGET (label)->allocation.height);
gtk_widget_queue_clear (GTK_WIDGET (label));
gtk_widget_queue_resize (GTK_WIDGET (label));
}
}
@@ -257,11 +245,7 @@ gtk_label_set_pattern (GtkLabel *label,
if (GTK_WIDGET_VISIBLE (label))
{
if (GTK_WIDGET_MAPPED (label))
gdk_window_clear_area (GTK_WIDGET (label)->window,
GTK_WIDGET (label)->allocation.x,
GTK_WIDGET (label)->allocation.y,
GTK_WIDGET (label)->allocation.width,
GTK_WIDGET (label)->allocation.height);
gtk_widget_queue_clear (GTK_WIDGET (label));
gtk_widget_queue_resize (GTK_WIDGET (label));
}
@@ -281,12 +265,8 @@ gtk_label_set_justify (GtkLabel *label,
if (GTK_WIDGET_VISIBLE (label))
{
if (GTK_WIDGET_MAPPED (label))
gdk_window_clear_area (GTK_WIDGET (label)->window,
GTK_WIDGET (label)->allocation.x,
GTK_WIDGET (label)->allocation.y,
GTK_WIDGET (label)->allocation.width,
GTK_WIDGET (label)->allocation.height);
gtk_widget_queue_clear (GTK_WIDGET (label));
gtk_widget_queue_resize (GTK_WIDGET (label));
}
}
@@ -322,10 +302,11 @@ gtk_label_finalize (GtkObject *object)
}
static gint
gtk_label_process_row (GtkLabel *label,
GtkLabelRow *row,
gint x, gint y,
gboolean draw)
gtk_label_process_row (GtkLabel *label,
GtkLabelRow *row,
gint x, gint y,
gboolean draw,
GdkRectangle *area)
{
GtkWidget *widget = GTK_WIDGET (label);
@@ -382,16 +363,12 @@ gtk_label_process_row (GtkLabel *label,
if (draw)
{
if (widget->state == GTK_STATE_INSENSITIVE)
gdk_draw_line (widget->window,
widget->style->white_gc,
offset + x + lbearing, y + descent + 2,
offset + x + rbearing + 1, y + descent + 2);
gdk_draw_line (widget->window,
widget->style->fg_gc[widget->state],
offset + x + lbearing - 1, y + descent + 1,
offset + x + rbearing, y + descent + 1);
gtk_paint_hline (widget->style, widget->window,
widget->state, area,
widget, "label",
offset + x + lbearing - 1,
offset + x + rbearing,
y + descent + 2);
}
height = MAX (height,
@@ -406,16 +383,12 @@ gtk_label_process_row (GtkLabel *label,
if (draw)
{
if (widget->state == GTK_STATE_INSENSITIVE)
gdk_draw_text (widget->window, widget->style->font,
widget->style->white_gc,
offset + x + 1, y + 1,
&label->label[row->index+j], i - j);
gdk_draw_text (widget->window, widget->style->font,
widget->style->fg_gc[widget->state],
offset + x, y,
&label->label[row->index+j], i - j);
char save = label->label[row->index + i];
label->label[row->index + i] = '\0';
gtk_paint_string(widget->style, widget->window, widget->state,
area, widget, "label", offset + x, y,
&label->label[row->index+j]);
label->label[row->index + i] = save;
}
@@ -459,7 +432,7 @@ gtk_label_size_request (GtkWidget *widget,
row->len);
width = MAX (width, row->width);
requisition->height += gtk_label_process_row (label, row, 0, 0, FALSE) + 2;
requisition->height += gtk_label_process_row (label, row, 0, 0, FALSE, NULL) + 2;
tmp_list = tmp_list->next;
}
@@ -491,24 +464,7 @@ gtk_label_expose (GtkWidget *widget,
*/
gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area);
gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area);
/* We clear the whole allocation here so that if a partial
* expose is triggered we don't just clear part and mess up
* when the queued redraw comes along. (There will always
* be a complete queued redraw when the needs_clear flag
* is set.)
*/
if (label->needs_clear)
{
gdk_window_clear_area (widget->window,
widget->allocation.x,
widget->allocation.y,
widget->allocation.width,
widget->allocation.height);
label->needs_clear = FALSE;
}
x = widget->allocation.x + misc->xpad +
(widget->allocation.width - (label->max_width + label->misc.xpad * 2))
* misc->xalign + 0.5;
@@ -517,7 +473,7 @@ gtk_label_expose (GtkWidget *widget,
(widget->allocation.y + widget->allocation.height -
(widget->requisition.height - misc->ypad * 2)) *
misc->yalign + widget->style->font->ascent) + 1.5;
/*
* COMMENT: we can avoid gdk_text_width() calls here storing in label->row
* the widths of the rows calculated in gtk_label_set.
@@ -527,13 +483,13 @@ gtk_label_expose (GtkWidget *widget,
tmp_list = label->row;
while (tmp_list)
{
y += gtk_label_process_row (label, tmp_list->data, x, y, TRUE) + 2;
y += gtk_label_process_row (label, tmp_list->data, x, y, TRUE, &event->area) + 2;
tmp_list = tmp_list->next;
}
gdk_gc_set_clip_mask (widget->style->white_gc, NULL);
gdk_gc_set_clip_mask (widget->style->fg_gc[widget->state], NULL);
}
return TRUE;
}
@@ -553,22 +509,6 @@ gtk_label_free_rows (GtkLabel *label)
label->row = NULL;
}
static void
gtk_label_state_changed (GtkWidget *widget,
guint previous_state)
{
if (GTK_WIDGET_DRAWABLE (widget))
GTK_LABEL (widget)->needs_clear = TRUE;
}
static void
gtk_label_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (GTK_WIDGET_DRAWABLE (widget))
GTK_LABEL (widget)->needs_clear = TRUE;
}
guint
gtk_label_parse_uline (GtkLabel *label,
const gchar *string)
@@ -631,5 +571,3 @@ gtk_label_parse_uline (GtkLabel *label,
return accel_key;
}
-1
View File
@@ -48,7 +48,6 @@ struct _GtkLabel
GSList *row;
guint max_width : 16;
guint jtype : 2;
guint needs_clear : 1;
};
struct _GtkLabelClass
+1539 -1213
View File
File diff suppressed because it is too large Load Diff
+60 -199
View File
@@ -63,24 +63,6 @@ static void gtk_real_list_item_deselect (GtkItem *item);
static void gtk_real_list_item_toggle (GtkItem *item);
static void gtk_list_item_toggle_focus_row (GtkListItem *list_item);
static void gtk_list_item_select_all (GtkListItem *list_item);
static void gtk_list_item_unselect_all (GtkListItem *list_item);
static void gtk_list_item_undo_selection (GtkListItem *list_item);
static void gtk_list_item_start_selection (GtkListItem *list_item);
static void gtk_list_item_end_selection (GtkListItem *list_item);
static void gtk_list_item_extend_selection (GtkListItem *list_item,
GtkScrollType scroll_type,
gfloat position,
gboolean auto_start_selection);
static void gtk_list_item_scroll_horizontal (GtkListItem *list_item,
GtkScrollType scroll_type,
gfloat position);
static void gtk_list_item_scroll_vertical (GtkListItem *list_item,
GtkScrollType scroll_type,
gfloat position);
static void gtk_list_item_toggle_add_mode (GtkListItem *list_item);
static GtkItemClass *parent_class = NULL;
static guint list_item_signals[LAST_SIGNAL] = {0};
@@ -195,6 +177,7 @@ gtk_list_item_class_init (GtkListItemClass *class)
gtk_marshal_NONE__ENUM_FLOAT,
GTK_TYPE_NONE, 2, GTK_TYPE_ENUM, GTK_TYPE_FLOAT);
gtk_object_class_add_signals (object_class, list_item_signals, LAST_SIGNAL);
widget_class->realize = gtk_list_item_realize;
widget_class->size_request = gtk_list_item_size_request;
@@ -210,16 +193,16 @@ gtk_list_item_class_init (GtkListItemClass *class)
item_class->deselect = gtk_real_list_item_deselect;
item_class->toggle = gtk_real_list_item_toggle;
class->toggle_focus_row = gtk_list_item_toggle_focus_row;
class->select_all = gtk_list_item_select_all;
class->unselect_all = gtk_list_item_unselect_all;
class->undo_selection = gtk_list_item_undo_selection;
class->start_selection = gtk_list_item_start_selection;
class->end_selection = gtk_list_item_end_selection;
class->extend_selection = gtk_list_item_extend_selection;
class->scroll_horizontal = gtk_list_item_scroll_horizontal;
class->scroll_vertical = gtk_list_item_scroll_vertical;
class->toggle_add_mode = gtk_list_item_toggle_add_mode;
class->toggle_focus_row = NULL;
class->select_all = NULL;
class->unselect_all = NULL;
class->undo_selection = NULL;
class->start_selection = NULL;
class->end_selection = NULL;
class->extend_selection = NULL;
class->scroll_horizontal = NULL;
class->scroll_vertical = NULL;
class->toggle_add_mode = NULL;
{
GtkBindingSet *binding_set;
@@ -397,7 +380,6 @@ gtk_list_item_realize (GtkWidget *widget)
gdk_window_set_user_data (widget->window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gdk_window_set_background (widget->window,
&widget->style->base[GTK_STATE_NORMAL]);
@@ -474,60 +456,47 @@ gtk_list_item_draw (GtkWidget *widget,
{
bin = GTK_BIN (widget);
if (!GTK_WIDGET_IS_SENSITIVE (widget))
gtk_style_set_background (widget->style, widget->window, GTK_STATE_INSENSITIVE);
else if (widget->state == GTK_STATE_NORMAL)
gdk_window_set_background (widget->window,
&widget->style->base[GTK_STATE_NORMAL]);
if (widget->state == GTK_STATE_NORMAL)
{
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
}
else
gtk_style_set_background (widget->style, widget->window, widget->state);
gdk_window_clear_area (widget->window, area->x, area->y,
area->width, area->height);
{
gtk_paint_flat_box(widget->style, widget->window,
widget->state, GTK_SHADOW_ETCHED_OUT,
area, widget, "listitem",
0, 0, -1, -1);
}
if (bin->child && gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
gtk_widget_draw_focus (widget);
if (GTK_WIDGET_HAS_FOCUS (widget))
{
if (GTK_IS_LIST (widget->parent) && GTK_LIST (widget->parent)->add_mode)
gtk_paint_focus (widget->style, widget->window,
NULL, widget, "add-mode",
0, 0,
widget->allocation.width - 1,
widget->allocation.height - 1);
else
gtk_paint_focus (widget->style, widget->window,
NULL, widget, NULL,
0, 0,
widget->allocation.width - 1,
widget->allocation.height - 1);
}
}
}
static void
gtk_list_item_draw_focus (GtkWidget *widget)
{
GdkGC *gc;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (widget));
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (widget));
if (GTK_WIDGET_DRAWABLE (widget))
{
if (GTK_WIDGET_HAS_FOCUS (widget))
gc = widget->style->black_gc;
else if (!GTK_WIDGET_IS_SENSITIVE (widget))
gc = widget->style->bg_gc[GTK_STATE_INSENSITIVE];
else if (widget->state == GTK_STATE_NORMAL)
gc = widget->style->base_gc[GTK_STATE_NORMAL];
else
gc = widget->style->bg_gc[widget->state];
if (GTK_IS_LIST (widget->parent) && GTK_LIST (widget->parent)->add_mode)
{
gdk_gc_set_line_attributes (gc, 1, GDK_LINE_ON_OFF_DASH, 0, 0);
gdk_gc_set_dashes (gc, 0, "\4\4", 2);
gdk_draw_rectangle (widget->window, gc, FALSE, 0, 0,
widget->allocation.width - 1,
widget->allocation.height - 1);
gdk_gc_set_line_attributes (gc, 1, GDK_LINE_SOLID, 0, 0);
}
else
gdk_draw_rectangle (widget->window, gc, FALSE, 0, 0,
widget->allocation.width - 1,
widget->allocation.height - 1);
}
gtk_widget_draw(widget, NULL);
}
static gint
@@ -619,7 +588,15 @@ gtk_real_list_item_select (GtkItem *item)
g_return_if_fail (item != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (item));
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED);
switch (GTK_WIDGET (item)->state)
{
case GTK_STATE_SELECTED:
case GTK_STATE_INSENSITIVE:
break;
default:
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED);
break;
}
}
static void
@@ -628,10 +605,8 @@ gtk_real_list_item_deselect (GtkItem *item)
g_return_if_fail (item != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (item));
if (GTK_WIDGET (item)->state == GTK_STATE_NORMAL)
return;
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL);
if (GTK_WIDGET (item)->state == GTK_STATE_SELECTED)
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL);
}
static void
@@ -640,129 +615,15 @@ gtk_real_list_item_toggle (GtkItem *item)
g_return_if_fail (item != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (item));
if (GTK_WIDGET (item)->parent && GTK_IS_LIST (GTK_WIDGET (item)->parent))
gtk_list_select_child (GTK_LIST (GTK_WIDGET (item)->parent),
GTK_WIDGET (item));
else
switch (GTK_WIDGET (item)->state)
{
/* Should we really bother with this bit? A listitem not in a list?
* -Johannes Keukelaar
* yes, always be on the save side!
* -timj
*/
if (GTK_WIDGET (item)->state == GTK_STATE_SELECTED)
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL);
else
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED);
case GTK_STATE_SELECTED:
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL);
break;
case GTK_STATE_INSENSITIVE:
break;
default:
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED);
break;
}
}
static void
gtk_list_item_toggle_focus_row (GtkListItem *list_item)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_toggle_focus_row (GTK_LIST (GTK_WIDGET (list_item)->parent));
}
static void
gtk_list_item_select_all (GtkListItem *list_item)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_select_all (GTK_LIST (GTK_WIDGET (list_item)->parent));
}
static void
gtk_list_item_unselect_all (GtkListItem *list_item)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_unselect_all (GTK_LIST (GTK_WIDGET (list_item)->parent));
}
static void
gtk_list_item_undo_selection (GtkListItem *list_item)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_undo_selection (GTK_LIST (GTK_WIDGET (list_item)->parent));
}
static void
gtk_list_item_start_selection (GtkListItem *list_item)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_start_selection (GTK_LIST (GTK_WIDGET (list_item)->parent));
}
static void
gtk_list_item_end_selection (GtkListItem *list_item)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_end_selection (GTK_LIST (GTK_WIDGET (list_item)->parent));
}
static void
gtk_list_item_extend_selection (GtkListItem *list_item,
GtkScrollType scroll_type,
gfloat position,
gboolean auto_start_selection)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_extend_selection (GTK_LIST (GTK_WIDGET (list_item)->parent),
scroll_type, position, auto_start_selection);
}
static void
gtk_list_item_scroll_horizontal (GtkListItem *list_item,
GtkScrollType scroll_type,
gfloat position)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_scroll_horizontal (GTK_LIST (GTK_WIDGET (list_item)->parent),
scroll_type, position);
}
static void
gtk_list_item_scroll_vertical (GtkListItem *list_item,
GtkScrollType scroll_type,
gfloat position)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_scroll_vertical (GTK_LIST (GTK_WIDGET (list_item)->parent),
scroll_type, position);
}
static void
gtk_list_item_toggle_add_mode (GtkListItem *list_item)
{
g_return_if_fail (list_item != 0);
g_return_if_fail (GTK_IS_LIST_ITEM (list_item));
if (GTK_IS_LIST (GTK_WIDGET (list_item)->parent))
gtk_list_toggle_add_mode (GTK_LIST (GTK_WIDGET (list_item)->parent));
}
+373 -427
View File
@@ -48,7 +48,7 @@
typedef struct _GtkInitFunction GtkInitFunction;
typedef struct _GtkQuitFunction GtkQuitFunction;
typedef struct _GtkTimeoutFunction GtkTimeoutFunction;
typedef struct _GtkIdleFunction GtkIdleFunction;
typedef struct _GtkIdleHook GtkIdleHook;
typedef struct _GtkInputFunction GtkInputFunction;
typedef struct _GtkKeySnooperData GtkKeySnooperData;
@@ -80,16 +80,18 @@ struct _GtkTimeoutFunction
GtkDestroyNotify destroy;
};
struct _GtkIdleFunction
enum
{
guint tag;
gint priority;
GtkCallbackMarshal marshal;
GtkFunction function;
gpointer data;
GtkDestroyNotify destroy;
GTK_HOOK_MARSHAL = 1 << (G_HOOK_FLAG_USER_SHIFT)
};
struct _GtkIdleHook
{
GHook hook;
gint priority;
};
#define GTK_IDLE_HOOK(hook) ((GtkIdleHook*) hook)
struct _GtkInputFunction
{
GtkCallbackMarshal callback;
@@ -104,16 +106,18 @@ struct _GtkKeySnooperData
guint id;
};
static void gtk_exit_func (void);
static void gtk_exit_func (void);
static void gtk_invoke_hook (GHookList *hook_list,
GHook *hook);
static void gtk_handle_idles (void);
static gboolean gtk_finish_idles (void);
static gint gtk_quit_invoke_function (GtkQuitFunction *quitf);
static void gtk_quit_destroy (GtkQuitFunction *quitf);
static void gtk_timeout_insert (GtkTimeoutFunction *timeoutf);
static void gtk_handle_current_timeouts (guint32 the_time);
static void gtk_handle_current_idles (void);
static gint gtk_invoke_key_snoopers (GtkWidget *grab_widget,
GdkEvent *event);
static void gtk_handle_timeouts (void);
static void gtk_handle_idle (void);
static void gtk_handle_timer (void);
static void gtk_propagate_event (GtkWidget *widget,
GdkEvent *event);
@@ -124,17 +128,10 @@ static void gtk_message (gchar *str);
static void gtk_print (gchar *str);
#endif
static gint gtk_idle_remove_from_list (GList **list,
guint tag,
gpointer data,
gint remove_link);
static gint gtk_timeout_remove_from_list (GList **list,
guint tag,
gint remove_link);
static gint gtk_idle_compare (gconstpointer a,
gconstpointer b);
static gint gtk_timeout_compare (gconstpointer a,
gconstpointer b);
@@ -191,23 +188,20 @@ static GList *timeout_functions = NULL; /* A list of timeout functions sorted
* function to expire is at the head of
* the list and the last to expire is at
* the tail of the list. */
static GList *idle_functions = NULL; /* A list of idle functions.
*/
/* Prioritized idle callbacks */
static GHookList idle_hooks = { 0 };
static GHook *last_idle = NULL;
/* The idle functions / timeouts that are currently being processed
* by gtk_handle_current_(timeouts/idles)
/* The timeouts that are currently being processed
* by gtk_handle_current_timeouts
*/
static GList *current_idles = NULL;
static GList *current_timeouts = NULL;
/* A stack of idle functions / timeouts that are currently being
* being executed
/* A stack of timeouts that is currently being executed
*/
static GList *running_idles = NULL;
static GList *running_timeouts = NULL;
static GMemChunk *timeout_mem_chunk = NULL;
static GMemChunk *idle_mem_chunk = NULL;
static GMemChunk *quit_mem_chunk = NULL;
static GSList *key_snoopers = NULL;
@@ -260,8 +254,10 @@ void
gtk_init (int *argc,
char ***argv)
{
GSList *gtk_modinit_funcs = NULL;
GSList *gtk_modules = NULL;
GSList *slist;
gchar *current_locale;
gchar *env_string = NULL;
if (gtk_initialized)
return;
@@ -279,15 +275,33 @@ gtk_init (int *argc,
gdk_init (argc, argv);
#ifdef G_ENABLE_DEBUG
{
gchar *debug_string = getenv("GTK_DEBUG");
if (debug_string != NULL)
gtk_debug_flags = g_parse_debug_string (debug_string,
env_string = getenv ("GTK_DEBUG");
if (env_string != NULL)
{
gtk_debug_flags = g_parse_debug_string (env_string,
gtk_debug_keys,
gtk_ndebug_keys);
}
env_string = NULL;
}
#endif /* G_ENABLE_DEBUG */
env_string = getenv ("GTK_MODULES");
if (env_string)
{
gchar **modules, **as;
modules = g_strsplit (env_string, ":", -1);
for (as = modules; *as; as++)
{
if (**as)
gtk_modules = g_slist_prepend (gtk_modules, *as);
else
g_free (*as);
}
g_free (modules);
env_string = NULL;
}
if (argc && argv)
{
gint i, j, k;
@@ -297,8 +311,6 @@ gtk_init (int *argc,
if (strcmp ("--gtk-module", (*argv)[i]) == 0 ||
strncmp ("--gtk-module=", (*argv)[i], 13) == 0)
{
GModule *module = NULL;
GtkModuleInitFunc modinit_func = NULL;
gchar *module_name = (*argv)[i] + 12;
if (*module_name == '=')
@@ -309,43 +321,9 @@ gtk_init (int *argc,
i += 1;
module_name = (*argv)[i];
}
if (module_name[0] == '/' ||
(module_name[0] == 'l' &&
module_name[1] == 'i' &&
module_name[2] == 'b'))
module_name = g_strdup (module_name);
else
module_name = g_strconcat ("lib", module_name, ".so", NULL);
(*argv)[i] = NULL;
if (g_module_supported ())
{
module = g_module_open (module_name, G_MODULE_BIND_LAZY);
if (module &&
g_module_symbol (module, "gtk_module_init", (gpointer*) &modinit_func) &&
modinit_func)
{
if (!g_slist_find (gtk_modinit_funcs, modinit_func))
{
g_module_make_resident (module);
gtk_modinit_funcs = g_slist_prepend (gtk_modinit_funcs, modinit_func);
}
else
{
g_module_close (module);
module = NULL;
}
}
}
if (!modinit_func)
{
g_warning ("Failed to load module \"%s\": %s",
module ? g_module_name (module) : module_name,
g_module_error ());
if (module)
g_module_close (module);
}
g_free (module_name);
gtk_modules = g_slist_prepend (gtk_modules, g_strdup (module_name));
}
else if (strcmp ("--g-fatal-warnings", (*argv)[i]) == 0)
{
@@ -442,7 +420,58 @@ gtk_init (int *argc,
GTK_NOTE (MISC,
g_message ("%s multi-byte string functions.",
gtk_use_mb ? "Using" : "Not using"));
/* load gtk modules */
gtk_modules = g_slist_reverse (gtk_modules);
for (slist = gtk_modules; slist; slist = slist->next)
{
gchar *module_name;
GModule *module = NULL;
GtkModuleInitFunc modinit_func = NULL;
module_name = slist->data;
slist->data = NULL;
if (!(module_name[0] == '/' ||
(module_name[0] == 'l' &&
module_name[1] == 'i' &&
module_name[2] == 'b')))
{
gchar *old = module_name;
module_name = g_strconcat ("lib", module_name, ".so", NULL);
g_free (old);
}
if (g_module_supported ())
{
module = g_module_open (module_name, G_MODULE_BIND_LAZY);
if (module &&
g_module_symbol (module, "gtk_module_init", (gpointer*) &modinit_func) &&
modinit_func)
{
if (!g_slist_find (gtk_modules, modinit_func))
{
g_module_make_resident (module);
slist->data = modinit_func;
}
else
{
g_module_close (module);
module = NULL;
}
}
}
if (!modinit_func)
{
g_warning ("Failed to load module \"%s\": %s",
module ? g_module_name (module) : module_name,
g_module_error ());
if (module)
g_module_close (module);
}
g_free (module_name);
}
/* Initialize the default visual and colormap to be
* used in creating widgets. (We want to use the system
* defaults so as to be nice to the colormap).
@@ -463,24 +492,19 @@ gtk_init (int *argc,
*/
gtk_initialized = TRUE;
/* initialize modules
/* initialize gtk modules
*/
if (gtk_modinit_funcs)
for (slist = gtk_modules; slist; slist = slist->next)
{
GSList *slist;
slist = gtk_modinit_funcs;
while (slist)
if (slist->data)
{
GtkModuleInitFunc modinit;
modinit = slist->data;
modinit (argc, argv);
slist = slist->next;
}
g_slist_free (gtk_modinit_funcs);
}
g_slist_free (gtk_modules);
}
void
@@ -590,14 +614,16 @@ gtk_events_pending (void)
result += next_event != NULL;
result += gdk_events_pending();
result += current_idles != NULL;
result += last_idle != NULL;
result += current_timeouts != NULL;
if (!result)
{
result += (idle_functions &&
(((GtkIdleFunction *)idle_functions->data)->priority <=
GTK_PRIORITY_INTERNAL));
GHook *hook;
hook = g_hook_first_valid (&idle_hooks, FALSE);
result += hook && GTK_IDLE_HOOK (hook)->priority <= GTK_PRIORITY_INTERNAL;
}
if (!result && timeout_functions)
@@ -644,10 +670,8 @@ gtk_main_iteration_do (gboolean blocking)
return iteration_done;
}
if (current_idles)
if (last_idle && gtk_finish_idles ())
{
gtk_handle_current_idles ();
if (iteration_done)
gdk_flush ();
@@ -674,7 +698,8 @@ gtk_main_iteration_do (gboolean blocking)
*/
gtk_handle_timer ();
if (blocking) event = gdk_event_get ();
if (blocking)
event = gdk_event_get ();
}
/* "gdk_event_get" can return FALSE if the timer goes off
@@ -864,7 +889,7 @@ gtk_main_iteration_do (gboolean blocking)
else
{
if (gdk_events_pending() == 0)
gtk_handle_idle ();
gtk_handle_idles ();
}
event_handling_done:
@@ -1110,17 +1135,6 @@ gtk_timeout_remove (guint tag)
return;
}
/* We rely on some knowledge of how g_list_insert_sorted works to make
* sure that we insert at the _end_ of the idles of this priority
*/
static gint
gtk_idle_compare (gconstpointer a, gconstpointer b)
{
return (((const GtkIdleFunction *)a)->priority <
((const GtkIdleFunction *)b)->priority)
? -1 : 1;
}
guint
gtk_quit_add_full (guint main_level,
GtkFunction function,
@@ -1151,6 +1165,20 @@ gtk_quit_add_full (guint main_level,
return quitf->id;
}
gint
gtk_idle_compare (GHook *new_g_hook,
GHook *g_sibling)
{
GtkIdleHook *new_hook = GTK_IDLE_HOOK (new_g_hook);
GtkIdleHook *sibling = GTK_IDLE_HOOK (g_sibling);
/* We add an extra +1 to the comparision result to make sure
* that we get inserted at the end of the list of hooks with
* the same priority.
*/
return new_hook->priority - sibling->priority + 1;
}
guint
gtk_idle_add_full (gint priority,
GtkFunction function,
@@ -1158,34 +1186,54 @@ gtk_idle_add_full (gint priority,
gpointer data,
GtkDestroyNotify destroy)
{
static guint idle_tag = 1;
GtkIdleFunction *idlef;
g_return_val_if_fail ((function != NULL) || (marshal != NULL), 0);
GHook *hook;
GtkIdleHook *ihook;
if (!idle_mem_chunk)
idle_mem_chunk = g_mem_chunk_new ("idle mem chunk", sizeof (GtkIdleFunction),
1024, G_ALLOC_AND_FREE);
idlef = g_chunk_new (GtkIdleFunction, idle_mem_chunk);
idlef->tag = idle_tag++;
idlef->priority = priority;
idlef->function = function;
idlef->marshal = marshal;
idlef->data = data;
idlef->destroy = destroy;
if (function)
g_return_val_if_fail (marshal == NULL, 0);
else
g_return_val_if_fail (marshal != NULL, 0);
if (!idle_hooks.seq_id)
g_hook_list_init (&idle_hooks, sizeof (GtkIdleHook));
hook = g_hook_alloc (&idle_hooks);
ihook = GTK_IDLE_HOOK (hook);
hook->data = data;
if (marshal)
{
hook->flags |= GTK_HOOK_MARSHAL;
hook->func = marshal;
}
else
hook->func = function;
hook->destroy = destroy;
ihook->priority = priority;
/* If we are adding the first idle function, possibly wake up
* the main thread out of its select().
*/
if (!idle_functions)
if (!g_hook_first_valid (&idle_hooks, TRUE))
gdk_threads_wake ();
idle_functions = g_list_insert_sorted (idle_functions, idlef, gtk_idle_compare);
g_hook_insert_sorted (&idle_hooks, hook, gtk_idle_compare);
return idlef->tag;
return hook->hook_id;
}
guint
gtk_idle_add (GtkFunction function,
gpointer data)
{
return gtk_idle_add_full (GTK_PRIORITY_DEFAULT, function, NULL, data, NULL);
}
guint
gtk_idle_add_priority (gint priority,
GtkFunction function,
gpointer data)
{
return gtk_idle_add_full (priority, function, NULL, data, NULL);
}
guint
@@ -1196,12 +1244,209 @@ gtk_idle_add_interp (GtkCallbackMarshal marshal,
return gtk_idle_add_full (GTK_PRIORITY_DEFAULT, NULL, marshal, data, destroy);
}
static void
gtk_idle_destroy (GtkIdleFunction *idlef)
void
gtk_idle_remove (guint tag)
{
if (idlef->destroy)
idlef->destroy (idlef->data);
g_mem_chunk_free (idle_mem_chunk, idlef);
g_return_if_fail (tag > 0);
if (!g_hook_destroy (&idle_hooks, tag))
g_warning ("gtk_idle_remove(%d): no such idle function", tag);
}
void
gtk_idle_remove_by_data (gpointer data)
{
GHook *hook;
hook = g_hook_find_data (&idle_hooks, TRUE, data);
if (hook)
g_hook_destroy_link (&idle_hooks, hook);
else
g_warning ("gtk_idle_remove_by_data(%p): no such idle function", data);
}
static gboolean
gtk_finish_idles (void)
{
gboolean idles_called;
idles_called = FALSE;
while (last_idle)
{
GHook *hook;
hook = g_hook_next_valid (last_idle, FALSE);
if (!hook || GTK_IDLE_HOOK (hook)->priority != GTK_IDLE_HOOK (last_idle)->priority)
{
g_hook_unref (&idle_hooks, last_idle);
last_idle = NULL;
}
else
{
g_hook_unref (&idle_hooks, last_idle);
last_idle = hook;
g_hook_ref (&idle_hooks, last_idle);
idles_called = TRUE;
gtk_invoke_hook (&idle_hooks, last_idle);
}
}
return idles_called;
}
static void
gtk_handle_idles (void)
{
GHook *hook;
/* Caller must already have called gtk_finish_idles() if necessary
*/
g_assert (last_idle == NULL);
hook = g_hook_first_valid (&idle_hooks, FALSE);
if (hook)
{
last_idle = hook;
g_hook_ref (&idle_hooks, last_idle);
gtk_invoke_hook (&idle_hooks, last_idle);
gtk_finish_idles ();
}
}
static void
gtk_invoke_hook (GHookList *hook_list,
GHook *hook)
{
gboolean keep_alive;
if (hook->flags & GTK_HOOK_MARSHAL)
{
GtkArg args[1];
register GtkCallbackMarshal marshal;
keep_alive = FALSE;
args[0].name = NULL;
args[0].type = GTK_TYPE_BOOL;
GTK_VALUE_POINTER (args[0]) = &keep_alive;
marshal = hook->func;
marshal (NULL, hook->data, 0, args);
}
else
{
register GtkFunction func;
func = hook->func;
keep_alive = func (hook->data);
}
if (!keep_alive)
g_hook_destroy_link (hook_list, hook);
}
static gint
gtk_invoke_timeout_function (GtkTimeoutFunction *timeoutf)
{
if (!timeoutf->marshal)
return timeoutf->function (timeoutf->data);
else
{
GtkArg args[1];
gint ret_val = FALSE;
args[0].name = NULL;
args[0].type = GTK_TYPE_BOOL;
args[0].d.pointer_data = &ret_val;
timeoutf->marshal (NULL, timeoutf->data, 0, args);
return ret_val;
}
}
static void
gtk_handle_current_timeouts (guint32 the_time)
{
gint result;
GList *tmp_list;
GtkTimeoutFunction *timeoutf;
while (current_timeouts)
{
tmp_list = current_timeouts;
timeoutf = tmp_list->data;
current_timeouts = g_list_remove_link (current_timeouts, tmp_list);
if (running_timeouts)
{
running_timeouts->prev = tmp_list;
tmp_list->next = running_timeouts;
}
running_timeouts = tmp_list;
result = gtk_invoke_timeout_function (timeoutf);
running_timeouts = g_list_remove_link (running_timeouts, tmp_list);
timeoutf = tmp_list->data;
g_list_free_1 (tmp_list);
if (timeoutf)
{
if (!result)
{
gtk_timeout_destroy (timeoutf);
}
else
{
timeoutf->interval = timeoutf->originterval;
timeoutf->start = the_time;
gtk_timeout_insert (timeoutf);
}
}
}
}
static void
gtk_handle_timeouts (void)
{
guint32 the_time;
GList *tmp_list;
GList *tmp_list2;
GtkTimeoutFunction *timeoutf;
/* Caller must already have called gtk_handle_current_timeouts if
* necessary */
g_assert (current_timeouts == NULL);
if (timeout_functions)
{
the_time = gdk_time_get ();
tmp_list = timeout_functions;
while (tmp_list)
{
timeoutf = tmp_list->data;
if (timeoutf->interval <= (the_time - timeoutf->start))
{
tmp_list2 = tmp_list;
tmp_list = tmp_list->next;
timeout_functions = g_list_remove_link (timeout_functions, tmp_list2);
current_timeouts = g_list_concat (current_timeouts, tmp_list2);
}
else
{
timeoutf->interval -= (the_time - timeoutf->start);
timeoutf->start = the_time;
tmp_list = tmp_list->next;
}
}
if (current_timeouts)
gtk_handle_current_timeouts (the_time);
}
}
static void
@@ -1249,21 +1494,6 @@ gtk_quit_add (guint main_level,
return gtk_quit_add_full (main_level, function, NULL, data, NULL);
}
guint
gtk_idle_add (GtkFunction function,
gpointer data)
{
return gtk_idle_add_full (GTK_PRIORITY_DEFAULT, function, NULL, data, NULL);
}
guint
gtk_idle_add_priority (gint priority,
GtkFunction function,
gpointer data)
{
return gtk_idle_add_full (priority, function, NULL, data, NULL);
}
void
gtk_quit_remove (guint id)
{
@@ -1312,72 +1542,6 @@ gtk_quit_remove_by_data (gpointer data)
}
}
/* Search for the specified tag in a list of idles. If it
* is found, destroy the idle, and either remove the link
* or set link->data to NULL depending on remove_link
*
* If tag != 0, match tag against idlef->tag, otherwise, match
* data against idlef->data
*/
static gint
gtk_idle_remove_from_list (GList **list,
guint tag,
gpointer data,
gint remove_link)
{
GtkIdleFunction *idlef;
GList *tmp_list;
tmp_list = *list;
while (tmp_list)
{
idlef = tmp_list->data;
if (((tag != 0) && (idlef->tag == tag)) ||
((tag == 0) && (idlef->data == data)))
{
if (remove_link)
{
*list = g_list_remove_link (*list, tmp_list);
g_list_free (tmp_list);
}
else
tmp_list->data = NULL;
gtk_idle_destroy (idlef);
return TRUE;
}
tmp_list = tmp_list->next;
}
return FALSE;
}
void
gtk_idle_remove (guint tag)
{
g_return_if_fail (tag != 0);
if (gtk_idle_remove_from_list (&idle_functions, tag, NULL, TRUE))
return;
if (gtk_idle_remove_from_list (&current_idles, tag, NULL, TRUE))
return;
if (gtk_idle_remove_from_list (&running_idles, tag, NULL, FALSE))
return;
}
void
gtk_idle_remove_by_data (gpointer data)
{
if (gtk_idle_remove_from_list (&idle_functions, 0, data, TRUE))
return;
if (gtk_idle_remove_from_list (&current_idles, 0, data, TRUE))
return;
if (gtk_idle_remove_from_list (&running_idles, 0, data, FALSE))
return;
}
static void
gtk_invoke_input_function (GtkInputFunction *input,
gint source,
@@ -1493,108 +1657,6 @@ gtk_timeout_insert (GtkTimeoutFunction *timeoutf)
gtk_timeout_compare);
}
static gint
gtk_invoke_timeout_function (GtkTimeoutFunction *timeoutf)
{
if (!timeoutf->marshal)
return timeoutf->function (timeoutf->data);
else
{
GtkArg args[1];
gint ret_val = FALSE;
args[0].name = NULL;
args[0].type = GTK_TYPE_BOOL;
args[0].d.pointer_data = &ret_val;
timeoutf->marshal (NULL, timeoutf->data, 0, args);
return ret_val;
}
}
static void
gtk_handle_current_timeouts (guint32 the_time)
{
gint result;
GList *tmp_list;
GtkTimeoutFunction *timeoutf;
while (current_timeouts)
{
tmp_list = current_timeouts;
timeoutf = tmp_list->data;
current_timeouts = g_list_remove_link (current_timeouts, tmp_list);
if (running_timeouts)
{
running_timeouts->prev = tmp_list;
tmp_list->next = running_timeouts;
}
running_timeouts = tmp_list;
result = gtk_invoke_timeout_function (timeoutf);
running_timeouts = g_list_remove_link (running_timeouts, tmp_list);
timeoutf = tmp_list->data;
g_list_free_1 (tmp_list);
if (timeoutf)
{
if (!result)
{
gtk_timeout_destroy (timeoutf);
}
else
{
timeoutf->interval = timeoutf->originterval;
timeoutf->start = the_time;
gtk_timeout_insert (timeoutf);
}
}
}
}
static void
gtk_handle_timeouts (void)
{
guint32 the_time;
GList *tmp_list;
GList *tmp_list2;
GtkTimeoutFunction *timeoutf;
/* Caller must already have called gtk_handle_current_timeouts if
* necessary */
g_assert (current_timeouts == NULL);
if (timeout_functions)
{
the_time = gdk_time_get ();
tmp_list = timeout_functions;
while (tmp_list)
{
timeoutf = tmp_list->data;
if (timeoutf->interval <= (the_time - timeoutf->start))
{
tmp_list2 = tmp_list;
tmp_list = tmp_list->next;
timeout_functions = g_list_remove_link (timeout_functions, tmp_list2);
current_timeouts = g_list_concat (current_timeouts, tmp_list2);
}
else
{
timeoutf->interval -= (the_time - timeoutf->start);
timeoutf->start = the_time;
tmp_list = tmp_list->next;
}
}
if (current_timeouts)
gtk_handle_current_timeouts (the_time);
}
}
static gint
gtk_quit_invoke_function (GtkQuitFunction *quitf)
{
@@ -1615,128 +1677,12 @@ gtk_quit_invoke_function (GtkQuitFunction *quitf)
}
}
static gint
gtk_idle_invoke_function (GtkIdleFunction *idlef)
{
if (!idlef->marshal)
return idlef->function (idlef->data);
else
{
GtkArg args[1];
gint ret_val = FALSE;
args[0].name = NULL;
args[0].type = GTK_TYPE_BOOL;
args[0].d.pointer_data = &ret_val;
((GtkCallbackMarshal) idlef->marshal) (NULL,
idlef->data,
0, args);
return ret_val;
}
}
static void
gtk_handle_current_idles (void)
{
GList *tmp_list;
GList *tmp_list2;
GtkIdleFunction *idlef;
gint result;
while (current_idles)
{
tmp_list = current_idles;
idlef = tmp_list->data;
current_idles = g_list_remove_link (current_idles, tmp_list);
if (running_idles)
{
running_idles->prev = tmp_list;
tmp_list->next = running_idles;
}
running_idles = tmp_list;
result = gtk_idle_invoke_function (idlef);
running_idles = g_list_remove_link (running_idles, tmp_list);
idlef = tmp_list->data;
if (!idlef || !result)
{
g_list_free (tmp_list);
if (idlef)
gtk_idle_destroy (idlef);
}
else
{
/* Insert the idle function back into the list of idle
* functions at the end of the idles of this priority
*/
tmp_list2 = idle_functions;
while (tmp_list2 &&
(((GtkIdleFunction *)tmp_list2->data)->priority <= idlef->priority))
tmp_list2 = tmp_list2->next;
if (!tmp_list2)
idle_functions = g_list_concat (idle_functions, tmp_list);
else if (tmp_list2 == idle_functions)
{
tmp_list->next = idle_functions;
if (idle_functions)
idle_functions->prev = tmp_list;
idle_functions = tmp_list;
}
else
{
tmp_list->prev = tmp_list2->prev;
tmp_list->next = tmp_list2;
tmp_list2->prev->next = tmp_list;
tmp_list2->prev = tmp_list;
}
}
}
}
static void
gtk_handle_idle (void)
{
/* Caller must already have called gtk_handle_current_idles if
* necessary
*/
g_assert (current_idles == NULL);
/* Handle only the idle functions that have the highest priority */
if (idle_functions)
{
GList *tmp_list;
gint top_priority;
tmp_list = idle_functions;
top_priority = ((GtkIdleFunction *)tmp_list->data)->priority;
while (tmp_list &&
(((GtkIdleFunction *)tmp_list->data)->priority == top_priority))
tmp_list = tmp_list->next;
current_idles = idle_functions;
idle_functions = tmp_list;
if (tmp_list)
{
tmp_list->prev->next = NULL;
tmp_list->prev = NULL;
}
gtk_handle_current_idles();
}
}
static void
gtk_handle_timer (void)
{
GtkTimeoutFunction *timeoutf;
if (idle_functions)
if (g_hook_first_valid (&idle_hooks, FALSE))
{
gdk_timer_set (0);
gdk_timer_enable ();
+8 -7
View File
@@ -668,6 +668,7 @@ gtk_menu_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_menu_paint(widget);
}
static void
@@ -788,13 +789,12 @@ gtk_menu_paint (GtkWidget *widget)
if (GTK_WIDGET_DRAWABLE (widget))
{
gtk_draw_shadow (widget->style,
widget->window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
0, 0,
widget->allocation.width,
widget->allocation.height);
gtk_paint_box (widget->style,
widget->window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
NULL, widget, "menu",
0, 0, -1, -1);
}
}
@@ -1086,3 +1086,4 @@ gtk_menu_hide_all (GtkWidget *widget)
/* Hide children, but not self. */
gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_hide_all, NULL);
}
+13 -12
View File
@@ -33,7 +33,8 @@ static void gtk_menu_bar_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_menu_bar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_menu_bar_paint (GtkWidget *widget);
static void gtk_menu_bar_paint (GtkWidget *widget,
GdkRectangle *area);
static void gtk_menu_bar_draw (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_menu_bar_expose (GtkWidget *widget,
@@ -262,20 +263,20 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
}
static void
gtk_menu_bar_paint (GtkWidget *widget)
gtk_menu_bar_paint (GtkWidget *widget, GdkRectangle *area)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_MENU_BAR (widget));
if (GTK_WIDGET_DRAWABLE (widget))
{
gtk_draw_shadow (widget->style,
widget->window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
0, 0,
widget->allocation.width,
widget->allocation.height);
gtk_paint_box (widget->style,
widget->window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
area, widget, "menubar",
0, 0,
-1,-1);
}
}
@@ -294,7 +295,7 @@ gtk_menu_bar_draw (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
gtk_menu_bar_paint (widget);
gtk_menu_bar_paint (widget, area);
menu_shell = GTK_MENU_SHELL (widget);
@@ -315,9 +316,9 @@ gtk_menu_bar_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkMenuShell *menu_shell;
GtkWidget *child;
GdkEventExpose child_event;
GList *children;
GtkWidget *child;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_MENU_BAR (widget), FALSE);
@@ -325,7 +326,7 @@ gtk_menu_bar_expose (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
gtk_menu_bar_paint (widget);
gtk_menu_bar_paint (widget, &event->area);
menu_shell = GTK_MENU_SHELL (widget);
child_event = *event;
+20 -14
View File
@@ -415,21 +415,24 @@ gtk_menu_item_paint (GtkWidget *widget,
if (!GTK_WIDGET_IS_SENSITIVE (widget))
state_type = GTK_STATE_INSENSITIVE;
gtk_style_set_background (widget->style, widget->window, state_type);
gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
x = GTK_CONTAINER (menu_item)->border_width;
y = GTK_CONTAINER (menu_item)->border_width;
width = widget->allocation.width - x * 2;
height = widget->allocation.height - y * 2;
if ((state_type == GTK_STATE_PRELIGHT) &&
(GTK_BIN (menu_item)->child))
gtk_draw_shadow (widget->style,
widget->window,
GTK_STATE_PRELIGHT,
GTK_SHADOW_OUT,
x, y, width, height);
gtk_paint_box (widget->style,
widget->window,
GTK_STATE_PRELIGHT,
GTK_SHADOW_OUT,
area, widget, "menuitem",
x, y, width, height);
else
{
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
}
if (menu_item->submenu && menu_item->show_submenu_indicator)
{
@@ -437,14 +440,17 @@ gtk_menu_item_paint (GtkWidget *widget,
if (state_type == GTK_STATE_PRELIGHT)
shadow_type = GTK_SHADOW_IN;
gtk_draw_arrow (widget->style, widget->window,
state_type, shadow_type, GTK_ARROW_RIGHT, FALSE,
x + width - 15, y + height / 2 - 5, 10, 10);
gtk_paint_arrow (widget->style, widget->window,
state_type, shadow_type,
area, widget, "menuitem",
GTK_ARROW_RIGHT, TRUE,
x + width - 15, y + height / 2 - 5, 10, 10);
}
else if (!GTK_BIN (menu_item)->child)
{
gtk_draw_hline (widget->style, widget->window, GTK_STATE_NORMAL,
0, widget->allocation.width, 0);
gtk_paint_hline (widget->style, widget->window, GTK_STATE_NORMAL,
area, widget, "menuitem",
0, widget->allocation.width, 0);
}
}
}
+6 -2
View File
@@ -868,7 +868,9 @@ gtk_menu_shell_move_selected (GtkMenuShell *menu_shell,
{
node = node->next;
while (node != start_node &&
(!node || !GTK_WIDGET_SENSITIVE (node->data)))
(!node ||
!GTK_WIDGET_SENSITIVE (node->data) ||
!GTK_WIDGET_VISIBLE (node->data) ))
{
if (!node)
node = menu_shell->children;
@@ -880,7 +882,9 @@ gtk_menu_shell_move_selected (GtkMenuShell *menu_shell,
{
node = node->prev;
while (node != start_node &&
(!node || !GTK_WIDGET_SENSITIVE (node->data)))
(!node ||
!GTK_WIDGET_SENSITIVE (node->data) ||
!GTK_WIDGET_VISIBLE (node->data) ))
{
if (!node)
node = g_list_last (menu_shell->children);
+1 -6
View File
@@ -182,12 +182,7 @@ gtk_misc_set_alignment (GtkMisc *misc,
GtkWidget *widget;
widget = GTK_WIDGET (misc);
gdk_window_clear_area (widget->window,
widget->allocation.x,
widget->allocation.y,
widget->allocation.width,
widget->allocation.height);
gtk_widget_queue_draw (GTK_WIDGET (misc));
gtk_widget_queue_clear (widget);
}
}
}
+262 -424
View File
@@ -28,8 +28,8 @@
#define TAB_OVERLAP 2
#define TAB_CURVATURE 1
#define ARROW_SIZE 11
#define ARROW_SPACING 3
#define ARROW_SIZE 12
#define ARROW_SPACING 0
#define NOTEBOOK_INIT_SCROLL_DELAY (200)
#define NOTEBOOK_SCROLL_DELAY (100)
@@ -168,7 +168,9 @@ static void gtk_notebook_menu_item_create (GtkNotebook *notebook,
static GtkType gtk_notebook_child_type (GtkContainer *container);
static gint gtk_notebook_find_page (gconstpointer a,
gconstpointer b);
static void gtk_notebook_set_shape (GtkNotebook *notebook);
static void gtk_notebook_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static GtkContainerClass *parent_class = NULL;
static guint notebook_signals[LAST_SIGNAL] = { 0 };
@@ -254,7 +256,8 @@ gtk_notebook_class_init (GtkNotebookClass *class)
widget_class->focus_in_event = gtk_notebook_focus_in;
widget_class->focus_out_event = gtk_notebook_focus_out;
widget_class->draw_focus = gtk_notebook_draw_focus;
widget_class->style_set = gtk_notebook_style_set;
container_class->add = gtk_notebook_add;
container_class->remove = gtk_notebook_remove;
container_class->forall = gtk_notebook_forall;
@@ -643,7 +646,7 @@ gtk_notebook_insert_page_menu (GtkNotebook *notebook,
page->allocation.height = 0;
page->default_menu = FALSE;
page->default_tab = FALSE;
nchildren = g_list_length (notebook->children);
if ((position < 0) || (position > nchildren))
position = nchildren;
@@ -1182,11 +1185,7 @@ gtk_notebook_set_tab_pos (GtkNotebook *notebook,
notebook->tab_pos = pos;
if (GTK_WIDGET_VISIBLE (notebook))
{
gtk_widget_queue_resize (GTK_WIDGET (notebook));
if (notebook->panel)
gdk_window_clear (notebook->panel);
}
gtk_widget_queue_resize (GTK_WIDGET (notebook));
}
}
@@ -1275,17 +1274,28 @@ gtk_notebook_set_scrollable (GtkNotebook *notebook,
g_return_if_fail (notebook != NULL);
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
scrollable = (scrollable != FALSE);
if (scrollable != notebook->scrollable)
{
if ( (notebook->scrollable = (scrollable != 0)) )
gtk_notebook_panel_realize (notebook);
else if (notebook->panel)
notebook->scrollable = scrollable;
if (GTK_WIDGET_REALIZED (notebook))
{
gdk_window_destroy (notebook->panel);
notebook->panel = NULL;
if (scrollable)
{
gtk_notebook_panel_realize (notebook);
}
else if (notebook->panel)
{
gdk_window_destroy (notebook->panel);
notebook->panel = NULL;
}
}
gtk_widget_queue_resize (GTK_WIDGET(notebook));
}
if (GTK_WIDGET_VISIBLE (notebook))
gtk_widget_queue_resize (GTK_WIDGET(notebook));
}
}
static void
@@ -1361,8 +1371,8 @@ gtk_notebook_realize (GtkWidget *widget)
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK;
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
@@ -1372,6 +1382,7 @@ gtk_notebook_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
if (notebook->scrollable)
gtk_notebook_panel_realize (notebook);
}
@@ -1417,6 +1428,7 @@ gtk_notebook_panel_realize (GtkNotebook *notebook)
attributes_mask);
gtk_style_set_background (widget->style, notebook->panel,
GTK_STATE_NORMAL);
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
gdk_window_set_user_data (notebook->panel, widget);
}
@@ -1636,6 +1648,7 @@ gtk_notebook_size_allocate (GtkWidget *widget,
gtk_notebook_pages_allocate (notebook, allocation);
}
gtk_notebook_set_shape (notebook);
}
static void
@@ -1645,11 +1658,11 @@ gtk_notebook_paint (GtkWidget *widget,
GtkNotebook *notebook;
GtkNotebookPage *page;
GList *children;
GdkPoint points[6];
gint width, height;
gint x, y;
gint showarrow;
gint gap_x = 0, gap_width = 0;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_NOTEBOOK (widget));
g_return_if_fail (area != NULL);
@@ -1658,10 +1671,6 @@ gtk_notebook_paint (GtkWidget *widget,
{
notebook = GTK_NOTEBOOK (widget);
gdk_window_clear_area (widget->window,
area->x, area->y,
area->width, area->height);
if (notebook->show_tabs || notebook->show_border)
{
x = GTK_CONTAINER (widget)->border_width;
@@ -1693,16 +1702,15 @@ gtk_notebook_paint (GtkWidget *widget,
case GTK_POS_RIGHT:
width -= page->allocation.width +
widget->style->klass->xthickness;
break;
break;
}
gtk_draw_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
x, y, width, height);
gtk_paint_box (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
area, widget, "notebook",
x, y, width, height);
}
else
{
gint i = 0;
switch (notebook->tab_pos)
{
case GTK_POS_TOP:
@@ -1716,141 +1724,35 @@ gtk_notebook_paint (GtkWidget *widget,
width -= notebook->cur_page->allocation.width;
break;
}
switch (notebook->tab_pos)
switch (notebook->tab_pos)
{
case GTK_POS_TOP:
if (x != notebook->cur_page->allocation.x)
{
points[i].x = notebook->cur_page->allocation.x;
points[i++].y = y;
}
points[i].x = x;
points[i++].y = y;
points[i].x = x;
points[i++].y = y + height - 1;
points[i].x = x + width - 1;
points[i++].y = y + height - 1;
points[i].x = x + width - 1;
points[i++].y = y;
if ((notebook->cur_page->allocation.x +
notebook->cur_page->allocation.width -
widget->style->klass->xthickness) <
x + width - widget->style->klass->xthickness)
{
points[i].x = (notebook->cur_page->allocation.x +
notebook->cur_page->allocation.width -
widget->style->klass->xthickness);
if (points[i].x == (x + width))
points[i].x -= 1;
points[i++].y = y;
}
gap_x = notebook->cur_page->allocation.x -
GTK_CONTAINER(notebook)->border_width;
gap_width = notebook->cur_page->allocation.width;
break;
case GTK_POS_BOTTOM:
if ((notebook->cur_page->allocation.x +
notebook->cur_page->allocation.width -
widget->style->klass->xthickness) <
x + width - widget->style->klass->xthickness)
{
points[i].x = (notebook->cur_page->allocation.x +
notebook->cur_page->allocation.width -
widget->style->klass->xthickness);
if (points[i].x == (x + width))
points[i].x -= 1;
points[i++].y = y + height - 1;
}
points[i].x = x + width - 1;
points[i++].y = y + height - 1;
points[i].x = x + width - 1;
points[i++].y = y;
points[i].x = x;
points[i++].y = y;
points[i].x = x;
points[i++].y = y + height - 1;
if (notebook->cur_page->allocation.x != x)
{
points[i].x = notebook->cur_page->allocation.x;
points[i++].y = y + height - 1;
}
gap_x = notebook->cur_page->allocation.x -
GTK_CONTAINER(notebook)->border_width;
gap_width = notebook->cur_page->allocation.width;
break;
case GTK_POS_LEFT:
if ((notebook->cur_page->allocation.y +
notebook->cur_page->allocation.height -
widget->style->klass->ythickness) <
y + height - widget->style->klass->ythickness)
{
points[i].x = x;
points[i++].y = notebook->cur_page->allocation.y +
notebook->cur_page->allocation.height -
widget->style->klass->ythickness;
if (points[0].y == (y + height))
points[0].y -= 1;
}
points[i].x = x;
points[i++].y = y + height - 1;
points[i].x = x + width - 1;
points[i++].y = y + height - 1;
points[i].x = x + width - 1;
points[i++].y = y;
points[i].x = x;
points[i++].y = y;
if (notebook->cur_page->allocation.y != y)
{
points[i].x = x;
points[i++].y = notebook->cur_page->allocation.y;
}
gap_x = notebook->cur_page->allocation.y -
GTK_CONTAINER(notebook)->border_width;
gap_width = notebook->cur_page->allocation.height;
break;
case GTK_POS_RIGHT:
if (notebook->cur_page->allocation.y != y)
{
points[i].x = x + width - 1;
points[i++].y = notebook->cur_page->allocation.y;
}
points[i].x = x + width - 1;
points[i++].y = y;
points[i].x = x;
points[i++].y = y;
points[i].x = x;
points[i++].y = y + height - 1;
points[i].x = x + width - 1;
points[i++].y = y + height - 1;
if ((notebook->cur_page->allocation.y +
notebook->cur_page->allocation.height -
widget->style->klass->ythickness) <
y + height - widget->style->klass->ythickness)
{
points[i].x = x + width - 1;
points[i++].y = notebook->cur_page->allocation.y +
notebook->cur_page->allocation.height -
widget->style->klass->ythickness;
if (points[i - 1].y == (y + height))
points[i - 1].y -= 1;
}
gap_x = notebook->cur_page->allocation.y -
GTK_CONTAINER(notebook)->border_width;
gap_width = notebook->cur_page->allocation.height;
break;
}
gtk_draw_polygon (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
points, i, FALSE);
gtk_paint_box_gap(widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
area, widget, "notebook",
x, y, width, height,
notebook->tab_pos, gap_x, gap_width);
}
children = g_list_last (notebook->children);
showarrow = FALSE;
@@ -1878,9 +1780,10 @@ gtk_notebook_paint (GtkWidget *widget,
}
else if (notebook->show_border)
{
gtk_draw_shadow (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
x, y, width, height);
gtk_paint_box(widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
area, widget, "notebook",
x, y, width, height);
}
}
}
@@ -1916,7 +1819,8 @@ gtk_notebook_expose (GtkWidget *widget,
{
GtkNotebook *notebook;
GdkEventExpose child_event;
GdkRectangle child_area;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_NOTEBOOK (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -1926,7 +1830,10 @@ gtk_notebook_expose (GtkWidget *widget,
notebook = GTK_NOTEBOOK (widget);
gtk_notebook_paint (widget, &event->area);
gtk_widget_draw_focus (widget);
if (notebook->cur_page &&
gtk_widget_intersect (notebook->cur_page->tab_label,
&event->area, &child_area))
gtk_widget_draw_focus (widget);
child_event = *event;
if (notebook->cur_page &&
@@ -2059,6 +1966,7 @@ gtk_notebook_button_press (GtkWidget *widget,
if (!children && !GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
}
gtk_notebook_set_shape (notebook);
return FALSE;
}
@@ -2277,9 +2185,12 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook, guint arrow)
if (notebook->tab_pos == GTK_POS_LEFT ||
notebook->tab_pos == GTK_POS_RIGHT)
arrow = GTK_ARROW_UP;
gtk_draw_arrow (widget->style, notebook->panel, state_type,
shadow_type, arrow, TRUE,
0, 0, ARROW_SIZE, ARROW_SIZE);
gdk_window_clear_area (notebook->panel, 0, 0, ARROW_SIZE, ARROW_SIZE);
gtk_paint_arrow (widget->style, notebook->panel, state_type,
shadow_type, NULL, GTK_WIDGET(notebook), "notebook",
arrow, TRUE,
0, 0, ARROW_SIZE, ARROW_SIZE);
}
else
{
@@ -2292,9 +2203,12 @@ gtk_notebook_draw_arrow (GtkNotebook *notebook, guint arrow)
if (notebook->tab_pos == GTK_POS_LEFT ||
notebook->tab_pos == GTK_POS_RIGHT)
arrow = GTK_ARROW_DOWN;
gtk_draw_arrow (widget->style, notebook->panel, state_type,
shadow_type, arrow, TRUE, ARROW_SIZE + ARROW_SPACING,
0, ARROW_SIZE, ARROW_SIZE);
gdk_window_clear_area(notebook->panel, ARROW_SIZE + ARROW_SPACING,
0, ARROW_SIZE, ARROW_SIZE);
gtk_paint_arrow (widget->style, notebook->panel, state_type,
shadow_type, NULL, GTK_WIDGET(notebook), "notebook",
arrow, TRUE, ARROW_SIZE + ARROW_SPACING,
0, ARROW_SIZE, ARROW_SIZE);
}
}
}
@@ -2322,7 +2236,6 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
g_list_find (notebook->children, notebook->cur_page);
gtk_notebook_pages_allocate (notebook, &GTK_WIDGET (notebook)->allocation);
gtk_notebook_expose_tabs (notebook);
if (GTK_WIDGET_MAPPED (notebook))
{
@@ -2338,6 +2251,7 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
if (GTK_WIDGET_DRAWABLE (notebook))
gtk_widget_queue_draw (GTK_WIDGET (notebook));
gtk_notebook_set_shape (notebook);
}
static void
@@ -2348,14 +2262,14 @@ gtk_notebook_draw_tab (GtkNotebook *notebook,
GdkRectangle child_area;
GdkRectangle page_area;
GtkStateType state_type;
GdkPoint points[6];
gint n = 0;
GtkPositionType gap_side;
g_return_if_fail (notebook != NULL);
g_return_if_fail (page != NULL);
g_return_if_fail (area != NULL);
if (!GTK_WIDGET_MAPPED (page->tab_label))
if (!GTK_WIDGET_MAPPED (page->tab_label) ||
(page->allocation.width == 0) || (page->allocation.height == 0))
return;
page_area.x = page->allocation.x;
@@ -2367,207 +2281,45 @@ gtk_notebook_draw_tab (GtkNotebook *notebook,
{
GtkWidget *widget;
widget = GTK_WIDGET (notebook);
gap_side = 0;
switch (notebook->tab_pos)
{
case GTK_POS_TOP:
if (child_area.x + child_area.width >
page->allocation.x + page->allocation.width - TAB_OVERLAP)
{
points[0].x = page->allocation.x + page->allocation.width - 1;
points[0].y = page->allocation.y + page->allocation.height - 1;
points[1].x = page->allocation.x + page->allocation.width - 1;
points[1].y = page->allocation.y + TAB_CURVATURE;
points[2].x = page->allocation.x + page->allocation.width
- TAB_CURVATURE - 1;
points[2].y = page->allocation.y;
n = 3;
}
else
{
points[0].x = page->allocation.x + page->allocation.width
- TAB_OVERLAP - 1;
points[0].y = page->allocation.y;
n = 1;
}
if ( (child_area.x < page->allocation.x + TAB_OVERLAP) &&
(page == notebook->cur_page ||
page == (GtkNotebookPage *)(notebook->children->data) ||
(notebook->scrollable &&
page == (GtkNotebookPage *)(notebook->first_tab->data))) )
{
points[n].x = page->allocation.x + TAB_CURVATURE;
points[n++].y = page->allocation.y;
points[n].x = page->allocation.x;
points[n++].y = page->allocation.y + TAB_CURVATURE;
points[n].x = page->allocation.x;
points[n++].y = page->allocation.y + page->allocation.height - 1;
}
else
{
points[n].x = page->allocation.x + TAB_OVERLAP;
points[n++].y = page->allocation.y;
}
gap_side = GTK_POS_BOTTOM;
break;
case GTK_POS_BOTTOM:
if ( (child_area.x < page->allocation.x + TAB_OVERLAP) &&
(page == notebook->cur_page ||
page == (GtkNotebookPage *)(notebook->children->data) ||
(notebook->scrollable &&
page == (GtkNotebookPage *)(notebook->first_tab->data))) )
{
points[0].x = page->allocation.x;
points[0].y = page->allocation.y;
points[1].x = page->allocation.x;
points[1].y = page->allocation.y + page->allocation.height
- TAB_CURVATURE - 1;
points[2].x = page->allocation.x + TAB_CURVATURE;
points[2].y = page->allocation.y + page->allocation.height - 1;
n = 3;
}
else
{
points[0].x = page->allocation.x + TAB_OVERLAP;
points[0].y = page->allocation.y + page->allocation.height - 1;
n = 1;
}
if (child_area.x + child_area.width >
page->allocation.x + page->allocation.width - TAB_OVERLAP)
{
points[n].x = page->allocation.x + page->allocation.width
- TAB_CURVATURE - 1;
points[n++].y = page->allocation.y + page->allocation.height - 1;
points[n].x = page->allocation.x + page->allocation.width - 1;
points[n++].y = page->allocation.y + page->allocation.height
- TAB_CURVATURE - 1;
points[n].x = page->allocation.x + page->allocation.width - 1;
points[n++].y = page->allocation.y;
}
else
{
points[n].x = page->allocation.x + page->allocation.width
- TAB_OVERLAP - 1;
points[n++].y = page->allocation.y + page->allocation.height - 1;
}
gap_side = GTK_POS_TOP;
break;
case GTK_POS_LEFT:
if ( (child_area.y < page->allocation.y + TAB_OVERLAP) &&
(page == notebook->cur_page ||
page == (GtkNotebookPage *)(notebook->children->data) ||
(notebook->scrollable &&
page == (GtkNotebookPage *)(notebook->first_tab->data))) )
{
points[0].x = page->allocation.x + page->allocation.width - 1;
points[0].y = page->allocation.y;
points[1].x = page->allocation.x + TAB_CURVATURE;
points[1].y = page->allocation.y;
points[2].x = page->allocation.x;
points[2].y = page->allocation.y + TAB_CURVATURE;
n = 3;
}
else
{
points[0].x = page->allocation.x;
points[0].y = page->allocation.y + TAB_OVERLAP;
n = 1;
}
if (child_area.y + child_area.height >
page->allocation.y + page->allocation.height - TAB_OVERLAP)
{
points[n].x = page->allocation.x;
points[n++].y = page->allocation.y + page->allocation.height
- TAB_CURVATURE - 1;
points[n].x = page->allocation.x + TAB_CURVATURE;
points[n++].y = page->allocation.y + page->allocation.height - 1;
points[n].x = page->allocation.x + page->allocation.width - 1;
points[n++].y = page->allocation.y + page->allocation.height - 1;
}
else
{
points[n].x = page->allocation.x;
points[n++].y = page->allocation.y + page->allocation.height
- TAB_OVERLAP - 1;
}
gap_side = GTK_POS_RIGHT;
break;
case GTK_POS_RIGHT:
if (child_area.y + child_area.height >
page->allocation.y + page->allocation.height - TAB_OVERLAP)
{
points[0].x = page->allocation.x;
points[0].y = page->allocation.y + page->allocation.height - 1;
points[1].x = page->allocation.x + page->allocation.width
- TAB_CURVATURE - 1;
points[1].y = page->allocation.y + page->allocation.height - 1;
points[2].x = page->allocation.x + page->allocation.width - 1;
points[2].y = page->allocation.y + page->allocation.height
- TAB_CURVATURE - 1;
n = 3;
}
else
{
points[0].x = page->allocation.x + page->allocation.width - 1;
points[0].y = page->allocation.y + page->allocation.height
- TAB_OVERLAP - 1;
n = 1;
}
if ( (child_area.y < page->allocation.y + TAB_OVERLAP) &&
(page == notebook->cur_page ||
page == (GtkNotebookPage *)(notebook->children->data) ||
(notebook->scrollable &&
page == (GtkNotebookPage *)(notebook->first_tab->data))) )
{
points[n].x = page->allocation.x + page->allocation.width - 1;
points[n++].y = page->allocation.y + TAB_CURVATURE;
points[n].x = page->allocation.x + page->allocation.width
- TAB_CURVATURE - 1;
points[n++].y = page->allocation.y;
points[n].x = page->allocation.x;
points[n++].y = page->allocation.y;
}
else
{
points[n].x = page->allocation.x + page->allocation.width - 1;
points[n++].y = page->allocation.y + TAB_OVERLAP;
}
gap_side = GTK_POS_RIGHT;
break;
}
widget = GTK_WIDGET(notebook);
if (notebook->cur_page == page)
{
state_type = GTK_STATE_NORMAL;
}
else
{
state_type = GTK_STATE_ACTIVE;
gdk_draw_rectangle (widget->window, widget->style->bg_gc[state_type],
TRUE, child_area.x, child_area.y,
child_area.width, child_area.height);
}
gtk_draw_polygon (widget->style, widget->window, state_type,
GTK_SHADOW_OUT, points, n, FALSE);
if (notebook->cur_page == page)
state_type = GTK_STATE_NORMAL;
else
state_type = GTK_STATE_ACTIVE;
gtk_paint_extension(widget->style, widget->window,
state_type, GTK_SHADOW_OUT,
area, widget, "tab",
page_area.x, page_area.y,
page_area.width, page_area.height,
gap_side);
if ((GTK_WIDGET_HAS_FOCUS (widget)) &&
notebook->focus_tab && (notebook->focus_tab->data == page) &&
(page))
{
gtk_paint_focus (widget->style, widget->window,
area, widget, "tab",
page->tab_label->allocation.x - 1,
page->tab_label->allocation.y - 1,
page->tab_label->allocation.width + 1,
page->tab_label->allocation.height + 1);
}
if (gtk_widget_intersect (page->tab_label, area, &child_area))
gtk_widget_draw (page->tab_label, &child_area);
}
@@ -2649,77 +2401,27 @@ gtk_notebook_draw_focus (GtkWidget *widget)
if (GTK_WIDGET_DRAWABLE (widget) && notebook->show_tabs &&
notebook->focus_tab)
{
GtkNotebookPage *page;
GdkGC *gc;
page = notebook->focus_tab->data;
if (GTK_WIDGET_HAS_FOCUS (widget))
gc = widget->style->black_gc;
else if (page == notebook->cur_page)
gc = widget->style->bg_gc[GTK_STATE_NORMAL];
else
gc = widget->style->bg_gc[GTK_STATE_ACTIVE];
gdk_draw_rectangle (widget->window,
gc, FALSE,
page->tab_label->allocation.x - 1,
page->tab_label->allocation.y - 1,
page->tab_label->allocation.width + 1,
page->tab_label->allocation.height + 1);
GtkNotebookPage *page;
GdkRectangle area;
page = notebook->focus_tab->data;
area.x = widget->allocation.x;
area.y = widget->allocation.y;
area.width = widget->allocation.width;
area.height = widget->allocation.height;
gtk_notebook_draw_tab(GTK_NOTEBOOK(widget), page, &area);
}
}
static void
gtk_notebook_focus_changed (GtkNotebook *notebook, GtkNotebookPage *old_page)
{
GtkWidget *widget;
g_return_if_fail (notebook != NULL);
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
widget = GTK_WIDGET (notebook);
if (GTK_WIDGET_DRAWABLE (widget) && notebook->show_tabs)
{
GdkGC *gc;
if (notebook->focus_tab)
{
GtkNotebookPage *page;
page = notebook->focus_tab->data;
if (GTK_WIDGET_HAS_FOCUS (widget))
gc = widget->style->black_gc;
else if (page == notebook->cur_page)
gc = widget->style->bg_gc[GTK_STATE_NORMAL];
else
gc = widget->style->bg_gc[GTK_STATE_ACTIVE];
gdk_draw_rectangle (widget->window,
gc, FALSE,
page->tab_label->allocation.x - 1,
page->tab_label->allocation.y - 1,
page->tab_label->allocation.width + 1,
page->tab_label->allocation.height + 1);
}
if (old_page)
{
if (old_page == notebook->cur_page)
gc = widget->style->bg_gc[GTK_STATE_NORMAL];
else
gc = widget->style->bg_gc[GTK_STATE_ACTIVE];
gdk_draw_rectangle (widget->window,
gc, FALSE,
old_page->tab_label->allocation.x - 1,
old_page->tab_label->allocation.y - 1,
old_page->tab_label->allocation.width + 1,
old_page->tab_label->allocation.height + 1);
}
}
gtk_notebook_expose_tabs(notebook);
}
static void
@@ -3033,6 +2735,7 @@ gtk_notebook_pages_allocate (GtkNotebook *notebook,
gtk_widget_map (page->tab_label);
}
}
gtk_notebook_set_shape (notebook);
}
static void
@@ -3338,7 +3041,7 @@ gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
old_tab = notebook->focus_tab;
notebook->focus_tab = new_child;
if (notebook->scrollable)
if (notebook->scrollable && GTK_WIDGET_DRAWABLE (notebook))
{
if ((new_child == NULL) != (old_tab == NULL))
{
@@ -3380,6 +3083,8 @@ gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
&(GTK_WIDGET (notebook)->allocation));
gtk_notebook_expose_tabs (notebook);
}
gtk_notebook_set_shape (notebook);
}
static gint
@@ -3579,3 +3284,136 @@ gtk_notebook_find_page (gconstpointer a,
{
return (((GtkNotebookPage *) a)->child != b);
}
static void
gtk_notebook_set_shape (GtkNotebook *notebook)
{
GtkWidget *widget = NULL;
GdkPixmap *pm = NULL;
GdkGC *pmgc = NULL;
GdkColor col;
gint x, y, width, height, w, h, depth;
GtkNotebookPage *page;
GList *children;
if (!GTK_WIDGET(notebook)->window)
return;
widget = GTK_WIDGET(notebook);
w = widget->allocation.width;
h = widget->allocation.height;
pm = gdk_pixmap_new (widget->window, w, h, 1);
pmgc = gdk_gc_new (pm);
/* clear the shape mask */
col.pixel = 0;
gdk_gc_set_foreground(pmgc, &col);
gdk_draw_rectangle(pm, pmgc, TRUE, 0, 0, w, h);
col.pixel = 1;
gdk_gc_set_foreground(pmgc, &col);
/* draw the shape for the notebook page itself */
x = GTK_CONTAINER(notebook)->border_width;
y = GTK_CONTAINER(notebook)->border_width;
width = widget->allocation.width - x * 2;
height = widget->allocation.height - y * 2;
if (notebook->show_tabs && notebook->children)
{
if (!(notebook->show_tabs))
{
page = notebook->first_tab->data;
switch (notebook->tab_pos)
{
case GTK_POS_TOP:
y += page->allocation.height +
widget->style->klass->ythickness;
case GTK_POS_BOTTOM:
height -= page->allocation.height +
widget->style->klass->ythickness;
break;
case GTK_POS_LEFT:
x += page->allocation.width +
widget->style->klass->xthickness;
case GTK_POS_RIGHT:
width -= page->allocation.width +
widget->style->klass->xthickness;
break;
}
}
else
{
page = notebook->cur_page;
if (!GTK_WIDGET_MAPPED (page->tab_label))
{
if (notebook->tab_pos == GTK_POS_LEFT)
{
x -= widget->style->klass->xthickness * 2;
width += widget->style->klass->xthickness * 2;
}
else if (notebook->tab_pos == GTK_POS_RIGHT)
width += widget->style->klass->xthickness * 2;
}
switch (notebook->tab_pos)
{
case GTK_POS_TOP:
y += page->allocation.height;
case GTK_POS_BOTTOM:
height -= page->allocation.height;
break;
case GTK_POS_LEFT:
x += page->allocation.width;
case GTK_POS_RIGHT:
width -= page->allocation.width;
break;
}
}
}
gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
/* if theres an area for scrollign arrows draw the shape for them */
if (notebook->panel)
{
gdk_window_get_geometry(notebook->panel, &x, &y, &width, &height, &depth);
gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
}
/* draw the shapes of all the children */
children = notebook->children;
while (children)
{
page = children->data;
if (GTK_WIDGET_MAPPED (page->tab_label))
{
x = page->allocation.x;
y = page->allocation.y;
width = page->allocation.width;
height = page->allocation.height;
gdk_draw_rectangle(pm, pmgc, TRUE, x, y, width, height);
}
children = children->next;
}
/* set the mask */
gdk_window_shape_combine_mask(widget->window, pm, 0, 0);
gdk_pixmap_unref(pm);
gdk_gc_destroy(pmgc);
}
static void
gtk_notebook_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (GTK_WIDGET_REALIZED (widget) &&
!GTK_WIDGET_NO_WINDOW (widget))
{
gtk_style_set_background (widget->style, widget->window, widget->state);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (widget->window);
}
gtk_widget_queue_draw (widget);
gtk_notebook_set_shape (GTK_NOTEBOOK(widget));
}
+1 -1
View File
@@ -986,7 +986,7 @@ gtk_object_remove_no_notify_by_id (GtkObject *object,
}
void
gtk_object_set_data_destroy (GtkObject *object,
gtk_object_remove_no_notify (GtkObject *object,
const gchar *key)
{
g_return_if_fail (object != NULL);

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