Commit Graph

304 Commits

Author SHA1 Message Date
Tim Janik
3c7f5af2a5 check for clist !REALIZED. (draw_rows): bail out if the widget isn't
Fri Feb 13 19:08:51 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkclist.c (check_exposures): check for clist !REALIZED.
        (draw_rows): bail out if the widget isn't drawable.
        (hadjustment_value_changed):
        (vadjustment_value_changed): bail out if clist isn't drawable.

        * gdk/gdk.c (graphics_expose_predicate): check for private != NULL.
        (gdk_event_get_graphics_expose): check for window != NULL.
1998-02-13 18:41:18 +00:00
Owen Taylor
c3fc26bb9d Realize window before creating xpm so it gets the right colormap/visual,
Fri Feb 13 00:33:26 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/testgtk.c (shape_create_icon): Realize window before
	  creating xpm so it gets the right colormap/visual,
	  instead of the default one.
1998-02-13 05:33:17 +00:00
Owen Taylor
041983a776 Change style->white to style->base[] where appropriate. Change the default
* gtk/gtkentry.c gtk/gtkinputdialog.c gtk/gtklist.c
	  gtk/gtklistitem.c gtktree.c gtk/gtktreeitem.c testgtkrc:

	  Change style->white to style->base[] where appropriate.
	  Change the default style to make this apparent. (Yes, it's
	  ugly... it can be removed later)
1998-02-13 05:26:33 +00:00
Owen Taylor
888470ee29 gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
Thu Feb 12 23:59:49 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]
	  gtk/gtkselection.[ch] gdk/gdk.[ch] gtktypeutils.h

 	  Replaced all _interp functions with _full functions.
	  (_interp functions left in for compatibility until 0.99.5).
	  Difference: _full functions take _both_ a C-language callback and a
	  marshaller, and simply ignore the C-language callback
	  if the marshaller is present. This allows the destroy notification
	  to be used without marshalling.

	  gtk_selection_add_handler[_full]() regularized to agree
	  with other callbacks.

	  Also, added gtk_input_add_full() to the header file.
	  (gtk_input_add_interp() was never there)

	* gtk/gtkmain.[ch] gtk/gtkwidget.c: Idle functions are now prioritized.
	  Added new function gtk_idle_add_priority to create
	  an idle with a specified priority (default is zero)
	  constants #defined - GTK_PRIORITY_[HIGH/INTERNAL/DEFAULT/LOW]
	  (redraws, resizes run at GTK_PRIORITY_INTERNAL)

	* gtk/gtkentry.c gtk/testselection.c: changes to keep up with change
  	  to gtkselection.c.
1998-02-13 05:19:06 +00:00
Owen Taylor
dd07df15c1 Add a DestroyNotify field, and gtk_object_set_data_full() to match.
Tue Feb 10 15:01:44 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtkobject.c gtk/gtkobject.h: Add a DestroyNotify
	field, and gtk_object_set_data_full() to match.

	* gtk/gtkobject.c (gtk_object_finalize): ObjectData structures
	were being added to a free list, then forgotten about. Just
	rely on GMemChunk instead.
1998-02-13 05:11:16 +00:00
Owen Taylor
39e26262a5 change logged. 1998-02-13 03:47:43 +00:00
Owen Taylor
c43a50fe36 removed deprecated g_string_equal and g_string_hash.
Thu Feb 12 22:48:11 1998  Owen Taylor  <owt1@cornell.edu>

	* gstring.c glib.h: removed deprecated g_string_equal
	  and g_string_hash.
