Merge from themes-2. See the ChangeLog for a somewhat detailed

history of the evolution of the changes involved. Most of this
is actually minor painting tweaks.
This commit is contained in:
Owen Taylor 1998-11-06 22:05:02 +00:00
parent 3c0df19a58
commit e2a5219220
110 changed files with 12077 additions and 5381 deletions

View File

@ -10,4 +10,3 @@ aclocal.m4
configure
gtk-config
config.cache

541
ChangeLog
View File

@ -1,3 +1,544 @@
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.
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()
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!
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 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* 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)
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.
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.
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.
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.
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/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
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/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.
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.
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
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 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.
Thu Nov 5 18:52:35 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass)

View File

@ -1,3 +1,544 @@
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.
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()
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!
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 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* 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)
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.
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.
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.
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.
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/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
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/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.
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.
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
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 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.
Thu Nov 5 18:52:35 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass)

View File

@ -1,3 +1,544 @@
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.
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()
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!
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 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* 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)
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.
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.
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.
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.
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/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
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/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.
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.
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
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 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.
Thu Nov 5 18:52:35 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass)

View File

@ -1,3 +1,544 @@
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.
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()
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!
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 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* 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)
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.
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.
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.
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.
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/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
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/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.
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.
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
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 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.
Thu Nov 5 18:52:35 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass)

View File

@ -1,3 +1,544 @@
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.
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()
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!
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 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* 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)
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.
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.
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.
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.
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/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
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/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.
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.
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
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 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.
Thu Nov 5 18:52:35 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass)

View File

@ -1,3 +1,544 @@
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.
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()
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!
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 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* 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)
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.
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.
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.
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.
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/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
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/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.
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.
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
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 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.
Thu Nov 5 18:52:35 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass)

View File

@ -1,3 +1,544 @@
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.
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()
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!
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 13:07:54 1998 Owen Taylor <otaylor@redhat.com>
* 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)
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.
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.
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.
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.
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/gtkwidget.c (gtk_widget_clip_rect): Fixed up
queued area resizing once more.
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/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.
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.
Wed Aug 5 14:23:52 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_default_draw_shadow): Don't set
clip rects (or do anything) for shadow_none.
Wed Aug 5 13:14:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbutton.c (gtk_button_paint): Restored paint function.
Yes, it was needed. draw() and expose() are _not_
identical.
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 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.
Thu Nov 5 18:52:35 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass)

View File

@ -1,501 +0,0 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@
GTK_MICRO_VERSION = @GTK_MICRO_VERSION@
GTK_MINOR_VERSION = @GTK_MINOR_VERSION@
GTK_VERSION = @GTK_VERSION@
LD = @LD@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NM = @NM@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
x_cflags = @x_cflags@
x_includes = @x_includes@
x_ldflags = @x_ldflags@
x_libs = @x_libs@
xinput_progs = @xinput_progs@
SRC_SUBDIRS = glib gdk gtk
SUBDIRS = $(SRC_SUBDIRS) docs
bin_SCRIPTS = gtk-config
EXTRA_DIST = \
gtk+.spec \
gtk.m4 \
makecopyright \
TODO \
NEWS.pre-1-0 \
ChangeLog.pre-1-0 \
examples/aspectframe/Makefile \
examples/aspectframe/aspectframe.c \
examples/buttons/Makefile \
examples/buttons/buttons.c \
examples/buttons/info.xpm \
examples/entry/Makefile \
examples/entry/entry.c \
examples/eventbox/Makefile \
examples/eventbox/eventbox.c \
examples/filesel/Makefile \
examples/filesel/filesel.c \
examples/gtkdial/Makefile \
examples/gtkdial/dial_test.c \
examples/gtkdial/gtkdial.c \
examples/gtkdial/gtkdial.h \
examples/helloworld/Makefile \
examples/helloworld/helloworld.c \
examples/helloworld2/Makefile \
examples/helloworld2/helloworld2.c \
examples/list/Makefile \
examples/list/list.c \
examples/menu/Makefile \
examples/menu/menu.c \
examples/menu/menufactory.c \
examples/menu/menufactory.h \
examples/menu/mfmain.c \
examples/menu/mfmain.h \
examples/notebook/Makefile \
examples/notebook/notebook.c \
examples/packbox/Makefile \
examples/packbox/packbox.c \
examples/paned/Makefile \
examples/paned/paned.c \
examples/pixmap/Makefile \
examples/pixmap/pixmap.c \
examples/progressbar/Makefile \
examples/progressbar/progressbar.c \
examples/radiobuttons/Makefile \
examples/radiobuttons/radiobuttons.c \
examples/rulers/Makefile \
examples/rulers/rulers.c \
examples/scribble-simple/Makefile \
examples/scribble-simple/scribble-simple.c \
examples/scrolledwin/Makefile \
examples/scrolledwin/scrolledwin.c \
examples/selection/Makefile \
examples/selection/gettargets.c \
examples/selection/setselection.c \
examples/statusbar/Makefile \
examples/statusbar/statusbar.c \
examples/table/Makefile \
examples/table/table.c \
examples/tictactoe/Makefile \
examples/tictactoe/tictactoe.c \
examples/tictactoe/tictactoe.h \
examples/tictactoe/ttt_test.c \
examples/wheelbarrow/Makefile \
examples/wheelbarrow/wheelbarrow.c \
examples/find-examples.sh
m4datadir = $(datadir)/aclocal
m4data_DATA = gtk.m4
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = gtk-config
SCRIPTS = $(bin_SCRIPTS)
DATA = $(m4data_DATA)
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess config.h.in \
config.sub configure configure.in gtk-config.in install-sh ltconfig \
ltmain.sh missing mkinstalldirs stamp-h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
all: all-recursive-am all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): @MAINT@ configure.in
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
@:
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@echo timestamp > stamp-h
$(srcdir)/config.h.in: @MAINT@$(srcdir)/stamp-h.in
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f config.h
maintainer-clean-hdr:
gtk-config: $(top_builddir)/config.status gtk-config.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
else :; fi; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
list='$(bin_SCRIPTS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
done
install-m4dataDATA: $(m4data_DATA)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(m4datadir)
@list='$(m4data_DATA)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p"; \
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p; \
else if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p; \
fi; fi; \
done
uninstall-m4dataDATA:
@$(NORMAL_UNINSTALL)
list='$(m4data_DATA)'; for p in $$list; do \
rm -f $(DESTDIR)$(m4datadir)/$$p; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
list='$(SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
done; \
for subdir in $$rev; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
(cd $$subdir && $(MAKE) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) install \
&& $(MAKE) installcheck \
&& $(MAKE) dist
-rm -rf $(distdir)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
$(mkinstalldirs) $(distdir)/examples $(distdir)/examples/aspectframe \
$(distdir)/examples/buttons $(distdir)/examples/entry \
$(distdir)/examples/eventbox $(distdir)/examples/filesel \
$(distdir)/examples/gtkdial $(distdir)/examples/helloworld \
$(distdir)/examples/helloworld2 $(distdir)/examples/list \
$(distdir)/examples/menu $(distdir)/examples/notebook \
$(distdir)/examples/packbox $(distdir)/examples/paned \
$(distdir)/examples/pixmap $(distdir)/examples/progressbar \
$(distdir)/examples/radiobuttons $(distdir)/examples/rulers \
$(distdir)/examples/scribble-simple \
$(distdir)/examples/scrolledwin \
$(distdir)/examples/selection $(distdir)/examples/statusbar \
$(distdir)/examples/table $(distdir)/examples/tictactoe \
$(distdir)/examples/wheelbarrow
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
for subdir in $(SUBDIRS); do \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
info: info-recursive
dvi: dvi-recursive
check: all-am
$(MAKE) check-recursive
installcheck: installcheck-recursive
all-recursive-am: config.h
$(MAKE) all-recursive
all-am: Makefile $(SCRIPTS) $(DATA) config.h
install-exec-am: install-binSCRIPTS
install-data-am: install-m4dataDATA
uninstall-am: uninstall-binSCRIPTS uninstall-m4dataDATA
install-exec: install-exec-recursive install-exec-am
@$(NORMAL_INSTALL)
install-data: install-data-recursive install-data-am
@$(NORMAL_INSTALL)
install: install-recursive install-exec-am install-data-am
@:
uninstall: uninstall-recursive uninstall-am
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs: installdirs-recursive
$(mkinstalldirs) $(DATADIR)$(bindir) $(DATADIR)$(m4datadir)
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
maintainer-clean-generic distclean-am
mostlyclean: mostlyclean-recursive mostlyclean-am
clean: clean-recursive clean-am
distclean: distclean-recursive distclean-am
-rm -f config.status
-rm -f libtool
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
uninstall-binSCRIPTS install-binSCRIPTS uninstall-m4dataDATA \
install-m4dataDATA install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
installcheck all-recursive-am all-am install-exec-am install-data-am \
uninstall-am install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
.PHONY: files populate checkin release
files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
@for subdir in $(SUBDIRS); do \
files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
for file in $$files; do \
echo $$subdir/$$file; \
done; \
done
populate:
@echo "populating project"
@files=`$(MAKE) files | grep -v "make\[[1-9]\]"`; prcs populate -d gtk+.prj $$files
checkin: populate
@echo "checking in project"
@prcs checkin
release:
$(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

64
TODO
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.
@ -315,3 +306,4 @@ DND
- Send synthetic motion events on structure changes so
drag_enter/leave get sent properly. (See the popup
in testdnd)

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

View File

@ -291,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)
@ -304,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)
@ -408,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

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.

View File

