mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 09:00:34 +00:00
d69496c060
Wed Oct 25 20:47:41 2000 Tim Janik <timj@gtk.org> * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): urg, removed implementation of gtk_marshal_VOID__INT_INT_INT_INT. if people do that, couldn't they at least give it a non-standard name? * gtk/gtktextlayout.c: arg! yet another implementation of gtk_marshal_VOID__INT_INT_INT_INT(), is this a conspiracy? * gtk/gtktextbuffer.c: gotcha! captured a vagabonding gtk_marshal_VOID__INT_POINTER_INT() implementation, braught it back home. now i know this _is_ a conspiracy. * gtk/gtkwidget.c (gtk_widget_class_init): marshaller fixups for ::state-changed. * gtk/gtkaccelgroup.c (gtk_accel_group_create_remove): (gtk_accel_group_create_add): marshaller signature fixups. * gtk/gtklistitem.c (gtk_list_item_class_init): signal creation fixups, pass in GTK_TYPE_SCROLL_TYPE instead of GTK_TYPE_ENUM. * gtk/gtkobject.[hc]: removed GTK_CONNECTED flag, it's not valid anymore. Tue Oct 24 23:59:21 2000 Tim Janik <timj@gtk.org> * docs/reference/Makefile.am: disabled SUBDIRS for the moment, since due to the signal system changes, it wouldn't build currently. to be fixed soon. * docs/Changes-2.0.txt: GtkSignal/GSignal updates. * gtk/gtkwidget.c: ::direction_changed takes an enum as argument, so it needs gtk_marshal_VOID__ENUM() instead of gtk_marshal_NONE__UINT(). * gdk/gdk*.c: adapted type registration functions. * gtk/gtkbindings.c: * gtk/gtkaccelgroup.c: operate on GSignalQuery, GtkSignalQuery is gone. * gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType. * gtk/gtkobject.c: (gtk_object_destroy): (gtk_object_shutdown): fixed recursion guards. basically we have to catch the case where any of GObject.shutdown() or gtk_object_destroy() is called during ::destroy, and avoid recursion there. * gtk/gtktypeutils.c: * gtk/maketypes.awk: awk-script hackup to provide gtk_type_init() with boxed_copy/boxed_free. this needs a more general solution based on a publically installed code-generator utility. * gtk/gtktypeutils.[hc]: compat aliased GTK_TYPE_BOXED to G_TYPE_BOXED, glib's gobject has support for that now. define GtkSignalMarshaller in terms of GSignalCMarshaller. Mon Oct 23 09:36:42 2000 Tim Janik <timj@gtk.org> * gtk/gtksignal.[hc]: * gtk/gtkmarshal.[hc]: * gtk/Makefile.am: generate marshallers with glib-genmarshal and don't compile gtkmarshal.c on its own anymore, just include it in gtksignal.c. removed #include <gtkmarshal.h>s all over the place, gtksignal.h takes care of that. * *.c: marshaller name fixups. * gtk/gtkmarshal.list: added a comment briefing the format. Sun Oct 22 23:14:39 2000 Tim Janik <timj@gtk.org> * gtk/gtksignal.[hc]: nuked old implementation. we mostly have compatibility macros here now. more specifically, most of the API is preserved (yes, _most_, nonwithstanding the following exceptions listed, the API is stil lHUGE ;) things that got removed completely: GtkSignalQuery, gtk_signal_query(), gtk_signal_n_emissions(), gtk_signal_n_emissions_by_name(), gtk_signal_handlers_destroy(), gtk_signal_set_funcs(), gtk_signal_handler_pending_by_id(), gtk_signal_add_emission_hook(), gtk_signal_add_emission_hook_full(), gtk_signal_remove_emission_hook(). non-functional functions variants: gtk_signal_add_emission_hook(), gtk_signal_remove_emission_hook(). the GtkCallbackMarshal argument to gtk_signal_connect_full() is not supported anymore. (gtk_signal_compat_matched): new internal function to aid implementation of the compatibility macros, it provides functionality to block/unblock/disconnect handlers based on func/data. * gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType, * *.c: adaptions to new type registration API signatures. Fri Oct 20 15:26:33 2000 Tim Janik <timj@gtk.org> * gtk/gtktypeutils.[hc]: removed G_TYPE_GTK_POINTER cludge.
253 lines
12 KiB
Plaintext
253 lines
12 KiB
Plaintext
Incompatible Changes from GTK+-1.2 to GTK+-1.4:
|
|
|
|
* 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)
|
|
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 *'.
|
|
|
|
* 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
|
|
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.
|
|
|
|
* GtkColorSelectionDialog has now been moved into it's own set of files,
|
|
gtkcolorseldialog.c and gtkcolorseldialog.h.
|
|
|
|
* gtk_widget_shape_combine_mask() now keeps a reference count on the
|
|
mask pixmap that is passed in.
|
|
|
|
* 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. The corresponding GtkArg
|
|
fields and field access macros are also gone.
|
|
- 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, so 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() and shutdown() methods
|
|
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 now be emitted multiple times on an object.
|
|
::destroy implementations should check that make sure that they take this
|
|
into account, by checking to make sure that resources are there before
|
|
freeing them. For example:
|
|
if (object->foo_data)
|
|
{
|
|
g_free (object->foo_data);
|
|
object->foo_data = NULL;
|
|
}
|
|
|
|
Also, ::destroy implementations have to release object references that
|
|
the object holds. Code in finalize implementations such as:
|
|
if (object->adjustment)
|
|
{
|
|
gtk_object_unref (object->adjustment);
|
|
object->adjustment = NULL;
|
|
}
|
|
have to be moved into the ::destroy implementations. The reason for doing
|
|
this is that all object reference cycles should be broken at destruction
|
|
time.
|
|
|
|
* Signal system changes:
|
|
The Gtk 2.0 signal merly proxies the GSignal system now.
|
|
For future usage, direct use of the GSignal API is recommended,
|
|
this avoids significant performance hits where GtkArg structures
|
|
have to be converted into GValues. For language bindings,
|
|
GSignal+GClosure provide a much more flexible and convenient
|
|
mechanism to hook into signal emissions or install class default
|
|
handlers, so the old GtkSignal API for language bindings is not
|
|
supported anymore.
|
|
Functions that got removed in the Gtk signal API:
|
|
gtk_signal_n_emissions(), gtk_signal_n_emissions_by_name(),
|
|
gtk_signal_set_funcs(), gtk_signal_handler_pending_by_id(),
|
|
gtk_signal_add_emission_hook(), gtk_signal_add_emission_hook_full(),
|
|
gtk_signal_remove_emission_hook(), gtk_signal_query().
|
|
gtk_signal_add_emission_hook(), gtk_signal_remove_emission_hook().
|
|
Also, the GtkCallbackMarshal argument to gtk_signal_connect_full() is
|
|
not supported anymore.
|
|
For many of the removed functions, similar variants are available
|
|
in the g_signal_* namespace.
|
|
|
|
- Inserting and deleting text in GtkEntry though functions such
|
|
as gtk_entry_insert_text() now leave the cursor at its original
|
|
position in the text instead of moving it to the location of
|
|
the insertion/deletion.
|
|
|
|
- The ->label field of GtkFrame widgets has been removed. (As part of
|
|
a change to allow the arbitrary widgets in the title position.) The
|
|
text can now be retrieved with the new function gtk_frame_get_text().
|
|
|
|
- The 'font' and 'font_set' declarations in RC files are now ignored. There
|
|
is a new 'font_name' field that holds the string form of a Pango font
|
|
|
|
- A number of types in GDK have become subclasses of GObject. For the
|
|
most part, this should not break anyone's code. However, it's now
|
|
possible/encouraged to use g_object_ref()/g_object_unref() and other
|
|
GObject features with these GDK types. The converted types are:
|
|
GdkWindow, GdkDrawable, GdkPixmap, GdkImage, GdkGC, GdkDragContext,
|
|
GdkColormap
|
|
|
|
- All drawables including pixmaps used to have a type tag, the
|
|
GdkWindowType enumeration, which included GDK_WINDOW_PIXMAP.
|
|
GdkWindowType is now a property of GdkWindow _only_, and there is
|
|
no GDK_WINDOW_PIXMAP. You can use the GDK_IS_PIXMAP() macro to see
|
|
if you have a pixmap, if you need to know that.
|
|
|
|
- GtkStyle and GtkRcStyle are now subclasses of GObject as well. This
|
|
requires fairly extensive changes to theme engines quite badly, but
|
|
shouldn't affect most other code.
|
|
|
|
- xthickness/ythickness have moved from GtkStyleClass to GtkStyle
|
|
(from class to instance). This gives themes a bit more flexibility
|
|
and is generally more of the Right Thing. You can trivially fix
|
|
your code with s/style->klass->xthickness/style->xthickness/g and
|
|
same for ythickness.
|
|
|
|
- If you were using private GDK types, they have been rearranged
|
|
significantly. You shouldn't use private types. ;-)
|
|
|
|
- The visual for a widget, and also the default visual is now derived
|
|
from the colormap for the widget and the default colormap.
|
|
gtk_widget_set_visual(), gtk_widget_set_default_visual(), gtk_widget_push_visual()
|
|
and gtk_widget_pop_visual() now do nothing. Since the visual always
|
|
had to match that of the colormap, it is safe to simply delete
|
|
all references to these functions.
|
|
|
|
- A number of functions in GDK have been renamed for consistency and
|
|
clarity. #defines to provide backwards compatibility have been
|
|
included, but can be disabled by defineing GDK_DISABLE_COMPAT_H.
|
|
|
|
#define gdk_draw_pixmap gdk_draw_drawable
|
|
#define gdk_draw_bitmap gdk_draw_drawable
|
|
|
|
#define gdk_window_get_size gdk_drawable_get_size
|
|
#define gdk_window_get_type gdk_window_get_window_type
|
|
#define gdk_window_get_colormap gdk_drawable_get_colormap
|
|
#define gdk_window_set_colormap gdk_drawable_set_colormap
|
|
#define gdk_window_get_visual gdk_drawable_get_visual
|
|
|
|
#define gdk_window_ref gdk_drawable_ref
|
|
#define gdk_window_unref gdk_drawable_unref
|
|
#define gdk_bitmap_ref gdk_drawable_ref
|
|
#define gdk_bitmap_unref gdk_drawable_unref
|
|
#define gdk_pixmap_ref gdk_drawable_ref
|
|
#define gdk_pixmap_unref gdk_drawable_unref
|
|
|
|
#define gdk_gc_destroy gdk_gc_unref
|
|
#define gdk_image_destroy gdk_image_unref
|
|
#define gdk_cursor_destroy gdk_cursor_unref
|
|
|
|
(Note that g_object_ref() and g_object_unref() may be used for all of
|
|
the above.)
|
|
|
|
#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \
|
|
gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height)
|
|
|
|
#define gdk_rgb_get_cmap gdk_rgb_get_colormap
|
|
|
|
- gdk_pixmap_foreign_new() no longer calls XFreePixmap() on the
|
|
pixmap when the GdkPixmap is finalized. This change corresponds
|
|
to the behavior of gdk_window_foreign_new(), and fixes a lot
|
|
of problems with code where the pixmap wasn't supposed to be
|
|
freed. If XFreePixmap() is needed, it can be done using the
|
|
destroy-notification facilities of g_object_set_data().
|
|
|
|
- GtkProgress/GtkProgressBar had serious problems in GTK 1.2.
|
|
|
|
- Only 3 or 4 functions are really needed for 95% of progress
|
|
interfaces; GtkProgress[Bar] had about 25 functions, and
|
|
didn't even include these 3 or 4.
|
|
- In activity mode, the API involves setting the adjustment
|
|
to any random value, just to have the side effect of
|
|
calling the progress bar update function - the adjustment
|
|
is totally ignored in activity mode
|
|
- You set the activity step as a pixel value, which means to
|
|
set the activity step you basically need to connect to
|
|
size_allocate
|
|
- There are ctree_set_expander_style()-functions, to randomly
|
|
change look-and-feel for no good reason
|
|
- The split between GtkProgress and GtkProgressBar makes no sense
|
|
to me whatsoever.
|
|
|
|
This was a big wart on GTK and made people waste lots of time,
|
|
both learning and using the interface.
|
|
|
|
So, we have added what we feel is the correct API, and marked all the
|
|
rest deprecated. However, the changes are 100% backward-compatible and
|
|
should break no existing code.
|
|
|
|
The following 5 functions are the new programming interface and you
|
|
should consider changing your code to use them:
|
|
|
|
void gtk_progress_bar_pulse (GtkProgressBar *pbar);
|
|
void gtk_progress_bar_set_text (GtkProgressBar *pbar,
|
|
const gchar *text);
|
|
void gtk_progress_bar_set_fraction (GtkProgressBar *pbar,
|
|
gfloat fraction);
|
|
|
|
void gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar,
|
|
gfloat fraction);
|
|
void gtk_progress_bar_set_orientation (GtkProgressBar *pbar,
|
|
GtkProgressBarOrientation orientation);
|
|
|
|
|