1998-02-13 03:47:25 +00:00
Federico Mena Quintero
9dee8ee4e4 Fixed unrealize handler to comply with the documentation (which mentions
2018-02-11  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gtk/gtkclist.c:
	* gtk/gtkentry.c:
	* gtk/gtkfixed.c:
	* gtk/gtkhandlebox.c:
	* gtk/gtknotebook.c:
	* gtk/gtkpaned.c:
	* gtk/gtkpreview.c:
	* gtk/gtkrange.c:
	* gtk/gtkruler.c:
	* gtk/gtktext.c:
	* gtk/gtkviewport.c:
	Fixed unrealize handler to comply with the
	documentation (which mentions the right thing to do).
1998-02-12 03:02:14 +00:00
Owen Taylor
31a238b6b6 Spelling fixups and minor changes. 1998-02-12 02:40:30 +00:00
Tim Janik
c305397fca small fixup, so that the clist doesn't draw if it is
not realized.
-timj
1998-02-11 05:07:36 +00:00
Manish Singh
f747f3b2cd Really minor cosmetic fix that just niggled me. :P
-Yosh
1998-02-11 01:08:42 +00:00
Tim Janik
ed848ac41e backed out the section "Gnits to care about". new file, kinda developers
Wed Feb 11 00:18:31 1998  Tim Janik  <timj@gimp.org>

        * docs/refcounting.txt: backed out the section "Gnits to care about".
        * docs/developers.txt: new file, kinda developers FAQ.
1998-02-11 00:40:20 +00:00
Tim Janik
2090cc650c new function gtk_signal_handler_pending() returning the id of the next
Wed Feb 11 00:18:31 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtksignal.h:
        * gtk/gtksignal.c: new function gtk_signal_handler_pending() returning
          the id of the next handler pending for that signal or 0.
          put struct GtkHandler back into gtksignal.c along with
          gtk_signal_get_handlers.
1998-02-10 23:49:15 +00:00
Owen Taylor
13179d42a0 Add check to see if the C library's iswalnum can actually be used. (Not
Tue Feb 10 13:04:36 1998  Owen Taylor  <owt1@cornell.edu>

	* configure.in: Add check to see if the C library's
	  iswalnum can actually be used. (Not true for
	  Linux libc-5.4.38)
1998-02-10 18:18:19 +00:00
Tim Janik
6898536a02 ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtksignal.h:
        * gtk/gtksignal.c:
        ok, there have been several severe bugs in the signal handler
        referencing and ->next connection stuff. these bugs caused
        invokations of handlers that are disconnected and - worse -
        destroyed already. invokation of *destroyd* handlers mean:
        anything can be executed , because the handler structure can just
        as well be realocated.
        at the cost of an extra ->prev field per handler we should have a
        reasonable stable system now, because of the various places that
        can cause a handler to be disconnected (*any* handler invokation can
        cause *any* or *all* handlers to be disconnected, there is no way
        around a doubly linked list, actually handler disconnection has never
        worked correctly because of this.
        handlers are connected together via a *doubly* linked list now, and it
        is *not* valid to remove a handler out of this list untill all its
        references have been droped, i.e. handler->ref_count==0.
        to prevent emissions of disconnected but still referenced handlers,
        disconnected handlers are simply marked as blocked and get an id of 0
        which is an invalid signal handler id.
        the handler->id has been changed to have 28 significant bits (using
        alignment gaps), since 65536 (old range: guint16) signal connections
        (as a total) can easily be reached by complex applications.
        this whole handler thingy is at least as tedious as writing doubly
        linked list implementations ;)
1998-02-10 06:53:08 +00:00
Owen Taylor
f98686da85 Check for the RESIZE_NEEDED flag and remove the widget from the list.
Mon Feb  9 23:08:16 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtkwidget.c (gtk_widget_unparent): Check for
	  the RESIZE_NEEDED flag and remove the widget from the list.
	  Remove the check from gtk_widget_destroy (no longer needed).

	* Unrealize widget _before_ calling "destroy" signal, and
	  unset VISIBLE flag.

	* Unrealize child widgets _after_ unrealizing parent to improve
	  visual appearance.
1998-02-10 04:17:10 +00:00
Miguel de Icaza
6246db9288 no longer a private routine; gtksignal.h: export gtk_signal_get_handlers
Mon Feb  9 16:42:21 1998  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* gtk/gtksignal.c (gtk_signal_get_handlers): no longer a private
	routine;
	gtksignal.h: export gtk_signal_get_handlers and GtkHandlers type.
1998-02-09 22:44:34 +00:00
Tim Janik
38fac1be63 new fundtion to return the widget that the menu is attached to.
Sun Feb  8 07:06:54 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkmenu.c (gtk_menu_get_attach_widget): new fundtion to return
          the widget that the menu is attached to.
1998-02-08 19:00:01 +00:00
Jay Painter
7a3af96d84 New API functions: gtk_clist_get_cell_type gtk_clist_get_text
New API functions:
  gtk_clist_get_cell_type
  gtk_clist_get_text
  gtk_clist_get_pixmap
  gtk_clist_get_pixtext
  gtk_clist_find_row_from_data
1998-02-08 07:55:11 +00:00
Owen Taylor
289f6a38fe use a mask of 0xffffffff instead of 0xffff, since there are 22 flags
Sat Feb  7 11:33:08 1998  Owen Taylor  <owt1@cornell.edu>

	* gdk/gdkgc.c (gdk_gc_copy): use a mask of 0xffffffff
	  instead of 0xffff, since there are 22 flags currently
	  defined. (From: Jon Trowbridge <trow@emccta.com>)

	  Changed to something better. ~((~1) << GCLastBit)
		   (From: from Daniel Stephens <daniel@cheeseplant.org>)
1998-02-07 17:07:14 +00:00
Owen Taylor
e105a87144 added some additional consts in appropriate places to remove a warning
Sat Feb  7 11:48:09 1998  Owen Taylor  <owt1@cornell.edu>

	* gstring.c gutils.c: added some additional consts in
	  appropriate places to remove a warning
1998-02-07 16:48:03 +00:00
Owen Taylor
c763748dd1 use a mask of 0xffffffff instead of 0xffff, since there are 22 flags
Sat Feb  7 11:33:08 1998  Owen Taylor  <owt1@cornell.edu>

	* gdk/gdkgc.c (gdk_gc_copy): use a mask of 0xffffffff
	  instead of 0xffff, since there are 22 flags currently
	  defined. (From: Jon Trowbridge <trow@emccta.com>)
1998-02-07 16:34:40 +00:00
Owen Taylor
75cd57b6cb include <ctype.h> for tolower()
Sat Feb  7 11:15:54 1998  Owen Taylor  <owt1@cornell.edu>

	* gutils.c: include <ctype.h> for tolower()
1998-02-07 16:14:13 +00:00
Tom Tromey
dca018206e Here's a small patch that corrects a prototype in gtkvpaned.h.
From: Tom Tromey <tromey@creche.cygnus.com>
Here's a small patch that corrects a prototype in gtkvpaned.h.

                                        -owt
1998-02-07 16:10:01 +00:00
Tim Janik
89107cb751 clean ups. -timj
clean ups.
-timj
1998-02-07 04:59:23 +00:00
Tim Janik
edad08addd don't wipe out window_private's x and y coordinates if the configure
Sat Feb  7 02:29:01 1998  Tim Janik  <timj@gimp.org>

        * gdk/gdk.c (gdk_event_translate): don't wipe out window_private's x
          and y coordinates if the configure notify is only about resizing,
          query the correct origin instead.
1998-02-07 02:26:09 +00:00
Jay Painter
5b597c65c7 A little cosmetic cleanup 1998-02-05 08:40:06 +00:00
scott
d3c3333735 Menufactory now refs&sinks its children.
--sg
1998-02-05 04:10:43 +00:00
Tim Janik
9258a7aecb new function to perform the same actions as gtk_list_remove_items, but
Thu Feb  5 02:13:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtklist.h:
        * gtk/gtklist.c (gtk_list_remove_items_no_unref): new function
          to perform the same actions as gtk_list_remove_items, but
          supply the removed widgets with an additional reference count.

        * gtk/gtkmain.c (gtk_main_iteration_do): ignore events
          with event_widget == NULL, since they are bogus events
          from destroyed GdkWindows, exept for the case where
          event->type==GDK_PROPERTY_NOTIFY. Always handle expired
          timeout functions when returning from this function.

        * gtk/gtkwidget.c (gtk_widget_event): ignore GDK_EXPOSE events
          if event->window == NULL. Also, if this function couldn't handle
          the event for any reason (including failing assumptions), make
          the return value to look as if the event had been handled to
          avoid further processing (and warnings).

        * gtk/gtkwidget.h:
        * gtk/gtkwidget.c: remove gtk_widget_sink, because there is
          no point in providing such a function.

        * gdk/gdk.c (gdk_init): changed options `-name' and `-class'
          to `--name' and `--class', because the old names would
          confuse getopt(). these arguments have been introduced in the
          changes from gtk+970916 to gtk+970925 without a ChangeLog entry,
          changing argument names is painful, it would be nice if people
          would care about compatibility and consistency in the first place!
1998-02-05 03:53:41 +00:00
Tim Janik
f82814760e section: Gnits to care about -------------------
section:
Gnits to care about
-------------------

-timj
1998-02-05 00:13:42 +00:00
Tim Janik
4b86717650 documentation. -timj
documentation.
-timj
1998-02-04 03:18:53 +00:00
Tim Janik
8d2bb0f43e indentations. -timj
indentations.
-timj
1998-02-04 00:06:29 +00:00
Owen Taylor
23a13fd4a5 Renamed widget_states.txt to widget_system.txt, and
made some further revisions.
1998-02-03 23:31:21 +00:00
Tim Janik
64ca527ecb for the emission of AFTER signals, fetch the objects signals via
Tue Feb  3 15:09:55 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtksignal.c (gtk_signal_real_emit): for the emission
          of AFTER signals, fetch the objects signals via
          gtk_signal_get_handlers again. some handlers might have
          been removed or added. not doing this would mess up the
          memchunk allocation of signal handlers (this had been
          triggered by multiple *_while_alive connections), bad, bad, bad!
          (gtk_handlers_run): do the referencing on signal handlers
          unconditionally, the invokation of AFTER handlers will now take
          care of modified lists.

        * gtk/gtksignal.h: added gtk_signal_connect_while_alive.
1998-02-03 21:36:06 +00:00
Owen Taylor
3b0de24a7b Only query the colormap for GRAYSCALE and PSEUDOCOLOR visuals, and don't
Tue Feb  3 15:34:27 1998  Owen Taylor  <owt1@cornell.edu>

	* gdk/gdkcolor.c (gdk_colormap_get_system): Only query
	  the colormap for GRAYSCALE and PSEUDOCOLOR visuals,
	  and don't ask for more than 256 colors in any case.

	* gdk/gdkwindow.c (gdk_window_internal_destroy): Remove
	  the input window information when we destroy the window,
	  not when we are notified of it.

	* gdk/gdkinputcommon.h (gdk_input_device_new): Work around
	  bug in XFree86 3.3.1's handling of Wacom macro buttons.
	  by assumming no device will report exactly 25 buttons.

	* gdk/gdkinputcommon.h (gdk_input_common_other_event): Fill
	  in string translation for generated key press events,
	  do sanity checking on received key codes.

	* gdk/gdkcc.c (gdk_color_context_new): Allocate enough
	  room for a GdkColorContextPrivate, not just for a
	  GdkColorContext.
1998-02-03 20:57:40 +00:00
Tim Janik
5842311062 don't add the same menu to different menuitems/ optionmenus.
Tue Feb  3 15:09:55 1998  Tim Janik  <timj@gimp.org>

        * gtk/testgtk.c: don't add the same menu to different menuitems/
          optionmenus.

        * gtk/gtkmenuitem.h:
        * gtk/gtkmenuitem.c: new function gtk_menu_item_remove_submenu ro
          be consistent with optionmenu. use gtk_menu_attach_to_widget/
          gtk_menu_detach for setting/removing the submenu.
          invoke gtk_widget_destroy(submenu) in destructor to be consistent
          with other destructors.

        * gtk/gtkoptionmenu.h:
        * gtk/gtkoptionmenu.c: attach/detach to menu widget via
          gtk_menu_attach_to_widget/gtk_menu_detach.
          invoke gtk_widget_destroy(menu) in destructor to be consistent
          with other destructors.
1998-02-03 15:14:35 +00:00
Tim Janik
b45cd0430c attach/detach to menu widget via
Tue Feb  3 15:09:55 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkoptionmenu.h:
        * gtk/gtkoptionmenu.c: attach/detach to menu widget via

        * gtk/gtkmenu.h:
        * gtk/gtkmenu.c: new functions gtk_menu_attach_to_widget
          and gtk_menu_detach that correspond to the action of
          gtk_widget_set_parent and gtk_widget_unparent.

        * gtk/widget.c: few fixups.
1998-02-03 14:13:05 +00:00
Owen Taylor
a8629917ae gtk/gtktable.c Fixed problem with division by zero in row/column-spanned
Tue Feb  3 00:12:00 1998  Owen Taylor  <owt1@cornell.edu>
	* gtk/gtktable.c
	  Fixed problem with division by zero in row/column-spanned
	  tables. Also removed a bunch of conditionals by making
	  the observation that x/1 == x.
1998-02-03 05:57:31 +00:00
Owen Taylor
febe6498f2 Fixed (?) problem with arithmentic exceptions in row/column
spanned tables.
1998-02-03 05:23:03 +00:00
Tim Janik
fc86f630a6 dunno, what cvs wants right now. i just told me these
changes are already commited... ;(
-timj
1998-02-02 21:41:24 +00:00
Tim Janik
b239e3c941 changed name to reflect that these macros in fact can't operate on
Mon Feb  2 04:15:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkwindow.c:
        * gtk/gtkwidget.c:
        * gtk/gtkmain.c:
        * gtk/gtkwidget.c:
        * gtk/gtkcontainer.c:
        * gtk/gtkprivate.h (GTK_PRIVATE_UNSET_FLAG) (GTK_PRIVATE_UNSET_FLAGS):
          changed name to reflect that these macros in fact can't operate on
          multiple flags.
1998-02-02 21:07:18 +00:00
Tim Janik
6b5e983f3d fixed destroy handler, so it doesn't segfault with the new refcounting
Mon Feb  2 04:15:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
          segfault with the new refcounting scheme anymore.

        * gtk/gtkhandlebox.c:
        * gtk/gtkclist.c:
        * gtk/gtkentry.c:
        * gtk/gtkrange.c:
        * gtk/gtktext.c:
        * gtk/gtkviewport.c:
          enforced
          gdk_window_set_user_data (window, NULL);
          gdk_window_destroy (window);
          window = NULL;
          throughout the code.
1998-02-02 20:40:03 +00:00
Tim Janik
eeaefdf04f fixed a bad, bad referencing bug that could caused unreferencing of
Mon Feb  2 04:15:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
          bug that could caused unreferencing of finalized objects.

        * gtk/testgtk.c: destroy fileselection on "OK" (this triggered the
          above mentioned bug).

        * gtk/gtkwidget.h:
        * gtk/gtkwidget.c:
        * gtk/gtkobject.h:
        * gtk/gtkobject.c:
          implemented and object reference tracer (gtk_trace_referencing) which
          is activated if GTK_TRACE_OBJECTS is defined (currently per default).
          in gdb: set the static variable `gtk_trace_object' to point to the
          object that you want to have reference traced.

        * gtk/gtkfileselection.c: few cleanups.
1998-02-02 18:44:28 +00:00
Tim Janik
8822bde131 cleanups with key name spaces.
Mon Feb  2 04:15:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkcolorsel.c:
        * gtk/gtkcombo.c:
        * gtk/gtkobject.c:
        * gtk/gtkselection.c:
        * gtk/gtkwidget.c:
        * gtk/gtkwindow.c:
          cleanups with key name spaces.

        * gtk/gtkcombo.c: fixed destruction bug with popwin.
1998-02-02 14:13:13 +00:00
Tim Janik
c3154703d0 watch the next ChangeLog update...
-timj
1998-02-02 14:11:24 +00:00
Tim Janik
57bae55574 fixed a refresh bug with unrealization of no_window widgets.
(dialog button in tesgtk)
-timj
1998-02-02 05:35:59 +00:00
Tim Janik
58df302b15 forgot gtkprivate.h as well
-timj
1998-02-02 04:56:42 +00:00
Tim Janik
35ba1ac7ef hehe, forgot the ChangeLog
-timj
1998-02-02 04:55:09 +00:00
Tim Janik
eef38289b2 GTK_RESIZE_NEEDED is a private flag now.
Mon Feb  2 04:15:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtkcontainer.h:
        * gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
          (gtk_container_register_toplevel): new function.
          (gtk_container_unregister_toplevel): new function.

        * gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.

        * gtk/gtkmenu.c: call gtk_container_register_toplevel in
          gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
          hack. new default handler gtk_menu_destroy for calling
          gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.

        * gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.

        * gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
          (object).

        * gtk/gtkprivate.h: new file that will not be automatically included.
          it holds the private flags for GtkWidget along with it's SET/UNSET
          and examination macros.

        * gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
          GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
          replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
          removed the gtk_widget_set_parent(, NULL) hack for toplevels.
          upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.

        * gtk/gtkwidget.h: split up the widget flags into a public and a private
          portion. added an extra field private_flags to GtkWidget without making
          it bigger by using an alignment gap of 16 bit. macro cleanups.

        * gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
          for calling gtk_container_unregister_toplevel. removed the
          gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
          instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.

        * gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
          removal that cut off the handler list -> living_objects == 0
          with testgtk. made some warnings more descriptive.
          new function gtk_signal_connect_object_while_alive, which
          will automatically destroy the connection once one of the objects
          is destroyed. didn't include this before removal of the above
          mentioned bug.

* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
Radek Doulik
81fe36047e move enum GtkToolbarChildType before typedef to make gtktoolbar.h compile with c++ (or egcs at least :) 1998-02-01 08:50:08 +00:00