@ -1,387 +0,0 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@
GTK_MICRO_VERSION = @GTK_MICRO_VERSION@
GTK_MINOR_VERSION = @GTK_MINOR_VERSION@
GTK_VERSION = @GTK_VERSION@
LD = @LD@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NM = @NM@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
x_cflags = @x_cflags@
x_includes = @x_includes@
x_ldflags = @x_ldflags@
x_libs = @x_libs@
xinput_progs = @xinput_progs@
info_TEXINFOS = gdk.texi gtk.texi glib.texi
man_MANS = gtk-config.1
EXTRA_DIST = \
texinfo.tex \
macros.texi \
Makefile.sgml \
gtkdocs_fix \
gtkfaq.sgml \
gtk-config.txt \
gtk_tut.sgml \
gtk_tut_it.sgml \
debugging.txt \
developers.txt \
refcounting.txt \
styles.txt \
text_widget.txt \
widget_system.txt \
gtk_tut_packbox1.gif \
gtk_tut_packbox2.gif \
gtk_tut_table.gif \
gtk-config.1
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
TEXI2DVI = texi2dvi
TEXINFO_TEX = $(srcdir)/texinfo.tex
INFO_DEPS = gdk.info gtk.info glib.info
DVIS = gdk.dvi gtk.dvi glib.dvi
TEXINFOS = gdk.texi gtk.texi glib.texi
man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = Makefile.am Makefile.in texinfo.tex
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
all: Makefile $(INFO_DEPS) $(MANS)
.SUFFIXES:
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
gdk.info: gdk.texi
gdk.dvi: gdk.texi
gtk.info: gtk.texi
gtk.dvi: gtk.texi
glib.info: glib.texi
glib.dvi: glib.texi
DVIPS = dvips
.texi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.txi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@for file in $(INFO_DEPS); do \
d=$(srcdir); \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
for file in $(INFO_DEPS); do \
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
uninstall-info:
$(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
ii=yes; \
else ii=; fi; \
for file in $(INFO_DEPS); do \
test -z "$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
for file in $(INFO_DEPS); do \
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
dist-info: $(INFO_DEPS)
for base in $(INFO_DEPS); do \
d=$(srcdir); \
for file in `cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done; \
done
mostlyclean-aminfo:
-rm -f gdk.aux gdk.cp gdk.cps gdk.dvi gdk.fn gdk.fns gdk.ky gdk.kys \
gdk.ps gdk.log gdk.pg gdk.toc gdk.tp gdk.tps gdk.vr gdk.vrs \
gdk.op gdk.tr gdk.cv gdk.cn gtk.aux gtk.cp gtk.cps gtk.dvi \
gtk.fn gtk.fns gtk.ky gtk.kys gtk.ps gtk.log gtk.pg gtk.toc \
gtk.tp gtk.tps gtk.vr gtk.vrs gtk.op gtk.tr gtk.cv gtk.cn \
glib.aux glib.cp glib.cps glib.dvi glib.fn glib.fns glib.ky \
glib.kys glib.ps glib.log glib.pg glib.toc glib.tp glib.tps \
glib.vr glib.vrs glib.op glib.tr glib.cv glib.cn
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
for i in $(INFO_DEPS); do \
rm -f $$i; \
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
rm -f $$i-[0-9]*; \
fi; \
done
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
done
uninstall-man1:
@list='$(man1_MANS)'; \
l2='$(man_MANS)'; for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
done
install-man: $(MANS)
@$(NORMAL_INSTALL)
$(MAKE) install-man1
uninstall-man:
@$(NORMAL_UNINSTALL)
$(MAKE) uninstall-man1
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = docs
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu docs/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
info: $(INFO_DEPS)
dvi: $(DVIS)
check: all
$(MAKE)
installcheck:
install-exec:
@$(NORMAL_INSTALL)
install-data: install-info-am install-man
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-info uninstall-man
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-aminfo mostlyclean-generic
clean: clean-aminfo clean-generic mostlyclean
distclean: distclean-aminfo distclean-generic clean
-rm -f config.status
-rm -f libtool
maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \
uninstall-man1 install-man uninstall-man tags distdir info dvi \
installcheck install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,4 +1,3 @@
CC = gcc
filesel: filesel.c

View File

@ -67,15 +67,14 @@ gxid_LDADD = \
@x_libs@ \
-lm
BUILT_SOURCES = gdkcursors.h gdkkeysyms.h
EXTRA_DIST = makecursors.awk makekeysyms.awk
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

283
gdk/gdk.c
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,
@ -743,6 +739,194 @@ gdk_event_get_graphics_expose (GdkWindow *window)
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;
}
/*
*--------------------------------------------------------------
* gdk_event_get
@ -834,6 +1018,7 @@ gdk_event_get (void)
#else
XNextEvent (gdk_display, &xevent);
#endif
event = gdk_event_new ();
event->any.type = GDK_NOTHING;
@ -2005,6 +2190,13 @@ gdk_event_translate (GdkEvent *event,
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);
@ -2031,8 +2223,7 @@ gdk_event_translate (GdkEvent *event,
/* 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));
@ -2102,8 +2293,7 @@ gdk_event_translate (GdkEvent *event,
/* 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));
@ -2178,6 +2368,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);
@ -2357,6 +2548,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;
@ -2539,10 +2731,11 @@ gdk_event_translate (GdkEvent *event,
xevent->xconfigure.above - base_id,
xevent->xconfigure.override_redirect));
if ((window_private->extension_events != 0) &&
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
@ -2714,6 +2907,7 @@ gdk_event_translate (GdkEvent *event,
/* 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);
@ -3638,61 +3832,6 @@ _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)
{
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;
g_return_val_if_fail (w != NULL && x != NULL && y != NULL, NULL);
myx = *x;
myy = *y;
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
/* Sends a ClientMessage to all toplevel client windows */
gboolean
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
@ -3716,7 +3855,7 @@ gdk_event_send_client_message (GdkEvent *event, guint32 xid)
gboolean
gdk_event_send_client_message_to_all_recurse (XEvent *xev,
guint32 xid,
gboolean send_anyways)
guint level)
{
static GdkAtom wm_state_atom = GDK_NONE;
@ -3729,7 +3868,7 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
unsigned int ret_nchildren;
int i;
gboolean send = TRUE;
gboolean send = FALSE;
gboolean found = FALSE;
if (!wm_state_atom)
@ -3761,13 +3900,13 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
return FALSE;
for(i = 0; i < ret_nchildren; i++)
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], FALSE))
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
found = TRUE;
XFree(ret_children);
}
if (send || (!found && send_anyways))
if (send || (!found && (level == 1)))
{
xev->xclient.window = xid;
gdk_send_xevent (xid, False, NoEventMask, xev);
@ -3791,7 +3930,7 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
sev.xclient.message_type = event->client.message_type;
gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, TRUE);
gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, 0);
gdk_error_warnings = old_warnings;
}

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
*/
@ -894,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
*/

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,

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,

View File

@ -676,7 +676,7 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
{
GdkGCPrivate *private;
XRectangle xrectangle;
g_return_if_fail (gc != NULL);
private = (GdkGCPrivate*) gc;

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;
}

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;

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))
@ -65,20 +63,6 @@ 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;

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,

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;

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;
@ -506,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;
@ -584,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;
@ -1629,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
@ -1639,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;
@ -1960,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,

View File

@ -1,4 +0,0 @@
$1 == "#define" && NF >= 3 {
sub(/^XC/,"GDK",$2)
printf("%s = %s,\n",toupper($2),$3)
}

View File

@ -1,5 +0,0 @@
$1 == "#define" && NF >= 3 {
sub(/^XK/,"GDK",$2)
sub(/0X/,"0x",$3)
print $1,$2,$3
}

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,

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;
}

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;

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,
@ -743,6 +739,194 @@ gdk_event_get_graphics_expose (GdkWindow *window)
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;
}
/*
*--------------------------------------------------------------
* gdk_event_get
@ -834,6 +1018,7 @@ gdk_event_get (void)
#else
XNextEvent (gdk_display, &xevent);
#endif
event = gdk_event_new ();
event->any.type = GDK_NOTHING;
@ -2005,6 +2190,13 @@ gdk_event_translate (GdkEvent *event,
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);
@ -2031,8 +2223,7 @@ gdk_event_translate (GdkEvent *event,
/* 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));
@ -2102,8 +2293,7 @@ gdk_event_translate (GdkEvent *event,
/* 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));
@ -2178,6 +2368,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);
@ -2357,6 +2548,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;
@ -2539,10 +2731,11 @@ gdk_event_translate (GdkEvent *event,
xevent->xconfigure.above - base_id,
xevent->xconfigure.override_redirect));
if ((window_private->extension_events != 0) &&
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
@ -2714,6 +2907,7 @@ gdk_event_translate (GdkEvent *event,
/* 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);
@ -3638,61 +3832,6 @@ _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)
{
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;
g_return_val_if_fail (w != NULL && x != NULL && y != NULL, NULL);
myx = *x;
myy = *y;
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
/* Sends a ClientMessage to all toplevel client windows */
gboolean
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
@ -3716,7 +3855,7 @@ gdk_event_send_client_message (GdkEvent *event, guint32 xid)
gboolean
gdk_event_send_client_message_to_all_recurse (XEvent *xev,
guint32 xid,
gboolean send_anyways)
guint level)
{
static GdkAtom wm_state_atom = GDK_NONE;
@ -3729,7 +3868,7 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
unsigned int ret_nchildren;
int i;
gboolean send = TRUE;
gboolean send = FALSE;
gboolean found = FALSE;
if (!wm_state_atom)
@ -3761,13 +3900,13 @@ gdk_event_send_client_message_to_all_recurse (XEvent *xev,
return FALSE;
for(i = 0; i < ret_nchildren; i++)
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], FALSE))
if (gdk_event_send_client_message_to_all_recurse(xev, ret_children[i], level + 1))
found = TRUE;
XFree(ret_children);
}
if (send || (!found && send_anyways))
if (send || (!found && (level == 1)))
{
xev->xclient.window = xid;
gdk_send_xevent (xid, False, NoEventMask, xev);
@ -3791,7 +3930,7 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
memcpy(&sev.xclient.data, &event->client.data, sizeof(sev.xclient.data));
sev.xclient.message_type = event->client.message_type;
gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, TRUE);
gdk_event_send_client_message_to_all_recurse(&sev, gdk_root_window, 0);
gdk_error_warnings = old_warnings;
}

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;
@ -506,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;
@ -584,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;
@ -1629,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
@ -1639,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;
@ -1960,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,

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 \
@ -232,7 +239,7 @@ BUILT_SOURCES = \
gtkmarshal.h
# cause the built sources to be rebuild when possible, even with --include-deps
$(libgtk_la_SOURCES): $(BUILT_SOURCES)
$(static_sources): $(BUILT_SOURCES)
# More headers to use when autogenerating.
gdk_headers = \
@ -307,12 +314,13 @@ 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
# FIXME, we currently rely on linking against libglib-1.1
DEPS = \
libgtk.la \
$(top_builddir)/gdk/libgdk.la

View File

@ -1,712 +0,0 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
GTK_MAJOR_VERSION = @GTK_MAJOR_VERSION@
GTK_MICRO_VERSION = @GTK_MICRO_VERSION@
GTK_MINOR_VERSION = @GTK_MINOR_VERSION@
GTK_VERSION = @GTK_VERSION@
LD = @LD@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NM = @NM@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
x_cflags = @x_cflags@
x_includes = @x_includes@
x_ldflags = @x_ldflags@
x_libs = @x_libs@
xinput_progs = @xinput_progs@
gtkincludedir = $(includedir)/gtk
lib_LTLIBRARIES = libgtk-1.1.la
libgtk_1_1_la_SOURCES = \
gtkaccelerator.c \
gtkadjustment.c \
gtkaspectframe.c \
gtkalignment.c \
gtkarrow.c \
gtkbin.c \
gtkbbox.c \
gtkbox.c \
gtkbutton.c \
gtkcheckbutton.c \
gtkcheckmenuitem.c \
gtkclist.c \
gtkcolorsel.c \
gtkcombo.c \
gtkcontainer.c \
gtkctree.c \
gtkcurve.c \
gtkdata.c \
gtkdialog.c \
gtkdrawingarea.c \
gtkeditable.c \
gtkentry.c \
gtkeventbox.c \
gtkfilesel.c \
gtkfixed.c \
gtkframe.c \
gtkgamma.c \
gtkgc.c \
gtkhandlebox.c \
gtkhbbox.c \
gtkhbox.c \
gtkhpaned.c \
gtkhruler.c \
gtkhscale.c \
gtkhscrollbar.c \
gtkhseparator.c \
gtkimage.c \
gtkinputdialog.c \
gtkitem.c \
gtklabel.c \
gtklist.c \
gtklistitem.c \
gtkmain.c \
gtkmenu.c \
gtkmenubar.c \
gtkmenufactory.c \
gtkmenuitem.c \
gtkmenushell.c \
gtkmisc.c \
gtknotebook.c \
gtkobject.c \
gtkoptionmenu.c \
gtkpaned.c \
gtkpixmap.c \
gtkpreview.c \
gtkprogressbar.c \
gtkradiobutton.c \
gtkradiomenuitem.c \
gtkrange.c \
gtkrc.c \
gtkruler.c \
gtkscale.c \
gtkscrollbar.c \
gtkscrolledwindow.c \
gtkselection.c \
gtkseparator.c \
gtksignal.c \
gtkspinbutton.c \
gtkstyle.c \
gtkstatusbar.c \
gtktable.c \
gtktext.c \
gtktipsquery.c \
gtktogglebutton.c \
gtktoolbar.c \
gtktooltips.c \
gtktree.c \
gtktreeitem.c \
gtktypeutils.c \
gtkvbbox.c \
gtkvbox.c \
gtkviewport.c \
gtkvpaned.c \
gtkvruler.c \
gtkvscale.c \
gtkvscrollbar.c \
gtkvseparator.c \
gtkwidget.c \
gtkwindow.c \
fnmatch.c \
fnmatch.h
gtkinclude_HEADERS = \
gtk.h \
gtkaccelerator.h \
gtkadjustment.h \
gtkaspectframe.h \
gtkalignment.h \
gtkarrow.h \
gtkbin.h \
gtkbbox.h \
gtkbox.h \
gtkbutton.h \
gtkcheckbutton.h \
gtkcheckmenuitem.h \
gtkclist.h \
gtkcolorsel.h \
gtkcombo.h \
gtkcontainer.h \
gtkctree.h \
gtkcurve.h \
gtkdata.h \
gtkdebug.h \
gtkdialog.h \
gtkdrawingarea.h \
gtkeditable.h \
gtkentry.h \
gtkenums.h \
gtkeventbox.h \
gtkfeatures.h \
gtkfilesel.h \
gtkfixed.h \
gtkframe.h \
gtkgamma.h \
gtkgc.h \
gtkhandlebox.h \
gtkhbbox.h \
gtkhbox.h \
gtkhpaned.h \
gtkhruler.h \
gtkhscale.h \
gtkhscrollbar.h \
gtkhseparator.h \
gtkimage.h \
gtkinputdialog.h \
gtkitem.h \
gtklabel.h \
gtklist.h \
gtklistitem.h \
gtkmain.h \
gtkmenu.h \
gtkmenubar.h \
gtkmenufactory.h \
gtkmenuitem.h \
gtkmenushell.h \
gtkmisc.h \
gtknotebook.h \
gtkobject.h \
gtkoptionmenu.h \
gtkpaned.h \
gtkpixmap.h \
gtkpreview.h \
gtkprivate.h \
gtkprogressbar.h \
gtkradiobutton.h \
gtkradiomenuitem.h \
gtkrange.h \
gtkrc.h \
gtkruler.h \
gtkscale.h \
gtkscrollbar.h \
gtkscrolledwindow.h \
gtkselection.h \
gtkseparator.h \
gtksignal.h \
gtkspinbutton.h \
gtkstyle.h \
gtkstatusbar.h \
gtktable.h \
gtktext.h \
gtktipsquery.h \
gtktogglebutton.h \
gtktoolbar.h \
gtktooltips.h \
gtktree.h \
gtktreeitem.h \
gtktypeutils.h \
gtkvbbox.h \
gtkvbox.h \
gtkviewport.h \
gtkvpaned.h \
gtkvruler.h \
gtkvscale.h \
gtkvscrollbar.h \
gtkvseparator.h \
gtkwidget.h \
gtkwindow.h \
gtktypebuiltins.h
libgtk_1_1_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
EXTRA_DIST = \
line-arrow.xbm \
line-wrap.xbm \
testgtkrc \
testgtkrc2 \
gtk.defs \
gtkfeatures.h.in \
runelisp \
gentypeinfo.el \
gtktypebuiltins.c \
test.xpm \
marble.xpm \
3DRings.xpm \
FilesQueue.xpm \
Modeller.xpm \
tree_plus.xpm \
tree_minus.xpm \
tree_plus.xbm \
tree_minus.xbm \
circles.xbm
INCLUDES = -I$(top_srcdir) -I../glib -I$(top_srcdir)/glib @x_cflags@
noinst_PROGRAMS = testgtk testinput testselection testthreads simple
# FIXME, we currently rely on linking against libglib-1.1
DEPS = \
libgtk-@LT_RELEASE@.la \
$(top_builddir)/gdk/libgdk-@LT_RELEASE@.la \
$(top_builddir)/glib/libglib-1.1.la
LDADDS = \
libgtk-@LT_RELEASE@.la \
$(top_builddir)/gdk/libgdk-@LT_RELEASE@.la \
@x_ldflags@ \
@x_libs@ \
$(top_builddir)/glib/libglib-1.1.la \
-lm
testgtk_DEPENDENCIES = $(DEPS)
testinput_DEPENDENCIES = $(DEPS)
testthreads_DEPENDENCIES = $(DEPS)
testselection_DEPENDENCIES = $(DEPS)
simple_DEPENDENCIES = $(DEPS)
testgtk_LDADD = $(LDADDS)
testinput_LDADD = $(LDADDS)
testthreads_LDADD = $(LDADDS)
testselection_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES = gtkfeatures.h
LTLIBRARIES = $(lib_LTLIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
libgtk_1_1_la_LIBADD =
libgtk_1_1_la_OBJECTS = gtkaccelerator.lo gtkadjustment.lo \
gtkaspectframe.lo gtkalignment.lo gtkarrow.lo gtkbin.lo gtkbbox.lo \
gtkbox.lo gtkbutton.lo gtkcheckbutton.lo gtkcheckmenuitem.lo \
gtkclist.lo gtkcolorsel.lo gtkcombo.lo gtkcontainer.lo gtkctree.lo \
gtkcurve.lo gtkdata.lo gtkdialog.lo gtkdrawingarea.lo gtkeditable.lo \
gtkentry.lo gtkeventbox.lo gtkfilesel.lo gtkfixed.lo gtkframe.lo \
gtkgamma.lo gtkgc.lo gtkhandlebox.lo gtkhbbox.lo gtkhbox.lo \
gtkhpaned.lo gtkhruler.lo gtkhscale.lo gtkhscrollbar.lo \
gtkhseparator.lo gtkimage.lo gtkinputdialog.lo gtkitem.lo gtklabel.lo \
gtklist.lo gtklistitem.lo gtkmain.lo gtkmenu.lo gtkmenubar.lo \
gtkmenufactory.lo gtkmenuitem.lo gtkmenushell.lo gtkmisc.lo \
gtknotebook.lo gtkobject.lo gtkoptionmenu.lo gtkpaned.lo gtkpixmap.lo \
gtkpreview.lo gtkprogressbar.lo gtkradiobutton.lo gtkradiomenuitem.lo \
gtkrange.lo gtkrc.lo gtkruler.lo gtkscale.lo gtkscrollbar.lo \
gtkscrolledwindow.lo gtkselection.lo gtkseparator.lo gtksignal.lo \
gtkspinbutton.lo gtkstyle.lo gtkstatusbar.lo gtktable.lo gtktext.lo \
gtktipsquery.lo gtktogglebutton.lo gtktoolbar.lo gtktooltips.lo \
gtktree.lo gtktreeitem.lo gtktypeutils.lo gtkvbbox.lo gtkvbox.lo \
gtkviewport.lo gtkvpaned.lo gtkvruler.lo gtkvscale.lo gtkvscrollbar.lo \
gtkvseparator.lo gtkwidget.lo gtkwindow.lo fnmatch.lo
PROGRAMS = $(noinst_PROGRAMS)
testgtk_SOURCES = testgtk.c
testgtk_OBJECTS = testgtk.o
testgtk_LDFLAGS =
testinput_SOURCES = testinput.c
testinput_OBJECTS = testinput.o
testinput_LDFLAGS =
testselection_SOURCES = testselection.c
testselection_OBJECTS = testselection.o
testselection_LDFLAGS =
testthreads_SOURCES = testthreads.c
testthreads_OBJECTS = testthreads.o
testthreads_LDFLAGS =
simple_SOURCES = simple.c
simple_OBJECTS = simple.o
simple_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(gtkinclude_HEADERS)
DIST_COMMON = Makefile.am Makefile.in gtkfeatures.h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
DEP_FILES = .deps/fnmatch.P .deps/gtkaccelerator.P \
.deps/gtkadjustment.P .deps/gtkalignment.P .deps/gtkarrow.P \
.deps/gtkaspectframe.P .deps/gtkbbox.P .deps/gtkbin.P .deps/gtkbox.P \
.deps/gtkbutton.P .deps/gtkcheckbutton.P .deps/gtkcheckmenuitem.P \
.deps/gtkclist.P .deps/gtkcolorsel.P .deps/gtkcombo.P \
.deps/gtkcontainer.P .deps/gtkctree.P .deps/gtkcurve.P .deps/gtkdata.P \
.deps/gtkdialog.P .deps/gtkdrawingarea.P .deps/gtkeditable.P \
.deps/gtkentry.P .deps/gtkeventbox.P .deps/gtkfilesel.P \
.deps/gtkfixed.P .deps/gtkframe.P .deps/gtkgamma.P .deps/gtkgc.P \
.deps/gtkhandlebox.P .deps/gtkhbbox.P .deps/gtkhbox.P .deps/gtkhpaned.P \
.deps/gtkhruler.P .deps/gtkhscale.P .deps/gtkhscrollbar.P \
.deps/gtkhseparator.P .deps/gtkimage.P .deps/gtkinputdialog.P \
.deps/gtkitem.P .deps/gtklabel.P .deps/gtklist.P .deps/gtklistitem.P \
.deps/gtkmain.P .deps/gtkmenu.P .deps/gtkmenubar.P \
.deps/gtkmenufactory.P .deps/gtkmenuitem.P .deps/gtkmenushell.P \
.deps/gtkmisc.P .deps/gtknotebook.P .deps/gtkobject.P \
.deps/gtkoptionmenu.P .deps/gtkpaned.P .deps/gtkpixmap.P \
.deps/gtkpreview.P .deps/gtkprogressbar.P .deps/gtkradiobutton.P \
.deps/gtkradiomenuitem.P .deps/gtkrange.P .deps/gtkrc.P \
.deps/gtkruler.P .deps/gtkscale.P .deps/gtkscrollbar.P \
.deps/gtkscrolledwindow.P .deps/gtkselection.P .deps/gtkseparator.P \
.deps/gtksignal.P .deps/gtkspinbutton.P .deps/gtkstatusbar.P \
.deps/gtkstyle.P .deps/gtktable.P .deps/gtktext.P .deps/gtktipsquery.P \
.deps/gtktogglebutton.P .deps/gtktoolbar.P .deps/gtktooltips.P \
.deps/gtktree.P .deps/gtktreeitem.P .deps/gtktypeutils.P \
.deps/gtkvbbox.P .deps/gtkvbox.P .deps/gtkviewport.P .deps/gtkvpaned.P \
.deps/gtkvruler.P .deps/gtkvscale.P .deps/gtkvscrollbar.P \
.deps/gtkvseparator.P .deps/gtkwidget.P .deps/gtkwindow.P \
.deps/simple.P .deps/testgtk.P .deps/testinput.P .deps/testselection.P \
.deps/testthreads.P
SOURCES = $(libgtk_1_1_la_SOURCES) testgtk.c testinput.c testselection.c testthreads.c simple.c
OBJECTS = $(libgtk_1_1_la_OBJECTS) testgtk.o testinput.o testselection.o testthreads.o simple.o
all: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .s
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu gtk/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
gtkfeatures.h: $(top_builddir)/config.status gtkfeatures.h.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
mostlyclean-libLTLIBRARIES:
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
distclean-libLTLIBRARIES:
maintainer-clean-libLTLIBRARIES:
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo "$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
$(LIBTOOL) --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
list='$(lib_LTLIBRARIES)'; for p in $$list; do \
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
done
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
.s.lo:
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
.S.lo:
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
maintainer-clean-libtool:
libgtk-1.1.la: $(libgtk_1_1_la_OBJECTS) $(libgtk_1_1_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libgtk_1_1_la_LDFLAGS) $(libgtk_1_1_la_OBJECTS) $(libgtk_1_1_la_LIBADD) $(LIBS)
mostlyclean-noinstPROGRAMS:
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
testgtk: $(testgtk_OBJECTS) $(testgtk_DEPENDENCIES)
@rm -f testgtk
$(LINK) $(testgtk_LDFLAGS) $(testgtk_OBJECTS) $(testgtk_LDADD) $(LIBS)
testinput: $(testinput_OBJECTS) $(testinput_DEPENDENCIES)
@rm -f testinput
$(LINK) $(testinput_LDFLAGS) $(testinput_OBJECTS) $(testinput_LDADD) $(LIBS)
testselection: $(testselection_OBJECTS) $(testselection_DEPENDENCIES)
@rm -f testselection
$(LINK) $(testselection_LDFLAGS) $(testselection_OBJECTS) $(testselection_LDADD) $(LIBS)
testthreads: $(testthreads_OBJECTS) $(testthreads_DEPENDENCIES)
@rm -f testthreads
$(LINK) $(testthreads_LDFLAGS) $(testthreads_OBJECTS) $(testthreads_LDADD) $(LIBS)
simple: $(simple_OBJECTS) $(simple_DEPENDENCIES)
@rm -f simple
$(LINK) $(simple_LDFLAGS) $(simple_OBJECTS) $(simple_LDADD) $(LIBS)
install-gtkincludeHEADERS: $(gtkinclude_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(gtkincludedir)
@list='$(gtkinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(gtkincludedir)/$$p"; \
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(gtkincludedir)/$$p; \
done
uninstall-gtkincludeHEADERS:
@$(NORMAL_UNINSTALL)
list='$(gtkinclude_HEADERS)'; for p in $$list; do \
rm -f $(DESTDIR)$(gtkincludedir)/$$p; \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = gtk
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu gtk/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
maintainer-clean-depend:
-rm -rf .deps
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
@-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
< .deps/$(*F).p > .deps/$(*F).P
@-rm -f .deps/$(*F).p
info:
dvi:
check: all
$(MAKE)
installcheck:
install-exec: install-libLTLIBRARIES
@$(NORMAL_INSTALL)
install-data: install-gtkincludeHEADERS
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-libLTLIBRARIES uninstall-gtkincludeHEADERS
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(DATADIR)$(libdir) $(DATADIR)$(gtkincludedir)
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-libLTLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-noinstPROGRAMS \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
clean: clean-libLTLIBRARIES clean-compile clean-libtool \
clean-noinstPROGRAMS clean-tags clean-depend \
clean-generic mostlyclean
distclean: distclean-libLTLIBRARIES distclean-compile distclean-libtool \
distclean-noinstPROGRAMS distclean-tags \
distclean-depend distclean-generic clean
-rm -f config.status
-rm -f libtool
maintainer-clean: maintainer-clean-libLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
distclean-compile clean-compile maintainer-clean-compile \
mostlyclean-libtool distclean-libtool clean-libtool \
maintainer-clean-libtool mostlyclean-noinstPROGRAMS \
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
maintainer-clean-noinstPROGRAMS uninstall-gtkincludeHEADERS \
install-gtkincludeHEADERS tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info dvi \
installcheck install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
$(srcdir)/gtktypebuiltins.h: @MAINT@ $(srcdir)/gtk.defs $(srcdir)/gentypeinfo.el
$(SHELL) $(srcdir)/runelisp $(srcdir)/gentypeinfo.el idmac $< $@
$(srcdir)/gtktypebuiltins.c: @MAINT@ $(srcdir)/gtk.defs $(srcdir)/gentypeinfo.el
$(SHELL) $(srcdir)/runelisp $(srcdir)/gentypeinfo.el id $< $@
.PHONY: files test test-debug
files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
test: testgtk
builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \
cd $$builddir; cd $(srcdir); \
$(SHELL) $$top_builddir/libtool --mode=execute $$builddir/testgtk
test-debug: testgtk
builddir=`pwd`; cd $(top_builddir); top_builddir=`pwd`; \
cd $$builddir; cd $(srcdir); \
$(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

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

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>

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;

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);
}
}

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);

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);
}

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;

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);
}
}

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);
}
}

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

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)

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);

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,
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++)
{

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");
@ -1183,14 +1186,14 @@ gtk_drag_dest_leave (GtkWidget *widget,
}
else
{
if (site->flags & GTK_DEST_DEFAULT_HIGHLIGHT)
gtk_drag_unhighlight (widget);
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;
if (site->flags & GTK_DEST_DEFAULT_HIGHLIGHT)
gtk_drag_unhighlight (widget);
}
}
@ -1208,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)
@ -1219,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);
@ -1298,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))
@ -1313,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;
@ -1320,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);
@ -1430,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
@ -1499,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)
{
@ -1647,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 ();
@ -2007,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
@ -2020,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;
}
@ -2030,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);
@ -2054,6 +2100,7 @@ gtk_drag_source_event_cb (GtkWidget *widget,
break;
default: /* hit for 2/3BUTTON_PRESS */
break;
}
return FALSE;
}
@ -2183,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);

View File

@ -26,7 +26,6 @@
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
typedef enum {

125
gtk/gtkdrawwindow.c Normal file
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
gtk/gtkdrawwindow.h Normal file
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__ */

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);
}

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);
}

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;

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;

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);
}
}

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);

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);
}
}

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);
}
}

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;
}

View File

@ -26,7 +26,6 @@
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */

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

View File

@ -51,12 +51,7 @@ 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 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,12 @@ 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 +508,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 +570,3 @@ gtk_label_parse_uline (GtkLabel *label,
return accel_key;
}

View File

@ -48,7 +48,6 @@ struct _GtkLabel
GSList *row;
guint max_width : 16;
guint jtype : 2;
guint needs_clear : 1;
};
struct _GtkLabelClass

View File

@ -380,8 +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]);
}
@ -457,60 +455,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));
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

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);
}

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;

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);
}
}
}

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);
}
}
}

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));
}

View File

@ -272,11 +272,11 @@ gtk_option_menu_size_request (GtkWidget *widget,
option_menu->width +
OPTION_INDICATOR_WIDTH +
OPTION_INDICATOR_SPACING * 5 +
CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING);
CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING + 2);
requisition->height = ((GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->klass->ythickness) * 2 +
option_menu->height +
CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING);
CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING + 2);
tmp = (requisition->height - option_menu->height +
OPTION_INDICATOR_HEIGHT + OPTION_INDICATOR_SPACING * 2);
@ -304,14 +304,14 @@ gtk_option_menu_size_allocate (GtkWidget *widget,
if (child && GTK_WIDGET_VISIBLE (child))
{
child_allocation.x = (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->klass->xthickness);
GTK_WIDGET (widget)->style->klass->xthickness) + 1;
child_allocation.y = (GTK_CONTAINER (widget)->border_width +
GTK_WIDGET (widget)->style->klass->ythickness);
GTK_WIDGET (widget)->style->klass->ythickness) + 1;
child_allocation.width = (allocation->width - child_allocation.x * 2 -
OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 -
CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING);
CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING) - 2;
child_allocation.height = (allocation->height - child_allocation.y * 2 -
CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING);
CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING) - 2;
child_allocation.x += CHILD_LEFT_SPACING;
child_allocation.y += CHILD_RIGHT_SPACING;
@ -323,8 +323,7 @@ static void
gtk_option_menu_paint (GtkWidget *widget,
GdkRectangle *area)
{
GdkRectangle restrict_area;
GdkRectangle new_area;
GdkRectangle button_area;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_OPTION_MENU (widget));
@ -332,30 +331,39 @@ gtk_option_menu_paint (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
restrict_area.x = GTK_CONTAINER (widget)->border_width;
restrict_area.y = GTK_CONTAINER (widget)->border_width;
restrict_area.width = widget->allocation.width - restrict_area.x * 2;
restrict_area.height = widget->allocation.height - restrict_area.y * 2;
button_area.x = GTK_CONTAINER (widget)->border_width + 1;
button_area.y = GTK_CONTAINER (widget)->border_width + 1;
button_area.width = widget->allocation.width - button_area.x * 2;
button_area.height = widget->allocation.height - button_area.y * 2;
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
{
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);
/* This is evil, and should be elimated here and in the button
* code. The point is to clear the focus, and make it
* sort of transparent if it isn't there.
*/
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
gtk_draw_shadow (widget->style, widget->window,
GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
restrict_area.x, restrict_area.y,
restrict_area.width, restrict_area.height);
gtk_draw_shadow (widget->style, widget->window,
GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
restrict_area.x + restrict_area.width - restrict_area.x -
OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 4,
restrict_area.y + (restrict_area.height - OPTION_INDICATOR_HEIGHT) / 2,
OPTION_INDICATOR_WIDTH, OPTION_INDICATOR_HEIGHT);
}
gtk_paint_box(widget->style, widget->window,
GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
area, widget, "optionmenu",
button_area.x, button_area.y,
button_area.width, button_area.height);
gtk_paint_tab (widget->style, widget->window,
GTK_WIDGET_STATE (widget), GTK_SHADOW_OUT,
area, widget, "optionmenutab",
button_area.x + button_area.width - button_area.x -
OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 4,
button_area.y + (button_area.height - OPTION_INDICATOR_HEIGHT) / 2,
OPTION_INDICATOR_WIDTH, OPTION_INDICATOR_HEIGHT);
if (GTK_WIDGET_HAS_FOCUS (widget))
gtk_paint_focus (widget->style, widget->window,
area, widget, "button",
button_area.x - 1,
button_area.y - 1,
button_area.width + 1,
button_area.height + 1);
}
}
@ -377,7 +385,6 @@ gtk_option_menu_draw (GtkWidget *widget,
child = GTK_BIN (widget)->child;
if (child && gtk_widget_intersect (child, area, &child_area))
gtk_widget_draw (child, &child_area);
gtk_widget_draw_focus (widget);
}
}
@ -440,7 +447,6 @@ gtk_option_menu_expose (GtkWidget *widget,
gtk_widget_event (child, (GdkEvent*) &child_event);
#endif /* 0 */
gtk_widget_draw_focus (widget);
}
return FALSE;

View File

@ -31,10 +31,10 @@ static void gtk_paned_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_paned_remove (GtkContainer *container,
GtkWidget *widget);
static void gtk_paned_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static void gtk_paned_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static GtkType gtk_paned_child_type (GtkContainer *container);
@ -167,6 +167,8 @@ gtk_paned_realize (GtkWidget *widget)
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, paned->handle, GTK_STATE_NORMAL);
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
gdk_window_show (paned->handle);
}
@ -252,13 +254,12 @@ gtk_paned_expose (GtkWidget *widget,
/* An expose event for the handle */
if (event->window == paned->handle)
{
gdk_window_set_background (paned->handle,
&widget->style->bg[widget->state]);
gdk_window_clear (paned->handle);
gtk_draw_shadow (widget->style, paned->handle,
GTK_WIDGET_STATE(widget),
GTK_SHADOW_OUT, 0, 0,
paned->handle_size, paned->handle_size);
gtk_paint_box (widget->style, paned->handle,
GTK_WIDGET_STATE(widget),
GTK_SHADOW_OUT,
&event->area, widget, "paned",
0, 0,
paned->handle_size, paned->handle_size);
}
else
{

View File

@ -74,7 +74,6 @@ gtk_pixmap_init (GtkPixmap *pixmap)
pixmap->pixmap = NULL;
pixmap->mask = NULL;
pixmap->needs_clear = FALSE;
}
GtkWidget*
@ -82,13 +81,13 @@ gtk_pixmap_new (GdkPixmap *val,
GdkBitmap *mask)
{
GtkPixmap *pixmap;
g_return_val_if_fail (val != NULL, NULL);
pixmap = gtk_type_new (gtk_pixmap_get_type ());
gtk_pixmap_set (pixmap, val, mask);
return GTK_WIDGET (pixmap);
}
@ -135,20 +134,11 @@ gtk_pixmap_set (GtkPixmap *pixmap,
}
if (GTK_WIDGET_VISIBLE (pixmap))
{
/* If we aren't drawing the entire area, clear first */
if (GTK_WIDGET_DRAWABLE (pixmap) &&
((mask != NULL) ||
(GTK_WIDGET (pixmap)->requisition.width != oldwidth) ||
(GTK_WIDGET (pixmap)->requisition.height != oldheight)))
{
pixmap->needs_clear = TRUE;
}
if ((GTK_WIDGET (pixmap)->requisition.width != oldwidth) ||
(GTK_WIDGET (pixmap)->requisition.height != oldheight))
gtk_widget_queue_resize (GTK_WIDGET (pixmap));
else
gtk_widget_queue_draw (GTK_WIDGET (pixmap));
gtk_widget_queue_clear (GTK_WIDGET (pixmap));
}
}
@ -194,17 +184,6 @@ gtk_pixmap_expose (GtkWidget *widget,
pixmap = GTK_PIXMAP (widget);
misc = GTK_MISC (widget);
if (pixmap->needs_clear)
{
gdk_window_clear_area (GTK_WIDGET (pixmap)->window,
GTK_WIDGET (pixmap)->allocation.x,
GTK_WIDGET (pixmap)->allocation.y,
GTK_WIDGET (pixmap)->allocation.width,
GTK_WIDGET (pixmap)->allocation.height);
pixmap->needs_clear = FALSE;
}
x = (widget->allocation.x * (1.0 - misc->xalign) +
(widget->allocation.x + widget->allocation.width
- (widget->requisition.width - misc->xpad * 2)) *
@ -231,6 +210,5 @@ gtk_pixmap_expose (GtkWidget *widget,
gdk_gc_set_clip_origin (widget->style->black_gc, 0, 0);
}
}
return FALSE;
}

View File

@ -45,8 +45,6 @@ struct _GtkPixmap
GdkPixmap *pixmap;
GdkBitmap *mask;
guint needs_clear : 1;
};
struct _GtkPixmapClass

View File

@ -423,6 +423,7 @@ gtk_preview_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

View File

@ -379,72 +379,47 @@ gtk_progress_bar_paint (GtkProgress *progress)
if (progress->offscreen_pixmap)
{
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_NORMAL, GTK_SHADOW_IN, 0, 0,
widget->allocation.width,
widget->allocation.height);
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_ACTIVE], TRUE,
widget->style->klass->xthickness,
widget->style->klass->ythickness,
widget->allocation.width -
widget->style->klass->xthickness * 2,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
NULL, widget, "trough",
0, 0,
widget->allocation.width,
widget->allocation.height);
if (progress->activity_mode)
{
if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
{
size = MAX (2, widget->allocation.width / pbar->activity_blocks);
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
pbar->activity_pos,
widget->style->klass->ythickness,
size,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
pbar->activity_pos,
widget->style->klass->ythickness,
size,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
pbar->activity_pos,
widget->style->klass->ythickness,
size,
widget->allocation.height - widget->style->klass->ythickness * 2);
return;
}
else
{
size = MAX (2, widget->allocation.height / pbar->activity_blocks);
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
widget->style->klass->xthickness,
pbar->activity_pos,
widget->allocation.width -
widget->style->klass->xthickness * 2,
size);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
widget->style->klass->xthickness,
pbar->activity_pos,
widget->allocation.width -
widget->style->klass->xthickness * 2,
size);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->style->klass->xthickness,
pbar->activity_pos,
widget->allocation.width - widget->style->klass->xthickness * 2,
size);
return;
}
}
amount = percentage * space;
if (amount > 0)
@ -456,22 +431,14 @@ gtk_progress_bar_paint (GtkProgress *progress)
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
{
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
widget->style->klass->xthickness,
widget->style->klass->ythickness,
amount,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
widget->style->klass->xthickness,
widget->style->klass->ythickness,
amount,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->style->klass->xthickness,
widget->style->klass->ythickness,
amount,
widget->allocation.height - widget->style->klass->ythickness * 2);
}
else
{
@ -482,82 +449,56 @@ gtk_progress_bar_paint (GtkProgress *progress)
block_delta = (((i + 1) * space) / pbar->blocks)
- ((i * space) / pbar->blocks);
gdk_draw_rectangle
(progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
x,
widget->style->klass->ythickness,
block_delta,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
x,
widget->style->klass->ythickness,
block_delta,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
x,
widget->style->klass->ythickness,
block_delta,
widget->allocation.height - widget->style->klass->ythickness * 2);
x += block_delta;
}
}
break;
case GTK_PROGRESS_RIGHT_TO_LEFT:
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
{
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
widget->allocation.width -
widget->style->klass->xthickness - amount,
widget->style->klass->ythickness,
amount,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
widget->allocation.width -
widget->style->klass->xthickness - amount,
widget->style->klass->ythickness,
amount,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->allocation.width -
widget->style->klass->xthickness - amount,
widget->style->klass->ythickness,
amount,
widget->allocation.height -
widget->style->klass->ythickness * 2);
}
else
{
x = widget->allocation.width -
widget->style->klass->xthickness;
for (i = 0; i <= pbar->in_block; i++)
{
block_delta = (((i + 1) * space) / pbar->blocks) -
((i * space) / pbar->blocks);
x -= block_delta;
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
x,
widget->style->klass->ythickness,
block_delta,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
x,
widget->style->klass->ythickness,
block_delta,
widget->allocation.height -
widget->style->klass->ythickness * 2);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
x,
widget->style->klass->ythickness,
block_delta,
widget->allocation.height -
widget->style->klass->ythickness * 2);
}
}
break;
@ -566,119 +507,86 @@ gtk_progress_bar_paint (GtkProgress *progress)
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
{
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
widget->style->klass->xthickness,
widget->allocation.height -
widget->style->klass->ythickness - amount,
widget->allocation.width -
widget->style->klass->xthickness * 2,
amount);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
widget->style->klass->xthickness,
widget->allocation.height -
widget->style->klass->ythickness - amount,
widget->allocation.width -
widget->style->klass->xthickness * 2,
amount);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->style->klass->xthickness,
widget->allocation.height -
widget->style->klass->ythickness - amount,
widget->allocation.width -
widget->style->klass->xthickness * 2,
amount);
}
else
{
y = widget->allocation.height -
widget->style->klass->ythickness;
for (i = 0; i <= pbar->in_block; i++)
{
block_delta = (((i + 1) * space) / pbar->blocks) -
((i * space) / pbar->blocks);
y -= block_delta;
gdk_draw_rectangle
(progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
widget->style->klass->xthickness,
y,
widget->allocation.width -
widget->style->klass->xthickness * 2,
block_delta);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
widget->style->klass->xthickness,
y,
widget->allocation.width -
widget->style->klass->xthickness * 2,
block_delta);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->style->klass->xthickness,
y,
widget->allocation.width -
widget->style->klass->xthickness * 2,
block_delta);
}
}
break;
case GTK_PROGRESS_TOP_TO_BOTTOM:
if (pbar->bar_style == GTK_PROGRESS_CONTINUOUS)
{
gdk_draw_rectangle (progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
widget->style->klass->xthickness,
widget->style->klass->ythickness,
widget->allocation.width -
widget->style->klass->xthickness * 2,
amount);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
widget->style->klass->xthickness,
widget->style->klass->ythickness,
widget->allocation.width -
widget->style->klass->xthickness * 2,
amount);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->style->klass->xthickness,
widget->style->klass->ythickness,
widget->allocation.width -
widget->style->klass->xthickness * 2,
amount);
}
else
{
y = widget->style->klass->ythickness;
for (i = 0; i <= pbar->in_block; i++)
{
block_delta = (((i + 1) * space) / pbar->blocks)
- ((i * space) / pbar->blocks);
gdk_draw_rectangle
(progress->offscreen_pixmap,
widget->style->bg_gc[GTK_STATE_PRELIGHT],
TRUE,
widget->style->klass->xthickness,
y,
widget->allocation.width -
widget->style->klass->xthickness * 2,
block_delta);
gtk_draw_shadow (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
widget->style->klass->xthickness,
y,
widget->allocation.width -
widget->style->klass->xthickness * 2,
block_delta);
gtk_paint_box (widget->style,
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->style->klass->xthickness,
y,
widget->allocation.width -
widget->style->klass->xthickness * 2,
block_delta);
y += block_delta;
}
}
break;
default:
break;
}
}
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
gint x;

View File

@ -98,6 +98,7 @@ gtk_radio_button_class_init (GtkRadioButtonClass *class)
static void
gtk_radio_button_init (GtkRadioButton *radio_button)
{
GTK_WIDGET_SET_FLAGS (radio_button, GTK_NO_WINDOW);
radio_button->group = g_slist_prepend (NULL, radio_button);
}
@ -358,7 +359,6 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
GtkShadowType shadow_type;
GdkRectangle restrict_area;
GdkRectangle new_area;
GdkPoint pts[4];
gint width, height;
gint x, y;
@ -376,43 +376,34 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
(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, widget->window, state_type,
GTK_SHADOW_ETCHED_OUT,
area, widget, "radiobutton",
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;
if (GTK_TOGGLE_BUTTON (widget)->active)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;
pts[0].x = x + width / 2;
pts[0].y = y;
pts[1].x = x + width;
pts[1].y = y + height / 2;
pts[2].x = pts[0].x;
pts[2].y = y + height;
pts[3].x = x;
pts[3].y = pts[1].y;
gdk_draw_polygon (widget->window,
widget->style->bg_gc[GTK_WIDGET_STATE (widget)],
TRUE, pts, 4);
gtk_draw_diamond (widget->style, widget->window,
gtk_paint_option (widget->style, widget->window,
GTK_WIDGET_STATE (widget), shadow_type,
area, widget, "radiobutton",
x, y, width, height);
}
}

View File

@ -227,7 +227,6 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
GtkWidget *widget;
GtkStateType state_type;
GtkShadowType shadow_type;
GdkPoint pts[4];
gint width, height;
gint x, y;
@ -244,8 +243,6 @@ gtk_radio_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))
@ -257,20 +254,9 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
else
shadow_type = GTK_SHADOW_OUT;
pts[0].x = x + width / 2;
pts[0].y = y;
pts[1].x = x + width;
pts[1].y = y + height / 2;
pts[2].x = pts[0].x;
pts[2].y = y + height;
pts[3].x = x;
pts[3].y = pts[1].y;
gdk_draw_polygon (widget->window,
widget->style->bg_gc[state_type],
TRUE, pts, 4);
gtk_draw_diamond (widget->style, widget->window,
gtk_paint_option (widget->style, widget->window,
state_type, shadow_type,
area, widget, "option",
x, y, width, height);
}
}

View File

@ -142,6 +142,7 @@ gtk_range_class_init (GtkRangeClass *class)
class->step_forw = 3;
class->step_back = 4;
class->draw_background = NULL;
class->clear_background = NULL;
class->draw_trough = gtk_real_range_draw_trough;
class->draw_slider = gtk_real_range_draw_slider;
class->draw_step_forw = NULL;
@ -244,6 +245,16 @@ gtk_range_draw_background (GtkRange *range)
(* RANGE_CLASS (range)->draw_background) (range);
}
void
gtk_range_clear_background (GtkRange *range)
{
g_return_if_fail (range != NULL);
g_return_if_fail (GTK_IS_RANGE (range));
if (range->trough && RANGE_CLASS (range)->clear_background)
(* RANGE_CLASS (range)->clear_background) (range);
}
void
gtk_range_draw_trough (GtkRange *range)
{
@ -532,7 +543,7 @@ gtk_range_default_hmotion (GtkRange *range,
else
{
gtk_range_slider_update (range);
gtk_range_draw_background (range);
gtk_range_clear_background (range);
if (range->policy == GTK_UPDATE_DELAYED)
{
@ -597,7 +608,7 @@ gtk_range_default_vmotion (GtkRange *range,
else
{
gtk_range_slider_update (range);
gtk_range_draw_background (range);
gtk_range_clear_background (range);
if (range->policy == GTK_UPDATE_DELAYED)
{
@ -717,7 +728,6 @@ gtk_range_expose (GtkWidget *widget,
* trough-drawing handler. (Probably should really pass another
* argument - the redrawn area to all the drawing functions)
*/
gint xt = widget->style->klass->xthickness;
gint yt = widget->style->klass->ythickness;
@ -983,7 +993,7 @@ gtk_range_key_press (GtkWidget *widget,
"value_changed");
gtk_range_slider_update (range);
gtk_range_draw_background (range);
gtk_range_clear_background (range);
}
}
}
@ -1108,23 +1118,16 @@ gtk_real_range_draw_trough (GtkRange *range)
g_return_if_fail (GTK_IS_RANGE (range));
if (range->trough)
{
gtk_draw_shadow (GTK_WIDGET (range)->style, range->trough,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
0, 0, -1, -1);
if (GTK_WIDGET_HAS_FOCUS (range))
gdk_draw_rectangle (GTK_WIDGET (range)->window,
GTK_WIDGET (range)->style->black_gc,
FALSE, 0, 0,
GTK_WIDGET (range)->allocation.width - 1,
GTK_WIDGET (range)->allocation.height - 1);
else if (range->trough != GTK_WIDGET (range)->window)
gdk_draw_rectangle (GTK_WIDGET (range)->window,
GTK_WIDGET (range)->style->bg_gc[GTK_STATE_NORMAL],
FALSE, 0, 0,
GTK_WIDGET (range)->allocation.width - 1,
GTK_WIDGET (range)->allocation.height - 1);
{
gtk_paint_box (GTK_WIDGET (range)->style, range->trough,
GTK_STATE_ACTIVE, GTK_SHADOW_IN,
NULL, GTK_WIDGET(range), "trough",
0, 0, -1, -1);
if (GTK_WIDGET_HAS_FOCUS (range))
gtk_paint_focus (GTK_WIDGET (range)->style,
range->trough,
NULL, GTK_WIDGET(range), "trough",
0, 0, -1, -1);
}
}
@ -1132,10 +1135,10 @@ static void
gtk_real_range_draw_slider (GtkRange *range)
{
GtkStateType state_type;
g_return_if_fail (range != NULL);
g_return_if_fail (GTK_IS_RANGE (range));
if (range->slider)
{
if ((range->in_child == RANGE_CLASS (range)->slider) ||
@ -1143,13 +1146,10 @@ gtk_real_range_draw_slider (GtkRange *range)
state_type = GTK_STATE_PRELIGHT;
else
state_type = GTK_STATE_NORMAL;
gtk_style_set_background (GTK_WIDGET (range)->style, range->slider, state_type);
gdk_window_clear (range->slider);
gtk_draw_shadow (GTK_WIDGET (range)->style, range->slider,
state_type, GTK_SHADOW_OUT,
0, 0, -1, -1);
gtk_paint_box (GTK_WIDGET (range)->style, range->slider,
state_type, GTK_SHADOW_OUT,
NULL, GTK_WIDGET (range), "slider",
0, 0, -1, -1);
}
}
@ -1289,7 +1289,7 @@ gtk_range_scroll (GtkRange *range,
else
{
gtk_range_slider_update (range);
gtk_range_draw_background (range);
gtk_range_clear_background (range);
}
}
@ -1356,7 +1356,7 @@ gtk_range_adjustment_changed (GtkAdjustment *adjustment,
(range->old_page_size != adjustment->page_size))
{
gtk_range_slider_update (range);
gtk_range_draw_background (range);
gtk_range_clear_background (range);
range->old_value = adjustment->value;
range->old_lower = adjustment->lower;
@ -1379,7 +1379,7 @@ gtk_range_adjustment_value_changed (GtkAdjustment *adjustment,
if (range->old_value != adjustment->value)
{
gtk_range_slider_update (range);
gtk_range_draw_background (range);
gtk_range_clear_background (range);
range->old_value = adjustment->value;
}
@ -1474,7 +1474,7 @@ gtk_range_style_set (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget) &&
!GTK_WIDGET_NO_WINDOW (widget))
{
if (range->trough)
if (range->trough)
{
gtk_style_set_background (widget->style, range->trough, GTK_STATE_ACTIVE);
if (GTK_WIDGET_DRAWABLE (widget))
@ -1494,5 +1494,6 @@ gtk_range_style_set (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (range->step_back);
}
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
}
}

View File

@ -82,7 +82,8 @@ struct _GtkRangeClass
guint8 step_forw;
guint8 step_back;
void (* draw_background) (GtkRange *range);
void (* draw_background) (GtkRange *range);
void (* clear_background) (GtkRange *range);
void (* draw_trough) (GtkRange *range);
void (* draw_slider) (GtkRange *range);
void (* draw_step_forw) (GtkRange *range);
@ -111,6 +112,7 @@ void gtk_range_set_adjustment (GtkRange *range,
GtkAdjustment *adjustment);
void gtk_range_draw_background (GtkRange *range);
void gtk_range_clear_background (GtkRange *range);
void gtk_range_draw_trough (GtkRange *range);
void gtk_range_draw_slider (GtkRange *range);
void gtk_range_draw_step_forw (GtkRange *range);

File diff suppressed because it is too large Load Diff

View File

@ -23,25 +23,52 @@
#include <gtk/gtkstyle.h>
#include <gtk/gtkwidget.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef enum {
GTK_RC_FG = 1 << 0,
GTK_RC_BG = 1 << 1,
GTK_RC_TEXT = 1 << 2,
GTK_RC_BASE = 1 << 3
} GtkRcFlags;
struct _GtkRcStyle
{
char *name;
char *font_name;
char *fontset_name;
char *bg_pixmap_name[5];
GtkRcFlags color_flags[5];
GdkColor fg[5];
GdkColor bg[5];
GdkColor text[5];
GdkColor base[5];
GtkThemeEngine *engine;
gpointer engine_data;
/* Private */
guint ref_count;
};
void gtk_rc_init (void);
void gtk_rc_parse (const gchar *filename);
void gtk_rc_parse_string (const gchar *rc_string);
gboolean gtk_rc_reparse_all (void);
GtkStyle* gtk_rc_get_style (GtkWidget *widget);
void gtk_rc_add_widget_name_style (GtkStyle *style,
void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style,
const gchar *pattern);
void gtk_rc_add_widget_class_style (GtkStyle *style,
void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style,
const gchar *pattern);
void gtk_rc_add_class_style (GtkStyle *style,
void gtk_rc_add_class_style (GtkRcStyle *rc_style,
const gchar *pattern);
GtkRcStyle *gtk_rc_style_new (void);
void gtk_rc_style_ref (GtkRcStyle *rc_style);
void gtk_rc_style_unref (GtkRcStyle *rc_style);
/* Tell gtkrc to use a custom routine to load images specified in rc files instead of
* the default xpm-only loader
@ -53,6 +80,15 @@ typedef GdkPixmap * (*GtkImageLoader) (GdkWindow *window,
const gchar *filename);
void gtk_rc_set_image_loader(GtkImageLoader loader);
GdkPixmap *gtk_rc_load_image (GdkColormap *colormap,
GdkColor *transparent_color,
const gchar *filename);
gchar *gtk_rc_find_pixmap_in_path (GScanner *scanner,
gchar *pixmap_file);
gchar *gtk_rc_find_module_in_path (GScanner *scanner,
gchar *module_file);
gchar *gtk_rc_get_theme_dir(void);
gchar *gtk_rc_get_module_dir(void);
/* private functions/definitions */
typedef enum {
@ -82,6 +118,8 @@ typedef enum {
GTK_RC_TOKEN_APPLICATION,
GTK_RC_TOKEN_RC,
GTK_RC_TOKEN_HIGHEST,
GTK_RC_TOKEN_ENGINE,
GTK_RC_TOKEN_MODULE_PATH,
GTK_RC_TOKEN_LAST
} GtkRcTokenType;

View File

@ -249,26 +249,20 @@ gtk_ruler_expose (GtkWidget *widget,
{
ruler = GTK_RULER (widget);
gdk_draw_rectangle (ruler->backing_store,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE, 0, 0,
widget->allocation.width,
widget->allocation.height);
gtk_paint_box (widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, widget, "ruler",
0, 0, -1, -1);
gtk_ruler_draw_ticks (ruler);
gtk_draw_shadow (widget->style, ruler->backing_store,
GTK_STATE_NORMAL, GTK_SHADOW_OUT, 0, 0,
widget->allocation.width,
widget->allocation.height);
gdk_draw_pixmap (widget->window,
ruler->non_gr_exp_gc,
ruler->backing_store,
0, 0, 0, 0,
widget->allocation.width,
widget->allocation.height);
gtk_ruler_draw_pos (ruler);
}

View File

@ -26,6 +26,9 @@
static void gtk_scale_class_init (GtkScaleClass *klass);
static void gtk_scale_init (GtkScale *scale);
static void gtk_scale_map (GtkWidget *widget);
static void gtk_scale_unmap (GtkWidget *widget);
static void gtk_scale_draw_background (GtkRange *range);
@ -61,13 +64,18 @@ static void
gtk_scale_class_init (GtkScaleClass *class)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkRangeClass *range_class;
object_class = (GtkObjectClass*) class;
range_class = (GtkRangeClass*) class;
widget_class = (GtkWidgetClass*) class;
parent_class = gtk_type_class (gtk_range_get_type ());
widget_class->map = gtk_scale_map;
widget_class->unmap = gtk_scale_unmap;
range_class->draw_background = gtk_scale_draw_background;
class->slider_length = 31;
@ -79,11 +87,46 @@ static void
gtk_scale_init (GtkScale *scale)
{
GTK_WIDGET_SET_FLAGS (scale, GTK_CAN_FOCUS);
GTK_WIDGET_SET_FLAGS (scale, GTK_NO_WINDOW);
GTK_RANGE (scale)->digits = 1;
scale->draw_value = TRUE;
scale->value_pos = GTK_POS_TOP;
}
static void
gtk_scale_map (GtkWidget *widget)
{
GtkRange *range;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_SCALE (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
range = GTK_RANGE (widget);
if (GTK_WIDGET_NO_WINDOW (widget))
gtk_widget_queue_draw (widget);
gdk_window_show (range->trough);
}
static void
gtk_scale_unmap (GtkWidget *widget)
{
GtkRange *range;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_SCALE (widget));
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
range = GTK_RANGE (widget);
if (GTK_WIDGET_NO_WINDOW (widget))
gtk_widget_queue_clear (widget);
gdk_window_hide (range->trough);
}
void
gtk_scale_set_digits (GtkScale *scale,
gint digits)

View File

@ -499,15 +499,21 @@ gtk_spin_button_paint (GtkWidget *widget,
if (GTK_WIDGET_DRAWABLE (widget))
{
if (spin->shadow_type != GTK_SHADOW_NONE)
gtk_draw_shadow (widget->style, spin->panel,
GTK_STATE_NORMAL, spin->shadow_type,
0, 0,
ARROW_SIZE + 2 * widget->style->klass->xthickness,
widget->requisition.height);
gtk_spin_button_draw_arrow (spin, GTK_ARROW_UP);
gtk_spin_button_draw_arrow (spin, GTK_ARROW_DOWN);
gtk_paint_box (widget->style, spin->panel,
GTK_STATE_NORMAL, spin->shadow_type,
area, widget, "spinbutton",
0, 0,
ARROW_SIZE + 2 * widget->style->klass->xthickness,
widget->requisition.height);
else
{
gdk_window_set_back_pixmap (spin->panel, NULL, TRUE);
gdk_window_clear_area (spin->panel, area->x, area->y, area->width, area->height);
}
gtk_spin_button_draw_arrow (spin, GTK_ARROW_UP);
gtk_spin_button_draw_arrow (spin, GTK_ARROW_DOWN);
GTK_WIDGET_CLASS (parent_class)->draw (widget, area);
GTK_WIDGET_CLASS (parent_class)->draw (widget, area);
}
}
@ -581,10 +587,12 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
x = widget->style->klass->xthickness - 1;
y = widget->style->klass->ythickness - 1;
}
gtk_draw_arrow (widget->style, spin_button->panel,
state_type, shadow_type, arrow, TRUE,
x, y, ARROW_SIZE, widget->requisition.height / 2
- widget->style->klass->ythickness);
gtk_paint_arrow (widget->style, spin_button->panel,
state_type, shadow_type,
NULL, widget, "spinbutton",
arrow, TRUE,
x, y, ARROW_SIZE, widget->requisition.height / 2
- widget->style->klass->ythickness);
}
else
{
@ -598,10 +606,12 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
x = widget->style->klass->xthickness - 1;
y = widget->requisition.height / 2 + 1;
}
gtk_draw_arrow (widget->style, spin_button->panel,
state_type, shadow_type, arrow, TRUE,
x, y, ARROW_SIZE, widget->requisition.height / 2
- widget->style->klass->ythickness);
gtk_paint_arrow (widget->style, spin_button->panel,
state_type, shadow_type,
NULL, widget, "spinbutton",
arrow, TRUE,
x, y, ARROW_SIZE, widget->requisition.height / 2
- widget->style->klass->ythickness);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,6 @@
#include <gdk/gdk.h>
#include <gtk/gtkenums.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@ -31,6 +30,18 @@ extern "C" {
typedef struct _GtkStyle GtkStyle;
typedef struct _GtkStyleClass GtkStyleClass;
/* Some forward declarations needed to rationalize the header
* files.
*/
typedef struct _GtkThemeEngine GtkThemeEngine;
typedef struct _GtkRcStyle GtkRcStyle;
/* We make this forward declaration here, since we pass
* GtkWidgt's to the draw functions.
*/
typedef struct _GtkWidget GtkWidget;
/* This is used for having dynamic style changing stuff */
/* fg, bg, light, dark, mid, text, base */
#define GTK_STYLE_NUM_STYLECOLORS() 7*5
@ -63,13 +74,21 @@ struct _GtkStyle
GdkPixmap *bg_pixmap[5];
/* Private */
gint ref_count;
gint attach_count;
gint depth;
GdkColormap *colormap;
GtkStyleClass *klass;
GtkStyleClass *klass; /* Not private - reorder me */
GtkThemeEngine *engine;
gpointer engine_data;
GtkRcStyle *rc_style; /* the Rc style from which this style
* was created */
GSList *styles;
};
struct _GtkStyleClass
@ -80,12 +99,18 @@ struct _GtkStyleClass
void (*draw_hline) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x1,
gint x2,
gint y);
void (*draw_vline) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint y1,
gint y2,
gint x);
@ -93,6 +118,9 @@ struct _GtkStyleClass
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
@ -101,15 +129,21 @@ struct _GtkStyleClass
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
GdkPoint *point,
gint npoints,
gint fill);
gboolean fill);
void (*draw_arrow) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
GtkArrowType arrow_type,
gint fill,
gboolean fill,
gint x,
gint y,
gint width,
@ -118,6 +152,9 @@ struct _GtkStyleClass
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
@ -126,6 +163,9 @@ struct _GtkStyleClass
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
@ -133,12 +173,165 @@ struct _GtkStyleClass
void (*draw_string) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
const gchar *string);
void (*draw_box) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void (*draw_flat_box) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void (*draw_check) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void (*draw_option) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void (*draw_cross) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void (*draw_ramp) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
GtkArrowType arrow_type,
gint x,
gint y,
gint width,
gint height);
void (*draw_tab) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void (*draw_shadow_gap) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side,
gint gap_x,
gint gap_width);
void (*draw_box_gap) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side,
gint gap_x,
gint gap_width);
void (*draw_extension) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side);
void (*draw_focus) (GtkStyle *style,
GdkWindow *window,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void (*draw_slider) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkOrientation orientation);
void (*draw_handle) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkOrientation orientation);
};
GtkStyle* gtk_style_new (void);
GtkStyle* gtk_style_copy (GtkStyle *style);
GtkStyle* gtk_style_attach (GtkStyle *style,
@ -149,8 +342,15 @@ void gtk_style_unref (GtkStyle *style);
void gtk_style_set_background (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type);
void gtk_style_apply_default_pixmap(GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_hline (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
@ -177,13 +377,13 @@ void gtk_draw_polygon (GtkStyle *style,
GtkShadowType shadow_type,
GdkPoint *points,
gint npoints,
gint fill);
gboolean fill);
void gtk_draw_arrow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GtkArrowType arrow_type,
gint fill,
gboolean fill,
gint x,
gint y,
gint width,
@ -210,8 +410,376 @@ void gtk_draw_string (GtkStyle *style,
gint x,
gint y,
const gchar *string);
void gtk_draw_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_flat_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_check (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_option (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_cross (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_ramp (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GtkArrowType arrow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_tab (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_shadow_gap (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side,
gint gap_x,
gint gap_width);
void gtk_draw_box_gap (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side,
gint gap_x,
gint gap_width);
void gtk_draw_extension (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side);
void gtk_draw_focus (GtkStyle *style,
GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void gtk_draw_slider (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height,
GtkOrientation orientation);
void gtk_draw_handle (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
gint x,
gint y,
gint width,
gint height,
GtkOrientation orientation);
/*
* NEW API CALLS
*
* NEW API CALLS
*
* NEW API CALLS
*
* NEW API CALLS
*
* NEW API CALLS
*
* NEW API CALLS
*
* NEW API CALLS
*
* NEW API CALLS
*
*/
void gtk_paint_hline (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x1,
gint x2,
gint y);
void gtk_paint_vline (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint y1,
gint y2,
gint x);
void gtk_paint_shadow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_polygon (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
GdkPoint *points,
gint npoints,
gboolean fill);
void gtk_paint_arrow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
GtkArrowType arrow_type,
gboolean fill,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_diamond (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_oval (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_string (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
const gchar *string);
void gtk_paint_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_flat_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_check (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_option (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_cross (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_ramp (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
GtkArrowType arrow_type,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_tab (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_shadow_gap (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side,
gint gap_x,
gint gap_width);
void gtk_paint_box_gap (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side,
gint gap_x,
gint gap_width);
void gtk_paint_extension (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkPositionType gap_side);
void gtk_paint_focus (GtkStyle *style,
GdkWindow *window,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height);
void gtk_paint_slider (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkOrientation orientation);
void gtk_paint_handle (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
gchar *detail,
gint x,
gint y,
gint width,
gint height,
GtkOrientation orientation);
void gtk_reset_widget_shapes(GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -134,9 +134,6 @@ gtk_tearoff_menu_item_paint (GtkWidget *widget,
menu_item = GTK_MENU_ITEM (widget);
tearoff_item = GTK_TEAROFF_MENU_ITEM (widget);
gtk_style_set_background (widget->style, widget->window, widget->state);
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;
@ -144,11 +141,14 @@ gtk_tearoff_menu_item_paint (GtkWidget *widget,
right_max = x + width;
if (widget->state == GTK_STATE_PRELIGHT)
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_clear_area (widget->window, area->x, area->y, area->width, area->height);
if (tearoff_item->torn_off)
{

View File

@ -1350,18 +1350,19 @@ gtk_text_draw_focus (GtkWidget *widget)
height -= 2;
xextra -= 1;
yextra -= 1;
gdk_draw_rectangle (widget->window,
widget->style->fg_gc[GTK_STATE_NORMAL],
FALSE, 0, 0,
widget->allocation.width - 1,
widget->allocation.height - 1);
gtk_paint_focus (widget->style, widget->window,
NULL, widget, "text",
0, 0,
widget->allocation.width - 1,
widget->allocation.height - 1);
}
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, "text",
x, y, width, height);
x += xthick;
y += ythick;
width -= 2 * xthick;
@ -1380,14 +1381,6 @@ gtk_text_draw_focus (GtkWidget *widget)
/* bottom rect */
clear_focus_area (text, x, x + height - yextra, width, yextra);
}
else if (!GTK_WIDGET_HAS_FOCUS (widget))
{
gdk_draw_rectangle (widget->window,
widget->style->base_gc[GTK_STATE_NORMAL], FALSE,
x, y,
width - 1,
height - 1);
}
}
else
{
@ -4571,32 +4564,48 @@ expand_scratch_buffer (GtkText* text, guint len)
}
}
/* Returns a GC to draw a background for the text at a mark,
* or NULL, if the mark's background is NULL
*
* Side effect: modifies text->gc
/* Side effect: modifies text->gc
*/
static GdkGC *
mark_bg_gc (GtkText* text, const GtkPropertyMark *mark)
static void
draw_bg_rect (GtkText* text, GtkPropertyMark *mark,
gint x, gint y, gint width, gint height,
gboolean already_cleared)
{
GtkEditable *editable = GTK_EDITABLE(text);
if ((mark->index >= MIN(editable->selection_start_pos, editable->selection_end_pos) &&
mark->index < MAX(editable->selection_start_pos, editable->selection_end_pos)))
{
if (editable->has_selection)
return GTK_WIDGET(text)->style->bg_gc[GTK_STATE_SELECTED];
else
return GTK_WIDGET(text)->style->bg_gc[GTK_STATE_ACTIVE];
gtk_paint_flat_box(GTK_WIDGET(text)->style, text->text_area,
editable->has_selection ?
GTK_STATE_SELECTED : GTK_STATE_ACTIVE,
GTK_SHADOW_NONE,
NULL, GTK_WIDGET(text), "text",
x, y, width, height);
}
else if (!gdk_color_equal(MARK_CURRENT_BACK (text, mark),
&GTK_WIDGET(text)->style->base[GTK_STATE_NORMAL]))
{
gdk_gc_set_foreground (text->gc, MARK_CURRENT_BACK (text, mark));
return text->gc;
gdk_draw_rectangle (text->text_area,
text->gc,
TRUE, x, y, width, height);
}
return NULL;
else if (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL])
{
GdkRectangle rect;
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
clear_area (text, &rect);
}
else if (!already_cleared)
gdk_window_clear_area (text->text_area, x, y, width, height);
}
static void
@ -4609,7 +4618,7 @@ draw_line (GtkText* text,
gint len = 0;
guint running_offset = lp->tab_cont.pixel_offset;
guchar* buffer;
GdkGC *fg_gc, *bg_gc;
GdkGC *fg_gc;
GtkEditable *editable = GTK_EDITABLE(text);
@ -4645,27 +4654,8 @@ draw_line (GtkText* text,
if (running_offset > 0)
{
bg_gc = mark_bg_gc (text, &mark);
if (bg_gc)
gdk_draw_rectangle (text->text_area,
bg_gc,
TRUE,
0,
pixel_start_height,
running_offset,
LINE_HEIGHT (*lp));
else if (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL])
{
GdkRectangle rect;
rect.x = 0;
rect.y = pixel_start_height;
rect.width = running_offset;
rect.height = LINE_HEIGHT (*lp);
clear_area (text, &rect);
}
draw_bg_rect (text, &mark, 0, pixel_start_height, running_offset,
LINE_HEIGHT (*lp), TRUE);
}
for (; chars > 0; chars -= len, buffer += len, len = 0)
@ -4697,26 +4687,8 @@ draw_line (GtkText* text,
else
pixel_width = gdk_text_width (font, (gchar*) buffer, len);
bg_gc = mark_bg_gc (text, &mark);
if (bg_gc)
gdk_draw_rectangle (text->text_area,
bg_gc,
TRUE,
running_offset,
pixel_start_height,
pixel_width,
LINE_HEIGHT(*lp));
else if (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL])
{
GdkRectangle rect;
rect.x = running_offset;
rect.y = pixel_start_height;
rect.width = pixel_width;
rect.height = LINE_HEIGHT (*lp);
clear_area (text, &rect);
}
draw_bg_rect (text, &mark, running_offset, pixel_start_height,
pixel_width, LINE_HEIGHT (*lp), TRUE);
if ((mark.index >= selection_start_pos) &&
(mark.index < selection_end_pos))
@ -4745,32 +4717,23 @@ draw_line (GtkText* text,
}
else
{
gint pixels_remaining;
gint space_width;
gint spaces_avail;
len = 1;
bg_gc = mark_bg_gc (text, &mark);
if (bg_gc)
{
gint pixels_remaining;
gint space_width;
gint spaces_avail;
gdk_window_get_size (text->text_area, &pixels_remaining, NULL);
pixels_remaining -= (LINE_WRAP_ROOM + running_offset);
space_width = MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' '];
spaces_avail = pixels_remaining / space_width;
spaces_avail = MIN (spaces_avail, tab_mark.to_next_tab);
gdk_draw_rectangle (text->text_area,
bg_gc,
TRUE,
running_offset,
pixel_start_height,
spaces_avail * space_width,
LINE_HEIGHT (*lp));
}
gdk_window_get_size (text->text_area, &pixels_remaining, NULL);
pixels_remaining -= (LINE_WRAP_ROOM + running_offset);
space_width = MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' '];
spaces_avail = pixels_remaining / space_width;
spaces_avail = MIN (spaces_avail, tab_mark.to_next_tab);
draw_bg_rect (text, &mark, running_offset, pixel_start_height,
spaces_avail * space_width, LINE_HEIGHT (*lp), TRUE);
running_offset += tab_mark.to_next_tab *
MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' '];
@ -4833,7 +4796,6 @@ static void
undraw_cursor (GtkText* text, gint absolute)
{
GtkEditable *editable = (GtkEditable *)text;
GdkGC *gc;
TDEBUG (("in undraw_cursor\n"));
@ -4849,30 +4811,11 @@ undraw_cursor (GtkText* text, gint absolute)
g_assert(text->cursor_mark.property);
font = MARK_CURRENT_FONT(text, &text->cursor_mark);
gc = mark_bg_gc (text, &text->cursor_mark);
if (!gc && (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL]))
{
GdkRectangle rect;
rect.x = text->cursor_pos_x;
rect.y = text->cursor_pos_y - text->cursor_char_offset - font->ascent;
rect.width = 1;
rect.height = font->ascent + 1; /* @@@ I add one here because draw_line is inclusive, right? */
clear_area (text, &rect);
}
else
{
if (!gc)
{
gdk_gc_set_foreground (text->gc, MARK_CURRENT_BACK (text, &text->cursor_mark));
gc = text->gc;
}
gdk_draw_line (text->text_area, gc, text->cursor_pos_x,
text->cursor_pos_y - text->cursor_char_offset, text->cursor_pos_x,
text->cursor_pos_y - text->cursor_char_offset - font->ascent);
}
draw_bg_rect (text, &text->cursor_mark,
text->cursor_pos_x,
text->cursor_pos_y - text->cursor_char_offset - font->ascent,
1, font->ascent + 1, FALSE);
if (text->cursor_char)
{

138
gtk/gtkthemes.c Normal file
View File

@ -0,0 +1,138 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* Themes added by The Rasterman <raster@redhat.com>
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <gmodule.h>
#include "gtkthemes.h"
#include "gtkmain.h"
#include "gtkrc.h"
#include "gtkselection.h"
#include "gtksignal.h"
#include "gtkwidget.h"
#include "gtkprivate.h"
#include "config.h"
typedef struct _GtkThemeEnginePrivate GtkThemeEnginePrivate;
struct _GtkThemeEnginePrivate {
GtkThemeEngine engine;
GModule *library;
void *name;
void (*init) (GtkThemeEngine *);
void (*exit) (void);
guint refcount;
};
static GHashTable *engine_hash = NULL;
GtkThemeEngine *
gtk_theme_engine_get (gchar *name)
{
GtkThemeEnginePrivate *result;
if (!engine_hash)
engine_hash = g_hash_table_new (g_str_hash, g_str_equal);
/* get the library name for the theme */
result = g_hash_table_lookup (engine_hash, name);
if (!result)
{
gchar fullname[1024];
gchar *engine_path;
GModule *library;
g_snprintf (fullname, 1024, "lib%s.so", name);
engine_path = gtk_rc_find_module_in_path(NULL, fullname);
if (!engine_path)
return NULL;
/* load the lib */
printf ("Loading Theme %s\n", engine_path);
library = g_module_open (engine_path, 0);
g_free(engine_path);
if (!library)
g_error(g_module_error());
else
{
result = g_new (GtkThemeEnginePrivate, 1);
result->refcount = 1;
result->name = g_strdup (name);
result->library = library;
/* extract symbols from the lib */
if (!g_module_symbol (library, "theme_init",
(gpointer *)&result->init) ||
!g_module_symbol (library, "theme_exit",
(gpointer *)&result->exit))
{
g_error (g_module_error());
g_free (result);
return NULL;
}
/* call the theme's init (theme_init) function to let it */
/* setup anything it needs to set up. */
result->init((GtkThemeEngine *)result);
g_hash_table_insert (engine_hash, result->name, result);
}
}
else
result->refcount++;
return (GtkThemeEngine *)result;
}
void
gtk_theme_engine_ref (GtkThemeEngine *engine)
{
g_return_if_fail (engine != NULL);
((GtkThemeEnginePrivate *)engine)->refcount++;
}
void
gtk_theme_engine_unref (GtkThemeEngine *engine)
{
GtkThemeEnginePrivate *private;
g_return_if_fail (engine != NULL);
private = (GtkThemeEnginePrivate *)engine;
private->refcount--;
if (private->refcount == 0)
{
g_hash_table_remove (engine_hash, private->name);
g_module_close (private->library);
g_free (private->name);
g_free (private);
}
}

95
gtk/gtkthemes.h Normal file
View File

@ -0,0 +1,95 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* Themes added by The Rasterman <raster@redhat.com>
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __GTK_THEMES_H__
#define __GTK_THEMES_H__
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <gdk/gdk.h>
#include <gtk/gtkstyle.h>
#include <gtk/gtkwidget.h>
struct _GtkThemeEngine {
/* Fill in engine_data pointer in a GtkRcStyle by parsing contents
* of brackets. Returns G_TOKEN_NONE if succesfull, otherwise returns
* the token it expected but didn't get.
*/
guint (*parse_rc_style) (GScanner *scanner, GtkRcStyle *rc_style);
/* Combine RC style data from src into dest. If
* dest->engine_data is NULL, it should be initialized to default
* values.
*/
void (*merge_rc_style) (GtkRcStyle *dest, GtkRcStyle *src);
/* Fill in style->engine_data from rc_style->engine_data */
void (*rc_style_to_style) (GtkStyle *style, GtkRcStyle *rc_style);
/* Duplicate engine_data from src to dest. The engine_data will
* not subsequently be modified except by a call to realize_style()
* so if realize_style() does nothing, refcounting is appropriate.
*/
void (*duplicate_style) (GtkStyle *dest, GtkStyle *src);
/* If style needs to initialize for a particular colormap/depth
* combination, do it here. style->colormap/style->depth will have
* been set at this point, and style itself initialized for
* the colormap
*/
void (*realize_style) (GtkStyle *new_style);
/* If style needs to clean up for a particular colormap/depth
* combination, do it here.
*/
void (*unrealize_style) (GtkStyle *new_style);
/* Clean up rc_style->engine_data before rc_style is destroyed */
void (*destroy_rc_style) (GtkRcStyle *rc_style);
/* Clean up style->engine_data before style is destroyed */
void (*destroy_style) (GtkStyle *style);
void (*set_background) (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type);
};
GtkThemeEngine *gtk_theme_engine_get (gchar *name);
void gtk_theme_engine_ref (GtkThemeEngine *engine);
void gtk_theme_engine_unref (GtkThemeEngine *engine);
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Initialization, exit, mainloop and miscellaneous routines
*/
void gtk_themes_init (int *argc,
char ***argv);
void gtk_themes_exit (gint error_code);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_THEMES_H__ */

View File

@ -52,10 +52,12 @@ static void gtk_toggle_button_set_arg (GtkObject *object,
static void gtk_toggle_button_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_toggle_button_leave (GtkButton *button);
static void gtk_toggle_button_realize (GtkWidget *widget);
static void gtk_toggle_button_unrealize (GtkWidget *widget);
static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
static GtkContainerClass *parent_class = NULL;
GtkType
gtk_toggle_button_get_type (void)
@ -95,6 +97,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
container_class = (GtkContainerClass*) class;
button_class = (GtkButtonClass*) class;
parent_class = gtk_type_class (GTK_TYPE_BUTTON);
gtk_object_add_arg_type ("GtkToggleButton::active", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ACTIVE);
gtk_object_add_arg_type ("GtkToggleButton::draw_indicator", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_DRAW_INDICATOR);
@ -112,6 +116,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
object_class->get_arg = gtk_toggle_button_get_arg;
widget_class->draw_focus = gtk_toggle_button_draw_focus;
widget_class->realize = gtk_toggle_button_realize;
widget_class->unrealize = gtk_toggle_button_unrealize;
button_class->pressed = gtk_toggle_button_pressed;
button_class->released = gtk_toggle_button_released;
@ -208,7 +214,15 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
if (toggle_button->draw_indicator != draw_indicator)
{
toggle_button->draw_indicator = draw_indicator;
if (GTK_WIDGET_REALIZED(toggle_button))
{
gtk_widget_unrealize(GTK_WIDGET(toggle_button));
toggle_button->draw_indicator = draw_indicator;
gtk_widget_realize(GTK_WIDGET(toggle_button));
gtk_widget_show(GTK_WIDGET(toggle_button));
}
else
toggle_button->draw_indicator = draw_indicator;
if (GTK_WIDGET_VISIBLE (toggle_button))
gtk_widget_queue_resize (GTK_WIDGET (toggle_button));
@ -272,26 +286,16 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
width -= 2;
height -= 2;
}
else
{
if (GTK_WIDGET_STATE (toggle_button) == 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
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_WIDGET_STATE (widget)], FALSE,
x + 2, y + 2, width - 5, height - 5);
}
if (toggle_button->active)
shadow_type = GTK_SHADOW_IN;
else
shadow_type = GTK_SHADOW_OUT;
gtk_draw_shadow (widget->style, widget->window,
GTK_WIDGET_STATE (widget), shadow_type,
x, y, width, height);
gtk_paint_box (widget->style, widget->window,
GTK_WIDGET_STATE (widget), shadow_type,
NULL, widget, "togglebutton",
x, y, width, height);
if (GTK_WIDGET_HAS_FOCUS (widget))
{
@ -300,10 +304,11 @@ gtk_toggle_button_draw_focus (GtkWidget *widget)
width += 2;
height += 2;
gdk_draw_rectangle (widget->window,
widget->style->black_gc, FALSE,
x, y, width - 1, height - 1);
gtk_paint_focus (widget->style, widget->window,
NULL, widget, "togglebutton",
x, y, width - 1, height - 1);
}
gtk_widget_draw (GTK_BIN (widget)->child, NULL);
}
}
@ -433,3 +438,80 @@ gtk_toggle_button_leave (GtkButton *button)
gtk_widget_queue_draw (GTK_WIDGET (button));
}
}
static void
gtk_toggle_button_realize (GtkWidget *widget)
{
GtkToggleButton *toggle_button;
GdkWindowAttr attributes;
gint attributes_mask;
gint border_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
toggle_button = GTK_TOGGLE_BUTTON (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
border_width = GTK_CONTAINER (widget)->border_width;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
attributes.width = widget->allocation.width - border_width * 2;
attributes.height = widget->allocation.height - border_width * 2;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_EXPOSURE_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
if (toggle_button->draw_indicator)
{
GTK_WIDGET_SET_FLAGS (toggle_button, GTK_NO_WINDOW);
attributes.wclass = GDK_INPUT_ONLY;
attributes_mask = GDK_WA_X | GDK_WA_Y;
widget->window = gtk_widget_get_parent_window(widget);
gdk_window_ref(widget->window);
toggle_button->event_window =
gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gdk_window_show(toggle_button->event_window);
gdk_window_set_user_data (toggle_button->event_window, toggle_button);
}
else
{
GTK_WIDGET_UNSET_FLAGS (toggle_button, GTK_NO_WINDOW);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
widget->window =
gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gdk_window_set_user_data (widget->window, toggle_button);
}
widget->style = gtk_style_attach (widget->style, widget->window);
}
static void
gtk_toggle_button_unrealize (GtkWidget *widget)
{
GtkToggleButton *toggle_button;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
toggle_button = GTK_TOGGLE_BUTTON (widget);
if (toggle_button->draw_indicator)
{
gdk_window_set_user_data (toggle_button->event_window, NULL);
gdk_window_destroy (toggle_button->event_window);
toggle_button->event_window = NULL;
}
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
}

View File

@ -45,6 +45,8 @@ struct _GtkToggleButton
guint active : 1;
guint draw_indicator : 1;
GdkWindow *event_window;
};
struct _GtkToggleButtonClass

View File

@ -22,7 +22,7 @@
#include "gtkmain.h"
#include "gtkwidget.h"
#include "gtkwindow.h"
#include "gtkdrawwindow.h"
#include "gtksignal.h"
#include "gtkstyle.h"
#include "gtktooltips.h"
@ -43,6 +43,9 @@ static void gtk_tooltips_widget_remove (GtkWidget *widget,
static void gtk_tooltips_set_active_widget (GtkTooltips *tooltips,
GtkWidget *widget);
static gint gtk_tooltips_timeout (gpointer data);
static gint gtk_tooltips_expose (GtkTooltips *tooltips,
GdkEventExpose *event);
static void gtk_tooltips_draw_tips (GtkTooltips *tooltips);
static GtkDataClass *parent_class;
@ -171,9 +174,15 @@ gtk_tooltips_force_window (GtkTooltips *tooltips)
if (!tooltips->tip_window)
{
tooltips->tip_window = gtk_window_new (GTK_WINDOW_POPUP);
tooltips->tip_window = gtk_draw_window_new (GTK_WINDOW_POPUP);
gtk_widget_ref (tooltips->tip_window);
gtk_window_set_policy (GTK_WINDOW (tooltips->tip_window), FALSE, FALSE, TRUE);
gtk_widget_realize (tooltips->tip_window);
gtk_signal_connect_object (GTK_OBJECT (tooltips->tip_window),
"expose_event",
GTK_SIGNAL_FUNC (gtk_tooltips_expose),
GTK_OBJECT (tooltips));
gtk_signal_connect (GTK_OBJECT (tooltips->tip_window),
"destroy",
gtk_widget_destroyed,
@ -378,6 +387,49 @@ gtk_tooltips_set_colors (GtkTooltips *tooltips,
tooltips->background = background;
}
static gint
gtk_tooltips_expose (GtkTooltips *tooltips, GdkEventExpose *event)
{
GtkStyle *style;
gint y, baseline_skip, gap;
GtkTooltipsData *data;
GList *el;
style = tooltips->tip_window->style;
gap = (style->font->ascent + style->font->descent) / 4;
if (gap < 2)
gap = 2;
baseline_skip = style->font->ascent + style->font->descent + gap;
data = tooltips->active_tips_data;
if (!data)
return FALSE;
gtk_paint_flat_box(style, tooltips->tip_window->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, GTK_WIDGET(tooltips->tip_window), "tooltip",
0, 0, -1, -1);
y = style->font->ascent + 4;
for (el = data->row; el; el = el->next)
{
if (el->data)
{
gtk_paint_string (style, tooltips->tip_window->window,
GTK_STATE_NORMAL,
NULL, GTK_WIDGET(tooltips->tip_window), "tooltip",
4, y, el->data);
y += baseline_skip;
}
else
y += baseline_skip / 2;
}
return FALSE;
}
static void
gtk_tooltips_draw_tips (GtkTooltips * tooltips)
{
@ -407,6 +459,7 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips)
if (gap < 2)
gap = 2;
baseline_skip = style->font->ascent + style->font->descent + gap;
w = data->width;
h = 8 - gap;
for (el = data->row; el; el = el->next)
@ -432,51 +485,8 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips)
else
y = y + widget->allocation.height + 4;
gtk_widget_set_usize (tooltips->tip_window, w + 1, h + 1);
gtk_widget_set_usize (tooltips->tip_window, w, h);
gtk_widget_popup (tooltips->tip_window, x, y);
if (tooltips->gc == NULL)
tooltips->gc = gdk_gc_new (tooltips->tip_window->window);
if (tooltips->background != NULL)
{
gdk_gc_set_foreground (tooltips->gc, tooltips->background);
gdk_gc_set_background (tooltips->gc, tooltips->foreground);
}
else
{
gdk_gc_set_foreground (tooltips->gc, &style->bg[GTK_STATE_NORMAL]);
gdk_gc_set_background (tooltips->gc, &style->fg[GTK_STATE_NORMAL]);
}
gdk_gc_set_font (tooltips->gc, style->font);
gdk_draw_rectangle (tooltips->tip_window->window, tooltips->gc, TRUE, 0, 0, w, h);
if (tooltips->foreground != NULL)
{
gdk_gc_set_foreground (tooltips->gc, tooltips->foreground);
gdk_gc_set_background (tooltips->gc, tooltips->background);
}
else
{
gdk_gc_set_foreground (tooltips->gc, &style->fg[GTK_STATE_NORMAL]);
gdk_gc_set_background (tooltips->gc, &style->bg[GTK_STATE_NORMAL]);
}
gdk_draw_rectangle (tooltips->tip_window->window, tooltips->gc, FALSE, 0, 0, w, h);
y = style->font->ascent + 4;
for (el = data->row; el; el = el->next)
{
if (el->data)
{
gdk_draw_string (tooltips->tip_window->window, style->font,
tooltips->gc, 4, y, el->data);
y += baseline_skip;
}
else
y += baseline_skip / 2;
}
}
static gint

View File

@ -648,23 +648,28 @@ gtk_tree_item_draw (GtkWidget *widget,
GTK_TREE (widget->parent)->current_indent + 2);
item_area.height = widget->allocation.height;
if (gdk_rectangle_intersect (&item_area, area, &child_area))
if (gdk_rectangle_intersect(&item_area, area, &child_area))
{
if (!GTK_WIDGET_IS_SENSITIVE (widget))
gtk_style_set_background (widget->style, widget->window,
GTK_STATE_INSENSITIVE);
else if(GTK_TREE(widget->parent)->view_mode == GTK_TREE_VIEW_LINE &&
widget->state == GTK_STATE_SELECTED)
gtk_style_set_background (widget->style, widget->window, widget->state);
else
gdk_window_set_background (widget->window,
&widget->style->base[GTK_STATE_NORMAL]);
gdk_window_clear_area (widget->window,
child_area.x, child_area.y,
child_area.width, child_area.height);
/* gtk_tree_item_draw_lines(widget); */
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
{
if (!GTK_WIDGET_IS_SENSITIVE (widget))
gtk_paint_flat_box(widget->style, widget->window,
widget->state, GTK_STATE_INSENSITIVE,
area, widget, "treeitem",
0, 0, -1, -1);
else
gtk_paint_flat_box(widget->style, widget->window,
widget->state, GTK_SHADOW_ETCHED_OUT,
area, widget, "treeitem",
0, 0, -1, -1);
}
gtk_tree_item_draw_lines(widget);
if (tree_item->pixmaps_box &&
GTK_WIDGET_VISIBLE(tree_item->pixmaps_box) &&
@ -673,66 +678,31 @@ gtk_tree_item_draw (GtkWidget *widget,
}
/* draw right side */
if (gtk_widget_intersect (bin->child, area, &child_area))
if (gtk_widget_intersect (bin->child, area, &child_area))
{
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]);
else
gtk_style_set_background (widget->style, widget->window, widget->state);
gdk_window_clear_area (widget->window, child_area.x, child_area.y,
child_area.width+1, child_area.height);
if (bin->child &&
GTK_WIDGET_VISIBLE(bin->child) &&
gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
}
if (bin->child &&
GTK_WIDGET_VISIBLE(bin->child) &&
gtk_widget_intersect (bin->child, area, &child_area))
gtk_widget_draw (bin->child, &child_area);
}
if (GTK_WIDGET_HAS_FOCUS (widget))
gtk_paint_focus (widget->style, widget->window,
NULL, widget, "treeitem",
0, 0,
widget->allocation.width - 1,
widget->allocation.height - 1);
gtk_widget_draw_focus (widget);
}
}
static void
gtk_tree_item_draw_focus (GtkWidget *widget)
{
GdkGC *gc;
int dx;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TREE_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];
dx = 0;
if (GTK_TREE(widget->parent)->view_mode == GTK_TREE_VIEW_ITEM)
dx = (GTK_TREE_ITEM(widget)->pixmaps_box->allocation.width + DEFAULT_DELTA +
GTK_TREE(widget->parent)->current_indent + 1);
gdk_draw_rectangle (widget->window, gc, FALSE, dx, 0,
widget->allocation.width - 1 - dx,
widget->allocation.height - 1);
if (GTK_TREE (widget->parent)->view_line &&
(!GTK_IS_ROOT_TREE (widget->parent) ||
(GTK_IS_ROOT_TREE (widget->parent) && GTK_TREE_ITEM(widget)->subtree)))
{
gtk_tree_item_draw_lines(widget);
}
}
gtk_widget_draw(widget, NULL);
}
static gint
@ -848,7 +818,7 @@ gtk_real_tree_item_toggle (GtkItem *item)
{
/* Should we really bother with this bit? A listitem not in a list?
* -Johannes Keukelaar
* yes, always be on the save side!
* yes, always be on the safe side!
* -timj
*/
if (GTK_WIDGET (item)->state == GTK_STATE_SELECTED)

View File

@ -57,6 +57,8 @@ static void gtk_viewport_adjustment_changed (GtkAdjustment *adjustment,
gpointer data);
static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
gpointer data);
static void gtk_viewport_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static GtkBinClass *parent_class;
@ -122,7 +124,8 @@ gtk_viewport_class_init (GtkViewportClass *class)
widget_class->expose_event = gtk_viewport_expose;
widget_class->size_request = gtk_viewport_size_request;
widget_class->size_allocate = gtk_viewport_size_allocate;
widget_class->style_set = gtk_viewport_style_set;
container_class->add = gtk_viewport_add;
}
@ -438,7 +441,12 @@ gtk_viewport_realize (GtkWidget *widget)
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, viewport->bin_window, GTK_STATE_NORMAL);
gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL,
GTK_SHADOW_NONE,
NULL, widget, "viewportbin",
0, 0, -1, -1);
gdk_window_show (viewport->bin_window);
gdk_window_show (viewport->view_window);
}
@ -641,6 +649,10 @@ gtk_viewport_size_allocate (GtkWidget *widget,
child_allocation.y,
child_allocation.width,
child_allocation.height);
gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL,
GTK_SHADOW_NONE,
NULL, widget, "viewportbin",
0, 0, -1, -1);
}
viewport->hadjustment->page_size = child_allocation.width;
@ -757,3 +769,28 @@ gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
child_allocation.y);
}
}
static void
gtk_viewport_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
GtkViewport *viewport;
if (GTK_WIDGET_REALIZED (widget) &&
!GTK_WIDGET_NO_WINDOW (widget))
{
viewport = GTK_VIEWPORT (widget);
gtk_style_set_background (widget->style, viewport->bin_window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, widget->window, widget->state);
gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL,
GTK_SHADOW_NONE,
NULL, widget, "viewportbin",
0, 0, -1, -1);
if (GTK_WIDGET_DRAWABLE (widget))
{
gdk_window_clear (widget->window);
gdk_window_clear (viewport->bin_window);
}
}
}

View File

@ -229,6 +229,8 @@ gtk_vpaned_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_vpaned_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],
0,
border_width + paned->child1_size + paned->gutter_size / 2 - 1,
widget->allocation.width - 1,
border_width + paned->child1_size + paned->gutter_size / 2 - 1);
gdk_draw_line (widget->window,
widget->style->light_gc[widget->state],
0,
border_width + paned->child1_size + paned->gutter_size / 2,
widget->allocation.width - 1,
border_width + paned->child1_size + paned->gutter_size / 2);
gtk_paint_hline(widget->style, widget->window, GTK_STATE_NORMAL,
area, widget, "vpaned",
0, widget->allocation.width - 1,
border_width + paned->child1_size + paned->gutter_size / 2 - 1);
}
}

View File

@ -162,7 +162,13 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
width = widget->allocation.height;
height = widget->allocation.width - 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, "vruler",
0, 0,
widget->allocation.width, widget->allocation.height);
gdk_draw_line (ruler->backing_store, gc,
height + xthickness,
ythickness,
height + xthickness,
@ -234,12 +240,6 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
for (j = 0; j < (int) strlen (unit_str); j++)
{
digit_str[0] = unit_str[j];
gdk_draw_rectangle (ruler->backing_store,
bg_gc, TRUE,
xthickness + 1,
pos + digit_height * j + 1,
gdk_string_width(font, digit_str),
digit_height);
gdk_draw_string (ruler->backing_store, font, gc,
xthickness + 1,
pos + digit_height * (j + 1) + 1,

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