mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org> * docs/Changes-1.4.txt: documented necessary changes for 1.4 transition. * gtk/gtktext.c: made the adjustments no-construct args, simply provide default adjustments. (gtk_text_destroy): release adjustments. * gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the adjustment argument non-construct. * gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here, instead of in finalize. (gtk_progress_get_text_from_value): (gtk_progress_get_current_text): (gtk_progress_set_value): (gtk_progress_get_percentage_from_value): (gtk_progress_get_current_percentage): (gtk_progress_set_percentage): (gtk_progress_configure): ensure an adjustment is present. Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org> * gtk/gtkcolorsel.[hc]: * gtk/gtkcolorseldialog.[hc]: * gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain their parent implementation, use bit fields for boolean values, don't create unused widgets, usage of glib types, braces go on their own lines, function argument alignment, #include directives etc. etc. etc.. * gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h. Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org> * gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips. * gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state of NULL. * gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references to freed data. (gtk_combo_destroy): don't keep a pointer to a destroyed window. * gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer to NULL when the toplevel is getting destroyed. (gtk_menu_set_tearoff_state): same here for the tearoff_window. (gtk_menu_destroy): (gtk_menu_init): store the information of whether we have to readd the initial child ref_count during destruction in a new GtkMenu field needs_destruction_ref_count. * gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it here, those reading: learn from my mistake! ;) in order for set_?adjustment to support a default adjustemnt if invoked with an adjustment pointer of NULL, the code read (pseudo): if (v->adjustment) unref (v->adjustment); if (!adjustment) adjustment = adjustment_new (); if (v->adjustment != adjustment) v->adjustment = ref (adjustment); now imagine the first unref to actually free the old adjustment and adjustment_new() creating a new adjustment from the very same memory portion. here, the latter comparision will unintendedly fail, and all hell breaks loose. (gtk_viewport_set_hadjustment): (gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL after unreferencing it. * gtk/gtkcontainer.[hc]: removed toplevel registration functions: gtk_container_register_toplevel(), gtk_container_unregister_toplevel() and gtk_container_get_toplevels() which had wrong semantics anyways: it didn't reference and copy the list. * gtk/gtkwindow.c: we take over the container toplevel registration bussiness now. windows are registered across multiple destructions, untill they are finalized. the initial implicit reference count users are holding on windows is removed with the first destruction though. (gtk_window_init): ref & sink and set has_user_ref_count, got rid of gtk_container_register_toplevel() call. add window to toplevel_list. (gtk_window_destroy): unref the window if has_user_ref_count is still set, got rid of call to gtk_container_unregister_toplevel(). (gtk_window_finalize): remove window from toplevel list. (gtk_window_list_toplevels): new function to return a newly created list with referenced toplevels. (gtk_window_read_rcfiles): use gtk_window_list_toplevels(). * gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange adjustment a non-construct arg. * gtk/gtkvscale.c (gtk_vscale_class_init): likewise. * gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise. * gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise. * gtk/gtkrange.c: added some realized checks. (gtk_range_destroy): get rid of the h/v adjustments in the destroy handler instead of finalize. remove timer. (gtk_range_get_adjustment): demand create adjustment. * gtk/gtkviewport.c: made h/v adjustment non-construct args. we simply create them on demand now and get rid of them in the destroy handler. (gtk_viewport_destroy): get rid of the h/v adjustments in the destroy handler instead of finalize. (gtk_viewport_get_hadjustment): (gtk_viewport_get_vadjustment): (gtk_viewport_size_allocate): demand create h/v adjustment if required. * gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the gtk_widget_real_destroy () functionality. (gtk_widget_real_destroy): reinitialize with a new style, instead of setting widget->style to NULL. Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org> * gtk/gtkcalendar.c: * gtk/gtkbutton.c: ported _get_type() implementation over to GType, either to preserve memchunks allocation facilities, or because Gtk+ 1.0 GtkTypeInfo was still being used. * gtk/gtkobject.[hc]: derive from GObject. ported various functions over. prepare for ::destroy to be emitted multiple times. removed reference tracer magic. chain into GObjectClass.shutdown() to emit ::destroy signal. * gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being fundamental. * gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init() cludge. * gtk/gtksocket.c: * gtk/gtkplug.c: * gtk/gtklayout.c: * gtk/gtklabel.c: * gtk/gtkargcollector.c: * gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT not being a fundamental anymore, and to work with the new type system (nuked fundamental type varargs clutter). * gtk/*.c: install finalize handlers in the GObjectClass part of the class structure. changed direct GTK_OBJECT()->klass accesses to GTK_*_GET_CLASS(). changed direct object_class->type accesses to GTK_CLASS_TYPE(). * gtktypeutils.[hc]: use the reserved fundamental ids provided by GType. made most of the GTK_*() type macros and Gtk* typedefs simple wrappers around macros and types provided by GType. most notably, a significant portion of the old API vanished: GTK_TYPE_MAKE(), GTK_TYPE_SEQNO(), GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST, GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST, GTK_TYPE_ARGS, GTK_TYPE_CALLBACK, GTK_TYPE_C_CALLBACK, GTK_TYPE_FOREIGN, GtkTypeQuery, gtk_type_query(), gtk_type_set_varargs_type(), gtk_type_get_varargs_type(), gtk_type_check_object_cast(), gtk_type_check_class_cast(), gtk_type_describe_tree(), gtk_type_describe_heritage(), gtk_type_free(), gtk_type_children_types(), gtk_type_set_chunk_alloc(), gtk_type_register_enum(), gtk_type_register_flags(), gtk_type_parent_class(). replacements, where available are described in ../docs/Changes-1.4.txt. implemented compatibility functions for the remaining API. * configure.in: depend on glib 1.3.1, use gobject module.
This commit is contained in:
parent
5ef1e2e970
commit
9595c55184
178
ChangeLog
178
ChangeLog
@ -1,3 +1,181 @@
|
||||
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
|
||||
|
||||
* gtk/gtktext.c: made the adjustments no-construct args, simply
|
||||
provide default adjustments.
|
||||
(gtk_text_destroy): release adjustments.
|
||||
|
||||
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
|
||||
adjustment argument non-construct.
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
|
||||
instead of in finalize.
|
||||
(gtk_progress_get_text_from_value):
|
||||
(gtk_progress_get_current_text):
|
||||
(gtk_progress_set_value):
|
||||
(gtk_progress_get_percentage_from_value):
|
||||
(gtk_progress_get_current_percentage):
|
||||
(gtk_progress_set_percentage):
|
||||
(gtk_progress_configure): ensure an adjustment is present.
|
||||
|
||||
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcolorsel.[hc]:
|
||||
* gtk/gtkcolorseldialog.[hc]:
|
||||
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
|
||||
their parent implementation, use bit fields for boolean values, don't
|
||||
create unused widgets, usage of glib types, braces go on their own
|
||||
lines, function argument alignment, #include directives etc. etc. etc..
|
||||
|
||||
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
|
||||
|
||||
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
|
||||
|
||||
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
|
||||
of NULL.
|
||||
|
||||
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
|
||||
to freed data.
|
||||
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
|
||||
to NULL when the toplevel is getting destroyed.
|
||||
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
|
||||
(gtk_menu_destroy):
|
||||
(gtk_menu_init): store the information of whether we have to
|
||||
readd the initial child ref_count during destruction in a new
|
||||
GtkMenu field needs_destruction_ref_count.
|
||||
|
||||
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
|
||||
here, those reading: learn from my mistake! ;)
|
||||
in order for set_?adjustment to support a default adjustemnt if
|
||||
invoked with an adjustment pointer of NULL, the code read (pseudo):
|
||||
if (v->adjustment) unref (v->adjustment);
|
||||
if (!adjustment) adjustment = adjustment_new ();
|
||||
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
|
||||
now imagine the first unref to actually free the old adjustment and
|
||||
adjustment_new() creating a new adjustment from the very same memory
|
||||
portion. here, the latter comparision will unintendedly fail, and
|
||||
all hell breaks loose.
|
||||
(gtk_viewport_set_hadjustment):
|
||||
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
|
||||
after unreferencing it.
|
||||
|
||||
* gtk/gtkcontainer.[hc]: removed toplevel registration
|
||||
functions: gtk_container_register_toplevel(),
|
||||
gtk_container_unregister_toplevel() and
|
||||
gtk_container_get_toplevels() which had wrong semantics
|
||||
anyways: it didn't reference and copy the list.
|
||||
|
||||
* gtk/gtkwindow.c: we take over the container toplevel registration
|
||||
bussiness now. windows are registered across multiple destructions,
|
||||
untill they are finalized. the initial implicit reference count
|
||||
users are holding on windows is removed with the first destruction
|
||||
though.
|
||||
(gtk_window_init): ref & sink and set has_user_ref_count, got
|
||||
rid of gtk_container_register_toplevel() call. add window to
|
||||
toplevel_list.
|
||||
(gtk_window_destroy): unref the window if has_user_ref_count
|
||||
is still set, got rid of call to
|
||||
gtk_container_unregister_toplevel().
|
||||
(gtk_window_finalize): remove window from toplevel list.
|
||||
(gtk_window_list_toplevels): new function to return a newly
|
||||
created list with referenced toplevels.
|
||||
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
|
||||
|
||||
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
|
||||
adjustment a non-construct arg.
|
||||
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
|
||||
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
|
||||
* gtk/gtkrange.c: added some realized checks.
|
||||
(gtk_range_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize. remove timer.
|
||||
(gtk_range_get_adjustment): demand create adjustment.
|
||||
|
||||
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
|
||||
we simply create them on demand now and get rid of them in
|
||||
the destroy handler.
|
||||
(gtk_viewport_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize.
|
||||
(gtk_viewport_get_hadjustment):
|
||||
(gtk_viewport_get_vadjustment):
|
||||
(gtk_viewport_size_allocate): demand create h/v adjustment
|
||||
if required.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
|
||||
gtk_widget_real_destroy () functionality.
|
||||
(gtk_widget_real_destroy): reinitialize with a new style, instead
|
||||
of setting widget->style to NULL.
|
||||
|
||||
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcalendar.c:
|
||||
* gtk/gtkbutton.c: ported _get_type() implementation over to
|
||||
GType, either to preserve memchunks allocation facilities,
|
||||
or because Gtk+ 1.0 GtkTypeInfo was still being used.
|
||||
|
||||
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
|
||||
over. prepare for ::destroy to be emitted multiple times.
|
||||
removed reference tracer magic. chain into GObjectClass.shutdown()
|
||||
to emit ::destroy signal.
|
||||
|
||||
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
|
||||
fundamental.
|
||||
|
||||
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
|
||||
cludge.
|
||||
|
||||
* gtk/gtksocket.c:
|
||||
* gtk/gtkplug.c:
|
||||
* gtk/gtklayout.c:
|
||||
* gtk/gtklabel.c:
|
||||
* gtk/gtkargcollector.c:
|
||||
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
|
||||
not being a fundamental anymore, and to work with the new
|
||||
type system (nuked fundamental type varargs clutter).
|
||||
|
||||
* gtk/*.c: install finalize handlers in the GObjectClass
|
||||
part of the class structure.
|
||||
changed direct GTK_OBJECT()->klass accesses to
|
||||
GTK_*_GET_CLASS().
|
||||
changed direct object_class->type accesses to GTK_CLASS_TYPE().
|
||||
|
||||
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
|
||||
GType. made most of the GTK_*() type macros and Gtk* typedefs
|
||||
simple wrappers around macros and types provided by GType.
|
||||
most notably, a significant portion of the old API vanished:
|
||||
GTK_TYPE_MAKE(),
|
||||
GTK_TYPE_SEQNO(),
|
||||
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
|
||||
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
GtkTypeQuery,
|
||||
gtk_type_query(),
|
||||
gtk_type_set_varargs_type(),
|
||||
gtk_type_get_varargs_type(),
|
||||
gtk_type_check_object_cast(),
|
||||
gtk_type_check_class_cast(),
|
||||
gtk_type_describe_tree(),
|
||||
gtk_type_describe_heritage(),
|
||||
gtk_type_free(),
|
||||
gtk_type_children_types(),
|
||||
gtk_type_set_chunk_alloc(),
|
||||
gtk_type_register_enum(),
|
||||
gtk_type_register_flags(),
|
||||
gtk_type_parent_class().
|
||||
replacements, where available are described in ../docs/Changes-1.4.txt.
|
||||
implemented compatibility functions for the remaining API.
|
||||
|
||||
* configure.in: depend on glib 1.3.1, use gobject module.
|
||||
|
||||
Thu May 11 12:39:50 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* TODO.xml: Various updates to current status.
|
||||
|
@ -1,3 +1,181 @@
|
||||
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
|
||||
|
||||
* gtk/gtktext.c: made the adjustments no-construct args, simply
|
||||
provide default adjustments.
|
||||
(gtk_text_destroy): release adjustments.
|
||||
|
||||
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
|
||||
adjustment argument non-construct.
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
|
||||
instead of in finalize.
|
||||
(gtk_progress_get_text_from_value):
|
||||
(gtk_progress_get_current_text):
|
||||
(gtk_progress_set_value):
|
||||
(gtk_progress_get_percentage_from_value):
|
||||
(gtk_progress_get_current_percentage):
|
||||
(gtk_progress_set_percentage):
|
||||
(gtk_progress_configure): ensure an adjustment is present.
|
||||
|
||||
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcolorsel.[hc]:
|
||||
* gtk/gtkcolorseldialog.[hc]:
|
||||
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
|
||||
their parent implementation, use bit fields for boolean values, don't
|
||||
create unused widgets, usage of glib types, braces go on their own
|
||||
lines, function argument alignment, #include directives etc. etc. etc..
|
||||
|
||||
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
|
||||
|
||||
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
|
||||
|
||||
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
|
||||
of NULL.
|
||||
|
||||
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
|
||||
to freed data.
|
||||
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
|
||||
to NULL when the toplevel is getting destroyed.
|
||||
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
|
||||
(gtk_menu_destroy):
|
||||
(gtk_menu_init): store the information of whether we have to
|
||||
readd the initial child ref_count during destruction in a new
|
||||
GtkMenu field needs_destruction_ref_count.
|
||||
|
||||
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
|
||||
here, those reading: learn from my mistake! ;)
|
||||
in order for set_?adjustment to support a default adjustemnt if
|
||||
invoked with an adjustment pointer of NULL, the code read (pseudo):
|
||||
if (v->adjustment) unref (v->adjustment);
|
||||
if (!adjustment) adjustment = adjustment_new ();
|
||||
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
|
||||
now imagine the first unref to actually free the old adjustment and
|
||||
adjustment_new() creating a new adjustment from the very same memory
|
||||
portion. here, the latter comparision will unintendedly fail, and
|
||||
all hell breaks loose.
|
||||
(gtk_viewport_set_hadjustment):
|
||||
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
|
||||
after unreferencing it.
|
||||
|
||||
* gtk/gtkcontainer.[hc]: removed toplevel registration
|
||||
functions: gtk_container_register_toplevel(),
|
||||
gtk_container_unregister_toplevel() and
|
||||
gtk_container_get_toplevels() which had wrong semantics
|
||||
anyways: it didn't reference and copy the list.
|
||||
|
||||
* gtk/gtkwindow.c: we take over the container toplevel registration
|
||||
bussiness now. windows are registered across multiple destructions,
|
||||
untill they are finalized. the initial implicit reference count
|
||||
users are holding on windows is removed with the first destruction
|
||||
though.
|
||||
(gtk_window_init): ref & sink and set has_user_ref_count, got
|
||||
rid of gtk_container_register_toplevel() call. add window to
|
||||
toplevel_list.
|
||||
(gtk_window_destroy): unref the window if has_user_ref_count
|
||||
is still set, got rid of call to
|
||||
gtk_container_unregister_toplevel().
|
||||
(gtk_window_finalize): remove window from toplevel list.
|
||||
(gtk_window_list_toplevels): new function to return a newly
|
||||
created list with referenced toplevels.
|
||||
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
|
||||
|
||||
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
|
||||
adjustment a non-construct arg.
|
||||
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
|
||||
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
|
||||
* gtk/gtkrange.c: added some realized checks.
|
||||
(gtk_range_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize. remove timer.
|
||||
(gtk_range_get_adjustment): demand create adjustment.
|
||||
|
||||
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
|
||||
we simply create them on demand now and get rid of them in
|
||||
the destroy handler.
|
||||
(gtk_viewport_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize.
|
||||
(gtk_viewport_get_hadjustment):
|
||||
(gtk_viewport_get_vadjustment):
|
||||
(gtk_viewport_size_allocate): demand create h/v adjustment
|
||||
if required.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
|
||||
gtk_widget_real_destroy () functionality.
|
||||
(gtk_widget_real_destroy): reinitialize with a new style, instead
|
||||
of setting widget->style to NULL.
|
||||
|
||||
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcalendar.c:
|
||||
* gtk/gtkbutton.c: ported _get_type() implementation over to
|
||||
GType, either to preserve memchunks allocation facilities,
|
||||
or because Gtk+ 1.0 GtkTypeInfo was still being used.
|
||||
|
||||
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
|
||||
over. prepare for ::destroy to be emitted multiple times.
|
||||
removed reference tracer magic. chain into GObjectClass.shutdown()
|
||||
to emit ::destroy signal.
|
||||
|
||||
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
|
||||
fundamental.
|
||||
|
||||
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
|
||||
cludge.
|
||||
|
||||
* gtk/gtksocket.c:
|
||||
* gtk/gtkplug.c:
|
||||
* gtk/gtklayout.c:
|
||||
* gtk/gtklabel.c:
|
||||
* gtk/gtkargcollector.c:
|
||||
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
|
||||
not being a fundamental anymore, and to work with the new
|
||||
type system (nuked fundamental type varargs clutter).
|
||||
|
||||
* gtk/*.c: install finalize handlers in the GObjectClass
|
||||
part of the class structure.
|
||||
changed direct GTK_OBJECT()->klass accesses to
|
||||
GTK_*_GET_CLASS().
|
||||
changed direct object_class->type accesses to GTK_CLASS_TYPE().
|
||||
|
||||
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
|
||||
GType. made most of the GTK_*() type macros and Gtk* typedefs
|
||||
simple wrappers around macros and types provided by GType.
|
||||
most notably, a significant portion of the old API vanished:
|
||||
GTK_TYPE_MAKE(),
|
||||
GTK_TYPE_SEQNO(),
|
||||
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
|
||||
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
GtkTypeQuery,
|
||||
gtk_type_query(),
|
||||
gtk_type_set_varargs_type(),
|
||||
gtk_type_get_varargs_type(),
|
||||
gtk_type_check_object_cast(),
|
||||
gtk_type_check_class_cast(),
|
||||
gtk_type_describe_tree(),
|
||||
gtk_type_describe_heritage(),
|
||||
gtk_type_free(),
|
||||
gtk_type_children_types(),
|
||||
gtk_type_set_chunk_alloc(),
|
||||
gtk_type_register_enum(),
|
||||
gtk_type_register_flags(),
|
||||
gtk_type_parent_class().
|
||||
replacements, where available are described in ../docs/Changes-1.4.txt.
|
||||
implemented compatibility functions for the remaining API.
|
||||
|
||||
* configure.in: depend on glib 1.3.1, use gobject module.
|
||||
|
||||
Thu May 11 12:39:50 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* TODO.xml: Various updates to current status.
|
||||
|
@ -1,3 +1,181 @@
|
||||
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
|
||||
|
||||
* gtk/gtktext.c: made the adjustments no-construct args, simply
|
||||
provide default adjustments.
|
||||
(gtk_text_destroy): release adjustments.
|
||||
|
||||
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
|
||||
adjustment argument non-construct.
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
|
||||
instead of in finalize.
|
||||
(gtk_progress_get_text_from_value):
|
||||
(gtk_progress_get_current_text):
|
||||
(gtk_progress_set_value):
|
||||
(gtk_progress_get_percentage_from_value):
|
||||
(gtk_progress_get_current_percentage):
|
||||
(gtk_progress_set_percentage):
|
||||
(gtk_progress_configure): ensure an adjustment is present.
|
||||
|
||||
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcolorsel.[hc]:
|
||||
* gtk/gtkcolorseldialog.[hc]:
|
||||
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
|
||||
their parent implementation, use bit fields for boolean values, don't
|
||||
create unused widgets, usage of glib types, braces go on their own
|
||||
lines, function argument alignment, #include directives etc. etc. etc..
|
||||
|
||||
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
|
||||
|
||||
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
|
||||
|
||||
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
|
||||
of NULL.
|
||||
|
||||
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
|
||||
to freed data.
|
||||
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
|
||||
to NULL when the toplevel is getting destroyed.
|
||||
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
|
||||
(gtk_menu_destroy):
|
||||
(gtk_menu_init): store the information of whether we have to
|
||||
readd the initial child ref_count during destruction in a new
|
||||
GtkMenu field needs_destruction_ref_count.
|
||||
|
||||
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
|
||||
here, those reading: learn from my mistake! ;)
|
||||
in order for set_?adjustment to support a default adjustemnt if
|
||||
invoked with an adjustment pointer of NULL, the code read (pseudo):
|
||||
if (v->adjustment) unref (v->adjustment);
|
||||
if (!adjustment) adjustment = adjustment_new ();
|
||||
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
|
||||
now imagine the first unref to actually free the old adjustment and
|
||||
adjustment_new() creating a new adjustment from the very same memory
|
||||
portion. here, the latter comparision will unintendedly fail, and
|
||||
all hell breaks loose.
|
||||
(gtk_viewport_set_hadjustment):
|
||||
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
|
||||
after unreferencing it.
|
||||
|
||||
* gtk/gtkcontainer.[hc]: removed toplevel registration
|
||||
functions: gtk_container_register_toplevel(),
|
||||
gtk_container_unregister_toplevel() and
|
||||
gtk_container_get_toplevels() which had wrong semantics
|
||||
anyways: it didn't reference and copy the list.
|
||||
|
||||
* gtk/gtkwindow.c: we take over the container toplevel registration
|
||||
bussiness now. windows are registered across multiple destructions,
|
||||
untill they are finalized. the initial implicit reference count
|
||||
users are holding on windows is removed with the first destruction
|
||||
though.
|
||||
(gtk_window_init): ref & sink and set has_user_ref_count, got
|
||||
rid of gtk_container_register_toplevel() call. add window to
|
||||
toplevel_list.
|
||||
(gtk_window_destroy): unref the window if has_user_ref_count
|
||||
is still set, got rid of call to
|
||||
gtk_container_unregister_toplevel().
|
||||
(gtk_window_finalize): remove window from toplevel list.
|
||||
(gtk_window_list_toplevels): new function to return a newly
|
||||
created list with referenced toplevels.
|
||||
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
|
||||
|
||||
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
|
||||
adjustment a non-construct arg.
|
||||
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
|
||||
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
|
||||
* gtk/gtkrange.c: added some realized checks.
|
||||
(gtk_range_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize. remove timer.
|
||||
(gtk_range_get_adjustment): demand create adjustment.
|
||||
|
||||
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
|
||||
we simply create them on demand now and get rid of them in
|
||||
the destroy handler.
|
||||
(gtk_viewport_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize.
|
||||
(gtk_viewport_get_hadjustment):
|
||||
(gtk_viewport_get_vadjustment):
|
||||
(gtk_viewport_size_allocate): demand create h/v adjustment
|
||||
if required.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
|
||||
gtk_widget_real_destroy () functionality.
|
||||
(gtk_widget_real_destroy): reinitialize with a new style, instead
|
||||
of setting widget->style to NULL.
|
||||
|
||||
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcalendar.c:
|
||||
* gtk/gtkbutton.c: ported _get_type() implementation over to
|
||||
GType, either to preserve memchunks allocation facilities,
|
||||
or because Gtk+ 1.0 GtkTypeInfo was still being used.
|
||||
|
||||
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
|
||||
over. prepare for ::destroy to be emitted multiple times.
|
||||
removed reference tracer magic. chain into GObjectClass.shutdown()
|
||||
to emit ::destroy signal.
|
||||
|
||||
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
|
||||
fundamental.
|
||||
|
||||
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
|
||||
cludge.
|
||||
|
||||
* gtk/gtksocket.c:
|
||||
* gtk/gtkplug.c:
|
||||
* gtk/gtklayout.c:
|
||||
* gtk/gtklabel.c:
|
||||
* gtk/gtkargcollector.c:
|
||||
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
|
||||
not being a fundamental anymore, and to work with the new
|
||||
type system (nuked fundamental type varargs clutter).
|
||||
|
||||
* gtk/*.c: install finalize handlers in the GObjectClass
|
||||
part of the class structure.
|
||||
changed direct GTK_OBJECT()->klass accesses to
|
||||
GTK_*_GET_CLASS().
|
||||
changed direct object_class->type accesses to GTK_CLASS_TYPE().
|
||||
|
||||
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
|
||||
GType. made most of the GTK_*() type macros and Gtk* typedefs
|
||||
simple wrappers around macros and types provided by GType.
|
||||
most notably, a significant portion of the old API vanished:
|
||||
GTK_TYPE_MAKE(),
|
||||
GTK_TYPE_SEQNO(),
|
||||
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
|
||||
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
GtkTypeQuery,
|
||||
gtk_type_query(),
|
||||
gtk_type_set_varargs_type(),
|
||||
gtk_type_get_varargs_type(),
|
||||
gtk_type_check_object_cast(),
|
||||
gtk_type_check_class_cast(),
|
||||
gtk_type_describe_tree(),
|
||||
gtk_type_describe_heritage(),
|
||||
gtk_type_free(),
|
||||
gtk_type_children_types(),
|
||||
gtk_type_set_chunk_alloc(),
|
||||
gtk_type_register_enum(),
|
||||
gtk_type_register_flags(),
|
||||
gtk_type_parent_class().
|
||||
replacements, where available are described in ../docs/Changes-1.4.txt.
|
||||
implemented compatibility functions for the remaining API.
|
||||
|
||||
* configure.in: depend on glib 1.3.1, use gobject module.
|
||||
|
||||
Thu May 11 12:39:50 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* TODO.xml: Various updates to current status.
|
||||
|
@ -1,3 +1,181 @@
|
||||
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
|
||||
|
||||
* gtk/gtktext.c: made the adjustments no-construct args, simply
|
||||
provide default adjustments.
|
||||
(gtk_text_destroy): release adjustments.
|
||||
|
||||
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
|
||||
adjustment argument non-construct.
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
|
||||
instead of in finalize.
|
||||
(gtk_progress_get_text_from_value):
|
||||
(gtk_progress_get_current_text):
|
||||
(gtk_progress_set_value):
|
||||
(gtk_progress_get_percentage_from_value):
|
||||
(gtk_progress_get_current_percentage):
|
||||
(gtk_progress_set_percentage):
|
||||
(gtk_progress_configure): ensure an adjustment is present.
|
||||
|
||||
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcolorsel.[hc]:
|
||||
* gtk/gtkcolorseldialog.[hc]:
|
||||
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
|
||||
their parent implementation, use bit fields for boolean values, don't
|
||||
create unused widgets, usage of glib types, braces go on their own
|
||||
lines, function argument alignment, #include directives etc. etc. etc..
|
||||
|
||||
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
|
||||
|
||||
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
|
||||
|
||||
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
|
||||
of NULL.
|
||||
|
||||
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
|
||||
to freed data.
|
||||
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
|
||||
to NULL when the toplevel is getting destroyed.
|
||||
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
|
||||
(gtk_menu_destroy):
|
||||
(gtk_menu_init): store the information of whether we have to
|
||||
readd the initial child ref_count during destruction in a new
|
||||
GtkMenu field needs_destruction_ref_count.
|
||||
|
||||
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
|
||||
here, those reading: learn from my mistake! ;)
|
||||
in order for set_?adjustment to support a default adjustemnt if
|
||||
invoked with an adjustment pointer of NULL, the code read (pseudo):
|
||||
if (v->adjustment) unref (v->adjustment);
|
||||
if (!adjustment) adjustment = adjustment_new ();
|
||||
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
|
||||
now imagine the first unref to actually free the old adjustment and
|
||||
adjustment_new() creating a new adjustment from the very same memory
|
||||
portion. here, the latter comparision will unintendedly fail, and
|
||||
all hell breaks loose.
|
||||
(gtk_viewport_set_hadjustment):
|
||||
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
|
||||
after unreferencing it.
|
||||
|
||||
* gtk/gtkcontainer.[hc]: removed toplevel registration
|
||||
functions: gtk_container_register_toplevel(),
|
||||
gtk_container_unregister_toplevel() and
|
||||
gtk_container_get_toplevels() which had wrong semantics
|
||||
anyways: it didn't reference and copy the list.
|
||||
|
||||
* gtk/gtkwindow.c: we take over the container toplevel registration
|
||||
bussiness now. windows are registered across multiple destructions,
|
||||
untill they are finalized. the initial implicit reference count
|
||||
users are holding on windows is removed with the first destruction
|
||||
though.
|
||||
(gtk_window_init): ref & sink and set has_user_ref_count, got
|
||||
rid of gtk_container_register_toplevel() call. add window to
|
||||
toplevel_list.
|
||||
(gtk_window_destroy): unref the window if has_user_ref_count
|
||||
is still set, got rid of call to
|
||||
gtk_container_unregister_toplevel().
|
||||
(gtk_window_finalize): remove window from toplevel list.
|
||||
(gtk_window_list_toplevels): new function to return a newly
|
||||
created list with referenced toplevels.
|
||||
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
|
||||
|
||||
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
|
||||
adjustment a non-construct arg.
|
||||
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
|
||||
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
|
||||
* gtk/gtkrange.c: added some realized checks.
|
||||
(gtk_range_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize. remove timer.
|
||||
(gtk_range_get_adjustment): demand create adjustment.
|
||||
|
||||
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
|
||||
we simply create them on demand now and get rid of them in
|
||||
the destroy handler.
|
||||
(gtk_viewport_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize.
|
||||
(gtk_viewport_get_hadjustment):
|
||||
(gtk_viewport_get_vadjustment):
|
||||
(gtk_viewport_size_allocate): demand create h/v adjustment
|
||||
if required.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
|
||||
gtk_widget_real_destroy () functionality.
|
||||
(gtk_widget_real_destroy): reinitialize with a new style, instead
|
||||
of setting widget->style to NULL.
|
||||
|
||||
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcalendar.c:
|
||||
* gtk/gtkbutton.c: ported _get_type() implementation over to
|
||||
GType, either to preserve memchunks allocation facilities,
|
||||
or because Gtk+ 1.0 GtkTypeInfo was still being used.
|
||||
|
||||
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
|
||||
over. prepare for ::destroy to be emitted multiple times.
|
||||
removed reference tracer magic. chain into GObjectClass.shutdown()
|
||||
to emit ::destroy signal.
|
||||
|
||||
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
|
||||
fundamental.
|
||||
|
||||
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
|
||||
cludge.
|
||||
|
||||
* gtk/gtksocket.c:
|
||||
* gtk/gtkplug.c:
|
||||
* gtk/gtklayout.c:
|
||||
* gtk/gtklabel.c:
|
||||
* gtk/gtkargcollector.c:
|
||||
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
|
||||
not being a fundamental anymore, and to work with the new
|
||||
type system (nuked fundamental type varargs clutter).
|
||||
|
||||
* gtk/*.c: install finalize handlers in the GObjectClass
|
||||
part of the class structure.
|
||||
changed direct GTK_OBJECT()->klass accesses to
|
||||
GTK_*_GET_CLASS().
|
||||
changed direct object_class->type accesses to GTK_CLASS_TYPE().
|
||||
|
||||
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
|
||||
GType. made most of the GTK_*() type macros and Gtk* typedefs
|
||||
simple wrappers around macros and types provided by GType.
|
||||
most notably, a significant portion of the old API vanished:
|
||||
GTK_TYPE_MAKE(),
|
||||
GTK_TYPE_SEQNO(),
|
||||
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
|
||||
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
GtkTypeQuery,
|
||||
gtk_type_query(),
|
||||
gtk_type_set_varargs_type(),
|
||||
gtk_type_get_varargs_type(),
|
||||
gtk_type_check_object_cast(),
|
||||
gtk_type_check_class_cast(),
|
||||
gtk_type_describe_tree(),
|
||||
gtk_type_describe_heritage(),
|
||||
gtk_type_free(),
|
||||
gtk_type_children_types(),
|
||||
gtk_type_set_chunk_alloc(),
|
||||
gtk_type_register_enum(),
|
||||
gtk_type_register_flags(),
|
||||
gtk_type_parent_class().
|
||||
replacements, where available are described in ../docs/Changes-1.4.txt.
|
||||
implemented compatibility functions for the remaining API.
|
||||
|
||||
* configure.in: depend on glib 1.3.1, use gobject module.
|
||||
|
||||
Thu May 11 12:39:50 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* TODO.xml: Various updates to current status.
|
||||
|
@ -1,3 +1,181 @@
|
||||
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
|
||||
|
||||
* gtk/gtktext.c: made the adjustments no-construct args, simply
|
||||
provide default adjustments.
|
||||
(gtk_text_destroy): release adjustments.
|
||||
|
||||
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
|
||||
adjustment argument non-construct.
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
|
||||
instead of in finalize.
|
||||
(gtk_progress_get_text_from_value):
|
||||
(gtk_progress_get_current_text):
|
||||
(gtk_progress_set_value):
|
||||
(gtk_progress_get_percentage_from_value):
|
||||
(gtk_progress_get_current_percentage):
|
||||
(gtk_progress_set_percentage):
|
||||
(gtk_progress_configure): ensure an adjustment is present.
|
||||
|
||||
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcolorsel.[hc]:
|
||||
* gtk/gtkcolorseldialog.[hc]:
|
||||
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
|
||||
their parent implementation, use bit fields for boolean values, don't
|
||||
create unused widgets, usage of glib types, braces go on their own
|
||||
lines, function argument alignment, #include directives etc. etc. etc..
|
||||
|
||||
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
|
||||
|
||||
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
|
||||
|
||||
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
|
||||
of NULL.
|
||||
|
||||
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
|
||||
to freed data.
|
||||
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
|
||||
to NULL when the toplevel is getting destroyed.
|
||||
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
|
||||
(gtk_menu_destroy):
|
||||
(gtk_menu_init): store the information of whether we have to
|
||||
readd the initial child ref_count during destruction in a new
|
||||
GtkMenu field needs_destruction_ref_count.
|
||||
|
||||
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
|
||||
here, those reading: learn from my mistake! ;)
|
||||
in order for set_?adjustment to support a default adjustemnt if
|
||||
invoked with an adjustment pointer of NULL, the code read (pseudo):
|
||||
if (v->adjustment) unref (v->adjustment);
|
||||
if (!adjustment) adjustment = adjustment_new ();
|
||||
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
|
||||
now imagine the first unref to actually free the old adjustment and
|
||||
adjustment_new() creating a new adjustment from the very same memory
|
||||
portion. here, the latter comparision will unintendedly fail, and
|
||||
all hell breaks loose.
|
||||
(gtk_viewport_set_hadjustment):
|
||||
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
|
||||
after unreferencing it.
|
||||
|
||||
* gtk/gtkcontainer.[hc]: removed toplevel registration
|
||||
functions: gtk_container_register_toplevel(),
|
||||
gtk_container_unregister_toplevel() and
|
||||
gtk_container_get_toplevels() which had wrong semantics
|
||||
anyways: it didn't reference and copy the list.
|
||||
|
||||
* gtk/gtkwindow.c: we take over the container toplevel registration
|
||||
bussiness now. windows are registered across multiple destructions,
|
||||
untill they are finalized. the initial implicit reference count
|
||||
users are holding on windows is removed with the first destruction
|
||||
though.
|
||||
(gtk_window_init): ref & sink and set has_user_ref_count, got
|
||||
rid of gtk_container_register_toplevel() call. add window to
|
||||
toplevel_list.
|
||||
(gtk_window_destroy): unref the window if has_user_ref_count
|
||||
is still set, got rid of call to
|
||||
gtk_container_unregister_toplevel().
|
||||
(gtk_window_finalize): remove window from toplevel list.
|
||||
(gtk_window_list_toplevels): new function to return a newly
|
||||
created list with referenced toplevels.
|
||||
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
|
||||
|
||||
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
|
||||
adjustment a non-construct arg.
|
||||
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
|
||||
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
|
||||
* gtk/gtkrange.c: added some realized checks.
|
||||
(gtk_range_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize. remove timer.
|
||||
(gtk_range_get_adjustment): demand create adjustment.
|
||||
|
||||
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
|
||||
we simply create them on demand now and get rid of them in
|
||||
the destroy handler.
|
||||
(gtk_viewport_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize.
|
||||
(gtk_viewport_get_hadjustment):
|
||||
(gtk_viewport_get_vadjustment):
|
||||
(gtk_viewport_size_allocate): demand create h/v adjustment
|
||||
if required.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
|
||||
gtk_widget_real_destroy () functionality.
|
||||
(gtk_widget_real_destroy): reinitialize with a new style, instead
|
||||
of setting widget->style to NULL.
|
||||
|
||||
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcalendar.c:
|
||||
* gtk/gtkbutton.c: ported _get_type() implementation over to
|
||||
GType, either to preserve memchunks allocation facilities,
|
||||
or because Gtk+ 1.0 GtkTypeInfo was still being used.
|
||||
|
||||
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
|
||||
over. prepare for ::destroy to be emitted multiple times.
|
||||
removed reference tracer magic. chain into GObjectClass.shutdown()
|
||||
to emit ::destroy signal.
|
||||
|
||||
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
|
||||
fundamental.
|
||||
|
||||
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
|
||||
cludge.
|
||||
|
||||
* gtk/gtksocket.c:
|
||||
* gtk/gtkplug.c:
|
||||
* gtk/gtklayout.c:
|
||||
* gtk/gtklabel.c:
|
||||
* gtk/gtkargcollector.c:
|
||||
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
|
||||
not being a fundamental anymore, and to work with the new
|
||||
type system (nuked fundamental type varargs clutter).
|
||||
|
||||
* gtk/*.c: install finalize handlers in the GObjectClass
|
||||
part of the class structure.
|
||||
changed direct GTK_OBJECT()->klass accesses to
|
||||
GTK_*_GET_CLASS().
|
||||
changed direct object_class->type accesses to GTK_CLASS_TYPE().
|
||||
|
||||
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
|
||||
GType. made most of the GTK_*() type macros and Gtk* typedefs
|
||||
simple wrappers around macros and types provided by GType.
|
||||
most notably, a significant portion of the old API vanished:
|
||||
GTK_TYPE_MAKE(),
|
||||
GTK_TYPE_SEQNO(),
|
||||
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
|
||||
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
GtkTypeQuery,
|
||||
gtk_type_query(),
|
||||
gtk_type_set_varargs_type(),
|
||||
gtk_type_get_varargs_type(),
|
||||
gtk_type_check_object_cast(),
|
||||
gtk_type_check_class_cast(),
|
||||
gtk_type_describe_tree(),
|
||||
gtk_type_describe_heritage(),
|
||||
gtk_type_free(),
|
||||
gtk_type_children_types(),
|
||||
gtk_type_set_chunk_alloc(),
|
||||
gtk_type_register_enum(),
|
||||
gtk_type_register_flags(),
|
||||
gtk_type_parent_class().
|
||||
replacements, where available are described in ../docs/Changes-1.4.txt.
|
||||
implemented compatibility functions for the remaining API.
|
||||
|
||||
* configure.in: depend on glib 1.3.1, use gobject module.
|
||||
|
||||
Thu May 11 12:39:50 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* TODO.xml: Various updates to current status.
|
||||
|
@ -1,3 +1,181 @@
|
||||
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
|
||||
|
||||
* gtk/gtktext.c: made the adjustments no-construct args, simply
|
||||
provide default adjustments.
|
||||
(gtk_text_destroy): release adjustments.
|
||||
|
||||
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
|
||||
adjustment argument non-construct.
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
|
||||
instead of in finalize.
|
||||
(gtk_progress_get_text_from_value):
|
||||
(gtk_progress_get_current_text):
|
||||
(gtk_progress_set_value):
|
||||
(gtk_progress_get_percentage_from_value):
|
||||
(gtk_progress_get_current_percentage):
|
||||
(gtk_progress_set_percentage):
|
||||
(gtk_progress_configure): ensure an adjustment is present.
|
||||
|
||||
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcolorsel.[hc]:
|
||||
* gtk/gtkcolorseldialog.[hc]:
|
||||
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
|
||||
their parent implementation, use bit fields for boolean values, don't
|
||||
create unused widgets, usage of glib types, braces go on their own
|
||||
lines, function argument alignment, #include directives etc. etc. etc..
|
||||
|
||||
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
|
||||
|
||||
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
|
||||
|
||||
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
|
||||
of NULL.
|
||||
|
||||
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
|
||||
to freed data.
|
||||
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
|
||||
to NULL when the toplevel is getting destroyed.
|
||||
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
|
||||
(gtk_menu_destroy):
|
||||
(gtk_menu_init): store the information of whether we have to
|
||||
readd the initial child ref_count during destruction in a new
|
||||
GtkMenu field needs_destruction_ref_count.
|
||||
|
||||
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
|
||||
here, those reading: learn from my mistake! ;)
|
||||
in order for set_?adjustment to support a default adjustemnt if
|
||||
invoked with an adjustment pointer of NULL, the code read (pseudo):
|
||||
if (v->adjustment) unref (v->adjustment);
|
||||
if (!adjustment) adjustment = adjustment_new ();
|
||||
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
|
||||
now imagine the first unref to actually free the old adjustment and
|
||||
adjustment_new() creating a new adjustment from the very same memory
|
||||
portion. here, the latter comparision will unintendedly fail, and
|
||||
all hell breaks loose.
|
||||
(gtk_viewport_set_hadjustment):
|
||||
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
|
||||
after unreferencing it.
|
||||
|
||||
* gtk/gtkcontainer.[hc]: removed toplevel registration
|
||||
functions: gtk_container_register_toplevel(),
|
||||
gtk_container_unregister_toplevel() and
|
||||
gtk_container_get_toplevels() which had wrong semantics
|
||||
anyways: it didn't reference and copy the list.
|
||||
|
||||
* gtk/gtkwindow.c: we take over the container toplevel registration
|
||||
bussiness now. windows are registered across multiple destructions,
|
||||
untill they are finalized. the initial implicit reference count
|
||||
users are holding on windows is removed with the first destruction
|
||||
though.
|
||||
(gtk_window_init): ref & sink and set has_user_ref_count, got
|
||||
rid of gtk_container_register_toplevel() call. add window to
|
||||
toplevel_list.
|
||||
(gtk_window_destroy): unref the window if has_user_ref_count
|
||||
is still set, got rid of call to
|
||||
gtk_container_unregister_toplevel().
|
||||
(gtk_window_finalize): remove window from toplevel list.
|
||||
(gtk_window_list_toplevels): new function to return a newly
|
||||
created list with referenced toplevels.
|
||||
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
|
||||
|
||||
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
|
||||
adjustment a non-construct arg.
|
||||
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
|
||||
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
|
||||
* gtk/gtkrange.c: added some realized checks.
|
||||
(gtk_range_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize. remove timer.
|
||||
(gtk_range_get_adjustment): demand create adjustment.
|
||||
|
||||
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
|
||||
we simply create them on demand now and get rid of them in
|
||||
the destroy handler.
|
||||
(gtk_viewport_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize.
|
||||
(gtk_viewport_get_hadjustment):
|
||||
(gtk_viewport_get_vadjustment):
|
||||
(gtk_viewport_size_allocate): demand create h/v adjustment
|
||||
if required.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
|
||||
gtk_widget_real_destroy () functionality.
|
||||
(gtk_widget_real_destroy): reinitialize with a new style, instead
|
||||
of setting widget->style to NULL.
|
||||
|
||||
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcalendar.c:
|
||||
* gtk/gtkbutton.c: ported _get_type() implementation over to
|
||||
GType, either to preserve memchunks allocation facilities,
|
||||
or because Gtk+ 1.0 GtkTypeInfo was still being used.
|
||||
|
||||
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
|
||||
over. prepare for ::destroy to be emitted multiple times.
|
||||
removed reference tracer magic. chain into GObjectClass.shutdown()
|
||||
to emit ::destroy signal.
|
||||
|
||||
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
|
||||
fundamental.
|
||||
|
||||
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
|
||||
cludge.
|
||||
|
||||
* gtk/gtksocket.c:
|
||||
* gtk/gtkplug.c:
|
||||
* gtk/gtklayout.c:
|
||||
* gtk/gtklabel.c:
|
||||
* gtk/gtkargcollector.c:
|
||||
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
|
||||
not being a fundamental anymore, and to work with the new
|
||||
type system (nuked fundamental type varargs clutter).
|
||||
|
||||
* gtk/*.c: install finalize handlers in the GObjectClass
|
||||
part of the class structure.
|
||||
changed direct GTK_OBJECT()->klass accesses to
|
||||
GTK_*_GET_CLASS().
|
||||
changed direct object_class->type accesses to GTK_CLASS_TYPE().
|
||||
|
||||
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
|
||||
GType. made most of the GTK_*() type macros and Gtk* typedefs
|
||||
simple wrappers around macros and types provided by GType.
|
||||
most notably, a significant portion of the old API vanished:
|
||||
GTK_TYPE_MAKE(),
|
||||
GTK_TYPE_SEQNO(),
|
||||
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
|
||||
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
GtkTypeQuery,
|
||||
gtk_type_query(),
|
||||
gtk_type_set_varargs_type(),
|
||||
gtk_type_get_varargs_type(),
|
||||
gtk_type_check_object_cast(),
|
||||
gtk_type_check_class_cast(),
|
||||
gtk_type_describe_tree(),
|
||||
gtk_type_describe_heritage(),
|
||||
gtk_type_free(),
|
||||
gtk_type_children_types(),
|
||||
gtk_type_set_chunk_alloc(),
|
||||
gtk_type_register_enum(),
|
||||
gtk_type_register_flags(),
|
||||
gtk_type_parent_class().
|
||||
replacements, where available are described in ../docs/Changes-1.4.txt.
|
||||
implemented compatibility functions for the remaining API.
|
||||
|
||||
* configure.in: depend on glib 1.3.1, use gobject module.
|
||||
|
||||
Thu May 11 12:39:50 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* TODO.xml: Various updates to current status.
|
||||
|
@ -1,3 +1,181 @@
|
||||
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
|
||||
|
||||
* gtk/gtktext.c: made the adjustments no-construct args, simply
|
||||
provide default adjustments.
|
||||
(gtk_text_destroy): release adjustments.
|
||||
|
||||
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
|
||||
adjustment argument non-construct.
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
|
||||
instead of in finalize.
|
||||
(gtk_progress_get_text_from_value):
|
||||
(gtk_progress_get_current_text):
|
||||
(gtk_progress_set_value):
|
||||
(gtk_progress_get_percentage_from_value):
|
||||
(gtk_progress_get_current_percentage):
|
||||
(gtk_progress_set_percentage):
|
||||
(gtk_progress_configure): ensure an adjustment is present.
|
||||
|
||||
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcolorsel.[hc]:
|
||||
* gtk/gtkcolorseldialog.[hc]:
|
||||
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
|
||||
their parent implementation, use bit fields for boolean values, don't
|
||||
create unused widgets, usage of glib types, braces go on their own
|
||||
lines, function argument alignment, #include directives etc. etc. etc..
|
||||
|
||||
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
|
||||
|
||||
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
|
||||
|
||||
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
|
||||
of NULL.
|
||||
|
||||
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
|
||||
to freed data.
|
||||
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
|
||||
|
||||
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
|
||||
to NULL when the toplevel is getting destroyed.
|
||||
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
|
||||
(gtk_menu_destroy):
|
||||
(gtk_menu_init): store the information of whether we have to
|
||||
readd the initial child ref_count during destruction in a new
|
||||
GtkMenu field needs_destruction_ref_count.
|
||||
|
||||
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
|
||||
here, those reading: learn from my mistake! ;)
|
||||
in order for set_?adjustment to support a default adjustemnt if
|
||||
invoked with an adjustment pointer of NULL, the code read (pseudo):
|
||||
if (v->adjustment) unref (v->adjustment);
|
||||
if (!adjustment) adjustment = adjustment_new ();
|
||||
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
|
||||
now imagine the first unref to actually free the old adjustment and
|
||||
adjustment_new() creating a new adjustment from the very same memory
|
||||
portion. here, the latter comparision will unintendedly fail, and
|
||||
all hell breaks loose.
|
||||
(gtk_viewport_set_hadjustment):
|
||||
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
|
||||
after unreferencing it.
|
||||
|
||||
* gtk/gtkcontainer.[hc]: removed toplevel registration
|
||||
functions: gtk_container_register_toplevel(),
|
||||
gtk_container_unregister_toplevel() and
|
||||
gtk_container_get_toplevels() which had wrong semantics
|
||||
anyways: it didn't reference and copy the list.
|
||||
|
||||
* gtk/gtkwindow.c: we take over the container toplevel registration
|
||||
bussiness now. windows are registered across multiple destructions,
|
||||
untill they are finalized. the initial implicit reference count
|
||||
users are holding on windows is removed with the first destruction
|
||||
though.
|
||||
(gtk_window_init): ref & sink and set has_user_ref_count, got
|
||||
rid of gtk_container_register_toplevel() call. add window to
|
||||
toplevel_list.
|
||||
(gtk_window_destroy): unref the window if has_user_ref_count
|
||||
is still set, got rid of call to
|
||||
gtk_container_unregister_toplevel().
|
||||
(gtk_window_finalize): remove window from toplevel list.
|
||||
(gtk_window_list_toplevels): new function to return a newly
|
||||
created list with referenced toplevels.
|
||||
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
|
||||
|
||||
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
|
||||
adjustment a non-construct arg.
|
||||
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
|
||||
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
|
||||
|
||||
* gtk/gtkrange.c: added some realized checks.
|
||||
(gtk_range_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize. remove timer.
|
||||
(gtk_range_get_adjustment): demand create adjustment.
|
||||
|
||||
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
|
||||
we simply create them on demand now and get rid of them in
|
||||
the destroy handler.
|
||||
(gtk_viewport_destroy): get rid of the h/v adjustments in the
|
||||
destroy handler instead of finalize.
|
||||
(gtk_viewport_get_hadjustment):
|
||||
(gtk_viewport_get_vadjustment):
|
||||
(gtk_viewport_size_allocate): demand create h/v adjustment
|
||||
if required.
|
||||
|
||||
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
|
||||
gtk_widget_real_destroy () functionality.
|
||||
(gtk_widget_real_destroy): reinitialize with a new style, instead
|
||||
of setting widget->style to NULL.
|
||||
|
||||
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
|
||||
|
||||
* gtk/gtkcalendar.c:
|
||||
* gtk/gtkbutton.c: ported _get_type() implementation over to
|
||||
GType, either to preserve memchunks allocation facilities,
|
||||
or because Gtk+ 1.0 GtkTypeInfo was still being used.
|
||||
|
||||
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
|
||||
over. prepare for ::destroy to be emitted multiple times.
|
||||
removed reference tracer magic. chain into GObjectClass.shutdown()
|
||||
to emit ::destroy signal.
|
||||
|
||||
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
|
||||
fundamental.
|
||||
|
||||
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
|
||||
cludge.
|
||||
|
||||
* gtk/gtksocket.c:
|
||||
* gtk/gtkplug.c:
|
||||
* gtk/gtklayout.c:
|
||||
* gtk/gtklabel.c:
|
||||
* gtk/gtkargcollector.c:
|
||||
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
|
||||
not being a fundamental anymore, and to work with the new
|
||||
type system (nuked fundamental type varargs clutter).
|
||||
|
||||
* gtk/*.c: install finalize handlers in the GObjectClass
|
||||
part of the class structure.
|
||||
changed direct GTK_OBJECT()->klass accesses to
|
||||
GTK_*_GET_CLASS().
|
||||
changed direct object_class->type accesses to GTK_CLASS_TYPE().
|
||||
|
||||
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
|
||||
GType. made most of the GTK_*() type macros and Gtk* typedefs
|
||||
simple wrappers around macros and types provided by GType.
|
||||
most notably, a significant portion of the old API vanished:
|
||||
GTK_TYPE_MAKE(),
|
||||
GTK_TYPE_SEQNO(),
|
||||
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
|
||||
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
GtkTypeQuery,
|
||||
gtk_type_query(),
|
||||
gtk_type_set_varargs_type(),
|
||||
gtk_type_get_varargs_type(),
|
||||
gtk_type_check_object_cast(),
|
||||
gtk_type_check_class_cast(),
|
||||
gtk_type_describe_tree(),
|
||||
gtk_type_describe_heritage(),
|
||||
gtk_type_free(),
|
||||
gtk_type_children_types(),
|
||||
gtk_type_set_chunk_alloc(),
|
||||
gtk_type_register_enum(),
|
||||
gtk_type_register_flags(),
|
||||
gtk_type_parent_class().
|
||||
replacements, where available are described in ../docs/Changes-1.4.txt.
|
||||
implemented compatibility functions for the remaining API.
|
||||
|
||||
* configure.in: depend on glib 1.3.1, use gobject module.
|
||||
|
||||
Thu May 11 12:39:50 2000 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* TODO.xml: Various updates to current status.
|
||||
|
@ -252,16 +252,16 @@ fi
|
||||
if test x$with_glib = x ; then
|
||||
# Look for separately installed glib
|
||||
|
||||
AM_PATH_GLIB(1.3.0,,
|
||||
AM_PATH_GLIB(1.3.1,,
|
||||
AC_MSG_ERROR([
|
||||
*** GLIB 1.3.0 or better is required. The latest version of GLIB
|
||||
*** is always available from ftp://ftp.gtk.org/.]),
|
||||
gmodule gthread)
|
||||
gobject gmodule gthread)
|
||||
|
||||
# we do not want to make all gtk progs to link to thread libraries.
|
||||
glib_cflags=`$GLIB_CONFIG glib gmodule --cflags`
|
||||
glib_cflags=`$GLIB_CONFIG glib gobject gmodule --cflags`
|
||||
glib_thread_cflags="$GLIB_CFLAGS"
|
||||
glib_libs=`$GLIB_CONFIG glib gmodule --libs`
|
||||
glib_libs=`$GLIB_CONFIG glib gobject gmodule --libs`
|
||||
glib_thread_libs="$GLIB_LIBS"
|
||||
GLIB_LIBS="$glib_libs"
|
||||
GLIB_DEPLIBS="$glib_libs"
|
||||
|
@ -1,26 +1,101 @@
|
||||
Incompatible Changes from GTK+-1.2 to GTK+-1.4:
|
||||
|
||||
- The gdk_time* functions have been removed. This functionality
|
||||
* The gdk_time* functions have been removed. This functionality
|
||||
has been unused since the main loop was moved into GLib
|
||||
prior to 1.2.
|
||||
|
||||
- The signature for GtkPrintFunc (used for gtk_item_factory_dump_items)
|
||||
* The signature for GtkPrintFunc (used for gtk_item_factory_dump_items)
|
||||
has been changed to take a 'const gchar *' instead of 'gchar *', to
|
||||
match what we do for glib, and other similar cases.
|
||||
|
||||
- The detail arguments in the GtkStyleClass structure are now 'const gchar *'.
|
||||
* The detail arguments in the GtkStyleClass structure are now 'const gchar *'.
|
||||
|
||||
- gtk_paned_set_gutter_size() has been removed, since the small handle tab
|
||||
* gtk_paned_set_gutter_size() has been removed, since the small handle tab
|
||||
has been changed to include the entire area previously occupied by
|
||||
the gutter.
|
||||
|
||||
- GDK no longer selects OwnerGrabButtonMask for button presses. This means
|
||||
* GDK no longer selects OwnerGrabButtonMask for button presses. This means
|
||||
that the automatic grab that occurs when the user presses a button
|
||||
will have owner_events = FALSE, so all events are redirected to the
|
||||
grab window, even events that would normally go to other windows of the
|
||||
window's owner.
|
||||
|
||||
- The detail arguments in the GtkStyleClass structure are now 'const gchar *'.
|
||||
* GtkColorSelectionDialog has now been moved into it's own set of files,
|
||||
gtkcolorseldialog.c and gtkcolorseldialog.h.
|
||||
|
||||
- GtkColorSelectionDialog has now been moved into it's own set of files,
|
||||
gtkcolorseldialog.c and gtkcolorseldialog.h.
|
||||
* Type system changes:
|
||||
- GTK_TYPE_OBJECT is not a fundamental type anymore. Type checks of the
|
||||
style (GTK_FUNDAMENTAL_TYPE (some_type) == GTK_TYPE_OBJECT)
|
||||
will not work anymore. As a replacement, (GTK_TYPE_IS_OBJECT (some_type))
|
||||
can be used now.
|
||||
- The following types vanished: GTK_TYPE_ARGS, GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK, GTK_TYPE_FOREIGN. With them, the corresponding GtkARg
|
||||
fields and field access macros vanished as well.
|
||||
- The following type aliases vanished: GTK_TYPE_FLAT_FIRST,
|
||||
GTK_TYPE_FLAT_LAST, GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST.
|
||||
- The type macros GTK_TYPE_MAKE() and GTK_TYPE_SEQNO() vanished, use of
|
||||
GTK_FUNDAMENTAL_TYPE() is discouraged. Instead, the corresponding GType
|
||||
API should be used: G_TYPE_FUNDAMENTAL(), G_TYPE_DERIVE_ID(),
|
||||
G_TYPE_BRANCH_SEQNO(). Note that the GLib type system doesn't build new
|
||||
type ids based on a global incremental sequential number anymore, but
|
||||
numbers new type ids sequentially per fundamental type branch.
|
||||
- The following type functions vanished/were replaced:
|
||||
Old Function Replacement
|
||||
gtk_type_query() - being investigated -
|
||||
gtk_type_set_varargs_type() -
|
||||
gtk_type_get_varargs_type() -
|
||||
gtk_type_check_object_cast() g_type_check_instance_cast()
|
||||
gtk_type_check_class_cast() g_type_check_class_cast()
|
||||
gtk_type_describe_tree() -
|
||||
gtk_type_describe_heritage() -
|
||||
gtk_type_free() -
|
||||
gtk_type_children_types() g_type_children()
|
||||
gtk_type_set_chunk_alloc() GTypeInfo.n_preallocs
|
||||
gtk_type_register_enum() g_enum_register_static()
|
||||
gtk_type_register_flags() g_flags_register_static()
|
||||
gtk_type_parent_class() g_type_parent() / g_type_class_peek_parent()
|
||||
Use of g_type_class_ref() / g_type_class_unref() and g_type_class_peek()
|
||||
is recommended over usage of gtk_type_class().
|
||||
Use of g_type_register_static() / g_type_register_dynamic() is recommended
|
||||
over usage of gtk_type_unique().
|
||||
|
||||
* Object system changes:
|
||||
GtkObject derives from GObject, it is not the basic object type anymore.
|
||||
This imposes the following source incompatible changes:
|
||||
- GtkObject has no klass field anymore, an object's class can be retrived
|
||||
with the object's coresponding GTK_<OBJECT>_GET_CLASS (object) macro.
|
||||
- GtkObjectClass has no type field anymore, a class's type can be retrived
|
||||
with the GTK_CLASS_TYPE (class) macro.
|
||||
- GtkObjectClass does not introduce the finalize() or shutdown() method
|
||||
anymore. While shutdown() is intended for Gtk internal use only, finalize()
|
||||
is required by a variety of object implementations. GObjectClass.finalize
|
||||
should be overriden here, e.g.:
|
||||
static void gtk_label_finalize (GObject *gobject)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (gobject);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
static void gtk_label_class_init (GtkLabelClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
|
||||
gobject_class->finalize = gtk_label_finalize;
|
||||
}
|
||||
- the GtkObject::destroy signal can be emitted multiple times on an object
|
||||
now. ::destroy implementations have to take this into account by
|
||||
conditionalising freeing/release of assorted resources, e.g.:
|
||||
if (object->foo_data)
|
||||
{
|
||||
g_free (object->foo_data);
|
||||
object->foo_data = NULL;
|
||||
}
|
||||
Also, ::destroy implementations have to release peding object references,
|
||||
that is, code portions commonly found in finalize implementations like:
|
||||
if (object->adjustment)
|
||||
{
|
||||
gtk_object_unref (object->adjustment);
|
||||
object->adjustment = NULL;
|
||||
}
|
||||
have to be moved into the ::destroy implementations.
|
||||
This is required to break object reference cycles at destruction time.
|
||||
|
@ -92,6 +92,7 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
|
||||
gtkhscale.h \
|
||||
gtkhscrollbar.h \
|
||||
gtkhseparator.h \
|
||||
gtkhsv.h \
|
||||
gtkimage.h \
|
||||
gtkinputdialog.h \
|
||||
gtkinvisible.h \
|
||||
|
@ -13,11 +13,7 @@
|
||||
"OBJECT"=>"gpointer",
|
||||
|
||||
# complex types. These need special handling.
|
||||
"FOREIGN"=>"FOREIGN",
|
||||
"C_CALLBACK"=>"C_CALLBACK",
|
||||
"SIGNAL"=>"SIGNAL",
|
||||
"ARGS"=>"ARGS",
|
||||
"CALLBACK"=>"CALLBACK"
|
||||
"SIGNAL"=>"SIGNAL"
|
||||
);
|
||||
|
||||
if ($#ARGV != 2) {
|
||||
@ -106,24 +102,7 @@ EOT
|
||||
print OS "typedef $trans{$retval} (*GtkSignal_$funcname) (GtkObject *object, \n";
|
||||
$argn = 1;
|
||||
for (@params) {
|
||||
if($_ eq "C_CALLBACK") {
|
||||
print OS "gpointer arg".$argn."a,\n";
|
||||
print OS "gpointer arg".$argn."b,\n";
|
||||
$argn++;
|
||||
} elsif($_ eq "SIGNAL") {
|
||||
print OS "gpointer arg".$argn."a,\n";
|
||||
print OS "gpointer arg".$argn."b,\n";
|
||||
$argn++;
|
||||
} elsif($_ eq "ARGS") {
|
||||
print OS "gpointer arg".$argn."a,\n";
|
||||
print OS "gpointer arg".$argn."b,\n";
|
||||
$argn++;
|
||||
} elsif($_ eq "CALLBACK") {
|
||||
print OS "gpointer arg".$argn."a,\n";
|
||||
print OS "gpointer arg".$argn."b,\n";
|
||||
print OS "gpointer arg".$argn."c,\n";
|
||||
$argn++;
|
||||
} elsif($_ eq "FOREIGN") {
|
||||
if($_ eq "SIGNAL") {
|
||||
print OS "gpointer arg".$argn."a,\n";
|
||||
print OS "gpointer arg".$argn."b,\n";
|
||||
$argn++;
|
||||
@ -153,26 +132,10 @@ EOT
|
||||
print OS " (* rfunc) (object,\n";
|
||||
|
||||
for($i = 0; $i < (scalar @params); $i++) {
|
||||
if($params[$i] eq "C_CALLBACK") {
|
||||
print OS <<EOT;
|
||||
GTK_VALUE_C_CALLBACK(args[$i]).func,
|
||||
GTK_VALUE_C_CALLBACK(args[$i]).func_data,
|
||||
EOT
|
||||
} elsif ($params[$i] eq "SIGNAL") {
|
||||
if ($params[$i] eq "SIGNAL") {
|
||||
print OS <<EOT;
|
||||
GTK_VALUE_SIGNAL(args[$i]).f,
|
||||
GTK_VALUE_SIGNAL(args[$i]).d,
|
||||
EOT
|
||||
} elsif ($params[$i] eq "CALLBACK") {
|
||||
print OS <<EOT;
|
||||
GTK_VALUE_CALLBACK(args[$i]).marshal,
|
||||
GTK_VALUE_CALLBACK(args[$i]).data,
|
||||
GTK_VALUE_CALLBACK(args[$i]).notify,
|
||||
EOT
|
||||
} elsif ($params[$i] eq "FOREIGN") {
|
||||
print OS <<EOT;
|
||||
GTK_VALUE_FOREIGN(args[$i]).data,
|
||||
GTK_VALUE_FOREIGN(args[$i]).notify,
|
||||
EOT
|
||||
} elsif ($params[$i] eq "NONE") {
|
||||
} else {
|
||||
|
@ -685,8 +685,6 @@ EXPORTS
|
||||
gtk_marshal_INT__POINTER
|
||||
gtk_marshal_INT__POINTER_CHAR_CHAR
|
||||
gtk_marshal_NONE__BOOL
|
||||
gtk_marshal_NONE__C_CALLBACK
|
||||
gtk_marshal_NONE__C_CALLBACK_C_CALLBACK
|
||||
gtk_marshal_NONE__INT
|
||||
gtk_marshal_NONE__INT_FLOAT
|
||||
gtk_marshal_NONE__INT_FLOAT_BOOL
|
||||
|
@ -656,7 +656,7 @@ gtk_accel_group_create_add (GtkType class_type,
|
||||
GtkSignalRunType signal_flags,
|
||||
guint handler_offset)
|
||||
{
|
||||
g_return_val_if_fail (gtk_type_is_a (class_type, GTK_TYPE_OBJECT), 0);
|
||||
g_return_val_if_fail (GTK_TYPE_IS_OBJECT (class_type), 0);
|
||||
|
||||
return gtk_signal_new ("add-accelerator",
|
||||
signal_flags,
|
||||
@ -676,7 +676,7 @@ gtk_accel_group_create_remove (GtkType class_type,
|
||||
GtkSignalRunType signal_flags,
|
||||
guint handler_offset)
|
||||
{
|
||||
g_return_val_if_fail (gtk_type_is_a (class_type, GTK_TYPE_OBJECT), 0);
|
||||
g_return_val_if_fail (GTK_TYPE_IS_OBJECT (class_type), 0);
|
||||
|
||||
return gtk_signal_new ("remove-accelerator",
|
||||
signal_flags,
|
||||
|
@ -48,7 +48,7 @@ static void gtk_accel_label_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_accel_label_destroy (GtkObject *object);
|
||||
static void gtk_accel_label_finalize (GtkObject *object);
|
||||
static void gtk_accel_label_finalize (GObject *object);
|
||||
static void gtk_accel_label_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static gint gtk_accel_label_expose_event (GtkWidget *widget,
|
||||
@ -87,6 +87,7 @@ gtk_accel_label_get_type (void)
|
||||
static void
|
||||
gtk_accel_label_class_init (GtkAccelLabelClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkMiscClass *misc_class;
|
||||
@ -102,10 +103,11 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class)
|
||||
|
||||
gtk_object_add_arg_type ("GtkAccelLabel::accel_widget", GTK_TYPE_WIDGET, GTK_ARG_READWRITE, ARG_ACCEL_WIDGET);
|
||||
|
||||
gobject_class->finalize = gtk_accel_label_finalize;
|
||||
|
||||
object_class->set_arg = gtk_accel_label_set_arg;
|
||||
object_class->get_arg = gtk_accel_label_get_arg;
|
||||
object_class->destroy = gtk_accel_label_destroy;
|
||||
object_class->finalize = gtk_accel_label_finalize;
|
||||
|
||||
widget_class->size_request = gtk_accel_label_size_request;
|
||||
widget_class->expose_event = gtk_accel_label_expose_event;
|
||||
@ -200,18 +202,17 @@ gtk_accel_label_destroy (GtkObject *object)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_accel_label_finalize (GtkObject *object)
|
||||
gtk_accel_label_finalize (GObject *object)
|
||||
{
|
||||
GtkAccelLabel *accel_label;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_ACCEL_LABEL (object));
|
||||
|
||||
accel_label = GTK_ACCEL_LABEL (object);
|
||||
|
||||
g_free (accel_label->accel_string);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
guint
|
||||
@ -376,7 +377,7 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label)
|
||||
g_return_val_if_fail (accel_label != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), FALSE);
|
||||
|
||||
class = GTK_ACCEL_LABEL_CLASS (GTK_OBJECT (accel_label)->klass);
|
||||
class = GTK_ACCEL_LABEL_GET_CLASS (accel_label);
|
||||
|
||||
g_free (accel_label->accel_string);
|
||||
accel_label->accel_string = NULL;
|
||||
|
@ -77,14 +77,14 @@ gtk_adjustment_class_init (GtkAdjustmentClass *class)
|
||||
adjustment_signals[CHANGED] =
|
||||
gtk_signal_new ("changed",
|
||||
GTK_RUN_FIRST | GTK_RUN_NO_RECURSE,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkAdjustmentClass, changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
adjustment_signals[VALUE_CHANGED] =
|
||||
gtk_signal_new ("value_changed",
|
||||
GTK_RUN_FIRST | GTK_RUN_NO_RECURSE,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkAdjustmentClass, value_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
47
gtk/gtkarg.c
47
gtk/gtkarg.c
@ -65,7 +65,7 @@ gtk_arg_type_new_static (GtkType base_class_type,
|
||||
gchar *p;
|
||||
|
||||
g_return_val_if_fail (arg_name != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_FUNDAMENTAL_TYPE (base_class_type) == GTK_TYPE_OBJECT, NULL);
|
||||
g_return_val_if_fail (GTK_TYPE_IS_OBJECT (base_class_type), NULL);
|
||||
g_return_val_if_fail (class_n_args_offset != 0, NULL);
|
||||
g_return_val_if_fail (arg_info_hash_table != NULL, NULL);
|
||||
g_return_val_if_fail (arg_type > GTK_TYPE_NONE, NULL);
|
||||
@ -214,7 +214,7 @@ gtk_arg_get_info (GtkType object_type,
|
||||
else
|
||||
{
|
||||
otype = object_type;
|
||||
while (!*info_p && GTK_FUNDAMENTAL_TYPE (otype) == GTK_TYPE_OBJECT)
|
||||
while (!*info_p && GTK_TYPE_IS_OBJECT (otype))
|
||||
{
|
||||
GtkArgInfo info;
|
||||
|
||||
@ -440,12 +440,6 @@ gtk_arg_reset (GtkArg *arg)
|
||||
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)
|
||||
{
|
||||
@ -503,12 +497,6 @@ gtk_arg_values_equal (const GtkArg *arg1,
|
||||
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)
|
||||
{
|
||||
@ -555,20 +543,7 @@ gtk_arg_values_equal (const GtkArg *arg1,
|
||||
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:
|
||||
case G_TYPE_OBJECT:
|
||||
equal = GTK_VALUE_OBJECT (*arg1) == GTK_VALUE_OBJECT (*arg2);
|
||||
break;
|
||||
case GTK_TYPE_POINTER:
|
||||
@ -578,10 +553,6 @@ gtk_arg_values_equal (const GtkArg *arg1,
|
||||
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;
|
||||
@ -601,12 +572,6 @@ gtk_arg_to_valueloc (GtkArg *arg,
|
||||
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)
|
||||
{
|
||||
@ -661,15 +626,11 @@ gtk_arg_to_valueloc (GtkArg *arg,
|
||||
case GTK_TYPE_STRING:
|
||||
case GTK_TYPE_POINTER:
|
||||
case GTK_TYPE_BOXED:
|
||||
case GTK_TYPE_OBJECT:
|
||||
case G_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,
|
||||
|
@ -38,13 +38,7 @@ G_STMT_START { \
|
||||
GtkType fundamental_type; \
|
||||
\
|
||||
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); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
error_msg = NULL; \
|
||||
switch (fundamental_type) \
|
||||
{ \
|
||||
@ -124,42 +118,25 @@ G_STMT_START { \
|
||||
GTK_VALUE_SIGNAL (*arg).f = va_arg (var_args, GtkSignalFunc); \
|
||||
GTK_VALUE_SIGNAL (*arg).d = va_arg (var_args, gpointer); \
|
||||
break; \
|
||||
case GTK_TYPE_ARGS: \
|
||||
GTK_VALUE_ARGS (*arg).n_args = va_arg (var_args, gint); \
|
||||
GTK_VALUE_ARGS (*arg).args = va_arg (var_args, GtkArg*); \
|
||||
break; \
|
||||
case GTK_TYPE_FOREIGN: \
|
||||
GTK_VALUE_FOREIGN (*arg).data = va_arg (var_args, gpointer); \
|
||||
GTK_VALUE_FOREIGN (*arg).notify = va_arg (var_args, GtkDestroyNotify); \
|
||||
break; \
|
||||
case GTK_TYPE_CALLBACK: \
|
||||
GTK_VALUE_CALLBACK (*arg).marshal = va_arg (var_args, GtkCallbackMarshal); \
|
||||
GTK_VALUE_CALLBACK (*arg).data = va_arg (var_args, gpointer); \
|
||||
GTK_VALUE_CALLBACK (*arg).notify = va_arg (var_args, GtkDestroyNotify); \
|
||||
break; \
|
||||
case GTK_TYPE_C_CALLBACK: \
|
||||
GTK_VALUE_C_CALLBACK (*arg).func = va_arg (var_args, GtkFunction); \
|
||||
GTK_VALUE_C_CALLBACK (*arg).func_data = va_arg (var_args, gpointer); \
|
||||
break; \
|
||||
\
|
||||
/* we do some extra sanity checking when collecting objects, \
|
||||
* i.e. if the object pointer is not NULL, we check whether we \
|
||||
* actually got an object pointer within the desired class branch. \
|
||||
*/ \
|
||||
case GTK_TYPE_OBJECT: \
|
||||
case G_TYPE_OBJECT: \
|
||||
GTK_VALUE_OBJECT (*arg) = va_arg (var_args, GtkObject*); \
|
||||
if (GTK_VALUE_OBJECT (*arg) != NULL) \
|
||||
{ \
|
||||
register GtkObject *object = GTK_VALUE_OBJECT (*arg); \
|
||||
\
|
||||
if (object->klass == NULL) \
|
||||
if (((GTypeInstance*) object)->g_class == NULL) \
|
||||
error_msg = g_strconcat ("invalid unclassed object pointer for argument type `", \
|
||||
gtk_type_name (arg->type), \
|
||||
"'", \
|
||||
NULL); \
|
||||
else if (!gtk_type_is_a (GTK_OBJECT_TYPE (object), arg->type)) \
|
||||
error_msg = g_strconcat ("invalid object `", \
|
||||
gtk_type_name (GTK_OBJECT_TYPE (object)), \
|
||||
gtk_type_name (G_OBJECT_TYPE (object)), \
|
||||
"' for argument type `", \
|
||||
gtk_type_name (arg->type), \
|
||||
"'", \
|
||||
|
@ -458,10 +458,10 @@ gtk_binding_set_by_class (gpointer object_class)
|
||||
if (binding_set)
|
||||
return binding_set;
|
||||
|
||||
binding_set = gtk_binding_set_new (gtk_type_name (class->type));
|
||||
binding_set = gtk_binding_set_new (gtk_type_name (GTK_CLASS_TYPE (class)));
|
||||
gtk_binding_set_add_path (binding_set,
|
||||
GTK_PATH_CLASS,
|
||||
gtk_type_name (class->type),
|
||||
gtk_type_name (GTK_CLASS_TYPE (class)),
|
||||
GTK_PATH_PRIO_GTK);
|
||||
g_dataset_id_set_data (class, key_id_class_binding_set, binding_set);
|
||||
|
||||
|
@ -108,20 +108,20 @@ gtk_button_get_type (void)
|
||||
|
||||
if (!button_type)
|
||||
{
|
||||
static const GtkTypeInfo button_info =
|
||||
static const GTypeInfo button_info =
|
||||
{
|
||||
"GtkButton",
|
||||
sizeof (GtkButton),
|
||||
sizeof (GtkButtonClass),
|
||||
(GtkClassInitFunc) gtk_button_class_init,
|
||||
(GtkObjectInitFunc) gtk_button_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_button_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkButton),
|
||||
16, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_button_init,
|
||||
};
|
||||
|
||||
button_type = gtk_type_unique (GTK_TYPE_BIN, &button_info);
|
||||
gtk_type_set_chunk_alloc (button_type, 16);
|
||||
button_type = g_type_register_static (GTK_TYPE_BIN, "GtkButton", &button_info);
|
||||
}
|
||||
|
||||
return button_type;
|
||||
@ -146,35 +146,35 @@ gtk_button_class_init (GtkButtonClass *klass)
|
||||
button_signals[PRESSED] =
|
||||
gtk_signal_new ("pressed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkButtonClass, pressed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
button_signals[RELEASED] =
|
||||
gtk_signal_new ("released",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkButtonClass, released),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
button_signals[CLICKED] =
|
||||
gtk_signal_new ("clicked",
|
||||
GTK_RUN_FIRST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkButtonClass, clicked),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
button_signals[ENTER] =
|
||||
gtk_signal_new ("enter",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkButtonClass, enter),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
button_signals[LEAVE] =
|
||||
gtk_signal_new ("leave",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkButtonClass, leave),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
@ -324,18 +324,20 @@ gtk_calendar_get_type (void)
|
||||
|
||||
if (!calendar_type)
|
||||
{
|
||||
static const GtkTypeInfo calendar_info =
|
||||
static const GTypeInfo calendar_info =
|
||||
{
|
||||
"GtkCalendar",
|
||||
sizeof (GtkCalendar),
|
||||
sizeof (GtkCalendarClass),
|
||||
(GtkClassInitFunc) gtk_calendar_class_init,
|
||||
(GtkObjectInitFunc) gtk_calendar_init,
|
||||
(GtkArgSetFunc) NULL,
|
||||
(GtkArgGetFunc) NULL,
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_calendar_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkCalendar),
|
||||
16, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_calendar_init,
|
||||
};
|
||||
|
||||
calendar_type = gtk_type_unique (GTK_TYPE_WIDGET, &calendar_info);
|
||||
|
||||
calendar_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCalendar", &calendar_info);
|
||||
}
|
||||
|
||||
return calendar_type;
|
||||
@ -371,37 +373,37 @@ gtk_calendar_class_init (GtkCalendarClass *class)
|
||||
|
||||
gtk_calendar_signals[MONTH_CHANGED_SIGNAL] =
|
||||
gtk_signal_new ("month_changed",
|
||||
GTK_RUN_FIRST, object_class->type,
|
||||
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCalendarClass, month_changed),
|
||||
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
|
||||
gtk_calendar_signals[DAY_SELECTED_SIGNAL] =
|
||||
gtk_signal_new ("day_selected",
|
||||
GTK_RUN_FIRST, object_class->type,
|
||||
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCalendarClass, day_selected),
|
||||
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
|
||||
gtk_calendar_signals[DAY_SELECTED_DOUBLE_CLICK_SIGNAL] =
|
||||
gtk_signal_new ("day_selected_double_click",
|
||||
GTK_RUN_FIRST, object_class->type,
|
||||
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCalendarClass, day_selected_double_click),
|
||||
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
|
||||
gtk_calendar_signals[PREV_MONTH_SIGNAL] =
|
||||
gtk_signal_new ("prev_month",
|
||||
GTK_RUN_FIRST, object_class->type,
|
||||
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCalendarClass, prev_month),
|
||||
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
|
||||
gtk_calendar_signals[NEXT_MONTH_SIGNAL] =
|
||||
gtk_signal_new ("next_month",
|
||||
GTK_RUN_FIRST, object_class->type,
|
||||
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCalendarClass, next_month),
|
||||
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
|
||||
gtk_calendar_signals[PREV_YEAR_SIGNAL] =
|
||||
gtk_signal_new ("prev_year",
|
||||
GTK_RUN_FIRST, object_class->type,
|
||||
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCalendarClass, prev_year),
|
||||
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
|
||||
gtk_calendar_signals[NEXT_YEAR_SIGNAL] =
|
||||
gtk_signal_new ("next_year",
|
||||
GTK_RUN_FIRST, object_class->type,
|
||||
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCalendarClass, next_year),
|
||||
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
|
||||
|
||||
|
@ -31,8 +31,6 @@
|
||||
#define INDICATOR_SIZE 10
|
||||
#define INDICATOR_SPACING 2
|
||||
|
||||
#define CHECK_BUTTON_CLASS(w) GTK_CHECK_BUTTON_CLASS (GTK_OBJECT (w)->klass)
|
||||
|
||||
|
||||
static void gtk_check_button_class_init (GtkCheckButtonClass *klass);
|
||||
static void gtk_check_button_init (GtkCheckButton *check_button);
|
||||
@ -229,11 +227,11 @@ gtk_check_button_size_request (GtkWidget *widget,
|
||||
|
||||
if (toggle_button->draw_indicator)
|
||||
{
|
||||
requisition->width += (CHECK_BUTTON_CLASS (widget)->indicator_size +
|
||||
CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 2);
|
||||
requisition->width += (GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size +
|
||||
GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_spacing * 3 + 2);
|
||||
|
||||
temp = (CHECK_BUTTON_CLASS (widget)->indicator_size +
|
||||
CHECK_BUTTON_CLASS (widget)->indicator_spacing * 2);
|
||||
temp = (GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size +
|
||||
GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_spacing * 2);
|
||||
requisition->height = MAX (requisition->height, temp) + 2;
|
||||
}
|
||||
}
|
||||
@ -267,15 +265,15 @@ gtk_check_button_size_allocate (GtkWidget *widget,
|
||||
if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
|
||||
{
|
||||
child_allocation.x = (GTK_CONTAINER (widget)->border_width +
|
||||
CHECK_BUTTON_CLASS (widget)->indicator_size +
|
||||
CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1 +
|
||||
GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size +
|
||||
GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_spacing * 3 + 1 +
|
||||
widget->allocation.x);
|
||||
child_allocation.y = GTK_CONTAINER (widget)->border_width + 1 +
|
||||
widget->allocation.y;
|
||||
child_allocation.width = MAX (1, allocation->width -
|
||||
(GTK_CONTAINER (widget)->border_width +
|
||||
CHECK_BUTTON_CLASS (widget)->indicator_size +
|
||||
CHECK_BUTTON_CLASS (widget)->indicator_spacing * 3 + 1) -
|
||||
GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size +
|
||||
GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_spacing * 3 + 1) -
|
||||
GTK_CONTAINER (widget)->border_width - 1);
|
||||
child_allocation.height = MAX (1, allocation->height - (GTK_CONTAINER (widget)->border_width + 1) * 2);
|
||||
|
||||
@ -337,7 +335,7 @@ gtk_check_button_draw_indicator (GtkCheckButton *check_button,
|
||||
g_return_if_fail (check_button != NULL);
|
||||
g_return_if_fail (GTK_IS_CHECK_BUTTON (check_button));
|
||||
|
||||
class = CHECK_BUTTON_CLASS (check_button);
|
||||
class = GTK_CHECK_BUTTON_GET_CLASS (check_button);
|
||||
|
||||
if (class->draw_indicator)
|
||||
(* class->draw_indicator) (check_button, area);
|
||||
@ -387,10 +385,10 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
|
||||
new_area.width, new_area.height);
|
||||
}
|
||||
|
||||
x = widget->allocation.x + CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
|
||||
y = widget->allocation.y + (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
|
||||
width = CHECK_BUTTON_CLASS (widget)->indicator_size;
|
||||
height = CHECK_BUTTON_CLASS (widget)->indicator_size;
|
||||
x = widget->allocation.x + GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
|
||||
y = widget->allocation.y + (widget->allocation.height - GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size) / 2;
|
||||
width = GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size;
|
||||
height = GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size;
|
||||
|
||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||
{
|
||||
|
@ -29,8 +29,6 @@
|
||||
#include "gtksignal.h"
|
||||
|
||||
|
||||
#define CHECK_MENU_ITEM_CLASS(w) GTK_CHECK_MENU_ITEM_CLASS (GTK_OBJECT (w)->klass)
|
||||
|
||||
|
||||
enum {
|
||||
TOGGLED,
|
||||
@ -106,7 +104,7 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
||||
check_menu_item_signals[TOGGLED] =
|
||||
gtk_signal_new ("toggled",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkCheckMenuItemClass, toggled),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -223,10 +221,10 @@ gtk_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
|
||||
{
|
||||
g_return_if_fail (check_menu_item != NULL);
|
||||
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
|
||||
g_return_if_fail (CHECK_MENU_ITEM_CLASS (check_menu_item) != NULL);
|
||||
g_return_if_fail (GTK_CHECK_MENU_ITEM_GET_CLASS (check_menu_item) != NULL);
|
||||
|
||||
if (CHECK_MENU_ITEM_CLASS (check_menu_item)->draw_indicator)
|
||||
(* CHECK_MENU_ITEM_CLASS (check_menu_item)->draw_indicator) (check_menu_item, area);
|
||||
if (GTK_CHECK_MENU_ITEM_GET_CLASS (check_menu_item)->draw_indicator)
|
||||
(* GTK_CHECK_MENU_ITEM_GET_CLASS (check_menu_item)->draw_indicator) (check_menu_item, area);
|
||||
}
|
||||
|
||||
static void
|
||||
|
2076
gtk/gtkclist.c
2076
gtk/gtkclist.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -34,6 +34,7 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#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))
|
||||
@ -43,8 +44,8 @@ extern "C" {
|
||||
|
||||
|
||||
/* Number of elements in the custom palatte */
|
||||
#define CUSTOM_PALETTE_WIDTH 10
|
||||
#define CUSTOM_PALETTE_HEIGHT 2
|
||||
#define GTK_CUSTOM_PALETTE_WIDTH 10
|
||||
#define GTK_CUSTOM_PALETTE_HEIGHT 2
|
||||
|
||||
typedef struct _GtkColorSelection GtkColorSelection;
|
||||
typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
|
||||
@ -52,7 +53,7 @@ typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
|
||||
|
||||
struct _GtkColorSelection
|
||||
{
|
||||
GtkVBox parent;
|
||||
GtkVBox parent_instance;
|
||||
|
||||
/* < private > */
|
||||
gpointer private;
|
||||
@ -68,16 +69,16 @@ struct _GtkColorSelectionClass
|
||||
|
||||
/* ColorSelection */
|
||||
|
||||
GtkType gtk_color_selection_get_type (void);
|
||||
GtkWidget *gtk_color_selection_new (void);
|
||||
void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel,
|
||||
GtkUpdateType policy);
|
||||
gboolean gtk_color_selection_get_use_opacity (GtkColorSelection *colorsel);
|
||||
void gtk_color_selection_set_use_opacity (GtkColorSelection *colorsel,
|
||||
gboolean use_opacity);
|
||||
gboolean gtk_color_selection_get_use_palette (GtkColorSelection *colorsel);
|
||||
void gtk_color_selection_set_use_palette (GtkColorSelection *colorsel,
|
||||
gboolean use_palette);
|
||||
GtkType gtk_color_selection_get_type (void);
|
||||
GtkWidget * gtk_color_selection_new (void);
|
||||
void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel,
|
||||
GtkUpdateType policy);
|
||||
gboolean gtk_color_selection_get_use_opacity (GtkColorSelection *colorsel);
|
||||
void gtk_color_selection_set_use_opacity (GtkColorSelection *colorsel,
|
||||
gboolean use_opacity);
|
||||
gboolean gtk_color_selection_get_use_palette (GtkColorSelection *colorsel);
|
||||
void gtk_color_selection_set_use_palette (GtkColorSelection *colorsel,
|
||||
gboolean use_palette);
|
||||
|
||||
/* The Color set is an array of doubles, of the following format:
|
||||
* color[0] = red_channel;
|
||||
@ -85,26 +86,26 @@ void gtk_color_selection_set_use_palette (GtkColorSelection *colorsel,
|
||||
* color[2] = blue_channel;
|
||||
* color[3] = alpha_channel;
|
||||
*/
|
||||
void gtk_color_selection_set_color (GtkColorSelection *colorsel,
|
||||
void gtk_color_selection_set_color (GtkColorSelection *colorsel,
|
||||
gdouble *color);
|
||||
void gtk_color_selection_get_color (GtkColorSelection *colorsel,
|
||||
void gtk_color_selection_get_color (GtkColorSelection *colorsel,
|
||||
gdouble *color);
|
||||
void gtk_color_selection_set_old_color (GtkColorSelection *colorsel,
|
||||
void gtk_color_selection_set_old_color (GtkColorSelection *colorsel,
|
||||
gdouble *color);
|
||||
void gtk_color_selection_get_old_color (GtkColorSelection *colorsel,
|
||||
void gtk_color_selection_get_old_color (GtkColorSelection *colorsel,
|
||||
gdouble *color);
|
||||
void gtk_color_selection_set_palette_color (GtkColorSelection *colorsel,
|
||||
gint x,
|
||||
gint y,
|
||||
gdouble *color);
|
||||
gboolean gtk_color_selection_get_palette_color (GtkColorSelection *colorsel,
|
||||
void gtk_color_selection_set_palette_color (GtkColorSelection *colorsel,
|
||||
gint x,
|
||||
gint y,
|
||||
gdouble *color);
|
||||
void gtk_color_selection_unset_palette_color(GtkColorSelection *colorsel,
|
||||
gboolean gtk_color_selection_get_palette_color (GtkColorSelection *colorsel,
|
||||
gint x,
|
||||
gint y,
|
||||
gdouble *color);
|
||||
void gtk_color_selection_unset_palette_color (GtkColorSelection *colorsel,
|
||||
gint x,
|
||||
gint y);
|
||||
gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel);
|
||||
gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -44,7 +44,7 @@ GtkType
|
||||
gtk_color_selection_dialog_get_type (void)
|
||||
{
|
||||
static GtkType color_selection_dialog_type = 0;
|
||||
|
||||
|
||||
if (!color_selection_dialog_type)
|
||||
{
|
||||
GtkTypeInfo colorsel_diag_info =
|
||||
@ -58,10 +58,10 @@ gtk_color_selection_dialog_get_type (void)
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
|
||||
|
||||
color_selection_dialog_type = gtk_type_unique (GTK_TYPE_DIALOG, &colorsel_diag_info);
|
||||
}
|
||||
|
||||
|
||||
return color_selection_dialog_type;
|
||||
}
|
||||
|
||||
@ -69,9 +69,9 @@ static void
|
||||
gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
|
||||
|
||||
object_class = (GtkObjectClass*) klass;
|
||||
|
||||
|
||||
color_selection_dialog_parent_class = gtk_type_class (GTK_TYPE_DIALOG);
|
||||
}
|
||||
|
||||
@ -79,47 +79,47 @@ static void
|
||||
gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
|
||||
{
|
||||
GtkWidget *action_area_button_box, *frame;
|
||||
|
||||
|
||||
gtk_widget_set_visual (GTK_WIDGET (colorseldiag), gdk_rgb_get_visual ());
|
||||
gtk_widget_set_colormap (GTK_WIDGET (colorseldiag), gdk_rgb_get_cmap ());
|
||||
|
||||
|
||||
gtk_widget_push_visual (gdk_rgb_get_visual ());
|
||||
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
|
||||
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (colorseldiag)->vbox), frame);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
|
||||
colorseldiag->colorsel = gtk_color_selection_new ();
|
||||
gtk_color_selection_set_use_palette (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
|
||||
gtk_color_selection_set_use_opacity (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (frame), colorseldiag->colorsel);
|
||||
gtk_widget_show (colorseldiag->colorsel);
|
||||
|
||||
|
||||
action_area_button_box = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX(action_area_button_box), GTK_BUTTONBOX_END);
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX(action_area_button_box), 5);
|
||||
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (colorseldiag)->action_area), action_area_button_box, TRUE, TRUE, 0);
|
||||
gtk_widget_show (action_area_button_box);
|
||||
|
||||
|
||||
colorseldiag->ok_button = gtk_button_new_with_label (_("OK"));
|
||||
GTK_WIDGET_SET_FLAGS (colorseldiag->ok_button, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->ok_button, TRUE, TRUE, 0);
|
||||
gtk_widget_grab_default (colorseldiag->ok_button);
|
||||
gtk_widget_show (colorseldiag->ok_button);
|
||||
|
||||
|
||||
colorseldiag->cancel_button = gtk_button_new_with_label (_("Cancel"));
|
||||
GTK_WIDGET_SET_FLAGS (colorseldiag->cancel_button, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->cancel_button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (colorseldiag->cancel_button);
|
||||
|
||||
|
||||
colorseldiag->help_button = gtk_button_new_with_label (_("Help"));
|
||||
GTK_WIDGET_SET_FLAGS (colorseldiag->help_button, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->help_button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (colorseldiag->help_button);
|
||||
|
||||
|
||||
gtk_widget_pop_colormap ();
|
||||
gtk_widget_pop_visual ();
|
||||
}
|
||||
@ -128,11 +128,10 @@ GtkWidget*
|
||||
gtk_color_selection_dialog_new (const gchar *title)
|
||||
{
|
||||
GtkColorSelectionDialog *colorseldiag;
|
||||
|
||||
|
||||
colorseldiag = gtk_type_new (GTK_TYPE_COLOR_SELECTION_DIALOG);
|
||||
gtk_window_set_title (GTK_WINDOW (colorseldiag), title);
|
||||
gtk_window_set_policy(GTK_WINDOW (colorseldiag), FALSE, FALSE, TRUE);
|
||||
|
||||
|
||||
return GTK_WIDGET (colorseldiag);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <gtk/gtkdialog.h>
|
||||
#include <gtk/gtkcolorsel.h>
|
||||
#include <gtk/gtkvbox.h>
|
||||
#include "gtkintl.h"
|
||||
#include <gtk/gtkintl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -49,7 +49,7 @@ typedef struct _GtkColorSelectionDialogClass GtkColorSelectionDialogClass;
|
||||
|
||||
struct _GtkColorSelectionDialog
|
||||
{
|
||||
GtkDialog dialog;
|
||||
GtkDialog parent_instance;
|
||||
|
||||
GtkWidget *colorsel;
|
||||
GtkWidget *ok_button;
|
||||
@ -64,8 +64,8 @@ struct _GtkColorSelectionDialogClass
|
||||
|
||||
|
||||
/* ColorSelectionDialog */
|
||||
GtkType gtk_color_selection_dialog_get_type (void);
|
||||
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
|
||||
GtkType gtk_color_selection_dialog_get_type (void);
|
||||
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -110,13 +110,18 @@ gtk_combo_class_init (GtkComboClass * klass)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_combo_destroy (GtkObject * combo)
|
||||
gtk_combo_destroy (GtkObject *object)
|
||||
{
|
||||
gtk_widget_destroy (GTK_COMBO (combo)->popwin);
|
||||
gtk_widget_unref (GTK_COMBO (combo)->popwin);
|
||||
GtkCombo *combo = GTK_COMBO (object);
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
(*GTK_OBJECT_CLASS (parent_class)->destroy) (combo);
|
||||
if (combo->popwin)
|
||||
{
|
||||
gtk_widget_destroy (combo->popwin);
|
||||
gtk_widget_unref (combo->popwin);
|
||||
combo->popwin = NULL;
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -340,9 +345,8 @@ gtk_combo_get_pos (GtkCombo * combo, gint * x, gint * y, gint * height, gint * w
|
||||
if (!show_hscroll &&
|
||||
alloc_width < list_requisition.width)
|
||||
{
|
||||
work_height += popup->hscrollbar->requisition.height +
|
||||
GTK_SCROLLED_WINDOW_CLASS
|
||||
(GTK_OBJECT (combo->popup)->klass)->scrollbar_spacing;
|
||||
work_height += (popup->hscrollbar->requisition.height +
|
||||
GTK_SCROLLED_WINDOW_GET_CLASS (combo->popup)->scrollbar_spacing);
|
||||
show_hscroll = TRUE;
|
||||
}
|
||||
if (!show_vscroll &&
|
||||
@ -354,10 +358,8 @@ gtk_combo_get_pos (GtkCombo * combo, gint * x, gint * y, gint * height, gint * w
|
||||
*y -= (work_height + list_requisition.height + real_height);
|
||||
break;
|
||||
}
|
||||
alloc_width -=
|
||||
popup->vscrollbar->requisition.width +
|
||||
GTK_SCROLLED_WINDOW_CLASS
|
||||
(GTK_OBJECT (combo->popup)->klass)->scrollbar_spacing;
|
||||
alloc_width -= (popup->vscrollbar->requisition.width +
|
||||
GTK_SCROLLED_WINDOW_GET_CLASS (combo->popup)->scrollbar_spacing);
|
||||
show_vscroll = TRUE;
|
||||
}
|
||||
} while (old_width != alloc_width || old_height != work_height);
|
||||
@ -834,7 +836,10 @@ gtk_combo_item_destroy (GtkObject * object)
|
||||
|
||||
key = gtk_object_get_data (object, gtk_combo_string_key);
|
||||
if (key)
|
||||
g_free (key);
|
||||
{
|
||||
gtk_object_remove_data (object, gtk_combo_string_key);
|
||||
g_free (key);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -173,7 +173,7 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
container_signals[ADD] =
|
||||
gtk_signal_new ("add",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkContainerClass, add),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -181,7 +181,7 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
container_signals[REMOVE] =
|
||||
gtk_signal_new ("remove",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkContainerClass, remove),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -189,14 +189,14 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
container_signals[CHECK_RESIZE] =
|
||||
gtk_signal_new ("check_resize",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkContainerClass, check_resize),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
container_signals[FOCUS] =
|
||||
gtk_signal_new ("focus",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkContainerClass, focus),
|
||||
gtk_marshal_ENUM__ENUM,
|
||||
GTK_TYPE_DIRECTION_TYPE, 1,
|
||||
@ -204,7 +204,7 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
container_signals[SET_FOCUS_CHILD] =
|
||||
gtk_signal_new ("set-focus-child",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkContainerClass, set_focus_child),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -237,7 +237,7 @@ gtk_container_child_type (GtkContainer *container)
|
||||
g_return_val_if_fail (container != NULL, 0);
|
||||
g_return_val_if_fail (GTK_IS_CONTAINER (container), 0);
|
||||
|
||||
class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass);
|
||||
class = GTK_CONTAINER_GET_CLASS (container);
|
||||
if (class->child_type)
|
||||
slot = class->child_type (container);
|
||||
else
|
||||
@ -1104,7 +1104,7 @@ gtk_container_forall (GtkContainer *container,
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass);
|
||||
class = GTK_CONTAINER_GET_CLASS (container);
|
||||
|
||||
if (class->forall)
|
||||
class->forall (container, TRUE, callback, callback_data);
|
||||
@ -1121,7 +1121,7 @@ gtk_container_foreach (GtkContainer *container,
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass);
|
||||
class = GTK_CONTAINER_GET_CLASS (container);
|
||||
|
||||
if (class->forall)
|
||||
class->forall (container, FALSE, callback, callback_data);
|
||||
@ -1144,8 +1144,8 @@ gtk_container_foreach_unmarshal (GtkWidget *child,
|
||||
|
||||
/* first argument */
|
||||
args[0].name = NULL;
|
||||
args[0].type = GTK_OBJECT(child)->klass->type;
|
||||
GTK_VALUE_OBJECT(args[0]) = GTK_OBJECT (child);
|
||||
args[0].type = GTK_OBJECT_TYPE (child);
|
||||
GTK_VALUE_OBJECT (args[0]) = GTK_OBJECT (child);
|
||||
|
||||
/* location for return value */
|
||||
args[1].name = NULL;
|
||||
@ -1227,42 +1227,6 @@ gtk_container_children (GtkContainer *container)
|
||||
return g_list_reverse (children);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_register_toplevel (GtkContainer *container)
|
||||
{
|
||||
g_return_if_fail (container != NULL);
|
||||
|
||||
toplevel_list = g_list_prepend (toplevel_list, container);
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (container));
|
||||
gtk_object_sink (GTK_OBJECT (container));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_container_unregister_toplevel (GtkContainer *container)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
g_return_if_fail (container != NULL);
|
||||
|
||||
node = g_list_find (toplevel_list, container);
|
||||
g_return_if_fail (node != NULL);
|
||||
|
||||
toplevel_list = g_list_remove_link (toplevel_list, node);
|
||||
g_list_free_1 (node);
|
||||
|
||||
gtk_widget_unref (GTK_WIDGET (container));
|
||||
}
|
||||
|
||||
GList*
|
||||
gtk_container_get_toplevels (void)
|
||||
{
|
||||
/* XXX: fixme we should ref all these widgets and duplicate
|
||||
* the list.
|
||||
*/
|
||||
return toplevel_list;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_container_child_position_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
@ -1327,7 +1291,7 @@ gtk_container_child_composite_name (GtkContainer *container,
|
||||
{
|
||||
GtkContainerClass *class;
|
||||
|
||||
class = GTK_CONTAINER_CLASS (GTK_OBJECT (container)->klass);
|
||||
class = GTK_CONTAINER_GET_CLASS (container);
|
||||
if (class->composite_name)
|
||||
name = class->composite_name (container, child);
|
||||
}
|
||||
|
@ -141,9 +141,6 @@ void gtk_container_set_focus_vadjustment (GtkContainer *container,
|
||||
GtkAdjustment *adjustment);
|
||||
void gtk_container_set_focus_hadjustment (GtkContainer *container,
|
||||
GtkAdjustment *adjustment);
|
||||
void gtk_container_register_toplevel (GtkContainer *container);
|
||||
void gtk_container_unregister_toplevel (GtkContainer *container);
|
||||
GList* gtk_container_get_toplevels (void);
|
||||
|
||||
void gtk_container_resize_children (GtkContainer *container);
|
||||
|
||||
|
1479
gtk/gtkctree.c
1479
gtk/gtkctree.c
File diff suppressed because it is too large
Load Diff
@ -68,7 +68,7 @@ static void gtk_curve_set_arg (GtkObject *object,
|
||||
static void gtk_curve_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_curve_finalize (GtkObject *object);
|
||||
static void gtk_curve_finalize (GObject *object);
|
||||
static gint gtk_curve_graph_events (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
GtkCurve *c);
|
||||
@ -101,18 +101,18 @@ gtk_curve_get_type (void)
|
||||
static void
|
||||
gtk_curve_class_init (GtkCurveClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_DRAWING_AREA);
|
||||
|
||||
object_class = (GtkObjectClass *) class;
|
||||
|
||||
gobject_class->finalize = gtk_curve_finalize;
|
||||
|
||||
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_new ("curve_type_changed", GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
|
||||
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);
|
||||
@ -942,7 +942,7 @@ gtk_curve_new (void)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_curve_finalize (GtkObject *object)
|
||||
gtk_curve_finalize (GObject *object)
|
||||
{
|
||||
GtkCurve *curve;
|
||||
|
||||
@ -957,5 +957,5 @@ gtk_curve_finalize (GtkObject *object)
|
||||
if (curve->ctlpoint)
|
||||
g_free (curve->ctlpoint);
|
||||
|
||||
(*GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ gtk_data_class_init (GtkDataClass *class)
|
||||
data_signals[DISCONNECT] =
|
||||
gtk_signal_new ("disconnect",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkDataClass, disconnect),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
@ -148,7 +148,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[CHANGED] =
|
||||
gtk_signal_new ("changed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -156,7 +156,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[INSERT_TEXT] =
|
||||
gtk_signal_new ("insert_text",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, insert_text),
|
||||
gtk_marshal_NONE__POINTER_INT_POINTER,
|
||||
GTK_TYPE_NONE,
|
||||
@ -168,7 +168,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[DELETE_TEXT] =
|
||||
gtk_signal_new ("delete_text",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, delete_text),
|
||||
gtk_marshal_NONE__INT_INT,
|
||||
GTK_TYPE_NONE,
|
||||
@ -179,7 +179,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[ACTIVATE] =
|
||||
gtk_signal_new ("activate",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, activate),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -188,7 +188,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[SET_EDITABLE] =
|
||||
gtk_signal_new ("set-editable",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, set_editable),
|
||||
gtk_marshal_NONE__BOOL,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -197,7 +197,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[MOVE_CURSOR] =
|
||||
gtk_signal_new ("move_cursor",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, move_cursor),
|
||||
gtk_marshal_NONE__INT_INT,
|
||||
GTK_TYPE_NONE, 2,
|
||||
@ -207,7 +207,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[MOVE_WORD] =
|
||||
gtk_signal_new ("move_word",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, move_word),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -216,7 +216,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[MOVE_PAGE] =
|
||||
gtk_signal_new ("move_page",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, move_page),
|
||||
gtk_marshal_NONE__INT_INT,
|
||||
GTK_TYPE_NONE, 2,
|
||||
@ -226,7 +226,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[MOVE_TO_ROW] =
|
||||
gtk_signal_new ("move_to_row",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, move_to_row),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -235,7 +235,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[MOVE_TO_COLUMN] =
|
||||
gtk_signal_new ("move_to_column",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, move_to_column),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -244,7 +244,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[KILL_CHAR] =
|
||||
gtk_signal_new ("kill_char",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, kill_char),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -253,7 +253,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[KILL_WORD] =
|
||||
gtk_signal_new ("kill_word",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, kill_word),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -262,7 +262,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[KILL_LINE] =
|
||||
gtk_signal_new ("kill_line",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, kill_line),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -271,7 +271,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[CUT_CLIPBOARD] =
|
||||
gtk_signal_new ("cut_clipboard",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, cut_clipboard),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -279,7 +279,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[COPY_CLIPBOARD] =
|
||||
gtk_signal_new ("copy_clipboard",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, copy_clipboard),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -287,7 +287,7 @@ gtk_editable_class_init (GtkEditableClass *class)
|
||||
editable_signals[PASTE_CLIPBOARD] =
|
||||
gtk_signal_new ("paste_clipboard",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkEditableClass, paste_clipboard),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -422,7 +422,7 @@ gtk_editable_insert_text (GtkEditable *editable,
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (editable));
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
klass = GTK_EDITABLE_GET_CLASS (editable);
|
||||
|
||||
if (new_text_length <= 64)
|
||||
text = buf;
|
||||
@ -452,7 +452,7 @@ gtk_editable_delete_text (GtkEditable *editable,
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (editable));
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
klass = GTK_EDITABLE_GET_CLASS (editable);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (editable), editable_signals[DELETE_TEXT], start_pos, end_pos);
|
||||
gtk_signal_emit (GTK_OBJECT (editable), editable_signals[CHANGED]);
|
||||
@ -470,7 +470,7 @@ gtk_editable_update_text (GtkEditable *editable,
|
||||
g_return_if_fail (editable != NULL);
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
klass = GTK_EDITABLE_GET_CLASS (editable);
|
||||
|
||||
klass->update_text (editable, start_pos, end_pos);
|
||||
}
|
||||
@ -485,7 +485,7 @@ gtk_editable_get_chars (GtkEditable *editable,
|
||||
g_return_val_if_fail (editable != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_EDITABLE (editable), NULL);
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
klass = GTK_EDITABLE_GET_CLASS (editable);
|
||||
|
||||
return klass->get_chars (editable, start, end);
|
||||
}
|
||||
@ -529,7 +529,7 @@ gtk_editable_set_selection (GtkEditable *editable,
|
||||
g_return_if_fail (editable != NULL);
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
klass = GTK_EDITABLE_GET_CLASS (editable);
|
||||
|
||||
klass->set_selection (editable, start_pos, end_pos);
|
||||
}
|
||||
@ -543,7 +543,7 @@ gtk_editable_set_position (GtkEditable *editable,
|
||||
g_return_if_fail (editable != NULL);
|
||||
g_return_if_fail (GTK_IS_EDITABLE (editable));
|
||||
|
||||
klass = GTK_EDITABLE_CLASS (GTK_OBJECT (editable)->klass);
|
||||
klass = GTK_EDITABLE_GET_CLASS (editable);
|
||||
|
||||
klass->set_position (editable, position);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ static void gtk_entry_set_arg (GtkObject *object,
|
||||
static void gtk_entry_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_entry_finalize (GtkObject *object);
|
||||
static void gtk_entry_finalize (GObject *object);
|
||||
static void gtk_entry_realize (GtkWidget *widget);
|
||||
static void gtk_entry_unrealize (GtkWidget *widget);
|
||||
static void gtk_entry_draw_focus (GtkWidget *widget);
|
||||
@ -249,6 +249,7 @@ gtk_entry_get_type (void)
|
||||
static void
|
||||
gtk_entry_class_init (GtkEntryClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkEditableClass *editable_class;
|
||||
@ -258,12 +259,13 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
editable_class = (GtkEditableClass*) class;
|
||||
parent_class = gtk_type_class (GTK_TYPE_EDITABLE);
|
||||
|
||||
gobject_class->finalize = gtk_entry_finalize;
|
||||
|
||||
gtk_object_add_arg_type ("GtkEntry::max_length", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_MAX_LENGTH);
|
||||
gtk_object_add_arg_type ("GtkEntry::visibility", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_VISIBILITY);
|
||||
|
||||
object_class->set_arg = gtk_entry_set_arg;
|
||||
object_class->get_arg = gtk_entry_get_arg;
|
||||
object_class->finalize = gtk_entry_finalize;
|
||||
|
||||
widget_class->realize = gtk_entry_realize;
|
||||
widget_class->unrealize = gtk_entry_unrealize;
|
||||
@ -513,11 +515,10 @@ gtk_entry_get_text (GtkEntry *entry)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_finalize (GtkObject *object)
|
||||
gtk_entry_finalize (GObject *object)
|
||||
{
|
||||
GtkEntry *entry;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_ENTRY (object));
|
||||
|
||||
entry = GTK_ENTRY (object);
|
||||
@ -540,7 +541,7 @@ gtk_entry_finalize (GtkObject *object)
|
||||
if (entry->backing_pixmap)
|
||||
gdk_pixmap_unref (entry->backing_pixmap);
|
||||
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -673,10 +673,7 @@ gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel)
|
||||
g_return_if_fail (GTK_IS_FILE_SELECTION (filesel));
|
||||
|
||||
if (filesel->fileop_ren_file)
|
||||
{
|
||||
gtk_widget_destroy (filesel->fileop_ren_file);
|
||||
filesel->fileop_ren_file = NULL;
|
||||
}
|
||||
gtk_widget_destroy (filesel->fileop_ren_file);
|
||||
|
||||
if (filesel->fileop_del_file)
|
||||
{
|
||||
@ -770,14 +767,16 @@ gtk_file_selection_destroy (GtkObject *object)
|
||||
GtkFileSelection *filesel;
|
||||
GList *list;
|
||||
HistoryCallbackArg *callback_arg;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
|
||||
g_return_if_fail (GTK_IS_FILE_SELECTION (object));
|
||||
|
||||
|
||||
filesel = GTK_FILE_SELECTION (object);
|
||||
|
||||
if (filesel->fileop_dialog)
|
||||
gtk_widget_destroy (filesel->fileop_dialog);
|
||||
{
|
||||
gtk_widget_destroy (filesel->fileop_dialog);
|
||||
filesel->fileop_dialog = NULL;
|
||||
}
|
||||
|
||||
if (filesel->history_list)
|
||||
{
|
||||
@ -792,12 +791,14 @@ gtk_file_selection_destroy (GtkObject *object)
|
||||
g_list_free (filesel->history_list);
|
||||
filesel->history_list = NULL;
|
||||
}
|
||||
|
||||
cmpl_free_state (filesel->cmpl_state);
|
||||
filesel->cmpl_state = NULL;
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
||||
if (filesel->cmpl_state)
|
||||
{
|
||||
cmpl_free_state (filesel->cmpl_state);
|
||||
filesel->cmpl_state = NULL;
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
/* Begin file operations callbacks */
|
||||
@ -910,10 +911,11 @@ gtk_file_selection_create_dir (GtkWidget *widget, gpointer data)
|
||||
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
||||
|
||||
if (fs->fileop_dialog)
|
||||
return;
|
||||
return;
|
||||
|
||||
/* main dialog */
|
||||
fs->fileop_dialog = dialog = gtk_dialog_new ();
|
||||
dialog = gtk_dialog_new ();
|
||||
fs->fileop_dialog = dialog;
|
||||
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
||||
(GtkSignalFunc) gtk_file_selection_fileop_destroy,
|
||||
(gpointer) fs);
|
||||
@ -1818,6 +1820,8 @@ cmpl_free_dir_sent_list(GList* dp0)
|
||||
static void
|
||||
cmpl_free_state (CompletionState* cmpl_state)
|
||||
{
|
||||
g_return_if_fail (cmpl_state != NULL);
|
||||
|
||||
cmpl_free_dir_list (cmpl_state->directory_storage);
|
||||
cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage);
|
||||
|
||||
|
@ -44,7 +44,7 @@ static void gtk_frame_set_arg (GtkObject *object,
|
||||
static void gtk_frame_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_frame_finalize (GtkObject *object);
|
||||
static void gtk_frame_finalize (GObject *object);
|
||||
static void gtk_frame_paint (GtkWidget *widget,
|
||||
GdkRectangle *area);
|
||||
static void gtk_frame_draw (GtkWidget *widget,
|
||||
@ -90,6 +90,7 @@ gtk_frame_get_type (void)
|
||||
static void
|
||||
gtk_frame_class_init (GtkFrameClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
@ -98,6 +99,8 @@ gtk_frame_class_init (GtkFrameClass *class)
|
||||
|
||||
parent_class = gtk_type_class (gtk_bin_get_type ());
|
||||
|
||||
gobject_class->finalize = gtk_frame_finalize;
|
||||
|
||||
gtk_object_add_arg_type ("GtkFrame::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL);
|
||||
gtk_object_add_arg_type ("GtkFrame::label_xalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_LABEL_XALIGN);
|
||||
gtk_object_add_arg_type ("GtkFrame::label_yalign", GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_LABEL_YALIGN);
|
||||
@ -105,7 +108,6 @@ gtk_frame_class_init (GtkFrameClass *class)
|
||||
|
||||
object_class->set_arg = gtk_frame_set_arg;
|
||||
object_class->get_arg = gtk_frame_get_arg;
|
||||
object_class->finalize = gtk_frame_finalize;
|
||||
|
||||
widget_class->draw = gtk_frame_draw;
|
||||
widget_class->expose_event = gtk_frame_expose;
|
||||
@ -314,11 +316,10 @@ gtk_frame_set_shadow_type (GtkFrame *frame,
|
||||
|
||||
|
||||
static void
|
||||
gtk_frame_finalize (GtkObject *object)
|
||||
gtk_frame_finalize (GObject *object)
|
||||
{
|
||||
GtkFrame *frame;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_FRAME (object));
|
||||
|
||||
frame = GTK_FRAME (object);
|
||||
@ -326,7 +327,7 @@ gtk_frame_finalize (GtkObject *object)
|
||||
if (frame->label)
|
||||
g_free (frame->label);
|
||||
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -181,7 +181,7 @@ gtk_handle_box_class_init (GtkHandleBoxClass *class)
|
||||
handle_box_signals[SIGNAL_CHILD_ATTACHED] =
|
||||
gtk_signal_new ("child_attached",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkHandleBoxClass, child_attached),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -189,7 +189,7 @@ gtk_handle_box_class_init (GtkHandleBoxClass *class)
|
||||
handle_box_signals[SIGNAL_CHILD_DETACHED] =
|
||||
gtk_signal_new ("child_detached",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkHandleBoxClass, child_detached),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
|
@ -30,8 +30,8 @@
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
|
||||
|
||||
#define SCALE_CLASS(w) GTK_SCALE_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define RANGE_CLASS(w) GTK_RANGE_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define SCALE_CLASS(w) GTK_SCALE_GET_CLASS (w)
|
||||
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
@ -111,7 +111,7 @@ gtk_hscale_class_init (GtkHScaleClass *class)
|
||||
|
||||
gtk_object_add_arg_type ("GtkHScale::adjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_ADJUSTMENT);
|
||||
|
||||
object_class->set_arg = gtk_hscale_set_arg;
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#define EPSILON 0.01
|
||||
|
||||
#define RANGE_CLASS(w) GTK_RANGE_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
@ -97,7 +97,7 @@ gtk_hscrollbar_class_init (GtkHScrollbarClass *class)
|
||||
|
||||
gtk_object_add_arg_type ("GtkHScrollbar::adjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_ADJUSTMENT);
|
||||
|
||||
object_class->set_arg = gtk_hscrollbar_set_arg;
|
||||
|
2237
gtk/gtkhsv.c
2237
gtk/gtkhsv.c
File diff suppressed because it is too large
Load Diff
83
gtk/gtkhsv.h
83
gtk/gtkhsv.h
@ -21,63 +21,86 @@
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_HSV_H__
|
||||
#define __GTK_HSV_H__
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
|
||||
|
||||
|
||||
#define GTK_TYPE_HSV (gtk_hsv_get_type ())
|
||||
#define GTK_HSV(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_HSV, GtkHSV))
|
||||
#define GTK_HSV_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_HSV, GtkHSV))
|
||||
#define GTK_IS_HSV(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_HSV))
|
||||
#define GTK_IS_HSV_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HSV))
|
||||
#define GTK_HSV_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_HSV, GtkHSVClass))
|
||||
|
||||
|
||||
typedef struct _GtkHSV GtkHSV;
|
||||
typedef struct _GtkHSV GtkHSV;
|
||||
typedef struct _GtkHSVClass GtkHSVClass;
|
||||
|
||||
struct _GtkHSV {
|
||||
GtkWidget widget;
|
||||
|
||||
/* Private data */
|
||||
gpointer priv;
|
||||
struct _GtkHSV
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
/* Private data */
|
||||
gpointer priv;
|
||||
};
|
||||
|
||||
struct _GtkHSVClass {
|
||||
GtkWidgetClass parent_class;
|
||||
|
||||
/* Notification signals */
|
||||
|
||||
void (* changed) (GtkHSV *hsv);
|
||||
struct _GtkHSVClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
|
||||
/* Notification signals */
|
||||
|
||||
void (*changed) (GtkHSV *hsv);
|
||||
};
|
||||
|
||||
|
||||
GtkType gtk_hsv_get_type (void);
|
||||
GtkType gtk_hsv_get_type (void);
|
||||
GtkWidget* gtk_hsv_new (void);
|
||||
void gtk_hsv_set_color (GtkHSV *hsv,
|
||||
double h,
|
||||
double s,
|
||||
double v);
|
||||
void gtk_hsv_get_color (GtkHSV *hsv,
|
||||
gdouble *h,
|
||||
gdouble *s,
|
||||
gdouble *v);
|
||||
void gtk_hsv_set_metrics (GtkHSV *hsv,
|
||||
gint size,
|
||||
gint ring_width);
|
||||
void gtk_hsv_get_metrics (GtkHSV *hsv,
|
||||
gint *size,
|
||||
gint *ring_width);
|
||||
gboolean gtk_hsv_is_adjusting (GtkHSV *hsv);
|
||||
void gtk_hsv_to_rgb (gdouble h,
|
||||
gdouble s,
|
||||
gdouble v,
|
||||
gdouble *r,
|
||||
gdouble *g,
|
||||
gdouble *b);
|
||||
void gtk_rgb_to_hsv (gdouble r,
|
||||
gdouble g,
|
||||
gdouble b,
|
||||
gdouble *h,
|
||||
gdouble *s,
|
||||
gdouble *v);
|
||||
|
||||
GtkWidget *gtk_hsv_new (void);
|
||||
|
||||
void gtk_hsv_set_color (GtkHSV *hsv, double h, double s, double v);
|
||||
void gtk_hsv_get_color (GtkHSV *hsv, double *h, double *s, double *v);
|
||||
|
||||
void gtk_hsv_set_metrics (GtkHSV *hsv, int size, int ring_width);
|
||||
void gtk_hsv_get_metrics (GtkHSV *hsv, int *size, int *ring_width);
|
||||
|
||||
gboolean gtk_hsv_is_adjusting (GtkHSV *hsv);
|
||||
|
||||
void gtk_hsv_to_rgb (double h, double s, double v, double *r, double *g, double *b);
|
||||
void gtk_rgb_to_hsv (double r, double g, double b, double *h, double *s, double *v);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* __GTK_HSV_H__ */
|
||||
|
@ -81,7 +81,6 @@ static void gtk_input_dialog_class_init (GtkInputDialogClass *klass);
|
||||
static void gtk_input_dialog_init (GtkInputDialog *inputd);
|
||||
static GdkDeviceInfo *gtk_input_dialog_get_device_info(guint32 deviceid);
|
||||
static void gtk_input_dialog_set_device(GtkWidget *widget, gpointer data);
|
||||
static void gtk_input_dialog_finalize (GtkObject *object);
|
||||
static void gtk_input_dialog_set_mapping_mode(GtkWidget *w,
|
||||
gpointer data);
|
||||
static void gtk_input_dialog_set_axis(GtkWidget *widget, gpointer data);
|
||||
@ -155,7 +154,7 @@ gtk_input_dialog_class_init (GtkInputDialogClass *klass)
|
||||
input_dialog_signals[ENABLE_DEVICE] =
|
||||
gtk_signal_new ("enable_device",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkInputDialogClass, enable_device),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_INT);
|
||||
@ -163,7 +162,7 @@ gtk_input_dialog_class_init (GtkInputDialogClass *klass)
|
||||
input_dialog_signals[DISABLE_DEVICE] =
|
||||
gtk_signal_new ("disable_device",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkInputDialogClass, disable_device),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1, GTK_TYPE_INT);
|
||||
@ -172,7 +171,6 @@ gtk_input_dialog_class_init (GtkInputDialogClass *klass)
|
||||
LAST_SIGNAL);
|
||||
|
||||
|
||||
object_class->finalize = gtk_input_dialog_finalize;
|
||||
klass->enable_device = NULL;
|
||||
klass->disable_device = NULL;
|
||||
}
|
||||
@ -392,16 +390,6 @@ gtk_input_dialog_set_device(GtkWidget *widget, gpointer data)
|
||||
info->mode);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_input_dialog_finalize (GtkObject *object)
|
||||
{
|
||||
/* GtkInputDialog *inputd = GTK_INPUT_DIALOG (object); */
|
||||
|
||||
/* Clean up ? */
|
||||
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_input_dialog_set_mapping_mode(GtkWidget *w,
|
||||
gpointer data)
|
||||
|
@ -87,21 +87,21 @@ gtk_item_class_init (GtkItemClass *class)
|
||||
item_signals[SELECT] =
|
||||
gtk_signal_new ("select",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkItemClass, select),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
item_signals[DESELECT] =
|
||||
gtk_signal_new ("deselect",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkItemClass, deselect),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
item_signals[TOGGLE] =
|
||||
gtk_signal_new ("toggle",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkItemClass, toggle),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
@ -85,12 +85,12 @@ struct _GtkIFDumpData
|
||||
static void gtk_item_factory_class_init (GtkItemFactoryClass *klass);
|
||||
static void gtk_item_factory_init (GtkItemFactory *ifactory);
|
||||
static void gtk_item_factory_destroy (GtkObject *object);
|
||||
static void gtk_item_factory_finalize (GtkObject *object);
|
||||
static void gtk_item_factory_finalize (GObject *object);
|
||||
|
||||
|
||||
/* --- static variables --- */
|
||||
static GtkItemFactoryClass *gtk_item_factory_class = NULL;
|
||||
static GtkObjectClass *parent_class = NULL;
|
||||
static gpointer parent_class = NULL;
|
||||
static const gchar *item_factory_string = "Gtk-<ItemFactory>";
|
||||
static GMemChunk *ifactory_item_chunks = NULL;
|
||||
static GMemChunk *ifactory_cb_data_chunks = NULL;
|
||||
@ -181,6 +181,7 @@ gtk_item_factory_get_type (void)
|
||||
static void
|
||||
gtk_item_factory_class_init (GtkItemFactoryClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
|
||||
gtk_item_factory_class = class;
|
||||
@ -189,8 +190,9 @@ gtk_item_factory_class_init (GtkItemFactoryClass *class)
|
||||
|
||||
object_class = (GtkObjectClass*) class;
|
||||
|
||||
gobject_class->finalize = gtk_item_factory_finalize;
|
||||
|
||||
object_class->destroy = gtk_item_factory_destroy;
|
||||
object_class->finalize = gtk_item_factory_finalize;
|
||||
|
||||
class->cpair_comment_single = g_strdup (";\n");
|
||||
|
||||
@ -511,7 +513,7 @@ gtk_item_factory_add_item (GtkItemFactory *ifactory,
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (item_type != NULL);
|
||||
|
||||
class = GTK_ITEM_FACTORY_CLASS (GTK_OBJECT (ifactory)->klass);
|
||||
class = GTK_ITEM_FACTORY_GET_CLASS (ifactory);
|
||||
|
||||
/* set accelerator group on menu widgets
|
||||
*/
|
||||
@ -681,11 +683,11 @@ gtk_item_factory_destroy (GtkObject *object)
|
||||
g_slist_free (ifactory->items);
|
||||
ifactory->items = NULL;
|
||||
|
||||
parent_class->destroy (object);
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_item_factory_finalize (GtkObject *object)
|
||||
gtk_item_factory_finalize (GObject *object)
|
||||
{
|
||||
GtkItemFactory *ifactory;
|
||||
|
||||
@ -701,7 +703,7 @@ gtk_item_factory_finalize (GtkObject *object)
|
||||
if (ifactory->translate_notify)
|
||||
ifactory->translate_notify (ifactory->translate_data);
|
||||
|
||||
parent_class->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
GtkItemFactory*
|
||||
@ -859,7 +861,7 @@ gtk_item_factory_get_widget (GtkItemFactory *ifactory,
|
||||
g_return_val_if_fail (GTK_IS_ITEM_FACTORY (ifactory), NULL);
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
||||
class = GTK_ITEM_FACTORY_CLASS (GTK_OBJECT (ifactory)->klass);
|
||||
class = GTK_ITEM_FACTORY_GET_CLASS (ifactory);
|
||||
|
||||
if (path[0] == '<')
|
||||
item = g_hash_table_lookup (class->item_ht, (gpointer) path);
|
||||
@ -1323,7 +1325,7 @@ gtk_item_factory_delete_item (GtkItemFactory *ifactory,
|
||||
g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory));
|
||||
g_return_if_fail (path != NULL);
|
||||
|
||||
class = GTK_ITEM_FACTORY_CLASS (GTK_OBJECT (ifactory)->klass);
|
||||
class = GTK_ITEM_FACTORY_GET_CLASS (ifactory);
|
||||
|
||||
fpath = g_strconcat (ifactory->path, path, NULL);
|
||||
item = g_hash_table_lookup (class->item_ht, fpath);
|
||||
|
@ -74,7 +74,7 @@ static void gtk_label_set_arg (GtkObject *object,
|
||||
static void gtk_label_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_label_finalize (GtkObject *object);
|
||||
static void gtk_label_finalize (GObject *object);
|
||||
static void gtk_label_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
static void gtk_label_style_set (GtkWidget *widget,
|
||||
@ -101,20 +101,20 @@ gtk_label_get_type (void)
|
||||
|
||||
if (!label_type)
|
||||
{
|
||||
static const GtkTypeInfo label_info =
|
||||
static const GTypeInfo label_info =
|
||||
{
|
||||
"GtkLabel",
|
||||
sizeof (GtkLabel),
|
||||
sizeof (GtkLabelClass),
|
||||
(GtkClassInitFunc) gtk_label_class_init,
|
||||
(GtkObjectInitFunc) gtk_label_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_label_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkLabel),
|
||||
32, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_label_init,
|
||||
};
|
||||
|
||||
label_type = gtk_type_unique (GTK_TYPE_MISC, &label_info);
|
||||
gtk_type_set_chunk_alloc (label_type, 32);
|
||||
|
||||
label_type = g_type_register_static (GTK_TYPE_MISC, "GtkLabel", &label_info);
|
||||
}
|
||||
|
||||
return label_type;
|
||||
@ -123,6 +123,7 @@ gtk_label_get_type (void)
|
||||
static void
|
||||
gtk_label_class_init (GtkLabelClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
@ -136,9 +137,10 @@ gtk_label_class_init (GtkLabelClass *class)
|
||||
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);
|
||||
|
||||
gobject_class->finalize = gtk_label_finalize;
|
||||
|
||||
object_class->set_arg = gtk_label_set_arg;
|
||||
object_class->get_arg = gtk_label_get_arg;
|
||||
object_class->finalize = gtk_label_finalize;
|
||||
|
||||
widget_class->size_request = gtk_label_size_request;
|
||||
widget_class->style_set = gtk_label_style_set;
|
||||
@ -347,11 +349,10 @@ gtk_label_get_text (GtkLabel *label)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_finalize (GtkObject *object)
|
||||
gtk_label_finalize (GObject *object)
|
||||
{
|
||||
GtkLabel *label;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_LABEL (object));
|
||||
|
||||
label = GTK_LABEL (object);
|
||||
@ -362,7 +363,7 @@ gtk_label_finalize (GtkObject *object)
|
||||
|
||||
gtk_label_free_words (label);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GtkLabelULine*
|
||||
|
@ -45,7 +45,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_finalize (GObject *object);
|
||||
static void gtk_layout_realize (GtkWidget *widget);
|
||||
static void gtk_layout_unrealize (GtkWidget *widget);
|
||||
static void gtk_layout_map (GtkWidget *widget);
|
||||
@ -170,14 +170,14 @@ gtk_layout_set_adjustments (GtkLayout *layout,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_layout_finalize (GtkObject *object)
|
||||
gtk_layout_finalize (GObject *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);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
void
|
||||
@ -320,18 +320,20 @@ gtk_layout_get_type (void)
|
||||
|
||||
if (!layout_type)
|
||||
{
|
||||
static const GtkTypeInfo layout_info =
|
||||
static const GTypeInfo layout_info =
|
||||
{
|
||||
"GtkLayout",
|
||||
sizeof (GtkLayout),
|
||||
sizeof (GtkLayoutClass),
|
||||
(GtkClassInitFunc) gtk_layout_class_init,
|
||||
(GtkObjectInitFunc) gtk_layout_init,
|
||||
(GtkArgSetFunc) NULL,
|
||||
(GtkArgGetFunc) NULL,
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_layout_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkLayout),
|
||||
16, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_layout_init,
|
||||
};
|
||||
|
||||
layout_type = gtk_type_unique (GTK_TYPE_CONTAINER, &layout_info);
|
||||
layout_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkLayout", &layout_info);
|
||||
}
|
||||
|
||||
return layout_type;
|
||||
@ -340,6 +342,7 @@ gtk_layout_get_type (void)
|
||||
static void
|
||||
gtk_layout_class_init (GtkLayoutClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkContainerClass *container_class;
|
||||
@ -350,7 +353,7 @@ gtk_layout_class_init (GtkLayoutClass *class)
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
|
||||
|
||||
object_class->finalize = gtk_layout_finalize;
|
||||
gobject_class->finalize = gtk_layout_finalize;
|
||||
|
||||
widget_class->realize = gtk_layout_realize;
|
||||
widget_class->unrealize = gtk_layout_unrealize;
|
||||
@ -368,7 +371,7 @@ gtk_layout_class_init (GtkLayoutClass *class)
|
||||
widget_class->set_scroll_adjustments_signal =
|
||||
gtk_signal_new ("set_scroll_adjustments",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkLayoutClass, set_scroll_adjustments),
|
||||
gtk_marshal_NONE__POINTER_POINTER,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
|
||||
|
@ -54,7 +54,7 @@ static void gtk_list_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
/** GtkObject Methods **/
|
||||
static void gtk_list_shutdown (GtkObject *object);
|
||||
static void gtk_list_shutdown (GObject *object);
|
||||
|
||||
/** GtkWidget Methods **/
|
||||
static void gtk_list_size_request (GtkWidget *widget,
|
||||
@ -200,6 +200,7 @@ gtk_list_get_type (void)
|
||||
static void
|
||||
gtk_list_class_init (GtkListClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkContainerClass *container_class;
|
||||
@ -213,17 +214,19 @@ gtk_list_class_init (GtkListClass *class)
|
||||
vadjustment_key_id = g_quark_from_static_string (vadjustment_key);
|
||||
hadjustment_key_id = g_quark_from_static_string (hadjustment_key);
|
||||
|
||||
gobject_class->shutdown = gtk_list_shutdown;
|
||||
|
||||
list_signals[SELECTION_CHANGED] =
|
||||
gtk_signal_new ("selection_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListClass, selection_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_signals[SELECT_CHILD] =
|
||||
gtk_signal_new ("select_child",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListClass, select_child),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -231,7 +234,7 @@ gtk_list_class_init (GtkListClass *class)
|
||||
list_signals[UNSELECT_CHILD] =
|
||||
gtk_signal_new ("unselect_child",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListClass, unselect_child),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -239,7 +242,6 @@ 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;
|
||||
|
||||
@ -341,10 +343,11 @@ gtk_list_new (void)
|
||||
* gtk_list_shutdown
|
||||
*/
|
||||
static void
|
||||
gtk_list_shutdown (GtkObject *object)
|
||||
gtk_list_shutdown (GObject *object)
|
||||
{
|
||||
gtk_list_clear_items (GTK_LIST (object), 0, -1);
|
||||
GTK_OBJECT_CLASS (parent_class)->shutdown (object);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->shutdown (object);
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,56 +118,56 @@ gtk_list_item_class_init (GtkListItemClass *class)
|
||||
list_item_signals[TOGGLE_FOCUS_ROW] =
|
||||
gtk_signal_new ("toggle_focus_row",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, toggle_focus_row),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_item_signals[SELECT_ALL] =
|
||||
gtk_signal_new ("select_all",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, select_all),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_item_signals[UNSELECT_ALL] =
|
||||
gtk_signal_new ("unselect_all",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, unselect_all),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_item_signals[UNDO_SELECTION] =
|
||||
gtk_signal_new ("undo_selection",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, undo_selection),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_item_signals[START_SELECTION] =
|
||||
gtk_signal_new ("start_selection",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, start_selection),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_item_signals[END_SELECTION] =
|
||||
gtk_signal_new ("end_selection",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, end_selection),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_item_signals[TOGGLE_ADD_MODE] =
|
||||
gtk_signal_new ("toggle_add_mode",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, toggle_add_mode),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
list_item_signals[EXTEND_SELECTION] =
|
||||
gtk_signal_new ("extend_selection",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, extend_selection),
|
||||
gtk_marshal_NONE__ENUM_FLOAT_BOOL,
|
||||
GTK_TYPE_NONE, 3,
|
||||
@ -175,14 +175,14 @@ gtk_list_item_class_init (GtkListItemClass *class)
|
||||
list_item_signals[SCROLL_VERTICAL] =
|
||||
gtk_signal_new ("scroll_vertical",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, scroll_vertical),
|
||||
gtk_marshal_NONE__ENUM_FLOAT,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ENUM, GTK_TYPE_FLOAT);
|
||||
list_item_signals[SCROLL_HORIZONTAL] =
|
||||
gtk_signal_new ("scroll_horizontal",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkListItemClass, scroll_horizontal),
|
||||
gtk_marshal_NONE__ENUM_FLOAT,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ENUM, GTK_TYPE_FLOAT);
|
||||
|
@ -197,7 +197,6 @@ gboolean
|
||||
gtk_init_check (int *argc,
|
||||
char ***argv)
|
||||
{
|
||||
extern void gtk_object_post_arg_parsing_init (void);
|
||||
GSList *gtk_modules = NULL;
|
||||
GSList *slist;
|
||||
gchar *env_string = NULL;
|
||||
@ -422,7 +421,6 @@ gtk_init_check (int *argc,
|
||||
gtk_colormap = gdk_colormap_get_system ();
|
||||
|
||||
gtk_type_init ();
|
||||
gtk_object_post_arg_parsing_init ();
|
||||
gtk_signal_init ();
|
||||
gtk_rc_init ();
|
||||
|
||||
|
@ -9,8 +9,6 @@ INT:POINTER
|
||||
INT:POINTER,CHAR,CHAR
|
||||
NONE:BOOL
|
||||
NONE:BOXED
|
||||
NONE:C_CALLBACK
|
||||
NONE:C_CALLBACK,C_CALLBACK
|
||||
NONE:ENUM
|
||||
NONE:ENUM,FLOAT
|
||||
NONE:ENUM,FLOAT,BOOL
|
||||
|
@ -9,8 +9,6 @@ INT:POINTER
|
||||
INT:POINTER,CHAR,CHAR
|
||||
NONE:BOOL
|
||||
NONE:BOXED
|
||||
NONE:C_CALLBACK
|
||||
NONE:C_CALLBACK,C_CALLBACK
|
||||
NONE:ENUM
|
||||
NONE:ENUM,FLOAT
|
||||
NONE:ENUM,FLOAT,BOOL
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "gtkwindow.h"
|
||||
|
||||
|
||||
#define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_GET_CLASS (w)
|
||||
#define MENU_NEEDS_RESIZE(m) GTK_MENU_SHELL (m)->menu_flag
|
||||
|
||||
typedef struct _GtkMenuAttachData GtkMenuAttachData;
|
||||
@ -192,20 +192,20 @@ gtk_menu_init (GtkMenu *menu)
|
||||
menu->position_func = NULL;
|
||||
menu->position_func_data = NULL;
|
||||
|
||||
menu->toplevel = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_signal_connect (GTK_OBJECT (menu->toplevel),
|
||||
"event",
|
||||
GTK_SIGNAL_FUNC (gtk_menu_window_event),
|
||||
GTK_OBJECT (menu));
|
||||
menu->toplevel = gtk_widget_new (GTK_TYPE_WINDOW,
|
||||
"type", GTK_WINDOW_POPUP,
|
||||
"signal::event", gtk_menu_window_event, menu,
|
||||
"signal::destroy", gtk_widget_destroyed, &menu->toplevel,
|
||||
"child", menu,
|
||||
NULL);
|
||||
gtk_window_set_policy (GTK_WINDOW (menu->toplevel),
|
||||
FALSE, FALSE, TRUE);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (menu->toplevel), GTK_WIDGET (menu));
|
||||
|
||||
/* Refloat the menu, so that reference counting for the menu isn't
|
||||
* affected by it being a child of the toplevel
|
||||
*/
|
||||
GTK_WIDGET_SET_FLAGS (menu, GTK_FLOATING);
|
||||
menu->needs_destruction_ref_count = TRUE;
|
||||
|
||||
menu->tearoff_window = NULL;
|
||||
menu->torn_off = FALSE;
|
||||
@ -214,18 +214,15 @@ gtk_menu_init (GtkMenu *menu)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_destroy (GtkObject *object)
|
||||
gtk_menu_destroy (GtkObject *object)
|
||||
{
|
||||
GtkMenu *menu;
|
||||
GtkMenuAttachData *data;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_MENU (object));
|
||||
|
||||
menu = GTK_MENU (object);
|
||||
|
||||
gtk_object_ref (object);
|
||||
|
||||
data = gtk_object_get_data (object, attach_data_key);
|
||||
if (data)
|
||||
gtk_menu_detach (menu);
|
||||
@ -239,16 +236,18 @@ gtk_menu_destroy (GtkObject *object)
|
||||
}
|
||||
|
||||
/* Add back the reference count for being a child */
|
||||
gtk_object_ref (object);
|
||||
if (menu->needs_destruction_ref_count)
|
||||
{
|
||||
menu->needs_destruction_ref_count = FALSE;
|
||||
gtk_object_ref (object);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (menu->toplevel);
|
||||
if (menu->toplevel)
|
||||
gtk_widget_destroy (menu->toplevel);
|
||||
if (menu->tearoff_window)
|
||||
gtk_widget_destroy (menu->tearoff_window);
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
||||
|
||||
gtk_object_unref (object);
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
|
||||
@ -293,7 +292,7 @@ gtk_menu_attach_to_widget (GtkMenu *menu,
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_menu_get_attach_widget (GtkMenu *menu)
|
||||
gtk_menu_get_attach_widget (GtkMenu *menu)
|
||||
{
|
||||
GtkMenuAttachData *data;
|
||||
|
||||
@ -307,7 +306,7 @@ gtk_menu_get_attach_widget (GtkMenu *menu)
|
||||
}
|
||||
|
||||
void
|
||||
gtk_menu_detach (GtkMenu *menu)
|
||||
gtk_menu_detach (GtkMenu *menu)
|
||||
{
|
||||
GtkMenuAttachData *data;
|
||||
|
||||
@ -708,7 +707,10 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
|
||||
GtkWidget *attach_widget;
|
||||
gchar *title;
|
||||
|
||||
menu->tearoff_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
menu->tearoff_window = gtk_widget_new (GTK_TYPE_WINDOW,
|
||||
"type", GTK_WINDOW_TOPLEVEL,
|
||||
"signal::destroy", gtk_widget_destroyed, &menu->tearoff_window,
|
||||
NULL);
|
||||
gtk_widget_set_app_paintable (menu->tearoff_window, TRUE);
|
||||
gtk_signal_connect (GTK_OBJECT (menu->tearoff_window),
|
||||
"event",
|
||||
|
@ -74,6 +74,7 @@ struct _GtkMenu
|
||||
GtkWidget *toplevel;
|
||||
GtkWidget *tearoff_window;
|
||||
|
||||
guint needs_destruction_ref_count : 1;
|
||||
guint torn_off : 1;
|
||||
};
|
||||
|
||||
|
@ -88,20 +88,20 @@ gtk_menu_item_get_type (void)
|
||||
|
||||
if (!menu_item_type)
|
||||
{
|
||||
static const GtkTypeInfo menu_item_info =
|
||||
static const GTypeInfo menu_item_info =
|
||||
{
|
||||
"GtkMenuItem",
|
||||
sizeof (GtkMenuItem),
|
||||
sizeof (GtkMenuItemClass),
|
||||
(GtkClassInitFunc) gtk_menu_item_class_init,
|
||||
(GtkObjectInitFunc) gtk_menu_item_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_menu_item_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkMenuItem),
|
||||
16, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_menu_item_init,
|
||||
};
|
||||
|
||||
menu_item_type = gtk_type_unique (gtk_item_get_type (), &menu_item_info);
|
||||
gtk_type_set_chunk_alloc (menu_item_type, 16);
|
||||
menu_item_type = g_type_register_static (GTK_TYPE_ITEM, "GtkMenuItem", &menu_item_info);
|
||||
}
|
||||
|
||||
return menu_item_type;
|
||||
@ -125,7 +125,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
|
||||
menu_item_signals[ACTIVATE] =
|
||||
gtk_signal_new ("activate",
|
||||
GTK_RUN_FIRST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkMenuItemClass, activate),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -133,7 +133,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
|
||||
menu_item_signals[ACTIVATE_ITEM] =
|
||||
gtk_signal_new ("activate_item",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkMenuItemClass, activate_item),
|
||||
gtk_signal_default_marshaller,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
|
||||
#define MENU_SHELL_TIMEOUT 500
|
||||
#define MENU_SHELL_CLASS(w) GTK_MENU_SHELL_CLASS (GTK_OBJECT (w)->klass)
|
||||
|
||||
|
||||
enum {
|
||||
@ -191,21 +190,21 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
|
||||
menu_shell_signals[DEACTIVATE] =
|
||||
gtk_signal_new ("deactivate",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkMenuShellClass, deactivate),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
menu_shell_signals[SELECTION_DONE] =
|
||||
gtk_signal_new ("selection-done",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkMenuShellClass, selection_done),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
menu_shell_signals[MOVE_CURRENT] =
|
||||
gtk_signal_new ("move_current",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkMenuShellClass, move_current),
|
||||
gtk_marshal_NONE__ENUM,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -213,7 +212,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
|
||||
menu_shell_signals[ACTIVATE_CURRENT] =
|
||||
gtk_signal_new ("activate_current",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkMenuShellClass, activate_current),
|
||||
gtk_marshal_NONE__BOOL,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -221,7 +220,7 @@ gtk_menu_shell_class_init (GtkMenuShellClass *klass)
|
||||
menu_shell_signals[CANCEL] =
|
||||
gtk_signal_new ("cancel",
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkMenuShellClass, cancel),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
@ -786,7 +785,7 @@ gtk_menu_shell_select_item (GtkMenuShell *menu_shell,
|
||||
|
||||
menu_shell->active_menu_item = menu_item;
|
||||
gtk_menu_item_set_placement (GTK_MENU_ITEM (menu_shell->active_menu_item),
|
||||
MENU_SHELL_CLASS (menu_shell)->submenu_placement);
|
||||
GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement);
|
||||
gtk_menu_item_select (GTK_MENU_ITEM (menu_shell->active_menu_item));
|
||||
|
||||
/* This allows the bizarre radio buttons-with-submenus-display-history
|
||||
@ -822,7 +821,7 @@ 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;
|
||||
deactivate = GTK_MENU_ITEM_GET_CLASS (menu_item)->hide_on_activate;
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (menu_shell));
|
||||
|
||||
@ -936,8 +935,8 @@ gtk_real_menu_shell_move_current (GtkMenuShell *menu_shell,
|
||||
case GTK_MENU_DIR_PARENT:
|
||||
if (parent_menu_shell)
|
||||
{
|
||||
if (GTK_MENU_SHELL_CLASS (GTK_OBJECT (parent_menu_shell)->klass)->submenu_placement ==
|
||||
GTK_MENU_SHELL_CLASS (GTK_OBJECT (menu_shell)->klass)->submenu_placement)
|
||||
if (GTK_MENU_SHELL_GET_CLASS (parent_menu_shell)->submenu_placement ==
|
||||
GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement)
|
||||
gtk_menu_shell_deselect (menu_shell);
|
||||
else
|
||||
{
|
||||
@ -960,8 +959,8 @@ gtk_real_menu_shell_move_current (GtkMenuShell *menu_shell,
|
||||
{
|
||||
/* Try to find a menu running the opposite direction */
|
||||
while (parent_menu_shell &&
|
||||
(GTK_MENU_SHELL_CLASS (GTK_OBJECT (parent_menu_shell)->klass)->submenu_placement ==
|
||||
GTK_MENU_SHELL_CLASS (GTK_OBJECT (menu_shell)->klass)->submenu_placement))
|
||||
(GTK_MENU_SHELL_GET_CLASS (parent_menu_shell)->submenu_placement ==
|
||||
GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement))
|
||||
parent_menu_shell = GTK_MENU_SHELL (parent_menu_shell->parent_menu_shell);
|
||||
|
||||
if (parent_menu_shell)
|
||||
|
@ -271,7 +271,7 @@ gtk_notebook_class_init (GtkNotebookClass *class)
|
||||
notebook_signals[SWITCH_PAGE] =
|
||||
gtk_signal_new ("switch_page",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkNotebookClass, switch_page),
|
||||
gtk_marshal_NONE__POINTER_UINT,
|
||||
GTK_TYPE_NONE, 2,
|
||||
|
313
gtk/gtkobject.c
313
gtk/gtkobject.c
@ -45,95 +45,60 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
void gtk_object_init_type (void);
|
||||
static void gtk_object_base_class_init (GtkObjectClass *klass);
|
||||
static void gtk_object_class_init (GtkObjectClass *klass);
|
||||
static void gtk_object_init (GtkObject *object,
|
||||
extern void gtk_object_init_type (void); /* for gtktypeutils.h */
|
||||
static void gtk_object_base_class_init (GtkObjectClass *class);
|
||||
static void gtk_object_base_class_finalize (GtkObjectClass *class);
|
||||
static void gtk_object_class_init (GtkObjectClass *klass);
|
||||
static void gtk_object_init (GtkObject *object,
|
||||
GtkObjectClass *klass);
|
||||
static void gtk_object_set_arg (GtkObject *object,
|
||||
static void gtk_object_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_object_get_arg (GtkObject *object,
|
||||
static void gtk_object_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_object_shutdown (GtkObject *object);
|
||||
static void gtk_object_real_destroy (GtkObject *object);
|
||||
static void gtk_object_finalize (GtkObject *object);
|
||||
static void gtk_object_notify_weaks (GtkObject *object);
|
||||
|
||||
static guint object_signals[LAST_SIGNAL] = { 0 };
|
||||
static void gtk_object_shutdown (GObject *object);
|
||||
static void gtk_object_real_destroy (GtkObject *object);
|
||||
static void gtk_object_finalize (GObject *object);
|
||||
static void gtk_object_notify_weaks (GtkObject *object);
|
||||
|
||||
static gpointer parent_class = NULL;
|
||||
static guint object_signals[LAST_SIGNAL] = { 0 };
|
||||
static GHashTable *object_arg_info_ht = NULL;
|
||||
static GQuark quark_user_data = 0;
|
||||
static GQuark quark_weakrefs = 0;
|
||||
static GQuark quark_carg_history = 0;
|
||||
|
||||
static GQuark quark_user_data = 0;
|
||||
static GQuark quark_weakrefs = 0;
|
||||
static GQuark quark_carg_history = 0;
|
||||
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static guint obj_count = 0;
|
||||
static GHashTable *living_objs_ht = NULL;
|
||||
static void
|
||||
gtk_object_debug_foreach (gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
GtkObject *object;
|
||||
|
||||
object = (GtkObject*) value;
|
||||
g_message ("[%p] %s\tref_count=%d%s%s",
|
||||
object,
|
||||
gtk_type_name (GTK_OBJECT_TYPE (object)),
|
||||
object->ref_count,
|
||||
GTK_OBJECT_FLOATING (object) ? " (floating)" : "",
|
||||
GTK_OBJECT_DESTROYED (object) ? " (destroyed)" : "");
|
||||
}
|
||||
static void
|
||||
gtk_object_debug (void)
|
||||
{
|
||||
if (living_objs_ht)
|
||||
g_hash_table_foreach (living_objs_ht, gtk_object_debug_foreach, NULL);
|
||||
|
||||
g_message ("living objects count = %d", obj_count);
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
void
|
||||
gtk_object_post_arg_parsing_init (void)
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gtk_debug_flags & GTK_DEBUG_OBJECTS)
|
||||
g_atexit (gtk_object_debug);
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
}
|
||||
|
||||
/****************************************************
|
||||
* GtkObject type, class and instance initialization
|
||||
*
|
||||
****************************************************/
|
||||
|
||||
void
|
||||
gtk_object_init_type (void)
|
||||
{
|
||||
static const GtkTypeInfo object_info =
|
||||
{
|
||||
"GtkObject",
|
||||
sizeof (GtkObject),
|
||||
sizeof (GtkObjectClass),
|
||||
(GtkClassInitFunc) gtk_object_class_init,
|
||||
(GtkObjectInitFunc) gtk_object_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) gtk_object_base_class_init,
|
||||
};
|
||||
GtkType object_type;
|
||||
|
||||
object_type = gtk_type_unique (0, &object_info);
|
||||
g_assert (object_type == GTK_TYPE_OBJECT);
|
||||
}
|
||||
|
||||
GtkType
|
||||
gtk_object_get_type (void)
|
||||
{
|
||||
return GTK_TYPE_OBJECT;
|
||||
static GtkType object_type = 0;
|
||||
|
||||
if (!object_type)
|
||||
{
|
||||
static const GTypeInfo object_info =
|
||||
{
|
||||
sizeof (GtkObjectClass),
|
||||
(GBaseInitFunc) gtk_object_base_class_init,
|
||||
(GBaseFinalizeFunc) gtk_object_base_class_finalize,
|
||||
(GClassInitFunc) gtk_object_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkObject),
|
||||
16, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_object_init,
|
||||
};
|
||||
|
||||
object_type = g_type_register_static (G_TYPE_OBJECT, "GtkObject", &object_info);
|
||||
}
|
||||
|
||||
return object_type;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -150,9 +115,27 @@ gtk_object_base_class_init (GtkObjectClass *class)
|
||||
class->set_arg = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_object_base_class_finalize (GtkObjectClass *class)
|
||||
{
|
||||
g_free (class->signals);
|
||||
g_return_if_fail (class->construct_args == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_object_class_init (GtkObjectClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
|
||||
parent_class = g_type_class_ref (G_TYPE_OBJECT);
|
||||
|
||||
gobject_class->shutdown = gtk_object_shutdown;
|
||||
gobject_class->finalize = gtk_object_finalize;
|
||||
|
||||
class->get_arg = gtk_object_get_arg;
|
||||
class->set_arg = gtk_object_set_arg;
|
||||
class->destroy = gtk_object_real_destroy;
|
||||
|
||||
quark_carg_history = g_quark_from_static_string ("gtk-construct-arg-history");
|
||||
|
||||
gtk_object_add_arg_type ("GtkObject::user_data",
|
||||
@ -179,18 +162,12 @@ gtk_object_class_init (GtkObjectClass *class)
|
||||
object_signals[DESTROY] =
|
||||
gtk_signal_new ("destroy",
|
||||
GTK_RUN_LAST | GTK_RUN_NO_HOOKS,
|
||||
class->type,
|
||||
GTK_CLASS_TYPE (class),
|
||||
GTK_SIGNAL_OFFSET (GtkObjectClass, destroy),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_object_class_add_signals (class, object_signals, LAST_SIGNAL);
|
||||
|
||||
class->get_arg = gtk_object_get_arg;
|
||||
class->set_arg = gtk_object_set_arg;
|
||||
class->shutdown = gtk_object_shutdown;
|
||||
class->destroy = gtk_object_real_destroy;
|
||||
class->finalize = gtk_object_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -203,26 +180,11 @@ gtk_object_init (GtkObject *object,
|
||||
do
|
||||
{
|
||||
needs_construction |= klass->construct_args != NULL;
|
||||
klass = gtk_type_parent_class (klass->type);
|
||||
klass = g_type_class_peek_parent (klass);
|
||||
}
|
||||
while (klass && !needs_construction);
|
||||
if (!needs_construction)
|
||||
GTK_OBJECT_FLAGS (object) |= GTK_CONSTRUCTED;
|
||||
|
||||
object->ref_count = 1;
|
||||
g_datalist_init (&object->object_data);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gtk_debug_flags & GTK_DEBUG_OBJECTS)
|
||||
{
|
||||
obj_count++;
|
||||
|
||||
if (!living_objs_ht)
|
||||
living_objs_ht = g_hash_table_new (g_direct_hash, NULL);
|
||||
|
||||
g_hash_table_insert (living_objs_ht, object, object);
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
}
|
||||
|
||||
/********************************************
|
||||
@ -238,21 +200,26 @@ gtk_object_destroy (GtkObject *object)
|
||||
|
||||
if (!GTK_OBJECT_DESTROYED (object))
|
||||
{
|
||||
/* we will hold a reference on the object in this place, so
|
||||
* to ease all classes shutdown and destroy implementations.
|
||||
* i.e. they don't have to bother about referencing at all.
|
||||
/* need to hold a reference count around all class method
|
||||
* invocations. we guard against reinvocations during
|
||||
* destruction with the GTK_DESTROYED flag.
|
||||
*/
|
||||
gtk_object_ref (object);
|
||||
object->klass->shutdown (object);
|
||||
GTK_OBJECT_SET_FLAGS (object, GTK_DESTROYED);
|
||||
G_OBJECT_GET_CLASS (object)->shutdown (G_OBJECT (object));
|
||||
GTK_OBJECT_UNSET_FLAGS (object, GTK_DESTROYED);
|
||||
gtk_object_unref (object);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_object_shutdown (GtkObject *object)
|
||||
gtk_object_shutdown (GObject *gobject)
|
||||
{
|
||||
GTK_OBJECT_SET_FLAGS (object, GTK_DESTROYED);
|
||||
GtkObject *object = GTK_OBJECT (gobject);
|
||||
|
||||
gtk_signal_emit (object, object_signals[DESTROY]);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->shutdown (gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -263,13 +230,13 @@ gtk_object_real_destroy (GtkObject *object)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_object_finalize (GtkObject *object)
|
||||
gtk_object_finalize (GObject *gobject)
|
||||
{
|
||||
gtk_object_notify_weaks (object);
|
||||
GtkObject *object = GTK_OBJECT (gobject);
|
||||
|
||||
g_datalist_clear (&object->object_data);
|
||||
gtk_object_notify_weaks (object);
|
||||
|
||||
gtk_type_free (GTK_OBJECT_TYPE (object), object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (gobject);
|
||||
}
|
||||
|
||||
/*****************************************
|
||||
@ -396,7 +363,7 @@ gtk_object_class_user_signal_new (GtkObjectClass *class,
|
||||
|
||||
signal_id = gtk_signal_newv (name,
|
||||
signal_flags,
|
||||
class->type,
|
||||
GTK_CLASS_TYPE (class),
|
||||
0,
|
||||
marshaller,
|
||||
return_val,
|
||||
@ -429,7 +396,7 @@ gtk_object_class_user_signal_newv (GtkObjectClass *class,
|
||||
|
||||
signal_id = gtk_signal_newv (name,
|
||||
signal_flags,
|
||||
class->type,
|
||||
GTK_CLASS_TYPE (class),
|
||||
0,
|
||||
marshaller,
|
||||
return_val,
|
||||
@ -576,7 +543,7 @@ gtk_object_new (GtkType object_type,
|
||||
GSList *info_list = NULL;
|
||||
gchar *error;
|
||||
|
||||
g_return_val_if_fail (GTK_FUNDAMENTAL_TYPE (object_type) == GTK_TYPE_OBJECT, NULL);
|
||||
g_return_val_if_fail (GTK_TYPE_IS_OBJECT (object_type), NULL);
|
||||
|
||||
object = gtk_type_new (object_type);
|
||||
|
||||
@ -623,7 +590,7 @@ gtk_object_newv (GtkType object_type,
|
||||
GtkObject *object;
|
||||
GtkArg *max_args;
|
||||
|
||||
g_return_val_if_fail (GTK_FUNDAMENTAL_TYPE (object_type) == GTK_TYPE_OBJECT, NULL);
|
||||
g_return_val_if_fail (GTK_TYPE_IS_OBJECT (object_type), NULL);
|
||||
if (n_args)
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
|
||||
@ -872,7 +839,7 @@ gtk_object_default_construct (GtkObject *object)
|
||||
|
||||
if (!GTK_OBJECT_CONSTRUCTED (object))
|
||||
{
|
||||
for (slist = object->klass->construct_args;
|
||||
for (slist = GTK_OBJECT_GET_CLASS (object)->construct_args;
|
||||
slist && !GTK_OBJECT_CONSTRUCTED (object);
|
||||
slist = slist->next)
|
||||
{
|
||||
@ -888,7 +855,7 @@ gtk_object_default_construct (GtkObject *object)
|
||||
/* default application */
|
||||
arg.type = info->type;
|
||||
arg.name = info->name;
|
||||
switch (gtk_type_get_varargs_type (arg.type))
|
||||
switch (G_TYPE_FUNDAMENTAL (arg.type))
|
||||
{
|
||||
case GTK_TYPE_FLOAT:
|
||||
GTK_VALUE_FLOAT (arg) = 0.0;
|
||||
@ -899,7 +866,7 @@ gtk_object_default_construct (GtkObject *object)
|
||||
case GTK_TYPE_BOXED:
|
||||
case GTK_TYPE_STRING:
|
||||
case GTK_TYPE_POINTER:
|
||||
case GTK_TYPE_OBJECT:
|
||||
case G_TYPE_OBJECT:
|
||||
GTK_VALUE_POINTER (arg) = NULL;
|
||||
break;
|
||||
default:
|
||||
@ -1004,7 +971,7 @@ gtk_object_query_args (GtkType class_type,
|
||||
{
|
||||
g_return_val_if_fail (n_args != NULL, NULL);
|
||||
*n_args = 0;
|
||||
g_return_val_if_fail (GTK_FUNDAMENTAL_TYPE (class_type) == GTK_TYPE_OBJECT, NULL);
|
||||
g_return_val_if_fail (GTK_TYPE_IS_OBJECT (class_type), NULL);
|
||||
|
||||
return gtk_args_query (class_type, object_arg_info_ht, arg_flags, n_args);
|
||||
}
|
||||
@ -1019,10 +986,9 @@ gtk_object_set_data_by_id (GtkObject *object,
|
||||
GQuark data_id,
|
||||
gpointer data)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
|
||||
g_datalist_id_set_data (&object->object_data, data_id, data);
|
||||
g_datalist_id_set_data (&G_OBJECT (object)->qdata, data_id, data);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1030,11 +996,10 @@ gtk_object_set_data (GtkObject *object,
|
||||
const gchar *key,
|
||||
gpointer data)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
g_return_if_fail (key != NULL);
|
||||
|
||||
g_datalist_set_data (&object->object_data, key, data);
|
||||
g_datalist_set_data (&G_OBJECT (object)->qdata, key, data);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1043,10 +1008,9 @@ gtk_object_set_data_by_id_full (GtkObject *object,
|
||||
gpointer data,
|
||||
GtkDestroyNotify destroy)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
|
||||
g_datalist_id_set_data_full (&object->object_data, data_id, data, destroy);
|
||||
g_datalist_id_set_data_full (&G_OBJECT (object)->qdata, data_id, data, destroy);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1055,186 +1019,101 @@ gtk_object_set_data_full (GtkObject *object,
|
||||
gpointer data,
|
||||
GtkDestroyNotify destroy)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
g_return_if_fail (key != NULL);
|
||||
|
||||
g_datalist_set_data_full (&object->object_data, key, data, destroy);
|
||||
g_datalist_set_data_full (&G_OBJECT (object)->qdata, key, data, destroy);
|
||||
}
|
||||
|
||||
gpointer
|
||||
gtk_object_get_data_by_id (GtkObject *object,
|
||||
GQuark data_id)
|
||||
{
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_OBJECT (object), NULL);
|
||||
|
||||
return g_datalist_id_get_data (&object->object_data, data_id);
|
||||
return g_datalist_id_get_data (&G_OBJECT (object)->qdata, data_id);
|
||||
}
|
||||
|
||||
gpointer
|
||||
gtk_object_get_data (GtkObject *object,
|
||||
const gchar *key)
|
||||
{
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_OBJECT (object), NULL);
|
||||
g_return_val_if_fail (key != NULL, NULL);
|
||||
|
||||
return g_datalist_get_data (&object->object_data, key);
|
||||
return g_datalist_get_data (&G_OBJECT (object)->qdata, key);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_remove_data_by_id (GtkObject *object,
|
||||
GQuark data_id)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
|
||||
g_datalist_id_remove_data (&object->object_data, data_id);
|
||||
g_datalist_id_remove_data (&G_OBJECT (object)->qdata, data_id);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_remove_data (GtkObject *object,
|
||||
const gchar *key)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
g_return_if_fail (key != NULL);
|
||||
|
||||
g_datalist_remove_data (&object->object_data, key);
|
||||
g_datalist_remove_data (&G_OBJECT (object)->qdata, key);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_remove_no_notify_by_id (GtkObject *object,
|
||||
GQuark key_id)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
|
||||
g_datalist_id_remove_no_notify (&object->object_data, key_id);
|
||||
g_datalist_id_remove_no_notify (&G_OBJECT (object)->qdata, key_id);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_remove_no_notify (GtkObject *object,
|
||||
const gchar *key)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
g_return_if_fail (key != NULL);
|
||||
|
||||
g_datalist_remove_no_notify (&object->object_data, key);
|
||||
g_datalist_remove_no_notify (&G_OBJECT (object)->qdata, key);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_set_user_data (GtkObject *object,
|
||||
gpointer data)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
|
||||
if (!quark_user_data)
|
||||
quark_user_data = g_quark_from_static_string ("user_data");
|
||||
|
||||
g_datalist_id_set_data (&object->object_data, quark_user_data, data);
|
||||
g_datalist_id_set_data (&G_OBJECT (object)->qdata, quark_user_data, data);
|
||||
}
|
||||
|
||||
gpointer
|
||||
gtk_object_get_user_data (GtkObject *object)
|
||||
{
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_OBJECT (object), NULL);
|
||||
|
||||
return g_datalist_id_get_data (&object->object_data, quark_user_data);
|
||||
return g_datalist_id_get_data (&G_OBJECT (object)->qdata, quark_user_data);
|
||||
}
|
||||
|
||||
/*******************************************
|
||||
* GtkObject referencing and unreferencing
|
||||
*
|
||||
*******************************************/
|
||||
|
||||
#undef gtk_object_ref
|
||||
#undef gtk_object_unref
|
||||
|
||||
void
|
||||
GtkObject*
|
||||
gtk_object_ref (GtkObject *object)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
g_return_if_fail (object->ref_count > 0);
|
||||
g_return_val_if_fail (GTK_IS_OBJECT (object), NULL);
|
||||
|
||||
object->ref_count += 1;
|
||||
return (GtkObject*) g_object_ref ((GObject*) object);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_object_unref (GtkObject *object)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
g_return_if_fail (object->ref_count > 0);
|
||||
|
||||
if (object->ref_count == 1)
|
||||
{
|
||||
gtk_object_destroy (object);
|
||||
|
||||
g_return_if_fail (object->ref_count > 0);
|
||||
}
|
||||
|
||||
object->ref_count -= 1;
|
||||
|
||||
if (object->ref_count == 0)
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
if (gtk_debug_flags & GTK_DEBUG_OBJECTS)
|
||||
{
|
||||
g_assert (g_hash_table_lookup (living_objs_ht, object) == object);
|
||||
g_hash_table_remove (living_objs_ht, object);
|
||||
obj_count--;
|
||||
}
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
object->klass->finalize (object);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkObject *gtk_trace_object = NULL;
|
||||
void
|
||||
gtk_trace_referencing (GtkObject *object,
|
||||
const gchar *func,
|
||||
guint dummy,
|
||||
guint line,
|
||||
gboolean do_ref)
|
||||
{
|
||||
if (gtk_debug_flags & GTK_DEBUG_OBJECTS)
|
||||
{
|
||||
gboolean exists = TRUE;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_OBJECT (object));
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
exists = g_hash_table_lookup (living_objs_ht, object) != NULL;
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
if (exists &&
|
||||
(object == gtk_trace_object ||
|
||||
gtk_trace_object == (void*)42))
|
||||
fprintf (stdout, "trace: object_%s: (%s:%p)->ref_count=%d %s (%s:%d)\n",
|
||||
do_ref ? "ref" : "unref",
|
||||
gtk_type_name (GTK_OBJECT_TYPE (object)),
|
||||
object,
|
||||
object->ref_count,
|
||||
do_ref ? "+ 1" : "- 1",
|
||||
func,
|
||||
line);
|
||||
else if (!exists)
|
||||
fprintf (stdout, "trace: object_%s(%p): no such object! (%s:%d)\n",
|
||||
do_ref ? "ref" : "unref",
|
||||
object,
|
||||
func,
|
||||
line);
|
||||
}
|
||||
|
||||
if (do_ref)
|
||||
gtk_object_ref (object);
|
||||
else
|
||||
gtk_object_unref (object);
|
||||
g_object_unref ((GObject*) object);
|
||||
}
|
||||
|
@ -39,38 +39,21 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
|
||||
/* Macro for casting a pointer to a GtkObject or GtkObjectClass pointer.
|
||||
* The second portion of the ?: statments are just in place to offer
|
||||
* descriptive warning message.
|
||||
/* macros for casting a pointer to a GtkObject or GtkObjectClass pointer,
|
||||
* and to test whether `object' and `klass' are of type GTK_TYPE_OBJECT.
|
||||
* these are the standard macros for all GtkObject-derived classes.
|
||||
*/
|
||||
#define GTK_OBJECT(object) ( \
|
||||
GTK_IS_OBJECT (object) ? \
|
||||
(GtkObject*) (object) : \
|
||||
(GtkObject*) gtk_type_check_object_cast ((GtkTypeObject*) (object), GTK_TYPE_OBJECT) \
|
||||
)
|
||||
#define GTK_OBJECT_CLASS(klass) ( \
|
||||
GTK_IS_OBJECT_CLASS (klass) ? \
|
||||
(GtkObjectClass*) (klass) : \
|
||||
(GtkObjectClass*) gtk_type_check_class_cast ((GtkTypeClass*) (klass), GTK_TYPE_OBJECT) \
|
||||
)
|
||||
|
||||
/* Macro for testing whether `object' and `klass' are of type GTK_TYPE_OBJECT.
|
||||
*/
|
||||
#define GTK_IS_OBJECT(object) ( \
|
||||
(object) != NULL && \
|
||||
GTK_IS_OBJECT_CLASS (((GtkObject*) (object))->klass) \
|
||||
)
|
||||
#define GTK_IS_OBJECT_CLASS(klass) ( \
|
||||
(klass) != NULL && \
|
||||
GTK_FUNDAMENTAL_TYPE (((GtkObjectClass*) (klass))->type) == GTK_TYPE_OBJECT \
|
||||
)
|
||||
#define GTK_TYPE_OBJECT (gtk_object_get_type ())
|
||||
#define GTK_OBJECT(object) (GTK_CHECK_CAST ((object), GTK_TYPE_OBJECT, GtkObject))
|
||||
#define GTK_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_OBJECT, GtkObjectClass))
|
||||
#define GTK_IS_OBJECT(object) (GTK_CHECK_TYPE ((object), GTK_TYPE_OBJECT))
|
||||
#define GTK_IS_OBJECT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_OBJECT))
|
||||
#define GTK_OBJECT_GET_CLASS(object) (GTK_CHECK_GET_CLASS ((object), GTK_TYPE_OBJECT, GtkObjectClass))
|
||||
|
||||
/* Macros for extracting various fields from GtkObject and GtkObjectClass.
|
||||
*/
|
||||
#define GTK_OBJECT_TYPE(obj) (GTK_OBJECT (obj)->klass->type)
|
||||
#define GTK_OBJECT_SIGNALS(obj) (GTK_OBJECT (obj)->klass->signals)
|
||||
#define GTK_OBJECT_NSIGNALS(obj) (GTK_OBJECT (obj)->klass->nsignals)
|
||||
#define GTK_OBJECT_TYPE(object) (G_TYPE_FROM_INSTANCE (object))
|
||||
#define GTK_OBJECT_TYPE_NAME(object) (g_type_name (GTK_OBJECT_TYPE (object)))
|
||||
|
||||
/* GtkObject only uses the first 4 bits of the flags field.
|
||||
* Derived objects may use the remaining bits. Though this
|
||||
@ -124,9 +107,7 @@ typedef struct _GtkObjectClass GtkObjectClass;
|
||||
*/
|
||||
struct _GtkObject
|
||||
{
|
||||
/* GtkTypeObject related fields: */
|
||||
GtkObjectClass *klass;
|
||||
|
||||
GObject parent_instance;
|
||||
|
||||
/* 32 bits of flags. GtkObject only uses 4 of these bits and
|
||||
* GtkWidget uses the rest. This is done because structs are
|
||||
@ -134,16 +115,6 @@ struct _GtkObject
|
||||
* used in GtkWidget much space would be wasted.
|
||||
*/
|
||||
guint32 flags;
|
||||
|
||||
/* reference count.
|
||||
* refer to the file docs/refcounting.txt on this issue.
|
||||
*/
|
||||
guint ref_count;
|
||||
|
||||
/* A list of keyed data pointers, used for e.g. the list of signal
|
||||
* handlers or an object's user_data.
|
||||
*/
|
||||
GData *object_data;
|
||||
};
|
||||
|
||||
/* The GtkObjectClass is the base of the Gtk+ objects classes hierarchy,
|
||||
@ -155,9 +126,7 @@ struct _GtkObject
|
||||
*/
|
||||
struct _GtkObjectClass
|
||||
{
|
||||
/* GtkTypeClass fields: */
|
||||
GtkType type;
|
||||
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* The signals this object class handles. "signals" is an
|
||||
* array of signal ID's.
|
||||
@ -181,7 +150,7 @@ struct _GtkObjectClass
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
|
||||
/* The functions that will end an objects life time. In one way ore
|
||||
/* The function that will end an objects life time. In one way ore
|
||||
* another all three of them are defined for all objects. If an
|
||||
* object class overrides one of the methods in order to perform class
|
||||
* specific destruction then it must still invoke its superclass'
|
||||
@ -189,10 +158,7 @@ struct _GtkObjectClass
|
||||
* own cleanup. (See the destroy function for GtkWidget for
|
||||
* an example of how to do this).
|
||||
*/
|
||||
void (* shutdown) (GtkObject *object);
|
||||
void (* destroy) (GtkObject *object);
|
||||
|
||||
void (* finalize) (GtkObject *object);
|
||||
};
|
||||
|
||||
|
||||
@ -222,11 +188,11 @@ GtkObject* gtk_object_new (GtkType type,
|
||||
GtkObject* gtk_object_newv (GtkType object_type,
|
||||
guint n_args,
|
||||
GtkArg *args);
|
||||
GtkObject* gtk_object_ref (GtkObject *object);
|
||||
void gtk_object_unref (GtkObject *object);
|
||||
void gtk_object_default_construct (GtkObject *object);
|
||||
void gtk_object_constructed (GtkObject *object);
|
||||
void gtk_object_sink (GtkObject *object);
|
||||
void gtk_object_ref (GtkObject *object);
|
||||
void gtk_object_unref (GtkObject *object);
|
||||
void gtk_object_weakref (GtkObject *object,
|
||||
GtkDestroyNotify notify,
|
||||
gpointer data);
|
||||
@ -358,16 +324,6 @@ gchar* gtk_object_args_collect (GtkType object_type,
|
||||
gchar* gtk_object_arg_get_info (GtkType object_type,
|
||||
const gchar *arg_name,
|
||||
GtkArgInfo **info_p);
|
||||
void gtk_trace_referencing (GtkObject *object,
|
||||
const gchar *func,
|
||||
guint dummy,
|
||||
guint line,
|
||||
gboolean do_ref);
|
||||
#if G_ENABLE_DEBUG
|
||||
# define gtk_object_ref(o) G_STMT_START{gtk_trace_referencing((o),G_GNUC_PRETTY_FUNCTION,0,__LINE__,1);}G_STMT_END
|
||||
# define gtk_object_unref(o) G_STMT_START{gtk_trace_referencing((o),G_GNUC_PRETTY_FUNCTION,0,__LINE__,0);}G_STMT_END
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ static void gtk_pixmap_class_init (GtkPixmapClass *klass);
|
||||
static void gtk_pixmap_init (GtkPixmap *pixmap);
|
||||
static gint gtk_pixmap_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static void gtk_pixmap_finalize (GtkObject *object);
|
||||
static void gtk_pixmap_finalize (GObject *object);
|
||||
static void build_insensitive_pixmap (GtkPixmap *gtkpixmap);
|
||||
|
||||
static GtkWidgetClass *parent_class;
|
||||
@ -68,6 +68,7 @@ gtk_pixmap_get_type (void)
|
||||
static void
|
||||
gtk_pixmap_class_init (GtkPixmapClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
@ -75,7 +76,8 @@ gtk_pixmap_class_init (GtkPixmapClass *class)
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
parent_class = gtk_type_class (gtk_widget_get_type ());
|
||||
|
||||
object_class->finalize = gtk_pixmap_finalize;
|
||||
gobject_class->finalize = gtk_pixmap_finalize;
|
||||
|
||||
widget_class->expose_event = gtk_pixmap_expose;
|
||||
}
|
||||
|
||||
@ -105,10 +107,11 @@ gtk_pixmap_new (GdkPixmap *val,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_pixmap_finalize (GtkObject *object)
|
||||
gtk_pixmap_finalize (GObject *object)
|
||||
{
|
||||
gtk_pixmap_set (GTK_PIXMAP (object), NULL, NULL);
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -64,18 +64,20 @@ gtk_plug_get_type ()
|
||||
|
||||
if (!plug_type)
|
||||
{
|
||||
static const GtkTypeInfo plug_info =
|
||||
static const GTypeInfo plug_info =
|
||||
{
|
||||
"GtkPlug",
|
||||
sizeof (GtkPlug),
|
||||
sizeof (GtkPlugClass),
|
||||
(GtkClassInitFunc) gtk_plug_class_init,
|
||||
(GtkObjectInitFunc) gtk_plug_init,
|
||||
(GtkArgSetFunc) NULL,
|
||||
(GtkArgGetFunc) NULL
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_plug_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkPlug),
|
||||
16, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_plug_init,
|
||||
};
|
||||
|
||||
plug_type = gtk_type_unique (GTK_TYPE_WINDOW, &plug_info);
|
||||
plug_type = g_type_register_static (GTK_TYPE_WINDOW, "GtkPlug", &plug_info);
|
||||
}
|
||||
|
||||
return plug_type;
|
||||
|
@ -53,7 +53,7 @@ static void gtk_preview_set_arg (GtkObject *object,
|
||||
static void gtk_preview_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_preview_finalize (GtkObject *object);
|
||||
static void gtk_preview_finalize (GObject *object);
|
||||
static void gtk_preview_realize (GtkWidget *widget);
|
||||
static void gtk_preview_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
@ -95,6 +95,7 @@ gtk_preview_get_type (void)
|
||||
static void
|
||||
gtk_preview_class_init (GtkPreviewClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
@ -104,9 +105,10 @@ gtk_preview_class_init (GtkPreviewClass *klass)
|
||||
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
|
||||
preview_class = klass;
|
||||
|
||||
gobject_class->finalize = gtk_preview_finalize;
|
||||
|
||||
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;
|
||||
widget_class->size_allocate = gtk_preview_size_allocate;
|
||||
@ -438,11 +440,10 @@ gtk_preview_get_info (void)
|
||||
|
||||
|
||||
static void
|
||||
gtk_preview_finalize (GtkObject *object)
|
||||
gtk_preview_finalize (GObject *object)
|
||||
{
|
||||
GtkPreview *preview;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_PREVIEW (object));
|
||||
|
||||
preview = GTK_PREVIEW (object);
|
||||
@ -450,7 +451,7 @@ gtk_preview_finalize (GtkObject *object)
|
||||
g_free (preview->buffer);
|
||||
preview->type = (GtkPreviewType) -1;
|
||||
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -50,7 +50,7 @@ static void gtk_progress_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_progress_destroy (GtkObject *object);
|
||||
static void gtk_progress_finalize (GtkObject *object);
|
||||
static void gtk_progress_finalize (GObject *object);
|
||||
static void gtk_progress_realize (GtkWidget *widget);
|
||||
static gint gtk_progress_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
@ -90,6 +90,7 @@ gtk_progress_get_type (void)
|
||||
static void
|
||||
gtk_progress_class_init (GtkProgressClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
@ -97,6 +98,21 @@ gtk_progress_class_init (GtkProgressClass *class)
|
||||
widget_class = (GtkWidgetClass *) class;
|
||||
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
|
||||
|
||||
gobject_class->finalize = gtk_progress_finalize;
|
||||
|
||||
object_class->set_arg = gtk_progress_set_arg;
|
||||
object_class->get_arg = gtk_progress_get_arg;
|
||||
object_class->destroy = gtk_progress_destroy;
|
||||
|
||||
widget_class->realize = gtk_progress_realize;
|
||||
widget_class->expose_event = gtk_progress_expose;
|
||||
widget_class->size_allocate = gtk_progress_size_allocate;
|
||||
|
||||
/* to be overridden */
|
||||
class->paint = NULL;
|
||||
class->update = NULL;
|
||||
class->act_mode_enter = NULL;
|
||||
|
||||
gtk_object_add_arg_type ("GtkProgress::activity_mode",
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
@ -113,20 +129,6 @@ gtk_progress_class_init (GtkProgressClass *class)
|
||||
GTK_TYPE_FLOAT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_TEXT_YALIGN);
|
||||
|
||||
object_class->set_arg = gtk_progress_set_arg;
|
||||
object_class->get_arg = gtk_progress_get_arg;
|
||||
object_class->destroy = gtk_progress_destroy;
|
||||
object_class->finalize = gtk_progress_finalize;
|
||||
|
||||
widget_class->realize = gtk_progress_realize;
|
||||
widget_class->expose_event = gtk_progress_expose;
|
||||
widget_class->size_allocate = gtk_progress_size_allocate;
|
||||
|
||||
/* to be overridden */
|
||||
class->paint = NULL;
|
||||
class->update = NULL;
|
||||
class->act_mode_enter = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -245,32 +247,32 @@ gtk_progress_destroy (GtkObject *object)
|
||||
progress = GTK_PROGRESS (object);
|
||||
|
||||
if (progress->adjustment)
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (progress->adjustment),
|
||||
progress);
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (progress->adjustment),
|
||||
progress);
|
||||
gtk_object_unref (GTK_OBJECT (progress->adjustment));
|
||||
progress->adjustment = NULL;
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_progress_finalize (GtkObject *object)
|
||||
gtk_progress_finalize (GObject *object)
|
||||
{
|
||||
GtkProgress *progress;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_PROGRESS (object));
|
||||
|
||||
progress = GTK_PROGRESS (object);
|
||||
|
||||
if (progress->adjustment)
|
||||
gtk_object_unref (GTK_OBJECT (GTK_PROGRESS (object)->adjustment));
|
||||
|
||||
if (progress->offscreen_pixmap)
|
||||
gdk_pixmap_unref (progress->offscreen_pixmap);
|
||||
|
||||
if (progress->format)
|
||||
g_free (progress->format);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gint
|
||||
@ -332,7 +334,7 @@ gtk_progress_create_pixmap (GtkProgress *progress)
|
||||
widget->allocation.width,
|
||||
widget->allocation.height,
|
||||
-1);
|
||||
GTK_PROGRESS_CLASS (GTK_OBJECT (progress)->klass)->paint (progress);
|
||||
GTK_PROGRESS_GET_CLASS (progress)->paint (progress);
|
||||
}
|
||||
}
|
||||
|
||||
@ -340,7 +342,7 @@ static void
|
||||
gtk_progress_value_changed (GtkAdjustment *adjustment,
|
||||
GtkProgress *progress)
|
||||
{
|
||||
GTK_PROGRESS_CLASS (GTK_OBJECT (progress)->klass)->update (progress);
|
||||
GTK_PROGRESS_GET_CLASS (progress)->update (progress);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
@ -495,6 +497,8 @@ gtk_progress_configure (GtkProgress *progress,
|
||||
g_return_if_fail (min <= max);
|
||||
g_return_if_fail (value >= min && value <= max);
|
||||
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
adj = progress->adjustment;
|
||||
|
||||
if (fabs (adj->lower - min) > EPSILON || fabs (adj->upper - max) > EPSILON)
|
||||
@ -517,6 +521,8 @@ gtk_progress_set_percentage (GtkProgress *progress,
|
||||
g_return_if_fail (GTK_IS_PROGRESS (progress));
|
||||
g_return_if_fail (percentage >= 0 && percentage <= 1.0);
|
||||
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
gtk_progress_set_value (progress, progress->adjustment->lower + percentage *
|
||||
(progress->adjustment->upper - progress->adjustment->lower));
|
||||
}
|
||||
@ -527,8 +533,11 @@ gtk_progress_get_current_percentage (GtkProgress *progress)
|
||||
g_return_val_if_fail (progress != NULL, 0);
|
||||
g_return_val_if_fail (GTK_IS_PROGRESS (progress), 0);
|
||||
|
||||
return (progress->adjustment->value - progress->adjustment->lower) /
|
||||
(progress->adjustment->upper - progress->adjustment->lower);
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
|
||||
return ((progress->adjustment->value - progress->adjustment->lower) /
|
||||
(progress->adjustment->upper - progress->adjustment->lower));
|
||||
}
|
||||
|
||||
gfloat
|
||||
@ -538,6 +547,9 @@ gtk_progress_get_percentage_from_value (GtkProgress *progress,
|
||||
g_return_val_if_fail (progress != NULL, 0);
|
||||
g_return_val_if_fail (GTK_IS_PROGRESS (progress), 0);
|
||||
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
|
||||
if (value >= progress->adjustment->lower &&
|
||||
value <= progress->adjustment->upper)
|
||||
return (value - progress->adjustment->lower) /
|
||||
@ -553,6 +565,9 @@ gtk_progress_set_value (GtkProgress *progress,
|
||||
g_return_if_fail (progress != NULL);
|
||||
g_return_if_fail (GTK_IS_PROGRESS (progress));
|
||||
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
|
||||
if (fabs (progress->adjustment->value - value) > EPSILON)
|
||||
gtk_adjustment_set_value (progress->adjustment, value);
|
||||
}
|
||||
@ -563,7 +578,7 @@ gtk_progress_get_value (GtkProgress *progress)
|
||||
g_return_val_if_fail (progress != NULL, 0);
|
||||
g_return_val_if_fail (GTK_IS_PROGRESS (progress), 0);
|
||||
|
||||
return progress->adjustment->value;
|
||||
return progress->adjustment ? progress->adjustment->value : 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -626,8 +641,11 @@ gtk_progress_get_current_text (GtkProgress *progress)
|
||||
g_return_val_if_fail (progress != NULL, 0);
|
||||
g_return_val_if_fail (GTK_IS_PROGRESS (progress), 0);
|
||||
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
|
||||
return gtk_progress_build_string (progress, progress->adjustment->value,
|
||||
gtk_progress_get_current_percentage (progress));
|
||||
gtk_progress_get_current_percentage (progress));
|
||||
}
|
||||
|
||||
gchar *
|
||||
@ -637,8 +655,11 @@ gtk_progress_get_text_from_value (GtkProgress *progress,
|
||||
g_return_val_if_fail (progress != NULL, 0);
|
||||
g_return_val_if_fail (GTK_IS_PROGRESS (progress), 0);
|
||||
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
|
||||
return gtk_progress_build_string (progress, value,
|
||||
gtk_progress_get_percentage_from_value (progress, value));
|
||||
gtk_progress_get_percentage_from_value (progress, value));
|
||||
}
|
||||
|
||||
void
|
||||
@ -653,8 +674,7 @@ gtk_progress_set_activity_mode (GtkProgress *progress,
|
||||
progress->activity_mode = (activity_mode != 0);
|
||||
|
||||
if (progress->activity_mode)
|
||||
GTK_PROGRESS_CLASS
|
||||
(GTK_OBJECT (progress)->klass)->act_mode_enter (progress);
|
||||
GTK_PROGRESS_GET_CLASS (progress)->act_mode_enter (progress);
|
||||
|
||||
if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress)))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (progress));
|
||||
|
@ -108,7 +108,7 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
|
||||
|
||||
gtk_object_add_arg_type ("GtkProgressBar::adjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_ADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkProgressBar::orientation",
|
||||
GTK_TYPE_PROGRESS_BAR_ORIENTATION,
|
||||
|
@ -34,8 +34,6 @@ enum {
|
||||
ARG_GROUP
|
||||
};
|
||||
|
||||
#define CHECK_BUTTON_CLASS(w) GTK_CHECK_BUTTON_CLASS (GTK_OBJECT (w)->klass)
|
||||
|
||||
|
||||
static void gtk_radio_button_class_init (GtkRadioButtonClass *klass);
|
||||
static void gtk_radio_button_init (GtkRadioButton *radio_button);
|
||||
@ -409,10 +407,10 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
|
||||
new_area.width, new_area.height);
|
||||
}
|
||||
|
||||
x = widget->allocation.x + CHECK_BUTTON_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
|
||||
y = widget->allocation.y + (widget->allocation.height - CHECK_BUTTON_CLASS (widget)->indicator_size) / 2;
|
||||
width = CHECK_BUTTON_CLASS (widget)->indicator_size;
|
||||
height = CHECK_BUTTON_CLASS (widget)->indicator_size;
|
||||
x = widget->allocation.x + GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_spacing + GTK_CONTAINER (widget)->border_width;
|
||||
y = widget->allocation.y + (widget->allocation.height - GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size) / 2;
|
||||
width = GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size;
|
||||
height = GTK_CHECK_BUTTON_GET_CLASS (widget)->indicator_size;
|
||||
|
||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||
shadow_type = GTK_SHADOW_IN;
|
||||
|
@ -34,7 +34,7 @@
|
||||
#define SCROLL_INITIAL_DELAY 100
|
||||
#define SCROLL_DELAY_LENGTH 300
|
||||
|
||||
#define RANGE_CLASS(w) GTK_RANGE_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
@ -50,7 +50,6 @@ static void gtk_range_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_range_destroy (GtkObject *object);
|
||||
static void gtk_range_finalize (GtkObject *object);
|
||||
static void gtk_range_draw (GtkWidget *widget,
|
||||
GdkRectangle *area);
|
||||
static void gtk_range_draw_focus (GtkWidget *widget);
|
||||
@ -138,15 +137,9 @@ gtk_range_class_init (GtkRangeClass *class)
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_WIDGET);
|
||||
|
||||
gtk_object_add_arg_type ("GtkRange::update_policy",
|
||||
GTK_TYPE_UPDATE_TYPE,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_UPDATE_POLICY);
|
||||
|
||||
object_class->set_arg = gtk_range_set_arg;
|
||||
object_class->get_arg = gtk_range_get_arg;
|
||||
object_class->destroy = gtk_range_destroy;
|
||||
object_class->finalize = gtk_range_finalize;
|
||||
|
||||
widget_class->draw = gtk_range_draw;
|
||||
widget_class->draw_focus = gtk_range_draw_focus;
|
||||
@ -181,6 +174,11 @@ gtk_range_class_init (GtkRangeClass *class)
|
||||
class->trough_keys = NULL;
|
||||
class->motion = NULL;
|
||||
class->timer = gtk_real_range_timer;
|
||||
|
||||
gtk_object_add_arg_type ("GtkRange::update_policy",
|
||||
GTK_TYPE_UPDATE_TYPE,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_UPDATE_POLICY);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -253,6 +251,9 @@ gtk_range_get_adjustment (GtkRange *range)
|
||||
g_return_val_if_fail (range != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (range), NULL);
|
||||
|
||||
if (!range->adjustment)
|
||||
gtk_range_set_adjustment (range, NULL);
|
||||
|
||||
return range->adjustment;
|
||||
}
|
||||
|
||||
@ -573,8 +574,8 @@ gtk_range_default_hmotion (GtkRange *range,
|
||||
gint slider_x, slider_y;
|
||||
gint new_pos;
|
||||
|
||||
g_return_if_fail (range != NULL);
|
||||
g_return_if_fail (GTK_IS_RANGE (range));
|
||||
g_return_if_fail (GTK_WIDGET_REALIZED (range));
|
||||
|
||||
range = GTK_RANGE (range);
|
||||
|
||||
@ -638,8 +639,8 @@ gtk_range_default_vmotion (GtkRange *range,
|
||||
gint slider_x, slider_y;
|
||||
gint new_pos;
|
||||
|
||||
g_return_if_fail (range != NULL);
|
||||
g_return_if_fail (GTK_IS_RANGE (range));
|
||||
g_return_if_fail (GTK_WIDGET_REALIZED (range));
|
||||
|
||||
range = GTK_RANGE (range);
|
||||
|
||||
@ -704,29 +705,19 @@ gtk_range_destroy (GtkObject *object)
|
||||
|
||||
range = GTK_RANGE (object);
|
||||
|
||||
gtk_range_remove_timer (range);
|
||||
if (range->adjustment)
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (range->adjustment),
|
||||
(gpointer) range);
|
||||
{
|
||||
if (range->adjustment)
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (range->adjustment),
|
||||
(gpointer) range);
|
||||
gtk_object_unref (GTK_OBJECT (range->adjustment));
|
||||
range->adjustment = NULL;
|
||||
}
|
||||
|
||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_range_finalize (GtkObject *object)
|
||||
{
|
||||
GtkRange *range;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_RANGE (object));
|
||||
|
||||
range = GTK_RANGE (object);
|
||||
|
||||
if (range->adjustment)
|
||||
gtk_object_unref (GTK_OBJECT (range->adjustment));
|
||||
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_range_draw (GtkWidget *widget,
|
||||
GdkRectangle *area)
|
||||
@ -737,7 +728,7 @@ gtk_range_draw (GtkWidget *widget,
|
||||
g_return_if_fail (GTK_IS_RANGE (widget));
|
||||
g_return_if_fail (area != NULL);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
|
||||
if (GTK_WIDGET_DRAWABLE (widget))
|
||||
{
|
||||
range = GTK_RANGE (widget);
|
||||
|
||||
@ -844,7 +835,6 @@ gtk_range_button_press (GtkWidget *widget,
|
||||
gint trough_part;
|
||||
gfloat jump_perc;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -919,7 +909,6 @@ gtk_range_button_release (GtkWidget *widget,
|
||||
{
|
||||
GtkRange *range;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -976,20 +965,20 @@ gtk_range_scroll_event (GtkWidget *widget,
|
||||
{
|
||||
GtkRange *range;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
range = GTK_RANGE (widget);
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (range)) {
|
||||
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
|
||||
gfloat new_value = adj->value + ((event->direction == GDK_SCROLL_UP) ?
|
||||
-adj->page_increment / 2:
|
||||
adj->page_increment / 2);
|
||||
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
||||
gtk_adjustment_set_value (adj, new_value);
|
||||
}
|
||||
if (GTK_WIDGET_REALIZED (range))
|
||||
{
|
||||
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
|
||||
gfloat new_value = adj->value + ((event->direction == GDK_SCROLL_UP) ?
|
||||
-adj->page_increment / 2:
|
||||
adj->page_increment / 2);
|
||||
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
||||
gtk_adjustment_set_value (adj, new_value);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1002,7 +991,6 @@ gtk_range_motion_notify (GtkWidget *widget,
|
||||
GdkModifierType mods;
|
||||
gint x, y, mask;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -1053,7 +1041,6 @@ gtk_range_key_press (GtkWidget *widget,
|
||||
GtkScrollType scroll = GTK_SCROLL_NONE;
|
||||
GtkTroughType pos = GTK_TROUGH_NONE;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -1110,7 +1097,6 @@ gtk_range_enter_notify (GtkWidget *widget,
|
||||
{
|
||||
GtkRange *range;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -1154,7 +1140,6 @@ gtk_range_leave_notify (GtkWidget *widget,
|
||||
{
|
||||
GtkRange *range;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -1191,7 +1176,6 @@ static gint
|
||||
gtk_range_focus_in (GtkWidget *widget,
|
||||
GdkEventFocus *event)
|
||||
{
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -1205,7 +1189,6 @@ static gint
|
||||
gtk_range_focus_out (GtkWidget *widget,
|
||||
GdkEventFocus *event)
|
||||
{
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
@ -1218,7 +1201,6 @@ gtk_range_focus_out (GtkWidget *widget,
|
||||
static void
|
||||
gtk_real_range_draw_trough (GtkRange *range)
|
||||
{
|
||||
g_return_if_fail (range != NULL);
|
||||
g_return_if_fail (GTK_IS_RANGE (range));
|
||||
|
||||
if (range->trough)
|
||||
@ -1240,7 +1222,6 @@ gtk_real_range_draw_slider (GtkRange *range)
|
||||
{
|
||||
GtkStateType state_type;
|
||||
|
||||
g_return_if_fail (range != NULL);
|
||||
g_return_if_fail (GTK_IS_RANGE (range));
|
||||
|
||||
if (range->slider)
|
||||
@ -1324,7 +1305,6 @@ gtk_range_scroll (GtkRange *range,
|
||||
gfloat new_value;
|
||||
gint return_val;
|
||||
|
||||
g_return_val_if_fail (range != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_RANGE (range), FALSE);
|
||||
|
||||
new_value = range->adjustment->value;
|
||||
@ -1408,7 +1388,6 @@ gtk_range_scroll (GtkRange *range,
|
||||
static void
|
||||
gtk_range_add_timer (GtkRange *range)
|
||||
{
|
||||
g_return_if_fail (range != NULL);
|
||||
g_return_if_fail (GTK_IS_RANGE (range));
|
||||
|
||||
if (!range->timer)
|
||||
@ -1423,7 +1402,6 @@ gtk_range_add_timer (GtkRange *range)
|
||||
static void
|
||||
gtk_range_remove_timer (GtkRange *range)
|
||||
{
|
||||
g_return_if_fail (range != NULL);
|
||||
g_return_if_fail (GTK_IS_RANGE (range));
|
||||
|
||||
if (range->timer)
|
||||
|
@ -226,8 +226,8 @@ gtk_ruler_draw_ticks (GtkRuler *ruler)
|
||||
g_return_if_fail (ruler != NULL);
|
||||
g_return_if_fail (GTK_IS_RULER (ruler));
|
||||
|
||||
if (GTK_RULER_CLASS (GTK_OBJECT (ruler)->klass)->draw_ticks)
|
||||
(* GTK_RULER_CLASS (GTK_OBJECT (ruler)->klass)->draw_ticks) (ruler);
|
||||
if (GTK_RULER_GET_CLASS (ruler)->draw_ticks)
|
||||
GTK_RULER_GET_CLASS (ruler)->draw_ticks (ruler);
|
||||
}
|
||||
|
||||
void
|
||||
@ -236,8 +236,8 @@ gtk_ruler_draw_pos (GtkRuler *ruler)
|
||||
g_return_if_fail (ruler != NULL);
|
||||
g_return_if_fail (GTK_IS_RULER (ruler));
|
||||
|
||||
if (GTK_RULER_CLASS (GTK_OBJECT (ruler)->klass)->draw_pos)
|
||||
(* GTK_RULER_CLASS (GTK_OBJECT (ruler)->klass)->draw_pos) (ruler);
|
||||
if (GTK_RULER_GET_CLASS (ruler)->draw_pos)
|
||||
GTK_RULER_GET_CLASS (ruler)->draw_pos (ruler);
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,8 +29,6 @@
|
||||
#include "gtkscale.h"
|
||||
|
||||
|
||||
#define SCALE_CLASS(w) GTK_SCALE_CLASS (GTK_OBJECT (w)->klass)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_DIGITS,
|
||||
@ -330,8 +328,8 @@ gtk_scale_draw_value (GtkScale *scale)
|
||||
g_return_if_fail (scale != NULL);
|
||||
g_return_if_fail (GTK_IS_SCALE (scale));
|
||||
|
||||
if (SCALE_CLASS (scale)->draw_value)
|
||||
(* SCALE_CLASS (scale)->draw_value) (scale);
|
||||
if (GTK_SCALE_GET_CLASS (scale)->draw_value)
|
||||
GTK_SCALE_GET_CLASS (scale)->draw_value (scale);
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
||||
* under A) at least correspond to the space taken up by its scrollbars.
|
||||
*/
|
||||
|
||||
#define SCROLLBAR_SPACING(w) (GTK_SCROLLED_WINDOW_CLASS (GTK_OBJECT (w)->klass)->scrollbar_spacing)
|
||||
#define SCROLLBAR_SPACING(w) (GTK_SCROLLED_WINDOW_GET_CLASS (w)->scrollbar_spacing)
|
||||
|
||||
#define DEFAULT_SCROLLBAR_SPACING 3
|
||||
|
||||
@ -86,7 +86,7 @@ static void gtk_scrolled_window_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_scrolled_window_destroy (GtkObject *object);
|
||||
static void gtk_scrolled_window_finalize (GtkObject *object);
|
||||
static void gtk_scrolled_window_finalize (GObject *object);
|
||||
static void gtk_scrolled_window_map (GtkWidget *widget);
|
||||
static void gtk_scrolled_window_unmap (GtkWidget *widget);
|
||||
static void gtk_scrolled_window_draw (GtkWidget *widget,
|
||||
@ -141,6 +141,7 @@ gtk_scrolled_window_get_type (void)
|
||||
static void
|
||||
gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkContainerClass *container_class;
|
||||
@ -150,6 +151,25 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
container_class = (GtkContainerClass*) class;
|
||||
parent_class = gtk_type_class (GTK_TYPE_BIN);
|
||||
|
||||
gobject_class->finalize = gtk_scrolled_window_finalize;
|
||||
|
||||
object_class->set_arg = gtk_scrolled_window_set_arg;
|
||||
object_class->get_arg = gtk_scrolled_window_get_arg;
|
||||
object_class->destroy = gtk_scrolled_window_destroy;
|
||||
|
||||
widget_class->map = gtk_scrolled_window_map;
|
||||
widget_class->unmap = gtk_scrolled_window_unmap;
|
||||
widget_class->draw = gtk_scrolled_window_draw;
|
||||
widget_class->size_request = gtk_scrolled_window_size_request;
|
||||
widget_class->size_allocate = gtk_scrolled_window_size_allocate;
|
||||
widget_class->scroll_event = gtk_scrolled_window_scroll_event;
|
||||
|
||||
container_class->add = gtk_scrolled_window_add;
|
||||
container_class->remove = gtk_scrolled_window_remove;
|
||||
container_class->forall = gtk_scrolled_window_forall;
|
||||
|
||||
class->scrollbar_spacing = DEFAULT_SCROLLBAR_SPACING;
|
||||
|
||||
gtk_object_add_arg_type ("GtkScrolledWindow::hadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
@ -170,24 +190,6 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
GTK_TYPE_CORNER_TYPE,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_WINDOW_PLACEMENT);
|
||||
|
||||
object_class->set_arg = gtk_scrolled_window_set_arg;
|
||||
object_class->get_arg = gtk_scrolled_window_get_arg;
|
||||
object_class->destroy = gtk_scrolled_window_destroy;
|
||||
object_class->finalize = gtk_scrolled_window_finalize;
|
||||
|
||||
widget_class->map = gtk_scrolled_window_map;
|
||||
widget_class->unmap = gtk_scrolled_window_unmap;
|
||||
widget_class->draw = gtk_scrolled_window_draw;
|
||||
widget_class->size_request = gtk_scrolled_window_size_request;
|
||||
widget_class->size_allocate = gtk_scrolled_window_size_allocate;
|
||||
widget_class->scroll_event = gtk_scrolled_window_scroll_event;
|
||||
|
||||
container_class->add = gtk_scrolled_window_add;
|
||||
container_class->remove = gtk_scrolled_window_remove;
|
||||
container_class->forall = gtk_scrolled_window_forall;
|
||||
|
||||
class->scrollbar_spacing = DEFAULT_SCROLLBAR_SPACING;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -475,16 +477,14 @@ gtk_scrolled_window_destroy (GtkObject *object)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_finalize (GtkObject *object)
|
||||
gtk_scrolled_window_finalize (GObject *object)
|
||||
{
|
||||
GtkScrolledWindow *scrolled_window;
|
||||
|
||||
scrolled_window = GTK_SCROLLED_WINDOW (object);
|
||||
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (object);
|
||||
|
||||
gtk_widget_unref (scrolled_window->hscrollbar);
|
||||
gtk_widget_unref (scrolled_window->vscrollbar);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -435,7 +435,7 @@ gtk_signal_lookup (const gchar *name,
|
||||
gpointer class = NULL;
|
||||
|
||||
g_return_val_if_fail (name != NULL, 0);
|
||||
g_return_val_if_fail (gtk_type_is_a (object_type, GTK_TYPE_OBJECT), 0);
|
||||
g_return_val_if_fail (GTK_TYPE_IS_OBJECT (object_type), 0);
|
||||
|
||||
relookup:
|
||||
|
||||
@ -1393,7 +1393,7 @@ gtk_signal_real_emit (GtkObject *object,
|
||||
*/
|
||||
signal = *LOOKUP_SIGNAL_ID (signal_id);
|
||||
if (signal.function_offset)
|
||||
signal_func = G_STRUCT_MEMBER (GtkSignalFunc, object->klass, signal.function_offset);
|
||||
signal_func = G_STRUCT_MEMBER (GtkSignalFunc, ((GTypeInstance*) object)->g_class, signal.function_offset);
|
||||
else
|
||||
signal_func = NULL;
|
||||
|
||||
@ -1723,8 +1723,7 @@ gtk_signal_connect_by_type (GtkObject *object,
|
||||
gint found_it;
|
||||
GtkSignal *signal;
|
||||
|
||||
g_return_val_if_fail (object != NULL, 0);
|
||||
g_return_val_if_fail (object->klass != NULL, 0);
|
||||
g_return_val_if_fail (GTK_IS_OBJECT (object), 0);
|
||||
|
||||
signal = LOOKUP_SIGNAL_ID (signal_id);
|
||||
|
||||
@ -1737,7 +1736,7 @@ gtk_signal_connect_by_type (GtkObject *object,
|
||||
* return correct signal ids per class-branch.
|
||||
*/
|
||||
found_it = FALSE;
|
||||
class = object->klass;
|
||||
class = GTK_OBJECT_GET_CLASS (object);
|
||||
while (class)
|
||||
{
|
||||
GtkType parent;
|
||||
@ -1755,9 +1754,9 @@ gtk_signal_connect_by_type (GtkObject *object,
|
||||
break;
|
||||
}
|
||||
|
||||
parent = gtk_type_parent (class->type);
|
||||
if (parent)
|
||||
class = gtk_type_class (parent);
|
||||
parent = g_type_parent (GTK_CLASS_TYPE (class));
|
||||
if (GTK_TYPE_IS_OBJECT (parent))
|
||||
class = g_type_class_peek (parent);
|
||||
else
|
||||
class = NULL;
|
||||
}
|
||||
@ -1766,7 +1765,7 @@ gtk_signal_connect_by_type (GtkObject *object,
|
||||
{
|
||||
g_warning ("gtk_signal_connect_by_type(): could not find signal id (%u) in the `%s' class ancestry",
|
||||
signal_id,
|
||||
gtk_type_name (object->klass->type));
|
||||
GTK_OBJECT_TYPE_NAME (object));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1987,9 +1986,7 @@ gtk_signal_collect_params (GtkArg *params,
|
||||
return_type = GTK_FUNDAMENTAL_TYPE (return_type);
|
||||
if (return_type != GTK_TYPE_NONE)
|
||||
{
|
||||
if ((return_type >= GTK_TYPE_FLAT_FIRST &&
|
||||
return_type <= GTK_TYPE_FLAT_LAST) ||
|
||||
(return_type == GTK_TYPE_OBJECT))
|
||||
if (return_type != 0) // FIXME: check for IS_PARAM
|
||||
{
|
||||
GTK_VALUE_POINTER (*params) = va_arg (var_args, gpointer);
|
||||
|
||||
|
@ -77,18 +77,20 @@ gtk_socket_get_type (void)
|
||||
|
||||
if (!socket_type)
|
||||
{
|
||||
static const GtkTypeInfo socket_info =
|
||||
static const GTypeInfo socket_info =
|
||||
{
|
||||
"GtkSocket",
|
||||
sizeof (GtkSocket),
|
||||
sizeof (GtkSocketClass),
|
||||
(GtkClassInitFunc) gtk_socket_class_init,
|
||||
(GtkObjectInitFunc) gtk_socket_init,
|
||||
(GtkArgSetFunc) NULL,
|
||||
(GtkArgGetFunc) NULL
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) gtk_socket_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (GtkSocket),
|
||||
16, /* n_preallocs */
|
||||
(GInstanceInitFunc) gtk_socket_init,
|
||||
};
|
||||
|
||||
socket_type = gtk_type_unique (GTK_TYPE_CONTAINER, &socket_info);
|
||||
socket_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkSocket", &socket_info);
|
||||
}
|
||||
|
||||
return socket_type;
|
||||
|
@ -69,7 +69,7 @@ enum
|
||||
|
||||
static void gtk_spin_button_class_init (GtkSpinButtonClass *klass);
|
||||
static void gtk_spin_button_init (GtkSpinButton *spin_button);
|
||||
static void gtk_spin_button_finalize (GtkObject *object);
|
||||
static void gtk_spin_button_finalize (GObject *object);
|
||||
static void gtk_spin_button_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
@ -158,6 +158,7 @@ gtk_spin_button_get_type (void)
|
||||
static void
|
||||
gtk_spin_button_class_init (GtkSpinButtonClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkEditableClass *editable_class;
|
||||
@ -168,6 +169,35 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_ENTRY);
|
||||
|
||||
gobject_class->finalize = gtk_spin_button_finalize;
|
||||
|
||||
object_class->set_arg = gtk_spin_button_set_arg;
|
||||
object_class->get_arg = gtk_spin_button_get_arg;
|
||||
|
||||
widget_class->map = gtk_spin_button_map;
|
||||
widget_class->unmap = gtk_spin_button_unmap;
|
||||
widget_class->realize = gtk_spin_button_realize;
|
||||
widget_class->unrealize = gtk_spin_button_unrealize;
|
||||
widget_class->size_request = gtk_spin_button_size_request;
|
||||
widget_class->size_allocate = gtk_spin_button_size_allocate;
|
||||
widget_class->draw = gtk_spin_button_draw;
|
||||
widget_class->expose_event = gtk_spin_button_expose;
|
||||
widget_class->scroll_event = gtk_spin_button_scroll;
|
||||
widget_class->button_press_event = gtk_spin_button_button_press;
|
||||
widget_class->button_release_event = gtk_spin_button_button_release;
|
||||
widget_class->motion_notify_event = gtk_spin_button_motion_notify;
|
||||
widget_class->key_press_event = gtk_spin_button_key_press;
|
||||
widget_class->key_release_event = gtk_spin_button_key_release;
|
||||
widget_class->enter_notify_event = gtk_spin_button_enter_notify;
|
||||
widget_class->leave_notify_event = gtk_spin_button_leave_notify;
|
||||
widget_class->focus_out_event = gtk_spin_button_focus_out;
|
||||
|
||||
editable_class->insert_text = gtk_spin_button_insert_text;
|
||||
editable_class->activate = gtk_spin_button_activate;
|
||||
|
||||
class->input = NULL;
|
||||
class->output = NULL;
|
||||
|
||||
gtk_object_add_arg_type ("GtkSpinButton::adjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE,
|
||||
@ -205,14 +235,10 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_VALUE);
|
||||
|
||||
object_class->set_arg = gtk_spin_button_set_arg;
|
||||
object_class->get_arg = gtk_spin_button_get_arg;
|
||||
object_class->finalize = gtk_spin_button_finalize;
|
||||
|
||||
spinbutton_signals[INPUT] =
|
||||
gtk_signal_new ("input",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkSpinButtonClass, input),
|
||||
gtk_marshal_INT__POINTER,
|
||||
GTK_TYPE_INT, 1, GTK_TYPE_POINTER);
|
||||
@ -220,36 +246,12 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
|
||||
spinbutton_signals[OUTPUT] =
|
||||
gtk_signal_new ("output",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkSpinButtonClass, output),
|
||||
gtk_marshal_BOOL__NONE,
|
||||
GTK_TYPE_BOOL, 0);
|
||||
|
||||
gtk_object_class_add_signals (object_class, spinbutton_signals, LAST_SIGNAL);
|
||||
|
||||
widget_class->map = gtk_spin_button_map;
|
||||
widget_class->unmap = gtk_spin_button_unmap;
|
||||
widget_class->realize = gtk_spin_button_realize;
|
||||
widget_class->unrealize = gtk_spin_button_unrealize;
|
||||
widget_class->size_request = gtk_spin_button_size_request;
|
||||
widget_class->size_allocate = gtk_spin_button_size_allocate;
|
||||
widget_class->draw = gtk_spin_button_draw;
|
||||
widget_class->expose_event = gtk_spin_button_expose;
|
||||
widget_class->scroll_event = gtk_spin_button_scroll;
|
||||
widget_class->button_press_event = gtk_spin_button_button_press;
|
||||
widget_class->button_release_event = gtk_spin_button_button_release;
|
||||
widget_class->motion_notify_event = gtk_spin_button_motion_notify;
|
||||
widget_class->key_press_event = gtk_spin_button_key_press;
|
||||
widget_class->key_release_event = gtk_spin_button_key_release;
|
||||
widget_class->enter_notify_event = gtk_spin_button_enter_notify;
|
||||
widget_class->leave_notify_event = gtk_spin_button_leave_notify;
|
||||
widget_class->focus_out_event = gtk_spin_button_focus_out;
|
||||
|
||||
editable_class->insert_text = gtk_spin_button_insert_text;
|
||||
editable_class->activate = gtk_spin_button_activate;
|
||||
|
||||
class->input = NULL;
|
||||
class->output = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -375,14 +377,13 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_spin_button_finalize (GtkObject *object)
|
||||
gtk_spin_button_finalize (GObject *object)
|
||||
{
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_SPIN_BUTTON (object));
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (GTK_SPIN_BUTTON (object)->adjustment));
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1408,7 +1409,6 @@ void
|
||||
gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
|
||||
GtkAdjustment *adjustment)
|
||||
{
|
||||
g_return_if_fail (spin_button != NULL);
|
||||
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
|
||||
|
||||
if (spin_button->adjustment != adjustment)
|
||||
|
@ -41,7 +41,6 @@ enum
|
||||
static void gtk_statusbar_class_init (GtkStatusbarClass *class);
|
||||
static void gtk_statusbar_init (GtkStatusbar *statusbar);
|
||||
static void gtk_statusbar_destroy (GtkObject *object);
|
||||
static void gtk_statusbar_finalize (GtkObject *object);
|
||||
static void gtk_statusbar_update (GtkStatusbar *statusbar,
|
||||
guint context_id,
|
||||
const gchar *text);
|
||||
@ -86,29 +85,8 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
|
||||
container_class = (GtkContainerClass *) class;
|
||||
|
||||
parent_class = gtk_type_class (GTK_TYPE_HBOX);
|
||||
|
||||
statusbar_signals[SIGNAL_TEXT_PUSHED] =
|
||||
gtk_signal_new ("text_pushed",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_pushed),
|
||||
gtk_marshal_NONE__UINT_STRING,
|
||||
GTK_TYPE_NONE, 2,
|
||||
GTK_TYPE_UINT,
|
||||
GTK_TYPE_STRING);
|
||||
statusbar_signals[SIGNAL_TEXT_POPPED] =
|
||||
gtk_signal_new ("text_popped",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_popped),
|
||||
gtk_marshal_NONE__UINT_STRING,
|
||||
GTK_TYPE_NONE, 2,
|
||||
GTK_TYPE_UINT,
|
||||
GTK_TYPE_STRING);
|
||||
gtk_object_class_add_signals (object_class, statusbar_signals, SIGNAL_LAST);
|
||||
|
||||
object_class->destroy = gtk_statusbar_destroy;
|
||||
object_class->finalize = gtk_statusbar_finalize;
|
||||
|
||||
class->messages_mem_chunk = g_mem_chunk_new ("GtkStatusBar messages mem chunk",
|
||||
sizeof (GtkStatusbarMsg),
|
||||
@ -117,6 +95,26 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
|
||||
|
||||
class->text_pushed = gtk_statusbar_update;
|
||||
class->text_popped = gtk_statusbar_update;
|
||||
|
||||
statusbar_signals[SIGNAL_TEXT_PUSHED] =
|
||||
gtk_signal_new ("text_pushed",
|
||||
GTK_RUN_LAST,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_pushed),
|
||||
gtk_marshal_NONE__UINT_STRING,
|
||||
GTK_TYPE_NONE, 2,
|
||||
GTK_TYPE_UINT,
|
||||
GTK_TYPE_STRING);
|
||||
statusbar_signals[SIGNAL_TEXT_POPPED] =
|
||||
gtk_signal_new ("text_popped",
|
||||
GTK_RUN_LAST,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkStatusbarClass, text_popped),
|
||||
gtk_marshal_NONE__UINT_STRING,
|
||||
GTK_TYPE_NONE, 2,
|
||||
GTK_TYPE_UINT,
|
||||
GTK_TYPE_STRING);
|
||||
gtk_object_class_add_signals (object_class, statusbar_signals, SIGNAL_LAST);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -206,7 +204,7 @@ gtk_statusbar_push (GtkStatusbar *statusbar,
|
||||
g_return_val_if_fail (text != NULL, 0);
|
||||
g_return_val_if_fail (context_id > 0, 0);
|
||||
|
||||
class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass);
|
||||
class = GTK_STATUSBAR_GET_CLASS (statusbar);
|
||||
msg = g_chunk_new (GtkStatusbarMsg, class->messages_mem_chunk);
|
||||
msg->text = g_strdup (text);
|
||||
msg->context_id = context_id;
|
||||
@ -244,7 +242,7 @@ gtk_statusbar_pop (GtkStatusbar *statusbar,
|
||||
{
|
||||
GtkStatusbarClass *class;
|
||||
|
||||
class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass);
|
||||
class = GTK_STATUSBAR_GET_CLASS (statusbar);
|
||||
|
||||
statusbar->messages = g_slist_remove_link (statusbar->messages,
|
||||
list);
|
||||
@ -298,7 +296,7 @@ gtk_statusbar_remove (GtkStatusbar *statusbar,
|
||||
{
|
||||
GtkStatusbarClass *class;
|
||||
|
||||
class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass);
|
||||
class = GTK_STATUSBAR_GET_CLASS (statusbar);
|
||||
statusbar->messages = g_slist_remove_link (statusbar->messages, list);
|
||||
g_free (msg->text);
|
||||
g_mem_chunk_free (class->messages_mem_chunk, msg);
|
||||
@ -321,7 +319,7 @@ gtk_statusbar_destroy (GtkObject *object)
|
||||
g_return_if_fail (GTK_IS_STATUSBAR (object));
|
||||
|
||||
statusbar = GTK_STATUSBAR (object);
|
||||
class = GTK_STATUSBAR_CLASS (GTK_OBJECT (statusbar)->klass);
|
||||
class = GTK_STATUSBAR_GET_CLASS (statusbar);
|
||||
|
||||
for (list = statusbar->messages; list; list = list->next)
|
||||
{
|
||||
@ -341,16 +339,3 @@ gtk_statusbar_destroy (GtkObject *object)
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_statusbar_finalize (GtkObject *object)
|
||||
{
|
||||
GtkStatusbar *statusbar;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_STATUSBAR (object));
|
||||
|
||||
statusbar = GTK_STATUSBAR (object);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ enum
|
||||
|
||||
static void gtk_table_class_init (GtkTableClass *klass);
|
||||
static void gtk_table_init (GtkTable *table);
|
||||
static void gtk_table_finalize (GtkObject *object);
|
||||
static void gtk_table_finalize (GObject *object);
|
||||
static void gtk_table_map (GtkWidget *widget);
|
||||
static void gtk_table_unmap (GtkWidget *widget);
|
||||
static void gtk_table_draw (GtkWidget *widget,
|
||||
@ -129,6 +129,7 @@ gtk_table_get_type (void)
|
||||
static void
|
||||
gtk_table_class_init (GtkTableClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkContainerClass *container_class;
|
||||
@ -138,24 +139,11 @@ gtk_table_class_init (GtkTableClass *class)
|
||||
container_class = (GtkContainerClass*) class;
|
||||
|
||||
parent_class = gtk_type_class (gtk_container_get_type ());
|
||||
|
||||
gtk_object_add_arg_type ("GtkTable::n_rows", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_N_ROWS);
|
||||
gtk_object_add_arg_type ("GtkTable::n_columns", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_N_COLUMNS);
|
||||
gtk_object_add_arg_type ("GtkTable::row_spacing", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_ROW_SPACING);
|
||||
gtk_object_add_arg_type ("GtkTable::column_spacing", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_COLUMN_SPACING);
|
||||
gtk_object_add_arg_type ("GtkTable::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
|
||||
gtk_container_add_child_arg_type ("GtkTable::left_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_LEFT_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::right_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_RIGHT_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::top_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_TOP_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::bottom_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_BOTTOM_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::x_options", GTK_TYPE_ATTACH_OPTIONS, GTK_ARG_READWRITE, CHILD_ARG_X_OPTIONS);
|
||||
gtk_container_add_child_arg_type ("GtkTable::y_options", GTK_TYPE_ATTACH_OPTIONS, GTK_ARG_READWRITE, CHILD_ARG_Y_OPTIONS);
|
||||
gtk_container_add_child_arg_type ("GtkTable::x_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_X_PADDING);
|
||||
gtk_container_add_child_arg_type ("GtkTable::y_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_Y_PADDING);
|
||||
|
||||
gobject_class->finalize = gtk_table_finalize;
|
||||
|
||||
object_class->get_arg = gtk_table_get_arg;
|
||||
object_class->set_arg = gtk_table_set_arg;
|
||||
object_class->finalize = gtk_table_finalize;
|
||||
|
||||
widget_class->map = gtk_table_map;
|
||||
widget_class->unmap = gtk_table_unmap;
|
||||
@ -170,6 +158,20 @@ gtk_table_class_init (GtkTableClass *class)
|
||||
container_class->child_type = gtk_table_child_type;
|
||||
container_class->set_child_arg = gtk_table_set_child_arg;
|
||||
container_class->get_child_arg = gtk_table_get_child_arg;
|
||||
|
||||
gtk_object_add_arg_type ("GtkTable::n_rows", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_N_ROWS);
|
||||
gtk_object_add_arg_type ("GtkTable::n_columns", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_N_COLUMNS);
|
||||
gtk_object_add_arg_type ("GtkTable::row_spacing", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_ROW_SPACING);
|
||||
gtk_object_add_arg_type ("GtkTable::column_spacing", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_COLUMN_SPACING);
|
||||
gtk_object_add_arg_type ("GtkTable::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
|
||||
gtk_container_add_child_arg_type ("GtkTable::left_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_LEFT_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::right_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_RIGHT_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::top_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_TOP_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::bottom_attach", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_BOTTOM_ATTACH);
|
||||
gtk_container_add_child_arg_type ("GtkTable::x_options", GTK_TYPE_ATTACH_OPTIONS, GTK_ARG_READWRITE, CHILD_ARG_X_OPTIONS);
|
||||
gtk_container_add_child_arg_type ("GtkTable::y_options", GTK_TYPE_ATTACH_OPTIONS, GTK_ARG_READWRITE, CHILD_ARG_Y_OPTIONS);
|
||||
gtk_container_add_child_arg_type ("GtkTable::x_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_X_PADDING);
|
||||
gtk_container_add_child_arg_type ("GtkTable::y_padding", GTK_TYPE_UINT, GTK_ARG_READWRITE, CHILD_ARG_Y_PADDING);
|
||||
}
|
||||
|
||||
static GtkType
|
||||
@ -655,11 +657,10 @@ gtk_table_set_homogeneous (GtkTable *table,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_table_finalize (GtkObject *object)
|
||||
gtk_table_finalize (GObject *object)
|
||||
{
|
||||
GtkTable *table;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_TABLE (object));
|
||||
|
||||
table = GTK_TABLE (object);
|
||||
@ -667,7 +668,7 @@ gtk_table_finalize (GtkObject *object)
|
||||
g_free (table->rows);
|
||||
g_free (table->cols);
|
||||
|
||||
(* GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -202,7 +202,7 @@ static void gtk_text_get_arg (GtkObject *object,
|
||||
guint arg_id);
|
||||
static void gtk_text_init (GtkText *text);
|
||||
static void gtk_text_destroy (GtkObject *object);
|
||||
static void gtk_text_finalize (GtkObject *object);
|
||||
static void gtk_text_finalize (GObject *object);
|
||||
static void gtk_text_realize (GtkWidget *widget);
|
||||
static void gtk_text_unrealize (GtkWidget *widget);
|
||||
static void gtk_text_style_set (GtkWidget *widget,
|
||||
@ -534,6 +534,7 @@ gtk_text_get_type (void)
|
||||
static void
|
||||
gtk_text_class_init (GtkTextClass *class)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkEditableClass *editable_class;
|
||||
@ -543,27 +544,11 @@ gtk_text_class_init (GtkTextClass *class)
|
||||
editable_class = (GtkEditableClass*) class;
|
||||
parent_class = gtk_type_class (GTK_TYPE_EDITABLE);
|
||||
|
||||
gtk_object_add_arg_type ("GtkText::hadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_HADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkText::vadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_VADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkText::line_wrap",
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_LINE_WRAP);
|
||||
gtk_object_add_arg_type ("GtkText::word_wrap",
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_WORD_WRAP);
|
||||
gobject_class->finalize = gtk_text_finalize;
|
||||
|
||||
object_class->set_arg = gtk_text_set_arg;
|
||||
object_class->get_arg = gtk_text_get_arg;
|
||||
object_class->destroy = gtk_text_destroy;
|
||||
object_class->finalize = gtk_text_finalize;
|
||||
|
||||
widget_class->realize = gtk_text_realize;
|
||||
widget_class->unrealize = gtk_text_unrealize;
|
||||
@ -580,14 +565,6 @@ gtk_text_class_init (GtkTextClass *class)
|
||||
widget_class->key_press_event = gtk_text_key_press;
|
||||
widget_class->focus_in_event = gtk_text_focus_in;
|
||||
widget_class->focus_out_event = gtk_text_focus_out;
|
||||
|
||||
widget_class->set_scroll_adjustments_signal =
|
||||
gtk_signal_new ("set_scroll_adjustments",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkTextClass, set_scroll_adjustments),
|
||||
gtk_marshal_NONE__POINTER_POINTER,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
|
||||
|
||||
editable_class->set_editable = gtk_text_real_set_editable;
|
||||
editable_class->insert_text = gtk_text_insert_text;
|
||||
@ -609,6 +586,31 @@ gtk_text_class_init (GtkTextClass *class)
|
||||
editable_class->set_position = gtk_text_set_position;
|
||||
|
||||
class->set_scroll_adjustments = gtk_text_set_adjustments;
|
||||
|
||||
gtk_object_add_arg_type ("GtkText::hadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_HADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkText::vadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_VADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkText::line_wrap",
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_LINE_WRAP);
|
||||
gtk_object_add_arg_type ("GtkText::word_wrap",
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_WORD_WRAP);
|
||||
|
||||
widget_class->set_scroll_adjustments_signal =
|
||||
gtk_signal_new ("set_scroll_adjustments",
|
||||
GTK_RUN_LAST,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTextClass, set_scroll_adjustments),
|
||||
gtk_marshal_NONE__POINTER_POINTER,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -721,6 +723,7 @@ gtk_text_init (GtkText *text)
|
||||
|
||||
GTK_EDITABLE (text)->editable = FALSE;
|
||||
|
||||
gtk_text_set_adjustments (text, NULL, NULL);
|
||||
gtk_editable_set_position (GTK_EDITABLE (text), 0);
|
||||
}
|
||||
|
||||
@ -1200,13 +1203,22 @@ gtk_text_destroy (GtkObject *object)
|
||||
{
|
||||
GtkText *text;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_TEXT (object));
|
||||
|
||||
text = (GtkText*) object;
|
||||
text = GTK_TEXT (object);
|
||||
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (text->hadj), text);
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (text->vadj), text);
|
||||
if (text->hadj)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (text->hadj), text);
|
||||
gtk_object_unref (GTK_OBJECT (text->hadj));
|
||||
text->hadj = NULL;
|
||||
}
|
||||
if (text->vadj)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (text->vadj), text);
|
||||
gtk_object_unref (GTK_OBJECT (text->vadj));
|
||||
text->vadj = NULL;
|
||||
}
|
||||
|
||||
if (text->timer)
|
||||
{
|
||||
@ -1218,18 +1230,14 @@ gtk_text_destroy (GtkObject *object)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_text_finalize (GtkObject *object)
|
||||
gtk_text_finalize (GObject *object)
|
||||
{
|
||||
GtkText *text;
|
||||
GList *tmp_list;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_TEXT (object));
|
||||
|
||||
text = (GtkText *)object;
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (text->hadj));
|
||||
gtk_object_unref (GTK_OBJECT (text->vadj));
|
||||
text = GTK_TEXT (object);
|
||||
|
||||
/* Clean up the internal structures */
|
||||
if (text->use_wchar)
|
||||
@ -1262,7 +1270,7 @@ gtk_text_finalize (GtkObject *object)
|
||||
|
||||
g_list_free (text->tab_stops);
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -125,21 +125,21 @@ gtk_tips_query_class_init (GtkTipsQueryClass *class)
|
||||
tips_query_signals[SIGNAL_START_QUERY] =
|
||||
gtk_signal_new ("start_query",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTipsQueryClass, start_query),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
tips_query_signals[SIGNAL_STOP_QUERY] =
|
||||
gtk_signal_new ("stop_query",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTipsQueryClass, stop_query),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
tips_query_signals[SIGNAL_WIDGET_ENTERED] =
|
||||
gtk_signal_new ("widget_entered",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTipsQueryClass, widget_entered),
|
||||
gtk_marshal_NONE__POINTER_STRING_STRING,
|
||||
GTK_TYPE_NONE, 3,
|
||||
@ -149,7 +149,7 @@ gtk_tips_query_class_init (GtkTipsQueryClass *class)
|
||||
tips_query_signals[SIGNAL_WIDGET_SELECTED] =
|
||||
gtk_signal_new ("widget_selected",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTipsQueryClass, widget_selected),
|
||||
gtk_marshal_BOOL__POINTER_STRING_STRING_POINTER,
|
||||
GTK_TYPE_BOOL, 4,
|
||||
|
@ -122,7 +122,7 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
|
||||
toggle_button_signals[TOGGLED] =
|
||||
gtk_signal_new ("toggled",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkToggleButtonClass, toggled),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
@ -143,7 +143,7 @@ gtk_toolbar_class_init (GtkToolbarClass *class)
|
||||
toolbar_signals[ORIENTATION_CHANGED] =
|
||||
gtk_signal_new ("orientation_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkToolbarClass, orientation_changed),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -151,7 +151,7 @@ gtk_toolbar_class_init (GtkToolbarClass *class)
|
||||
toolbar_signals[STYLE_CHANGED] =
|
||||
gtk_signal_new ("style_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkToolbarClass, style_changed),
|
||||
gtk_marshal_NONE__INT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -290,8 +290,11 @@ gtk_toolbar_destroy (GtkObject *object)
|
||||
|
||||
toolbar = GTK_TOOLBAR (object);
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (toolbar->tooltips));
|
||||
toolbar->tooltips = NULL;
|
||||
if (toolbar->tooltips)
|
||||
{
|
||||
gtk_object_unref (GTK_OBJECT (toolbar->tooltips));
|
||||
toolbar->tooltips = NULL;
|
||||
}
|
||||
|
||||
for (children = toolbar->children; children; children = children->next)
|
||||
{
|
||||
@ -309,12 +312,10 @@ gtk_toolbar_destroy (GtkObject *object)
|
||||
|
||||
g_free (child);
|
||||
}
|
||||
|
||||
g_list_free (toolbar->children);
|
||||
toolbar->children = NULL;
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -115,14 +115,14 @@ gtk_tree_class_init (GtkTreeClass *class)
|
||||
tree_signals[SELECTION_CHANGED] =
|
||||
gtk_signal_new ("selection_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTreeClass, selection_changed),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
tree_signals[SELECT_CHILD] =
|
||||
gtk_signal_new ("select_child",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTreeClass, select_child),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -130,7 +130,7 @@ gtk_tree_class_init (GtkTreeClass *class)
|
||||
tree_signals[UNSELECT_CHILD] =
|
||||
gtk_signal_new ("unselect_child",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTreeClass, unselect_child),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
|
@ -145,14 +145,14 @@ gtk_tree_item_class_init (GtkTreeItemClass *class)
|
||||
tree_item_signals[EXPAND_TREE] =
|
||||
gtk_signal_new ("expand",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTreeItemClass, expand),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
tree_item_signals[COLLAPSE_TREE] =
|
||||
gtk_signal_new ("collapse",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTreeItemClass, collapse),
|
||||
gtk_marshal_NONE__NONE,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
1132
gtk/gtktypeutils.c
1132
gtk/gtktypeutils.c
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
@ -28,7 +28,7 @@
|
||||
#define __GTK_TYPE_UTILS_H__
|
||||
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -37,168 +37,91 @@ extern "C" {
|
||||
|
||||
|
||||
/* Fundamental Types
|
||||
* many of these are just aliases for GLib types to maintain
|
||||
* compatibility
|
||||
*/
|
||||
typedef enum
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
GTK_TYPE_INVALID,
|
||||
GTK_TYPE_NONE,
|
||||
|
||||
/* flat types */
|
||||
GTK_TYPE_CHAR,
|
||||
GTK_TYPE_UCHAR,
|
||||
GTK_TYPE_BOOL,
|
||||
GTK_TYPE_INT,
|
||||
GTK_TYPE_UINT,
|
||||
GTK_TYPE_LONG,
|
||||
GTK_TYPE_ULONG,
|
||||
GTK_TYPE_FLOAT,
|
||||
GTK_TYPE_DOUBLE,
|
||||
GTK_TYPE_STRING,
|
||||
GTK_TYPE_ENUM,
|
||||
GTK_TYPE_FLAGS,
|
||||
GTK_TYPE_BOXED,
|
||||
GTK_TYPE_POINTER,
|
||||
|
||||
/* structured types */
|
||||
GTK_TYPE_SIGNAL,
|
||||
GTK_TYPE_ARGS,
|
||||
GTK_TYPE_CALLBACK,
|
||||
GTK_TYPE_C_CALLBACK,
|
||||
GTK_TYPE_FOREIGN,
|
||||
|
||||
/* base type node of the object system */
|
||||
GTK_TYPE_OBJECT
|
||||
GTK_TYPE_INVALID = G_TYPE_INVALID,
|
||||
GTK_TYPE_NONE = G_TYPE_NONE,
|
||||
GTK_TYPE_ENUM = G_TYPE_ENUM,
|
||||
GTK_TYPE_FLAGS = G_TYPE_FLAGS,
|
||||
|
||||
/* GtkArg types */
|
||||
GTK_TYPE_CHAR = G_TYPE_GTK_CHAR,
|
||||
GTK_TYPE_UCHAR = G_TYPE_GTK_UCHAR,
|
||||
GTK_TYPE_BOOL = G_TYPE_GTK_BOOL,
|
||||
GTK_TYPE_INT = G_TYPE_GTK_INT,
|
||||
GTK_TYPE_UINT = G_TYPE_GTK_UINT,
|
||||
GTK_TYPE_LONG = G_TYPE_GTK_LONG,
|
||||
GTK_TYPE_ULONG = G_TYPE_GTK_ULONG,
|
||||
GTK_TYPE_FLOAT = G_TYPE_GTK_FLOAT,
|
||||
GTK_TYPE_DOUBLE = G_TYPE_GTK_DOUBLE,
|
||||
GTK_TYPE_STRING = G_TYPE_GTK_STRING,
|
||||
GTK_TYPE_BOXED = G_TYPE_GTK_BOXED,
|
||||
GTK_TYPE_POINTER = G_TYPE_GTK_POINTER,
|
||||
GTK_TYPE_SIGNAL = G_TYPE_GTK_SIGNAL
|
||||
} GtkFundamentalType;
|
||||
|
||||
/* bounds definitions for type sets, these are provided to distinct
|
||||
* between fundamental types with if() statements, and to build
|
||||
* up foreign fundamentals
|
||||
|
||||
/* --- type macros --- */
|
||||
#define GTK_CLASS_NAME(class) (g_type_name (G_TYPE_FROM_CLASS (class)))
|
||||
#define GTK_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
|
||||
#define GTK_TYPE_IS_OBJECT(type) (g_type_is_a ((type), GTK_TYPE_OBJECT))
|
||||
|
||||
|
||||
/* outdated macros that really shouldn't e used anymore,
|
||||
* use the GLib type system instead
|
||||
*/
|
||||
#define GTK_TYPE_FLAT_FIRST GTK_TYPE_CHAR
|
||||
#define GTK_TYPE_FLAT_LAST GTK_TYPE_POINTER
|
||||
#define GTK_TYPE_STRUCTURED_FIRST GTK_TYPE_SIGNAL
|
||||
#define GTK_TYPE_STRUCTURED_LAST GTK_TYPE_FOREIGN
|
||||
#define GTK_TYPE_FUNDAMENTAL_LAST GTK_TYPE_OBJECT
|
||||
#define GTK_TYPE_FUNDAMENTAL_MAX (32)
|
||||
#ifndef GTK_DISABLE_COMPAT_H
|
||||
#define GTK_TYPE_FUNDAMENTAL_LAST (G_TYPE_LAST_RESERVED_FUNDAMENTAL - 1)
|
||||
#define GTK_TYPE_FUNDAMENTAL_MAX (G_TYPE_FUNDAMENTAL_MAX)
|
||||
#endif /* GTK_DISABLE_COMPAT_H */
|
||||
|
||||
/* glib macro wrappers (compatibility) */
|
||||
#define GTK_STRUCT_OFFSET G_STRUCT_OFFSET
|
||||
#define GTK_CHECK_CAST G_TYPE_CHECK_INSTANCE_CAST
|
||||
#define GTK_CHECK_CLASS_CAST G_TYPE_CHECK_CLASS_CAST
|
||||
#define GTK_CHECK_GET_CLASS G_TYPE_INSTANCE_GET_CLASS
|
||||
#define GTK_CHECK_TYPE G_TYPE_CHECK_INSTANCE_TYPE
|
||||
#define GTK_CHECK_CLASS_TYPE G_TYPE_CHECK_CLASS_TYPE
|
||||
#define GTK_FUNDAMENTAL_TYPE G_TYPE_FUNDAMENTAL
|
||||
|
||||
/* retrive a structure offset */
|
||||
#ifdef offsetof
|
||||
#define GTK_STRUCT_OFFSET(struct, field) ((gint) offsetof (struct, field))
|
||||
#else /* !offsetof */
|
||||
#define GTK_STRUCT_OFFSET(struct, field) ((gint) ((gchar*) &((struct*) 0)->field))
|
||||
#endif /* !offsetof */
|
||||
|
||||
|
||||
/* The debugging versions of the casting macros make sure the cast is "ok"
|
||||
* before proceeding, but they are definately slower than their less
|
||||
* careful counterparts as they involve extra ``is a'' checks.
|
||||
*/
|
||||
#ifdef GTK_NO_CHECK_CASTS
|
||||
# define GTK_CHECK_CAST(tobj, cast_type, cast) ((cast*) (tobj))
|
||||
# define GTK_CHECK_CLASS_CAST(tclass,cast_type,cast) ((cast*) (tclass))
|
||||
#else /* !GTK_NO_CHECK_CASTS */
|
||||
# define GTK_CHECK_CAST(tobj, cast_type, cast) \
|
||||
((cast*) gtk_type_check_object_cast ((GtkTypeObject*) (tobj), (cast_type)))
|
||||
# define GTK_CHECK_CLASS_CAST(tclass,cast_type,cast) \
|
||||
((cast*) gtk_type_check_class_cast ((GtkTypeClass*) (tclass), (cast_type)))
|
||||
#endif /* GTK_NO_CHECK_CASTS */
|
||||
#define GTK_CHECK_GET_CLASS(obj,type,klass) ((klass*) (((GtkTypeObject*) (obj))->klass))
|
||||
|
||||
/* Determines whether `type_object' and `type_class' are a type of `otype'.
|
||||
*/
|
||||
#define GTK_CHECK_TYPE(type_object, otype) ( \
|
||||
((GtkTypeObject*) (type_object)) != NULL && \
|
||||
GTK_CHECK_CLASS_TYPE (((GtkTypeObject*) (type_object))->klass, (otype)) \
|
||||
)
|
||||
#define GTK_CHECK_CLASS_TYPE(type_class, otype) ( \
|
||||
((GtkTypeClass*) (type_class)) != NULL && \
|
||||
gtk_type_is_a (((GtkTypeClass*) (type_class))->type, (otype)) \
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
/* A GtkType holds a unique type id
|
||||
*/
|
||||
typedef guint GtkType;
|
||||
|
||||
typedef struct _GtkTypeObject GtkTypeObject;
|
||||
typedef struct _GtkTypeClass GtkTypeClass;
|
||||
/* glib type wrappers (compatibility) */
|
||||
typedef GType GtkType;
|
||||
typedef GTypeInstance GtkTypeObject;
|
||||
typedef GTypeClass GtkTypeClass;
|
||||
typedef GBaseInitFunc GtkClassInitFunc;
|
||||
typedef GInstanceInitFunc GtkObjectInitFunc;
|
||||
|
||||
|
||||
/* Builtin Types
|
||||
*/
|
||||
#include <gtk/gtktypebuiltins.h>
|
||||
|
||||
#define GTK_TYPE_IDENTIFIER (gtk_identifier_get_type ())
|
||||
GtkType gtk_identifier_get_type (void);
|
||||
|
||||
/* Macros
|
||||
/* --- typedefs --- */
|
||||
/* here we come with some necessary forward declarations for structures and
|
||||
* provide some fundamental function signatures
|
||||
*/
|
||||
#define GTK_TYPE_MAKE(parent_t, seqno) (((seqno) << 8) | GTK_FUNDAMENTAL_TYPE (parent_t))
|
||||
#define GTK_FUNDAMENTAL_TYPE(type) ((GtkFundamentalType) ((type) & 0xFF))
|
||||
#define GTK_TYPE_SEQNO(type) ((type) > 0xFF ? (type) >> 8 : (type))
|
||||
|
||||
typedef struct _GtkArg GtkArg;
|
||||
typedef struct _GtkObject GtkObject; /* forward declaration of object type */
|
||||
typedef struct _GtkTypeInfo GtkTypeInfo;
|
||||
typedef struct _GtkTypeQuery GtkTypeQuery;
|
||||
typedef struct _GtkEnumValue GtkEnumValue;
|
||||
typedef struct _GtkEnumValue GtkFlagValue;
|
||||
|
||||
|
||||
#define GTK_SIGNAL_FUNC(f) ((GtkSignalFunc) f)
|
||||
|
||||
typedef void (*GtkClassInitFunc) (gpointer klass);
|
||||
typedef void (*GtkObjectInitFunc) (gpointer object,
|
||||
gpointer klass);
|
||||
typedef void (*GtkSignalFunc) ();
|
||||
typedef gint (*GtkFunction) (gpointer data);
|
||||
typedef void (*GtkDestroyNotify) (gpointer data);
|
||||
typedef void (*GtkCallbackMarshal) (GtkObject *object,
|
||||
gpointer data,
|
||||
guint n_args,
|
||||
GtkArg *args);
|
||||
typedef void (*GtkSignalMarshaller) (GtkObject *object,
|
||||
GtkSignalFunc func,
|
||||
gpointer func_data,
|
||||
GtkArg *args);
|
||||
|
||||
/* deprecated */
|
||||
typedef void (*GtkArgGetFunc) (GtkObject*, GtkArg*, guint);
|
||||
typedef void (*GtkArgSetFunc) (GtkObject*, GtkArg*, guint);
|
||||
|
||||
|
||||
/* A GtkTypeObject defines the minimum structure requirements
|
||||
* for type instances. Type instances returned from gtk_type_new ()
|
||||
* and initialized through a GtkObjectInitFunc need to directly inherit
|
||||
* from this structure or at least copy its fields one by one.
|
||||
*/
|
||||
struct _GtkTypeObject
|
||||
{
|
||||
/* A pointer to the objects class. This will actually point to
|
||||
* the derived objects class struct (which will be derived from
|
||||
* GtkTypeClass).
|
||||
*/
|
||||
GtkTypeClass *klass;
|
||||
};
|
||||
|
||||
|
||||
/* A GtkTypeClass defines the minimum structure requirements for
|
||||
* a types class. Classes returned from gtk_type_class () and
|
||||
* initialized through a GtkClassInitFunc need to directly inherit
|
||||
* from this structure or at least copy its fields one by one.
|
||||
*/
|
||||
struct _GtkTypeClass
|
||||
{
|
||||
/* The type identifier for the objects class. There is
|
||||
* one unique identifier per class.
|
||||
*/
|
||||
GtkType type;
|
||||
};
|
||||
typedef struct _GtkArg GtkArg;
|
||||
typedef struct _GtkObject GtkObject; /* object forward declaration */
|
||||
typedef struct _GtkTypeInfo GtkTypeInfo;
|
||||
typedef gint (*GtkFunction) (gpointer data);
|
||||
typedef void (*GtkDestroyNotify) (gpointer data);
|
||||
typedef void (*GtkCallbackMarshal) (GtkObject *object,
|
||||
gpointer data,
|
||||
guint n_args,
|
||||
GtkArg *args);
|
||||
typedef void (*GtkSignalFunc) ();
|
||||
typedef void (*GtkSignalMarshaller) (GtkObject *object,
|
||||
GtkSignalFunc func,
|
||||
gpointer func_data,
|
||||
GtkArg *args);
|
||||
#define GTK_SIGNAL_FUNC(f) ((GtkSignalFunc) (f))
|
||||
|
||||
|
||||
/* GtkArg, used to hold differently typed values */
|
||||
struct _GtkArg
|
||||
{
|
||||
GtkType type;
|
||||
@ -222,31 +145,14 @@ struct _GtkArg
|
||||
gfloat float_data;
|
||||
gdouble double_data;
|
||||
gchar *string_data;
|
||||
gpointer pointer_data;
|
||||
GtkObject *object_data;
|
||||
gpointer pointer_data;
|
||||
|
||||
/* structured values */
|
||||
struct {
|
||||
GtkSignalFunc f;
|
||||
gpointer d;
|
||||
} signal_data;
|
||||
struct {
|
||||
gint n_args;
|
||||
GtkArg *args;
|
||||
} args_data;
|
||||
struct {
|
||||
GtkCallbackMarshal marshal;
|
||||
gpointer data;
|
||||
GtkDestroyNotify notify;
|
||||
} callback_data;
|
||||
struct {
|
||||
GtkFunction func;
|
||||
gpointer func_data;
|
||||
} c_callback_data;
|
||||
struct {
|
||||
gpointer data;
|
||||
GtkDestroyNotify notify;
|
||||
} foreign_data;
|
||||
} d;
|
||||
};
|
||||
|
||||
@ -254,8 +160,6 @@ struct _GtkArg
|
||||
* to allow the usage of these macros in combination with the
|
||||
* adress operator, e.g. >K_VALUE_CHAR (*arg)
|
||||
*/
|
||||
|
||||
/* flat values */
|
||||
#define GTK_VALUE_CHAR(a) ((a).d.char_data)
|
||||
#define GTK_VALUE_UCHAR(a) ((a).d.uchar_data)
|
||||
#define GTK_VALUE_BOOL(a) ((a).d.bool_data)
|
||||
@ -269,22 +173,14 @@ struct _GtkArg
|
||||
#define GTK_VALUE_ENUM(a) ((a).d.int_data)
|
||||
#define GTK_VALUE_FLAGS(a) ((a).d.uint_data)
|
||||
#define GTK_VALUE_BOXED(a) ((a).d.pointer_data)
|
||||
#define GTK_VALUE_POINTER(a) ((a).d.pointer_data)
|
||||
#define GTK_VALUE_OBJECT(a) ((a).d.object_data)
|
||||
|
||||
/* structured values */
|
||||
#define GTK_VALUE_POINTER(a) ((a).d.pointer_data)
|
||||
#define GTK_VALUE_SIGNAL(a) ((a).d.signal_data)
|
||||
#define GTK_VALUE_ARGS(a) ((a).d.args_data)
|
||||
#define GTK_VALUE_CALLBACK(a) ((a).d.callback_data)
|
||||
#define GTK_VALUE_C_CALLBACK(a) ((a).d.c_callback_data)
|
||||
#define GTK_VALUE_FOREIGN(a) ((a).d.foreign_data)
|
||||
|
||||
/* return location macros, these all narow down to
|
||||
* pointer types, because return values need to be
|
||||
* passed by reference
|
||||
*/
|
||||
|
||||
/* flat values */
|
||||
#define GTK_RETLOC_CHAR(a) ((gchar*) (a).d.pointer_data)
|
||||
#define GTK_RETLOC_UCHAR(a) ((guchar*) (a).d.pointer_data)
|
||||
#define GTK_RETLOC_BOOL(a) ((gboolean*) (a).d.pointer_data)
|
||||
@ -298,9 +194,14 @@ struct _GtkArg
|
||||
#define GTK_RETLOC_ENUM(a) ((gint*) (a).d.pointer_data)
|
||||
#define GTK_RETLOC_FLAGS(a) ((guint*) (a).d.pointer_data)
|
||||
#define GTK_RETLOC_BOXED(a) ((gpointer*) (a).d.pointer_data)
|
||||
#define GTK_RETLOC_POINTER(a) ((gpointer*) (a).d.pointer_data)
|
||||
#define GTK_RETLOC_OBJECT(a) ((GtkObject**) (a).d.pointer_data)
|
||||
#define GTK_RETLOC_POINTER(a) ((gpointer*) (a).d.pointer_data)
|
||||
/* GTK_RETLOC_SIGNAL() - no such thing */
|
||||
|
||||
/* type registration, it is recommended to use
|
||||
* g_type_register_static() or
|
||||
* g_type_register_dynamic() instead
|
||||
*/
|
||||
struct _GtkTypeInfo
|
||||
{
|
||||
gchar *type_name;
|
||||
@ -312,66 +213,37 @@ struct _GtkTypeInfo
|
||||
gpointer reserved_2;
|
||||
GtkClassInitFunc base_class_init_func;
|
||||
};
|
||||
|
||||
struct _GtkTypeQuery
|
||||
{
|
||||
GtkType type;
|
||||
const gchar *type_name;
|
||||
guint object_size;
|
||||
guint class_size;
|
||||
};
|
||||
|
||||
struct _GtkEnumValue
|
||||
{
|
||||
guint value;
|
||||
gchar *value_name;
|
||||
gchar *value_nick;
|
||||
};
|
||||
GtkType gtk_type_unique (GtkType parent_type,
|
||||
const GtkTypeInfo *gtkinfo);
|
||||
gpointer gtk_type_class (GtkType type);
|
||||
gpointer gtk_type_new (GtkType type);
|
||||
|
||||
|
||||
void gtk_type_init (void);
|
||||
GtkType gtk_type_unique (GtkType parent_type,
|
||||
const GtkTypeInfo *type_info);
|
||||
void gtk_type_set_chunk_alloc (GtkType type,
|
||||
guint n_chunks);
|
||||
gchar* gtk_type_name (GtkType type);
|
||||
GtkType gtk_type_from_name (const gchar *name);
|
||||
GtkType gtk_type_parent (GtkType type);
|
||||
gpointer gtk_type_class (GtkType type);
|
||||
gpointer gtk_type_parent_class (GtkType type);
|
||||
GList* gtk_type_children_types (GtkType type);
|
||||
gpointer gtk_type_new (GtkType type);
|
||||
void gtk_type_free (GtkType type,
|
||||
gpointer mem);
|
||||
void gtk_type_describe_heritage (GtkType type);
|
||||
void gtk_type_describe_tree (GtkType type,
|
||||
gboolean show_size);
|
||||
gboolean gtk_type_is_a (GtkType type,
|
||||
GtkType is_a_type);
|
||||
GtkTypeObject* gtk_type_check_object_cast (GtkTypeObject *type_object,
|
||||
GtkType cast_type);
|
||||
GtkTypeClass* gtk_type_check_class_cast (GtkTypeClass *klass,
|
||||
GtkType cast_type);
|
||||
GtkType gtk_type_register_enum (const gchar *type_name,
|
||||
GtkEnumValue *values);
|
||||
GtkType gtk_type_register_flags (const gchar *type_name,
|
||||
GtkFlagValue *values);
|
||||
/* --- initialize the type system --- */
|
||||
void gtk_type_init (void);
|
||||
|
||||
|
||||
/* --- compatibility defines --- */
|
||||
#define gtk_type_name g_type_name
|
||||
#define gtk_type_from_name g_type_from_name
|
||||
#define gtk_type_parent g_type_parent
|
||||
#define gtk_type_is_a g_type_is_a
|
||||
|
||||
|
||||
/* enum/flags compatibility functions, we strongly
|
||||
* recommend to use the glib enum/flags classes directly
|
||||
*/
|
||||
typedef GEnumValue GtkEnumValue;
|
||||
typedef GFlagsValue GtkFlagValue;
|
||||
GtkEnumValue* gtk_type_enum_get_values (GtkType enum_type);
|
||||
GtkFlagValue* gtk_type_flags_get_values (GtkType flags_type);
|
||||
GtkEnumValue* gtk_type_enum_find_value (GtkType enum_type,
|
||||
const gchar *value_name);
|
||||
GtkFlagValue* gtk_type_flags_find_value (GtkType flag_type,
|
||||
GtkFlagValue* gtk_type_flags_find_value (GtkType flags_type,
|
||||
const gchar *value_name);
|
||||
/* set the argument collector alias for foreign fundamentals */
|
||||
void gtk_type_set_varargs_type (GtkType foreign_type,
|
||||
GtkType varargs_type);
|
||||
GtkType gtk_type_get_varargs_type (GtkType foreign_type);
|
||||
/* Report internal information about a type. The caller has the
|
||||
* responsibility to invoke a subsequent g_free (returned_data); but
|
||||
* must not modify data pointed to by the members of GtkTypeQuery
|
||||
*/
|
||||
GtkTypeQuery* gtk_type_query (GtkType type);
|
||||
|
||||
/* urg */
|
||||
extern GType GTK_TYPE_IDENTIFIER;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -38,7 +38,6 @@ enum {
|
||||
static void gtk_viewport_class_init (GtkViewportClass *klass);
|
||||
static void gtk_viewport_init (GtkViewport *viewport);
|
||||
static void gtk_viewport_destroy (GtkObject *object);
|
||||
static void gtk_viewport_finalize (GtkObject *object);
|
||||
static void gtk_viewport_set_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
@ -110,23 +109,9 @@ gtk_viewport_class_init (GtkViewportClass *class)
|
||||
container_class = (GtkContainerClass*) class;
|
||||
parent_class = (GtkBinClass*) gtk_type_class (GTK_TYPE_BIN);
|
||||
|
||||
gtk_object_add_arg_type ("GtkViewport::hadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_HADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkViewport::vadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
ARG_VADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkViewport::shadow_type",
|
||||
GTK_TYPE_SHADOW_TYPE,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_SHADOW_TYPE);
|
||||
|
||||
object_class->set_arg = gtk_viewport_set_arg;
|
||||
object_class->get_arg = gtk_viewport_get_arg;
|
||||
object_class->destroy = gtk_viewport_destroy;
|
||||
object_class->finalize = gtk_viewport_finalize;
|
||||
|
||||
widget_class->map = gtk_viewport_map;
|
||||
widget_class->unmap = gtk_viewport_unmap;
|
||||
@ -137,18 +122,31 @@ gtk_viewport_class_init (GtkViewportClass *class)
|
||||
widget_class->size_request = gtk_viewport_size_request;
|
||||
widget_class->size_allocate = gtk_viewport_size_allocate;
|
||||
widget_class->style_set = gtk_viewport_style_set;
|
||||
|
||||
widget_class->set_scroll_adjustments_signal =
|
||||
gtk_signal_new ("set_scroll_adjustments",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GtkViewportClass, set_scroll_adjustments),
|
||||
gtk_marshal_NONE__POINTER_POINTER,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
|
||||
|
||||
container_class->add = gtk_viewport_add;
|
||||
|
||||
class->set_scroll_adjustments = gtk_viewport_set_scroll_adjustments;
|
||||
|
||||
gtk_object_add_arg_type ("GtkViewport::hadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_HADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkViewport::vadjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_VADJUSTMENT);
|
||||
gtk_object_add_arg_type ("GtkViewport::shadow_type",
|
||||
GTK_TYPE_SHADOW_TYPE,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_SHADOW_TYPE);
|
||||
|
||||
widget_class->set_scroll_adjustments_signal =
|
||||
gtk_signal_new ("set_scroll_adjustments",
|
||||
GTK_RUN_LAST,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkViewportClass, set_scroll_adjustments),
|
||||
gtk_marshal_NONE__POINTER_POINTER,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -236,24 +234,19 @@ gtk_viewport_destroy (GtkObject *object)
|
||||
GtkViewport *viewport = GTK_VIEWPORT (object);
|
||||
|
||||
if (viewport->hadjustment)
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->hadjustment),
|
||||
viewport);
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->hadjustment), viewport);
|
||||
gtk_object_unref (GTK_OBJECT (viewport->hadjustment));
|
||||
viewport->hadjustment = NULL;
|
||||
}
|
||||
if (viewport->vadjustment)
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->vadjustment),
|
||||
viewport);
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->vadjustment), viewport);
|
||||
gtk_object_unref (GTK_OBJECT (viewport->vadjustment));
|
||||
viewport->vadjustment = NULL;
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_viewport_finalize (GtkObject *object)
|
||||
{
|
||||
GtkViewport *viewport = GTK_VIEWPORT (object);
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (viewport->hadjustment));
|
||||
gtk_object_unref (GTK_OBJECT (viewport->vadjustment));
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->finalize (object);
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
GtkAdjustment*
|
||||
@ -262,6 +255,9 @@ gtk_viewport_get_hadjustment (GtkViewport *viewport)
|
||||
g_return_val_if_fail (viewport != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_VIEWPORT (viewport), NULL);
|
||||
|
||||
if (!viewport->hadjustment)
|
||||
gtk_viewport_set_hadjustment (viewport, NULL);
|
||||
|
||||
return viewport->hadjustment;
|
||||
}
|
||||
|
||||
@ -271,6 +267,9 @@ gtk_viewport_get_vadjustment (GtkViewport *viewport)
|
||||
g_return_val_if_fail (viewport != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_VIEWPORT (viewport), NULL);
|
||||
|
||||
if (!viewport->vadjustment)
|
||||
gtk_viewport_set_vadjustment (viewport, NULL);
|
||||
|
||||
return viewport->vadjustment;
|
||||
}
|
||||
|
||||
@ -285,9 +284,9 @@ gtk_viewport_set_hadjustment (GtkViewport *viewport,
|
||||
|
||||
if (viewport->hadjustment && viewport->hadjustment != adjustment)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->hadjustment),
|
||||
(gpointer) viewport);
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->hadjustment), viewport);
|
||||
gtk_object_unref (GTK_OBJECT (viewport->hadjustment));
|
||||
viewport->hadjustment = NULL;
|
||||
}
|
||||
|
||||
if (!adjustment)
|
||||
@ -322,9 +321,9 @@ gtk_viewport_set_vadjustment (GtkViewport *viewport,
|
||||
|
||||
if (viewport->vadjustment && viewport->vadjustment != adjustment)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->vadjustment),
|
||||
(gpointer) viewport);
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (viewport->vadjustment), viewport);
|
||||
gtk_object_unref (GTK_OBJECT (viewport->vadjustment));
|
||||
viewport->vadjustment = NULL;
|
||||
}
|
||||
|
||||
if (!adjustment)
|
||||
@ -686,6 +685,12 @@ gtk_viewport_size_allocate (GtkWidget *widget,
|
||||
viewport = GTK_VIEWPORT (widget);
|
||||
bin = GTK_BIN (widget);
|
||||
|
||||
/* demand creation */
|
||||
if (!viewport->hadjustment)
|
||||
gtk_viewport_set_hadjustment (viewport, NULL);
|
||||
if (!viewport->vadjustment)
|
||||
gtk_viewport_set_hadjustment (viewport, NULL);
|
||||
|
||||
border_width = GTK_CONTAINER (widget)->border_width;
|
||||
|
||||
child_allocation.x = 0;
|
||||
|
@ -30,8 +30,8 @@
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
|
||||
|
||||
#define SCALE_CLASS(w) GTK_SCALE_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define RANGE_CLASS(w) GTK_RANGE_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define SCALE_CLASS(w) GTK_SCALE_GET_CLASS (w)
|
||||
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
@ -111,7 +111,7 @@ gtk_vscale_class_init (GtkVScaleClass *class)
|
||||
|
||||
gtk_object_add_arg_type ("GtkVScale::adjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_ADJUSTMENT);
|
||||
|
||||
object_class->set_arg = gtk_vscale_set_arg;
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#define EPSILON 0.01
|
||||
|
||||
#define RANGE_CLASS(w) GTK_RANGE_CLASS (GTK_OBJECT (w)->klass)
|
||||
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
@ -97,7 +97,7 @@ gtk_vscrollbar_class_init (GtkVScrollbarClass *class)
|
||||
|
||||
gtk_object_add_arg_type ("GtkVScrollbar::adjustment",
|
||||
GTK_TYPE_ADJUSTMENT,
|
||||
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
|
||||
GTK_ARG_READWRITE,
|
||||
ARG_ADJUSTMENT);
|
||||
|
||||
object_class->set_arg = gtk_vscrollbar_set_arg;
|
||||
|
981
gtk/gtkwidget.c
981
gtk/gtkwidget.c
File diff suppressed because it is too large
Load Diff
@ -409,7 +409,7 @@ GtkWidget* gtk_widget_new (GtkType type,
|
||||
GtkWidget* gtk_widget_newv (GtkType type,
|
||||
guint nargs,
|
||||
GtkArg *args);
|
||||
void gtk_widget_ref (GtkWidget *widget);
|
||||
GtkWidget* gtk_widget_ref (GtkWidget *widget);
|
||||
void gtk_widget_unref (GtkWidget *widget);
|
||||
void gtk_widget_destroy (GtkWidget *widget);
|
||||
void gtk_widget_destroyed (GtkWidget *widget,
|
||||
|
@ -93,9 +93,9 @@ static void gtk_window_set_arg (GtkObject *object,
|
||||
static void gtk_window_get_arg (GtkObject *object,
|
||||
GtkArg *arg,
|
||||
guint arg_id);
|
||||
static void gtk_window_shutdown (GtkObject *object);
|
||||
static void gtk_window_shutdown (GObject *object);
|
||||
static void gtk_window_destroy (GtkObject *object);
|
||||
static void gtk_window_finalize (GtkObject *object);
|
||||
static void gtk_window_finalize (GObject *object);
|
||||
static void gtk_window_show (GtkWidget *widget);
|
||||
static void gtk_window_hide (GtkWidget *widget);
|
||||
static void gtk_window_map (GtkWidget *widget);
|
||||
@ -167,8 +167,9 @@ static GtkWindowGeometryInfo* gtk_window_get_geometry_info (GtkWindow *window,
|
||||
gboolean create);
|
||||
static void gtk_window_geometry_destroy (GtkWindowGeometryInfo *info);
|
||||
|
||||
static GSList *toplevel_list = NULL;
|
||||
static GtkBinClass *parent_class = NULL;
|
||||
static guint window_signals[LAST_SIGNAL] = { 0 };
|
||||
static guint window_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
|
||||
GtkType
|
||||
@ -199,6 +200,7 @@ gtk_window_get_type (void)
|
||||
static void
|
||||
gtk_window_class_init (GtkWindowClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
GtkContainerClass *container_class;
|
||||
@ -209,6 +211,9 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
|
||||
parent_class = gtk_type_class (gtk_bin_get_type ());
|
||||
|
||||
gobject_class->shutdown = gtk_window_shutdown;
|
||||
gobject_class->finalize = gtk_window_finalize;
|
||||
|
||||
gtk_object_add_arg_type ("GtkWindow::type", GTK_TYPE_WINDOW_TYPE, GTK_ARG_READWRITE, ARG_TYPE);
|
||||
gtk_object_add_arg_type ("GtkWindow::title", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TITLE);
|
||||
gtk_object_add_arg_type ("GtkWindow::auto_shrink", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_AUTO_SHRINK);
|
||||
@ -222,7 +227,7 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
window_signals[SET_FOCUS] =
|
||||
gtk_signal_new ("set_focus",
|
||||
GTK_RUN_LAST,
|
||||
object_class->type,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkWindowClass, set_focus),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
@ -232,9 +237,7 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
|
||||
object_class->set_arg = gtk_window_set_arg;
|
||||
object_class->get_arg = gtk_window_get_arg;
|
||||
object_class->shutdown = gtk_window_shutdown;
|
||||
object_class->destroy = gtk_window_destroy;
|
||||
object_class->finalize = gtk_window_finalize;
|
||||
|
||||
widget_class->show = gtk_window_show;
|
||||
widget_class->hide = gtk_window_hide;
|
||||
@ -282,8 +285,11 @@ gtk_window_init (GtkWindow *window)
|
||||
window->position = GTK_WIN_POS_NONE;
|
||||
window->use_uposition = TRUE;
|
||||
window->modal = FALSE;
|
||||
|
||||
gtk_container_register_toplevel (GTK_CONTAINER (window));
|
||||
|
||||
gtk_widget_ref (GTK_WIDGET (window));
|
||||
gtk_object_sink (GTK_OBJECT (window));
|
||||
window->has_user_ref_count = TRUE;
|
||||
toplevel_list = g_slist_prepend (toplevel_list, window);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -572,6 +578,18 @@ gtk_window_set_modal (GtkWindow *window,
|
||||
gtk_grab_remove (GTK_WIDGET (window));
|
||||
}
|
||||
|
||||
GList*
|
||||
gtk_window_list_toplevels (void)
|
||||
{
|
||||
GList *list = NULL;
|
||||
GSList *slist;
|
||||
|
||||
for (slist = toplevel_list; slist; slist = slist->next)
|
||||
list = g_list_prepend (list, gtk_widget_ref (slist->data));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_window_add_embedded_xid (GtkWindow *window, guint xid)
|
||||
{
|
||||
@ -649,11 +667,10 @@ gtk_window_reposition (GtkWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_shutdown (GtkObject *object)
|
||||
gtk_window_shutdown (GObject *object)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_WINDOW (object));
|
||||
|
||||
window = GTK_WINDOW (object);
|
||||
@ -661,7 +678,7 @@ gtk_window_shutdown (GtkObject *object)
|
||||
gtk_window_set_focus (window, NULL);
|
||||
gtk_window_set_default (window, NULL);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->shutdown (object);
|
||||
G_OBJECT_CLASS (parent_class)->shutdown (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -831,33 +848,38 @@ gtk_window_destroy (GtkObject *object)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_WINDOW (object));
|
||||
|
||||
window = GTK_WINDOW (object);
|
||||
|
||||
gtk_container_unregister_toplevel (GTK_CONTAINER (object));
|
||||
|
||||
if (window->transient_parent)
|
||||
gtk_window_unset_transient_for (window);
|
||||
|
||||
if (window->has_user_ref_count)
|
||||
{
|
||||
window->has_user_ref_count = FALSE;
|
||||
gtk_widget_unref (GTK_WIDGET (window));
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_finalize (GtkObject *object)
|
||||
gtk_window_finalize (GObject *object)
|
||||
{
|
||||
GtkWindow *window;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_WINDOW (object));
|
||||
|
||||
window = GTK_WINDOW (object);
|
||||
|
||||
toplevel_list = g_slist_remove (toplevel_list, window);
|
||||
|
||||
g_free (window->title);
|
||||
g_free (window->wmclass_name);
|
||||
g_free (window->wmclass_class);
|
||||
|
||||
GTK_OBJECT_CLASS(parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS(parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1406,14 +1428,14 @@ gtk_window_read_rcfiles (GtkWidget *widget,
|
||||
* then, the RC file will up to date, so we have to tell
|
||||
* them now.
|
||||
*/
|
||||
GList *toplevels;
|
||||
|
||||
toplevels = gtk_container_get_toplevels();
|
||||
while (toplevels)
|
||||
GList *list, *toplevels = gtk_window_list_toplevels ();
|
||||
|
||||
for (list = toplevels; list; list = list->next)
|
||||
{
|
||||
gtk_widget_reset_rc_styles (toplevels->data);
|
||||
toplevels = toplevels->next;
|
||||
gtk_widget_reset_rc_styles (list->data);
|
||||
gtk_widget_unref (list->data);
|
||||
}
|
||||
g_list_free (toplevels);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,7 @@ struct _GtkWindow
|
||||
GtkWindow *transient_parent;
|
||||
|
||||
gushort resize_count;
|
||||
guint has_user_ref_count : 1;
|
||||
guint allow_shrink : 1;
|
||||
guint allow_grow : 1;
|
||||
guint auto_shrink : 1;
|
||||
@ -126,6 +127,8 @@ void gtk_window_set_default_size (GtkWindow *window,
|
||||
/* If window is set modal, input will be grabbed when show and released when hide */
|
||||
void gtk_window_set_modal (GtkWindow *window,
|
||||
gboolean modal);
|
||||
GList* gtk_window_list_toplevels (void);
|
||||
|
||||
|
||||
/* --- internal functions --- */
|
||||
void gtk_window_set_focus (GtkWindow *window,
|
||||
|
@ -124,5 +124,5 @@ function generate (generate_1)
|
||||
|
||||
END {
|
||||
if (gen_macros)
|
||||
printf("\n#define\tGTK_TYPE_NUM_BUILTINS\t(%u)\n", type_counter);
|
||||
printf("\n#define\tGTK_TYPE_N_BUILTINS\t(%u)\n", type_counter);
|
||||
}
|
||||
|
@ -311,9 +311,9 @@ target_drag_motion (GtkWidget *widget,
|
||||
}
|
||||
|
||||
source_widget = gtk_drag_get_source_widget (context);
|
||||
g_print("motion, source %s\n", source_widget ?
|
||||
gtk_type_name (GTK_OBJECT (source_widget)->klass->type) :
|
||||
"unknown");
|
||||
g_print ("motion, source %s\n", source_widget ?
|
||||
GTK_OBJECT_TYPE_NAME (source_widget) :
|
||||
"NULL");
|
||||
|
||||
gdk_drag_status (context, context->suggested_action, time);
|
||||
return TRUE;
|
||||
|
@ -3290,7 +3290,7 @@ set_cursor (GtkWidget *spinner,
|
||||
guint c;
|
||||
GdkCursor *cursor;
|
||||
GtkWidget *label;
|
||||
GtkFlagValue *vals;
|
||||
GtkEnumValue *vals;
|
||||
|
||||
c = CLAMP (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spinner)), 0, 152);
|
||||
c &= 0xfe;
|
||||
@ -5660,13 +5660,11 @@ create_rulers (void)
|
||||
gtk_ruler_set_metric (GTK_RULER (ruler), GTK_CENTIMETERS);
|
||||
gtk_ruler_set_range (GTK_RULER (ruler), 100, 0, 0, 20);
|
||||
|
||||
gtk_signal_connect_object (
|
||||
GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC(
|
||||
GTK_WIDGET_CLASS (GTK_OBJECT (ruler)->klass)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), ruler, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (ruler);
|
||||
@ -5675,12 +5673,11 @@ create_rulers (void)
|
||||
ruler = gtk_vruler_new ();
|
||||
gtk_ruler_set_range (GTK_RULER (ruler), 5, 15, 0, 20);
|
||||
|
||||
gtk_signal_connect_object (
|
||||
GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC (GTK_WIDGET_CLASS (GTK_OBJECT (ruler)->klass)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 2,
|
||||
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (ruler);
|
||||
|
@ -311,9 +311,9 @@ target_drag_motion (GtkWidget *widget,
|
||||
}
|
||||
|
||||
source_widget = gtk_drag_get_source_widget (context);
|
||||
g_print("motion, source %s\n", source_widget ?
|
||||
gtk_type_name (GTK_OBJECT (source_widget)->klass->type) :
|
||||
"unknown");
|
||||
g_print ("motion, source %s\n", source_widget ?
|
||||
GTK_OBJECT_TYPE_NAME (source_widget) :
|
||||
"NULL");
|
||||
|
||||
gdk_drag_status (context, context->suggested_action, time);
|
||||
return TRUE;
|
||||
|
@ -3290,7 +3290,7 @@ set_cursor (GtkWidget *spinner,
|
||||
guint c;
|
||||
GdkCursor *cursor;
|
||||
GtkWidget *label;
|
||||
GtkFlagValue *vals;
|
||||
GtkEnumValue *vals;
|
||||
|
||||
c = CLAMP (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spinner)), 0, 152);
|
||||
c &= 0xfe;
|
||||
@ -5660,13 +5660,11 @@ create_rulers (void)
|
||||
gtk_ruler_set_metric (GTK_RULER (ruler), GTK_CENTIMETERS);
|
||||
gtk_ruler_set_range (GTK_RULER (ruler), 100, 0, 0, 20);
|
||||
|
||||
gtk_signal_connect_object (
|
||||
GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC(
|
||||
GTK_WIDGET_CLASS (GTK_OBJECT (ruler)->klass)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), ruler, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (ruler);
|
||||
@ -5675,12 +5673,11 @@ create_rulers (void)
|
||||
ruler = gtk_vruler_new ();
|
||||
gtk_ruler_set_range (GTK_RULER (ruler), 5, 15, 0, 20);
|
||||
|
||||
gtk_signal_connect_object (
|
||||
GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC (GTK_WIDGET_CLASS (GTK_OBJECT (ruler)->klass)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_signal_connect_object (GTK_OBJECT (window),
|
||||
"motion_notify_event",
|
||||
GTK_SIGNAL_FUNC (GTK_WIDGET_GET_CLASS (ruler)->motion_notify_event),
|
||||
GTK_OBJECT (ruler));
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), ruler, 0, 1, 1, 2,
|
||||
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (ruler);
|
||||
|
Loading…
Reference in New Issue
Block a user