mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-15 13:10:08 +00:00
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkgamma.h: Adapt cast macros to standard. [ Merges from 1.2 ] Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkitemfactory.c (gtk_item_factory_parse_path): If translation does not include a '/', use entire translation instead of crashing. Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org> * docs/gtk_tut.sgml: s/gtk_accel_group_attach/gtk_window_add_accel_group/. Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_remove): Use g_list_remove_link, not g_list_remove. [ From Geert Bevin <gbevin@thunderstorms.org> ] Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org> * gtk/gtkclist.c (real_undo_selection): commented out g_print() statement upon unselection (how the heck did that slip in?). Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org> * gtk/gtktext.c (gtk_text_freeze): (gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling in frozen state (and aparently crashes). patch provided by Anders Melchiorsen <and@kampsax.dtu.dk>. Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org> * fix insensitive default/focus widget activation, reported by Matt Goodall <mgg@isotek.co.uk>. * gtk/gtkwindow.c (gtk_window_key_press_event): (gtk_window_activate_default): (gtk_window_activate_focus): return handled=FALSE for actiavtion of insensitive default widgets. return handled=TRUE for activation of insensitive focus widgets. don't activate in either case. Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com> * gtk-config.in (lib_gtk): Switch order of @x_cflags@ and $glib_cflags to match library order and in the theory that an old version of GLib is more likely to be in the include directory for X then vice-versa. (Bug #2776) Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE to determine the locale for fontsets, not LC_MESSAGES; the user may want English messages with a handling for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR will still be broken) (Bug #2891) Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr> * gtk/gtkrc.ko: Fixed the wrong number of "*"'s. Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr> * gtk/gtkrc.ko: Changed the Korean default fontset. Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug where when scrolling to the left or top double exposes were done, causing major slowdowns. Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkrc.c (gtk_rc_init): Always normalize codeset names to lowercase and alphanumeric, before looking them up. * gtk/Makefile.am: Install codeset variant gtkrc files with normalized names. Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org> * gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even popup menus when the menu is already visible, but its parent is still hidden, (happens after tornoff window got hidden). Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com> * gtk/Makefile.am (install-data-local): Fix a typo where gtkrc.vi_VN.tcvn5712 wasn't getting deleted, causing error messages on install. Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw the handle as well, since we now sometimes ignore exposes on the handle while resizing. Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid extra g_free introduced in one of the last one or two commits. Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com> * gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files consistent, put each style that a gtkrc.* file creates in a unique namespace, remove old files before installing. Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when gtk_rc_init is called multiple times. (Yes, people who do that have bugs in their code.) Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org> * gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf. Remove it since it's generated by the Makefile anyway Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com> * gdk/gdkinputcommon.h (gdk_input_device_new): Free device->info.axes for core pointer. Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com> * gtk/testgtk.c (destroy_idle_test): Rename idle to idle_id, to deal with obsolete, broken C libraries. Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkvscale.c (gtk_vscale_draw): Don't add in allocation->x/y twice! * gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough() consistent with gtk_vscale_pos_trough(). Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkcontainer.c (gtk_container_queue_resize): We may be queueing a resize on a toplevel container between the time we show it and when we map it. So, we need to test GTK_WIDGET_VISIBLE() for toplevels, and only use GTK_WIDGET_DRAWABLE() for child windows. Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com> * gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS (fixes bug #2144) Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org> * gtk/gtkcontainer.c (gtk_container_queue_resize): check for container DRAWABLE (instead of VISIBLE), so we don't queue resizes on non-toplevel containers. Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.[ch]: Make the data argument const guchar *. Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c: Try to behave sensibly if the focus widget is the window itself. (Should we allow this at all?) Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_set_sensitive): * gtk/gtknotebook.c (gtk_notebook_set_scrollable): * gtk/gtknotebook.c (gtk_notebook_set_show_border): * gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args in prototypes and implementations consistent (Tomas Ogren). * gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag before the widget is unparented (reported by damon). * gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char, since we provide unsigned data anyways. Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay the call to gtk_tooltips_layout_text() until later. * gtk/gtktooltips.c (gtk_tooltips_draw_tips): Call gtk_widget_ensure_style() before using the style. Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_event): Added workaround for old widgets that don't propagate draws to all children. (Namely gnome-dock for gnome-libs <= 1.0.16) Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent for a redraw but just the widget that requested the resize. Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org> * gtk/gtkcontainer.c: added new widget level method gtk_container_set_reallocate_redraws() and a GtkContainer flag reallocate_redraws : 1 to reflect the setting, exported this through the argument system as a boolean ::reallocate_redraws. * gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws on the widget because the allocation changes, do so as well for widget->parent if the parent has reallocate_redraws set to TRUE. with that containers requesting reallocation redraws get automatically redrawn if their children changed allocation (this unfortunately affects also other children that didn't change allocation, but we cannot work around that before 1.3). Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width _and_ height are >0 (not _or_). * gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize() instead of gtk_container_queue_resize(), which is a core gtk internal function (must have been on crack when i queued that). * gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so we can check more reliably if we want to discard expose events. * gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING flag. * gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes, we simply trust these events. for deciding whether to discard exposes, check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING. Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore queues of areas that are completely off screen. * gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken logic for handleboxes. * gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity check on width/height. Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org> * gtk/Makefile.am: backed out Raja's recent VPATH build "improvements", we are fine with using $@ the way we do (if we actually encounter brokeness with $@ in VPATH builds because of additional path prefixes, we need to use $(@F) actually). Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org> * gtk/gtksignal.c: renamed two variables, hopefully didn't introduce short lived bugs, that would allow language bindings to do surgeries to our guts. Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo where comparison was being done against an uninitialized value causing intermittant results depending on compiler flags. Also make it clearer that we aren't ever initializing the child as 0x0 (though this will be caught in gtk_widget_size_allocate()) Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_set_transient_for): Move gtk_window_unset_transient_for() call after we do checks involving the old transient parent. [ From Lance Capser <lmc@cyberhighway.net> ] 1999-09-07 Raja R Harinath <harinath@cs.umn.edu> * gtk/Makefile.am (gtk.defs): Go back to using `touch' to create an empty file. Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org> * gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has no children. (Reported by: Chris Rogers <gandalf@pobox.com>) 1999-09-03 Raja R Harinath <harinath@cs.umn.edu> * gtk/Makefile.am (gen_sources): Improve VPATH builds. `$@' is valid only in the build dir, not after we've done `cd $srcdir'. Also use `test -f' instead of less portable `test -e'. Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtktext.c (correct_cache_insert): Rewrite for simplicity, and hopefully correctness. (Fixes bug #1322, which was a segfault when on some insertions with the properties around the insertion set up just wrong.) * gtk/gtktext.c (gtk_text_adjustment): When we receive a "changed" signal, clamp the new value to the adjustment bounds to avoid segfaulting if someone tries to change the adjustment to a bogus value. (Bug #1795) Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c: Ignore unexpected destroy notifies for children, for toplevel windows handle them like delete_event. * gtk/gtkplug.c: Add an unrealize handler so that we unref plug->socket_window when we are done with it. Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtktext.c (clear_area): Fix stupid signedness problem that was causing background to sometimes be misaligned. Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com> [ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ] * gtk/gtkmenu.c (gtk_menu_position): Make sure we never position menus with negative x, y, since gtk_widget_set_uposition() can't handle that. * gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Modify the positioning code a bit so that we always put the top-left corner onscreen. (This is for UI reasons, gtk_menu_position() now takes care of gtk_widet_set_uposition() brokeness.) Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org> * gtk/Makefile.am: fixed up things for -jx, x > 1. Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_modify_style): Ref the RC style that is passed in. The lack of the ref before was a bug. If people worked around this bug, this will introduce a slight memory leak in their code. The code should typically look like: rc_style = gtk_rc_style_new (); [...] gtk_widget_modify_style (widget, rc_style); gtk_rc_style_unref (rc_style); * gtk/gtkwidget.c (gtk_widget_modify_style): Reset the style if it was already set. * gtk/gtkwidget.c (gtk_widget_set_name): Only set the style if it was set before. Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com> * gtk/testgtk.c (main): Add a check to see if we are being run from the correct directory and to quit nicely if we are not. * gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function static. Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org> * gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS. * gtk/gtkwindow.c: queue resizes unconditionally (gtk_widget_queue_resize will figure what to do if the window is not realized). (gtk_window_move_resize): only recenter the window for GTK_WIN_POS_CENTER_ALWAYS. (gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in the same way as GTK_WIN_POS_CENTER. Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c (gtk_window_reposition): check for the last position with (!(info->last_flags & GDK_HINT_POS)) instead of (!info->last_flags & GDK_HINT_POS). * gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and new_height unconditionally, because we use these values even if !default_size_changed && !hints_changed. comented the (default_size_changed || hints_changed) case with respect to resize rejects from the window manager. * gtk/gtkwindow.c (gtk_window_move_resize): save info->last values in the zvt condition hack, since this includes the window hints, set the hints after the handling_resize case. * gtk/gtkwindow.c (gtk_window_show): constrain the default size that a window is initially shown with to the geometry. Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c (gtk_window_move_resize): s/size_changed/default_size_changed/g so i know what's really going on (frying brain on smaller flame now). Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if we have size_changed upon handling_resize. this is a gross workaround for the broken zvt widget and should be removed in 1.3 again (search for FIXME). Owen provided an accurate comment for this: /* We could be here for two reasons * 1) We coincidentally got a resize while handling * another resize. * 2) Our computation of size_changed was completely * screwed up, probably because one of our children * is broken. It's probably a zvt widget. * * For 1), we could just go ahead and ask for the * new size right now, but doing that for 2) * might well be fighting the user (and can even * trigger a loop). Since we really don't want to * do that, we requeue a resize in hopes that * by the time it gets handled, the child has seen * the light and is willing to go along with the * new size. (this happens for the zvt widget, since * the size_allocate() above will have stored the * requisition corresponding to the new size in the * zvt widget) * * This doesn't buy us anything for 1), but it shouldn't * hurt us too badly, since it is what would have * happened if we had gotten the configure event before * the new size had been set. */ Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkrc.c: deal properly with the fact that RC style lists may include rc styles more than once. * gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed unused static function. * gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a stack of directories of RC files currently being parsed and implicitely add them to pixmap path. This fixes a bug where the directory would get appended then overwritten by pixmap_path declarations. (bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>) * gtk/gtkthemes.c (gtk_theme_engine_unref): Call theme's exit function. (Patch from Peter Wainwright, bug #1454) * gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy): Add a destroy() handler to take care of removing group for menu item. (Fixes bug #1197) * gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko in warning message. Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c (gtk_window_move_resize): don't require a server roundtrip to figure window's width and height, since we know that anyways from widget->allocation. Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_move_resize): Compute the hints after we request the new size. Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_compute_hints): Removed GTK_WIDGET_REALIZED() assertion - we can compute the hints before we are realized. * gtk/gtkwindow.c (gtk_window_move_resize): Reorder hint changing so that we have a value of hints_changed when we decide whether to constrain the window size. * gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix. * gtk/gtkwindow.c (gtk_window_constrain_size): cleanups, change back to G_MAXINT. Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize new GtkWindowGeometryInfo, so fields like GdkGeometry geometry contain uncluttered values. (gtk_window_compute_hints): simply assert that window is realized and that geometry_info is valid, since we rely on this anyways. (gtk_window_constrain_size): major cleanups to the code. if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height for the base size, instead of the minimums. use 32767 as max width and height (like in gtkwindow.c) instead of G_MAXINT. Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org> * cleaned up the GtkContainer.need_resize flag handling mess, we only need to force resize requests when we were prematurely realized, or our widget tree was modified when we were temporarily hidden. handling these cases directly upon showing the window (i.e. while the GdkWindow is still unmapped) avoids the need to wait for a configure event response and therefore makes the GUI more snappier and avoids blank windows during the roundtrip. * gtk/gtkwidget.c: (gtk_widget_hide): (gtk_widget_show): don't queue resizes on toplevels, they know how to deal with matters. * gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize flag directly for not visible resize containers and spare us unecessary signal emissions. * gtk/gtkwindow.c: (gtk_window_realize): if we need to enforce premature size allocation, queue a container resize so we are correctly resized later on. (gtk_window_init): (gtk_window_size_request): don't freak around with the ->need_resize flag, gtk_container_queue_resize() will care about that. (gtk_window_show): handle initial resizing issues here, we can handle matters better in this place, especially since we know that our GdkWindow is still unmapped. (gtk_window_move_resize): don't care about ->need_resize at all. handle size changes properly that occoured while we waited for a configure event. Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_set_uposition): * gtk/gtkwindow.[hc] (gtk_window_reposition): Move the hint setting code from gtk_widget_set_uposition to here; set the hints so that we respect any previously set geometry hints. * gtk/gtkwindow.c (gtk_window_compute_reposition): Don't change the window hints here or move the window here, let that happen in gtk_window_move_resize(). Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due to already queued resizes (and therefore redraws) on a widget, check its anchestry as well. * gtk/gtkcontainer.c: (gtk_container_queue_resize): clear resize widgets for resize containers before aborting prematurely. this is especially important for toplevels which may need imemdiate processing or their resize handler to be queued. (gtk_container_dequeue_resize_handler): added new internal function for gtkwindow.c. * gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a configure event, take possible changes in window position into account as well. if we request a new window size, queue up a resize handler that will last until the configure event response arrives. combined the ->need_resize case (initial show) with the general size (hints) changed case and added even more comments. if !auto_shrink, only revert to the old allocation if the new size is smaller than the current allocation. Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy, gtk_window_set_geometry_hints gtk_window_set_default_size): When hints are set, queue a resize so that the hints will be eventually reset on the toplevel. * gtk/gtkwindow.c (gtk_window_show): Use gtk_window_compute_default_size(). Clear the need_resize flag on the initail map so that we don't unnecessarily trigger the resize code. * gtk/gtkwindow.c (gtk_window_move_resize): Split apart into separate functions. Compare the hints we are setting with what we set last time so that we can accurately tell when we need to reset the hints. * gtk/gtkwindow.c (gtk_window_compute_default_size): New function to figure out the size from requisition and default_size. * gtk/gtkwindow.c (gtk_window_constrain_size): Function from fvwm to constrain a size to the geometry hints. * gtk/gtkwindow.c (gtk_window_compare_hints): New function to compare two sets of geometry hints. * gtk/gtkwindow.c (gtk_window_compute_hints): Renamed from gtk_window_set_hints(), just compute the hints, don't set them. * gtk/gtkwindow.c (gtk_window_compute_reposition): Move code from gtk_window_move_resize() to separate function, rationalize a bit. Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com> * gtkrc.h: Move the ref_count member out of the GtkRcStyle structure into a new private structure. * gtkrc.c: Split GtkRcStyle into public/private. In the private part, add a list of pointers to the RcStyle lists this RcStyle participates in. * gtkrc.c: When a RcStyle is free, remove all lists referencing it from the realized_style_ht hash, and free those lists. * gtk/gtkrc.c (gtk_rc_clear_styles): Don't call gtk_rc_init(), since that adds the default styles to the list of parsed RC files again. * gtk/gtkrc.c: Use gtk_rc_style_find() consistently. Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity checks that ensure that a widget's allocation is at least 1 in width and height. (GNOME note: this doesn't affect old panel code anymore, because GtkSocket will request width and height of at least 1 since Fri Jul 23). * gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been allocated yet (happens if the user realizes the window prematurely), size request and allocate it. (gtk_window_size_allocate): guard against guint underflows. Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org> * gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs in gtk_built_sources, so gtk.defs gets built prior to all other sources. Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org> * gtk/Makefile.am: invoke indent on gtkmarshal.*. rewrote source generation rules, use COPYING as oldest source tag for a piggyback rule to generate all sources from (don't touch it ;). major cleanups, strip spaces on build rules for GNU Make. * gtk/genmarshal.pl: don't operate on hardcoded filenames but take source and target files from commandline arguments. don't invoke indent. Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org> * gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize notebook after switch to avoid drawing problems. (Bug#856 Reported by: Theodore Roth <troth@netmagic.net>) (gtk_notebook_pages_allocate): don't map not visible tab_labels, show them instead. (Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>) Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org> * gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize notebook after switch to avoid drawing problems. (Bug#856 Reported by: Theodore Roth <troth@netmagic.net>) (gtk_notebook_pages_allocate): don't map not visible tab_labels, show them instead. (Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>) Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: we use window->need_resize from configure_event now, to indicate that the gtkwindow should keep its allocation (e.g. because the user resized the window through window manager handles). resize_count is now reliably used to figure whether we got the allocation we requested from the window manager. configure events get queued as resizes now, the real stuff (size computation and allocation) now only goes on in gtk_window_move_resize(). GtkWindow's requisition now contains its *real* requisition (like all other widgets), *not* taking usize into account. geometry_info->last_{width|height} is now updated from set_hints() only so it always contains the last hints we set for the window manager. made some event handlers return TRUE instead of FALSE. the overall code should be much more straight forward now, and the significant code portions are accompanied by comments now. (gtk_window_set_hints): removed requisition argument and made it fetch the requisition through gtk_widget_get_child_requisition. we also don't move the gdkwindow here anymore, gtk_window_move_resize() does that now. (gtk_window_show): ensure that the widget is realized before calling gtk_container_check_resize() (and thus gtk_window_move_resize()), also ensure that we got properly size requested and allocated before realization. (gtk_window_configure_event): ignore plain window moves, or reallocate the widget tree through the resize queue otherwise. (gtk_window_move_resize): mostly rewrote this function to figure window manager hints more reliably, coalesce window moves and resizes to reduce configure events and do actuall size allocations. Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets that have a resize pending, because a redraw is already queued for them. * gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal hack to clear resize_widgets. * gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets for resize containers prior to size allocation. (this is also a bit ugly, but avoids side effects for stopped emissions and is thus more reliable). (gtk_widget_unparent): removed disconnect call for clear_resize_widgets. * gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this function from gtk_tooltips_expose, as we connect to ::expose_event *and* ::draw now. 1999-08-18 Federico Mena Quintero <federico@redhat.com> * gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity checks. (gtk_target_list_unref): Likewise. * gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise. Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar): guard against division by zero. (Fixes bug #1339) Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c (gtk_move_{forward,backward}_word): Prevent the trivial leak of information of allowing word motion when the entry is not visible. Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate modality to error dialog as well as confirmation dialogs. (Bug #1803, reported by Rosanna Wing Sze Yuen) Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor tree->view_lines. (gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>) * gtk/Makefile.am (install-data-local): Solaris apparently has various troubles with ln -f; use rm first instead. (gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>) 1999-07-30 Raja R Harinath <harinath@cs.umn.edu> * gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir, use `cp' followed by `rm' (the `rm' was already there). July 30, 1999 Elliot Lee <sopwith@redhat.com> * configure.in: Fix autoconf warnings about cross compilation by trying to provide sane defaults for AC_TRY_RUN. * gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir), put them into $(srcdir) when generated. Also add a dependency of gtksignal.h on gtkmarshal.h for -j builds. * gtk/gtk(dnd,style,gamma).c: Minor warning fixes. Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c (gtk_main_iteration_do): Added missing GDK_THREADS_{LEAVE,ENTER} pair. (From Paul Fisher <pnfisher@redhat.com>) Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org> * gtk/gtksocket.c (gtk_socket_size_request): asure that the requested width and height are always >0 (owen). Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent change that assured that a widget's allocated with and height are always >1, since this breaks *buggy* panel code. unfortunately this back-breaks the gimp's color selector. * gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our allocation is always >0 in width and height, before sending the configure event; this is a *gross* hack to get the gimp back to work. * marked both cases with TODO-1.3 Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtktext.c: Don't display wrap indicators when text is not editable and word wrap is on. Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org> * gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case option menus here as they are not derived from menu shell, assure that the option menu has a menu we can add items to. Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org> * gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation-> width/height to (gint) before calculations and check against < 0 to avoid guint wraparounds. Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated width and height is never zero. sanity check both dimensions against 32767 and issue a warning if the allocation is greater than that. Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c (gtk_events_pending): Unlock around call to g_main_pending() as well. Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c (gtk_main_iteration): Unlock around call to g_main_iteration() - since that will regrab GTK+ lock to process events. Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c - Regularize with the rest of GTK+ by making widget->requisition not reflect the set_usize() - Always recompute geometry hints, then check if they changed before sending them to the X server. The previous checks for changes would fail in a number of circumstances. Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkstyle.c: Include <stdlib.h> for strcmp(). Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkdnd.c: - Code cleanups - Instantaneously update on modifier key presses - Allow cancellation of the drag with Escape. Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com> * gtk/testgtk.c (create_handle_box): Set the policy to auto_shrink - otherwise the appearance is rather strange when flipping between horizontal and vertical. Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: add ::default_width and ::default_height arguments. (gtk_window_set_default_size): don't change a value if it's < 0. queue a resize. Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org> * gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts. Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkfilesel.c (cmpl_completion_fullname): Don't add an extra "/" when concating "/" + filename. (From Matt Grossman <mattg@oz.net>) Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask for fg_gc if we set it for drawing pixmap. Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com> Fixes from Peter Wainwright <prw@wainpr.demon.co.uk> * gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is already set, call old engine's destroy function and unref the old engine. Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org> * gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize. Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org> * gtk/gtkaccelgroup.h: mark certain functions as internal. Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org> * gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the expand behaviour changed. * gtk/gtklabel.c (gtk_label_set_pattern): (gtk_label_set_justify): (gtk_label_set_line_wrap): don't bother invoking queue_clear, the reallocation does that for us, always free_words so the upcoming resize will relayout the label's contents. Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org> * applied argument implementation patches from Elena Devdariani <elena@cogent.ca>. * gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size, ::space_style, ::relief * gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size * gtk/gtkpreview.c: ::expand * gtk/gtkpaned.c: ::handle_size, ::gutter_size * gtk/gtknotebook.c: ::homogeneous * gtk/gtklabel.c: ::wrap * gtk/gtklist.c: ::selection_mode * gtk/gtkhandlebox.c: ::handle_position, ::snap_edge * gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y * gtk/gtkcolorsel.c: ::update_policy, ::use_opacity * gtk/gtkclist.c: ::sort_type * gtk/gtkcheckmenuitem.c: ::active, ::show_toggle * gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkstyle.c: Removed ill-thought-out part of last comment. Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkstyle.c (gtk_style_attach): Get the reference counting right when we have to attach a new style for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>) * gtk/gtkstyle.c: Documented the refcounting peculularities of gtk_style_attach. 1999-06-01 Tim Janik <timj@dhcpd7.redhat.com> * gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid window types. * examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead of GTK_TOPLEVEL for creating the window. 1999-06-01 Tim Janik <timj@dhcpd7.redhat.com> * gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is the last argument (reported by Per Winkvist). Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com> Fixes for invisible XOR lines (Frank Loemker <floemker@TechFak.Uni-Bielefeld.DE>) * gtk/gtkclist.c (gtk_clist_realize): Always use a non-zero pixel for GDK_XOR. * gtk/gtkvpaned.c gtk/gtkhpaned.c: Use GDK_INVERT instead of GDK_XOR. Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org> * gtk/gtkclist.c (adjust_adjustments): signal emit value_changed signals if h/voffsets differ from adjustment values. Reportet by Jerome Bolliet <bolliet@in2p3.fr> Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org> * gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate ::selection-done emissions up to the topmost menu shell. Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset the user data on the window before destroying it. * gtk/gtknotebook.c (gtk_notebook_unrealize): Add an unrealize handler to take care of destroying notebook->panel properly. (Bug #1198 - Morten Welinder <terra@diku.dk>) * gtk/gtktext.c (expand_scratch_buffer): Fix reversal of g_new and g_realloc to stop memory leak. (Actually, we could just use g_realloc(), but I'm not 100% sure that is portable). (Bug #1196 - Morten Welinder <terra@diku.dk>) Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkplug.h: Removed stray GtkPlugButton declaration. * gdk/gdkfont.c (gdk_text_measure): Fix the return value for fontsets. * gtk/gtkbutton.c (gtkbutton_expose): Fix warning with bin/button confusion. Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org> * gtk/testgtk.c: in the ItemFactory test, link radio items together, and show how preselection of radio items is done. Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org> * gtk/gtktreeitem.c (gtk_tree_item_set_subtree): * gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert): * gtk/gtktoolbar.c (gtk_toolbar_insert_element): * gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1): * gtk/gtkscrolledwindow.c (gtk_scrolled_window_add): * gtk/gtktable.c (gtk_table_attach): * gtk/gtklist.c (gtk_list_insert_items): * gtk/gtkmenushell.c (gtk_menu_shell_insert): * gtk/gtknotebook.c (gtk_notebook_insert_page_menu): * gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add): * gtk/gtkbin.c (gtk_bin_add): * gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end): * gtk/gtkfixed.c (gtk_fixed_put): * gtk/gtklayout.c (gtk_layout_put): general fixups to container_add logic. always realize child if child->parent is realized, only map the child and queue a resize if child and child->parent are both visible. Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org> * gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall instead of gtk_container_foreach to walk and unrealize children, so composite children get also unrealized. (gtk_widget_real_show): don't call gtk_widget_map() if we don't need to. (gtk_widget_map): assert that the widget is visible (basic constrain). (gtk_widget_real_map): assert that the widget is realized (basic constrain). Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org> * gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak. Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com> * gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc file for iso-8859-2 locales. * configure.in (ALL_LINGUAS): ALL_LINGUAS update. Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com> * gtk/Makefile.am: Fix typo of static_sources for static_SOURCES. (Pointed out by andy@rz.uni-karlsruhe.de and others). Remove some suspicious and useless lines. Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use width,height = 0, 0 to mean - here to edge of window, instead of -1, -1, since the former is all we support. Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c (gtk_main): Correctly free list nodes when removing from quit_functions list. Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org> * gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable. Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable): When redrawing characters on non-visible entry, use appropriate '*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>) Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org> * gtk/gtkclist.c (drag_dest_cell): compute destination cell from drag coordinates. (gtk_clist_drag_data_received) (gtk_clist_drag_motion): use drag_dest_cell. * gtk/gtktree (drag_dest_cell) (gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise. (Bug #1129) Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org> * gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize translate_* fields. (gtk_item_factory_finalize): invoke translate_notify independant from translate_data. (gtk_item_factory_set_translate_func): likewise. (gtk_item_factory_destroy): only remove ifactory pointer from those widgets that belong to us (stupid me). Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of rc_style list when lookup succeeeds. Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org> * gtk/gtkctree.c (resync_selection): * gtk/gtkclist.c (resync_selection): fixed undo_selection bug. * gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection bug. Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c: Add some missing GDK_THREADS_ENTER()/LEAVE around timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>) Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org> * gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate() rather than emit_by_name. * gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference on the widget across multiple signal emissions. (gtk_editable_delete_text): same here. (gtk_editable_class_init): set widget_class->activate_signal after editable_signals[ACTIVATE] has been created. Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp position here prematurely -- we might not have the right ->min_position and ->max_position yet. Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request): Add error traps so if the other end of the connection dies, we survive. * gtk/gtkselection.c (gtk_selection_notify): Clean up properly when selection property retrieval fails. * gtk/gtkselection.c (gtk_selection_request): Correctly reject SelectionRequest notifies where the handler returns no data. Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight when we've previously highlighted. * gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't emit two "drag_leave" signals for Motif drops. * gtk/gtkdnd.c (gtk_drag_source_handle_event): Send back the correct status messages when dropping from Motif onto a proxy window that is rejecting the drop. Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org> * gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal() to compare two argument values. added gtk_arg_to_valueloc() to set a variable from an arg through its location (pointer). * gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected as gfloat*, uchars are collected as guchar*, ints are collected as gint*, etc... Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c: Include <string.h> instead of <strings.h>. * gtk/gtkstyle.c: Fix double include of gtkthemes.h (actually, a lot more duplicate includes occur if you trace through the sequence of #include's) gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com> Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp> gtk-a-higuti-990322-[0-3] * configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS that was causing -DX_LOCALE not to work. * gtk/gtkrc.c (gtk_rc_init): X_LOCALE will never have LC_MESSAGES defined Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org> * gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from g_get_home_dir() (gtk-pmc-990123-0.patch.gz). * gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/ left/right as well (gtk-michael-980726-0.patch.gz). * gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/ for pointer values, use gchar instead of char. fixed uline allocation leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem chunks instead of G_ALLOC_ONLY. (gtk_label_size_request): always alter requisition as passed and leave widget->requisition alone. (gtk_label_set_text): allow NULL strings. (gtk_label_new): likewise. Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org> * gtk/gtkdrawingarea.[hc]: type/macro fixups. Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org> * gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible *and* mapped (i.e. drawable). (gtk_bin_expose): only send exposes to drawable children. * gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable. (gtk_box_expose): only send exposes to drawable children. * gtk/gtkhscale.c (gtk_hscale_draw): * gtk/gtkvscale.c (gtk_vscale_draw): hm, this is an ugly one. we first compute the size of our trough area here (window relative) and then check intersection with the draw_area which is parent relative because we're a NO_WINDOW widget, so we need to offset the trough area by allocation.x and allocation.y before the check. (this must not be done for the background area though, since that's already computed parent relative). Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org> * gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary, unrealize title buttons. Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org> * gtk/gtkclist.c (gtk_clist_column_title_passive) (gtk_clist_column_title_active): only connect/disconnect to GtkWidgetClass::event to block mouse events. * gtk/gtkclist.c (vertical_timeout) (horizontal_timeout): zero initialize event, removed superfluous gdk_window_get_pointer call * gtk/gtklist.c (gtk_list_vertical_timeout) (gtk_list_horizontal_timeout): removed superfluous gdk_window_get_pointer call Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org> * plugging problems reported by "Bruce Mitchener, Jr." <bruce@puremagic.com> due to a purify session. * gtk/gtkstyle.c: (gtk_style_ref): (gtk_style_unref): assert ref_count to be > 0. * gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize the requisition. (gtk_clist_set_shift): likewise. * gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the adjustments. * gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the event before sending it and set send_event to TRUE (which needs to be done for *all* synthesized events). (gtk_list_vertical_timeout): likewise. * gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory leaks. * gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event to TRUE when synthesizing events. [ *** end of merges from 1.2 *** ]
This commit is contained in:
parent
14237d13e2
commit
33da844e70
1301
ChangeLog.pre-2-0
1301
ChangeLog.pre-2-0
File diff suppressed because it is too large
Load Diff
1301
ChangeLog.pre-2-10
1301
ChangeLog.pre-2-10
File diff suppressed because it is too large
Load Diff
1301
ChangeLog.pre-2-2
1301
ChangeLog.pre-2-2
File diff suppressed because it is too large
Load Diff
1301
ChangeLog.pre-2-4
1301
ChangeLog.pre-2-4
File diff suppressed because it is too large
Load Diff
1301
ChangeLog.pre-2-6
1301
ChangeLog.pre-2-6
File diff suppressed because it is too large
Load Diff
1301
ChangeLog.pre-2-8
1301
ChangeLog.pre-2-8
File diff suppressed because it is too large
Load Diff
187
INSTALL.in
Normal file
187
INSTALL.in
Normal file
@ -0,0 +1,187 @@
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
GTK+ requires the GLIB library, available at the same location as
|
||||
you got this package.
|
||||
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
[ Become root if necessary ]
|
||||
% make install # install GTK
|
||||
|
||||
The Nitty-Gritty
|
||||
================
|
||||
|
||||
The 'configure' script can be given a number of options to enable
|
||||
and disable various features. For a complete list, type:
|
||||
|
||||
./configure --help
|
||||
|
||||
A few of the more important ones:
|
||||
|
||||
* --prefix=PREFIX install architecture-independent files in PREFIX
|
||||
[ Defaults to /usr/local ]
|
||||
|
||||
* --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
||||
[ Defaults to the value given to --prefix ]
|
||||
|
||||
* --with-xinput=[no/gxi/xfree] support XInput [default=no]
|
||||
|
||||
The --with-xinput flag specifies whether to compile with support
|
||||
for the XInput extension (mainly used for graphics tablets), and
|
||||
which form of support to use:
|
||||
|
||||
no : no support
|
||||
gxi : Use generic XInput support
|
||||
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
|
||||
and later.
|
||||
|
||||
For more information, follow the link from http://www.gtk.org
|
||||
|
||||
* --disable-nls do not use Native Language Support
|
||||
|
||||
If this flag is not specified, GTK+ will try to find
|
||||
and use the gettext() set of functions to provide translations
|
||||
of the strings in the standard dialogs into the
|
||||
user's native language.
|
||||
|
||||
* --enable-xim support XIM [default=yes]
|
||||
|
||||
Specifying --disable-xim will disable support for entering
|
||||
internationalized text using X Input Methods. This will give some
|
||||
slight savings in speed and memory use and might be necessary
|
||||
with older versions of X.
|
||||
|
||||
* --with-locale=LOCALE locale name you want to use
|
||||
|
||||
The --with-locale options is used to determine if your operating
|
||||
system has support for the locale you will be using. If not, X's
|
||||
built in locale support will be used.
|
||||
|
||||
Because of bugs in autoconf, it is necessary to specify this
|
||||
option even if your LANG environment variable is correctly set.
|
||||
|
||||
This option does not determine which locale GTK will use at
|
||||
runtime. That will be determined from the usual environment
|
||||
variables. If you will be using multiple locales with GTK,
|
||||
specify the one for which your operating system has the worst
|
||||
support for the --with-locale option.
|
||||
|
||||
|
||||
Options can be given to the compiler and linker by setting
|
||||
environment variables before running configure. A few of the more
|
||||
important ones:
|
||||
|
||||
CC : The C compiler to use
|
||||
CPPFLAGS : Flags for the C preprocesser such as -I and -D
|
||||
CFLAGS : C compiler flags
|
||||
|
||||
The most important use of this is to set the
|
||||
optimization/debugging flags. For instance, to compile with no
|
||||
debugging information at all, run configure as:
|
||||
|
||||
CFLAGS=-O2 ./configure # Bourne compatible shells (sh/bash/zsh)
|
||||
|
||||
or,
|
||||
|
||||
setenv CFLAGS -O2 ; ./configure # csh and variants
|
||||
|
||||
Native-Language Support and gettext()
|
||||
=====================================
|
||||
|
||||
To provide native-language support (NLS) GTK+ uses the
|
||||
gettext() set of functions. These functions are found
|
||||
in the C library on many systems, such as the Solaris
|
||||
C library and the GNU C Library, version 2.
|
||||
|
||||
If your C library does not provide the necessary functionality,
|
||||
you may wish to install the GNU gettext package. You'll
|
||||
need version 0.10.35 or better. Version 0.10.35 is
|
||||
available from ftp://alpha.gnu.org/pub/gnu
|
||||
|
||||
Generally, GTK+ will properly detect what is installed
|
||||
on your system and enable or disable NLS as appropriate.
|
||||
However, in rare cases, it may be necessary to disable
|
||||
NLS manually to get GTK+ to compile. You can do this
|
||||
by specifying the --disable-nls flag when configuring
|
||||
GTK+.
|
||||
|
||||
Using an uninstalled copy of GLIB [ Unsupported ]
|
||||
=================================================
|
||||
|
||||
You can compile GTK+ against a copy of GLIB that you have not
|
||||
yet installed. To do this, give the --with-glib=DIR options
|
||||
to ./configure. For instance:
|
||||
|
||||
./configure --with-glib=../glib-@GTK_VERSION@
|
||||
|
||||
This, however, will not work if you built GLIB with different
|
||||
source and build directories.
|
||||
|
||||
It is recommended that you install GLIB before compiling
|
||||
GTK+. The --with-glib option is not regularly tested
|
||||
and may not function correctly. In addition,
|
||||
inter-library dependencies won't be generated when
|
||||
using --with-glib=.
|
||||
|
||||
Installation directories
|
||||
========================
|
||||
|
||||
The location of the installed files is determined by the --prefix
|
||||
and --exec-prefix options given to configure. There are also more
|
||||
detailed flags to control individual directories. However, the
|
||||
use of these flags is not tested.
|
||||
|
||||
One particular detail to note, is that the architecture-dependent
|
||||
include file glibconfig.h is installed in:
|
||||
|
||||
$exec_pref/lib/glib/include/
|
||||
|
||||
if you have a version in $prefix/include, this is out of date
|
||||
and should be deleted.
|
||||
|
||||
A shell script gtk-config is created during the configure
|
||||
process, and installed in the bin/ directory
|
||||
($exec_prefix/bin). This is used to determine the location of GTK
|
||||
when building applications. If you move GTK after installation,
|
||||
it will be necessary to edit this file.
|
||||
|
||||
For complete details, see the file docs/gtk-config.txt
|
||||
|
||||
|
||||
Notes for using XIM support for Japanese input
|
||||
==============================================
|
||||
|
||||
* There is a bug in older versions of kinput2 that will cause GTK+
|
||||
to hang when destroying a text entry. The latest versions of
|
||||
kinput is available from:
|
||||
|
||||
ftp://ftp.sra.co.jp/pub/x11/kinput2
|
||||
|
||||
* The locale information file for the ja_JP EUC locale
|
||||
distributed with some recent versions of X11 specifies to use the
|
||||
C library multibyte functions. Unless your C library has support
|
||||
for Japanese locales, this is incorrect, and will cause problems
|
||||
for GTK's internationalization.
|
||||
|
||||
(In particular, this occurs with GNU libc 2.0 in which
|
||||
the multibyte functions always translate to and from UTF-8; but
|
||||
the problem may occur for other C libraries, and other operating
|
||||
systems as well.)
|
||||
|
||||
To fix this, change the line:
|
||||
|
||||
use_stdc_env True
|
||||
|
||||
to
|
||||
|
||||
use_stdc_env False
|
||||
|
||||
in the file /usr/X11R6/lib/X11/locale/ja_JP/XLC_LOCALE.
|
||||
|
||||
|
96
NEWS
96
NEWS
@ -1,3 +1,99 @@
|
||||
Overview of Changes in GTK+ 1.2.6:
|
||||
|
||||
* container queue_resize fixes
|
||||
* gtk[vh]scale: minor fixups
|
||||
* rename idle to idle_id in testgtk to avoid conflicts with
|
||||
broken libs
|
||||
* More consistant naming of gtkrc files
|
||||
* Added language support: ro, uk
|
||||
|
||||
Overview of Changes in GTK+ 1.2.5:
|
||||
|
||||
* more GtkCTree and GtkWindow bug fixes.
|
||||
* more redraw/resize queue fixes, better expose event
|
||||
discarding code.
|
||||
* more miscellaneous bugs fixed
|
||||
* new configure.in option --disable-rebuilds to completely disable
|
||||
rebuilds of autogenerated sources.
|
||||
* check for 5.002 now, to avoid failing autogeneration build rules due
|
||||
to old perl versions.
|
||||
* fonts (and fontsets) are cached now.
|
||||
* more autogeneration make rules and dependancy fixups, we should be
|
||||
save with autogeneration up to make -j12 now ;)
|
||||
* new window position GTK_WIN_POS_CENTER_ALWAYS, which will recenter the
|
||||
GtkWindow on every size change.
|
||||
* major rework of window manager hints handling code, fixed a bunch of
|
||||
races with the new resizing code.
|
||||
* the new wm hints and resizing code is absolutely perfect and bug free now,
|
||||
it only lacks testing ;)
|
||||
* fixed up various rc style memory prolems.
|
||||
* gtk_widget_modify_style() now properly changes the style of realized widgets
|
||||
and references the style passed into it. if people worked around this bug,
|
||||
this will introduce a slight memory leak in their code.
|
||||
The code should typically look like:
|
||||
GtkRcStyle *rc_style = gtk_rc_style_new ();
|
||||
[...]
|
||||
gtk_widget_modify_style (widget, rc_style);
|
||||
gtk_rc_style_unref (rc_style);
|
||||
* fix problems with positioning menus offscreen.
|
||||
* GtkText fixes for some crashes and drawing errors.
|
||||
* Better handling for unexpected window destroys in GDK and GTK+.
|
||||
This should make it possible to use a GtkPlug and catch the
|
||||
case where its parent socket is randomly killed.
|
||||
* FAQ updates.
|
||||
* FileSelection i18n patches, RadioButton fixups.
|
||||
* many translation improvements.
|
||||
* miscellaneous other bugs fixed.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.4:
|
||||
|
||||
* DnD improvements (drags can be canceled with Esc now).
|
||||
* suppressed configure event reordering in Gdk.
|
||||
* rewrite of Gtk's configure event handling.
|
||||
* major improvements for the object argument system (Elena Devdariani).
|
||||
* major bugfixes for threading, GtkNotebook, GtkItemFactory, GtkCList and
|
||||
GtkCTree.
|
||||
* tutorial/FAQ updates, new file generation.txt on autogenerated sources.
|
||||
* configure's --with-glib= is "officially" unsupported.
|
||||
* upgrade to libtool 1.3.3.
|
||||
* various buglets fixed.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.3:
|
||||
|
||||
* Upgrade to libtool 1.3
|
||||
* Check for dgettext (for systems with old versions of GNU Gettext)
|
||||
* Many bug fixes (see ChangeLog for details)
|
||||
|
||||
Overview of Changes in GTK+ 1.2.2:
|
||||
|
||||
* Improved Dnd behaviour with Motif applications.
|
||||
* Bug fixes for the Gtk selection code.
|
||||
* Minor bug fixes to the Gdk Atom cache and Dnd code (with --display option).
|
||||
* Bug fixes and leak plugs for the Gdk IM code.
|
||||
* Added gtk_object_get() facility to retrive object arguments easily.
|
||||
The var args list expects ("arg-name", &value) pairs.
|
||||
* Fixed mapping for GdkInputCondition<->GIOCondition, this should fix
|
||||
problems where closed pipes were no longer signalling GDK_INPUT_READ on
|
||||
systems with a native poll().
|
||||
* Some cleanups to GtkLabel's memory allocation code (shouldn't leak memory
|
||||
anymore).
|
||||
* We don't attempt to lookup xpm color "None" anymore, this should prevent
|
||||
eXodus (commercial X windows server) from popping up a color dialog every
|
||||
time a transparent pixmap is created.
|
||||
* Fixed bug where Gtk timout/idle handlers would execute without the global
|
||||
Gdk lock being held.
|
||||
* Other minor bug fixes.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.1:
|
||||
|
||||
* Many Bug fixes have been applied to the menu and accelerator code.
|
||||
* GtkItemFactory can "adopt" foreign menu items now and manage their
|
||||
accelerator installation. This is often required to get GtkItemFactory
|
||||
like accelerator propagation between different windows with the same
|
||||
menu heirarchy and for centralized parsing and saving of accelerators.
|
||||
* GtkCList/GtkCTree buttons should always display correctly now.
|
||||
* Miscellaneous other bug fixes.
|
||||
|
||||
What's New in GTK+ 1.2.0 (since 1.0.x):
|
||||
|
||||
* New widgets: GtkFontSelector, GtkPacker, GtkItemFactory, GtkCTree,
|
||||
|
101
README.in
Normal file
101
README.in
Normal file
@ -0,0 +1,101 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version @GTK_VERSION@. GTK+, which stands for the Gimp ToolKit,
|
||||
is a library for creating graphical user interfaces for the X Window
|
||||
System. It is designed to be small, efficient, and flexible. GTK+ is
|
||||
written in C with a very object-oriented approach.
|
||||
|
||||
The official ftp site is:
|
||||
ftp://ftp.gtk.org/pub/gtk
|
||||
|
||||
The official web site is:
|
||||
http://www.gtk.org/
|
||||
|
||||
A mailing list is located at:
|
||||
gtk-list@redhat.com
|
||||
|
||||
To subscribe: mail -s subscribe gtk-list-request@redhat.com < /dev/null
|
||||
(Send mail to gtk-list-request@redhat.com with the subject "subscribe")
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
See the file 'INSTALL'
|
||||
|
||||
How to report bugs
|
||||
==================
|
||||
|
||||
Bugs should be reported to the GNOME bug tracking
|
||||
system. (http://bugs.gnome.org). To report a problem
|
||||
about GTK+, send mail to submit@bugs.gnome.org.
|
||||
|
||||
The subject of the mail should describe your problem.
|
||||
In the body of the mail, you should first include
|
||||
a "pseudo-header" that gives the package and
|
||||
version number. This should be separated by a blank
|
||||
line from the actual headers.
|
||||
|
||||
Package: gtk+
|
||||
Version: @GTK_VERSION@
|
||||
|
||||
[ Please substitute @GTK_VERSION@ with the version of GTK+ that
|
||||
you have installed ]
|
||||
|
||||
Then describe the bug. Include:
|
||||
|
||||
* Information about your system. For instance:
|
||||
|
||||
- What operating system and version
|
||||
- What version of X
|
||||
- For Linux, what version of the C library
|
||||
|
||||
And anything else you think is relevant.
|
||||
|
||||
* How to reproduce the bug.
|
||||
|
||||
If you can reproduce it with the testgtk program that is built
|
||||
in the gtk/ subdirectory, that will be most convenient. Otherwise,
|
||||
please include a short test program that exhibits the behavior.
|
||||
As a last resort, you can also provide a pointer to a larger piece
|
||||
of software that can be downloaded.
|
||||
|
||||
(Bugs that can be reproduced within the GIMP are almost as good
|
||||
as bugs that can be reproduced in testgtk. If you are reporting a
|
||||
bug found with the GIMP, please include the version number of the GIMP
|
||||
you are using)
|
||||
|
||||
* If the bug was a crash, the exact text that was printed out
|
||||
when the crash occured.
|
||||
|
||||
* Further information such as stack traces may be useful, but
|
||||
is not necessary. If you do send a stack trace, and the error
|
||||
is an X error, it will be more useful if the stacktrace
|
||||
is produced running the test program with the --sync command
|
||||
line option.
|
||||
|
||||
An example of a bug report:
|
||||
|
||||
====
|
||||
To: submit@bugs.gnome.org
|
||||
From: yourname@your.address.org
|
||||
Subject: handlebox test in testgtk is misnamed.
|
||||
|
||||
Package: gtk+
|
||||
Version: @GTK_VERSION@
|
||||
|
||||
When I run gtk/testgtk, the button "handle box"
|
||||
is misnamed. There are multiple handle boxes in
|
||||
the demo, so it should be "handle boxes", to
|
||||
be like "buttons" or "check buttons".
|
||||
===
|
||||
|
||||
Patches
|
||||
=======
|
||||
|
||||
Patches can be uploaded to the incoming/ directory on
|
||||
ftp.gtk.org. Please follow the instructions there, and include
|
||||
your name and email address in the README file.
|
||||
|
||||
If the patch fixes a bug, it is usually a good idea to include
|
||||
all the information described in "How to Report Bugs".
|
11
configure.in
11
configure.in
@ -207,8 +207,10 @@ AC_TRY_RUN([#include <math.h>
|
||||
AC_MSG_RESULT()
|
||||
CFLAGS=$gtk_save_CFLAGS
|
||||
AC_MSG_WARN(
|
||||
[No ANSI prototypes found in library. (-std1 didn't work.)])
|
||||
)
|
||||
[No ANSI prototypes found in library. (-std1 didn't work.)]),
|
||||
true
|
||||
),
|
||||
AC_MSG_RESULT(none needed)
|
||||
)
|
||||
LIBS=$gtk_save_LIBS
|
||||
|
||||
@ -453,11 +455,12 @@ main ()
|
||||
return setlocale (LC_ALL, "${with_locale}") == NULL;
|
||||
}],
|
||||
need_x_locale=no,
|
||||
need_x_locale=yes)
|
||||
need_x_locale=yes,
|
||||
need_x_locale=no)
|
||||
AC_MSG_RESULT($need_x_locale)
|
||||
|
||||
if test $need_x_locale = yes; then
|
||||
GTK_LOCALE_CFLAGS="-DX_LOCALE"
|
||||
GTK_LOCALE_FLAGS="-DX_LOCALE"
|
||||
fi
|
||||
|
||||
# Checks for header files.
|
||||
|
@ -1,4 +1,4 @@
|
||||
b\input texinfo @c -*-texinfo-*-
|
||||
\input texinfo @c -*-texinfo-*-
|
||||
@c %**start of header
|
||||
@setfilename gdk.info
|
||||
@settitle GDK
|
||||
|
177
docs/generation.txt
Normal file
177
docs/generation.txt
Normal file
@ -0,0 +1,177 @@
|
||||
Overview:
|
||||
========
|
||||
|
||||
This file describes the way that autogeneration
|
||||
works within the GTK+ source code.
|
||||
|
||||
The following files in the gdk/ subdirectory
|
||||
are autogenerated:
|
||||
|
||||
gdkkeysyms.h
|
||||
gdkcursors.h
|
||||
|
||||
The following files in the gtk/ subdirectory
|
||||
are autogenerated:
|
||||
|
||||
gtk.defs
|
||||
Description of GTK+ types (and some functions) in a lisp-style
|
||||
format.
|
||||
gtktypebuiltins.h
|
||||
Header file including declarations for internal types
|
||||
gtktypebuiltins_vars.c
|
||||
Variables for type values for internal types.
|
||||
gtktypebuiltins_ids.c
|
||||
Arrays holding information about each internal type.
|
||||
gtktypebuiltins_evals.c
|
||||
Arrays holding mapping between enumeration values
|
||||
and strings.
|
||||
|
||||
gtkmarshal.c
|
||||
gtkmarshal.h
|
||||
Autogenerated signal marshallers
|
||||
|
||||
GDK
|
||||
===
|
||||
|
||||
gdkkeysyms.h and gdkcursors.h are generated from
|
||||
the corresponding header files
|
||||
|
||||
X11/cursorfont.h
|
||||
X11/keysymdef.h
|
||||
|
||||
by some simple sed scripts. These are not actually
|
||||
run automatically because we want all the keysyms
|
||||
even on systems with a limited set.
|
||||
So the Gdk rule to generate both files (X-derived-headers)
|
||||
only needs to be rerun for every new release of the X Window
|
||||
System.
|
||||
|
||||
GTK+ - type definitions
|
||||
=======================
|
||||
|
||||
The type definitions are generated from several sources:
|
||||
|
||||
gtk-boxed.defs - definitions for boxed types
|
||||
GTK+ header files
|
||||
GDK header files
|
||||
|
||||
The makeenums.pl script does a heuristic parse of
|
||||
the header files and extracts all enumerations declarations.
|
||||
It also recognizes a number of pseudo-comments in the
|
||||
header files:
|
||||
|
||||
Two of these apply to individual enumeration values:
|
||||
|
||||
/*< skip >*/
|
||||
|
||||
This enumeration value should be skipped.
|
||||
|
||||
/*< nick=NICK >*/
|
||||
|
||||
The nickname for this value should NICK instead of the
|
||||
normally guessed value. For instance:
|
||||
|
||||
typedef enum {
|
||||
GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
|
||||
GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/
|
||||
} GtkTargetFlags;
|
||||
|
||||
makes the nicks "same-app" and "same-widget", instead of
|
||||
"app" and "widget" that would normally be used.
|
||||
|
||||
The other two apply to entire enumeration declarations.
|
||||
|
||||
/*< prefix=PREFIX >*/
|
||||
|
||||
Specifies the prefix to be removed from the enumeration
|
||||
values to generate nicknames.
|
||||
|
||||
/*< flags >*/
|
||||
|
||||
Specifies that this enumeration is used as a bitfield.
|
||||
(makenums.pl normally guesses this from the presence of values
|
||||
with << operators). For instance:
|
||||
|
||||
typedef enum /*< flags >*/
|
||||
{
|
||||
GDK_IM_PREEDIT_AREA = 0x0001,
|
||||
GDK_IM_PREEDIT_CALLBACKS = 0x0002,
|
||||
[ ... ]
|
||||
} GdkIMStyle;
|
||||
|
||||
makeenums.pl can be run into two modes:
|
||||
|
||||
1) Generate the gtktypebuiltins_eval.c file (this
|
||||
contains arrays holding the mapping of
|
||||
string <=> enumeration value)
|
||||
|
||||
2) Generate the enumeration portion of gtk.defs.
|
||||
|
||||
The enumearation portion is added to the boxed type
|
||||
declarations in gtk-boxed.defs to create gtk.defs.
|
||||
|
||||
The makeetypes.awk program takes the gtk.defs file, and
|
||||
from that generates various files depending on the
|
||||
third parameter passed to it:
|
||||
|
||||
macros: gtktypebuiltins.h
|
||||
variables: gtktypebuiltins_vars.c
|
||||
entries: gtktypebuiltins_ids.c
|
||||
|
||||
GTK+ - marshallers
|
||||
==================
|
||||
|
||||
The files gtkmarshal.c and gtkmarshal.h include declarations
|
||||
and definitions for the marshallers needed inside of
|
||||
GTK+. The marshallers to be generated are listed in
|
||||
the file gtkmashal.list, which is processed
|
||||
by genmarshal.pl.
|
||||
|
||||
The format of this file is a list of lines:
|
||||
|
||||
<retval-type>:<arg1-type>,<arg2-type>,<arg3-type>
|
||||
|
||||
e.g.:
|
||||
|
||||
BOOL:POINTER,STRING,STRING,POINTER
|
||||
|
||||
A marshaller is generated for each line in the file.
|
||||
The possible types are:
|
||||
|
||||
NONE
|
||||
BOOL
|
||||
CHAR
|
||||
INT
|
||||
UINT
|
||||
LONG
|
||||
ULONG
|
||||
FLOAT
|
||||
DOUBLE
|
||||
STRING
|
||||
ENUM
|
||||
FLAGS
|
||||
BOXED
|
||||
POINTER
|
||||
OBJECT
|
||||
FOREIGN (gpointer data, GtkDestroyNotify notify)
|
||||
C_CALLBACK (GtkFunction func, gpointer func_data)
|
||||
SIGNAL (GtkSignalFunc f, gpointer data)
|
||||
ARGS (gint n_args, GtkArg *args)
|
||||
CALLBACK (GtkCallBackMarshal marshall,
|
||||
gpointer data,
|
||||
GtkDestroyNotify Notify)
|
||||
|
||||
Some of these types map to multiple return values - these
|
||||
are marked above with the return types in parantheses.
|
||||
|
||||
NOTES
|
||||
=====
|
||||
|
||||
When autogenerating GTK+ files, the autogenerated
|
||||
files are often rebuild resulting in the same result.
|
||||
|
||||
To prevent unecessary rebuilds of the entire directory, some files
|
||||
that multiple other source files depend on are not actually written
|
||||
to directly. Instead, an intermediate file is written, which
|
||||
is then compared to the old file, and only if it is different
|
||||
is it copied into the final location.
|
@ -81,7 +81,7 @@ main (int argv, char **argc)
|
||||
|
||||
info = g_malloc(sizeof(Info));
|
||||
|
||||
window = gtk_window_new(GTK_TOPLEVEL);
|
||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_signal_connect (GTK_OBJECT (window), "destroy",
|
||||
GTK_SIGNAL_FUNC (destroy), NULL);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Note that this is NOT a relocatable package
|
||||
%define ver @VERSION@
|
||||
%define rel SNAP
|
||||
%define RELEASE 1
|
||||
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
|
||||
%define prefix /usr
|
||||
|
||||
Summary: The Gimp Toolkit
|
||||
|
@ -99,7 +99,7 @@ if test "$echo_cflags" = "yes"; then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo -I@libdir@/gtk+/include $includes @x_cflags@ $glib_cflags
|
||||
echo -I@libdir@/gtk+/include $includes $glib_cflags @x_cflags@
|
||||
fi
|
||||
|
||||
if test "$echo_libs" = "yes"; then
|
||||
|
@ -22,7 +22,6 @@ gtktypebuiltins_vars.c
|
||||
gtktypebuiltins_evals.c
|
||||
gtk.defs
|
||||
testdnd
|
||||
stamp-d
|
||||
stamp-t
|
||||
stamp-m
|
||||
s-*
|
||||
stamp-gtktypebuiltins.h
|
||||
stamp-gtkmarshal.h
|
||||
stamp-gtk.defs
|
||||
|
595
gtk/Makefile.am
595
gtk/Makefile.am
@ -1,126 +1,47 @@
|
||||
### Process this file with automake to produce Makefile.in
|
||||
## Makefile.am for gtk+/gtk
|
||||
|
||||
top_builddir_full=`cd \$(top_builddir); pwd`
|
||||
INCLUDES = @STRIP_BEGIN@ \
|
||||
-DG_LOG_DOMAIN=\"Gtk\" \
|
||||
-DGTK_DISABLE_COMPAT_H \
|
||||
-DGTK_EXE_PREFIX=\"$(exec_prefix)\" \
|
||||
-DGTK_DATA_PREFIX=\"$(prefix)\" \
|
||||
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DGTK_LOCALEDIR=\"$(gtklocaledir)\" \
|
||||
-I$(top_srcdir) -I../gdk \
|
||||
-I$(top_srcdir)/gdk \
|
||||
-I$(top_srcdir)/gdk/x11 \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@GTK_XIM_FLAGS@ \
|
||||
@GTK_LOCALE_FLAGS@ \
|
||||
@GLIB_CFLAGS@ \
|
||||
@x_cflags@ \
|
||||
@STRIP_END@
|
||||
|
||||
gtkincludedir = $(includedir)/gtk
|
||||
|
||||
#
|
||||
# libraries to compile and install
|
||||
#
|
||||
lib_LTLIBRARIES = libgtk.la
|
||||
|
||||
static_SOURCES = \
|
||||
gtkaccelgroup.c \
|
||||
gtkaccellabel.c \
|
||||
gtkadjustment.c \
|
||||
gtkalignment.c \
|
||||
gtkarg.c \
|
||||
gtkarrow.c \
|
||||
gtkaspectframe.c \
|
||||
gtkbin.c \
|
||||
gtkbindings.c \
|
||||
gtkbbox.c \
|
||||
gtkbox.c \
|
||||
gtkbutton.c \
|
||||
gtkcalendar.c \
|
||||
gtkcheckbutton.c \
|
||||
gtkcheckmenuitem.c \
|
||||
gtkclist.c \
|
||||
gtkcolorsel.c \
|
||||
gtkcombo.c \
|
||||
gtkcontainer.c \
|
||||
gtkctree.c \
|
||||
gtkcurve.c \
|
||||
gtkdata.c \
|
||||
gtkdialog.c \
|
||||
gtkdnd.c \
|
||||
gtkdrawingarea.c \
|
||||
gtkeditable.c \
|
||||
gtkentry.c \
|
||||
gtkeventbox.c \
|
||||
gtkfilesel.c \
|
||||
gtkfixed.c \
|
||||
gtkfontsel.c \
|
||||
gtkframe.c \
|
||||
gtkgamma.c \
|
||||
gtkgc.c \
|
||||
gtkhandlebox.c \
|
||||
gtkhbbox.c \
|
||||
gtkhbox.c \
|
||||
gtkhpaned.c \
|
||||
gtkhruler.c \
|
||||
gtkhscale.c \
|
||||
gtkhscrollbar.c \
|
||||
gtkhseparator.c \
|
||||
gtkimage.c \
|
||||
gtkinputdialog.c \
|
||||
gtkintl.h \
|
||||
gtkinvisible.c \
|
||||
gtkitem.c \
|
||||
gtkitemfactory.c \
|
||||
gtklabel.c \
|
||||
gtklayout.c \
|
||||
gtklist.c \
|
||||
gtklistitem.c \
|
||||
gtkmain.c \
|
||||
gtkmenu.c \
|
||||
gtkmenubar.c \
|
||||
gtkmenufactory.c \
|
||||
gtkmenuitem.c \
|
||||
gtkmenushell.c \
|
||||
gtkmisc.c \
|
||||
gtknotebook.c \
|
||||
gtkobject.c \
|
||||
gtkoptionmenu.c \
|
||||
gtkpacker.c \
|
||||
gtkpaned.c \
|
||||
gtkpixmap.c \
|
||||
gtkplug.c \
|
||||
gtkpreview.c \
|
||||
gtkprogress.c \
|
||||
gtkprogressbar.c \
|
||||
gtkradiobutton.c \
|
||||
gtkradiomenuitem.c \
|
||||
gtkrange.c \
|
||||
gtkrc.c \
|
||||
gtkruler.c \
|
||||
gtkscale.c \
|
||||
gtkscrollbar.c \
|
||||
gtkscrolledwindow.c \
|
||||
gtkselection.c \
|
||||
gtkseparator.c \
|
||||
gtksignal.c \
|
||||
gtksocket.c \
|
||||
gtkspinbutton.c \
|
||||
gtkstyle.c \
|
||||
gtkstatusbar.c \
|
||||
gtktable.c \
|
||||
gtktearoffmenuitem.c \
|
||||
gtktext.c \
|
||||
gtkthemes.c \
|
||||
gtktipsquery.c \
|
||||
gtktogglebutton.c \
|
||||
gtktoolbar.c \
|
||||
gtktooltips.c \
|
||||
gtktree.c \
|
||||
gtktreeitem.c \
|
||||
gtktypeutils.c \
|
||||
gtkvbbox.c \
|
||||
gtkvbox.c \
|
||||
gtkviewport.c \
|
||||
gtkvpaned.c \
|
||||
gtkvruler.c \
|
||||
gtkvscale.c \
|
||||
gtkvscrollbar.c \
|
||||
gtkvseparator.c \
|
||||
gtkwidget.c \
|
||||
gtkwindow.c \
|
||||
fnmatch.c \
|
||||
fnmatch.h
|
||||
# libtool stuff: set version and export symbols for resolving
|
||||
libgtkincludedir = $(includedir)/gtk
|
||||
libgtk_la_LDFLAGS = @STRIP_BEGIN@ \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-release $(LT_RELEASE) \
|
||||
-export-dynamic \
|
||||
@GLIB_DEPLIBS@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
# $(top_builddir)/gdk/libgdk.la
|
||||
|
||||
libgtk_la_SOURCES = \
|
||||
$(static_SOURCES) \
|
||||
gtkmarshal.c
|
||||
|
||||
# Source headers which are non-autogenerated headers
|
||||
source_headers = \
|
||||
#
|
||||
# setup source file variables
|
||||
#
|
||||
# GTK+ header files for public installation (non-generated)
|
||||
gtk_public_h_sources = @STRIP_BEGIN@ \
|
||||
gtk.h \
|
||||
gtkaccelgroup.h \
|
||||
gtkaccellabel.h \
|
||||
@ -152,6 +73,7 @@ source_headers = \
|
||||
gtkentry.h \
|
||||
gtkenums.h \
|
||||
gtkeventbox.h \
|
||||
gtkfeatures.h \
|
||||
gtkfilesel.h \
|
||||
gtkfixed.h \
|
||||
gtkfontsel.h \
|
||||
@ -228,26 +150,160 @@ source_headers = \
|
||||
gtkvscrollbar.h \
|
||||
gtkvseparator.h \
|
||||
gtkwidget.h \
|
||||
gtkwindow.h
|
||||
|
||||
gtkinclude_HEADERS = \
|
||||
$(source_headers) \
|
||||
gtkcompat.h \
|
||||
gtkwindow.h \
|
||||
@STRIP_END@
|
||||
# GTK+ header files that don't get installed
|
||||
gtk_private_h_sources = @STRIP_BEGIN@ \
|
||||
@STRIP_END@
|
||||
# GTK+ C sources to build the library from
|
||||
gtk_c_sources = @STRIP_BEGIN@ \
|
||||
gtkaccelgroup.c \
|
||||
gtkaccellabel.c \
|
||||
gtkadjustment.c \
|
||||
gtkalignment.c \
|
||||
gtkarg.c \
|
||||
gtkarrow.c \
|
||||
gtkaspectframe.c \
|
||||
gtkbin.c \
|
||||
gtkbindings.c \
|
||||
gtkbbox.c \
|
||||
gtkbox.c \
|
||||
gtkbutton.c \
|
||||
gtkcalendar.c \
|
||||
gtkcheckbutton.c \
|
||||
gtkcheckmenuitem.c \
|
||||
gtkclist.c \
|
||||
gtkcolorsel.c \
|
||||
gtkcombo.c \
|
||||
gtkcontainer.c \
|
||||
gtkctree.c \
|
||||
gtkcurve.c \
|
||||
gtkdata.c \
|
||||
gtkdialog.c \
|
||||
gtkdnd.c \
|
||||
gtkdrawingarea.c \
|
||||
gtkeditable.c \
|
||||
gtkentry.c \
|
||||
gtkeventbox.c \
|
||||
gtkfilesel.c \
|
||||
gtkfixed.c \
|
||||
gtkfontsel.c \
|
||||
gtkframe.c \
|
||||
gtkgamma.c \
|
||||
gtkgc.c \
|
||||
gtkhandlebox.c \
|
||||
gtkhbbox.c \
|
||||
gtkhbox.c \
|
||||
gtkhpaned.c \
|
||||
gtkhruler.c \
|
||||
gtkhscale.c \
|
||||
gtkhscrollbar.c \
|
||||
gtkhseparator.c \
|
||||
gtkimage.c \
|
||||
gtkinputdialog.c \
|
||||
gtkintl.h \
|
||||
gtkinvisible.c \
|
||||
gtkitem.c \
|
||||
gtkitemfactory.c \
|
||||
gtklabel.c \
|
||||
gtklayout.c \
|
||||
gtklist.c \
|
||||
gtklistitem.c \
|
||||
gtkmain.c \
|
||||
gtkmarshal.c \
|
||||
gtkmenu.c \
|
||||
gtkmenubar.c \
|
||||
gtkmenufactory.c \
|
||||
gtkmenuitem.c \
|
||||
gtkmenushell.c \
|
||||
gtkmisc.c \
|
||||
gtknotebook.c \
|
||||
gtkobject.c \
|
||||
gtkoptionmenu.c \
|
||||
gtkpacker.c \
|
||||
gtkpaned.c \
|
||||
gtkpixmap.c \
|
||||
gtkplug.c \
|
||||
gtkpreview.c \
|
||||
gtkprogress.c \
|
||||
gtkprogressbar.c \
|
||||
gtkradiobutton.c \
|
||||
gtkradiomenuitem.c \
|
||||
gtkrange.c \
|
||||
gtkrc.c \
|
||||
gtkruler.c \
|
||||
gtkscale.c \
|
||||
gtkscrollbar.c \
|
||||
gtkscrolledwindow.c \
|
||||
gtkselection.c \
|
||||
gtkseparator.c \
|
||||
gtksignal.c \
|
||||
gtksocket.c \
|
||||
gtkspinbutton.c \
|
||||
gtkstyle.c \
|
||||
gtkstatusbar.c \
|
||||
gtktable.c \
|
||||
gtktearoffmenuitem.c \
|
||||
gtktext.c \
|
||||
gtkthemes.c \
|
||||
gtktipsquery.c \
|
||||
gtktogglebutton.c \
|
||||
gtktoolbar.c \
|
||||
gtktooltips.c \
|
||||
gtktree.c \
|
||||
gtktreeitem.c \
|
||||
gtktypeutils.c \
|
||||
gtkvbbox.c \
|
||||
gtkvbox.c \
|
||||
gtkviewport.c \
|
||||
gtkvpaned.c \
|
||||
gtkvruler.c \
|
||||
gtkvscale.c \
|
||||
gtkvscrollbar.c \
|
||||
gtkvseparator.c \
|
||||
gtkwidget.c \
|
||||
gtkwindow.c \
|
||||
fnmatch.c \
|
||||
fnmatch.h \
|
||||
@STRIP_END@
|
||||
# we use our own built_sources variable rules to avoid automake's
|
||||
# BUILT_SOURCES oddities
|
||||
# we generate frequently rebuild files piggyback on a stamp file, so sources
|
||||
# depending on them only get rebuild when the built source actually changed
|
||||
# content
|
||||
#
|
||||
# built sources that don't get installed
|
||||
gtk_built_sources = @STRIP_BEGIN@ \
|
||||
stamp-gtk.defs \
|
||||
stamp-gtktypebuiltins.h \
|
||||
stamp-gtkmarshal.h \
|
||||
gtktypebuiltins_vars.c \
|
||||
gtktypebuiltins_ids.c \
|
||||
gtktypebuiltins_evals.c \
|
||||
gtkmarshal.c \
|
||||
gtk.defs \
|
||||
@STRIP_END@
|
||||
# built sources that get installed with the header files
|
||||
gtk_built_public_sources = @STRIP_BEGIN@ \
|
||||
gtkmarshal.h \
|
||||
gtktypebuiltins.h
|
||||
|
||||
# note gtk.defs, gtktypebuiltin* and gtkmarshal.[ch] aren't here, but
|
||||
# their stamps are. Another trick is to use the temporary output files as
|
||||
# the stamp files.
|
||||
BUILT_SOURCES = \
|
||||
s-gd s-gtb s-gtbv s-gtbi s-gtbe \
|
||||
stamp-m
|
||||
|
||||
# cause the built sources to be rebuild when possible, even with --include-deps
|
||||
$(static_sources): $(BUILT_SOURCES)
|
||||
|
||||
# More headers to use when autogenerating.
|
||||
gdk_headers = \
|
||||
gtktypebuiltins.h \
|
||||
@STRIP_END@
|
||||
# non-header sources (headers should be specified in the above variables)
|
||||
# that don't serve as direct make target sources, i.e. they don't have
|
||||
# their own .lo rules and don't get publically installed
|
||||
gtk_extra_sources = @STRIP_BEGIN@ \
|
||||
gtkcompat.h.in \
|
||||
makeenums.pl \
|
||||
makeenums.awk \
|
||||
maketypes.awk \
|
||||
makeenums.h \
|
||||
gtkargcollector.c \
|
||||
gtk-boxed.defs \
|
||||
genmarshal.pl \
|
||||
gtkmarshal.list \
|
||||
@STRIP_END@
|
||||
# Extra headers that are used for enum type array/id generation
|
||||
gdk_headers = @STRIP_BEGIN@ \
|
||||
../gdk/gdkcc.h \
|
||||
../gdk/gdkcolor.h \
|
||||
../gdk/gdkcursor.h \
|
||||
@ -266,195 +322,137 @@ gdk_headers = \
|
||||
../gdk/gdkselection.h \
|
||||
../gdk/gdktypes.h \
|
||||
../gdk/gdkvisual.h \
|
||||
../gdk/gdkwindow.h
|
||||
../gdk/gdkwindow.h \
|
||||
@STRIP_END@
|
||||
|
||||
# generate gtk.defs file from gtk-boxed.defs and *.h
|
||||
gtk.defs: @REBUILD@ s-gd
|
||||
@:
|
||||
s-gd: @REBUILD@ makeenums.pl gtk-boxed.defs $(source_headers) $(gdk_headers)
|
||||
#
|
||||
# setup GTK+ sources and their dependancies
|
||||
#
|
||||
libgtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_built_public_sources)
|
||||
libgtk_la_SOURCES = $(gtk_c_sources)
|
||||
MAINTAINERCLEANFILES += $(gtk_built_public_sources) $(gtk_built_sources)
|
||||
EXTRA_HEADERS +=
|
||||
EXTRA_DIST += $(gtk_private_h_sources)
|
||||
EXTRA_DIST += $(gtk_built_sources) $(gtk_built_public_sources) $(gtk_extra_sources)
|
||||
|
||||
#
|
||||
# rules to generate built sources
|
||||
#
|
||||
# setup autogeneration dependancies
|
||||
gen_sources = xgen-gdef xgen-gtbh xgen-gtbvc xgen-gtbic xgen-gtbec xgen-gmh xgen-gmc
|
||||
CLEANFILES += $(gen_sources)
|
||||
OLD_STAMP: $(gtk_built_public_sources) $(gtk_built_sources)
|
||||
$(OBJECTS): OLD_STAMP # this is our oldest-source-stamp
|
||||
# initial creation of the real stamp-* files
|
||||
gtk.defs gtkmarshal.h gtktypebuiltins.h: # never add deps here
|
||||
test -f "$(srcdir)/$@" || touch $(srcdir)/$@
|
||||
# normal autogeneration rules
|
||||
stamp-gtk.defs: @REBUILD@ makeenums.pl gtk.defs gtk-boxed.defs $(gtk_public_h_sources) $(gdk_headers)
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) makeenums.pl defs $(source_headers) $(gdk_headers) > s-gd \
|
||||
&& cat gtk-boxed.defs >> s-gd \
|
||||
&& (cmp -s s-gd gtk.defs || cp s-gd gtk.defs)
|
||||
|
||||
# generate type identifier header (GTK_TYPE_WIDGET_FLAGS)
|
||||
gtktypebuiltins.h: @REBUILD@ s-gtb
|
||||
@:
|
||||
s-gtb: @REBUILD@ s-gd maketypes.awk
|
||||
&& $(PERL) makeenums.pl defs $(gtk_public_h_sources) $(gdk_headers) > xgen-gdef \
|
||||
&& cat gtk-boxed.defs >> xgen-gdef \
|
||||
&& (cmp -s xgen-gdef gtk.defs || cp xgen-gdef gtk.defs) \
|
||||
&& rm -f xgen-gdef \
|
||||
&& echo timestamp > $@
|
||||
gtkmarshal.c: stamp-gtkmarshal.h
|
||||
gtkmarshal.c stamp-gtkmarshal.h: @REBUILD@ genmarshal.pl gtkmarshal.list gtkmarshal.h
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs macros > s-gtb \
|
||||
&& (cmp -s s-gtb gtktypebuiltins.h || cp s-gtb gtktypebuiltins.h)
|
||||
|
||||
# generate type identifier variables (GTK_TYPE_WIDGET_FLAGS)
|
||||
gtktypebuiltins_vars.c: @REBUILD@ s-gtbv
|
||||
@:
|
||||
s-gtbv: @REBUILD@ s-gd maketypes.awk
|
||||
&& $(PERL) genmarshal.pl gtkmarshal.list xgen-gmh xgen-gmc \
|
||||
&& (test -z "$(INDENT)" || $(INDENT) xgen-gmh) \
|
||||
&& (test -z "$(INDENT)" || $(INDENT) xgen-gmc) \
|
||||
&& cp xgen-gmc gtkmarshal.c \
|
||||
&& (cmp -s xgen-gmh gtkmarshal.h || cp xgen-gmh gtkmarshal.h) \
|
||||
&& rm -f xgen-gmh xgen-gmc xgen-gmh~ xgen-gmc~ \
|
||||
&& echo timestamp > stamp-gtkmarshal.h
|
||||
stamp-gtktypebuiltins.h: @REBUILD@ maketypes.awk stamp-gtk.defs gtktypebuiltins.h
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs variables > s-gtbv \
|
||||
&& (cmp -s s-gtbv gtktypebuiltins_vars.c || cp s-gtbv gtktypebuiltins_vars.c)
|
||||
|
||||
# generate type entries for type-id registration
|
||||
gtktypebuiltins_ids.c: @REBUILD@ s-gtbi
|
||||
@:
|
||||
s-gtbi: @REBUILD@ s-gd maketypes.awk
|
||||
&& $(AWK) -f maketypes.awk gtk.defs macros > xgen-gtbh \
|
||||
&& (cmp -s xgen-gtbh gtktypebuiltins.h || cp xgen-gtbh gtktypebuiltins.h) \
|
||||
&& rm -f xgen-gtbh \
|
||||
&& echo timestamp > $@
|
||||
gtktypebuiltins_vars.c: @REBUILD@ maketypes.awk stamp-gtk.defs
|
||||
cd $(srcdir) \
|
||||
&& $(AWK) -f maketypes.awk gtk.defs entries > s-gtbi \
|
||||
&& (cmp -s s-gtbi gtktypebuiltins_ids.c || cp s-gtbi gtktypebuiltins_ids.c)
|
||||
|
||||
# generate enum value arrays
|
||||
gtktypebuiltins_evals.c: @REBUILD@ s-gtbe
|
||||
@:
|
||||
s-gtbe: @REBUILD@ makeenums.pl s-gd
|
||||
&& $(AWK) -f maketypes.awk gtk.defs variables > xgen-gtbvc \
|
||||
&& cp xgen-gtbvc $@ \
|
||||
&& rm -f xgen-gtbvc
|
||||
gtktypebuiltins_ids.c: @REBUILD@ maketypes.awk stamp-gtk.defs
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) makeenums.pl arrays $(source_headers) $(gdk_headers) > \
|
||||
s-gtbe \
|
||||
&& (cmp -s s-gtbe gtktypebuiltins_evals.c || cp s-gtbe gtktypebuiltins_evals.c)
|
||||
&& $(AWK) -f maketypes.awk gtk.defs entries > xgen-gtbic \
|
||||
&& cp xgen-gtbic $@ \
|
||||
&& rm -f xgen-gtbic
|
||||
gtktypebuiltins_evals.c: @REBUILD@ makeenums.pl $(gtk_public_h_sources) $(gdk_headers)
|
||||
cd $(srcdir) \
|
||||
&& $(PERL) makeenums.pl arrays $(gtk_public_h_sources) $(gdk_headers) > xgen-gtbec \
|
||||
&& cp xgen-gtbec $@ \
|
||||
&& rm -f xgen-gtbec
|
||||
|
||||
$(srcdir)/gtkmarshal.c $(srcdir)/gtkmarshal.h: @REBUILD@ stamp-m
|
||||
@:
|
||||
stamp-m: @REBUILD@ $(srcdir)/gtkmarshal.list $(srcdir)/genmarshal.pl
|
||||
(srcdir=$(srcdir) INDENT=$(INDENT) $(PERL) $(srcdir)/genmarshal.pl \
|
||||
&& (cmp -s s-gmc gtkmarshal.c || mv s-gmc gtkmarshal.c) \
|
||||
&& rm -f s-gmc \
|
||||
&& (cmp -s s-gmh gtkmarshal.h || mv s-gmh gtkmarshal.h) \
|
||||
&& rm -f s-gmh) \
|
||||
&& echo timestamp > stamp-m
|
||||
|
||||
libgtk_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
-release $(LT_RELEASE) \
|
||||
@GLIB_DEPLIBS@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
@GTK_LIBS_EXTRA@ \
|
||||
-lm
|
||||
# $(top_builddir)/gdk/libgdk.la
|
||||
|
||||
gtkconfdir = $(sysconfdir)/gtk
|
||||
gtkconf_DATA = gtkrc gtkrc.bg gtkrc.el gtkrc.eo gtkrc.he gtkrc.hy gtkrc.ja \
|
||||
gtkrc.ko gtkrc.ru gtkrc.tr gtkrc.th gtkrc.uk \
|
||||
gtkrc.iso88592 gtkrc.iso88595 gtkrc.iso885913 gtkrc.iso885914 \
|
||||
gtkrc.iso885915 gtkrc.zh_CN gtkrc.zh_TW.Big5 \
|
||||
gtkconf_DATA = gtkrc.bg gtkrc.el gtkrc.eo gtkrc.he gtkrc.hy gtkrc.ja \
|
||||
gtkrc.ko gtkrc.ru gtkrc.tr gtkrc.th gtkrc.uk gtkrc.iso-8859-2 \
|
||||
gtkrc.iso-8859-5 gtkrc.iso-8859-13 gtkrc.iso-8859-14 \
|
||||
gtkrc.iso-8859-15 gtkrc.zh_CN gtkrc.zh_TW.Big5 \
|
||||
gtkrc.ka_GE.georgianacademy gtkrc.ka_GE.georgianps \
|
||||
gtkrc.vi_VN.tcvn gtkrc.vi_VN.viscii
|
||||
|
||||
gtkrc:
|
||||
:
|
||||
|
||||
# We create a dummy theme for the default GTK+ theme
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk
|
||||
echo "# Empty gtkrc for default theme" > \
|
||||
$(DESTDIR)$(datadir)/themes/Default/gtk/gtkrc
|
||||
cd $(DESTDIR)$(gtkconfdir) ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.cs ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.hr ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.hu ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.pl ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.ro ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.sk ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.sl ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.sq ; \
|
||||
$(LN_S) gtkrc.iso88592 gtkrc.sr_YU.iso88592 ; \
|
||||
$(LN_S) gtkrc.iso88595 gtkrc.bg_BG.iso88595 ; \
|
||||
$(LN_S) gtkrc.iso88595 gtkrc.mk ; \
|
||||
$(LN_S) gtkrc.iso88595 gtkrc.sr ; \
|
||||
$(LN_S) gtkrc.iso88595 gtkrc.ru_RU.iso88595 ; \
|
||||
$(LN_S) gtkrc.iso885913 gtkrc.lt ; \
|
||||
$(LN_S) gtkrc.iso885914 gtkrc.cy ; \
|
||||
$(LN_S) gtkrc.iso885914 gtkrc.ga ; \
|
||||
$(LN_S) gtkrc.iso885915 gtkrc.et ; \
|
||||
$(LN_S) gtkrc.ka_GE.georgianacademy gtkrc.ka ; \
|
||||
$(LN_S) gtkrc.vi_VN.viscii gtkrc.vi_VN.viscii111 ; \
|
||||
$(LN_S) gtkrc.vi_VN.tcvn gtkrc.vi_VN.tcvn5712 ; \
|
||||
$(LN_S) gtkrc.vi_VN.tcvn5712 gtkrc.vi
|
||||
|
||||
$(mkinstalldirs) $(DESTDIR)$(gtkconfdir)
|
||||
cd $(DESTDIR)$(gtkconfdir) && \
|
||||
for i in cs hr hu pl ro sk sl sq ; do \
|
||||
rm -f gtkrc.$$i ; \
|
||||
ln -s gtkrc.iso-8859-2 gtkrc.$$i ; \
|
||||
done ; \
|
||||
for i in bg_BG.iso88595 mk sr ru_RU.iso88595 ; do \
|
||||
rm -f gtkrc.$$i ; \
|
||||
ln -s gtkrc.iso-8859-5 gtkrc.$$i ; \
|
||||
done ; \
|
||||
rm -f gtkrc.lt gtkrc.cy gtkrc.ga gtkrc.et gtkrc.ka \
|
||||
gtkrc.vi_VN.viscii111 gtkrc.vi_VN.tcvn5712 gtkrc.vi ; \
|
||||
ln -s gtkrc.iso-8859-13 gtkrc.lt ; \
|
||||
ln -s gtkrc.iso-8859-14 gtkrc.cy ; \
|
||||
ln -s gtkrc.iso-8859-14 gtkrc.ga ; \
|
||||
ln -s gtkrc.iso-8859-15 gtkrc.et ; \
|
||||
ln -s gtkrc.ka_GE.georgianacademy gtkrc.ka ; \
|
||||
ln -s gtkrc.vi_VN.viscii gtkrc.vi_VN.viscii111 ; \
|
||||
ln -s gtkrc.vi_VN.tcvn gtkrc.vi_VN.tcvn5712 ; \
|
||||
ln -s gtkrc.vi_VN.tcvn5712 gtkrc.vi
|
||||
|
||||
uninstall-local:
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Default/gtkrc
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(gtkconf_DATA) \
|
||||
line-arrow.xbm \
|
||||
line-wrap.xbm \
|
||||
testgtk.1 \
|
||||
testgtkrc \
|
||||
testgtkrc2 \
|
||||
gtkcompat.h.in \
|
||||
makeenums.pl \
|
||||
makeenums.awk \
|
||||
maketypes.awk \
|
||||
makeenums.h \
|
||||
gtkargcollector.c \
|
||||
gtktypebuiltins_vars.c \
|
||||
gtktypebuiltins_ids.c \
|
||||
gtktypebuiltins_evals.c \
|
||||
gtk-boxed.defs \
|
||||
gtk.defs \
|
||||
genmarshal.pl \
|
||||
gtkmarshal.list \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
test.xpm \
|
||||
marble.xpm \
|
||||
3DRings.xpm \
|
||||
FilesQueue.xpm \
|
||||
Modeller.xpm \
|
||||
tree_plus.xpm \
|
||||
tree_minus.xpm \
|
||||
tree_plus.xbm \
|
||||
tree_minus.xbm \
|
||||
circles.xbm \
|
||||
gtk.def \
|
||||
makefile.msc
|
||||
|
||||
INCLUDES = \
|
||||
-DGTK_DISABLE_COMPAT_H \
|
||||
-DG_LOG_DOMAIN=\"Gtk\" \
|
||||
-DGTK_EXE_PREFIX=\"$(exec_prefix)\" \
|
||||
-DGTK_DATA_PREFIX=\"$(prefix)\" \
|
||||
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DGTK_LOCALEDIR=\"$(gtklocaledir)\" \
|
||||
-I$(top_srcdir) -I../gdk \
|
||||
-I$(top_srcdir)/gdk \
|
||||
-I$(top_srcdir)/gdk/x11 \
|
||||
@GTK_DEBUG_FLAGS@ \
|
||||
@GTK_XIM_FLAGS@ \
|
||||
@GTK_LOCALE_FLAGS@ \
|
||||
@GLIB_CFLAGS@ \
|
||||
@x_cflags@
|
||||
|
||||
noinst_PROGRAMS = testgtk testinput testselection testrgb testdnd simple
|
||||
# testthreads
|
||||
|
||||
DEPS = \
|
||||
libgtk.la \
|
||||
$(top_builddir)/gdk/libgdk.la
|
||||
|
||||
LDADDS = \
|
||||
#
|
||||
# test programs, not to be installed
|
||||
#
|
||||
noinst_PROGRAMS = testgtk testinput testselection testrgb testdnd simple # testthreads
|
||||
DEPS = libgtk.la $(top_builddir)/gdk/libgdk.la
|
||||
LDADDS = @STRIP_BEGIN@ \
|
||||
libgtk.la \
|
||||
$(top_builddir)/gdk/libgdk.la \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
@GDK_WLIBS@ \
|
||||
@GLIB_LIBS@ \
|
||||
-lm
|
||||
|
||||
@GTK_LIBS_EXTRA@ \
|
||||
-lm \
|
||||
@STRIP_END@
|
||||
testgtk_DEPENDENCIES = $(DEPS)
|
||||
testinput_DEPENDENCIES = $(DEPS)
|
||||
#testthreads_DEPENDENCIES = $(DEPS)
|
||||
testselection_DEPENDENCIES = $(DEPS)
|
||||
testrgb_DEPENDENCIES = $(DEPS)
|
||||
testdnd_DEPENDENCIES = $(DEPS)
|
||||
simple_DEPENDENCIES = $(DEPS)
|
||||
|
||||
#testthreads_DEPENDENCIES = $(DEPS)
|
||||
testgtk_LDADD = $(LDADDS)
|
||||
testinput_LDADD = $(LDADDS)
|
||||
#testthreads_LDADD = $(LDADDS)
|
||||
testselection_LDADD = $(LDADDS)
|
||||
testrgb_LDADD = $(LDADDS)
|
||||
testdnd_LDADD = $(LDADDS)
|
||||
simple_LDADD = $(LDADDS)
|
||||
#testthreads_LDADD = $(LDADDS)
|
||||
|
||||
.PHONY: files test test-debug
|
||||
|
||||
@ -473,3 +471,28 @@ test-debug: testgtk
|
||||
cd $$builddir; cd $(srcdir); \
|
||||
$(SHELL) $$top_builddir/libtool --mode=execute gdb $$builddir/testgtk
|
||||
|
||||
EXTRA_DIST += @STRIP_BEGIN@ \
|
||||
testgtk.1 \
|
||||
testgtkrc \
|
||||
testgtkrc2 \
|
||||
circles.xbm \
|
||||
line-arrow.xbm \
|
||||
line-wrap.xbm \
|
||||
tree_plus.xbm \
|
||||
tree_minus.xbm \
|
||||
3DRings.xpm \
|
||||
FilesQueue.xpm \
|
||||
Modeller.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
marble.xpm \
|
||||
tree_minus.xpm \
|
||||
tree_plus.xpm \
|
||||
test.xpm \
|
||||
check-y.xpm \
|
||||
check-n.xpm \
|
||||
test.xpm \
|
||||
gtk.def \
|
||||
makefile.msc \
|
||||
$(gtkconf_DATA) \
|
||||
@STRIP_END@
|
||||
|
@ -20,25 +20,17 @@
|
||||
"CALLBACK"=>"CALLBACK"
|
||||
);
|
||||
|
||||
$srcdir = $ENV{'srcdir'} || '.';
|
||||
$indent = $ENV{'INDENT'};
|
||||
|
||||
sub indent {
|
||||
my $filename = shift;
|
||||
if (defined($indent) && $indent ne "") {
|
||||
system($indent, $filename);
|
||||
# we try the most likely names for backup files
|
||||
system("rm", "-f", "$filename.bak", "$filename~");
|
||||
}
|
||||
if ($#ARGV != 2) {
|
||||
die ("Wrong number of arguments given, need <source> <target.h> <target.c>");
|
||||
}
|
||||
|
||||
open(IL, "<$srcdir/gtkmarshal.list") || die("Open failed: $!");
|
||||
open(OH, ">s-gmh") || die("Open failed: $!");
|
||||
open(OS, ">s-gmc") || die("Open failed: $!");
|
||||
open(IL, "<" . $ARGV[0]) || die ("Open failed: $!");
|
||||
open(OH, ">" . $ARGV[1]) || die ("Open failed: $!");
|
||||
open(OS, ">" . $ARGV[2]) || die ("Open failed: $!");
|
||||
|
||||
print OH <<EOT;
|
||||
#ifndef __GTKMARSHAL_H__
|
||||
#define __GTKMARSHAL_H__ 1
|
||||
#ifndef __GTK_MARSHAL_H__
|
||||
#define __GTK_MARSHAL_H__
|
||||
|
||||
#include <gtk/gtktypeutils.h>
|
||||
#include <gtk/gtkobject.h>
|
||||
@ -196,10 +188,7 @@ print OH <<EOT;
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GTKMARSHAL_H__ */
|
||||
#endif /* __GTK_MARSHAL_H__ */
|
||||
EOT
|
||||
|
||||
close(IL); close(OH); close(OS);
|
||||
|
||||
indent("s-gmh");
|
||||
indent("s-gmc");
|
||||
|
@ -83,26 +83,42 @@ struct _GtkAccelEntry
|
||||
};
|
||||
|
||||
|
||||
/* Accelerators
|
||||
*/
|
||||
gboolean gtk_accelerator_valid (guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
void gtk_accelerator_parse (const gchar *accelerator,
|
||||
guint *accelerator_key,
|
||||
GdkModifierType *accelerator_mods);
|
||||
gchar* gtk_accelerator_name (guint accelerator_key,
|
||||
GdkModifierType accelerator_mods);
|
||||
void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
|
||||
guint gtk_accelerator_get_default_mod_mask (void);
|
||||
|
||||
|
||||
/* Accelerator Groups
|
||||
*/
|
||||
GtkAccelGroup* gtk_accel_group_new (void);
|
||||
GtkAccelGroup* gtk_accel_group_get_default (void);
|
||||
GtkAccelGroup* gtk_accel_group_ref (GtkAccelGroup *accel_group);
|
||||
void gtk_accel_group_unref (GtkAccelGroup *accel_group);
|
||||
gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
|
||||
void gtk_accel_group_lock (GtkAccelGroup *accel_group);
|
||||
void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
|
||||
gboolean gtk_accel_groups_activate (GtkObject *object,
|
||||
guint accel_key,
|
||||
GdkModifierType accel_mods);
|
||||
gboolean gtk_accel_groups_activate (GtkObject *object,
|
||||
|
||||
/* internal functions
|
||||
*/
|
||||
gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
|
||||
guint accel_key,
|
||||
GdkModifierType accel_mods);
|
||||
void gtk_accel_group_attach (GtkAccelGroup *accel_group,
|
||||
GtkObject *object);
|
||||
void gtk_accel_group_detach (GtkAccelGroup *accel_group,
|
||||
GtkObject *object);
|
||||
void gtk_accel_group_lock (GtkAccelGroup *accel_group);
|
||||
void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
|
||||
|
||||
/* Accelerator Group Entries
|
||||
/* Accelerator Group Entries (internal)
|
||||
*/
|
||||
GtkAccelEntry* gtk_accel_group_get_entry (GtkAccelGroup *accel_group,
|
||||
guint accel_key,
|
||||
@ -124,7 +140,7 @@ void gtk_accel_group_remove (GtkAccelGroup *accel_group,
|
||||
GdkModifierType accel_mods,
|
||||
GtkObject *object);
|
||||
|
||||
/* Accelerator Signals
|
||||
/* Accelerator Signals (internal)
|
||||
*/
|
||||
void gtk_accel_group_handle_add (GtkObject *object,
|
||||
guint accel_signal_id,
|
||||
@ -151,25 +167,12 @@ void gtk_accel_group_marshal_remove (GtkObject *object,
|
||||
gpointer func_data,
|
||||
GtkArg *args);
|
||||
|
||||
/* Miscellaneous
|
||||
/* Miscellaneous (internal)
|
||||
*/
|
||||
GSList* gtk_accel_groups_from_object (GtkObject *object);
|
||||
GSList* gtk_accel_group_entries_from_object (GtkObject *object);
|
||||
|
||||
|
||||
/* Accelerators
|
||||
*/
|
||||
gboolean gtk_accelerator_valid (guint keyval,
|
||||
GdkModifierType modifiers);
|
||||
void gtk_accelerator_parse (const gchar *accelerator,
|
||||
guint *accelerator_key,
|
||||
GdkModifierType *accelerator_mods);
|
||||
gchar* gtk_accelerator_name (guint accelerator_key,
|
||||
GdkModifierType accelerator_mods);
|
||||
void gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask);
|
||||
guint gtk_accelerator_get_default_mod_mask (void);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
221
gtk/gtkarg.c
221
gtk/gtkarg.c
@ -427,12 +427,35 @@ gtk_arg_free (GtkArg *arg,
|
||||
{
|
||||
g_return_if_fail (arg != NULL);
|
||||
|
||||
if (free_contents &&
|
||||
GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_STRING)
|
||||
g_free (GTK_VALUE_STRING (*arg));
|
||||
if (free_contents)
|
||||
gtk_arg_reset (arg);
|
||||
g_free (arg);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_arg_reset (GtkArg *arg)
|
||||
{
|
||||
GtkType fundamental_type;
|
||||
|
||||
g_return_if_fail (arg != NULL);
|
||||
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
|
||||
{
|
||||
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
|
||||
if (!fundamental_type)
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
}
|
||||
|
||||
if (fundamental_type == GTK_TYPE_STRING)
|
||||
{
|
||||
g_free (GTK_VALUE_STRING (*arg));
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
}
|
||||
else if (arg->type != GTK_TYPE_INVALID)
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
}
|
||||
|
||||
gint
|
||||
gtk_arg_info_equal (gconstpointer arg_info_1,
|
||||
gconstpointer arg_info_2)
|
||||
@ -466,3 +489,195 @@ gtk_arg_info_hash (gconstpointer arg_info)
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_arg_values_equal (const GtkArg *arg1,
|
||||
const GtkArg *arg2)
|
||||
{
|
||||
GtkType fundamental_type;
|
||||
gboolean equal;
|
||||
|
||||
g_return_val_if_fail (arg1 != NULL, FALSE);
|
||||
g_return_val_if_fail (arg2 != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_FUNDAMENTAL_TYPE (arg1->type) ==
|
||||
GTK_FUNDAMENTAL_TYPE (arg2->type), FALSE);
|
||||
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg1->type);
|
||||
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
|
||||
{
|
||||
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
|
||||
if (!fundamental_type)
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg1->type);
|
||||
}
|
||||
|
||||
switch (fundamental_type)
|
||||
{
|
||||
case GTK_TYPE_INVALID:
|
||||
equal = TRUE;
|
||||
break;
|
||||
case GTK_TYPE_CHAR:
|
||||
equal = GTK_VALUE_CHAR (*arg1) == GTK_VALUE_CHAR (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_BOOL:
|
||||
equal = (GTK_VALUE_BOOL (*arg1) != FALSE) == (GTK_VALUE_BOOL (*arg2) != FALSE);
|
||||
break;
|
||||
case GTK_TYPE_INT:
|
||||
equal = GTK_VALUE_INT (*arg1) == GTK_VALUE_INT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_UINT:
|
||||
equal = GTK_VALUE_UINT (*arg1) == GTK_VALUE_UINT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_LONG:
|
||||
equal = GTK_VALUE_LONG (*arg1) == GTK_VALUE_LONG (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_ULONG:
|
||||
equal = GTK_VALUE_ULONG (*arg1) == GTK_VALUE_ULONG (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_FLOAT:
|
||||
equal = GTK_VALUE_FLOAT (*arg1) == GTK_VALUE_FLOAT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_DOUBLE:
|
||||
equal = GTK_VALUE_DOUBLE (*arg1) == GTK_VALUE_DOUBLE (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_STRING:
|
||||
if (!GTK_VALUE_STRING (*arg1) ||
|
||||
!GTK_VALUE_STRING (*arg2))
|
||||
equal = GTK_VALUE_STRING (*arg1) == GTK_VALUE_STRING (*arg2);
|
||||
else
|
||||
equal = g_str_equal (GTK_VALUE_STRING (*arg1), GTK_VALUE_STRING (*arg2));
|
||||
break;
|
||||
case GTK_TYPE_ENUM:
|
||||
equal = GTK_VALUE_ENUM (*arg1) == GTK_VALUE_ENUM (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_FLAGS:
|
||||
equal = GTK_VALUE_FLAGS (*arg1) == GTK_VALUE_FLAGS (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_BOXED:
|
||||
equal = GTK_VALUE_BOXED (*arg1) == GTK_VALUE_BOXED (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_FOREIGN:
|
||||
equal = (GTK_VALUE_FOREIGN (*arg1).data == GTK_VALUE_FOREIGN (*arg2).data &&
|
||||
GTK_VALUE_FOREIGN (*arg1).notify == GTK_VALUE_FOREIGN (*arg2).notify);
|
||||
break;
|
||||
case GTK_TYPE_CALLBACK:
|
||||
equal = (GTK_VALUE_CALLBACK (*arg1).marshal == GTK_VALUE_CALLBACK (*arg2).marshal &&
|
||||
GTK_VALUE_CALLBACK (*arg1).data == GTK_VALUE_CALLBACK (*arg2).data &&
|
||||
GTK_VALUE_CALLBACK (*arg1).notify == GTK_VALUE_CALLBACK (*arg2).notify);
|
||||
break;
|
||||
case GTK_TYPE_ARGS:
|
||||
equal = (GTK_VALUE_ARGS (*arg1).n_args == GTK_VALUE_ARGS (*arg2).n_args &&
|
||||
GTK_VALUE_ARGS (*arg1).args == GTK_VALUE_ARGS (*arg2).args);
|
||||
break;
|
||||
case GTK_TYPE_OBJECT:
|
||||
equal = GTK_VALUE_OBJECT (*arg1) == GTK_VALUE_OBJECT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_POINTER:
|
||||
equal = GTK_VALUE_POINTER (*arg1) == GTK_VALUE_POINTER (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_SIGNAL:
|
||||
equal = (GTK_VALUE_SIGNAL (*arg1).f == GTK_VALUE_SIGNAL (*arg2).f &&
|
||||
GTK_VALUE_SIGNAL (*arg1).d == GTK_VALUE_SIGNAL (*arg2).d);
|
||||
break;
|
||||
case GTK_TYPE_C_CALLBACK:
|
||||
equal = (GTK_VALUE_C_CALLBACK (*arg1).func == GTK_VALUE_C_CALLBACK (*arg2).func &&
|
||||
GTK_VALUE_C_CALLBACK (*arg1).func_data == GTK_VALUE_C_CALLBACK (*arg2).func_data);
|
||||
break;
|
||||
default:
|
||||
g_warning ("gtk_arg_values_equal() used with unknown type `%s'", gtk_type_name (arg1->type));
|
||||
equal = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
return equal;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_arg_to_valueloc (GtkArg *arg,
|
||||
gpointer value_pointer)
|
||||
{
|
||||
GtkType fundamental_type;
|
||||
|
||||
g_return_if_fail (arg != NULL);
|
||||
g_return_if_fail (value_pointer != NULL);
|
||||
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
if (fundamental_type > GTK_TYPE_FUNDAMENTAL_LAST)
|
||||
{
|
||||
fundamental_type = gtk_type_get_varargs_type (fundamental_type);
|
||||
if (!fundamental_type)
|
||||
fundamental_type = GTK_FUNDAMENTAL_TYPE (arg->type);
|
||||
}
|
||||
|
||||
switch (fundamental_type)
|
||||
{
|
||||
gchar *p_char;
|
||||
guchar *p_uchar;
|
||||
gboolean *p_boolean;
|
||||
gint *p_int;
|
||||
guint *p_uint;
|
||||
glong *p_long;
|
||||
gulong *p_ulong;
|
||||
gfloat *p_float;
|
||||
gdouble *p_double;
|
||||
gpointer *p_pointer;
|
||||
case GTK_TYPE_CHAR:
|
||||
p_char = value_pointer;
|
||||
*p_char = GTK_VALUE_CHAR (*arg);
|
||||
break;
|
||||
case GTK_TYPE_UCHAR:
|
||||
p_uchar = value_pointer;
|
||||
*p_uchar = GTK_VALUE_UCHAR (*arg);
|
||||
break;
|
||||
case GTK_TYPE_BOOL:
|
||||
p_boolean = value_pointer;
|
||||
*p_boolean = GTK_VALUE_BOOL (*arg);
|
||||
break;
|
||||
case GTK_TYPE_INT:
|
||||
case GTK_TYPE_ENUM:
|
||||
p_int = value_pointer;
|
||||
*p_int = GTK_VALUE_INT (*arg);
|
||||
break;
|
||||
case GTK_TYPE_UINT:
|
||||
case GTK_TYPE_FLAGS:
|
||||
p_uint = value_pointer;
|
||||
*p_uint = GTK_VALUE_UINT (*arg);
|
||||
break;
|
||||
case GTK_TYPE_LONG:
|
||||
p_long = value_pointer;
|
||||
*p_long = GTK_VALUE_LONG (*arg);
|
||||
break;
|
||||
case GTK_TYPE_ULONG:
|
||||
p_ulong = value_pointer;
|
||||
*p_ulong = GTK_VALUE_ULONG (*arg);
|
||||
break;
|
||||
case GTK_TYPE_FLOAT:
|
||||
p_float = value_pointer;
|
||||
*p_float = GTK_VALUE_FLOAT (*arg);
|
||||
break;
|
||||
case GTK_TYPE_DOUBLE:
|
||||
p_double = value_pointer;
|
||||
*p_double = GTK_VALUE_DOUBLE (*arg);
|
||||
break;
|
||||
case GTK_TYPE_STRING:
|
||||
case GTK_TYPE_POINTER:
|
||||
case GTK_TYPE_BOXED:
|
||||
case GTK_TYPE_OBJECT:
|
||||
p_pointer = value_pointer;
|
||||
*p_pointer = GTK_VALUE_POINTER (*arg);
|
||||
break;
|
||||
case GTK_TYPE_SIGNAL:
|
||||
case GTK_TYPE_ARGS:
|
||||
case GTK_TYPE_FOREIGN:
|
||||
case GTK_TYPE_CALLBACK:
|
||||
case GTK_TYPE_C_CALLBACK:
|
||||
case GTK_TYPE_NONE:
|
||||
case GTK_TYPE_INVALID:
|
||||
/* it doesn't make much sense to retrive these values,
|
||||
* they either are always read-only args, or require
|
||||
* multiple pointers.
|
||||
*/
|
||||
g_warning ("gtk_arg_fill_retloc(): unsupported argument type `%s'",
|
||||
gtk_type_name (arg->type));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,9 @@ GtkArg* gtk_arg_copy (GtkArg *src_arg,
|
||||
GtkArg *dest_arg);
|
||||
void gtk_arg_free (GtkArg *arg,
|
||||
gboolean free_contents);
|
||||
void gtk_arg_reset (GtkArg *arg);
|
||||
gboolean gtk_arg_values_equal (const GtkArg *arg1,
|
||||
const GtkArg *arg2);
|
||||
gchar* gtk_args_collect (GtkType object_type,
|
||||
GHashTable *arg_info_hash_table,
|
||||
GSList **arg_list_p,
|
||||
@ -90,6 +93,8 @@ gchar* gtk_arg_name_strip_type (const gchar *arg_name);
|
||||
gint gtk_arg_info_equal (gconstpointer arg_info_1,
|
||||
gconstpointer arg_info_2);
|
||||
guint gtk_arg_info_hash (gconstpointer arg_info);
|
||||
void gtk_arg_to_valueloc (GtkArg *arg,
|
||||
gpointer value_pointer);
|
||||
|
||||
|
||||
|
||||
|
@ -31,8 +31,22 @@
|
||||
|
||||
#include "gtkaspectframe.h"
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_XALIGN,
|
||||
ARG_YALIGN,
|
||||
ARG_RATIO,
|
||||
ARG_OBEY_CHILD
|
||||
};
|
||||
|
||||
static void gtk_aspect_frame_class_init (GtkAspectFrameClass *klass);
|
||||
static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame);
|
||||
static void gtk_aspect_frame_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_aspect_frame_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_aspect_frame_draw (GtkWidget *widget,
|
||||
GdkRectangle *area);
|
||||
static void gtk_aspect_frame_paint (GtkWidget *widget,
|
||||
@ -64,7 +78,7 @@ gtk_aspect_frame_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
aspect_frame_type = gtk_type_unique (gtk_frame_get_type (), &aspect_frame_info);
|
||||
aspect_frame_type = gtk_type_unique (GTK_TYPE_FRAME, &aspect_frame_info);
|
||||
}
|
||||
|
||||
return aspect_frame_type;
|
||||
@ -73,13 +87,27 @@ gtk_aspect_frame_get_type (void)
|
||||
static void
|
||||
gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
object_class = GTK_OBJECT_CLASS (class);
|
||||
widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->set_arg = gtk_aspect_frame_set_arg;
|
||||
object_class->get_arg = gtk_aspect_frame_get_arg;
|
||||
|
||||
widget_class->draw = gtk_aspect_frame_draw;
|
||||
widget_class->expose_event = gtk_aspect_frame_expose;
|
||||
widget_class->size_allocate = gtk_aspect_frame_size_allocate;
|
||||
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::xalign", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_XALIGN);
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::yalign", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_YALIGN);
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::ratio", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_RATIO);
|
||||
gtk_object_add_arg_type ("GtkAspectFrame::obey_child", GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE, ARG_OBEY_CHILD);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -88,19 +116,86 @@ gtk_aspect_frame_init (GtkAspectFrame *aspect_frame)
|
||||
aspect_frame->xalign = 0.5;
|
||||
aspect_frame->yalign = 0.5;
|
||||
aspect_frame->ratio = 1.0;
|
||||
aspect_frame->obey_child = 1;
|
||||
aspect_frame->obey_child = TRUE;
|
||||
aspect_frame->center_allocation.x = -1;
|
||||
aspect_frame->center_allocation.y = -1;
|
||||
aspect_frame->center_allocation.width = 1;
|
||||
aspect_frame->center_allocation.height = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_aspect_frame_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_XALIGN:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
GTK_VALUE_FLOAT (*arg),
|
||||
aspect_frame->yalign,
|
||||
aspect_frame->ratio,
|
||||
aspect_frame->obey_child);
|
||||
break;
|
||||
case ARG_YALIGN:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
aspect_frame->xalign,
|
||||
GTK_VALUE_FLOAT (*arg),
|
||||
aspect_frame->ratio,
|
||||
aspect_frame->obey_child);
|
||||
break;
|
||||
case ARG_RATIO:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
aspect_frame->xalign,
|
||||
aspect_frame->yalign,
|
||||
GTK_VALUE_FLOAT (*arg),
|
||||
aspect_frame->obey_child);
|
||||
break;
|
||||
case ARG_OBEY_CHILD:
|
||||
gtk_aspect_frame_set (aspect_frame,
|
||||
aspect_frame->xalign,
|
||||
aspect_frame->yalign,
|
||||
aspect_frame->ratio,
|
||||
GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_aspect_frame_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_XALIGN:
|
||||
GTK_VALUE_FLOAT (*arg) = aspect_frame->xalign;
|
||||
break;
|
||||
case ARG_YALIGN:
|
||||
GTK_VALUE_FLOAT (*arg) = aspect_frame->yalign;
|
||||
break;
|
||||
case ARG_RATIO:
|
||||
GTK_VALUE_FLOAT (*arg) = aspect_frame->ratio;
|
||||
break;
|
||||
case ARG_OBEY_CHILD:
|
||||
GTK_VALUE_BOOL (*arg) = aspect_frame->obey_child;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_aspect_frame_new (const gchar *label,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child)
|
||||
gboolean obey_child)
|
||||
{
|
||||
GtkAspectFrame *aspect_frame;
|
||||
|
||||
@ -109,7 +204,7 @@ gtk_aspect_frame_new (const gchar *label,
|
||||
aspect_frame->xalign = CLAMP (xalign, 0.0, 1.0);
|
||||
aspect_frame->yalign = CLAMP (yalign, 0.0, 1.0);
|
||||
aspect_frame->ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
|
||||
aspect_frame->obey_child = obey_child;
|
||||
aspect_frame->obey_child = obey_child != FALSE;
|
||||
|
||||
gtk_frame_set_label (GTK_FRAME(aspect_frame), label);
|
||||
|
||||
@ -121,7 +216,7 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child)
|
||||
gboolean obey_child)
|
||||
{
|
||||
g_return_if_fail (aspect_frame != NULL);
|
||||
g_return_if_fail (GTK_IS_ASPECT_FRAME (aspect_frame));
|
||||
@ -129,6 +224,7 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
|
||||
xalign = CLAMP (xalign, 0.0, 1.0);
|
||||
yalign = CLAMP (yalign, 0.0, 1.0);
|
||||
ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO);
|
||||
obey_child = obey_child != FALSE;
|
||||
|
||||
if ((aspect_frame->xalign != xalign) ||
|
||||
(aspect_frame->yalign != yalign) ||
|
||||
@ -308,9 +404,10 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
if (child_requisition.height != 0)
|
||||
{
|
||||
ratio = (gdouble)child_requisition.width /
|
||||
child_requisition.height;
|
||||
if (ratio < MIN_RATIO) ratio = MIN_RATIO;
|
||||
ratio = ((gdouble) child_requisition.width /
|
||||
child_requisition.height);
|
||||
if (ratio < MIN_RATIO)
|
||||
ratio = MIN_RATIO;
|
||||
}
|
||||
else if (child_requisition.width != 0)
|
||||
ratio = MAX_RATIO;
|
||||
|
@ -76,7 +76,7 @@ void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame,
|
||||
gfloat xalign,
|
||||
gfloat yalign,
|
||||
gfloat ratio,
|
||||
gint obey_child);
|
||||
gboolean obey_child);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
20
gtk/gtkbin.c
20
gtk/gtkbin.c
@ -168,10 +168,13 @@ gtk_bin_draw (GtkWidget *widget,
|
||||
|
||||
bin = GTK_BIN (widget);
|
||||
|
||||
if (bin->child && GTK_WIDGET_VISIBLE (bin->child) &&
|
||||
if (GTK_WIDGET_DRAWABLE (bin))
|
||||
{
|
||||
if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
|
||||
gtk_widget_intersect (bin->child, area, &child_area))
|
||||
gtk_widget_draw (bin->child, &child_area);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_bin_expose (GtkWidget *widget,
|
||||
@ -189,7 +192,7 @@ gtk_bin_expose (GtkWidget *widget,
|
||||
bin = GTK_BIN (widget);
|
||||
|
||||
child_event = *event;
|
||||
if (bin->child &&
|
||||
if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
|
||||
GTK_WIDGET_NO_WINDOW (bin->child) &&
|
||||
gtk_widget_intersect (bin->child, &event->area, &child_event.area))
|
||||
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
|
||||
@ -216,20 +219,17 @@ gtk_bin_add (GtkContainer *container,
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (bin));
|
||||
bin->child = child;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child->parent))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (child->parent) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (child->parent) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (child->parent))
|
||||
gtk_widget_map (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (container))
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_bin_remove (GtkContainer *container,
|
||||
|
@ -1136,6 +1136,7 @@ gtk_pattern_spec_init (GtkPatternSpec *pspec,
|
||||
t = pspec->pattern_reversed;
|
||||
pspec->pattern_reversed = g_strdup (p);
|
||||
g_free (t);
|
||||
g_free (pspec->pattern);
|
||||
pspec->pattern = g_strdup (pspec->pattern_reversed);
|
||||
g_strreverse (pspec->pattern);
|
||||
pspec->pattern_length = strlen (pspec->pattern);
|
||||
|
32
gtk/gtkbox.c
32
gtk/gtkbox.c
@ -342,20 +342,17 @@ gtk_box_pack_start (GtkBox *box,
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (box));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (box)))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
if (GTK_WIDGET_REALIZED (box))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (box))
|
||||
gtk_widget_map (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_pack_end (GtkBox *box,
|
||||
@ -382,20 +379,17 @@ gtk_box_pack_end (GtkBox *box,
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (box));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (box)))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
if (GTK_WIDGET_REALIZED (box))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (GTK_WIDGET (box)) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (box))
|
||||
gtk_widget_map (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_box_pack_start_defaults (GtkBox *box,
|
||||
@ -660,7 +654,8 @@ gtk_box_draw (GtkWidget *widget,
|
||||
child = children->data;
|
||||
children = children->next;
|
||||
|
||||
if (gtk_widget_intersect (child->widget, area, &child_area))
|
||||
if (GTK_WIDGET_DRAWABLE (child->widget) &&
|
||||
gtk_widget_intersect (child->widget, area, &child_area))
|
||||
gtk_widget_draw (child->widget, &child_area);
|
||||
}
|
||||
}
|
||||
@ -691,7 +686,8 @@ gtk_box_expose (GtkWidget *widget,
|
||||
child = children->data;
|
||||
children = children->next;
|
||||
|
||||
if (GTK_WIDGET_NO_WINDOW (child->widget) &&
|
||||
if (GTK_WIDGET_DRAWABLE (child->widget) &&
|
||||
GTK_WIDGET_NO_WINDOW (child->widget) &&
|
||||
gtk_widget_intersect (child->widget, &event->area, &child_event.area))
|
||||
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
|
||||
}
|
||||
|
@ -646,7 +646,7 @@ static gint
|
||||
gtk_button_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkButton *bin;
|
||||
GtkBin *bin;
|
||||
GdkEventExpose child_event;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
|
@ -74,16 +74,49 @@ gtk_check_menu_item_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
check_menu_item_type = gtk_type_unique (gtk_menu_item_get_type (), &check_menu_item_info);
|
||||
check_menu_item_type = gtk_type_unique (GTK_TYPE_MENU_ITEM, &check_menu_item_info);
|
||||
}
|
||||
|
||||
return check_menu_item_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkMenuItemClass *menu_item_class;
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
menu_item_class = (GtkMenuItemClass*) klass;
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_MENU_ITEM);
|
||||
|
||||
widget_class->draw = gtk_check_menu_item_draw;
|
||||
widget_class->expose_event = gtk_check_menu_item_expose;
|
||||
|
||||
menu_item_class->activate = gtk_check_menu_item_activate;
|
||||
menu_item_class->toggle_size = 12;
|
||||
menu_item_class->hide_on_activate = FALSE;
|
||||
|
||||
klass->toggled = NULL;
|
||||
klass->draw_indicator = gtk_real_check_menu_item_draw_indicator;
|
||||
|
||||
check_menu_item_signals[TOGGLED] =
|
||||
gtk_signal_new ("toggled",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkCheckMenuItemClass, toggled),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
gtk_object_class_add_signals (object_class, check_menu_item_signals, LAST_SIGNAL);
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_check_menu_item_new (void)
|
||||
{
|
||||
return GTK_WIDGET (gtk_type_new (gtk_check_menu_item_get_type ()));
|
||||
return GTK_WIDGET (gtk_type_new (GTK_TYPE_CHECK_MENU_ITEM));
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
@ -132,41 +165,6 @@ gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item)
|
||||
gtk_signal_emit (GTK_OBJECT (check_menu_item), check_menu_item_signals[TOGGLED]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkMenuItemClass *menu_item_class;
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
menu_item_class = (GtkMenuItemClass*) klass;
|
||||
|
||||
parent_class = gtk_type_class (gtk_menu_item_get_type ());
|
||||
|
||||
check_menu_item_signals[TOGGLED] =
|
||||
gtk_signal_new ("toggled",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkCheckMenuItemClass, toggled),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, check_menu_item_signals, LAST_SIGNAL);
|
||||
|
||||
widget_class->draw = gtk_check_menu_item_draw;
|
||||
widget_class->expose_event = gtk_check_menu_item_expose;
|
||||
|
||||
menu_item_class->activate = gtk_check_menu_item_activate;
|
||||
menu_item_class->toggle_size = 12;
|
||||
|
||||
menu_item_class->hide_on_activate = FALSE;
|
||||
|
||||
klass->toggled = NULL;
|
||||
klass->draw_indicator = gtk_real_check_menu_item_draw_indicator;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
|
||||
{
|
||||
|
@ -133,8 +133,7 @@ LIST_WIDTH (GtkCList * clist)
|
||||
|
||||
|
||||
/* Signals */
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
SELECT_ROW,
|
||||
UNSELECT_ROW,
|
||||
ROW_MOVE,
|
||||
@ -154,8 +153,7 @@ enum
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
SYNC_REMOVE,
|
||||
SYNC_INSERT
|
||||
};
|
||||
@ -168,7 +166,8 @@ enum {
|
||||
ARG_ROW_HEIGHT,
|
||||
ARG_TITLES_ACTIVE,
|
||||
ARG_REORDERABLE,
|
||||
ARG_USE_DRAG_ICONS
|
||||
ARG_USE_DRAG_ICONS,
|
||||
ARG_SORT_TYPE
|
||||
};
|
||||
|
||||
/* GtkCList Methods */
|
||||
@ -451,6 +450,7 @@ static void drag_dest_cell (GtkCList *clist,
|
||||
GtkCListDestInfo *dest_info);
|
||||
|
||||
|
||||
|
||||
static GtkContainerClass *parent_class = NULL;
|
||||
static guint clist_signals[LAST_SIGNAL] = {0};
|
||||
|
||||
@ -523,7 +523,10 @@ gtk_clist_class_init (GtkCListClass *klass)
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_USE_DRAG_ICONS);
|
||||
|
||||
gtk_object_add_arg_type ("GtkCList::sort_type",
|
||||
GTK_TYPE_SORT_TYPE,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_SORT_TYPE);
|
||||
object_class->set_arg = gtk_clist_set_arg;
|
||||
object_class->get_arg = gtk_clist_get_arg;
|
||||
object_class->destroy = gtk_clist_destroy;
|
||||
@ -852,7 +855,8 @@ gtk_clist_set_arg (GtkObject *object,
|
||||
case ARG_USE_DRAG_ICONS:
|
||||
gtk_clist_set_use_drag_icons (clist, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
default:
|
||||
case ARG_SORT_TYPE:
|
||||
gtk_clist_set_sort_type (clist, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -898,6 +902,9 @@ gtk_clist_get_arg (GtkObject *object,
|
||||
case ARG_USE_DRAG_ICONS:
|
||||
GTK_VALUE_BOOL (*arg) = GTK_CLIST_USE_DRAG_ICONS (clist);
|
||||
break;
|
||||
case ARG_SORT_TYPE:
|
||||
GTK_VALUE_ENUM (*arg) = clist->sort_type;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
@ -1296,8 +1303,6 @@ void
|
||||
gtk_clist_column_title_active (GtkCList *clist,
|
||||
gint column)
|
||||
{
|
||||
GtkObject *object;
|
||||
|
||||
g_return_if_fail (clist != NULL);
|
||||
g_return_if_fail (GTK_IS_CLIST (clist));
|
||||
|
||||
@ -2736,8 +2741,7 @@ real_remove_row (GtkCList *clist,
|
||||
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
||||
row, -1, NULL);
|
||||
|
||||
/* reset the row end pointer if we're removing at the
|
||||
* end of the list */
|
||||
/* reset the row end pointer if we're removing at the end of the list */
|
||||
clist->rows--;
|
||||
if (clist->row_list == list)
|
||||
clist->row_list = g_list_next (list);
|
||||
@ -3871,7 +3875,7 @@ real_undo_selection (GtkCList *clist)
|
||||
|
||||
for (work = clist->undo_unselection; work; work = work->next)
|
||||
{
|
||||
g_print ("unselect %d\n",GPOINTER_TO_INT (work->data));
|
||||
/* g_print ("unselect %d\n",GPOINTER_TO_INT (work->data)); */
|
||||
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
||||
GPOINTER_TO_INT (work->data), -1, NULL);
|
||||
}
|
||||
@ -4511,7 +4515,8 @@ gtk_clist_realize (GtkWidget *widget)
|
||||
/* We'll use this gc to do scrolling as well */
|
||||
gdk_gc_set_exposures (clist->fg_gc, TRUE);
|
||||
|
||||
values.foreground = widget->style->white;
|
||||
values.foreground = (widget->style->white.pixel==0 ?
|
||||
widget->style->black:widget->style->white);
|
||||
values.function = GDK_XOR;
|
||||
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
|
||||
clist->xor_gc = gdk_gc_new_with_values (widget->window,
|
||||
@ -4755,7 +4760,7 @@ gtk_clist_draw (GtkWidget *widget,
|
||||
(2 * widget->style->klass->ythickness) +
|
||||
clist->column_title_area.height);
|
||||
|
||||
gdk_window_clear_area (clist->clist_window, 0, 0, -1, -1);
|
||||
gdk_window_clear_area (clist->clist_window, 0, 0, 0, 0);
|
||||
draw_rows (clist, NULL);
|
||||
|
||||
for (i = 0; i < clist->columns; i++)
|
||||
@ -5948,8 +5953,8 @@ draw_rows (GtkCList *clist,
|
||||
}
|
||||
|
||||
if (!area)
|
||||
gdk_window_clear_area (clist->clist_window,
|
||||
0, ROW_TOP_YPIXEL (clist, i), -1, -1);
|
||||
gdk_window_clear_area (clist->clist_window, 0,
|
||||
ROW_TOP_YPIXEL (clist, i), 0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -6049,7 +6054,8 @@ adjust_adjustments (GtkCList *clist,
|
||||
clist->vadjustment->lower = 0;
|
||||
clist->vadjustment->upper = LIST_HEIGHT (clist);
|
||||
|
||||
if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist))
|
||||
if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist) ||
|
||||
(clist->voffset + (gint)clist->vadjustment->value) != 0)
|
||||
{
|
||||
clist->vadjustment->value = MAX (0, (LIST_HEIGHT (clist) -
|
||||
clist->clist_window_height));
|
||||
@ -6067,7 +6073,8 @@ adjust_adjustments (GtkCList *clist,
|
||||
clist->hadjustment->lower = 0;
|
||||
clist->hadjustment->upper = LIST_WIDTH (clist);
|
||||
|
||||
if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist))
|
||||
if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist) ||
|
||||
(clist->hoffset + (gint)clist->hadjustment->value) != 0)
|
||||
{
|
||||
clist->hadjustment->value = MAX (0, (LIST_WIDTH (clist) -
|
||||
clist->clist_window_width));
|
||||
|
@ -42,8 +42,7 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* clist flags */
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
GTK_CLIST_IN_DRAG = 1 << 0,
|
||||
GTK_CLIST_ROW_HEIGHT_SET = 1 << 1,
|
||||
GTK_CLIST_SHOW_TITLES = 1 << 2,
|
||||
|
@ -62,32 +62,34 @@
|
||||
#define SAMPLE_HEIGHT 28
|
||||
|
||||
static void gtk_color_selection_class_init (GtkColorSelectionClass *klass);
|
||||
static void gtk_color_selection_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_color_selection_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_color_selection_init (GtkColorSelection *colorsel);
|
||||
static void gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass);
|
||||
static void gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag);
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
COLOR_CHANGED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
RGB_INPUTS = 1 << 0,
|
||||
HSV_INPUTS = 1 << 1,
|
||||
OPACITY_INPUTS = 1 << 2
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
SCALE,
|
||||
ENTRY,
|
||||
BOTH
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
HUE,
|
||||
SATURATION,
|
||||
VALUE,
|
||||
@ -98,6 +100,12 @@ enum
|
||||
NUM_CHANNELS
|
||||
};
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_UPDATE_POLICY,
|
||||
ARG_USE_OPACITY
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gchar *label;
|
||||
@ -238,7 +246,7 @@ gtk_color_selection_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
color_selection_type = gtk_type_unique (gtk_vbox_get_type (), &colorsel_info);
|
||||
color_selection_type = gtk_type_unique (GTK_TYPE_VBOX, &colorsel_info);
|
||||
}
|
||||
|
||||
return color_selection_type;
|
||||
@ -255,7 +263,12 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
container_class = (GtkContainerClass*) klass;
|
||||
|
||||
color_selection_parent_class = gtk_type_class (gtk_vbox_get_type ());
|
||||
color_selection_parent_class = gtk_type_class (GTK_TYPE_VBOX);
|
||||
|
||||
gtk_object_add_arg_type ("GtkColorSelection::policy", GTK_TYPE_UPDATE_TYPE,
|
||||
GTK_ARG_READWRITE, ARG_UPDATE_POLICY);
|
||||
gtk_object_add_arg_type ("GtkColorSelection::use_opacity", GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE, ARG_USE_OPACITY);
|
||||
|
||||
color_selection_signals[COLOR_CHANGED] =
|
||||
gtk_signal_new ("color_changed",
|
||||
@ -266,6 +279,8 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
|
||||
gtk_object_class_add_signals (object_class, color_selection_signals, LAST_SIGNAL);
|
||||
|
||||
object_class->set_arg = gtk_color_selection_set_arg;
|
||||
object_class->get_arg = gtk_color_selection_get_arg;
|
||||
object_class->finalize = gtk_color_selection_finalize;
|
||||
|
||||
widget_class->realize = gtk_color_selection_realize;
|
||||
@ -445,12 +460,52 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
gtk_widget_show (hbox);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_selection_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkColorSelection *color_selection = GTK_COLOR_SELECTION (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_UPDATE_POLICY:
|
||||
gtk_color_selection_set_update_policy (color_selection, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
case ARG_USE_OPACITY:
|
||||
gtk_color_selection_set_opacity (color_selection, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_color_selection_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkColorSelection *color_selection;
|
||||
|
||||
color_selection = GTK_COLOR_SELECTION (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_UPDATE_POLICY:
|
||||
GTK_VALUE_ENUM (*arg) = color_selection->policy;
|
||||
break;
|
||||
case ARG_USE_OPACITY:
|
||||
GTK_VALUE_BOOL (*arg) = color_selection->use_opacity;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_color_selection_new (void)
|
||||
{
|
||||
GtkColorSelection *colorsel;
|
||||
|
||||
colorsel = gtk_type_new (gtk_color_selection_get_type ());
|
||||
colorsel = gtk_type_new (GTK_TYPE_COLOR_SELECTION);
|
||||
|
||||
return GTK_WIDGET (colorsel);
|
||||
}
|
||||
@ -1145,10 +1200,14 @@ gtk_color_selection_wheel_timeout (GtkColorSelection *colorsel)
|
||||
{
|
||||
gint x, y;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
gdk_window_get_pointer (colorsel->wheel_area->window, &x, &y, NULL);
|
||||
gtk_color_selection_update_wheel (colorsel, x, y);
|
||||
gtk_color_selection_color_changed (colorsel);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
@ -1255,7 +1314,7 @@ gtk_color_selection_draw_value_bar (GtkColorSelection *colorsel,
|
||||
}
|
||||
|
||||
v = 1.0;
|
||||
sv = 1.0 / (gdouble) (heig - 1);
|
||||
sv = 1.0 / (gdouble) MAX (heig - 1, 0);
|
||||
|
||||
for (y = 0; y < heig; y++)
|
||||
{
|
||||
@ -1599,10 +1658,10 @@ gtk_color_selection_rgb_to_hsv (gdouble r, gdouble g, gdouble b,
|
||||
/* GtkColorSelectionDialog */
|
||||
/***************************/
|
||||
|
||||
guint
|
||||
GtkType
|
||||
gtk_color_selection_dialog_get_type (void)
|
||||
{
|
||||
static guint color_selection_dialog_type = 0;
|
||||
static GtkType color_selection_dialog_type = 0;
|
||||
|
||||
if (!color_selection_dialog_type)
|
||||
{
|
||||
@ -1618,7 +1677,7 @@ gtk_color_selection_dialog_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
color_selection_dialog_type = gtk_type_unique (gtk_window_get_type (), &colorsel_diag_info);
|
||||
color_selection_dialog_type = gtk_type_unique (GTK_TYPE_WINDOW, &colorsel_diag_info);
|
||||
}
|
||||
|
||||
return color_selection_dialog_type;
|
||||
@ -1631,7 +1690,7 @@ gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
|
||||
color_selection_dialog_parent_class = gtk_type_class (gtk_window_get_type ());
|
||||
color_selection_dialog_parent_class = gtk_type_class (GTK_TYPE_WINDOW);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1690,7 +1749,7 @@ gtk_color_selection_dialog_new (const gchar *title)
|
||||
{
|
||||
GtkColorSelectionDialog *colorseldiag;
|
||||
|
||||
colorseldiag = gtk_type_new (gtk_color_selection_dialog_get_type ());
|
||||
colorseldiag = gtk_type_new (GTK_TYPE_COLOR_SELECTION_DIALOG);
|
||||
gtk_window_set_title (GTK_WINDOW (colorseldiag), title);
|
||||
|
||||
return GTK_WIDGET (colorseldiag);
|
||||
|
@ -50,14 +50,17 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_COLOR_SELECTION(obj) GTK_CHECK_CAST (obj, gtk_color_selection_get_type (), GtkColorSelection)
|
||||
#define GTK_COLOR_SELECTION_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_get_type (), GtkColorSelectionClass)
|
||||
#define GTK_IS_COLOR_SELECTION(obj) GTK_CHECK_TYPE (obj, gtk_color_selection_get_type ())
|
||||
|
||||
#define GTK_COLOR_SELECTION_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialog)
|
||||
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_color_selection_dialog_get_type (), GtkColorSelectionDialogClass)
|
||||
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_color_selection_dialog_get_type ())
|
||||
#define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ())
|
||||
#define GTK_COLOR_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection))
|
||||
#define GTK_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
|
||||
#define GTK_IS_COLOR_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
|
||||
#define GTK_IS_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION))
|
||||
|
||||
#define GTK_TYPE_COLOR_SELECTION_DIALOG (gtk_color_selection_dialog_get_type ())
|
||||
#define GTK_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialog))
|
||||
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass))
|
||||
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG))
|
||||
#define GTK_IS_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG))
|
||||
|
||||
typedef struct _GtkColorSelection GtkColorSelection;
|
||||
typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
|
||||
@ -140,7 +143,7 @@ void gtk_color_selection_get_color (GtkColorSelection *colorse
|
||||
|
||||
/* ColorSelectionDialog */
|
||||
|
||||
guint gtk_color_selection_dialog_get_type (void);
|
||||
GtkType gtk_color_selection_dialog_get_type (void);
|
||||
|
||||
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
|
||||
|
||||
|
@ -44,7 +44,8 @@ enum {
|
||||
ARG_0,
|
||||
ARG_BORDER_WIDTH,
|
||||
ARG_RESIZE_MODE,
|
||||
ARG_CHILD
|
||||
ARG_CHILD,
|
||||
ARG_REALLOCATE_REDRAWS
|
||||
};
|
||||
|
||||
typedef struct _GtkChildArgInfo GtkChildArgInfo;
|
||||
@ -167,6 +168,7 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
|
||||
gtk_object_add_arg_type ("GtkContainer::resize_mode", GTK_TYPE_RESIZE_MODE, GTK_ARG_READWRITE, ARG_RESIZE_MODE);
|
||||
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, GTK_ARG_WRITABLE, ARG_CHILD);
|
||||
gtk_object_add_arg_type ("GtkContainer::reallocate_redraws", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_REALLOCATE_REDRAWS);
|
||||
|
||||
container_signals[ADD] =
|
||||
gtk_signal_new ("add",
|
||||
@ -607,6 +609,7 @@ gtk_container_init (GtkContainer *container)
|
||||
container->border_width = 0;
|
||||
container->need_resize = FALSE;
|
||||
container->resize_mode = GTK_RESIZE_PARENT;
|
||||
container->reallocate_redraws = FALSE;
|
||||
container->resize_widgets = NULL;
|
||||
}
|
||||
|
||||
@ -621,10 +624,8 @@ gtk_container_destroy (GtkObject *object)
|
||||
container = GTK_CONTAINER (object);
|
||||
|
||||
if (GTK_CONTAINER_RESIZE_PENDING (container))
|
||||
{
|
||||
container_resize_queue = g_slist_remove (container_resize_queue, container);
|
||||
GTK_PRIVATE_UNSET_FLAG (container, GTK_RESIZE_PENDING);
|
||||
}
|
||||
gtk_container_dequeue_resize_handler (container);
|
||||
if (container->resize_widgets)
|
||||
gtk_container_clear_resize_widgets (container);
|
||||
|
||||
gtk_container_foreach (container, (GtkCallback) gtk_widget_destroy, NULL);
|
||||
@ -650,6 +651,9 @@ gtk_container_set_arg (GtkObject *object,
|
||||
case ARG_RESIZE_MODE:
|
||||
gtk_container_set_resize_mode (container, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
case ARG_REALLOCATE_REDRAWS:
|
||||
gtk_container_set_reallocate_redraws (container, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
case ARG_CHILD:
|
||||
gtk_container_add (container, GTK_WIDGET (GTK_VALUE_OBJECT (*arg)));
|
||||
break;
|
||||
@ -675,6 +679,9 @@ gtk_container_get_arg (GtkObject *object,
|
||||
case ARG_RESIZE_MODE:
|
||||
GTK_VALUE_ENUM (*arg) = container->resize_mode;
|
||||
break;
|
||||
case ARG_REALLOCATE_REDRAWS:
|
||||
GTK_VALUE_BOOL (*arg) = container->reallocate_redraws;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
@ -725,6 +732,16 @@ gtk_container_remove (GtkContainer *container,
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[REMOVE], widget);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_dequeue_resize_handler (GtkContainer *container)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
g_return_if_fail (GTK_CONTAINER_RESIZE_PENDING (container));
|
||||
|
||||
container_resize_queue = g_slist_remove (container_resize_queue, container);
|
||||
GTK_PRIVATE_UNSET_FLAG (container, GTK_RESIZE_PENDING);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_clear_resize_widgets (GtkContainer *container)
|
||||
{
|
||||
@ -735,11 +752,6 @@ gtk_container_clear_resize_widgets (GtkContainer *container)
|
||||
|
||||
node = container->resize_widgets;
|
||||
|
||||
if (node)
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (container),
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
|
||||
while (node)
|
||||
{
|
||||
GtkWidget *widget = node->data;
|
||||
@ -778,6 +790,21 @@ gtk_container_set_resize_mode (GtkContainer *container,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_set_reallocate_redraws (GtkContainer *container,
|
||||
gboolean needs_redraws)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
|
||||
needs_redraws = needs_redraws ? TRUE : FALSE;
|
||||
if (needs_redraws != container->reallocate_redraws)
|
||||
{
|
||||
container->reallocate_redraws = needs_redraws;
|
||||
if (container->reallocate_redraws)
|
||||
gtk_widget_queue_draw (GTK_WIDGET (container));
|
||||
}
|
||||
}
|
||||
|
||||
static GtkContainer*
|
||||
gtk_container_get_resize_container (GtkContainer *container)
|
||||
{
|
||||
@ -833,18 +860,23 @@ gtk_container_queue_resize (GtkContainer *container)
|
||||
g_return_if_fail (container != NULL);
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
|
||||
/* clear resize widgets for resize containers
|
||||
* before aborting prematurely. this is especially
|
||||
* important for toplevels which may need imemdiate
|
||||
* processing or their resize handler to be queued.
|
||||
*/
|
||||
if (GTK_IS_RESIZE_CONTAINER (container))
|
||||
gtk_container_clear_resize_widgets (container);
|
||||
if (GTK_OBJECT_DESTROYED (container) ||
|
||||
GTK_WIDGET_RESIZE_NEEDED (container))
|
||||
return;
|
||||
|
||||
if (GTK_IS_RESIZE_CONTAINER (container))
|
||||
gtk_container_clear_resize_widgets (container);
|
||||
|
||||
resize_container = gtk_container_get_resize_container (container);
|
||||
|
||||
if (resize_container)
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (resize_container))
|
||||
if (GTK_WIDGET_VISIBLE (resize_container) &&
|
||||
(GTK_WIDGET_TOPLEVEL (resize_container) || GTK_WIDGET_DRAWABLE (resize_container)))
|
||||
{
|
||||
switch (resize_container->resize_mode)
|
||||
{
|
||||
@ -860,40 +892,29 @@ gtk_container_queue_resize (GtkContainer *container)
|
||||
}
|
||||
|
||||
GTK_PRIVATE_SET_FLAG (container, GTK_RESIZE_NEEDED);
|
||||
if (!resize_container->resize_widgets)
|
||||
gtk_signal_connect (GTK_OBJECT (resize_container),
|
||||
"size_allocate",
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
resize_container->resize_widgets =
|
||||
g_slist_prepend (resize_container->resize_widgets, container);
|
||||
break;
|
||||
|
||||
case GTK_RESIZE_IMMEDIATE:
|
||||
GTK_PRIVATE_SET_FLAG (container, GTK_RESIZE_NEEDED);
|
||||
if (!resize_container->resize_widgets)
|
||||
gtk_signal_connect (GTK_OBJECT (resize_container),
|
||||
"size_allocate",
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
resize_container->resize_widgets =
|
||||
g_slist_prepend (resize_container->resize_widgets, container);
|
||||
gtk_container_check_resize (resize_container);
|
||||
break;
|
||||
|
||||
case GTK_RESIZE_PARENT:
|
||||
/* Ignore */
|
||||
/* Ignore, should not be reached */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We need to let hidden toplevels know that something
|
||||
* changed while they where hidden. For other resize containers,
|
||||
* they will get resized when they are shown.
|
||||
/* we need to let hidden resize containers know that something
|
||||
* changed while they where hidden (currently only evaluated by
|
||||
* toplevels).
|
||||
*/
|
||||
if (GTK_WIDGET_TOPLEVEL (resize_container))
|
||||
gtk_container_check_resize (resize_container);
|
||||
resize_container->need_resize = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -976,7 +997,7 @@ gtk_container_resize_children (GtkContainer *container)
|
||||
* which is not the case if we got another container queued for
|
||||
* a resize in our anchestry. also we can skip the whole
|
||||
* resize_widgets checks if we are a toplevel and NEED_RESIZE.
|
||||
* this code implies that our allocation is sufficient for our
|
||||
* this code assumes that our allocation is sufficient for our
|
||||
* requisition, since otherwise we would NEED_RESIZE.
|
||||
*/
|
||||
resize_container = GTK_WIDGET (container);
|
||||
@ -1006,10 +1027,6 @@ gtk_container_resize_children (GtkContainer *container)
|
||||
* is insufficient, since we don't need to reallocate below that.
|
||||
*/
|
||||
resize_widgets = container->resize_widgets;
|
||||
if (resize_widgets)
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (container),
|
||||
GTK_SIGNAL_FUNC (gtk_container_clear_resize_widgets),
|
||||
NULL);
|
||||
container->resize_widgets = NULL;
|
||||
for (node = resize_widgets; node; node = node->next)
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ struct _GtkContainer
|
||||
guint border_width : 16;
|
||||
guint need_resize : 1;
|
||||
guint resize_mode : 2;
|
||||
|
||||
guint reallocate_redraws : 1;
|
||||
|
||||
/* The list of children that requested a resize
|
||||
*/
|
||||
@ -132,6 +132,8 @@ gint gtk_container_focus (GtkContainer *container,
|
||||
|
||||
/* Widget-level methods */
|
||||
|
||||
void gtk_container_set_reallocate_redraws (GtkContainer *container,
|
||||
gboolean needs_redraws);
|
||||
void gtk_container_set_focus_child (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
void gtk_container_set_focus_vadjustment (GtkContainer *container,
|
||||
@ -223,7 +225,7 @@ void gtk_container_forall (GtkContainer *container,
|
||||
gpointer callback_data);
|
||||
gchar* gtk_container_child_composite_name (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
|
||||
void gtk_container_dequeue_resize_handler (GtkContainer *container);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -992,7 +992,11 @@ draw_cell_pixmap (GdkWindow *window,
|
||||
if (width > 0 && height > 0)
|
||||
gdk_draw_pixmap (window, fg_gc, pixmap, xsrc, ysrc, x, y, width, height);
|
||||
|
||||
if (mask)
|
||||
{
|
||||
gdk_gc_set_clip_rectangle (fg_gc, NULL);
|
||||
gdk_gc_set_clip_origin (fg_gc, 0, 0);
|
||||
}
|
||||
|
||||
return x + MAX (width, 0);
|
||||
}
|
||||
@ -4136,9 +4140,13 @@ gtk_ctree_is_ancestor (GtkCTree *ctree,
|
||||
GtkCTreeNode *node,
|
||||
GtkCTreeNode *child)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
|
||||
if (GTK_CTREE_ROW (node)->children)
|
||||
return gtk_ctree_find (ctree, GTK_CTREE_ROW (node)->children, child);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GtkCTreeNode *
|
||||
|
@ -46,6 +46,15 @@
|
||||
GDK_BUTTON_RELEASE_MASK | \
|
||||
GDK_BUTTON1_MOTION_MASK)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_CURVE_TYPE,
|
||||
ARG_MIN_X,
|
||||
ARG_MAX_X,
|
||||
ARG_MIN_Y,
|
||||
ARG_MAX_Y
|
||||
};
|
||||
|
||||
static GtkDrawingAreaClass *parent_class = NULL;
|
||||
static guint curve_type_changed_signal = 0;
|
||||
|
||||
@ -53,6 +62,12 @@ static guint curve_type_changed_signal = 0;
|
||||
/* forward declarations: */
|
||||
static void gtk_curve_class_init (GtkCurveClass *class);
|
||||
static void gtk_curve_init (GtkCurve *curve);
|
||||
static void gtk_curve_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_curve_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_curve_finalize (GtkObject *object);
|
||||
static gint gtk_curve_graph_events (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
@ -78,7 +93,7 @@ gtk_curve_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
curve_type = gtk_type_unique (gtk_drawing_area_get_type (), &curve_info);
|
||||
curve_type = gtk_type_unique (GTK_TYPE_DRAWING_AREA, &curve_info);
|
||||
}
|
||||
return curve_type;
|
||||
}
|
||||
@ -88,17 +103,30 @@ gtk_curve_class_init (GtkCurveClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
|
||||
parent_class = gtk_type_class (gtk_drawing_area_get_type ());
|
||||
parent_class = gtk_type_class (GTK_TYPE_DRAWING_AREA);
|
||||
|
||||
object_class = (GtkObjectClass *) class;
|
||||
|
||||
object_class->set_arg = gtk_curve_set_arg;
|
||||
object_class->get_arg = gtk_curve_get_arg;
|
||||
object_class->finalize = gtk_curve_finalize;
|
||||
|
||||
curve_type_changed_signal =
|
||||
gtk_signal_new ("curve_type_changed", GTK_RUN_FIRST, object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkCurveClass, curve_type_changed),
|
||||
gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0);
|
||||
gtk_object_class_add_signals (object_class, &curve_type_changed_signal, 1);
|
||||
|
||||
object_class->finalize = gtk_curve_finalize;
|
||||
gtk_object_add_arg_type ("GtkCurve::curve_type", GTK_TYPE_CURVE_TYPE,
|
||||
GTK_ARG_READWRITE, ARG_CURVE_TYPE);
|
||||
gtk_object_add_arg_type ("GtkCurve::min_x", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_MIN_X);
|
||||
gtk_object_add_arg_type ("GtkCurve::max_x", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_MAX_X);
|
||||
gtk_object_add_arg_type ("GtkCurve::min_y", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_MIN_Y);
|
||||
gtk_object_add_arg_type ("GtkCurve::max_y", GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE, ARG_MAX_Y);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -130,6 +158,67 @@ gtk_curve_init (GtkCurve *curve)
|
||||
gtk_curve_size_graph (curve);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_curve_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkCurve *curve = GTK_CURVE (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_CURVE_TYPE:
|
||||
gtk_curve_set_curve_type (curve, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
case ARG_MIN_X:
|
||||
gtk_curve_set_range (curve, GTK_VALUE_FLOAT (*arg), curve->max_x,
|
||||
curve->min_y, curve->max_y);
|
||||
break;
|
||||
case ARG_MAX_X:
|
||||
gtk_curve_set_range (curve, curve->min_x, GTK_VALUE_FLOAT (*arg),
|
||||
curve->min_y, curve->max_y);
|
||||
break;
|
||||
case ARG_MIN_Y:
|
||||
gtk_curve_set_range (curve, curve->min_x, curve->max_x,
|
||||
GTK_VALUE_FLOAT (*arg), curve->max_y);
|
||||
break;
|
||||
case ARG_MAX_Y:
|
||||
gtk_curve_set_range (curve, curve->min_x, curve->max_x,
|
||||
curve->min_y, GTK_VALUE_FLOAT (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_curve_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkCurve *curve = GTK_CURVE (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_CURVE_TYPE:
|
||||
GTK_VALUE_ENUM (*arg) = curve->curve_type;
|
||||
break;
|
||||
case ARG_MIN_X:
|
||||
GTK_VALUE_FLOAT (*arg) = curve->min_x;
|
||||
break;
|
||||
case ARG_MAX_X:
|
||||
GTK_VALUE_FLOAT (*arg) = curve->max_x;
|
||||
break;
|
||||
case ARG_MIN_Y:
|
||||
GTK_VALUE_FLOAT (*arg) = curve->min_y;
|
||||
break;
|
||||
case ARG_MAX_Y:
|
||||
GTK_VALUE_FLOAT (*arg) = curve->max_y;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
project (gfloat value, gfloat min, gfloat max, int norm)
|
||||
{
|
||||
|
396
gtk/gtkdnd.c
396
gtk/gtkdnd.c
@ -25,6 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "gdkx.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
|
||||
#include "gtkdnd.h"
|
||||
#include "gtkinvisible.h"
|
||||
@ -228,9 +229,16 @@ static void gtk_drag_selection_get (GtkWidget *widget,
|
||||
static gint gtk_drag_anim_timeout (gpointer data);
|
||||
static void gtk_drag_remove_icon (GtkDragSourceInfo *info);
|
||||
static void gtk_drag_source_info_destroy (gpointer data);
|
||||
static void gtk_drag_update (GtkDragSourceInfo *info,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkEvent *event);
|
||||
static gint gtk_drag_motion_cb (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data);
|
||||
static gint gtk_drag_key_cb (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer data);
|
||||
static gint gtk_drag_button_release_cb (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
@ -242,70 +250,70 @@ static gint gtk_drag_abort_timeout (gpointer data);
|
||||
|
||||
#define action_ask_width 16
|
||||
#define action_ask_height 16
|
||||
static const char action_ask_bits[] = {
|
||||
static const guchar action_ask_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x76, 0xf8, 0xb6, 0xf7,
|
||||
0xd6, 0xec, 0x66, 0xdb, 0x66, 0xdb, 0x96, 0xec, 0x76, 0xf7, 0x76, 0xfb,
|
||||
0xf6, 0xfc, 0x72, 0xfb, 0x7a, 0xfb, 0xf8, 0xfc, };
|
||||
|
||||
#define action_ask_mask_width 16
|
||||
#define action_ask_mask_height 16
|
||||
static const char action_ask_mask_bits[] = {
|
||||
static const guchar action_ask_mask_bits[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x8f, 0x07, 0xcf, 0x0f,
|
||||
0xef, 0x1f, 0xff, 0x3c, 0xff, 0x3c, 0x6f, 0x1f, 0x8f, 0x0f, 0x8f, 0x07,
|
||||
0x0f, 0x03, 0x8f, 0x07, 0x87, 0x07, 0x07, 0x03, };
|
||||
|
||||
#define action_copy_width 16
|
||||
#define action_copy_height 16
|
||||
static const char action_copy_bits[] = {
|
||||
static const guchar action_copy_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x76, 0xfb, 0x76, 0xfb,
|
||||
0x76, 0xfb, 0x06, 0x83, 0xf6, 0xbf, 0xf6, 0xbf, 0x06, 0x83, 0x76, 0xfb,
|
||||
0x76, 0xfb, 0x72, 0xfb, 0x7a, 0xf8, 0xf8, 0xff, };
|
||||
|
||||
#define action_copy_mask_width 16
|
||||
#define action_copy_mask_height 16
|
||||
static const char action_copy_mask_bits[] = {
|
||||
static const guchar action_copy_mask_bits[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x8f, 0x07, 0x8f, 0x07,
|
||||
0x8f, 0x07, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x8f, 0x07,
|
||||
0x8f, 0x07, 0x8f, 0x07, 0x87, 0x07, 0x07, 0x00, };
|
||||
|
||||
#define action_move_width 16
|
||||
#define action_move_height 16
|
||||
static const char action_move_bits[] = {
|
||||
static const guchar action_move_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x96, 0xff, 0x26, 0xff,
|
||||
0xc6, 0xf8, 0xd6, 0xe3, 0x96, 0x8f, 0xb6, 0xbf, 0x36, 0xc3, 0x76, 0xfb,
|
||||
0x76, 0xfa, 0xf2, 0xfa, 0xfa, 0xf8, 0xf8, 0xff, };
|
||||
|
||||
#define action_move_mask_width 16
|
||||
#define action_move_mask_height 16
|
||||
static const char action_move_mask_bits[] = {
|
||||
static const guchar action_move_mask_bits[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x6f, 0x00, 0xff, 0x00,
|
||||
0xff, 0x07, 0xef, 0x1f, 0xef, 0x7f, 0xcf, 0x7f, 0xcf, 0x3f, 0x8f, 0x07,
|
||||
0x8f, 0x07, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x00, };
|
||||
|
||||
#define action_link_width 16
|
||||
#define action_link_height 16
|
||||
static const char action_link_bits[] = {
|
||||
static const guchar action_link_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x36, 0xf8, 0xd6, 0xf7,
|
||||
0x66, 0xec, 0xa6, 0xe8, 0x26, 0xdf, 0xe6, 0xbd, 0xd6, 0xa7, 0xb6, 0xa8,
|
||||
0xb6, 0xb1, 0x72, 0xdf, 0xfa, 0xe0, 0xf8, 0xff, };
|
||||
|
||||
#define action_link_mask_width 16
|
||||
#define action_link_mask_height 16
|
||||
static const char action_link_mask_bits[] = {
|
||||
static const guchar action_link_mask_bits[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xcf, 0x07, 0xef, 0x0f,
|
||||
0xff, 0x1f, 0x7f, 0x1f, 0xff, 0x3f, 0xff, 0x7f, 0xef, 0x7f, 0xcf, 0x77,
|
||||
0xcf, 0x7f, 0x8f, 0x3f, 0x07, 0x1f, 0x07, 0x00, };
|
||||
|
||||
#define action_none_width 16
|
||||
#define action_none_height 16
|
||||
static const char action_none_bits[] = {
|
||||
static const guchar action_none_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0xf6, 0xff, 0xf6, 0xff,
|
||||
0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff,
|
||||
0xf6, 0xff, 0xf2, 0xff, 0xfa, 0xff, 0xf8, 0xff, };
|
||||
|
||||
#define action_none_mask_width 16
|
||||
#define action_none_mask_height 16
|
||||
static const char action_none_mask_bits[] = {
|
||||
static const guchar action_none_mask_bits[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x00, 0x0f, 0x00,
|
||||
0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00,
|
||||
0x0f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x07, 0x00, };
|
||||
@ -416,6 +424,43 @@ gtk_drag_release_ipc_widget (GtkWidget *widget)
|
||||
drag_widgets = g_slist_prepend (drag_widgets, widget);
|
||||
}
|
||||
|
||||
static guint32
|
||||
gtk_drag_get_event_time (GdkEvent *event)
|
||||
{
|
||||
guint32 tm = GDK_CURRENT_TIME;
|
||||
|
||||
if (event)
|
||||
switch (event->type)
|
||||
{
|
||||
case GDK_MOTION_NOTIFY:
|
||||
tm = event->motion.time; break;
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_2BUTTON_PRESS:
|
||||
case GDK_3BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
tm = event->button.time; break;
|
||||
case GDK_KEY_PRESS:
|
||||
case GDK_KEY_RELEASE:
|
||||
tm = event->key.time; break;
|
||||
case GDK_ENTER_NOTIFY:
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
tm = event->crossing.time; break;
|
||||
case GDK_PROPERTY_NOTIFY:
|
||||
tm = event->property.time; break;
|
||||
case GDK_SELECTION_CLEAR:
|
||||
case GDK_SELECTION_REQUEST:
|
||||
case GDK_SELECTION_NOTIFY:
|
||||
tm = event->selection.time; break;
|
||||
case GDK_PROXIMITY_IN:
|
||||
case GDK_PROXIMITY_OUT:
|
||||
tm = event->proximity.time; break;
|
||||
default: /* use current time */
|
||||
break;
|
||||
}
|
||||
|
||||
return tm;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_drag_get_event_actions (GdkEvent *event,
|
||||
gint button,
|
||||
@ -953,7 +998,17 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
|
||||
gint tx, ty;
|
||||
|
||||
if (event->type == GDK_DROP_START)
|
||||
{
|
||||
info->dropped = TRUE;
|
||||
/* We send a leave here so that the widget unhighlights
|
||||
* properly.
|
||||
*/
|
||||
if (info->widget)
|
||||
{
|
||||
gtk_drag_dest_leave (info->widget, context, event->dnd.time);
|
||||
info->widget = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gdk_window_get_origin (toplevel->window, &tx, &ty);
|
||||
|
||||
@ -969,11 +1024,7 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
|
||||
|
||||
gtk_drag_find_widget (toplevel, &data);
|
||||
|
||||
/* We send a leave here so that the widget unhighlights
|
||||
* properly
|
||||
*/
|
||||
if (info->widget &&
|
||||
((event->type == GDK_DROP_START) || (!data.found)))
|
||||
if (info->widget && !data.found)
|
||||
{
|
||||
gtk_drag_dest_leave (info->widget, context, event->dnd.time);
|
||||
info->widget = NULL;
|
||||
@ -986,7 +1037,7 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
|
||||
if (!data.found)
|
||||
gdk_drag_status (context, 0, event->dnd.time);
|
||||
}
|
||||
else if (event->type == GDK_DROP_START)
|
||||
else if (event->type == GDK_DROP_START && !info->proxy_source)
|
||||
{
|
||||
gdk_drop_reply (context, data.found, event->dnd.time);
|
||||
if ((context->protocol == GDK_DRAG_PROTO_MOTIF) && !data.found)
|
||||
@ -1332,7 +1383,7 @@ gtk_drag_dest_leave (GtkWidget *widget,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (site->flags & GTK_DEST_DEFAULT_HIGHLIGHT)
|
||||
if ((site->flags & GTK_DEST_DEFAULT_HIGHLIGHT) && site->have_drag)
|
||||
gtk_drag_unhighlight (widget);
|
||||
|
||||
if (!(site->flags & GTK_DEST_DEFAULT_MOTION) || site->have_drag)
|
||||
@ -1645,16 +1696,6 @@ gtk_drag_begin (GtkWidget *widget,
|
||||
gtk_signal_emit_by_name (GTK_OBJECT (widget), "drag_begin",
|
||||
info->context);
|
||||
|
||||
/* We use a GTK grab here to override any grabs that the widget
|
||||
* we are dragging from might have held
|
||||
*/
|
||||
|
||||
gtk_grab_add (info->ipc_widget);
|
||||
gdk_pointer_grab (info->ipc_widget->window, FALSE,
|
||||
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK, NULL,
|
||||
info->cursor, time);
|
||||
|
||||
if (event->type == GDK_MOTION_NOTIFY)
|
||||
gtk_drag_motion_cb (info->ipc_widget, (GdkEventMotion *)event, info);
|
||||
|
||||
@ -1665,9 +1706,37 @@ gtk_drag_begin (GtkWidget *widget,
|
||||
GTK_SIGNAL_FUNC (gtk_drag_button_release_cb), info);
|
||||
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "motion_notify_event",
|
||||
GTK_SIGNAL_FUNC (gtk_drag_motion_cb), info);
|
||||
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "key_press_event",
|
||||
GTK_SIGNAL_FUNC (gtk_drag_key_cb), info);
|
||||
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "key_release_event",
|
||||
GTK_SIGNAL_FUNC (gtk_drag_key_cb), info);
|
||||
gtk_signal_connect (GTK_OBJECT (info->ipc_widget), "selection_get",
|
||||
GTK_SIGNAL_FUNC (gtk_drag_selection_get), info);
|
||||
|
||||
/* We use a GTK grab here to override any grabs that the widget
|
||||
* we are dragging from might have held
|
||||
*/
|
||||
gtk_grab_add (info->ipc_widget);
|
||||
if (gdk_pointer_grab (info->ipc_widget->window, FALSE,
|
||||
GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK, NULL,
|
||||
info->cursor, time) == 0)
|
||||
{
|
||||
if (gdk_keyboard_grab (info->ipc_widget->window, FALSE, time) != 0)
|
||||
{
|
||||
/* FIXME: This should be cleaned up... */
|
||||
GdkEventButton ev;
|
||||
|
||||
ev.time = time;
|
||||
ev.type = GDK_BUTTON_RELEASE;
|
||||
ev.button = info->button;
|
||||
|
||||
gtk_drag_button_release_cb (widget, &ev, info);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return info->context;
|
||||
}
|
||||
|
||||
@ -1937,7 +2006,7 @@ gtk_drag_set_icon_default (GdkDragContext *context)
|
||||
gdk_pixmap_colormap_create_from_xpm_d (NULL,
|
||||
default_icon_colormap,
|
||||
&default_icon_mask,
|
||||
NULL, drag_default_xpm);
|
||||
NULL, (gchar **)drag_default_xpm);
|
||||
default_icon_hot_x = -2;
|
||||
default_icon_hot_y = -2;
|
||||
}
|
||||
@ -2032,8 +2101,14 @@ gtk_drag_source_handle_event (GtkWidget *widget,
|
||||
{
|
||||
if (info->proxy_dest->proxy_drop_wait)
|
||||
{
|
||||
gboolean result = context->action != 0;
|
||||
|
||||
/* Aha - we can finally pass the MOTIF DROP on... */
|
||||
gdk_drop_reply (info->proxy_dest->context, result, info->proxy_dest->proxy_drop_time);
|
||||
if (result)
|
||||
gdk_drag_drop (info->context, info->proxy_dest->proxy_drop_time);
|
||||
else
|
||||
gtk_drag_finish (info->proxy_dest->context, FALSE, FALSE, info->proxy_dest->proxy_drop_time);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2066,9 +2141,9 @@ gtk_drag_source_handle_event (GtkWidget *widget,
|
||||
|
||||
if (info->last_event)
|
||||
{
|
||||
gtk_drag_motion_cb (info->widget,
|
||||
(GdkEventMotion *)info->last_event,
|
||||
info);
|
||||
gtk_drag_update (info,
|
||||
info->cur_x, info->cur_y,
|
||||
info->last_event);
|
||||
info->last_event = NULL;
|
||||
}
|
||||
}
|
||||
@ -2507,6 +2582,124 @@ gtk_drag_source_info_destroy (gpointer data)
|
||||
g_free (info);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gtk_drag_update:
|
||||
* Function to update the status of the drag when the
|
||||
* cursor moves or the modifier changes
|
||||
* arguments:
|
||||
* info: DragSourceInfo for the drag
|
||||
* x_root, y_root: position of darg
|
||||
* event: The event that triggered this call
|
||||
* results:
|
||||
*************************************************************/
|
||||
|
||||
static void
|
||||
gtk_drag_update (GtkDragSourceInfo *info,
|
||||
gint x_root,
|
||||
gint y_root,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GdkDragAction action;
|
||||
GdkDragAction possible_actions;
|
||||
GdkWindow *window = NULL;
|
||||
GdkWindow *dest_window;
|
||||
GdkDragProtocol protocol;
|
||||
GdkAtom selection;
|
||||
guint32 time = gtk_drag_get_event_time (event);
|
||||
|
||||
gtk_drag_get_event_actions (event,
|
||||
info->button,
|
||||
info->possible_actions,
|
||||
&action, &possible_actions);
|
||||
info->cur_x = x_root;
|
||||
info->cur_y = y_root;
|
||||
|
||||
if (info->icon_window)
|
||||
{
|
||||
gdk_window_raise (info->icon_window->window);
|
||||
gtk_widget_set_uposition (info->icon_window,
|
||||
info->cur_x - info->hot_x,
|
||||
info->cur_y - info->hot_y);
|
||||
window = info->icon_window->window;
|
||||
}
|
||||
|
||||
gdk_drag_find_window (info->context,
|
||||
window, x_root, y_root,
|
||||
&dest_window, &protocol);
|
||||
|
||||
if (gdk_drag_motion (info->context, dest_window, protocol,
|
||||
x_root, y_root, action,
|
||||
possible_actions,
|
||||
time))
|
||||
{
|
||||
if (info->last_event)
|
||||
gdk_event_free ((GdkEvent *)info->last_event);
|
||||
|
||||
info->last_event = gdk_event_copy ((GdkEvent *)event);
|
||||
}
|
||||
|
||||
if (dest_window)
|
||||
gdk_window_unref (dest_window);
|
||||
|
||||
selection = gdk_drag_get_selection (info->context);
|
||||
if (selection)
|
||||
gtk_drag_source_check_selection (info, selection, time);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gtk_drag_end:
|
||||
* Called when the user finishes to drag, either by
|
||||
* releasing the mouse, or by pressing Esc.
|
||||
* arguments:
|
||||
* widget: GtkInvisible widget for this drag
|
||||
* info:
|
||||
* results:
|
||||
*************************************************************/
|
||||
|
||||
static void
|
||||
gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
|
||||
{
|
||||
GdkEvent send_event;
|
||||
GtkWidget *source_widget = info->widget;
|
||||
|
||||
gdk_pointer_ungrab (time);
|
||||
gdk_keyboard_ungrab (time);
|
||||
|
||||
gtk_grab_remove (info->ipc_widget);
|
||||
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (info->ipc_widget),
|
||||
GTK_SIGNAL_FUNC (gtk_drag_button_release_cb),
|
||||
info);
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (info->ipc_widget),
|
||||
GTK_SIGNAL_FUNC (gtk_drag_motion_cb),
|
||||
info);
|
||||
|
||||
/* Send on a release pair to the the original
|
||||
* widget to convince it to release its grab. We need to
|
||||
* call gtk_propagate_event() here, instead of
|
||||
* gtk_widget_event() because widget like GtkList may
|
||||
* expect propagation.
|
||||
*/
|
||||
|
||||
send_event.button.type = GDK_BUTTON_RELEASE;
|
||||
send_event.button.window = GDK_ROOT_PARENT ();
|
||||
send_event.button.send_event = TRUE;
|
||||
send_event.button.time = time;
|
||||
send_event.button.x = 0;
|
||||
send_event.button.y = 0;
|
||||
send_event.button.pressure = 0.;
|
||||
send_event.button.xtilt = 0.;
|
||||
send_event.button.ytilt = 0.;
|
||||
send_event.button.state = 0;
|
||||
send_event.button.button = info->button;
|
||||
send_event.button.source = GDK_SOURCE_PEN;
|
||||
send_event.button.deviceid = GDK_CORE_POINTER;
|
||||
send_event.button.x_root = 0;
|
||||
send_event.button.y_root = 0;
|
||||
|
||||
gtk_propagate_event (source_widget, &send_event);
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gtk_drag_motion_cb:
|
||||
* "motion_notify_event" callback during drag.
|
||||
@ -2521,12 +2714,6 @@ gtk_drag_motion_cb (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
|
||||
GdkAtom selection;
|
||||
GdkDragAction action;
|
||||
GdkDragAction possible_actions;
|
||||
GdkWindow *window = NULL;
|
||||
GdkWindow *dest_window;
|
||||
GdkDragProtocol protocol;
|
||||
gint x_root, y_root;
|
||||
|
||||
if (event->is_hint)
|
||||
@ -2536,57 +2723,55 @@ gtk_drag_motion_cb (GtkWidget *widget,
|
||||
event->y_root = y_root;
|
||||
}
|
||||
|
||||
gtk_drag_get_event_actions ((GdkEvent *)event,
|
||||
info->button,
|
||||
info->possible_actions,
|
||||
&action, &possible_actions);
|
||||
|
||||
info->cur_x = event->x_root;
|
||||
info->cur_y = event->y_root;
|
||||
|
||||
if (info->icon_window)
|
||||
{
|
||||
gdk_window_raise (info->icon_window->window);
|
||||
gtk_widget_set_uposition (info->icon_window,
|
||||
info->cur_x - info->hot_x,
|
||||
info->cur_y - info->hot_y);
|
||||
window = info->icon_window->window;
|
||||
}
|
||||
|
||||
gdk_drag_find_window (info->context,
|
||||
window, event->x_root, event->y_root,
|
||||
&dest_window, &protocol);
|
||||
|
||||
if (gdk_drag_motion (info->context, dest_window, protocol,
|
||||
event->x_root, event->y_root, action,
|
||||
possible_actions,
|
||||
event->time))
|
||||
{
|
||||
if (info->last_event)
|
||||
gdk_event_free ((GdkEvent *)info->last_event);
|
||||
|
||||
info->last_event = gdk_event_copy ((GdkEvent *)event);
|
||||
}
|
||||
|
||||
if (dest_window)
|
||||
gdk_window_unref (dest_window);
|
||||
|
||||
selection = gdk_drag_get_selection (info->context);
|
||||
if (selection)
|
||||
gtk_drag_source_check_selection (info, selection, event->time);
|
||||
|
||||
#if 0
|
||||
/* We ignore the response, so we can respond precisely to the drop
|
||||
*/
|
||||
if (event->is_hint)
|
||||
gdk_window_get_pointer (widget->window, NULL, NULL, NULL);
|
||||
#endif
|
||||
gtk_drag_update (info, event->x_root, event->y_root, (GdkEvent *)event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gtk_drag_motion_cb:
|
||||
* gtk_drag_key_cb:
|
||||
* "key_press/release_event" callback during drag.
|
||||
* arguments:
|
||||
*
|
||||
* results:
|
||||
*************************************************************/
|
||||
|
||||
static gint
|
||||
gtk_drag_key_cb (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
|
||||
GdkModifierType state;
|
||||
|
||||
if (event->type == GDK_KEY_PRESS)
|
||||
{
|
||||
if (event->keyval == GDK_Escape)
|
||||
{
|
||||
gtk_drag_end (info, event->time);
|
||||
gdk_drag_abort (info->context, event->time);
|
||||
gtk_drag_drop_finished (info, FALSE, event->time);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now send a "motion" so that the modifier state is updated */
|
||||
|
||||
/* The state is not yet updated in the event, so we need
|
||||
* to query it here. We could use XGetModifierMapping, but
|
||||
* that would be overkill.
|
||||
*/
|
||||
gdk_window_get_pointer (GDK_ROOT_PARENT(), NULL, NULL, &state);
|
||||
|
||||
event->state = state;
|
||||
gtk_drag_update (info, info->cur_x, info->cur_y, (GdkEvent *)event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* gtk_drag_button_release_cb:
|
||||
* "button_release_event" callback during drag.
|
||||
* arguments:
|
||||
*
|
||||
@ -2599,23 +2784,11 @@ gtk_drag_button_release_cb (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GtkDragSourceInfo *info = (GtkDragSourceInfo *)data;
|
||||
GtkWidget *source_widget = info->widget;
|
||||
GdkEvent send_event;
|
||||
|
||||
gtk_widget_ref (source_widget);
|
||||
|
||||
if (event->button != info->button)
|
||||
return FALSE;
|
||||
|
||||
gdk_pointer_ungrab (event->time);
|
||||
|
||||
gtk_grab_remove (widget);
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
|
||||
GTK_SIGNAL_FUNC (gtk_drag_button_release_cb),
|
||||
info);
|
||||
gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
|
||||
GTK_SIGNAL_FUNC (gtk_drag_motion_cb),
|
||||
info);
|
||||
gtk_drag_end (info, event->time);
|
||||
|
||||
if ((info->context->action != 0) && (info->context->dest_window != NULL))
|
||||
{
|
||||
@ -2627,33 +2800,6 @@ gtk_drag_button_release_cb (GtkWidget *widget,
|
||||
gtk_drag_drop_finished (info, FALSE, event->time);
|
||||
}
|
||||
|
||||
/* Send on a release pair to the the original
|
||||
* widget to convince it to release its grab. We need to
|
||||
* call gtk_propagate_event() here, instead of
|
||||
* gtk_widget_event() because widget like GtkList may
|
||||
* expect propagation.
|
||||
*/
|
||||
|
||||
send_event.button.type = GDK_BUTTON_RELEASE;
|
||||
send_event.button.window = GDK_ROOT_PARENT ();
|
||||
send_event.button.send_event = TRUE;
|
||||
send_event.button.time = event->time;
|
||||
send_event.button.x = 0;
|
||||
send_event.button.y = 0;
|
||||
send_event.button.pressure = 0.;
|
||||
send_event.button.xtilt = 0.;
|
||||
send_event.button.ytilt = 0.;
|
||||
send_event.button.state = event->state;
|
||||
send_event.button.button = event->button;
|
||||
send_event.button.source = GDK_SOURCE_PEN;
|
||||
send_event.button.deviceid = GDK_CORE_POINTER;
|
||||
send_event.button.x_root = 0;
|
||||
send_event.button.y_root = 0;
|
||||
|
||||
gtk_propagate_event (source_widget, &send_event);
|
||||
|
||||
gtk_widget_unref (source_widget);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2663,11 +2809,15 @@ gtk_drag_abort_timeout (gpointer data)
|
||||
GtkDragSourceInfo *info = data;
|
||||
guint32 time = GDK_CURRENT_TIME;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
if (info->proxy_dest)
|
||||
time = info->proxy_dest->proxy_drop_time;
|
||||
|
||||
info->drop_timeout = 0;
|
||||
gtk_drag_drop_finished (info, FALSE, time);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -37,9 +37,11 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_DRAWING_AREA(obj) GTK_CHECK_CAST (obj, gtk_drawing_area_get_type (), GtkDrawingArea)
|
||||
#define GTK_DRAWING_AREA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_drawing_area_get_type (), GtkDrawingAreaClass)
|
||||
#define GTK_IS_DRAWING_AREA(obj) GTK_CHECK_TYPE (obj, gtk_drawing_area_get_type ())
|
||||
#define GTK_TYPE_DRAWING_AREA (gtk_drawing_area_get_type ())
|
||||
#define GTK_DRAWING_AREA(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_DRAWING_AREA, GtkDrawingArea))
|
||||
#define GTK_DRAWING_AREA_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_DRAWING_AREA, GtkDrawingAreaClass))
|
||||
#define GTK_IS_DRAWING_AREA(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_DRAWING_AREA))
|
||||
#define GTK_IS_DRAWING_AREA_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DRAWING_AREA))
|
||||
|
||||
|
||||
typedef struct _GtkDrawingArea GtkDrawingArea;
|
||||
|
@ -183,6 +183,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, activate),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
widget_class->activate_signal = editable_signals[ACTIVATE];
|
||||
|
||||
editable_signals[SET_EDITABLE] =
|
||||
gtk_signal_new ("set-editable",
|
||||
@ -413,13 +414,14 @@ gtk_editable_insert_text (GtkEditable *editable,
|
||||
gint *position)
|
||||
{
|
||||
GtkEditableClass *klass;
|
||||
|
||||
gchar buf[64];
|
||||
gchar *text;
|
||||
|
||||
g_return_if_fail (editable != NULL);
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (editable));
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
|
||||
if (new_text_length <= 64)
|
||||
@ -434,6 +436,8 @@ gtk_editable_insert_text (GtkEditable *editable,
|
||||
|
||||
if (new_text_length > 64)
|
||||
g_free (text);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (editable));
|
||||
}
|
||||
|
||||
void
|
||||
@ -446,10 +450,14 @@ gtk_editable_delete_text (GtkEditable *editable,
|
||||
g_return_if_fail (editable != NULL);
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (editable));
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (editable), editable_signals[DELETE_TEXT], start_pos, end_pos);
|
||||
gtk_signal_emit (GTK_OBJECT (editable), editable_signals[CHANGED]);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (editable));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -53,11 +53,14 @@ struct _GtkEditable
|
||||
{
|
||||
GtkWidget widget;
|
||||
|
||||
/*< public >*/
|
||||
guint current_pos;
|
||||
|
||||
guint selection_start_pos;
|
||||
guint selection_end_pos;
|
||||
guint has_selection : 1;
|
||||
|
||||
/*< private >*/
|
||||
guint editable : 1;
|
||||
guint visible : 1;
|
||||
GdkIC *ic;
|
||||
|
@ -1115,7 +1115,7 @@ gtk_entry_key_press (GtkWidget *widget,
|
||||
break;
|
||||
case GDK_Return:
|
||||
return_val = TRUE;
|
||||
gtk_signal_emit_by_name (GTK_OBJECT (entry), "activate");
|
||||
gtk_widget_activate (widget);
|
||||
break;
|
||||
/* The next two keys should not be inserted literally. Any others ??? */
|
||||
case GDK_Tab:
|
||||
@ -1477,10 +1477,15 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable)
|
||||
*/
|
||||
if ((editable->current_pos < entry->text_length) &&
|
||||
(editable->selection_start_pos == editable->selection_end_pos))
|
||||
{
|
||||
GdkWChar c = editable->visible ?
|
||||
*(entry->text + editable->current_pos) :
|
||||
'*';
|
||||
|
||||
gdk_draw_text_wc (drawable, widget->style->font,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
xoffset, yoffset,
|
||||
entry->text + editable->current_pos, 1);
|
||||
xoffset, yoffset, &c, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1947,6 +1952,13 @@ gtk_move_forward_word (GtkEntry *entry)
|
||||
|
||||
editable = GTK_EDITABLE (entry);
|
||||
|
||||
/* Prevent any leak of information */
|
||||
if (!editable->visible)
|
||||
{
|
||||
editable->current_pos = entry->text_length;
|
||||
return;
|
||||
}
|
||||
|
||||
if (entry->text && (editable->current_pos < entry->text_length))
|
||||
{
|
||||
text = entry->text;
|
||||
@ -1978,6 +1990,13 @@ gtk_move_backward_word (GtkEntry *entry)
|
||||
|
||||
editable = GTK_EDITABLE (entry);
|
||||
|
||||
/* Prevent any leak of information */
|
||||
if (!editable->visible)
|
||||
{
|
||||
editable->current_pos = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (entry->text && editable->current_pos > 0)
|
||||
{
|
||||
text = entry->text;
|
||||
|
@ -304,7 +304,8 @@ typedef enum
|
||||
{
|
||||
GTK_WIN_POS_NONE,
|
||||
GTK_WIN_POS_CENTER,
|
||||
GTK_WIN_POS_MOUSE
|
||||
GTK_WIN_POS_MOUSE,
|
||||
GTK_WIN_POS_CENTER_ALWAYS
|
||||
} GtkWindowPosition;
|
||||
|
||||
/* Window types */
|
||||
|
@ -808,7 +808,7 @@ gtk_file_selection_destroy (GtkObject *object)
|
||||
/* Begin file operations callbacks */
|
||||
|
||||
static void
|
||||
gtk_file_selection_fileop_error (gchar *error_message)
|
||||
gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message)
|
||||
{
|
||||
GtkWidget *label;
|
||||
GtkWidget *vbox;
|
||||
@ -827,6 +827,11 @@ gtk_file_selection_fileop_error (gchar *error_message)
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), _("Error"));
|
||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
||||
|
||||
/* If file dialog is grabbed, make this dialog modal too */
|
||||
/* When error dialog is closed, file dialog will be grabbed again */
|
||||
if (GTK_WINDOW(fs)->modal)
|
||||
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
|
||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
|
||||
@ -889,7 +894,7 @@ gtk_file_selection_create_dir_confirmed (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
buf = g_strconcat ("Error creating directory \"", dirname, "\": ",
|
||||
g_strerror(errno), NULL);
|
||||
gtk_file_selection_fileop_error (buf);
|
||||
gtk_file_selection_fileop_error (fs, buf);
|
||||
}
|
||||
g_free (full_path);
|
||||
|
||||
@ -986,7 +991,7 @@ gtk_file_selection_delete_file_confirmed (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ",
|
||||
g_strerror(errno), NULL);
|
||||
gtk_file_selection_fileop_error (buf);
|
||||
gtk_file_selection_fileop_error (fs, buf);
|
||||
}
|
||||
g_free (full_path);
|
||||
|
||||
@ -1096,7 +1101,7 @@ gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
buf = g_strconcat ("Error renaming file \"", file, "\": ",
|
||||
g_strerror(errno), NULL);
|
||||
gtk_file_selection_fileop_error (buf);
|
||||
gtk_file_selection_fileop_error (fs, buf);
|
||||
}
|
||||
g_free (new_filename);
|
||||
g_free (old_filename);
|
||||
|
@ -150,15 +150,17 @@ gtk_fixed_put (GtkFixed *fixed,
|
||||
|
||||
fixed->children = g_list_append (fixed->children, child_info);
|
||||
|
||||
if (GTK_WIDGET_REALIZED (fixed) && !GTK_WIDGET_REALIZED (widget))
|
||||
if (GTK_WIDGET_REALIZED (fixed))
|
||||
gtk_widget_realize (widget);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (fixed) && !GTK_WIDGET_MAPPED (widget))
|
||||
if (GTK_WIDGET_VISIBLE (fixed) && GTK_WIDGET_VISIBLE (widget))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (fixed))
|
||||
gtk_widget_map (widget);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (fixed))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (fixed));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_fixed_move (GtkFixed *fixed,
|
||||
|
@ -1453,6 +1453,7 @@ gtk_font_selection_show_available_sizes (GtkFontSelection *fontsel)
|
||||
can_match = TRUE;
|
||||
|
||||
if (nbitmapped_sizes)
|
||||
{
|
||||
if (fontsel->metric == GTK_FONT_METRIC_POINTS)
|
||||
{
|
||||
if (*bitmapped_sizes % 10 != 0)
|
||||
@ -1465,6 +1466,7 @@ gtk_font_selection_show_available_sizes (GtkFontSelection *fontsel)
|
||||
bitmap_size = *bitmapped_sizes;
|
||||
bitmap_size_float = *bitmapped_sizes;
|
||||
}
|
||||
}
|
||||
|
||||
if (can_match && nstandard_sizes && nbitmapped_sizes
|
||||
&& *standard_sizes == bitmap_size)
|
||||
|
@ -310,7 +310,7 @@ button_realize_callback (GtkWidget *w)
|
||||
|
||||
i = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "_GtkGammaCurveIndex"));
|
||||
pm = gdk_pixmap_create_from_xpm_d (w->window, &mask,
|
||||
&w->style->bg[GTK_STATE_NORMAL], xpm[i]);
|
||||
&w->style->bg[GTK_STATE_NORMAL], (gchar **)xpm[i]);
|
||||
|
||||
pixmap = gtk_pixmap_new (pm, mask);
|
||||
gtk_container_add (GTK_CONTAINER (w), pixmap);
|
||||
|
@ -37,12 +37,11 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_GAMMA_CURVE(obj) \
|
||||
GTK_CHECK_CAST (obj, gtk_gamma_curve_get_type (), GtkGammaCurve)
|
||||
#define GTK_GAMMA_CURVE_CLASS(klass) \
|
||||
GTK_CHECK_CLASS_CAST (klass, gtk_gamma_curve_get_type (), GtkGammaCurveClass)
|
||||
#define GTK_IS_GAMMA_CURVE(obj) \
|
||||
GTK_CHECK_TYPE (obj, gtk_gamma_curve_get_type ())
|
||||
#define GTK_TYPE_GAMMA_CURVE (gtk_gamma_curve_get_type ())
|
||||
#define GTK_GAMMA_CURVE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurve))
|
||||
#define GTK_GAMMA_CURVE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass))
|
||||
#define GTK_IS_GAMMA_CURVE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_GAMMA_CURVE))
|
||||
#define GTK_IS_GAMMA_CURVE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GAMMA_CURVE))
|
||||
|
||||
|
||||
typedef struct _GtkGammaCurve GtkGammaCurve;
|
||||
|
@ -33,7 +33,9 @@
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_SHADOW
|
||||
ARG_SHADOW,
|
||||
ARG_HANDLE_POSITION,
|
||||
ARG_SNAP_EDGE
|
||||
};
|
||||
|
||||
#define DRAG_HANDLE_SIZE 10
|
||||
@ -41,8 +43,7 @@ enum {
|
||||
#define GHOST_HEIGHT 3
|
||||
#define TOLERANCE 5
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
SIGNAL_CHILD_ATTACHED,
|
||||
SIGNAL_CHILD_DETACHED,
|
||||
SIGNAL_LAST
|
||||
@ -151,7 +152,7 @@ gtk_handle_box_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
handle_box_type = gtk_type_unique (gtk_bin_get_type (), &handle_box_info);
|
||||
handle_box_type = gtk_type_unique (GTK_TYPE_BIN, &handle_box_info);
|
||||
}
|
||||
|
||||
return handle_box_type;
|
||||
@ -168,9 +169,11 @@ gtk_handle_box_class_init (GtkHandleBoxClass *class)
|
||||
widget_class = (GtkWidgetClass *) class;
|
||||
container_class = (GtkContainerClass *) class;
|
||||
|
||||
parent_class = gtk_type_class (gtk_bin_get_type ());
|
||||
parent_class = gtk_type_class (GTK_TYPE_BIN);
|
||||
|
||||
gtk_object_add_arg_type ("GtkHandleBox::shadow", GTK_TYPE_SHADOW_TYPE, GTK_ARG_READWRITE, ARG_SHADOW);
|
||||
gtk_object_add_arg_type ("GtkHandleBox::handle_position", GTK_TYPE_POSITION_TYPE, GTK_ARG_READWRITE, ARG_HANDLE_POSITION);
|
||||
gtk_object_add_arg_type ("GtkHandleBox::snap_edge", GTK_TYPE_POSITION_TYPE, GTK_ARG_READWRITE, ARG_SNAP_EDGE);
|
||||
|
||||
object_class->set_arg = gtk_handle_box_set_arg;
|
||||
object_class->get_arg = gtk_handle_box_get_arg;
|
||||
@ -237,16 +240,18 @@ gtk_handle_box_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkHandleBox *handle_box;
|
||||
|
||||
handle_box = GTK_HANDLE_BOX (object);
|
||||
GtkHandleBox *handle_box = GTK_HANDLE_BOX (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_SHADOW:
|
||||
gtk_handle_box_set_shadow_type (handle_box, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
default:
|
||||
case ARG_HANDLE_POSITION:
|
||||
gtk_handle_box_set_handle_position (handle_box, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
case ARG_SNAP_EDGE:
|
||||
gtk_handle_box_set_snap_edge (handle_box, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -256,15 +261,19 @@ gtk_handle_box_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkHandleBox *handle_box;
|
||||
|
||||
handle_box = GTK_HANDLE_BOX (object);
|
||||
GtkHandleBox *handle_box = GTK_HANDLE_BOX (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_SHADOW:
|
||||
GTK_VALUE_ENUM (*arg) = handle_box->shadow_type;
|
||||
break;
|
||||
case ARG_HANDLE_POSITION:
|
||||
GTK_VALUE_ENUM (*arg) = handle_box->handle_position;
|
||||
break;
|
||||
case ARG_SNAP_EDGE:
|
||||
GTK_VALUE_ENUM (*arg) = handle_box->snap_edge;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
|
@ -43,9 +43,11 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_HANDLE_BOX(obj) GTK_CHECK_CAST (obj, gtk_handle_box_get_type (), GtkHandleBox)
|
||||
#define GTK_HANDLE_BOX_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_handle_box_get_type (), GtkHandleBoxClass)
|
||||
#define GTK_IS_HANDLE_BOX(obj) GTK_CHECK_TYPE (obj, gtk_handle_box_get_type ())
|
||||
#define GTK_TYPE_HANDLE_BOX (gtk_handle_box_get_type ())
|
||||
#define GTK_HANDLE_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HANDLE_BOX, GtkHandleBox))
|
||||
#define GTK_HANDLE_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HANDLE_BOX, GtkHandleBoxClass))
|
||||
#define GTK_IS_HANDLE_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HANDLE_BOX))
|
||||
#define GTK_IS_HANDLE_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HANDLE_BOX))
|
||||
|
||||
|
||||
typedef struct _GtkHandleBox GtkHandleBox;
|
||||
|
@ -245,7 +245,7 @@ gtk_hpaned_draw (GtkWidget *widget,
|
||||
GdkRectangle *area)
|
||||
{
|
||||
GtkPaned *paned;
|
||||
GdkRectangle child_area;
|
||||
GdkRectangle handle_area, child_area;
|
||||
guint16 border_width;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
@ -253,11 +253,43 @@ gtk_hpaned_draw (GtkWidget *widget,
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
|
||||
{
|
||||
gint width, height;
|
||||
|
||||
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);
|
||||
|
||||
/* Redraw the handle
|
||||
*/
|
||||
gdk_window_get_size (paned->handle, &width, &height);
|
||||
|
||||
handle_area.x = paned->handle_xpos;
|
||||
handle_area.y = paned->handle_ypos;
|
||||
handle_area.width = width;
|
||||
handle_area.height = height;
|
||||
|
||||
if (gdk_rectangle_intersect (&handle_area, area, &child_area))
|
||||
{
|
||||
child_area.x -= handle_area.x;
|
||||
child_area.y -= handle_area.y;
|
||||
gtk_paint_box (widget->style, paned->handle,
|
||||
GTK_WIDGET_STATE(widget),
|
||||
GTK_SHADOW_OUT,
|
||||
&child_area, widget, "paned",
|
||||
0, 0,
|
||||
width, height);
|
||||
}
|
||||
|
||||
/* Redraw the groove
|
||||
*/
|
||||
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);
|
||||
/* Redraw the children
|
||||
*/
|
||||
if (paned->child1 &&
|
||||
gtk_widget_intersect (paned->child1, area, &child_area))
|
||||
gtk_widget_draw (paned->child1, &child_area);
|
||||
@ -265,10 +297,6 @@ gtk_hpaned_draw (GtkWidget *widget,
|
||||
gtk_widget_intersect (paned->child2, area, &child_area))
|
||||
gtk_widget_draw (paned->child2, &child_area);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,12 +311,10 @@ gtk_hpaned_xor_line (GtkPaned *paned)
|
||||
|
||||
if (!paned->xor_gc)
|
||||
{
|
||||
values.foreground = widget->style->white;
|
||||
values.function = GDK_XOR;
|
||||
values.function = GDK_INVERT;
|
||||
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
|
||||
paned->xor_gc = gdk_gc_new_with_values (widget->window,
|
||||
&values,
|
||||
GDK_GC_FOREGROUND |
|
||||
GDK_GC_FUNCTION |
|
||||
GDK_GC_SUBWINDOW);
|
||||
}
|
||||
|
@ -209,8 +209,8 @@ gtk_hscale_realize (GtkWidget *widget)
|
||||
|
||||
gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &w, &h);
|
||||
|
||||
attributes.x = x + widget->allocation.x;
|
||||
attributes.y = y + widget->allocation.y;
|
||||
attributes.x = x;
|
||||
attributes.y = y;
|
||||
attributes.width = w;
|
||||
attributes.height = h;
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
@ -370,8 +370,7 @@ gtk_hscale_size_allocate (GtkWidget *widget,
|
||||
gtk_hscale_pos_trough (GTK_HSCALE (widget), &x, &y, &width, &height);
|
||||
|
||||
gdk_window_move_resize (range->trough,
|
||||
x + widget->allocation.x,
|
||||
y + widget->allocation.y, width, height);
|
||||
x, y, width, height);
|
||||
gtk_range_slider_update (GTK_RANGE (widget));
|
||||
}
|
||||
}
|
||||
@ -429,6 +428,9 @@ gtk_hscale_pos_trough (GtkHScale *hscale,
|
||||
}
|
||||
*x += 1;
|
||||
*w -= 2;
|
||||
|
||||
*x += widget->allocation.x;
|
||||
*y += widget->allocation.y;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -235,6 +235,9 @@ gtk_item_factory_init (GtkItemFactory *ifactory)
|
||||
ifactory->accel_group = NULL;
|
||||
ifactory->widget = NULL;
|
||||
ifactory->items = NULL;
|
||||
ifactory->translate_func = NULL;
|
||||
ifactory->translate_data = NULL;
|
||||
ifactory->translate_notify = NULL;
|
||||
}
|
||||
|
||||
GtkItemFactory*
|
||||
@ -672,7 +675,7 @@ gtk_item_factory_destroy (GtkObject *object)
|
||||
GSList *link;
|
||||
|
||||
for (link = item->widgets; link; link = link->next)
|
||||
if (gtk_object_get_data_by_id (link->data, quark_item_factory))
|
||||
if (gtk_object_get_data_by_id (link->data, quark_item_factory) == ifactory)
|
||||
gtk_object_remove_data_by_id (link->data, quark_item_factory);
|
||||
}
|
||||
g_slist_free (ifactory->items);
|
||||
@ -695,7 +698,7 @@ gtk_item_factory_finalize (GtkObject *object)
|
||||
g_free (ifactory->path);
|
||||
g_assert (ifactory->widget == NULL);
|
||||
|
||||
if (ifactory->translate_data && ifactory->translate_notify)
|
||||
if (ifactory->translate_notify)
|
||||
ifactory->translate_notify (ifactory->translate_data);
|
||||
|
||||
parent_class->finalize (object);
|
||||
@ -976,7 +979,10 @@ gtk_item_factory_parse_path (GtkItemFactory *ifactory,
|
||||
translation = str;
|
||||
|
||||
p = strrchr (translation, '/');
|
||||
if (p)
|
||||
p++;
|
||||
else
|
||||
p = translation;
|
||||
|
||||
*item = g_strdup (p);
|
||||
|
||||
@ -989,6 +995,7 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
|
||||
gpointer callback_data,
|
||||
guint callback_type)
|
||||
{
|
||||
GtkOptionMenu *option_menu = NULL;
|
||||
GtkWidget *parent;
|
||||
GtkWidget *widget;
|
||||
GSList *radio_group;
|
||||
@ -1085,6 +1092,14 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
|
||||
}
|
||||
g_free (parent_path);
|
||||
|
||||
if (GTK_IS_OPTION_MENU (parent))
|
||||
{
|
||||
option_menu = GTK_OPTION_MENU (parent);
|
||||
if (!option_menu->menu)
|
||||
gtk_option_menu_set_menu (option_menu, gtk_widget_new (GTK_TYPE_MENU, NULL));
|
||||
parent = option_menu->menu;
|
||||
}
|
||||
|
||||
g_return_if_fail (GTK_IS_CONTAINER (parent));
|
||||
|
||||
widget = gtk_widget_new (type,
|
||||
@ -1093,6 +1108,8 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
|
||||
type_id != quark_type_title),
|
||||
"GtkWidget::parent", parent,
|
||||
NULL);
|
||||
if (option_menu && !option_menu->menu_item)
|
||||
gtk_option_menu_set_history (option_menu, 0);
|
||||
|
||||
if (type == GTK_TYPE_RADIO_MENU_ITEM)
|
||||
gtk_radio_menu_item_set_group (GTK_RADIO_MENU_ITEM (widget), radio_group);
|
||||
@ -1427,14 +1444,12 @@ gtk_item_factory_popup_with_data (GtkItemFactory *ifactory,
|
||||
guint mouse_button,
|
||||
guint32 time)
|
||||
{
|
||||
MenuPos *mpos;
|
||||
|
||||
g_return_if_fail (ifactory != NULL);
|
||||
g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory));
|
||||
g_return_if_fail (GTK_IS_MENU (ifactory->widget));
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (ifactory->widget))
|
||||
{
|
||||
MenuPos *mpos;
|
||||
|
||||
mpos = gtk_object_get_data_by_id (GTK_OBJECT (ifactory->widget), quark_if_menu_pos);
|
||||
|
||||
if (!mpos)
|
||||
@ -1466,7 +1481,6 @@ gtk_item_factory_popup_with_data (GtkItemFactory *ifactory,
|
||||
gtk_item_factory_menu_pos, mpos,
|
||||
mouse_button, time);
|
||||
}
|
||||
}
|
||||
|
||||
static guint
|
||||
gtk_item_factory_parse_menu_path (GScanner *scanner,
|
||||
@ -1635,11 +1649,7 @@ gtk_item_factory_parse_rc (const gchar *file_name)
|
||||
if (!S_ISREG (g_scanner_stat_mode (file_name)))
|
||||
return;
|
||||
|
||||
#ifndef __EMX__
|
||||
fd = open (file_name, O_RDONLY);
|
||||
#else
|
||||
fd = open (file_name, O_RDONLY | O_TEXT);
|
||||
#endif
|
||||
if (fd < 0)
|
||||
return;
|
||||
|
||||
@ -1666,7 +1676,7 @@ gtk_item_factory_set_translate_func (GtkItemFactory *ifactory,
|
||||
{
|
||||
g_return_if_fail (ifactory != NULL);
|
||||
|
||||
if (ifactory->translate_data && ifactory->translate_notify)
|
||||
if (ifactory->translate_notify)
|
||||
ifactory->translate_notify (ifactory->translate_data);
|
||||
|
||||
ifactory->translate_func = func;
|
||||
|
258
gtk/gtklabel.c
258
gtk/gtklabel.c
@ -33,7 +33,8 @@ enum {
|
||||
ARG_0,
|
||||
ARG_LABEL,
|
||||
ARG_PATTERN,
|
||||
ARG_JUSTIFY
|
||||
ARG_JUSTIFY,
|
||||
ARG_WRAP
|
||||
};
|
||||
|
||||
typedef struct _GtkLabelULine GtkLabelULine;
|
||||
@ -86,16 +87,12 @@ static GtkLabelULine * gtk_label_uline_alloc (void);
|
||||
static void gtk_label_free_words (GtkLabel *label);
|
||||
static void gtk_label_free_ulines (GtkLabelWord *word);
|
||||
static gint gtk_label_split_text (GtkLabel *label);
|
||||
static void gtk_label_finalize_lines (GtkLabel * label, gint line_width);
|
||||
static void gtk_label_finalize_lines_wrap(GtkLabel * label, gint line_width);
|
||||
|
||||
|
||||
static GtkMiscClass *parent_class = NULL;
|
||||
|
||||
static GMemChunk *word_chunk = 0;
|
||||
static GtkLabelWord *free_words = 0;
|
||||
static GMemChunk *uline_chunk = 0;
|
||||
static GtkLabelULine *free_ulines = 0;
|
||||
static GMemChunk *word_chunk = NULL;
|
||||
static GMemChunk *uline_chunk = NULL;
|
||||
|
||||
GtkType
|
||||
gtk_label_get_type (void)
|
||||
@ -116,7 +113,7 @@ gtk_label_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
label_type = gtk_type_unique (gtk_misc_get_type (), &label_info);
|
||||
label_type = gtk_type_unique (GTK_TYPE_MISC, &label_info);
|
||||
gtk_type_set_chunk_alloc (label_type, 32);
|
||||
}
|
||||
|
||||
@ -132,11 +129,12 @@ gtk_label_class_init (GtkLabelClass *class)
|
||||
object_class = (GtkObjectClass*) class;
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
|
||||
parent_class = gtk_type_class (gtk_misc_get_type ());
|
||||
parent_class = gtk_type_class (GTK_TYPE_MISC);
|
||||
|
||||
gtk_object_add_arg_type ("GtkLabel::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL);
|
||||
gtk_object_add_arg_type ("GtkLabel::pattern", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_PATTERN);
|
||||
gtk_object_add_arg_type ("GtkLabel::justify", GTK_TYPE_JUSTIFICATION, GTK_ARG_READWRITE, ARG_JUSTIFY);
|
||||
gtk_object_add_arg_type ("GtkLabel::wrap", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_WRAP);
|
||||
|
||||
object_class->set_arg = gtk_label_set_arg;
|
||||
object_class->get_arg = gtk_label_get_arg;
|
||||
@ -159,7 +157,7 @@ gtk_label_set_arg (GtkObject *object,
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_LABEL:
|
||||
gtk_label_set_text (label, GTK_VALUE_STRING (*arg) ? GTK_VALUE_STRING (*arg) : "");
|
||||
gtk_label_set_text (label, GTK_VALUE_STRING (*arg));
|
||||
break;
|
||||
case ARG_PATTERN:
|
||||
gtk_label_set_pattern (label, GTK_VALUE_STRING (*arg));
|
||||
@ -167,6 +165,9 @@ gtk_label_set_arg (GtkObject *object,
|
||||
case ARG_JUSTIFY:
|
||||
gtk_label_set_justify (label, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
case ARG_WRAP:
|
||||
gtk_label_set_line_wrap (label, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -192,6 +193,9 @@ gtk_label_get_arg (GtkObject *object,
|
||||
case ARG_JUSTIFY:
|
||||
GTK_VALUE_ENUM (*arg) = label->jtype;
|
||||
break;
|
||||
case ARG_WRAP:
|
||||
GTK_VALUE_BOOL (*arg) = label->wrap;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
@ -217,54 +221,45 @@ gtk_label_init (GtkLabel *label)
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_label_new (const char *str)
|
||||
gtk_label_new (const gchar *str)
|
||||
{
|
||||
GtkLabel *label;
|
||||
|
||||
g_return_val_if_fail (str != NULL, NULL);
|
||||
|
||||
label = gtk_type_new (gtk_label_get_type ());
|
||||
label = gtk_type_new (GTK_TYPE_LABEL);
|
||||
|
||||
if (str && *str)
|
||||
gtk_label_set_text (label, str);
|
||||
|
||||
return GTK_WIDGET (label);
|
||||
}
|
||||
|
||||
static void
|
||||
static inline void
|
||||
gtk_label_set_text_internal (GtkLabel *label,
|
||||
char *str,
|
||||
gchar *str,
|
||||
GdkWChar *str_wc)
|
||||
{
|
||||
if (label->label)
|
||||
gtk_label_free_words (label);
|
||||
|
||||
g_free (label->label);
|
||||
if (label->label_wc)
|
||||
g_free (label->label_wc);
|
||||
|
||||
label->label = str;
|
||||
label->label_wc = str_wc;
|
||||
|
||||
gtk_label_free_words (label);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (label))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (label))
|
||||
gtk_widget_queue_clear (GTK_WIDGET (label));
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (label));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_label_set_text (GtkLabel *label,
|
||||
const char *str)
|
||||
const gchar *str)
|
||||
{
|
||||
GdkWChar *str_wc;
|
||||
gint len;
|
||||
gint wc_len;
|
||||
|
||||
g_return_if_fail (label != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
g_return_if_fail (str != NULL);
|
||||
if (!str)
|
||||
str = "";
|
||||
|
||||
if (!label->label || strcmp (label->label, str))
|
||||
{
|
||||
@ -286,68 +281,54 @@ void
|
||||
gtk_label_set_pattern (GtkLabel *label,
|
||||
const gchar *pattern)
|
||||
{
|
||||
g_return_if_fail (label != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
|
||||
if (label->pattern)
|
||||
gtk_label_free_words (label);
|
||||
|
||||
g_free (label->pattern);
|
||||
label->pattern = g_strdup (pattern);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (label))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (label))
|
||||
gtk_widget_queue_clear (GTK_WIDGET (label));
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (label));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_label_set_justify (GtkLabel *label, GtkJustification jtype)
|
||||
gtk_label_set_justify (GtkLabel *label,
|
||||
GtkJustification jtype)
|
||||
{
|
||||
g_return_if_fail (label != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
g_return_if_fail (jtype >= GTK_JUSTIFY_LEFT && jtype <= GTK_JUSTIFY_FILL);
|
||||
|
||||
if ((GtkJustification) label->jtype != jtype)
|
||||
{
|
||||
if ((label->jtype == GTK_JUSTIFY_FILL) ||
|
||||
(jtype == GTK_JUSTIFY_FILL))
|
||||
/* FIXME: think about this a little */
|
||||
gtk_label_free_words (label);
|
||||
|
||||
label->jtype = jtype;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (label))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (label))
|
||||
gtk_widget_queue_clear (GTK_WIDGET (label));
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (label));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_label_set_line_wrap (GtkLabel *label, gboolean wrap)
|
||||
gtk_label_set_line_wrap (GtkLabel *label,
|
||||
gboolean wrap)
|
||||
{
|
||||
g_return_if_fail (label != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
|
||||
if (label->wrap != wrap) {
|
||||
if (GTK_WIDGET_VISIBLE (label))
|
||||
wrap = wrap != FALSE;
|
||||
|
||||
if (label->wrap != wrap)
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (label))
|
||||
gtk_widget_queue_clear (GTK_WIDGET (label));
|
||||
gtk_label_free_words (label);
|
||||
|
||||
label->wrap = wrap;
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (label));
|
||||
}
|
||||
label->wrap = wrap;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_label_get (GtkLabel *label,
|
||||
char **str)
|
||||
gchar **str)
|
||||
{
|
||||
g_return_if_fail (label != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
@ -368,77 +349,22 @@ gtk_label_finalize (GtkObject *object)
|
||||
|
||||
g_free (label->label);
|
||||
g_free (label->label_wc);
|
||||
|
||||
if (label->pattern)
|
||||
g_free (label->pattern);
|
||||
|
||||
gtk_label_free_words (label);
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GtkLabelWord*
|
||||
gtk_label_word_alloc ()
|
||||
{
|
||||
GtkLabelWord * word;
|
||||
|
||||
if (!word_chunk)
|
||||
{
|
||||
word_chunk = g_mem_chunk_new ("GtkLabelWord chunk",
|
||||
sizeof (GtkLabelWord),
|
||||
32 * sizeof (GtkLabelWord),
|
||||
G_ALLOC_ONLY);
|
||||
}
|
||||
|
||||
if (free_words)
|
||||
{
|
||||
word = free_words;
|
||||
free_words = word->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
word = g_mem_chunk_alloc (word_chunk);
|
||||
}
|
||||
|
||||
word->next = 0;
|
||||
word->uline = 0;
|
||||
return word;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_free_words (GtkLabel *label)
|
||||
{
|
||||
GtkLabelWord * last;
|
||||
|
||||
if (label->words)
|
||||
{
|
||||
for (last = label->words; last->next != 0; last = last->next)
|
||||
gtk_label_free_ulines (label->words);
|
||||
last->next = free_words;
|
||||
free_words = label->words;
|
||||
label->words = NULL;
|
||||
}
|
||||
}
|
||||
static GtkLabelULine*
|
||||
gtk_label_uline_alloc (void)
|
||||
{
|
||||
GtkLabelULine *uline;
|
||||
|
||||
if (!uline_chunk)
|
||||
{
|
||||
uline_chunk = g_mem_chunk_new ("GtkLabelWord chunk",
|
||||
sizeof (GtkLabelULine),
|
||||
32 * sizeof (GtkLabelULine),
|
||||
G_ALLOC_ONLY);
|
||||
}
|
||||
uline_chunk = g_mem_chunk_create (GtkLabelWord, 32, G_ALLOC_AND_FREE);
|
||||
|
||||
if (free_ulines)
|
||||
{
|
||||
uline = free_ulines;
|
||||
free_ulines = uline->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
uline = g_mem_chunk_alloc (uline_chunk);
|
||||
}
|
||||
uline = g_chunk_new0 (GtkLabelULine, uline_chunk);
|
||||
|
||||
uline->next = NULL;
|
||||
|
||||
@ -448,14 +374,44 @@ gtk_label_uline_alloc (void)
|
||||
static void
|
||||
gtk_label_free_ulines (GtkLabelWord *word)
|
||||
{
|
||||
GtkLabelULine *last;
|
||||
if (word->uline)
|
||||
while (word->uline)
|
||||
{
|
||||
for (last = word->uline; last->next != 0; last = last->next)
|
||||
;
|
||||
last->next = free_ulines;
|
||||
free_ulines = word->uline;
|
||||
word->uline = 0;
|
||||
GtkLabelULine *uline = word->uline;
|
||||
|
||||
word->uline = uline->next;
|
||||
g_chunk_free (uline, uline_chunk);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkLabelWord*
|
||||
gtk_label_word_alloc (void)
|
||||
{
|
||||
GtkLabelWord * word;
|
||||
|
||||
if (!word_chunk)
|
||||
word_chunk = g_mem_chunk_create (GtkLabelWord, 32, G_ALLOC_AND_FREE);
|
||||
|
||||
word = g_chunk_new0 (GtkLabelWord, word_chunk);
|
||||
|
||||
word->beginning = NULL;
|
||||
word->next = NULL;
|
||||
word->uline = NULL;
|
||||
|
||||
return word;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_free_words (GtkLabel *label)
|
||||
{
|
||||
while (label->words)
|
||||
{
|
||||
GtkLabelWord *word = label->words;
|
||||
|
||||
label->words = word->next;
|
||||
|
||||
gtk_label_free_ulines (word);
|
||||
|
||||
g_chunk_free (word, word_chunk);
|
||||
}
|
||||
}
|
||||
|
||||
@ -466,8 +422,6 @@ gtk_label_split_text (GtkLabel *label)
|
||||
gint space_width, line_width, max_line_width;
|
||||
GdkWChar *str, *p;
|
||||
|
||||
g_return_val_if_fail (GTK_WIDGET (label)->style->font != NULL, 0);
|
||||
|
||||
gtk_label_free_words (label);
|
||||
if (label->label == NULL)
|
||||
return 0;
|
||||
@ -530,7 +484,7 @@ gtk_label_split_text (GtkLabel *label)
|
||||
|
||||
/* Add an empty word to represent an empty line
|
||||
*/
|
||||
if ((str == label->label_wc) || (str[-1] == '\n'))
|
||||
if (str == label->label_wc || str[-1] == '\n')
|
||||
{
|
||||
word = gtk_label_word_alloc ();
|
||||
|
||||
@ -546,16 +500,14 @@ gtk_label_split_text (GtkLabel *label)
|
||||
return MAX (line_width, max_line_width);
|
||||
}
|
||||
|
||||
/* this needs to handle white space better. */
|
||||
static gint
|
||||
gtk_label_split_text_wrapped (GtkLabel *label)
|
||||
{
|
||||
/* this needs to handle white space better. */
|
||||
GtkLabelWord *word, **tailp;
|
||||
gint space_width, line_width, max_line_width;
|
||||
GdkWChar *str, *p;
|
||||
|
||||
g_return_val_if_fail (GTK_WIDGET (label)->style->font != NULL, 0);
|
||||
|
||||
gtk_label_free_words (label);
|
||||
if (label->label == NULL)
|
||||
return 0;
|
||||
@ -669,7 +621,8 @@ gtk_label_pick_width (GtkLabel *label,
|
||||
*/
|
||||
static void
|
||||
gtk_label_finalize_lines (GtkLabel *label,
|
||||
gint line_width)
|
||||
GtkRequisition *requisition,
|
||||
gint max_line_width)
|
||||
{
|
||||
GtkLabelWord *line;
|
||||
gint y, baseline_skip, y_max;
|
||||
@ -680,14 +633,15 @@ gtk_label_finalize_lines (GtkLabel *label,
|
||||
ptrn = label->pattern;
|
||||
|
||||
y = 0;
|
||||
baseline_skip = GTK_WIDGET (label)->style->font->ascent + GTK_WIDGET (label)->style->font->descent + 2;
|
||||
baseline_skip = (GTK_WIDGET (label)->style->font->ascent +
|
||||
GTK_WIDGET (label)->style->font->descent + 2);
|
||||
|
||||
for (line = label->words; line; line = line->next)
|
||||
{
|
||||
if (label->jtype == GTK_JUSTIFY_CENTER)
|
||||
line->x = (line_width - line->width) / 2;
|
||||
line->x = (max_line_width - line->width) / 2;
|
||||
else if (label->jtype == GTK_JUSTIFY_RIGHT)
|
||||
line->x = line_width - line->width;
|
||||
line->x = max_line_width - line->width;
|
||||
else
|
||||
line->x = 0;
|
||||
|
||||
@ -748,15 +702,16 @@ gtk_label_finalize_lines (GtkLabel *label,
|
||||
y += (baseline_skip + y_max);
|
||||
}
|
||||
|
||||
label->max_width = line_width;
|
||||
GTK_WIDGET (label)->requisition.width = line_width + 2 * label->misc.xpad;
|
||||
GTK_WIDGET (label)->requisition.height = y + 2 * label->misc.ypad;
|
||||
label->max_width = max_line_width;
|
||||
requisition->width = max_line_width + 2 * label->misc.xpad;
|
||||
requisition->height = y + 2 * label->misc.ypad;
|
||||
}
|
||||
|
||||
/* this finalizes word-wrapped words */
|
||||
static void
|
||||
gtk_label_finalize_lines_wrap (GtkLabel *label,
|
||||
gint line_width)
|
||||
GtkRequisition *requisition,
|
||||
gint max_line_width)
|
||||
{
|
||||
GtkLabelWord *word, *line, *next_line;
|
||||
GtkWidget *widget;
|
||||
@ -767,12 +722,13 @@ gtk_label_finalize_lines_wrap (GtkLabel *label,
|
||||
|
||||
ptrn = label->pattern;
|
||||
y = 0;
|
||||
baseline_skip = GTK_WIDGET (label)->style->font->ascent + GTK_WIDGET (label)->style->font->descent + 1;
|
||||
baseline_skip = (GTK_WIDGET (label)->style->font->ascent +
|
||||
GTK_WIDGET (label)->style->font->descent + 1);
|
||||
|
||||
for (line = label->words; line != 0; line = next_line)
|
||||
{
|
||||
space = 0;
|
||||
extra_width = line_width - line->width;
|
||||
extra_width = max_line_width - line->width;
|
||||
|
||||
for (next_line = line->next; next_line; next_line = next_line->next)
|
||||
{
|
||||
@ -809,10 +765,10 @@ gtk_label_finalize_lines_wrap (GtkLabel *label,
|
||||
y += (baseline_skip);
|
||||
}
|
||||
|
||||
label->max_width = line_width;
|
||||
label->max_width = max_line_width;
|
||||
widget = GTK_WIDGET (label);
|
||||
widget->requisition.width = line_width + 2 * label->misc.xpad;
|
||||
widget->requisition.height = y + 2 * label->misc.ypad + 1;
|
||||
requisition->width = max_line_width + 2 * label->misc.xpad;
|
||||
requisition->height = y + 2 * label->misc.ypad + 1;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -821,7 +777,6 @@ gtk_label_size_request (GtkWidget *widget,
|
||||
{
|
||||
GtkLabel *label;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (widget));
|
||||
g_return_if_fail (requisition != NULL);
|
||||
|
||||
@ -878,16 +833,13 @@ gtk_label_size_request (GtkWidget *widget,
|
||||
label->max_width);
|
||||
}
|
||||
}
|
||||
gtk_label_finalize_lines_wrap (label, label->max_width);
|
||||
gtk_label_finalize_lines_wrap (label, requisition, label->max_width);
|
||||
}
|
||||
else if (label->words == NULL)
|
||||
else if (!label->words)
|
||||
{
|
||||
label->max_width = gtk_label_split_text (label);
|
||||
gtk_label_finalize_lines (label, label->max_width);
|
||||
gtk_label_finalize_lines (label, requisition, label->max_width);
|
||||
}
|
||||
|
||||
if (requisition != &widget->requisition)
|
||||
*requisition = widget->requisition;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -896,15 +848,14 @@ gtk_label_style_set (GtkWidget *widget,
|
||||
{
|
||||
GtkLabel *label;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (widget));
|
||||
|
||||
label = GTK_LABEL (widget);
|
||||
|
||||
if (previous_style && label->words)
|
||||
/* Clear the list of words so that they are recomputed on
|
||||
* size_request
|
||||
*/
|
||||
if (previous_style && label->words)
|
||||
gtk_label_free_words (label);
|
||||
}
|
||||
|
||||
@ -946,7 +897,6 @@ gtk_label_expose (GtkWidget *widget,
|
||||
GtkLabelWord *word;
|
||||
gint x, y;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_LABEL (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -999,6 +949,7 @@ gtk_label_parse_uline (GtkLabel *label,
|
||||
gint length, wc_length;
|
||||
gboolean underscore;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_LABEL (label), GDK_VoidSymbol);
|
||||
g_return_val_if_fail (string != NULL, GDK_VoidSymbol);
|
||||
|
||||
/* Convert text to wide characters */
|
||||
@ -1058,4 +1009,3 @@ gtk_label_parse_uline (GtkLabel *label,
|
||||
|
||||
return accel_key;
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ struct _GtkLayoutChild {
|
||||
static void gtk_layout_class_init (GtkLayoutClass *class);
|
||||
static void gtk_layout_init (GtkLayout *layout);
|
||||
|
||||
static void gtk_layout_finalize (GtkObject *object);
|
||||
static void gtk_layout_realize (GtkWidget *widget);
|
||||
static void gtk_layout_unrealize (GtkWidget *widget);
|
||||
static void gtk_layout_map (GtkWidget *widget);
|
||||
@ -97,9 +98,6 @@ static void gtk_layout_expose_area (GtkLayout *layout,
|
||||
gint height);
|
||||
static void gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
|
||||
GtkLayout *layout);
|
||||
static GdkFilterReturn gtk_layout_filter (GdkXEvent *gdk_xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
static GdkFilterReturn gtk_layout_main_filter (GdkXEvent *gdk_xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
@ -199,6 +197,17 @@ gtk_layout_set_adjustments (GtkLayout *layout,
|
||||
gtk_layout_adjustment_changed (NULL, layout);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_layout_finalize (GtkObject *object)
|
||||
{
|
||||
GtkLayout *layout = GTK_LAYOUT (object);
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (layout->hadjustment));
|
||||
gtk_object_unref (GTK_OBJECT (layout->vadjustment));
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_layout_set_hadjustment (GtkLayout *layout,
|
||||
GtkAdjustment *adjustment)
|
||||
@ -249,20 +258,17 @@ gtk_layout_put (GtkLayout *layout,
|
||||
if (!IS_ONSCREEN (x, y))
|
||||
GTK_PRIVATE_SET_FLAG (child_widget, GTK_IS_OFFSCREEN);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (layout))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (layout) &&
|
||||
!GTK_WIDGET_REALIZED (child_widget))
|
||||
if (GTK_WIDGET_REALIZED (layout))
|
||||
gtk_widget_realize (child_widget);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (layout) &&
|
||||
!GTK_WIDGET_MAPPED (child_widget))
|
||||
if (GTK_WIDGET_VISIBLE (layout) && GTK_WIDGET_VISIBLE (child_widget))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (layout))
|
||||
gtk_widget_map (child_widget);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child_widget) && GTK_WIDGET_VISIBLE (layout))
|
||||
gtk_widget_queue_resize (child_widget);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_layout_move (GtkLayout *layout,
|
||||
@ -375,6 +381,8 @@ gtk_layout_class_init (GtkLayoutClass *class)
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
|
||||
|
||||
object_class->finalize = gtk_layout_finalize;
|
||||
|
||||
widget_class->realize = gtk_layout_realize;
|
||||
widget_class->unrealize = gtk_layout_unrealize;
|
||||
widget_class->map = gtk_layout_map;
|
||||
@ -383,6 +391,11 @@ gtk_layout_class_init (GtkLayoutClass *class)
|
||||
widget_class->draw = gtk_layout_draw;
|
||||
widget_class->expose_event = gtk_layout_expose;
|
||||
|
||||
container_class->remove = gtk_layout_remove;
|
||||
container_class->forall = gtk_layout_forall;
|
||||
|
||||
class->set_scroll_adjustments = gtk_layout_set_adjustments;
|
||||
|
||||
widget_class->set_scroll_adjustments_signal =
|
||||
gtk_signal_new ("set_scroll_adjustments",
|
||||
GTK_RUN_LAST,
|
||||
@ -390,11 +403,6 @@ gtk_layout_class_init (GtkLayoutClass *class)
|
||||
GTK_SIGNAL_OFFSET (GtkLayoutClass, set_scroll_adjustments),
|
||||
gtk_marshal_NONE__POINTER_POINTER,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
|
||||
|
||||
container_class->remove = gtk_layout_remove;
|
||||
container_class->forall = gtk_layout_forall;
|
||||
|
||||
class->set_scroll_adjustments = gtk_layout_set_adjustments;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -465,7 +473,7 @@ gtk_layout_realize (GtkWidget *widget)
|
||||
gtk_style_set_background (widget->style, layout->bin_window, GTK_STATE_NORMAL);
|
||||
|
||||
gdk_window_add_filter (widget->window, gtk_layout_main_filter, layout);
|
||||
gdk_window_add_filter (layout->bin_window, gtk_layout_filter, layout);
|
||||
/* gdk_window_add_filter (layout->bin_window, gtk_layout_filter, layout);*/
|
||||
|
||||
/* XXX: If we ever get multiple displays for GTK+, then gravity_works
|
||||
* will have to become a widget member. Right now we just
|
||||
@ -695,14 +703,14 @@ gtk_layout_remove (GtkContainer *container,
|
||||
|
||||
if (tmp_list)
|
||||
{
|
||||
GTK_PRIVATE_UNSET_FLAG (widget, GTK_IS_OFFSCREEN);
|
||||
|
||||
gtk_widget_unparent (widget);
|
||||
|
||||
layout->children = g_list_remove_link (layout->children, tmp_list);
|
||||
g_list_free_1 (tmp_list);
|
||||
g_free (child);
|
||||
}
|
||||
|
||||
GTK_PRIVATE_UNSET_FLAG (widget, GTK_IS_OFFSCREEN);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1065,15 +1073,39 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
|
||||
GdkEvent event;
|
||||
GtkWidget *event_widget;
|
||||
|
||||
if ((xevent.xany.window == GDK_WINDOW_XWINDOW (layout->bin_window)) &&
|
||||
(gtk_layout_filter (&xevent, &event, layout) == GDK_FILTER_REMOVE))
|
||||
continue;
|
||||
switch (xevent.type)
|
||||
{
|
||||
case Expose:
|
||||
|
||||
if (xevent.type == Expose)
|
||||
if (xevent.xany.window == GDK_WINDOW_XWINDOW (layout->bin_window))
|
||||
{
|
||||
/* If the window is unobscured, then we've exposed the
|
||||
* regions with the following serials already, so we
|
||||
* can throw out the expose events.
|
||||
*/
|
||||
if (layout->visibility == GDK_VISIBILITY_UNOBSCURED &&
|
||||
(((dx > 0 || dy > 0) &&
|
||||
xevent.xexpose.serial == layout->configure_serial) ||
|
||||
((dx < 0 || dy < 0) &&
|
||||
xevent.xexpose.serial == layout->configure_serial + 1)))
|
||||
continue;
|
||||
/* The following expose was generated while the origin was
|
||||
* different from the current origin, so we need to offset it.
|
||||
*/
|
||||
else if (xevent.xexpose.serial == layout->configure_serial)
|
||||
{
|
||||
xevent.xexpose.x += layout->scroll_x;
|
||||
xevent.xexpose.y += layout->scroll_y;
|
||||
}
|
||||
event.expose.window = layout->bin_window;
|
||||
event_widget = widget;
|
||||
}
|
||||
else
|
||||
{
|
||||
event.expose.window = gdk_window_lookup (xevent.xany.window);
|
||||
gdk_window_get_user_data (event.expose.window,
|
||||
(gpointer *)&event_widget);
|
||||
}
|
||||
|
||||
if (event_widget)
|
||||
{
|
||||
@ -1088,6 +1120,17 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
|
||||
gtk_widget_event (event_widget, &event);
|
||||
gdk_window_unref (event.expose.window);
|
||||
}
|
||||
break;
|
||||
|
||||
case ConfigureNotify:
|
||||
if (xevent.xany.window == GDK_WINDOW_XWINDOW (layout->bin_window) &&
|
||||
(xevent.xconfigure.x != 0 || xevent.xconfigure.y != 0))
|
||||
{
|
||||
layout->configure_serial = xevent.xconfigure.serial;
|
||||
layout->scroll_x = xevent.xconfigure.x;
|
||||
layout->scroll_y = xevent.xconfigure.y;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#elif defined (GDK_WINDOWING_WIN32)
|
||||
@ -1095,9 +1138,10 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* The main event filter. Actually, we probably don't really need
|
||||
* to install this as a filter at all, since we are calling it
|
||||
* directly above in the expose-handling hack. But in case scrollbars
|
||||
* this filter at all, since we are calling it directly above in the
|
||||
* expose-handling hack. But in case scrollbars
|
||||
* are fixed up in some manner...
|
||||
*
|
||||
* This routine identifies expose events that are generated when
|
||||
@ -1150,6 +1194,7 @@ gtk_layout_filter (GdkXEvent *gdk_xevent,
|
||||
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
#endif 0
|
||||
|
||||
/* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
|
||||
* there is no corresponding event in GTK, so we have
|
||||
|
@ -37,12 +37,22 @@ enum {
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_SELECTION_MODE
|
||||
};
|
||||
|
||||
#define SCROLL_TIME 100
|
||||
|
||||
/** GtkList Methods **/
|
||||
static void gtk_list_class_init (GtkListClass *klass);
|
||||
static void gtk_list_init (GtkList *list);
|
||||
|
||||
static void gtk_list_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_list_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
/** GtkObject Methods **/
|
||||
static void gtk_list_shutdown (GtkObject *object);
|
||||
|
||||
@ -230,6 +240,8 @@ gtk_list_class_init (GtkListClass *class)
|
||||
gtk_object_class_add_signals (object_class, list_signals, LAST_SIGNAL);
|
||||
|
||||
object_class->shutdown = gtk_list_shutdown;
|
||||
object_class->set_arg = gtk_list_set_arg;
|
||||
object_class->get_arg = gtk_list_get_arg;
|
||||
|
||||
widget_class->map = gtk_list_map;
|
||||
widget_class->unmap = gtk_list_unmap;
|
||||
@ -254,6 +266,10 @@ gtk_list_class_init (GtkListClass *class)
|
||||
class->selection_changed = NULL;
|
||||
class->select_child = gtk_real_list_select_child;
|
||||
class->unselect_child = gtk_real_list_unselect_child;
|
||||
|
||||
gtk_object_add_arg_type ("GtkList::selection_mode",
|
||||
GTK_TYPE_SELECTION_MODE, GTK_ARG_READWRITE,
|
||||
ARG_SELECTION_MODE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -280,6 +296,39 @@ gtk_list_init (GtkList *list)
|
||||
list->add_mode = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkList *list = GTK_LIST (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_SELECTION_MODE:
|
||||
gtk_list_set_selection_mode (list, GTK_VALUE_ENUM (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_list_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkList *list = GTK_LIST (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_SELECTION_MODE:
|
||||
GTK_VALUE_ENUM (*arg) = list->selection_mode;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_list_new (void)
|
||||
{
|
||||
@ -1104,15 +1153,16 @@ gtk_list_insert_items (GtkList *list,
|
||||
gtk_signal_connect (GTK_OBJECT (widget), "toggle",
|
||||
GTK_SIGNAL_FUNC (gtk_list_signal_item_toggle),
|
||||
list);
|
||||
if (GTK_WIDGET_VISIBLE (widget->parent))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (widget->parent) &&
|
||||
!GTK_WIDGET_REALIZED (widget))
|
||||
|
||||
if (GTK_WIDGET_REALIZED (widget->parent))
|
||||
gtk_widget_realize (widget);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (widget->parent) &&
|
||||
!GTK_WIDGET_MAPPED (widget))
|
||||
if (GTK_WIDGET_VISIBLE (widget->parent) && GTK_WIDGET_VISIBLE (widget))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (widget->parent))
|
||||
gtk_widget_map (widget);
|
||||
|
||||
gtk_widget_queue_resize (widget);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1155,9 +1205,6 @@ gtk_list_insert_items (GtkList *list,
|
||||
widget = list->children->data;
|
||||
gtk_list_select_child (list, widget);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (list))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (list));
|
||||
}
|
||||
|
||||
void
|
||||
@ -2409,19 +2456,14 @@ gtk_list_move_focus_child (GtkList *list,
|
||||
static gint
|
||||
gtk_list_horizontal_timeout (GtkWidget *list)
|
||||
{
|
||||
gint x, y;
|
||||
GdkEventMotion event;
|
||||
GdkModifierType mask;
|
||||
GdkEventMotion event = { 0 };
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
GTK_LIST (list)->htimer = 0;
|
||||
gdk_window_get_pointer (list->window, &x, &y, &mask);
|
||||
|
||||
event.is_hint = 0;
|
||||
event.x = x;
|
||||
event.y = y;
|
||||
event.state = mask;
|
||||
event.type = GDK_MOTION_NOTIFY;
|
||||
event.send_event = TRUE;
|
||||
|
||||
gtk_list_motion_notify (list, &event);
|
||||
|
||||
@ -2433,20 +2475,14 @@ gtk_list_horizontal_timeout (GtkWidget *list)
|
||||
static gint
|
||||
gtk_list_vertical_timeout (GtkWidget *list)
|
||||
{
|
||||
gint x;
|
||||
gint y;
|
||||
GdkEventMotion event;
|
||||
GdkModifierType mask;
|
||||
GdkEventMotion event = { 0 };
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
GTK_LIST (list)->vtimer = 0;
|
||||
gdk_window_get_pointer (list->window, &x, &y, &mask);
|
||||
|
||||
event.is_hint = 0;
|
||||
event.x = x;
|
||||
event.y = y;
|
||||
event.state = mask;
|
||||
event.type = GDK_MOTION_NOTIFY;
|
||||
event.send_event = TRUE;
|
||||
|
||||
gtk_list_motion_notify (list, &event);
|
||||
|
||||
|
@ -265,7 +265,7 @@ gtk_init_check (int *argc,
|
||||
|
||||
if (*module_name == '=')
|
||||
module_name++;
|
||||
else
|
||||
else if (i + 1 < *argc)
|
||||
{
|
||||
(*argv)[i] = NULL;
|
||||
i += 1;
|
||||
@ -273,6 +273,7 @@ gtk_init_check (int *argc,
|
||||
}
|
||||
(*argv)[i] = NULL;
|
||||
|
||||
if (module_name && *module_name)
|
||||
gtk_modules = g_slist_prepend (gtk_modules, g_strdup (module_name));
|
||||
}
|
||||
else if (strcmp ("--g-fatal-warnings", (*argv)[i]) == 0)
|
||||
@ -530,7 +531,9 @@ gtk_main (void)
|
||||
{
|
||||
quitf = quit_functions->data;
|
||||
|
||||
tmp_list = quit_functions;
|
||||
quit_functions = g_list_remove_link (quit_functions, quit_functions);
|
||||
g_list_free_1 (tmp_list);
|
||||
|
||||
if ((quitf->main_level && quitf->main_level != gtk_main_loop_level) ||
|
||||
gtk_quit_invoke_function (quitf))
|
||||
@ -539,7 +542,6 @@ gtk_main (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
g_list_free (tmp_list);
|
||||
gtk_quit_destroy (quitf);
|
||||
}
|
||||
}
|
||||
@ -581,13 +583,21 @@ gtk_main_quit (void)
|
||||
gint
|
||||
gtk_events_pending (void)
|
||||
{
|
||||
return g_main_pending();
|
||||
gboolean result;
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
result = g_main_pending();
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
gint
|
||||
gtk_main_iteration (void)
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
g_main_iteration (TRUE);
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
if (main_loops)
|
||||
return !g_main_is_running (main_loops->data);
|
||||
@ -598,7 +608,9 @@ gtk_main_iteration (void)
|
||||
gint
|
||||
gtk_main_iteration_do (gboolean blocking)
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
g_main_iteration (blocking);
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
if (main_loops)
|
||||
return !g_main_is_running (main_loops->data);
|
||||
@ -717,11 +729,17 @@ gtk_main_do_event (GdkEvent *event)
|
||||
break;
|
||||
|
||||
case GDK_DESTROY:
|
||||
/* Unexpected GDK_DESTROY from the outside, ignore for
|
||||
* child windows, handle like a GDK_DELETE for toplevels
|
||||
*/
|
||||
if (!event_widget->parent)
|
||||
{
|
||||
gtk_widget_ref (event_widget);
|
||||
gtk_widget_event (event_widget, event);
|
||||
if (!GTK_OBJECT_DESTROYED (event_widget))
|
||||
if (!gtk_widget_event (event_widget, event) &&
|
||||
!GTK_OBJECT_DESTROYED (event_widget))
|
||||
gtk_widget_destroy (event_widget);
|
||||
gtk_widget_unref (event_widget);
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_PROPERTY_NOTIFY:
|
||||
|
@ -1180,22 +1180,17 @@ gtk_menu_position (GtkMenu *menu)
|
||||
screen_width = gdk_screen_width ();
|
||||
screen_height = gdk_screen_height ();
|
||||
|
||||
x -= 2;
|
||||
y -= 2;
|
||||
|
||||
if ((x + requisition.width) > screen_width)
|
||||
x -= ((x + requisition.width) - screen_width);
|
||||
if (x < 0)
|
||||
x = 0;
|
||||
if ((y + requisition.height) > screen_height)
|
||||
y -= ((y + requisition.height) - screen_height);
|
||||
if (y < 0)
|
||||
y = 0;
|
||||
x = CLAMP (x - 2, 0, MAX (0, screen_width - requisition.width));
|
||||
y = CLAMP (y - 2, 0, MAX (0, screen_height - requisition.height));
|
||||
}
|
||||
|
||||
/* FIXME: The MAX() here is because gtk_widget_set_uposition
|
||||
* is broken. Once we provide an alternate interface that
|
||||
* allows negative values, then we can remove them.
|
||||
*/
|
||||
gtk_widget_set_uposition (GTK_MENU_SHELL (menu)->active ?
|
||||
menu->toplevel : menu->tearoff_window,
|
||||
x, y);
|
||||
MAX (x, 0), MAX (y, 0));
|
||||
}
|
||||
|
||||
/* Reparent the menu, taking care of the refcounting
|
||||
|
@ -63,6 +63,7 @@ static void gtk_real_menu_item_select (GtkItem *item);
|
||||
static void gtk_real_menu_item_deselect (GtkItem *item);
|
||||
static void gtk_real_menu_item_activate_item (GtkMenuItem *item);
|
||||
static gint gtk_menu_item_select_timeout (gpointer data);
|
||||
static void gtk_menu_item_select_timeout_unlocked (gpointer data);
|
||||
static void gtk_menu_item_position_menu (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
@ -552,7 +553,7 @@ gtk_real_menu_item_select (GtkItem *item)
|
||||
gtk_menu_item_select_timeout,
|
||||
menu_item);
|
||||
else
|
||||
gtk_menu_item_select_timeout (menu_item);
|
||||
gtk_menu_item_select_timeout_unlocked (menu_item);
|
||||
if(event) gdk_event_free(event);
|
||||
}
|
||||
|
||||
@ -628,10 +629,20 @@ gtk_real_menu_item_activate_item (GtkMenuItem *menu_item)
|
||||
static gint
|
||||
gtk_menu_item_select_timeout (gpointer data)
|
||||
{
|
||||
GtkMenuItem *menu_item;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
gtk_menu_item_select_timeout_unlocked (data);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_item_select_timeout_unlocked (gpointer data)
|
||||
{
|
||||
GtkMenuItem *menu_item;
|
||||
|
||||
menu_item = GTK_MENU_ITEM (data);
|
||||
menu_item->timer = 0;
|
||||
|
||||
@ -655,10 +666,6 @@ gtk_menu_item_select_timeout (gpointer data)
|
||||
gtk_menu_shell_select_item (submenu, submenu->children->data);
|
||||
}
|
||||
}
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -702,12 +709,6 @@ gtk_menu_item_position_menu (GtkMenu *menu,
|
||||
else
|
||||
ty += GTK_WIDGET (menu_item)->allocation.height;
|
||||
|
||||
if ((tx + twidth) > screen_width)
|
||||
{
|
||||
tx -= ((tx + twidth) - screen_width);
|
||||
if (tx < 0)
|
||||
tx = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_LEFT_RIGHT:
|
||||
@ -739,19 +740,16 @@ gtk_menu_item_position_menu (GtkMenu *menu,
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ty + GTK_WIDGET (menu_item)->allocation.height / 4 + theight) <= screen_height)
|
||||
ty += GTK_WIDGET (menu_item)->allocation.height / 4;
|
||||
else
|
||||
{
|
||||
ty -= ((ty + theight) - screen_height);
|
||||
if (ty < 0)
|
||||
ty = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
*x = tx;
|
||||
*y = ty;
|
||||
/* If we have negative, tx, ty here it is because we can't get
|
||||
* the menu all the way on screen. Favor the upper-left portion.
|
||||
*/
|
||||
*x = CLAMP (tx, 0, MAX (0, screen_width - twidth));
|
||||
*y = CLAMP (ty, 0, MAX (0, screen_height - theight));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -308,23 +308,20 @@ gtk_menu_shell_insert (GtkMenuShell *menu_shell,
|
||||
g_return_if_fail (child != NULL);
|
||||
g_return_if_fail (GTK_IS_MENU_ITEM (child));
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (menu_shell));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child->parent))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (child->parent) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (child->parent) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
gtk_widget_map (child);
|
||||
}
|
||||
|
||||
menu_shell->children = g_list_insert (menu_shell->children, child, position);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (menu_shell))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (menu_shell));
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (menu_shell));
|
||||
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (child->parent))
|
||||
gtk_widget_map (child);
|
||||
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -805,6 +802,7 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
|
||||
GtkWidget *menu_item,
|
||||
gboolean force_deactivate)
|
||||
{
|
||||
GSList *slist, *shells = NULL;
|
||||
gboolean deactivate = force_deactivate;
|
||||
|
||||
g_return_if_fail (menu_shell != NULL);
|
||||
@ -813,12 +811,23 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
|
||||
g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
|
||||
|
||||
if (!deactivate)
|
||||
{
|
||||
deactivate = GTK_MENU_ITEM_CLASS (GTK_OBJECT (menu_item)->klass)->hide_on_activate;
|
||||
}
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (menu_shell));
|
||||
|
||||
if (deactivate)
|
||||
{
|
||||
GtkMenuShell *parent_menu_shell = menu_shell;
|
||||
|
||||
do
|
||||
{
|
||||
gtk_widget_ref (GTK_WIDGET (parent_menu_shell));
|
||||
shells = g_slist_prepend (shells, parent_menu_shell);
|
||||
parent_menu_shell = (GtkMenuShell*) parent_menu_shell->parent_menu_shell;
|
||||
}
|
||||
while (parent_menu_shell);
|
||||
shells = g_slist_reverse (shells);
|
||||
|
||||
gtk_menu_shell_deactivate (menu_shell);
|
||||
|
||||
/* flush the x-queue, so any grabs are removed and
|
||||
@ -827,11 +836,15 @@ gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
|
||||
gdk_flush ();
|
||||
}
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (menu_shell));
|
||||
gtk_widget_activate (menu_item);
|
||||
|
||||
if (deactivate)
|
||||
gtk_signal_emit (GTK_OBJECT (menu_shell), menu_shell_signals[SELECTION_DONE]);
|
||||
for (slist = shells; slist; slist = slist->next)
|
||||
{
|
||||
gtk_signal_emit (slist->data, menu_shell_signals[SELECTION_DONE]);
|
||||
gtk_widget_unref (slist->data);
|
||||
}
|
||||
g_slist_free (shells);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (menu_shell));
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,8 @@ enum {
|
||||
ARG_TAB_HBORDER,
|
||||
ARG_TAB_VBORDER,
|
||||
ARG_PAGE,
|
||||
ARG_ENABLE_POPUP
|
||||
ARG_ENABLE_POPUP,
|
||||
ARG_HOMOGENEOUS
|
||||
};
|
||||
|
||||
enum {
|
||||
@ -94,6 +95,7 @@ static void gtk_notebook_get_arg (GtkObject *object,
|
||||
static void gtk_notebook_map (GtkWidget *widget);
|
||||
static void gtk_notebook_unmap (GtkWidget *widget);
|
||||
static void gtk_notebook_realize (GtkWidget *widget);
|
||||
static void gtk_notebook_unrealize (GtkWidget *widget);
|
||||
static void gtk_notebook_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_notebook_size_allocate (GtkWidget *widget,
|
||||
@ -258,6 +260,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
|
||||
gtk_object_add_arg_type ("GtkNotebook::show_border", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SHOW_BORDER);
|
||||
gtk_object_add_arg_type ("GtkNotebook::scrollable", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SCROLLABLE);
|
||||
gtk_object_add_arg_type ("GtkNotebook::enable_popup", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ENABLE_POPUP);
|
||||
gtk_object_add_arg_type ("GtkNotebook::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
|
||||
|
||||
gtk_container_add_child_arg_type ("GtkNotebook::tab_label", GTK_TYPE_STRING, GTK_ARG_READWRITE, CHILD_ARG_TAB_LABEL);
|
||||
gtk_container_add_child_arg_type ("GtkNotebook::menu_label", GTK_TYPE_STRING, GTK_ARG_READWRITE, CHILD_ARG_MENU_LABEL);
|
||||
@ -284,6 +287,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
|
||||
widget_class->map = gtk_notebook_map;
|
||||
widget_class->unmap = gtk_notebook_unmap;
|
||||
widget_class->realize = gtk_notebook_realize;
|
||||
widget_class->unrealize = gtk_notebook_unrealize;
|
||||
widget_class->size_request = gtk_notebook_size_request;
|
||||
widget_class->size_allocate = gtk_notebook_size_allocate;
|
||||
widget_class->draw = gtk_notebook_draw;
|
||||
@ -393,6 +397,9 @@ gtk_notebook_set_arg (GtkObject *object,
|
||||
else
|
||||
gtk_notebook_popup_disable (notebook);
|
||||
break;
|
||||
case ARG_HOMOGENEOUS:
|
||||
gtk_notebook_set_homogeneous_tabs (notebook, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
case ARG_PAGE:
|
||||
gtk_notebook_set_page (notebook, GTK_VALUE_INT (*arg));
|
||||
break;
|
||||
@ -436,6 +443,9 @@ gtk_notebook_get_arg (GtkObject *object,
|
||||
case ARG_ENABLE_POPUP:
|
||||
GTK_VALUE_BOOL (*arg) = notebook->menu != NULL;
|
||||
break;
|
||||
case ARG_HOMOGENEOUS:
|
||||
GTK_VALUE_BOOL (*arg) = notebook->homogeneous;
|
||||
break;
|
||||
case ARG_PAGE:
|
||||
GTK_VALUE_INT (*arg) = gtk_notebook_get_current_page (notebook);
|
||||
break;
|
||||
@ -564,6 +574,27 @@ gtk_notebook_realize (GtkWidget *widget)
|
||||
gtk_notebook_panel_realize (notebook);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_notebook_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkNotebook *notebook;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_NOTEBOOK (widget));
|
||||
|
||||
notebook = GTK_NOTEBOOK (widget);
|
||||
|
||||
if (notebook->panel)
|
||||
{
|
||||
gdk_window_set_user_data (notebook->panel, NULL);
|
||||
gdk_window_destroy (notebook->panel);
|
||||
notebook->panel = NULL;
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
||||
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_notebook_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
@ -2917,7 +2948,12 @@ gtk_notebook_pages_allocate (GtkNotebook *notebook,
|
||||
|
||||
if (GTK_WIDGET_REALIZED (notebook) &&
|
||||
page->tab_label && !GTK_WIDGET_MAPPED (page->tab_label))
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (page->tab_label))
|
||||
gtk_widget_map (page->tab_label);
|
||||
else
|
||||
gtk_widget_show (page->tab_label);
|
||||
}
|
||||
}
|
||||
|
||||
if (children)
|
||||
@ -2985,7 +3021,12 @@ gtk_notebook_pages_allocate (GtkNotebook *notebook,
|
||||
|
||||
if (GTK_WIDGET_REALIZED (notebook) && page->tab_label &&
|
||||
!GTK_WIDGET_MAPPED (page->tab_label))
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (page->tab_label))
|
||||
gtk_widget_map (page->tab_label);
|
||||
else
|
||||
gtk_widget_show (page->tab_label);
|
||||
}
|
||||
}
|
||||
}
|
||||
gtk_notebook_set_shape (notebook);
|
||||
@ -3026,16 +3067,14 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
|
||||
{
|
||||
case GTK_POS_TOP:
|
||||
width = widget->allocation.width;
|
||||
height = MAX (page->allocation.height, allocation->height) +
|
||||
ythickness;
|
||||
height = MAX (page->allocation.height, allocation->height) + ythickness;
|
||||
x = 0;
|
||||
y = border_width;
|
||||
break;
|
||||
|
||||
case GTK_POS_BOTTOM:
|
||||
width = widget->allocation.width + xthickness;
|
||||
height = MAX (page->allocation.height, allocation->height) +
|
||||
ythickness;
|
||||
height = MAX (page->allocation.height, allocation->height) + ythickness;
|
||||
x = 0;
|
||||
y = widget->allocation.height - height - border_width;
|
||||
break;
|
||||
@ -3069,11 +3108,13 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
|
||||
case GTK_POS_TOP:
|
||||
page->allocation.y += ythickness;
|
||||
case GTK_POS_BOTTOM:
|
||||
if (page->allocation.height > ythickness)
|
||||
page->allocation.height -= ythickness;
|
||||
break;
|
||||
case GTK_POS_LEFT:
|
||||
page->allocation.x += xthickness;
|
||||
case GTK_POS_RIGHT:
|
||||
if (page->allocation.width > xthickness)
|
||||
page->allocation.width -= xthickness;
|
||||
break;
|
||||
}
|
||||
@ -3088,8 +3129,8 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
|
||||
{
|
||||
child_allocation.x = (xthickness + FOCUS_WIDTH +
|
||||
notebook->tab_hborder);
|
||||
child_allocation.width = (page->allocation.width -
|
||||
2 * child_allocation.x);
|
||||
child_allocation.width = MAX (1, (((gint) page->allocation.width) -
|
||||
2 * child_allocation.x));
|
||||
child_allocation.x += page->allocation.x;
|
||||
}
|
||||
else
|
||||
@ -3103,8 +3144,8 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
|
||||
page->allocation.y);
|
||||
if (notebook->tab_pos == GTK_POS_TOP)
|
||||
child_allocation.y += ythickness;
|
||||
child_allocation.height = (page->allocation.height - ythickness -
|
||||
2 * (notebook->tab_vborder + FOCUS_WIDTH));
|
||||
child_allocation.height = MAX (1, (((gint) page->allocation.height) - ythickness -
|
||||
2 * (notebook->tab_vborder + FOCUS_WIDTH)));
|
||||
break;
|
||||
case GTK_POS_LEFT:
|
||||
case GTK_POS_RIGHT:
|
||||
@ -3112,23 +3153,21 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
|
||||
if (page->fill)
|
||||
{
|
||||
child_allocation.y = ythickness + padding;
|
||||
child_allocation.height = (page->allocation.height -
|
||||
2 * child_allocation.y);
|
||||
child_allocation.height = MAX (1, (((gint) page->allocation.height) -
|
||||
2 * child_allocation.y));
|
||||
child_allocation.y += page->allocation.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
child_allocation.y = (page->allocation.y +
|
||||
(page->allocation.height -
|
||||
child_allocation.y = (page->allocation.y + (page->allocation.height -
|
||||
tab_requisition.height) / 2);
|
||||
child_allocation.height = tab_requisition.height;
|
||||
}
|
||||
child_allocation.x = (page->allocation.x + notebook->tab_hborder +
|
||||
FOCUS_WIDTH);
|
||||
child_allocation.x = page->allocation.x + notebook->tab_hborder + FOCUS_WIDTH;
|
||||
if (notebook->tab_pos == GTK_POS_LEFT)
|
||||
child_allocation.x += xthickness;
|
||||
child_allocation.width = (page->allocation.width - xthickness -
|
||||
2 * (notebook->tab_hborder + FOCUS_WIDTH));
|
||||
child_allocation.width = MAX (1, (((gint) page->allocation.width) - xthickness -
|
||||
2 * (notebook->tab_hborder + FOCUS_WIDTH)));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3253,24 +3292,10 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
|
||||
notebook->focus_tab =
|
||||
g_list_find (notebook->children, notebook->cur_page);
|
||||
|
||||
gtk_notebook_pages_allocate (notebook, >K_WIDGET (notebook)->allocation);
|
||||
gtk_notebook_expose_tabs (notebook);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (notebook))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (notebook->cur_page->child))
|
||||
gtk_widget_map (notebook->cur_page->child);
|
||||
else
|
||||
{
|
||||
gtk_widget_map (notebook->cur_page->child);
|
||||
gtk_widget_size_allocate (GTK_WIDGET (notebook),
|
||||
>K_WIDGET (notebook)->allocation);
|
||||
}
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (notebook))
|
||||
gtk_widget_queue_draw (GTK_WIDGET (notebook));
|
||||
gtk_notebook_set_shape (notebook);
|
||||
gtk_widget_queue_resize (GTK_WIDGET (notebook));
|
||||
}
|
||||
|
||||
/* Private GtkNotebook Page Switch Functions:
|
||||
@ -3620,16 +3645,21 @@ gtk_notebook_insert_page_menu (GtkNotebook *notebook,
|
||||
gtk_notebook_switch_focus_tab (notebook, NULL);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (notebook))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (notebook) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (notebook))
|
||||
{
|
||||
if (GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (notebook) &&
|
||||
!GTK_WIDGET_MAPPED (child) && notebook->cur_page == page)
|
||||
!GTK_WIDGET_MAPPED (child) &&
|
||||
notebook->cur_page == page)
|
||||
gtk_widget_map (child);
|
||||
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
|
||||
if (tab_label)
|
||||
{
|
||||
if (notebook->show_tabs && GTK_WIDGET_VISIBLE (child))
|
||||
@ -3649,9 +3679,6 @@ gtk_notebook_insert_page_menu (GtkNotebook *notebook,
|
||||
gtk_widget_hide (tab_label);
|
||||
}
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (notebook))
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
|
||||
void
|
||||
@ -3948,7 +3975,7 @@ gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
|
||||
|
||||
void
|
||||
gtk_notebook_set_scrollable (GtkNotebook *notebook,
|
||||
gint scrollable)
|
||||
gboolean scrollable)
|
||||
{
|
||||
g_return_if_fail (notebook != NULL);
|
||||
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
|
||||
@ -3967,6 +3994,7 @@ gtk_notebook_set_scrollable (GtkNotebook *notebook,
|
||||
}
|
||||
else if (notebook->panel)
|
||||
{
|
||||
gdk_window_set_user_data (notebook->panel, NULL);
|
||||
gdk_window_destroy (notebook->panel);
|
||||
notebook->panel = NULL;
|
||||
}
|
||||
|
@ -670,6 +670,49 @@ gtk_object_getv (GtkObject *object,
|
||||
gtk_object_arg_get (object, args, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_get (GtkObject *object,
|
||||
const gchar *first_arg_name,
|
||||
...)
|
||||
{
|
||||
va_list var_args;
|
||||
gchar *name;
|
||||
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
|
||||
va_start (var_args, first_arg_name);
|
||||
|
||||
name = (gchar*) first_arg_name;
|
||||
while (name)
|
||||
{
|
||||
gpointer value_pointer = va_arg (var_args, gpointer);
|
||||
|
||||
if (value_pointer)
|
||||
{
|
||||
GtkArgInfo *info;
|
||||
gchar *error;
|
||||
GtkArg arg;
|
||||
|
||||
error = gtk_arg_get_info (GTK_OBJECT_TYPE (object),
|
||||
object_arg_info_ht,
|
||||
name,
|
||||
&info);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("gtk_object_get(): %s", error);
|
||||
g_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
arg.name = name;
|
||||
gtk_object_arg_get (object, &arg, info);
|
||||
gtk_arg_to_valueloc (&arg, value_pointer);
|
||||
}
|
||||
|
||||
name = va_arg (var_args, gchar*);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_set (GtkObject *object,
|
||||
const gchar *first_arg_name,
|
||||
|
@ -243,6 +243,14 @@ void gtk_object_destroy (GtkObject *object);
|
||||
void gtk_object_getv (GtkObject *object,
|
||||
guint n_args,
|
||||
GtkArg *args);
|
||||
/* gtk_object_get() sets the variable values pointed to by the adresses
|
||||
* passed after the argument names according to the arguments value.
|
||||
* if GTK_FUNDAMENTAL_TYPE (arg->type) == GTK_TYPE_STRING, it's
|
||||
* the callers response to do a g_free (retrived_value);
|
||||
*/
|
||||
void gtk_object_get (GtkObject *object,
|
||||
const gchar *first_arg_name,
|
||||
...);
|
||||
|
||||
/* gtk_object_set() takes a variable argument list of the form:
|
||||
* (..., gchar *arg_name, ARG_VALUES, [repeatedly name/value pairs,] NULL)
|
||||
|
@ -636,20 +636,16 @@ gtk_packer_add_defaults (GtkPacker *packer,
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (packer));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (packer)))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (GTK_WIDGET (packer)) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (GTK_WIDGET (packer)) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (child->parent))
|
||||
gtk_widget_map (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (packer))
|
||||
gtk_widget_queue_resize (child);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -690,20 +686,16 @@ gtk_packer_add (GtkPacker *packer,
|
||||
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (packer));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (GTK_WIDGET (packer)))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (GTK_WIDGET (packer)) &&
|
||||
!GTK_WIDGET_REALIZED (child))
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (GTK_WIDGET (packer)) &&
|
||||
!GTK_WIDGET_MAPPED (child))
|
||||
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (child->parent))
|
||||
gtk_widget_map (child);
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (packer))
|
||||
gtk_widget_queue_resize (child);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -979,7 +971,6 @@ gtk_packer_size_request (GtkWidget *widget,
|
||||
gint nvis_horz_children;
|
||||
gint width, height;
|
||||
gint maxWidth, maxHeight;
|
||||
GtkRequisition child_requisition;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_PACKER (widget));
|
||||
|
142
gtk/gtkpaned.c
142
gtk/gtkpaned.c
@ -26,9 +26,20 @@
|
||||
|
||||
#include "gtkpaned.h"
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_HANDLE_SIZE,
|
||||
ARG_GUTTER_SIZE
|
||||
};
|
||||
|
||||
static void gtk_paned_class_init (GtkPanedClass *klass);
|
||||
static void gtk_paned_init (GtkPaned *paned);
|
||||
static void gtk_paned_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_paned_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_paned_realize (GtkWidget *widget);
|
||||
static void gtk_paned_map (GtkWidget *widget);
|
||||
static void gtk_paned_unmap (GtkWidget *widget);
|
||||
@ -87,6 +98,9 @@ gtk_paned_class_init (GtkPanedClass *class)
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
|
||||
|
||||
object_class->set_arg = gtk_paned_set_arg;
|
||||
object_class->get_arg = gtk_paned_get_arg;
|
||||
|
||||
widget_class->realize = gtk_paned_realize;
|
||||
widget_class->map = gtk_paned_map;
|
||||
widget_class->unmap = gtk_paned_unmap;
|
||||
@ -97,6 +111,11 @@ gtk_paned_class_init (GtkPanedClass *class)
|
||||
container_class->remove = gtk_paned_remove;
|
||||
container_class->forall = gtk_paned_forall;
|
||||
container_class->child_type = gtk_paned_child_type;
|
||||
|
||||
gtk_object_add_arg_type ("GtkPaned::handle_size", GTK_TYPE_UINT,
|
||||
GTK_ARG_READWRITE, ARG_HANDLE_SIZE);
|
||||
gtk_object_add_arg_type ("GtkPaned::gutter_size", GTK_TYPE_UINT,
|
||||
GTK_ARG_READWRITE, ARG_GUTTER_SIZE);
|
||||
}
|
||||
|
||||
static GtkType
|
||||
@ -128,6 +147,44 @@ gtk_paned_init (GtkPaned *paned)
|
||||
paned->handle_ypos = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_paned_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkPaned *paned = GTK_PANED (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_HANDLE_SIZE:
|
||||
gtk_paned_set_handle_size (paned, GTK_VALUE_UINT (*arg));
|
||||
break;
|
||||
case ARG_GUTTER_SIZE:
|
||||
gtk_paned_set_gutter_size (paned, GTK_VALUE_UINT (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_paned_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkPaned *paned = GTK_PANED (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_HANDLE_SIZE:
|
||||
GTK_VALUE_UINT (*arg) = paned->handle_size;
|
||||
break;
|
||||
case ARG_GUTTER_SIZE:
|
||||
GTK_VALUE_UINT (*arg) = paned->gutter_size;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_paned_realize (GtkWidget *widget)
|
||||
@ -308,69 +365,63 @@ gtk_paned_add2 (GtkPaned *paned,
|
||||
|
||||
void
|
||||
gtk_paned_pack1 (GtkPaned *paned,
|
||||
GtkWidget *widget,
|
||||
GtkWidget *child,
|
||||
gboolean resize,
|
||||
gboolean shrink)
|
||||
{
|
||||
g_return_if_fail (paned != NULL);
|
||||
g_return_if_fail (GTK_IS_PANED (paned));
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||
|
||||
if (!paned->child1)
|
||||
{
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (paned));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget->parent))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (widget->parent) &&
|
||||
!GTK_WIDGET_REALIZED (widget))
|
||||
gtk_widget_realize (widget);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (widget->parent) &&
|
||||
!GTK_WIDGET_MAPPED (widget))
|
||||
gtk_widget_map (widget);
|
||||
}
|
||||
|
||||
paned->child1 = widget;
|
||||
paned->child1 = child;
|
||||
paned->child1_resize = resize;
|
||||
paned->child1_shrink = shrink;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (paned))
|
||||
gtk_widget_queue_resize (widget);
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (paned));
|
||||
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (child->parent))
|
||||
gtk_widget_map (child);
|
||||
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_paned_pack2 (GtkPaned *paned,
|
||||
GtkWidget *widget,
|
||||
GtkWidget *child,
|
||||
gboolean resize,
|
||||
gboolean shrink)
|
||||
{
|
||||
g_return_if_fail (paned != NULL);
|
||||
g_return_if_fail (GTK_IS_PANED (paned));
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (child));
|
||||
|
||||
if (!paned->child2)
|
||||
{
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (paned));
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget->parent))
|
||||
{
|
||||
if (GTK_WIDGET_REALIZED (widget->parent) &&
|
||||
!GTK_WIDGET_REALIZED (widget))
|
||||
gtk_widget_realize (widget);
|
||||
|
||||
if (GTK_WIDGET_MAPPED (widget->parent) &&
|
||||
!GTK_WIDGET_MAPPED (widget))
|
||||
gtk_widget_map (widget);
|
||||
}
|
||||
|
||||
paned->child2 = widget;
|
||||
paned->child2 = child;
|
||||
paned->child2_resize = resize;
|
||||
paned->child2_shrink = shrink;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (paned))
|
||||
gtk_widget_queue_resize (widget);
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (paned));
|
||||
|
||||
if (GTK_WIDGET_REALIZED (child->parent))
|
||||
gtk_widget_realize (child);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
if (GTK_WIDGET_MAPPED (child->parent))
|
||||
gtk_widget_map (child);
|
||||
|
||||
gtk_widget_queue_resize (child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,9 +506,13 @@ gtk_paned_set_position (GtkPaned *paned,
|
||||
|
||||
if (position >= 0)
|
||||
{
|
||||
paned->child1_size = CLAMP (position,
|
||||
paned->min_position,
|
||||
paned->max_position);
|
||||
/* We don't clamp here - the assumption is that
|
||||
* if the total allocation changes at the same time
|
||||
* as the position, the position set is with reference
|
||||
* to the new total size. If only the position changes,
|
||||
* then clamping will occur in gtk_paned_compute_position()
|
||||
*/
|
||||
paned->child1_size = position;
|
||||
paned->position_set = TRUE;
|
||||
}
|
||||
else
|
||||
@ -525,14 +580,17 @@ gtk_paned_compute_position (GtkPaned *paned,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paned->last_allocation < 0)
|
||||
paned->last_allocation = allocation;
|
||||
|
||||
/* If the position was set before the initial allocation.
|
||||
* (paned->last_allocation < 0) just clamp it and leave it.
|
||||
*/
|
||||
if (paned->last_allocation >= 0)
|
||||
{
|
||||
if (paned->child1_resize && !paned->child2_resize)
|
||||
paned->child1_size += (allocation - paned->last_allocation);
|
||||
else if (!(!paned->child1_resize && paned->child2_resize))
|
||||
paned->child1_size = allocation * ((gdouble)paned->child1_size / (paned->last_allocation));
|
||||
}
|
||||
}
|
||||
|
||||
paned->child1_size = CLAMP (paned->child1_size,
|
||||
paned->min_position,
|
||||
|
@ -33,6 +33,7 @@ static void gtk_plug_class_init (GtkPlugClass *klass);
|
||||
static void gtk_plug_init (GtkPlug *plug);
|
||||
|
||||
static void gtk_plug_realize (GtkWidget *widget);
|
||||
static void gtk_plug_unrealize (GtkWidget *widget);
|
||||
static gint gtk_plug_key_press_event (GtkWidget *widget,
|
||||
GdkEventKey *event);
|
||||
static void gtk_plug_forward_key_press (GtkPlug *plug, GdkEventKey *event);
|
||||
@ -44,6 +45,9 @@ static void gtk_plug_set_focus (GtkWindow *window,
|
||||
/* From Tk */
|
||||
#define EMBEDDED_APP_WANTS_FOCUS NotifyNormal+20
|
||||
|
||||
|
||||
static GtkWindowClass *parent_class = NULL;
|
||||
|
||||
GtkType
|
||||
gtk_plug_get_type ()
|
||||
{
|
||||
@ -77,7 +81,10 @@ gtk_plug_class_init (GtkPlugClass *class)
|
||||
widget_class = (GtkWidgetClass *)class;
|
||||
window_class = (GtkWindowClass *)class;
|
||||
|
||||
parent_class = gtk_type_class (gtk_window_get_type ());
|
||||
|
||||
widget_class->realize = gtk_plug_realize;
|
||||
widget_class->unrealize = gtk_plug_unrealize;
|
||||
widget_class->key_press_event = gtk_plug_key_press_event;
|
||||
widget_class->focus_in_event = gtk_plug_focus_in_event;
|
||||
widget_class->focus_out_event = gtk_plug_focus_out_event;
|
||||
@ -119,6 +126,27 @@ gtk_plug_new (guint32 socket_id)
|
||||
return GTK_WIDGET (plug);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_plug_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkPlug *plug;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_PLUG (widget));
|
||||
|
||||
plug = GTK_PLUG (widget);
|
||||
|
||||
if (plug->socket_window != NULL)
|
||||
{
|
||||
gdk_window_set_user_data (plug->socket_window, NULL);
|
||||
gdk_window_unref (plug->socket_window);
|
||||
plug->socket_window = NULL;
|
||||
}
|
||||
|
||||
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
||||
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_plug_realize (GtkWidget *widget)
|
||||
{
|
||||
|
@ -43,7 +43,6 @@ extern "C" {
|
||||
|
||||
typedef struct _GtkPlug GtkPlug;
|
||||
typedef struct _GtkPlugClass GtkPlugClass;
|
||||
typedef struct _GtkPlugButton GtkPlugButton;
|
||||
|
||||
|
||||
struct _GtkPlug
|
||||
|
@ -39,9 +39,20 @@
|
||||
|
||||
#define PREVIEW_CLASS(w) GTK_PREVIEW_CLASS (GTK_OBJECT (w)->klass)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_EXPAND
|
||||
};
|
||||
|
||||
|
||||
static void gtk_preview_class_init (GtkPreviewClass *klass);
|
||||
static void gtk_preview_init (GtkPreview *preview);
|
||||
static void gtk_preview_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_preview_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_preview_finalize (GtkObject *object);
|
||||
static void gtk_preview_realize (GtkWidget *widget);
|
||||
static void gtk_preview_size_allocate (GtkWidget *widget,
|
||||
@ -75,7 +86,7 @@ gtk_preview_get_type (void)
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
preview_type = gtk_type_unique (gtk_widget_get_type (), &preview_info);
|
||||
preview_type = gtk_type_unique (GTK_TYPE_WIDGET, &preview_info);
|
||||
}
|
||||
|
||||
return preview_type;
|
||||
@ -90,9 +101,11 @@ gtk_preview_class_init (GtkPreviewClass *klass)
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
widget_class = (GtkWidgetClass*) klass;
|
||||
|
||||
parent_class = gtk_type_class (gtk_widget_get_type ());
|
||||
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
|
||||
preview_class = klass;
|
||||
|
||||
object_class->set_arg = gtk_preview_set_arg;
|
||||
object_class->get_arg = gtk_preview_get_arg;
|
||||
object_class->finalize = gtk_preview_finalize;
|
||||
|
||||
widget_class->realize = gtk_preview_realize;
|
||||
@ -109,6 +122,46 @@ gtk_preview_class_init (GtkPreviewClass *klass)
|
||||
gdk_rgb_init ();
|
||||
klass->info.cmap = gdk_rgb_get_cmap ();
|
||||
klass->info.visual = gdk_rgb_get_visual ();
|
||||
|
||||
gtk_object_add_arg_type ("GtkPreview::expand",
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_EXPAND);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_preview_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkPreview *preview = GTK_PREVIEW (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_EXPAND:
|
||||
gtk_preview_set_expand (preview, GTK_VALUE_BOOL (*arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_preview_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id)
|
||||
{
|
||||
GtkPreview *preview;
|
||||
|
||||
preview = GTK_PREVIEW (object);
|
||||
|
||||
switch (arg_id)
|
||||
{
|
||||
case ARG_EXPAND:
|
||||
GTK_VALUE_BOOL (*arg) = preview->expand;
|
||||
break;
|
||||
default:
|
||||
arg->type = GTK_TYPE_INVALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -295,12 +348,18 @@ gtk_preview_draw_row (GtkPreview *preview,
|
||||
|
||||
void
|
||||
gtk_preview_set_expand (GtkPreview *preview,
|
||||
gint expand)
|
||||
gboolean expand)
|
||||
{
|
||||
g_return_if_fail (preview != NULL);
|
||||
g_return_if_fail (GTK_IS_PREVIEW (preview));
|
||||
|
||||
preview->expand = (expand != FALSE);
|
||||
expand = expand != FALSE;
|
||||
|
||||
if (preview->expand != expand)
|
||||
{
|
||||
preview->expand = expand;
|
||||
gtk_widget_queue_resize (GTK_WIDGET (preview));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -539,7 +598,7 @@ gtk_preview_make_buffer (GtkPreview *preview)
|
||||
}
|
||||
}
|
||||
|
||||
/* This will be useful for implementing gamma. */
|
||||
/* This is used for implementing gamma. */
|
||||
static void
|
||||
gtk_fill_lookup_array (guchar *array)
|
||||
{
|
||||
|
@ -36,9 +36,11 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GTK_PREVIEW(obj) GTK_CHECK_CAST (obj, gtk_preview_get_type (), GtkPreview)
|
||||
#define GTK_PREVIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_preview_get_type (), GtkPreviewClass)
|
||||
#define GTK_IS_PREVIEW(obj) GTK_CHECK_TYPE (obj, gtk_preview_get_type ())
|
||||
#define GTK_TYPE_PREVIEW (gtk_preview_get_type ())
|
||||
#define GTK_PREVIEW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PREVIEW, GtkPreview))
|
||||
#define GTK_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PREVIEW, GtkPreviewClass))
|
||||
#define GTK_IS_PREVIEW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PREVIEW))
|
||||
#define GTK_IS_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PREVIEW))
|
||||
|
||||
|
||||
typedef struct _GtkPreview GtkPreview;
|
||||
@ -109,7 +111,7 @@ void gtk_preview_draw_row (GtkPreview *preview,
|
||||
gint y,
|
||||
gint w);
|
||||
void gtk_preview_set_expand (GtkPreview *preview,
|
||||
gint expand);
|
||||
gboolean expand);
|
||||
|
||||
void gtk_preview_set_gamma (double gamma);
|
||||
void gtk_preview_set_color_cube (guint nred_shades,
|
||||
|
@ -48,7 +48,8 @@ typedef enum
|
||||
PRIVATE_GTK_LEAVE_PENDING = 1 << 4,
|
||||
PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5,
|
||||
PRIVATE_GTK_IN_REPARENT = 1 << 6,
|
||||
PRIVATE_GTK_IS_OFFSCREEN = 1 << 7
|
||||
PRIVATE_GTK_IS_OFFSCREEN = 1 << 7,
|
||||
PRIVATE_GTK_FULLDRAW_PENDING = 1 << 8
|
||||
} GtkPrivateFlags;
|
||||
|
||||
/* Macros for extracting a widgets private_flags from GtkWidget.
|
||||
@ -62,6 +63,7 @@ typedef enum
|
||||
#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0)
|
||||
#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0)
|
||||
#define GTK_WIDGET_IS_OFFSCREEN(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IS_OFFSCREEN) != 0)
|
||||
#define GTK_WIDGET_FULLDRAW_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_FULLDRAW_PENDING) != 0)
|
||||
|
||||
/* Macros for setting and clearing private widget flags.
|
||||
* we use a preprocessor string concatenation here for a clear
|
||||
|
@ -30,10 +30,12 @@
|
||||
|
||||
static void gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass);
|
||||
static void gtk_radio_menu_item_init (GtkRadioMenuItem *radio_menu_item);
|
||||
static void gtk_radio_menu_item_destroy (GtkObject *object);
|
||||
static void gtk_radio_menu_item_activate (GtkMenuItem *menu_item);
|
||||
static void gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
|
||||
GdkRectangle *area);
|
||||
|
||||
static GtkCheckMenuItemClass *parent_class = NULL;
|
||||
|
||||
GtkType
|
||||
gtk_radio_menu_item_get_type (void)
|
||||
@ -149,12 +151,18 @@ gtk_radio_menu_item_group (GtkRadioMenuItem *radio_menu_item)
|
||||
static void
|
||||
gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkMenuItemClass *menu_item_class;
|
||||
GtkCheckMenuItemClass *check_menu_item_class;
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
menu_item_class = (GtkMenuItemClass*) klass;
|
||||
check_menu_item_class = (GtkCheckMenuItemClass*) klass;
|
||||
|
||||
parent_class = gtk_type_class (gtk_check_menu_item_get_type ());
|
||||
|
||||
object_class->destroy = gtk_radio_menu_item_destroy;
|
||||
|
||||
menu_item_class->activate = gtk_radio_menu_item_activate;
|
||||
|
||||
check_menu_item_class->draw_indicator = gtk_radio_menu_item_draw_indicator;
|
||||
@ -166,6 +174,34 @@ gtk_radio_menu_item_init (GtkRadioMenuItem *radio_menu_item)
|
||||
radio_menu_item->group = g_slist_prepend (NULL, radio_menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_radio_menu_item_destroy (GtkObject *object)
|
||||
{
|
||||
GtkRadioMenuItem *radio_menu_item;
|
||||
GtkRadioMenuItem *tmp_menu_item;
|
||||
GSList *tmp_list;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_RADIO_MENU_ITEM (object));
|
||||
|
||||
radio_menu_item = GTK_RADIO_MENU_ITEM (object);
|
||||
|
||||
radio_menu_item->group = g_slist_remove (radio_menu_item->group,
|
||||
radio_menu_item);
|
||||
tmp_list = radio_menu_item->group;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
tmp_menu_item = tmp_list->data;
|
||||
tmp_list = tmp_list->next;
|
||||
|
||||
tmp_menu_item->group = radio_menu_item->group;
|
||||
}
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_radio_menu_item_activate (GtkMenuItem *menu_item)
|
||||
{
|
||||
|
@ -1,6 +1,8 @@
|
||||
style "default" {
|
||||
style "gtk-default-bg" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-microsoft-cp1251"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-microsoft-cp1251,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-microsoft-cp1251"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-bg"
|
||||
|
||||
|
344
gtk/gtkrc.c
344
gtk/gtkrc.c
@ -60,6 +60,7 @@
|
||||
typedef struct _GtkRcSet GtkRcSet;
|
||||
typedef struct _GtkRcNode GtkRcNode;
|
||||
typedef struct _GtkRcFile GtkRcFile;
|
||||
typedef struct _GtkRcStylePrivate GtkRcStylePrivate;
|
||||
|
||||
struct _GtkRcSet
|
||||
{
|
||||
@ -75,6 +76,15 @@ struct _GtkRcFile
|
||||
gboolean reload;
|
||||
};
|
||||
|
||||
struct _GtkRcStylePrivate
|
||||
{
|
||||
GtkRcStyle style;
|
||||
|
||||
guint ref_count;
|
||||
/* list of RC style lists including this RC style */
|
||||
GSList *rc_style_lists;
|
||||
};
|
||||
|
||||
static guint gtk_rc_style_hash (const char *name);
|
||||
static gint gtk_rc_style_compare (const char *a,
|
||||
const char *b);
|
||||
@ -124,7 +134,6 @@ static void gtk_rc_clear_hash_node (gpointer key,
|
||||
static void gtk_rc_clear_styles (void);
|
||||
static void gtk_rc_append_default_pixmap_path (void);
|
||||
static void gtk_rc_append_default_module_path (void);
|
||||
static void gtk_rc_append_pixmap_path (gchar *dir);
|
||||
static void gtk_rc_add_initial_default_files (void);
|
||||
|
||||
|
||||
@ -220,6 +229,11 @@ static gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS];
|
||||
#define GTK_RC_MAX_MODULE_PATHS 128
|
||||
static gchar *module_path[GTK_RC_MAX_MODULE_PATHS];
|
||||
|
||||
/* A stack of directories for RC files we are parsing currently.
|
||||
* these are implicitely added to the end of PIXMAP_PATHS
|
||||
*/
|
||||
GSList *rc_dir_stack = NULL;
|
||||
|
||||
/* The files we have parsed, to reread later if necessary */
|
||||
GSList *rc_files = NULL;
|
||||
|
||||
@ -319,18 +333,6 @@ gtk_rc_append_default_pixmap_path(void)
|
||||
pixmap_path[n] = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rc_append_pixmap_path(gchar *dir)
|
||||
{
|
||||
gint n;
|
||||
|
||||
for (n = 0; pixmap_path[n]; n++) ;
|
||||
if (n >= GTK_RC_MAX_MODULE_PATHS - 1)
|
||||
return;
|
||||
pixmap_path[n++] = g_strdup(dir);
|
||||
pixmap_path[n] = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rc_append_default_module_path(void)
|
||||
{
|
||||
@ -459,26 +461,79 @@ gtk_rc_get_default_files (void)
|
||||
return gtk_rc_default_files;
|
||||
}
|
||||
|
||||
/* The following routine is based on _nl_normalize_codeset from
|
||||
* the GNU C library. Contributed by
|
||||
*
|
||||
* Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
*
|
||||
* Normalize codeset name. There is no standard for the codeset
|
||||
* names. Normalization allows the user to use any of the common
|
||||
* names.
|
||||
*/
|
||||
static char *
|
||||
_gtk_normalize_codeset (const char *codeset, int name_len)
|
||||
{
|
||||
int len = 0;
|
||||
int only_digit = 1;
|
||||
char *retval;
|
||||
char *wp;
|
||||
int cnt;
|
||||
|
||||
for (cnt = 0; cnt < name_len; ++cnt)
|
||||
if (isalnum (codeset[cnt]))
|
||||
{
|
||||
++len;
|
||||
|
||||
if (isalpha (codeset[cnt]))
|
||||
only_digit = 0;
|
||||
}
|
||||
|
||||
retval = g_malloc ((only_digit ? 3 : 0) + len + 1);
|
||||
|
||||
if (only_digit)
|
||||
{
|
||||
strcpy (retval, "iso");
|
||||
wp = retval + 3;
|
||||
}
|
||||
else
|
||||
wp = retval;
|
||||
|
||||
for (cnt = 0; cnt < name_len; ++cnt)
|
||||
if (isalpha (codeset[cnt]))
|
||||
*wp++ = isupper(codeset[cnt]) ? tolower (codeset[cnt]) : codeset[cnt];
|
||||
else if (isdigit (codeset[cnt]))
|
||||
*wp++ = codeset[cnt];
|
||||
|
||||
*wp = '\0';
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_rc_init (void)
|
||||
{
|
||||
gchar *locale_suffixes[3];
|
||||
gint n_locale_suffixes = 0;
|
||||
gint i, j;
|
||||
#ifdef G_OS_WIN32
|
||||
char *locale = g_win32_getlocale ();
|
||||
#else
|
||||
#ifdef HAVE_LC_MESSAGES
|
||||
char *locale = setlocale (LC_MESSAGES, NULL);
|
||||
#else
|
||||
char *locale = setlocale (LC_CTYPE, NULL);
|
||||
#endif
|
||||
#endif
|
||||
guint length;
|
||||
char *p;
|
||||
static gchar *locale_suffixes[3];
|
||||
static gint n_locale_suffixes = 0;
|
||||
|
||||
gint i, j;
|
||||
|
||||
static gboolean initted = FALSE;
|
||||
|
||||
if (!initted)
|
||||
{
|
||||
gint length;
|
||||
gchar *locale;
|
||||
gchar *p;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
locale = g_win32_getlocale ();
|
||||
#else
|
||||
locale = setlocale (LC_CTYPE, NULL);
|
||||
#endif
|
||||
|
||||
initted = TRUE;
|
||||
|
||||
rc_style_ht = g_hash_table_new ((GHashFunc) gtk_rc_style_hash,
|
||||
(GCompareFunc) gtk_rc_style_compare);
|
||||
pixmap_path[0] = NULL;
|
||||
module_path[0] = NULL;
|
||||
gtk_rc_append_default_pixmap_path();
|
||||
@ -489,25 +544,43 @@ gtk_rc_init (void)
|
||||
if (strcmp (locale, "C") && strcmp (locale, "POSIX"))
|
||||
{
|
||||
/* Determine locale-specific suffixes for RC files
|
||||
*
|
||||
* We normalize the charset into a standard form,
|
||||
* which has all '-' and '_' characters removed,
|
||||
* and is lowercase.
|
||||
*/
|
||||
gchar *normalized_locale;
|
||||
|
||||
p = strchr (locale, '@');
|
||||
length = p ? (p -locale) : strlen (locale);
|
||||
|
||||
p = strchr (locale, '.');
|
||||
if (p)
|
||||
{
|
||||
locale_suffixes[n_locale_suffixes++] = g_strndup (locale, length);
|
||||
gchar *tmp1 = g_strndup (locale, p - locale + 1);
|
||||
gchar *tmp2 = _gtk_normalize_codeset (p + 1, length - (p - locale + 1));
|
||||
|
||||
normalized_locale = g_strconcat (tmp1, tmp2, NULL);
|
||||
g_free (tmp1);
|
||||
g_free (tmp2);
|
||||
|
||||
locale_suffixes[n_locale_suffixes++] = g_strdup (normalized_locale);
|
||||
length = p - locale;
|
||||
}
|
||||
else
|
||||
normalized_locale = g_strndup (locale, length);
|
||||
|
||||
p = strchr (locale, '_');
|
||||
p = strchr (normalized_locale, '_');
|
||||
if (p)
|
||||
{
|
||||
locale_suffixes[n_locale_suffixes++] = g_strndup (locale, length);
|
||||
length = p - locale;
|
||||
locale_suffixes[n_locale_suffixes++] = g_strndup (normalized_locale, length);
|
||||
length = p - normalized_locale;
|
||||
}
|
||||
|
||||
locale_suffixes[n_locale_suffixes++] = g_strndup (locale, length);
|
||||
locale_suffixes[n_locale_suffixes++] = g_strndup (normalized_locale, length);
|
||||
|
||||
g_free (normalized_locale);
|
||||
}
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -595,6 +668,7 @@ gtk_rc_parse_file (const gchar *filename, gboolean reload)
|
||||
if (!lstat (rc_file->canonical_name, &statbuf))
|
||||
{
|
||||
gint fd;
|
||||
GSList *tmp_list;
|
||||
|
||||
rc_file->mtime = statbuf.st_mtime;
|
||||
|
||||
@ -602,20 +676,19 @@ gtk_rc_parse_file (const gchar *filename, gboolean reload)
|
||||
if (fd < 0)
|
||||
return;
|
||||
|
||||
{
|
||||
gint i;
|
||||
gchar *dir;
|
||||
|
||||
dir = g_strdup(rc_file->canonical_name);
|
||||
for (i = strlen(dir) - 1; (i >= 0) && (dir[i] != G_DIR_SEPARATOR); i--)
|
||||
dir[i] = 0;
|
||||
if (i >= 0 && dir[i] == G_DIR_SEPARATOR)
|
||||
dir[i] = 0;
|
||||
gtk_rc_append_pixmap_path(dir);
|
||||
g_free(dir);
|
||||
}
|
||||
/* Temporarily push directory name for this file on
|
||||
* a stack of directory names while parsing it
|
||||
*/
|
||||
rc_dir_stack = g_slist_prepend (rc_dir_stack,
|
||||
g_dirname (rc_file->canonical_name));
|
||||
gtk_rc_parse_any (filename, fd, NULL);
|
||||
|
||||
tmp_list = rc_dir_stack;
|
||||
rc_dir_stack = rc_dir_stack->next;
|
||||
|
||||
g_free (tmp_list->data);
|
||||
g_slist_free_1 (tmp_list);
|
||||
|
||||
close (fd);
|
||||
}
|
||||
}
|
||||
@ -633,12 +706,12 @@ gtk_rc_parse (const gchar *filename)
|
||||
GtkRcStyle *
|
||||
gtk_rc_style_new (void)
|
||||
{
|
||||
GtkRcStyle *new_style;
|
||||
GtkRcStylePrivate *new_style;
|
||||
|
||||
new_style = g_new0 (GtkRcStyle, 1);
|
||||
new_style = g_new0 (GtkRcStylePrivate, 1);
|
||||
new_style->ref_count = 1;
|
||||
|
||||
return new_style;
|
||||
return (GtkRcStyle *)new_style;
|
||||
}
|
||||
|
||||
void
|
||||
@ -646,21 +719,62 @@ gtk_rc_style_ref (GtkRcStyle *rc_style)
|
||||
{
|
||||
g_return_if_fail (rc_style != NULL);
|
||||
|
||||
rc_style->ref_count++;
|
||||
((GtkRcStylePrivate *)rc_style)->ref_count++;
|
||||
}
|
||||
|
||||
/* Like g_slist_remove, but remove all copies of data */
|
||||
static GSList*
|
||||
gtk_rc_slist_remove_all (GSList *list,
|
||||
gpointer data)
|
||||
{
|
||||
GSList *tmp;
|
||||
GSList *prev;
|
||||
|
||||
prev = NULL;
|
||||
tmp = list;
|
||||
|
||||
while (tmp)
|
||||
{
|
||||
if (tmp->data == data)
|
||||
{
|
||||
if (list == tmp)
|
||||
list = list->next;
|
||||
|
||||
if (prev)
|
||||
prev->next = tmp->next;
|
||||
|
||||
g_slist_free_1 (tmp);
|
||||
|
||||
if (prev)
|
||||
tmp = prev->next;
|
||||
else
|
||||
tmp = list;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev = tmp;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_rc_style_unref (GtkRcStyle *rc_style)
|
||||
{
|
||||
GtkRcStylePrivate *private = (GtkRcStylePrivate *)rc_style;
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (rc_style != NULL);
|
||||
g_return_if_fail (rc_style->ref_count > 0);
|
||||
g_return_if_fail (private->ref_count > 0);
|
||||
|
||||
rc_style->ref_count--;
|
||||
private->ref_count--;
|
||||
|
||||
if (rc_style->ref_count == 0)
|
||||
if (private->ref_count == 0)
|
||||
{
|
||||
GSList *tmp_list1, *tmp_list2;
|
||||
|
||||
if (rc_style->engine)
|
||||
{
|
||||
rc_style->engine->destroy_rc_style (rc_style);
|
||||
@ -678,16 +792,42 @@ gtk_rc_style_unref (GtkRcStyle *rc_style)
|
||||
if (rc_style->bg_pixmap_name[i])
|
||||
g_free (rc_style->bg_pixmap_name[i]);
|
||||
|
||||
g_free (rc_style);
|
||||
}
|
||||
/* Now remove all references to this rc_style from
|
||||
* realized_style_ht
|
||||
*/
|
||||
tmp_list1 = private->rc_style_lists;
|
||||
while (tmp_list1)
|
||||
{
|
||||
GSList *rc_styles = tmp_list1->data;
|
||||
GtkStyle *style = g_hash_table_lookup (realized_style_ht, rc_styles);
|
||||
gtk_style_unref (style);
|
||||
|
||||
/* Remove the list of styles from the other rc_styles
|
||||
* in the list
|
||||
*/
|
||||
tmp_list2 = rc_styles;
|
||||
while (tmp_list2)
|
||||
{
|
||||
GtkRcStylePrivate *other_style = tmp_list2->data;
|
||||
|
||||
if (other_style != private)
|
||||
other_style->rc_style_lists =
|
||||
gtk_rc_slist_remove_all (other_style->rc_style_lists, rc_styles);
|
||||
|
||||
tmp_list2 = tmp_list2->next;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_rc_clear_realized_node (gpointer key,
|
||||
gpointer data,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_style_unref (data);
|
||||
/* And from the hash table itself
|
||||
*/
|
||||
g_hash_table_remove (realized_style_ht, rc_styles);
|
||||
g_slist_free (rc_styles);
|
||||
|
||||
tmp_list1 = tmp_list1->next;
|
||||
}
|
||||
g_slist_free (private->rc_style_lists);
|
||||
|
||||
g_free (private);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -725,13 +865,6 @@ gtk_rc_clear_styles (void)
|
||||
rc_style_ht = NULL;
|
||||
}
|
||||
|
||||
if (realized_style_ht)
|
||||
{
|
||||
g_hash_table_foreach (realized_style_ht, gtk_rc_clear_realized_node, NULL);
|
||||
g_hash_table_destroy (realized_style_ht);
|
||||
realized_style_ht = NULL;
|
||||
}
|
||||
|
||||
gtk_rc_free_rc_sets (gtk_rc_sets_widget);
|
||||
g_slist_free (gtk_rc_sets_widget);
|
||||
gtk_rc_sets_widget = NULL;
|
||||
@ -743,8 +876,6 @@ gtk_rc_clear_styles (void)
|
||||
gtk_rc_free_rc_sets (gtk_rc_sets_class);
|
||||
g_slist_free (gtk_rc_sets_class);
|
||||
gtk_rc_sets_class = NULL;
|
||||
|
||||
gtk_rc_init ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -1081,11 +1212,10 @@ gtk_rc_style_compare (const char *a,
|
||||
static GtkRcStyle*
|
||||
gtk_rc_style_find (const char *name)
|
||||
{
|
||||
GtkRcStyle *rc_style;
|
||||
|
||||
rc_style = g_hash_table_lookup (rc_style_ht, (gpointer) name);
|
||||
|
||||
return rc_style;
|
||||
if (rc_style_ht)
|
||||
return g_hash_table_lookup (rc_style_ht, (gpointer) name);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Assumes ownership of rc_style */
|
||||
@ -1148,7 +1278,6 @@ gtk_rc_style_init (GSList *rc_styles)
|
||||
gint i;
|
||||
|
||||
GtkStyle *style = NULL;
|
||||
GtkRcStyle *proto_style;
|
||||
|
||||
if (!realized_style_ht)
|
||||
realized_style_ht = g_hash_table_new ((GHashFunc)gtk_rc_styles_hash,
|
||||
@ -1158,13 +1287,16 @@ gtk_rc_style_init (GSList *rc_styles)
|
||||
|
||||
if (!style)
|
||||
{
|
||||
GSList *tmp_styles = rc_styles;
|
||||
GtkRcStyle *proto_style;
|
||||
GSList *tmp_styles;
|
||||
|
||||
proto_style = gtk_rc_style_new ();
|
||||
|
||||
tmp_styles = rc_styles;
|
||||
while (tmp_styles)
|
||||
{
|
||||
GtkRcStyle *rc_style = tmp_styles->data;
|
||||
GtkRcStylePrivate *rc_style_private;
|
||||
|
||||
for (i=0; i<5; i++)
|
||||
{
|
||||
@ -1212,6 +1344,12 @@ gtk_rc_style_init (GSList *rc_styles)
|
||||
(proto_style->engine == rc_style->engine))
|
||||
proto_style->engine->merge_rc_style (proto_style, rc_style);
|
||||
|
||||
/* Point from each rc_style to the list of styles */
|
||||
|
||||
rc_style_private = (GtkRcStylePrivate *)rc_style;
|
||||
if (!g_slist_find (rc_style_private->rc_style_lists, rc_styles))
|
||||
rc_style_private->rc_style_lists = g_slist_prepend (rc_style_private->rc_style_lists, rc_styles);
|
||||
|
||||
tmp_styles = tmp_styles->next;
|
||||
}
|
||||
|
||||
@ -1227,6 +1365,8 @@ gtk_rc_style_init (GSList *rc_styles)
|
||||
|
||||
g_hash_table_insert (realized_style_ht, rc_styles, style);
|
||||
}
|
||||
else
|
||||
g_slist_free (rc_styles);
|
||||
|
||||
return style;
|
||||
}
|
||||
@ -1301,7 +1441,7 @@ gtk_rc_parse_style (GScanner *scanner)
|
||||
return G_TOKEN_STRING;
|
||||
|
||||
insert = FALSE;
|
||||
rc_style = g_hash_table_lookup (rc_style_ht, scanner->value.v_string);
|
||||
rc_style = gtk_rc_style_find (scanner->value.v_string);
|
||||
|
||||
if (!rc_style)
|
||||
{
|
||||
@ -1333,7 +1473,7 @@ gtk_rc_parse_style (GScanner *scanner)
|
||||
return G_TOKEN_STRING;
|
||||
}
|
||||
|
||||
parent_style = g_hash_table_lookup (rc_style_ht, scanner->value.v_string);
|
||||
parent_style = gtk_rc_style_find (scanner->value.v_string);
|
||||
if (parent_style)
|
||||
{
|
||||
for (i = 0; i < 5; i++)
|
||||
@ -1449,7 +1589,13 @@ gtk_rc_parse_style (GScanner *scanner)
|
||||
}
|
||||
|
||||
if (insert)
|
||||
{
|
||||
if (!rc_style_ht)
|
||||
rc_style_ht = g_hash_table_new ((GHashFunc) gtk_rc_style_hash,
|
||||
(GCompareFunc) gtk_rc_style_compare);
|
||||
|
||||
g_hash_table_insert (rc_style_ht, rc_style->name, rc_style);
|
||||
}
|
||||
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
@ -1586,18 +1732,13 @@ gtk_rc_parse_bg_pixmap (GScanner *scanner,
|
||||
return G_TOKEN_NONE;
|
||||
}
|
||||
|
||||
gchar*
|
||||
gtk_rc_find_pixmap_in_path (GScanner *scanner,
|
||||
const gchar *pixmap_file)
|
||||
static gchar*
|
||||
gtk_rc_check_pixmap_dir (const gchar *dir, const gchar *pixmap_file)
|
||||
{
|
||||
gint i;
|
||||
gint fd;
|
||||
gchar *buf;
|
||||
gint fd;
|
||||
|
||||
for (i = 0; (i < GTK_RC_MAX_PIXMAP_PATHS) && (pixmap_path[i] != NULL); i++)
|
||||
{
|
||||
buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s",
|
||||
pixmap_path[i], pixmap_file);
|
||||
buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", dir, pixmap_file);
|
||||
|
||||
fd = open (buf, O_RDONLY);
|
||||
if (fd >= 0)
|
||||
@ -1607,6 +1748,33 @@ gtk_rc_find_pixmap_in_path (GScanner *scanner,
|
||||
}
|
||||
|
||||
g_free (buf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gchar*
|
||||
gtk_rc_find_pixmap_in_path (GScanner *scanner,
|
||||
const gchar *pixmap_file)
|
||||
{
|
||||
gint i;
|
||||
gchar *filename;
|
||||
GSList *tmp_list;
|
||||
|
||||
for (i = 0; (i < GTK_RC_MAX_PIXMAP_PATHS) && (pixmap_path[i] != NULL); i++)
|
||||
{
|
||||
filename = gtk_rc_check_pixmap_dir (pixmap_path[i], pixmap_file);
|
||||
if (filename)
|
||||
return filename;
|
||||
}
|
||||
|
||||
tmp_list = rc_dir_stack;
|
||||
while (tmp_list)
|
||||
{
|
||||
filename = gtk_rc_check_pixmap_dir (tmp_list->data, pixmap_file);
|
||||
if (filename)
|
||||
return filename;
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
if (scanner)
|
||||
|
@ -1,6 +1,8 @@
|
||||
style "default" {
|
||||
style "gtk-default-el" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-7"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-7,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-7"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-el"
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
style "default" {
|
||||
style "gtk-default-eo" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-3"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-3,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-3"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-eo"
|
||||
|
||||
|
@ -58,9 +58,6 @@ struct _GtkRcStyle
|
||||
|
||||
GtkThemeEngine *engine;
|
||||
gpointer engine_data;
|
||||
|
||||
/* Private */
|
||||
guint ref_count;
|
||||
};
|
||||
|
||||
void gtk_rc_init (void);
|
||||
|
@ -1,6 +1,6 @@
|
||||
style "default" {
|
||||
style "gtk-default-he" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-*-medium-r-normal--12-*-*-*-*-*-iso8859-8"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-he"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
style "default" {
|
||||
style "gtk-default-hy" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-armnet helvetica-medium-r-normal--12-*-*-*-*-*-armscii-8"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-hy"
|
||||
|
||||
|
7
gtk/gtkrc.iso-8859-13
Normal file
7
gtk/gtkrc.iso-8859-13
Normal file
@ -0,0 +1,7 @@
|
||||
style "gtk-default-iso-8859-13" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-13,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-13"
|
||||
}
|
||||
class "GtkWidget" style "gtk-default-iso-8859-13"
|
8
gtk/gtkrc.iso-8859-14
Normal file
8
gtk/gtkrc.iso-8859-14
Normal file
@ -0,0 +1,8 @@
|
||||
style "gtk-default-iso-8859-14" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-14,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-14"
|
||||
}
|
||||
class "GtkWidget" style "gtk-default-iso-8859-14"
|
||||
|
8
gtk/gtkrc.iso-8859-15
Normal file
8
gtk/gtkrc.iso-8859-15
Normal file
@ -0,0 +1,8 @@
|
||||
style "gtk-default-iso-8859-15" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-15,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-15"
|
||||
}
|
||||
class "GtkWidget" style "gtk-default-iso-8859-15"
|
||||
|
14
gtk/gtkrc.iso-8859-2
Normal file
14
gtk/gtkrc.iso-8859-2
Normal file
@ -0,0 +1,14 @@
|
||||
#$(gtkconfigdir)/gtkrc.iso-8859-2
|
||||
#
|
||||
# This file defines the fontsets for iso-8859-2 encoding
|
||||
# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-2
|
||||
# and a gtkrc.$LANG doesn't exist yet.
|
||||
|
||||
style "gtk-default-iso-8859-2" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-2,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-2"
|
||||
}
|
||||
class "GtkWidget" style "gtk-default-iso-8859-2"
|
||||
|
14
gtk/gtkrc.iso-8859-5
Normal file
14
gtk/gtkrc.iso-8859-5
Normal file
@ -0,0 +1,14 @@
|
||||
#$(gtkconfigdir)/gtkrc.iso-8859-5
|
||||
#
|
||||
# This file defines the fontsets for iso-8859-5 encoding
|
||||
# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-5
|
||||
# and a gtkrc.$LANG doesn't exist yet.
|
||||
|
||||
style "gtk-default-iso-8859-5" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-5,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-5"
|
||||
}
|
||||
class "GtkWidget" style "gtk-default-iso-8859-5"
|
||||
|
@ -1,6 +0,0 @@
|
||||
style "default" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-13"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
|
@ -1,6 +0,0 @@
|
||||
style "default" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-14"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
|
@ -1,6 +0,0 @@
|
||||
style "default" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-15"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
|
@ -1,12 +0,0 @@
|
||||
#$(gtkconfigdir)/gtkrc.iso88592
|
||||
#
|
||||
# This file defines the fontsets for iso-8859-2 encoding
|
||||
# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-2
|
||||
# and a gtkrc.$LANG doesn't exist yet.
|
||||
|
||||
style "default" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-2"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
|
@ -1,12 +0,0 @@
|
||||
#$(gtkconfigdir)/gtkrc.iso88595
|
||||
#
|
||||
# This file defines the fontsets for iso-8859-5 encoding
|
||||
# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-5
|
||||
# and a gtkrc.$LANG doesn't exist yet.
|
||||
|
||||
style "default" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-5"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
|
@ -1,6 +1,6 @@
|
||||
style "default" {
|
||||
style "gtk-default-ja" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--14-100-100-100-p-76-iso8859-1,\
|
||||
-misc-fixed-medium-r-normal--14-*-*-*-*-*-jisx0208.1983-0"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-ja"
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
# 1999, Pablo Saratxaga <srtxg@chanae.alphanet.ch>
|
||||
#
|
||||
|
||||
style "default" {
|
||||
style "gtk-default-georgianacademy" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-*,\
|
||||
-*-*-medium-r-normal--14-*-*-*-*-*-georgian-academy"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-georgianacademy"
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
# 1999, Pablo Saratxaga <srtxg@chanae.alphanet.ch>
|
||||
#
|
||||
|
||||
style "default" {
|
||||
style "gtk-default-georgianps" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-*,\
|
||||
-*-*-medium-r-normal--14-*-*-*-*-*-georgian-ps"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-georgianps"
|
||||
|
||||
|
10
gtk/gtkrc.ko
10
gtk/gtkrc.ko
@ -1,6 +1,8 @@
|
||||
style "default" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--14-100-100-100-p-76-iso8859-1,\
|
||||
-*-*-medium-*-*--14-*-*-*-*-*-ksc5601.1987-*"
|
||||
style "gtk-default-ko" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,\
|
||||
-*-gulim-medium-r-normal--*-120-*-*-*-*-ksc5601.1987-0,\
|
||||
-*-kodig-medium-r-normal--*-120-*-*-*-*-ksc5601.1987-0,\
|
||||
-*-*-medium-r-normal--*-120-*-*-*-*-ksc5601.1987-0,*"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-ko"
|
||||
|
||||
|
10
gtk/gtkrc.ru
10
gtk/gtkrc.ru
@ -9,9 +9,11 @@
|
||||
# 1999-06-23: changed -cronyx-helvetica-...koi8-r to -*-helvetica-...koi8-r
|
||||
# everybody doesn't has cronyx fonts (I haven't :) )
|
||||
|
||||
style "default" {
|
||||
fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--14-*-*-*-*-*-koi8-r"
|
||||
style "gtk-default-ru" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-*,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-cronyx-helvetica-medium-r-normal--12-*-*-*-*-*-koi8-r,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-koi8-r"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-ru"
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
style "default" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-2"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
|
@ -6,10 +6,10 @@
|
||||
# 1999, Pablo Saratxaga <srtxg@chanae.alphanet.ch>
|
||||
#
|
||||
|
||||
style "default" {
|
||||
style "gtk-default-th" {
|
||||
fontset = "-*-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1,\
|
||||
-*-phaisarn-medium-r-normal--14-*-*-*-*-*-tis620.2533-1,\
|
||||
-*-*-medium-r-normal--14-*-*-*-*-*-tis620.2533-1"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-th"
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
style "default" {
|
||||
style "gtk-default-tr" {
|
||||
fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-9"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-9,\"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-9"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-tr"
|
||||
|
||||
|
@ -6,9 +6,11 @@
|
||||
# 1999, Pablo Saratxaga <srtxg@chanae.alphanet.ch>
|
||||
#
|
||||
|
||||
style "default" {
|
||||
style "gtk-default-uk" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-*,\
|
||||
-*-helvetica-medium-r-normal--14-*-*-*-*-*-koi8-u"
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--14-*-*-*-*-*-koi8-u,\"
|
||||
-*-arial-medium-r-normal--14-*-*-*-*-*-koi8-u"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-uk"
|
||||
|
||||
|
@ -11,9 +11,12 @@
|
||||
# 1999, Pablo Saratxaga <srtxg@chanae.alphanet.ch>
|
||||
#
|
||||
|
||||
style "default" {
|
||||
style "gtk-default-vi-vn-tcvn" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-*,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--14-*-*-*-*-*-tcvn-5712,\"
|
||||
-*-arial-medium-r-normal--14-*-*-*-*-*-tcvn-5712,\"
|
||||
-*-verdana-medium-r-normal--14-*-*-*-*-*-tcvn-5712"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-vi-vn-tcvn"
|
||||
|
||||
|
@ -10,9 +10,12 @@
|
||||
# 1999, Pablo Saratxaga <srtxg@chanae.alphanet.ch>
|
||||
#
|
||||
|
||||
style "default" {
|
||||
style "gtk-default-vi-vn-viscii" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-*,\
|
||||
-*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\"
|
||||
-*-helvetica-medium-r-normal--14-*-*-*-*-*-viscii1.1-1,\"
|
||||
-*-arial-medium-r-normal--14-*-*-*-*-*-viscii1.1-1,\"
|
||||
-*-verdana-medium-r-normal--14-*-*-*-*-*-viscii1.1-1"
|
||||
}
|
||||
class "GtkWidget" style "default"
|
||||
class "GtkWidget" style "gtk-default-vi-vn-viscii"
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user