diff options
author | Havoc Pennington <hp@redhat.com> | 2001-01-04 17:48:43 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-01-04 17:48:43 +0000 |
commit | c7826b5f63930c960cdb53aa4935ee1f8f7f3b18 (patch) | |
tree | e62c661b717b8350d09f12113bdaead0a2f46483 | |
parent | 7b8ec35897a3221780c73d47c08b82d7aa7f73dd (diff) | |
download | gtk+-c7826b5f63930c960cdb53aa4935ee1f8f7f3b18.tar.gz |
Adapt to uscore-ification of gtktextiterprivate
2001-01-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate
* gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use
of private functions; remove inclusion of private headers.
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this
function, so we don't need private functions in gtktextdisplay.c
* gtk/gtktextiterprivate.h: underscore-ification
* gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL"
to instead say "only useful to implement widgets"
* gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS,
GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS,
GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249.
* gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap):
This function was completely broken
* gtk/testtext.c (line_numbers_expose): use gtk_paint_layout
* gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout
* gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout
* gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout
* gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout
* gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use
gtk_paint_layout
* gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use
gtk_paint_layout
* gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders.
Progress on bug 40103. Add draw_layout to draw a PangoLayout.
(struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp,
which were not implemented.
* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add
insert_pixbuf signal. Rename delete_text to delete_range since it
also deletes pixbufs and child anchors. This almost closes bug
40245 (still need to deal with child anchors)
* gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add
insert_pixbuf, change signal names as appropriate, change types of
signals taking marks/tags to have the specific type, not just
G_TYPE_OBJECT
* gtk/gtkmain.c (gtk_get_current_event_state): Add this function;
closes bug 40051
* gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up
unnecessary remove_contents() call
(gtk_option_menu_class_init): add a "changed" signal, closes
bug 40039
(gtk_option_menu_update_contents): emit "changed" if the
active menu item changes
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad
cast to GtkObject, reported by Jonas Borgstrom
(gdk_pixbuf_loader_finalize): don't close the loader on finalize;
we can't do stuff with side effects in finalize. Instead, spew a
warning if the loader isn't closed.
* gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free
colormap in here, non-X ports probably need to sync to this change
* gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove
assertion that colormap != NULL, you can set the colormap to NULL
if you like.
* Makefile.am: remove gtk-config-2.0
* configure.in: Use pkg-config to locate GLib. Remove
separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used,
and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow.
Use pkg-config to locate Pango. Output correct Pango libs to
gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix).
* Makefile.am (pkgconfig_DATA): install only target-specific pc
files
(install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the
X11 pc files
* gtk+-2.0.pc.in (Requires): require the GDK for the current target
unref from here
48 files changed, 1404 insertions, 685 deletions
@@ -1,3 +1,97 @@ +2001-01-03 Havoc Pennington <hp@redhat.com> + + * gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use + of private functions; remove inclusion of private headers. + + * gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this + function, so we don't need private functions in gtktextdisplay.c + + * gtk/gtktextiterprivate.h: underscore-ification + + * gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL" + to instead say "only useful to implement widgets" + + * gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS, + GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249. + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap): + This function was completely broken + + * gtk/testtext.c (line_numbers_expose): use gtk_paint_layout + + * gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout + + * gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout + + * gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout + + * gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout + + * gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use + gtk_paint_layout + + * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use + gtk_paint_layout + + * gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders. + Progress on bug 40103. Add draw_layout to draw a PangoLayout. + (struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp, + which were not implemented. + + * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add + insert_pixbuf signal. Rename delete_text to delete_range since it + also deletes pixbufs and child anchors. This almost closes bug + 40245 (still need to deal with child anchors) + + * gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add + insert_pixbuf, change signal names as appropriate, change types of + signals taking marks/tags to have the specific type, not just + G_TYPE_OBJECT + + * gtk/gtkmain.c (gtk_get_current_event_state): Add this function; + closes bug 40051 + + * gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up + unnecessary remove_contents() call + (gtk_option_menu_class_init): add a "changed" signal, closes + bug 40039 + (gtk_option_menu_update_contents): emit "changed" if the + active menu item changes + + * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad + cast to GtkObject, reported by Jonas Borgstrom + (gdk_pixbuf_loader_finalize): don't close the loader on finalize; + we can't do stuff with side effects in finalize. Instead, spew a + warning if the loader isn't closed. + + * gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free + colormap in here, non-X ports probably need to sync to this change + + * gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove + assertion that colormap != NULL, you can set the colormap to NULL + if you like. + + * Makefile.am: remove gtk-config-2.0 + + * configure.in: Use pkg-config to locate GLib. Remove + separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used, + and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow. + Use pkg-config to locate Pango. Output correct Pango libs to + gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix). + + * Makefile.am (pkgconfig_DATA): install only target-specific pc + files + (install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the + X11 pc files + + * gtk+-2.0.pc.in (Requires): require the GDK for the current target + unref from here + 2001-01-03 Alexander Larsson <alla@lysator.liu.se> * configure.in: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 10999b1ffb..605f1dd4f3 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,97 @@ +2001-01-03 Havoc Pennington <hp@redhat.com> + + * gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use + of private functions; remove inclusion of private headers. + + * gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this + function, so we don't need private functions in gtktextdisplay.c + + * gtk/gtktextiterprivate.h: underscore-ification + + * gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL" + to instead say "only useful to implement widgets" + + * gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS, + GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249. + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap): + This function was completely broken + + * gtk/testtext.c (line_numbers_expose): use gtk_paint_layout + + * gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout + + * gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout + + * gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout + + * gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout + + * gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use + gtk_paint_layout + + * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use + gtk_paint_layout + + * gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders. + Progress on bug 40103. Add draw_layout to draw a PangoLayout. + (struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp, + which were not implemented. + + * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add + insert_pixbuf signal. Rename delete_text to delete_range since it + also deletes pixbufs and child anchors. This almost closes bug + 40245 (still need to deal with child anchors) + + * gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add + insert_pixbuf, change signal names as appropriate, change types of + signals taking marks/tags to have the specific type, not just + G_TYPE_OBJECT + + * gtk/gtkmain.c (gtk_get_current_event_state): Add this function; + closes bug 40051 + + * gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up + unnecessary remove_contents() call + (gtk_option_menu_class_init): add a "changed" signal, closes + bug 40039 + (gtk_option_menu_update_contents): emit "changed" if the + active menu item changes + + * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad + cast to GtkObject, reported by Jonas Borgstrom + (gdk_pixbuf_loader_finalize): don't close the loader on finalize; + we can't do stuff with side effects in finalize. Instead, spew a + warning if the loader isn't closed. + + * gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free + colormap in here, non-X ports probably need to sync to this change + + * gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove + assertion that colormap != NULL, you can set the colormap to NULL + if you like. + + * Makefile.am: remove gtk-config-2.0 + + * configure.in: Use pkg-config to locate GLib. Remove + separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used, + and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow. + Use pkg-config to locate Pango. Output correct Pango libs to + gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix). + + * Makefile.am (pkgconfig_DATA): install only target-specific pc + files + (install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the + X11 pc files + + * gtk+-2.0.pc.in (Requires): require the GDK for the current target + unref from here + 2001-01-03 Alexander Larsson <alla@lysator.liu.se> * configure.in: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 10999b1ffb..605f1dd4f3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,97 @@ +2001-01-03 Havoc Pennington <hp@redhat.com> + + * gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use + of private functions; remove inclusion of private headers. + + * gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this + function, so we don't need private functions in gtktextdisplay.c + + * gtk/gtktextiterprivate.h: underscore-ification + + * gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL" + to instead say "only useful to implement widgets" + + * gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS, + GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249. + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap): + This function was completely broken + + * gtk/testtext.c (line_numbers_expose): use gtk_paint_layout + + * gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout + + * gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout + + * gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout + + * gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout + + * gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use + gtk_paint_layout + + * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use + gtk_paint_layout + + * gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders. + Progress on bug 40103. Add draw_layout to draw a PangoLayout. + (struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp, + which were not implemented. + + * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add + insert_pixbuf signal. Rename delete_text to delete_range since it + also deletes pixbufs and child anchors. This almost closes bug + 40245 (still need to deal with child anchors) + + * gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add + insert_pixbuf, change signal names as appropriate, change types of + signals taking marks/tags to have the specific type, not just + G_TYPE_OBJECT + + * gtk/gtkmain.c (gtk_get_current_event_state): Add this function; + closes bug 40051 + + * gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up + unnecessary remove_contents() call + (gtk_option_menu_class_init): add a "changed" signal, closes + bug 40039 + (gtk_option_menu_update_contents): emit "changed" if the + active menu item changes + + * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad + cast to GtkObject, reported by Jonas Borgstrom + (gdk_pixbuf_loader_finalize): don't close the loader on finalize; + we can't do stuff with side effects in finalize. Instead, spew a + warning if the loader isn't closed. + + * gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free + colormap in here, non-X ports probably need to sync to this change + + * gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove + assertion that colormap != NULL, you can set the colormap to NULL + if you like. + + * Makefile.am: remove gtk-config-2.0 + + * configure.in: Use pkg-config to locate GLib. Remove + separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used, + and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow. + Use pkg-config to locate Pango. Output correct Pango libs to + gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix). + + * Makefile.am (pkgconfig_DATA): install only target-specific pc + files + (install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the + X11 pc files + + * gtk+-2.0.pc.in (Requires): require the GDK for the current target + unref from here + 2001-01-03 Alexander Larsson <alla@lysator.liu.se> * configure.in: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 10999b1ffb..605f1dd4f3 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,97 @@ +2001-01-03 Havoc Pennington <hp@redhat.com> + + * gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use + of private functions; remove inclusion of private headers. + + * gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this + function, so we don't need private functions in gtktextdisplay.c + + * gtk/gtktextiterprivate.h: underscore-ification + + * gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL" + to instead say "only useful to implement widgets" + + * gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS, + GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249. + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap): + This function was completely broken + + * gtk/testtext.c (line_numbers_expose): use gtk_paint_layout + + * gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout + + * gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout + + * gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout + + * gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout + + * gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use + gtk_paint_layout + + * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use + gtk_paint_layout + + * gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders. + Progress on bug 40103. Add draw_layout to draw a PangoLayout. + (struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp, + which were not implemented. + + * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add + insert_pixbuf signal. Rename delete_text to delete_range since it + also deletes pixbufs and child anchors. This almost closes bug + 40245 (still need to deal with child anchors) + + * gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add + insert_pixbuf, change signal names as appropriate, change types of + signals taking marks/tags to have the specific type, not just + G_TYPE_OBJECT + + * gtk/gtkmain.c (gtk_get_current_event_state): Add this function; + closes bug 40051 + + * gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up + unnecessary remove_contents() call + (gtk_option_menu_class_init): add a "changed" signal, closes + bug 40039 + (gtk_option_menu_update_contents): emit "changed" if the + active menu item changes + + * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad + cast to GtkObject, reported by Jonas Borgstrom + (gdk_pixbuf_loader_finalize): don't close the loader on finalize; + we can't do stuff with side effects in finalize. Instead, spew a + warning if the loader isn't closed. + + * gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free + colormap in here, non-X ports probably need to sync to this change + + * gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove + assertion that colormap != NULL, you can set the colormap to NULL + if you like. + + * Makefile.am: remove gtk-config-2.0 + + * configure.in: Use pkg-config to locate GLib. Remove + separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used, + and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow. + Use pkg-config to locate Pango. Output correct Pango libs to + gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix). + + * Makefile.am (pkgconfig_DATA): install only target-specific pc + files + (install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the + X11 pc files + + * gtk+-2.0.pc.in (Requires): require the GDK for the current target + unref from here + 2001-01-03 Alexander Larsson <alla@lysator.liu.se> * configure.in: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 10999b1ffb..605f1dd4f3 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,97 @@ +2001-01-03 Havoc Pennington <hp@redhat.com> + + * gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use + of private functions; remove inclusion of private headers. + + * gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this + function, so we don't need private functions in gtktextdisplay.c + + * gtk/gtktextiterprivate.h: underscore-ification + + * gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL" + to instead say "only useful to implement widgets" + + * gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS, + GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249. + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap): + This function was completely broken + + * gtk/testtext.c (line_numbers_expose): use gtk_paint_layout + + * gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout + + * gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout + + * gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout + + * gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout + + * gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use + gtk_paint_layout + + * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use + gtk_paint_layout + + * gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders. + Progress on bug 40103. Add draw_layout to draw a PangoLayout. + (struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp, + which were not implemented. + + * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add + insert_pixbuf signal. Rename delete_text to delete_range since it + also deletes pixbufs and child anchors. This almost closes bug + 40245 (still need to deal with child anchors) + + * gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add + insert_pixbuf, change signal names as appropriate, change types of + signals taking marks/tags to have the specific type, not just + G_TYPE_OBJECT + + * gtk/gtkmain.c (gtk_get_current_event_state): Add this function; + closes bug 40051 + + * gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up + unnecessary remove_contents() call + (gtk_option_menu_class_init): add a "changed" signal, closes + bug 40039 + (gtk_option_menu_update_contents): emit "changed" if the + active menu item changes + + * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad + cast to GtkObject, reported by Jonas Borgstrom + (gdk_pixbuf_loader_finalize): don't close the loader on finalize; + we can't do stuff with side effects in finalize. Instead, spew a + warning if the loader isn't closed. + + * gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free + colormap in here, non-X ports probably need to sync to this change + + * gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove + assertion that colormap != NULL, you can set the colormap to NULL + if you like. + + * Makefile.am: remove gtk-config-2.0 + + * configure.in: Use pkg-config to locate GLib. Remove + separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used, + and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow. + Use pkg-config to locate Pango. Output correct Pango libs to + gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix). + + * Makefile.am (pkgconfig_DATA): install only target-specific pc + files + (install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the + X11 pc files + + * gtk+-2.0.pc.in (Requires): require the GDK for the current target + unref from here + 2001-01-03 Alexander Larsson <alla@lysator.liu.se> * configure.in: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 10999b1ffb..605f1dd4f3 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,97 @@ +2001-01-03 Havoc Pennington <hp@redhat.com> + + * gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use + of private functions; remove inclusion of private headers. + + * gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this + function, so we don't need private functions in gtktextdisplay.c + + * gtk/gtktextiterprivate.h: underscore-ification + + * gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL" + to instead say "only useful to implement widgets" + + * gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS, + GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249. + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap): + This function was completely broken + + * gtk/testtext.c (line_numbers_expose): use gtk_paint_layout + + * gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout + + * gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout + + * gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout + + * gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout + + * gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use + gtk_paint_layout + + * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use + gtk_paint_layout + + * gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders. + Progress on bug 40103. Add draw_layout to draw a PangoLayout. + (struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp, + which were not implemented. + + * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add + insert_pixbuf signal. Rename delete_text to delete_range since it + also deletes pixbufs and child anchors. This almost closes bug + 40245 (still need to deal with child anchors) + + * gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add + insert_pixbuf, change signal names as appropriate, change types of + signals taking marks/tags to have the specific type, not just + G_TYPE_OBJECT + + * gtk/gtkmain.c (gtk_get_current_event_state): Add this function; + closes bug 40051 + + * gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up + unnecessary remove_contents() call + (gtk_option_menu_class_init): add a "changed" signal, closes + bug 40039 + (gtk_option_menu_update_contents): emit "changed" if the + active menu item changes + + * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad + cast to GtkObject, reported by Jonas Borgstrom + (gdk_pixbuf_loader_finalize): don't close the loader on finalize; + we can't do stuff with side effects in finalize. Instead, spew a + warning if the loader isn't closed. + + * gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free + colormap in here, non-X ports probably need to sync to this change + + * gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove + assertion that colormap != NULL, you can set the colormap to NULL + if you like. + + * Makefile.am: remove gtk-config-2.0 + + * configure.in: Use pkg-config to locate GLib. Remove + separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used, + and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow. + Use pkg-config to locate Pango. Output correct Pango libs to + gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix). + + * Makefile.am (pkgconfig_DATA): install only target-specific pc + files + (install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the + X11 pc files + + * gtk+-2.0.pc.in (Requires): require the GDK for the current target + unref from here + 2001-01-03 Alexander Larsson <alla@lysator.liu.se> * configure.in: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 10999b1ffb..605f1dd4f3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,97 @@ +2001-01-03 Havoc Pennington <hp@redhat.com> + + * gtk/gtktextbtree.c: Adapt to uscore-ification of gtktextiterprivate + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): remove use + of private functions; remove inclusion of private headers. + + * gtk/gtktextlayout.c (gtk_text_layout_get_iter_at_line): Add this + function, so we don't need private functions in gtktextdisplay.c + + * gtk/gtktextiterprivate.h: underscore-ification + + * gtk/gtkwidget.c: Clean up a bunch of docs that said "INTERNAL" + to instead say "only useful to implement widgets" + + * gtk/gtkenums.h (GtkMovementStep): Rename GTK_MOVEMENT_CHARS, + GTK_MOVEMENT_POSITIONS to GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS. Resolves bug 40249. + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_set_colormap): + This function was completely broken + + * gtk/testtext.c (line_numbers_expose): use gtk_paint_layout + + * gtk/gtkvscale.c (gtk_vscale_draw_value): use gtk_paint_layout + + * gtk/gtkvruler.c (gtk_vruler_draw_ticks): use gtk_paint_layout + + * gtk/gtklabel.c (gtk_label_expose): use gtk_paint_layout + + * gtk/gtkhscale.c (gtk_hscale_draw_value): use gtk_paint_layout + + * gtk/gtkhruler.c (gtk_hruler_draw_ticks): use gtk_paint_layout + + * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render): use + gtk_paint_layout + + * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): use + gtk_paint_layout + + * gtk/gtkstyle.h: Add draw/paint expander to draw tree expanders. + Progress on bug 40103. Add draw_layout to draw a PangoLayout. + (struct _GtkStyleClass): Remove draw_cross, draw_oval, draw_ramp, + which were not implemented. + + * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): Add + insert_pixbuf signal. Rename delete_text to delete_range since it + also deletes pixbufs and child anchors. This almost closes bug + 40245 (still need to deal with child anchors) + + * gtk/gtktextbuffer.c (gtk_text_buffer_class_init): Add + insert_pixbuf, change signal names as appropriate, change types of + signals taking marks/tags to have the specific type, not just + G_TYPE_OBJECT + + * gtk/gtkmain.c (gtk_get_current_event_state): Add this function; + closes bug 40051 + + * gtk/gtkoptionmenu.c (gtk_option_menu_set_history): clean up + unnecessary remove_contents() call + (gtk_option_menu_class_init): add a "changed" signal, closes + bug 40039 + (gtk_option_menu_update_contents): emit "changed" if the + active menu item changes + + * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_frame_done): fix bad + cast to GtkObject, reported by Jonas Borgstrom + (gdk_pixbuf_loader_finalize): don't close the loader on finalize; + we can't do stuff with side effects in finalize. Instead, spew a + warning if the loader isn't closed. + + * gdk/x11/gdkdrawable-x11.c (gdk_drawable_impl_x11_finalize): free + colormap in here, non-X ports probably need to sync to this change + + * gdk/x11/gdkdrawable-x11.c (gdk_x11_set_colormap): remove + assertion that colormap != NULL, you can set the colormap to NULL + if you like. + + * Makefile.am: remove gtk-config-2.0 + + * configure.in: Use pkg-config to locate GLib. Remove + separated-out GMODULE_LIBS, GMODULE_CFLAGS; these were not used, + and the gmodule libs/cflags were in GLIB_LIBS GLIB_CFLAGS anyhow. + Use pkg-config to locate Pango. Output correct Pango libs to + gdk-2.0.pc.in. Fix test for FREETYPE_CONFIG (typo fix). + + * Makefile.am (pkgconfig_DATA): install only target-specific pc + files + (install-data-local): symlink gtk+-2.0.pc and gdk-2.0.pc to the + X11 pc files + + * gtk+-2.0.pc.in (Requires): require the GDK for the current target + unref from here + 2001-01-03 Alexander Larsson <alla@lysator.liu.se> * configure.in: diff --git a/Makefile.am b/Makefile.am index b94dc3e6d1..aff671accf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,8 +3,6 @@ SRC_SUBDIRS = gdk-pixbuf gdk modules gtk demos contrib SUBDIRS = po $(SRC_SUBDIRS) docs build -bin_SCRIPTS = gtk-config-2.0 - # require automake 1.4 AUTOMAKE_OPTIONS = 1.4 @@ -117,8 +115,26 @@ EXTRA_DIST = \ examples/spinbutton/Makefile \ examples/find-examples.sh +GDKTARGET=@gdktarget@ + +## Copy .pc files to target-specific names +gtk+-$(GDKTARGET)-2.0.pc: gtk+-2.0.pc + /bin/rm -f gtk+-$(GDKTARGET)-2.0.pc && \ + /bin/cp gtk+-2.0.pc gtk+-$(GDKTARGET)-2.0.pc + +gdk-$(GDKTARGET)-2.0.pc: gdk-2.0.pc + /bin/rm -f gdk-$(GDKTARGET)-2.0.pc && \ + /bin/cp gdk-2.0.pc gdk-$(GDKTARGET)-2.0.pc + pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA= gdk-pixbuf-2.0.pc gdk-2.0.pc gtk+-2.0.pc +pkgconfig_DATA= gdk-pixbuf-2.0.pc gdk-$(GDKTARGET)-2.0.pc gtk+-$(GDKTARGET)-2.0.pc + +## symlink gdk-2.0.pc and gtk+-2.0.pc to default target for the platform +DEFAULT_GDKTARGET=x11 +install-data-local: + (cd $(DESTDIR)$(pkgconfigdir) && \ + $(LN_S) -f gdk-$(DEFAULT_GDKTARGET)-2.0.pc gdk-2.0.pc && \ + $(LN_S) -f gtk+-$(DEFAULT_GDKTARGET)-2.0.pc gtk+-2.0.pc) dist-hook: gtk+.spec if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \ diff --git a/configure.in b/configure.in index ab6b123cc8..1ba38f09f5 100644 --- a/configure.in +++ b/configure.in @@ -7,10 +7,12 @@ AC_INIT(gdk/gdktypes.h) # GLIB_CFLAGS: cflags for compiling libraries and example progs # GLIB_LIBS: libraries for linking example programs # GLIB_DEPLIBS: libraries for linking libraries against -# glib_cflags: cflags to store in gtk-config -# glib_libs: libs to store in gtk-config -# glib_thread_cflags: cflags to store in gtk-config for gtk-config gthread -# glib_thread_libs: libs to store in gtk-config for gtk-config gthread + + +## We could have pkg-config uniquify the ldflags and cflags by calling +## it once with both the GLib and Pango package names, but we don't, +## someone should fix that. + # Save this value here, since automake will set cflags later cflags_set=${CFLAGS+set} @@ -280,45 +282,54 @@ AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;], CFLAGS="$gtk_save_CFLAGS" AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)]))) + +# +# Find pkg-config +# +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +if test x$PKG_CONFIG = xno ; then + AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net]) +fi + +if ! pkg-config --atleast-pkgconfig-version 0.5 ; then + AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.]) +fi + if test x$with_glib = xyes ; then AC_MSG_ERROR([ *** Directory must be specified for --with-glib]) fi if test x$with_glib = x ; then + # Look for separately installed glib - AM_PATH_GLIB_2_0(1.3.1,, - AC_MSG_ERROR([ -*** GLIB 1.3.1 or better is required. The latest version of GLIB -*** is always available from ftp://ftp.gtk.org/.]), - gobject gmodule gthread) - - # we do not want to make all gtk progs to link to thread libraries. - glib_cflags=`$GLIB_CONFIG_2_0 glib gobject gmodule --cflags` - glib_thread_cflags="$GLIB_CFLAGS" - glib_libs=`$GLIB_CONFIG_2_0 glib gobject gmodule --libs` - glib_thread_libs="$GLIB_LIBS" - GLIB_LIBS="$glib_libs" - GLIB_DEPLIBS="$glib_libs" + GLIB_PACKAGES="gobject-2.0 gmodule-2.0 gthread-2.0" + GLIB_REQUIRED_VERSION=1.3.2 + + AC_MSG_CHECKING(GLib flags) + if $PKG_CONFIG --atleast-version $GLIB_REQUIRED_VERSION glib-2.0 ; then + GLIB_CFLAGS=`$PKG_CONFIG --cflags $GLIB_PACKAGES` + GLIB_LIBS=`$PKG_CONFIG --libs $GLIB_PACKAGES` + GLIB_DEPLIBS=$GLIB_LIBS + + AC_MSG_RESULT($GLIB_CFLAGS $GLIB_LIBS) + else + AC_MSG_ERROR([ +*** GLIB $GLIB_REQUIRED_VERSION or newer is required. The latest version of GLIB +*** is always available from ftp://ftp.gtk.org/. + ]) + fi + else # Use uninstalled glib (assume they got the version right) - GLIB_CONFIG_2_0=$with_glib/glib-config-2.0 - if test -x $GLIB_CONFIG_2_0 ; then + if test -e glib-2.0.pc ; then : else AC_MSG_ERROR([GLIB directory ($with_glib) not present or not configured]) fi - # For use in gtk-config - glib_cflags=`$GLIB_CONFIG_2_0 --cflags gmodule` - glib_thread_cflags=`$GLIB_CONFIG_2_0 --cflags gmodule gthread` - glib_libs=`$GLIB_CONFIG_2_0 --libs gmodule` - glib_thread_libs=`$GLIB_CONFIG_2_0 --libs gmodule gthread` - - glib_release=`$GLIB_CONFIG_2_0 --version | sed 's%\\.[[0-9]]*$%%'` - # canonicalize relative paths case $with_glib in /*) @@ -332,15 +343,11 @@ else GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule" GLIB_LIBS="$glib_dir/libglib-1.3.la $glib_dir/gmodule/libgmodule-1.3.la" GLIB_DEPLIBS= - - AC_SUBST(GLIB_CFLAGS) - AC_SUBST(GLIB_LIBS) fi -AC_SUBST(glib_cflags) -AC_SUBST(glib_libs) -AC_SUBST(glib_thread_cflags) -AC_SUBST(glib_thread_libs) +CFLAGS="$CFLAGS $GLIB_CFLAGS" +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_DEPLIBS) AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H)) @@ -410,7 +417,7 @@ if test "x$gdktarget" = "xx11"; then FREETYPE_CFLAGS= have_freetype=false AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) - if test "x$FREE_CONFIG" != "xno" ; then + if test "x$FREETYPE_CONFIG" != "xno" ; then FREETYPE_CFLAGS=`freetype-config --cflags` FREETYPE_LIBS=`freetype-config --libs` @@ -593,32 +600,46 @@ AC_SUBST(FREETYPE_LIBS) AC_SUBST(FREETYPE_CFLAGS) # -# Check for Pango +# Pick correct Pango packages to use # -AC_PATH_PROG(PANGO_CONFIG, pango-config, no) -if test x$PANGO_CONFIG = xno ; then - AC_MSG_ERROR([*** pango-config not found]) -fi if test "x$gdktarget" = "xx11"; then - PANGO_CFLAGS="`$PANGO_CONFIG --cflags pangox`" - PANGO_LIBS="`$PANGO_CONFIG --libs pangox`" if $have_xft = true ; then - PANGO_LIBS="$PANGO_LIBS -lpangoxft" + PANGO_PACKAGES="pangox pangoxft" + else + PANGO_PACKAGES=pangox fi elif test "x$gdktarget" = "xlinux-fb"; then - PANGO_CFLAGS="`$PANGO_CONFIG --cflags pangoft2`" - PANGO_LIBS="`$PANGO_CONFIG --libs pangoft2`" + PANGO_PACKAGES=pangoft2 else - PANGO_CFLAGS="`$PANGO_CONFIG --cflags pango`" - PANGO_LIBS="`$PANGO_CONFIG --libs pango`" + PANGO_PACKAGES=pango fi + +AC_SUBST(PANGO_PACKAGES) + +# Check for Pango flags + +AC_MSG_CHECKING(Pango flags) +if $PKG_CONFIG --exists $PANGO_PACKAGES ; then + PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_PACKAGES` + PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_PACKAGES` + + AC_MSG_RESULT($PANGO_CFLAGS $PANGO_LIBS) +else + AC_MSG_ERROR([ +*** Pango not found. Pango is required to build GTK+. +*** See http://www.pango.org for Pango information. +*** For the framebuffer target, you will need to build +*** Pango with freetype support. +]) +fi + CFLAGS="$CFLAGS $PANGO_CFLAGS" AC_SUBST(PANGO_LIBS) AC_SUBST(PANGO_CFLAGS) AC_CHECK_LIB(pango, pango_context_new, :, AC_MSG_ERROR([ -*** Pango not found. Pango is required to build +*** Can't link to Pango. Pango is required to build *** GTK+. For more information see http://www.pango.org]), $PANGO_LIBS $x_ldflags $x_libs) CFLAGS="$saved_cflags" @@ -794,10 +815,6 @@ fi if $dynworks; then AC_DEFINE(USE_GMODULE) - GMODULE_LIBS="`$GLIB_CONFIG_2_0 --libs gmodule`" - GMODULE_FLAGS="`$GLIB_CONFIG_2_0 --cflags gmodule`" - AC_SUBST(GMODULE_LIBS) - AC_SUBST(GMODULE_FLAGS) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -1086,7 +1103,6 @@ AC_OUTPUT([ gtk+.spec docs/gtk-config.1 Makefile -gtk-config-2.0 gdk-pixbuf-2.0.pc gdk-2.0.pc gtk+-2.0.pc diff --git a/contrib/gdk-pixbuf-xlib/ChangeLog b/contrib/gdk-pixbuf-xlib/ChangeLog index 14bec62178..f22b2c31f2 100644 --- a/contrib/gdk-pixbuf-xlib/ChangeLog +++ b/contrib/gdk-pixbuf-xlib/ChangeLog @@ -1,3 +1,7 @@ +2001-01-02 Havoc Pennington <hp@redhat.com> + + * gdk-pixbuf-xlib-2.0.pc.in (Description): fix up description a bit. + 2000-10-06 Havoc Pennington <hp@redhat.com> * gdk-pixbuf-xlib.c: Put display/screen here, instead of in diff --git a/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in b/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in index 197c03c6e5..026b1ffb2f 100644 --- a/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in +++ b/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in @@ -3,8 +3,8 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: GdkPixbufXlib -Description: Image loading and scaling for Xlib +Name: GdkPixbuf Xlib +Description: GdkPixbuf rendering for Xlib Version: @VERSION@ Requires: gobject-2.0,gmodule-2.0,gdk-pixbuf-2.0 Libs: -L${libdir} -lgdk_pixbuf_xlib-1.3 diff --git a/docs/Changes-2.0.txt b/docs/Changes-2.0.txt index 0c5789f39d..fa10e23404 100644 --- a/docs/Changes-2.0.txt +++ b/docs/Changes-2.0.txt @@ -168,6 +168,10 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0: your code with s/style->klass->xthickness/style->xthickness/g and same for ythickness. +- Some GtkStyle draw_ methods have been removed (cross, oval, ramp) + and others have been added (expander, layout). This will require + changes to theme engines. + - If you were using private GDK types, they have been rearranged significantly. You shouldn't use private types. ;-) diff --git a/gdk-2.0.pc.in b/gdk-2.0.pc.in index 38a24948ea..b69c3e29b2 100644 --- a/gdk-2.0.pc.in +++ b/gdk-2.0.pc.in @@ -5,8 +5,8 @@ includedir=@includedir@ target=@gdktarget@ Name: GDK -Description: GIMP Drawing Kit +Description: GIMP Drawing Kit (${target} target) Version: @VERSION@ -Requires: gdk-pixbuf-2.0,pangox +Requires: gdk-pixbuf-2.0 @PANGO_PACKAGES@ Libs: -L${libdir} @more_ldflags@ -lgdk-${target}-1.3 @more_libs@ @GDK_WLIBS@ Cflags: -I${includedir}/gtk-2.0 -I${libdir}/gtk-2.0/include @more_cflags@ diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c index 34cb3899a1..60277caddd 100644 --- a/gdk-pixbuf/gdk-pixbuf-loader.c +++ b/gdk-pixbuf/gdk-pixbuf-loader.c @@ -183,7 +183,7 @@ gdk_pixbuf_loader_finalize (GObject *object) priv = loader->private; if (!priv->closed) - gdk_pixbuf_loader_close (loader); + g_warning ("GdkPixbufLoader finalized without calling gdk_pixbuf_loader_close() - this is not allowed. You must explicitly end the data stream to the loader before dropping the last reference."); if (priv->animation) gdk_pixbuf_animation_unref (priv->animation); @@ -193,8 +193,7 @@ gdk_pixbuf_loader_finalize (GObject *object) g_free (priv); - if (G_OBJECT_CLASS (parent_class)->finalize) - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } static void @@ -269,7 +268,7 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, priv->animation->frames = g_list_append (priv->animation->frames, frame); priv->animation->n_frames++; - g_signal_emit (GTK_OBJECT (loader), + g_signal_emit (G_OBJECT (loader), pixbuf_loader_signals[FRAME_DONE], 0, frame); diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c index ed3f2003e0..7d563e86e4 100644 --- a/gdk/x11/gdkdrawable-x11.c +++ b/gdk/x11/gdkdrawable-x11.c @@ -131,6 +131,8 @@ static GdkVisual* gdk_x11_get_visual (GdkDrawable *drawable); static void gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass); +static void gdk_drawable_impl_x11_finalize (GObject *object); + static gpointer parent_class = NULL; GType @@ -165,9 +167,12 @@ static void gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass) { GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass); - + GObjectClass *object_class = G_OBJECT_CLASS (klass); + parent_class = g_type_class_peek_parent (klass); + object_class->finalize = gdk_drawable_impl_x11_finalize; + drawable_class->create_gc = _gdk_x11_gc_new; drawable_class->draw_rectangle = gdk_x11_draw_rectangle; drawable_class->draw_arc = gdk_x11_draw_arc; @@ -190,6 +195,14 @@ gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass) drawable_class->get_image = _gdk_x11_get_image; } +static void +gdk_drawable_impl_x11_finalize (GObject *object) +{ + gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + /***************************************************** * X11 specific implementations of generic functions * *****************************************************/ @@ -209,8 +222,6 @@ gdk_x11_set_colormap (GdkDrawable *drawable, GdkColormap *colormap) { GdkDrawableImplX11 *impl; - - g_return_if_fail (colormap != NULL); impl = GDK_DRAWABLE_IMPL_X11 (drawable); diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 17de521ef7..73199a71c9 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -210,20 +210,23 @@ gdk_window_impl_x11_set_colormap (GdkDrawable *drawable, GdkDrawableImplX11 *draw_impl; g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (drawable)); - g_return_if_fail (gdk_colormap_get_visual (cmap) != gdk_drawable_get_visual (drawable)); impl = GDK_WINDOW_IMPL_X11 (drawable); draw_impl = GDK_DRAWABLE_IMPL_X11 (drawable); - GDK_DRAWABLE_GET_CLASS (draw_impl)->set_colormap (drawable, cmap); - - XSetWindowColormap (draw_impl->xdisplay, - draw_impl->xid, - GDK_COLORMAP_XCOLORMAP (cmap)); + /* chain up */ + GDK_DRAWABLE_CLASS (parent_class)->set_colormap (drawable, cmap); - if (((GdkWindowObject*)draw_impl->wrapper)->window_type != - GDK_WINDOW_TOPLEVEL) - gdk_window_add_colormap_windows (GDK_WINDOW (draw_impl->wrapper)); + if (cmap) + { + XSetWindowColormap (draw_impl->xdisplay, + draw_impl->xid, + GDK_COLORMAP_XCOLORMAP (cmap)); + + if (((GdkWindowObject*)draw_impl->wrapper)->window_type != + GDK_WINDOW_TOPLEVEL) + gdk_window_add_colormap_windows (GDK_WINDOW (draw_impl->wrapper)); + } } diff --git a/gtk+-2.0.pc.in b/gtk+-2.0.pc.in index ddf6c4b62d..e052d884f9 100644 --- a/gtk+-2.0.pc.in +++ b/gtk+-2.0.pc.in @@ -5,8 +5,8 @@ includedir=@includedir@ target=@gdktarget@ Name: GTK+ -Description: GIMP Tool Kit +Description: GIMP Tool Kit (${target} target) Version: @VERSION@ -Requires: gdk-2.0 +Requires: gdk-${target}-2.0 Libs: -L${libdir} -lgtk-${target}-1.3 Cflags: -I${includedir} diff --git a/gtk/gdk-pixbuf-loader.c b/gtk/gdk-pixbuf-loader.c index 34cb3899a1..60277caddd 100644 --- a/gtk/gdk-pixbuf-loader.c +++ b/gtk/gdk-pixbuf-loader.c @@ -183,7 +183,7 @@ gdk_pixbuf_loader_finalize (GObject *object) priv = loader->private; if (!priv->closed) - gdk_pixbuf_loader_close (loader); + g_warning ("GdkPixbufLoader finalized without calling gdk_pixbuf_loader_close() - this is not allowed. You must explicitly end the data stream to the loader before dropping the last reference."); if (priv->animation) gdk_pixbuf_animation_unref (priv->animation); @@ -193,8 +193,7 @@ gdk_pixbuf_loader_finalize (GObject *object) g_free (priv); - if (G_OBJECT_CLASS (parent_class)->finalize) - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } static void @@ -269,7 +268,7 @@ gdk_pixbuf_loader_frame_done (GdkPixbufFrame *frame, priv->animation->frames = g_list_append (priv->animation->frames, frame); priv->animation->n_frames++; - g_signal_emit (GTK_OBJECT (loader), + g_signal_emit (G_OBJECT (loader), pixbuf_loader_signals[FRAME_DONE], 0, frame); diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index 3cb84ea8fc..4f313f52d2 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -288,19 +288,15 @@ gtk_accel_label_expose_event (GtkWidget *widget, misc->yalign) + 1.5; layout = gtk_widget_create_pango_layout (widget, accel_label->accel_string); - - if (GTK_WIDGET_STATE (accel_label) == GTK_STATE_INSENSITIVE) - gdk_draw_layout (widget->window, - widget->style->white_gc, - x + 1, - y + 1, - layout); - - gdk_draw_layout (widget->window, - widget->style->fg_gc[GTK_WIDGET_STATE (accel_label)], - x, - y, - layout); + + gtk_paint_layout (widget->style, + widget->window, + GTK_WIDGET_STATE (widget), + &event->area, + widget, + "accellabel", + x, y, + layout); g_object_unref (G_OBJECT (layout)); } diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c index 7155010110..e98e6fd098 100644 --- a/gtk/gtkcellrenderertext.c +++ b/gtk/gtkcellrenderertext.c @@ -387,17 +387,11 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell, PangoLayout *layout; PangoAttribute *attr; PangoUnderline underline; - + GtkStateType state; + gint real_xoffset; gint real_yoffset; - GdkGC *font_gc = NULL; - - if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) - font_gc = widget->style->fg_gc [GTK_STATE_SELECTED]; - else - font_gc = widget->style->fg_gc [GTK_STATE_NORMAL]; - layout = gtk_widget_create_pango_layout (widget, celltext->text); if (celltext->underline) @@ -425,20 +419,25 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell, pango_attr_list_change (celltext->attr_list, attr); pango_layout_set_attributes (layout, celltext->attr_list); - gdk_gc_set_clip_rectangle (font_gc, cell_area); - real_xoffset = cell->xalign * (cell_area->width - rect.width - (2 * cell->xpad)); real_xoffset = MAX (real_xoffset, 0) + cell->xpad; real_yoffset = cell->yalign * (cell_area->height - rect.height - (2 * cell->ypad)); real_yoffset = MAX (real_yoffset, 0) + cell->ypad; - gdk_draw_layout (window, - font_gc, - cell_area->x + real_xoffset, - cell_area->y + real_yoffset, - layout); + if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) + state = GTK_STATE_SELECTED; + else + state = GTK_STATE_NORMAL; + + gtk_paint_layout (widget->style, + window, + state, + cell_area, + widget, + "cellrenderertext", + cell_area->x + real_xoffset, + cell_area->y + real_yoffset, + layout); g_object_unref (G_OBJECT (layout)); - - gdk_gc_set_clip_rectangle (font_gc, NULL); } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 59c15cf056..f2edb59daa 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -420,16 +420,16 @@ gtk_entry_class_init (GtkEntryClass *class) /* Moving the insertion point */ add_move_binding (binding_set, GDK_Right, 0, - GTK_MOVEMENT_POSITIONS, 1); + GTK_MOVEMENT_VISUAL_POSITIONS, 1); add_move_binding (binding_set, GDK_Left, 0, - GTK_MOVEMENT_POSITIONS, -1); + GTK_MOVEMENT_VISUAL_POSITIONS, -1); add_move_binding (binding_set, GDK_f, GDK_CONTROL_MASK, - GTK_MOVEMENT_CHARS, 1); + GTK_MOVEMENT_LOGICAL_POSITIONS, 1); add_move_binding (binding_set, GDK_b, GDK_CONTROL_MASK, - GTK_MOVEMENT_CHARS, -1); + GTK_MOVEMENT_LOGICAL_POSITIONS, -1); add_move_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); @@ -1353,10 +1353,10 @@ gtk_entry_move_cursor (GtkEntry *entry, switch (step) { - case GTK_MOVEMENT_CHARS: + case GTK_MOVEMENT_LOGICAL_POSITIONS: new_pos = CLAMP (new_pos + count, 0, entry->text_length); break; - case GTK_MOVEMENT_POSITIONS: + case GTK_MOVEMENT_VISUAL_POSITIONS: new_pos = gtk_entry_move_visually (entry, new_pos, count); break; case GTK_MOVEMENT_WORDS: diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h index 07f958508b..d28383da0a 100644 --- a/gtk/gtkenums.h +++ b/gtk/gtkenums.h @@ -144,8 +144,8 @@ typedef enum } GtkMetricType; typedef enum { - GTK_MOVEMENT_CHARS, /* move by forw/back chars */ - GTK_MOVEMENT_POSITIONS, /* move by left/right chars */ + GTK_MOVEMENT_LOGICAL_POSITIONS, /* move by forw/back graphemes */ + GTK_MOVEMENT_VISUAL_POSITIONS, /* move by left/right graphemes */ GTK_MOVEMENT_WORDS, /* move by forward/back words */ GTK_MOVEMENT_DISPLAY_LINES, /* move up/down lines (wrapped lines) */ GTK_MOVEMENT_DISPLAY_LINE_ENDS, /* move up/down lines (wrapped lines) */ diff --git a/gtk/gtkhruler.c b/gtk/gtkhruler.c index 296425c03e..bf497e90a9 100644 --- a/gtk/gtkhruler.c +++ b/gtk/gtkhruler.c @@ -261,9 +261,14 @@ gtk_hruler_draw_ticks (GtkRuler *ruler) pango_layout_set_text (layout, unit_str, -1); pango_layout_get_extents (layout, &logical_rect, NULL); - gdk_draw_layout (ruler->backing_store, gc, - pos + 2, ythickness + PANGO_PIXELS (logical_rect.y - digit_offset), - layout); + gtk_paint_layout (widget->style, + ruler->backing_store, + GTK_WIDGET_STATE (widget), + NULL, + widget, + "hruler", + pos + 2, ythickness + PANGO_PIXELS (logical_rect.y - digit_offset), + layout); } } } diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c index 67ab9f4c75..8fe09ef70c 100644 --- a/gtk/gtkhscale.c +++ b/gtk/gtkhscale.c @@ -527,17 +527,14 @@ gtk_hscale_draw_value (GtkScale *scale) if (!GTK_WIDGET_IS_SENSITIVE (scale)) state_type = GTK_STATE_INSENSITIVE; -#if 0 - gtk_paint_string (GTK_WIDGET (scale)->style, - GTK_WIDGET (scale)->window, - state_type, - NULL, GTK_WIDGET (scale), "hscale", - x, y, buffer); -#endif - - gdk_draw_layout (GTK_WIDGET (scale)->window, - GTK_WIDGET (scale)->style->fg_gc [state_type], - x, y, layout); + gtk_paint_layout (widget->style, + widget->window, + state_type, + NULL, + widget, + "hscale", + x, y, + layout); g_object_unref (G_OBJECT (layout)); } diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index ab5c2cf4c1..e443c2dfa7 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -721,12 +721,6 @@ gtk_label_expose (GtkWidget *widget, xalign = misc->xalign; else xalign = 1. - misc->xalign; - - /* - * GC Clipping - */ - gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area); - gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area); x = floor (widget->allocation.x + (gint)misc->xpad + ((widget->allocation.width - widget->requisition.width) * xalign) @@ -736,10 +730,15 @@ gtk_label_expose (GtkWidget *widget, + ((widget->allocation.height - widget->requisition.height) * misc->yalign) + 0.5); - gdk_draw_layout (widget->window, widget->style->fg_gc [widget->state], x, y, label->layout); - gdk_gc_set_clip_rectangle (widget->style->white_gc, NULL); - gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], NULL); + gtk_paint_layout (widget->style, + widget->window, + GTK_WIDGET_STATE (widget), + &event->area, + widget, + "label", + x, y, + label->layout); } return TRUE; diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index fffe8b494c..61e1556580 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1327,6 +1327,20 @@ gtk_get_current_event_time (void) return GDK_CURRENT_TIME; } +gboolean +gtk_get_current_event_state (GdkModifierType *state) +{ + g_return_val_if_fail (state != NULL, FALSE); + + if (current_events) + return gdk_event_get_state (current_events->data, state); + else + { + *state = 0; + return FALSE; + } +} + GtkWidget* gtk_get_event_widget (GdkEvent *event) { diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h index 9229b74351..0f7651edb1 100644 --- a/gtk/gtkmain.h +++ b/gtk/gtkmain.h @@ -178,9 +178,10 @@ void gtk_input_remove (guint input_handler_id); guint gtk_key_snooper_install (GtkKeySnoopFunc snooper, gpointer func_data); void gtk_key_snooper_remove (guint snooper_handler_id); - -GdkEvent* gtk_get_current_event (void); -guint32 gtk_get_current_event_time (void); + +GdkEvent* gtk_get_current_event (void); +guint32 gtk_get_current_event_time (void); +gboolean gtk_get_current_event_state (GdkModifierType *state); GtkWidget* gtk_get_event_widget (GdkEvent *event); diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c index 30e857dfa2..c329a28965 100644 --- a/gtk/gtkoptionmenu.c +++ b/gtk/gtkoptionmenu.c @@ -69,9 +69,14 @@ static void gtk_option_menu_show_all (GtkWidget *widget); static void gtk_option_menu_hide_all (GtkWidget *widget); static GtkType gtk_option_menu_child_type (GtkContainer *container); - +enum +{ + CHANGED, + LAST_SIGNAL +}; static GtkButtonClass *parent_class = NULL; +static guint signals[LAST_SIGNAL] = { 0 }; GtkType @@ -114,6 +119,15 @@ gtk_option_menu_class_init (GtkOptionMenuClass *class) parent_class = gtk_type_class (gtk_button_get_type ()); + signals[CHANGED] = + g_signal_newc ("changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkOptionMenuClass, changed), + NULL, + gtk_marshal_VOID__VOID, + G_TYPE_NONE, 0); + object_class->destroy = gtk_option_menu_destroy; widget_class->size_request = gtk_option_menu_size_request; @@ -238,10 +252,7 @@ gtk_option_menu_set_history (GtkOptionMenu *option_menu, menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu)); if (menu_item != option_menu->menu_item) - { - gtk_option_menu_remove_contents (option_menu); - gtk_option_menu_update_contents (option_menu); - } + gtk_option_menu_update_contents (option_menu); } } @@ -258,7 +269,7 @@ gtk_option_menu_get_history (GtkOptionMenu *option_menu) if (active_widget) return g_list_index (GTK_MENU_SHELL (option_menu->menu)->children, - active_widget); + active_widget); else return -1; } @@ -540,6 +551,14 @@ gtk_option_menu_deactivate (GtkMenuShell *menu_shell, } static void +gtk_option_menu_changed (GtkOptionMenu *option_menu) +{ + g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); + + g_signal_emit (G_OBJECT (option_menu), signals[CHANGED], 0); +} + +static void gtk_option_menu_update_contents (GtkOptionMenu *option_menu) { GtkWidget *child; @@ -550,6 +569,8 @@ gtk_option_menu_update_contents (GtkOptionMenu *option_menu) if (option_menu->menu) { + GtkWidget *old_item = option_menu->menu_item; + gtk_option_menu_remove_contents (option_menu); option_menu->menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu)); @@ -574,6 +595,9 @@ gtk_option_menu_update_contents (GtkOptionMenu *option_menu) if (GTK_WIDGET_DRAWABLE (option_menu)) gtk_widget_queue_draw (GTK_WIDGET (option_menu)); } + + if (old_item != option_menu->menu_item) + gtk_option_menu_changed (option_menu); } } diff --git a/gtk/gtkoptionmenu.h b/gtk/gtkoptionmenu.h index 34206a2641..936eb7d014 100644 --- a/gtk/gtkoptionmenu.h +++ b/gtk/gtkoptionmenu.h @@ -62,6 +62,8 @@ struct _GtkOptionMenu struct _GtkOptionMenuClass { GtkButtonClass parent_class; + + void (*changed) (GtkOptionMenu *option_menu); }; diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index d8f6f32650..a0061b99ae 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -759,16 +759,16 @@ gtk_progress_bar_paint (GtkProgress *progress) 2 * widget->style->xthickness - 3; rect.height = widget->allocation.height - 2 * widget->style->ythickness - 3; + + gtk_paint_layout (widget->style, + progress->offscreen_pixmap, + GTK_WIDGET_STATE (widget), + &rect, + widget, + "progressbar", + x, y, + layout); - gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], - &rect); - - gdk_draw_layout (progress->offscreen_pixmap, - widget->style->fg_gc[widget->state], - x, y, layout); - - gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], - NULL); g_object_unref (G_OBJECT (layout)); g_free (buf); } diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index bbc760f9be..d86986e525 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -141,17 +141,6 @@ static void gtk_default_draw_diamond (GtkStyle *style, gint y, gint width, gint height); -static void gtk_default_draw_oval (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); static void gtk_default_draw_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -205,29 +194,6 @@ static void gtk_default_draw_option (GtkStyle *style, gint y, gint width, gint height); -static void gtk_default_draw_cross (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -static void gtk_default_draw_ramp (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gint x, - gint y, - gint width, - gint height); static void gtk_default_draw_tab (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -312,6 +278,24 @@ static void gtk_default_draw_handle (GtkStyle *style, gint width, gint height, GtkOrientation orientation); +static void gtk_default_draw_expander (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + gboolean is_open); +static void gtk_default_draw_layout (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + PangoLayout *layout); static void gtk_style_shade (GdkColor *a, GdkColor *b, gdouble k); static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b); @@ -465,14 +449,11 @@ gtk_style_class_init (GtkStyleClass *klass) klass->draw_polygon = gtk_default_draw_polygon; klass->draw_arrow = gtk_default_draw_arrow; klass->draw_diamond = gtk_default_draw_diamond; - klass->draw_oval = gtk_default_draw_oval; klass->draw_string = gtk_default_draw_string; klass->draw_box = gtk_default_draw_box; klass->draw_flat_box = gtk_default_draw_flat_box; klass->draw_check = gtk_default_draw_check; klass->draw_option = gtk_default_draw_option; - klass->draw_cross = gtk_default_draw_cross; - klass->draw_ramp = gtk_default_draw_ramp; klass->draw_tab = gtk_default_draw_tab; klass->draw_shadow_gap = gtk_default_draw_shadow_gap; klass->draw_box_gap = gtk_default_draw_box_gap; @@ -480,6 +461,8 @@ gtk_style_class_init (GtkStyleClass *klass) klass->draw_focus = gtk_default_draw_focus; klass->draw_slider = gtk_default_draw_slider; klass->draw_handle = gtk_default_draw_handle; + klass->draw_expander = gtk_default_draw_expander; + klass->draw_layout = gtk_default_draw_layout; } static void @@ -803,22 +786,6 @@ gtk_draw_diamond (GtkStyle *style, void -gtk_draw_oval (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_oval != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_oval (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -void gtk_draw_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -897,39 +864,6 @@ gtk_draw_option (GtkStyle *style, } void -gtk_draw_cross (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_cross != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_cross (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -void -gtk_draw_ramp (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GtkArrowType arrow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_ramp != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_ramp (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, x, y, width, height); -} - -void gtk_draw_tab (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -1049,6 +983,38 @@ gtk_draw_handle (GtkStyle *style, } void +gtk_draw_expander (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + gint x, + gint y, + gboolean is_open) +{ + g_return_if_fail (GTK_IS_STYLE (style)); + g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_expander != NULL); + + GTK_STYLE_GET_CLASS (style)->draw_expander (style, window, state_type, + NULL, NULL, NULL, + x, y, is_open); +} + +void +gtk_draw_layout (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + gint x, + gint y, + PangoLayout *layout) +{ + g_return_if_fail (GTK_IS_STYLE (style)); + g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL); + + GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type, + NULL, NULL, NULL, + x, y, layout); +} + +void gtk_style_set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type) @@ -2362,25 +2328,6 @@ gtk_default_draw_diamond (GtkStyle *style, } static void -gtk_default_draw_oval (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - g_warning ("gtk_default_draw_oval(): FIXME, this function is currently unimplemented"); -} - -static void gtk_default_draw_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -2550,45 +2497,6 @@ gtk_default_draw_option (GtkStyle *style, detail, x, y, width, height); } -static void -gtk_default_draw_cross (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - g_warning ("gtk_default_draw_cross(): FIXME, this function is currently unimplemented"); -} - -static void -gtk_default_draw_ramp (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (window != NULL); - - g_warning ("gtk_default_draw_ramp(): FIXME, this function is currently unimplemented"); -} - static void gtk_default_draw_tab (GtkStyle *style, GdkWindow *window, @@ -3457,6 +3365,97 @@ gtk_default_draw_handle (GtkStyle *style, } static void +gtk_default_draw_expander (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + gboolean is_open) +{ + /* FIXME replace macro with a style property */ +#define PM_SIZE 8 + + GdkPoint points[3]; + + if (area) + { + gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], area); + gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], area); + } + + if (is_open) + { + points[0].x = x; + points[0].y = y + (PM_SIZE + 2) / 6; + points[1].x = points[0].x + 1 * (PM_SIZE + 2); + points[1].y = points[0].y; + points[2].x = (points[0].x + 1 * (PM_SIZE + 2) / 2); + points[2].y = y + 2 * (PM_SIZE + 2) / 3; + } + else + { + points[0].x = x + 1 * ((PM_SIZE + 2) / 6 + 2); + points[0].y = y - 1; + points[1].x = points[0].x; + points[1].y = points[0].y + (PM_SIZE + 2); + points[2].x = (points[0].x + 1 * (2 * (PM_SIZE + 2) / 3 - 1)); + points[2].y = points[0].y + (PM_SIZE + 2) / 2; + } + + gdk_draw_polygon (window, style->base_gc[GTK_STATE_NORMAL], + TRUE, points, 3); + gdk_draw_polygon (window, style->fg_gc[GTK_STATE_NORMAL], + FALSE, points, 3); + + + if (area) + { + gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], NULL); + gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], NULL); + } + +#undef PM_SIZE +} + +static void +gtk_default_draw_layout (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + PangoLayout *layout) +{ + g_return_if_fail (GTK_IS_STYLE (style)); + g_return_if_fail (window != NULL); + + if (area) + { + gdk_gc_set_clip_rectangle (style->white_gc, area); + gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area); + } + + /* FIXME this is frickin' ugly with any kind of attributes set on the + * text being rendered + */ + if (state_type == GTK_STATE_INSENSITIVE) + gdk_draw_layout (window, style->white_gc, x + 1, y + 1, layout); + + gdk_draw_layout (window, style->fg_gc[state_type], x, y, layout); + + if (area) + { + gdk_gc_set_clip_rectangle (style->white_gc, NULL); + gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL); + } +} + +static void gtk_style_shade (GdkColor *a, GdkColor *b, gdouble k) @@ -3752,25 +3751,6 @@ gtk_paint_diamond (GtkStyle *style, } void -gtk_paint_oval (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_oval != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_oval (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); -} - -void gtk_paint_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -3864,45 +3844,6 @@ gtk_paint_option (GtkStyle *style, } void -gtk_paint_cross (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_cross != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_cross (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); -} - -void -gtk_paint_ramp (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_ramp != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_ramp (style, window, state_type, shadow_type, area, widget, detail, arrow_type, x, y, width, height); -} - -void gtk_paint_tab (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -4042,3 +3983,41 @@ gtk_paint_handle (GtkStyle *style, GTK_STYLE_GET_CLASS (style)->draw_handle (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation); } + +void +gtk_paint_expander (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + gboolean is_open) +{ + g_return_if_fail (GTK_IS_STYLE (style)); + g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_expander != NULL); + + GTK_STYLE_GET_CLASS (style)->draw_expander (style, window, state_type, area, + widget, detail, x, y, is_open); +} + +void +gtk_paint_layout (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + PangoLayout *layout) +{ + g_return_if_fail (GTK_IS_STYLE (style)); + g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL); + + GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type, area, + widget, detail, x, y, layout); +} + + diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h index 8427127307..fff657cd71 100644 --- a/gtk/gtkstyle.h +++ b/gtk/gtkstyle.h @@ -227,17 +227,6 @@ struct _GtkStyleClass gint y, gint width, gint height); - void (*draw_oval) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); void (*draw_string) (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -291,29 +280,6 @@ struct _GtkStyleClass gint y, gint width, gint height); - void (*draw_cross) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); - void (*draw_ramp) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gint x, - gint y, - gint width, - gint height); void (*draw_tab) (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -398,6 +364,26 @@ struct _GtkStyleClass gint width, gint height, GtkOrientation orientation); + + void (*draw_expander) (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + gboolean is_open); + void (*draw_layout) (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + PangoLayout *layout); + }; GType gtk_style_get_type (void) G_GNUC_CONST; @@ -475,14 +461,6 @@ void gtk_draw_diamond (GtkStyle *style, gint y, gint width, gint height); -void gtk_draw_oval (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); void gtk_draw_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -521,23 +499,6 @@ void gtk_draw_option (GtkStyle *style, gint y, gint width, gint height); -void gtk_draw_cross (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_ramp (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GtkArrowType arrow_type, - gint x, - gint y, - gint width, - gint height); void gtk_draw_tab (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -601,6 +562,18 @@ void gtk_draw_handle (GtkStyle *style, gint width, gint height, GtkOrientation orientation); +void gtk_draw_expander (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + gint x, + gint y, + gboolean is_open); +void gtk_draw_layout (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + gint x, + gint y, + PangoLayout *layout); void gtk_paint_hline (GtkStyle *style, GdkWindow *window, @@ -665,17 +638,6 @@ void gtk_paint_diamond (GtkStyle *style, gint y, gint width, gint height); -void gtk_paint_oval (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); void gtk_paint_string (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -729,29 +691,6 @@ void gtk_paint_option (GtkStyle *style, gint y, gint width, gint height); -void gtk_paint_cross (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - gint width, - gint height); -void gtk_paint_ramp (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - GtkArrowType arrow_type, - gint x, - gint y, - gint width, - gint height); void gtk_paint_tab (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -836,6 +775,24 @@ void gtk_paint_handle (GtkStyle *style, gint width, gint height, GtkOrientation orientation); +void gtk_paint_expander (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + gboolean is_open); +void gtk_paint_layout (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + PangoLayout *layout); #ifdef __cplusplus diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c index 93695fa515..3e9d1648fb 100644 --- a/gtk/gtktextbtree.c +++ b/gtk/gtktextbtree.c @@ -566,12 +566,12 @@ _gtk_text_btree_delete (GtkTextIter *start, g_return_if_fail (start != NULL); g_return_if_fail (end != NULL); - g_return_if_fail (gtk_text_iter_get_btree (start) == - gtk_text_iter_get_btree (end)); + g_return_if_fail (_gtk_text_iter_get_btree (start) == + _gtk_text_iter_get_btree (end)); gtk_text_iter_reorder (start, end); - tree = gtk_text_iter_get_btree (start); + tree = _gtk_text_iter_get_btree (start); { /* @@ -636,8 +636,8 @@ _gtk_text_btree_delete (GtkTextIter *start, /* Save the byte offset so we can reset the iterators */ start_byte_offset = gtk_text_iter_get_line_index (start); - start_line = gtk_text_iter_get_text_line (start); - end_line = gtk_text_iter_get_text_line (end); + start_line = _gtk_text_iter_get_text_line (start); + end_line = _gtk_text_iter_get_text_line (end); /* * Split the start and end segments, so we have a place @@ -947,8 +947,8 @@ _gtk_text_btree_insert (GtkTextIter *iter, len = strlen (text); /* extract iterator info */ - tree = gtk_text_iter_get_btree (iter); - line = gtk_text_iter_get_text_line (iter); + tree = _gtk_text_iter_get_btree (iter); + line = _gtk_text_iter_get_text_line (iter); start_line = line; start_byte_index = gtk_text_iter_get_line_index (iter); @@ -1083,8 +1083,8 @@ insert_pixbuf_or_widget_segment (GtkTextIter *iter, GtkTextBTree *tree; gint start_byte_offset; - line = gtk_text_iter_get_text_line (iter); - tree = gtk_text_iter_get_btree (iter); + line = _gtk_text_iter_get_text_line (iter); + tree = _gtk_text_iter_get_btree (iter); start_byte_offset = gtk_text_iter_get_line_index (iter); prevPtr = gtk_text_line_segment_split (iter); @@ -1133,7 +1133,7 @@ _gtk_text_btree_create_child_anchor (GtkTextIter *iter) seg = _gtk_widget_segment_new (); - tree = seg->body.child.tree = gtk_text_iter_get_btree (iter); + tree = seg->body.child.tree = _gtk_text_iter_get_btree (iter); insert_pixbuf_or_widget_segment (iter, seg); @@ -1572,8 +1572,8 @@ _gtk_text_btree_tag (const GtkTextIter *start_orig, g_return_if_fail (start_orig != NULL); g_return_if_fail (end_orig != NULL); g_return_if_fail (GTK_IS_TEXT_TAG (tag)); - g_return_if_fail (gtk_text_iter_get_btree (start_orig) == - gtk_text_iter_get_btree (end_orig)); + g_return_if_fail (_gtk_text_iter_get_btree (start_orig) == + _gtk_text_iter_get_btree (end_orig)); #if 0 printf ("%s tag %s from %d to %d\n", @@ -1591,14 +1591,14 @@ _gtk_text_btree_tag (const GtkTextIter *start_orig, gtk_text_iter_reorder (&start, &end); - tree = gtk_text_iter_get_btree (&start); + tree = _gtk_text_iter_get_btree (&start); queue_tag_redisplay (tree, tag, &start, &end); info = gtk_text_btree_get_tag_info (tree, tag); - start_line = gtk_text_iter_get_text_line (&start); - end_line = gtk_text_iter_get_text_line (&end); + start_line = _gtk_text_iter_get_text_line (&start); + end_line = _gtk_text_iter_get_text_line (&end); /* Find all tag toggles in the region; we are going to delete them. We need to find them in advance, because @@ -1669,9 +1669,9 @@ _gtk_text_btree_tag (const GtkTextIter *start_orig, GtkTextLineSegment *indexable_seg; GtkTextLine *line; - line = gtk_text_iter_get_text_line (&iter); - seg = gtk_text_iter_get_any_segment (&iter); - indexable_seg = gtk_text_iter_get_indexable_segment (&iter); + line = _gtk_text_iter_get_text_line (&iter); + seg = _gtk_text_iter_get_any_segment (&iter); + indexable_seg = _gtk_text_iter_get_indexable_segment (&iter); g_assert (seg != NULL); g_assert (indexable_seg != NULL); @@ -1973,8 +1973,8 @@ _gtk_text_btree_get_tags (const GtkTextIter *iter, #define NUM_TAG_INFOS 10 - line = gtk_text_iter_get_text_line (iter); - tree = gtk_text_iter_get_btree (iter); + line = _gtk_text_iter_get_text_line (iter); + tree = _gtk_text_iter_get_btree (iter); byte_index = gtk_text_iter_get_line_index (iter); tagInfo.numTags = 0; @@ -2084,8 +2084,8 @@ copy_segment (GString *string, if (gtk_text_iter_equal (start, end)) return; - seg = gtk_text_iter_get_indexable_segment (start); - end_seg = gtk_text_iter_get_indexable_segment (end); + seg = _gtk_text_iter_get_indexable_segment (start); + end_seg = _gtk_text_iter_get_indexable_segment (end); if (seg->type == >k_text_char_type) { @@ -2102,12 +2102,12 @@ copy_segment (GString *string, /* printf (" <invisible>\n"); */ } - copy_start = gtk_text_iter_get_segment_byte (start); + copy_start = _gtk_text_iter_get_segment_byte (start); if (seg == end_seg) { /* End is in the same segment; need to copy fewer bytes. */ - gint end_byte = gtk_text_iter_get_segment_byte (end); + gint end_byte = _gtk_text_iter_get_segment_byte (end); copy_bytes = end_byte - copy_start; } @@ -2170,8 +2170,8 @@ _gtk_text_btree_get_text (const GtkTextIter *start_orig, g_return_val_if_fail (start_orig != NULL, NULL); g_return_val_if_fail (end_orig != NULL, NULL); - g_return_val_if_fail (gtk_text_iter_get_btree (start_orig) == - gtk_text_iter_get_btree (end_orig), NULL); + g_return_val_if_fail (_gtk_text_iter_get_btree (start_orig) == + _gtk_text_iter_get_btree (end_orig), NULL); start = *start_orig; end = *end_orig; @@ -2180,19 +2180,19 @@ _gtk_text_btree_get_text (const GtkTextIter *start_orig, retval = g_string_new (""); - tree = gtk_text_iter_get_btree (&start); + tree = _gtk_text_iter_get_btree (&start); - end_seg = gtk_text_iter_get_indexable_segment (&end); + end_seg = _gtk_text_iter_get_indexable_segment (&end); iter = start; - seg = gtk_text_iter_get_indexable_segment (&iter); + seg = _gtk_text_iter_get_indexable_segment (&iter); while (seg != end_seg) { copy_segment (retval, include_hidden, include_nonchars, &iter, &end); - gtk_text_iter_forward_indexable_segment (&iter); + _gtk_text_iter_forward_indexable_segment (&iter); - seg = gtk_text_iter_get_indexable_segment (&iter); + seg = _gtk_text_iter_get_indexable_segment (&iter); } copy_segment (retval, include_hidden, include_nonchars, &iter, &end); @@ -2237,8 +2237,8 @@ _gtk_text_btree_char_is_invisible (const GtkTextIter *iter) GtkTextBTree *tree; gint byte_index; - line = gtk_text_iter_get_text_line (iter); - tree = gtk_text_iter_get_btree (iter); + line = _gtk_text_iter_get_text_line (iter); + tree = _gtk_text_iter_get_btree (iter); byte_index = gtk_text_iter_get_line_index (iter); numTags = gtk_text_tag_table_size (tree->table); @@ -2385,8 +2385,8 @@ redisplay_region (GtkTextBTree *tree, end = tmp; } - start_line = gtk_text_iter_get_text_line (start); - end_line = gtk_text_iter_get_text_line (end); + start_line = _gtk_text_iter_get_text_line (start); + end_line = _gtk_text_iter_get_text_line (end); view = tree->views; while (view != NULL) @@ -2463,7 +2463,7 @@ real_set_mark (GtkTextBTree *tree, g_return_val_if_fail (tree != NULL, NULL); g_return_val_if_fail (where != NULL, NULL); - g_return_val_if_fail (gtk_text_iter_get_btree (where) == tree, NULL); + g_return_val_if_fail (_gtk_text_iter_get_btree (where) == tree, NULL); if (existing_mark) mark = existing_mark->segment; @@ -2486,7 +2486,7 @@ real_set_mark (GtkTextBTree *tree, iter = *where; if (gtk_debug_flags & GTK_DEBUG_TEXT) - gtk_text_iter_check (&iter); + _gtk_text_iter_check (&iter); if (mark != NULL) { @@ -2518,8 +2518,8 @@ real_set_mark (GtkTextBTree *tree, This could hose our iterator... */ gtk_text_btree_unlink_segment (tree, mark, mark->body.mark.line); - mark->body.mark.line = gtk_text_iter_get_text_line (&iter); - g_assert (mark->body.mark.line == gtk_text_iter_get_text_line (&iter)); + mark->body.mark.line = _gtk_text_iter_get_text_line (&iter); + g_assert (mark->body.mark.line == _gtk_text_iter_get_text_line (&iter)); segments_changed (tree); /* make sure the iterator recomputes its segment */ @@ -2530,7 +2530,7 @@ real_set_mark (GtkTextBTree *tree, left_gravity, name); - mark->body.mark.line = gtk_text_iter_get_text_line (&iter); + mark->body.mark.line = _gtk_text_iter_get_text_line (&iter); if (mark->body.mark.name) g_hash_table_insert (tree->mark_table, @@ -2539,7 +2539,7 @@ real_set_mark (GtkTextBTree *tree, } if (gtk_debug_flags & GTK_DEBUG_TEXT) - gtk_text_iter_check (&iter); + _gtk_text_iter_check (&iter); /* Link mark into new location */ gtk_text_btree_link_segment (mark, &iter); @@ -2554,7 +2554,7 @@ real_set_mark (GtkTextBTree *tree, redisplay_mark_if_visible (mark); if (gtk_debug_flags & GTK_DEBUG_TEXT) - gtk_text_iter_check (&iter); + _gtk_text_iter_check (&iter); if (gtk_debug_flags & GTK_DEBUG_TEXT) _gtk_text_btree_check (tree); @@ -6092,8 +6092,8 @@ gtk_text_btree_link_segment (GtkTextLineSegment *seg, GtkTextLine *line; GtkTextBTree *tree; - line = gtk_text_iter_get_text_line (iter); - tree = gtk_text_iter_get_btree (iter); + line = _gtk_text_iter_get_text_line (iter); + tree = _gtk_text_iter_get_btree (iter); prev = gtk_text_line_segment_split (iter); if (prev == NULL) diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 0db7702ac7..a2c13ac0d3 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -48,7 +48,8 @@ struct _ClipboardRequest enum { INSERT_TEXT, - DELETE_TEXT, + INSERT_PIXBUF, + DELETE_RANGE, CHANGED, MODIFIED_CHANGED, MARK_SET, @@ -83,7 +84,10 @@ static void gtk_text_buffer_real_insert_text (GtkTextBuffer *buffe GtkTextIter *iter, const gchar *text, gint len); -static void gtk_text_buffer_real_delete_text (GtkTextBuffer *buffer, +static void gtk_text_buffer_real_insert_pixbuf (GtkTextBuffer *buffer, + GtkTextIter *iter, + GdkPixbuf *pixbuf); +static void gtk_text_buffer_real_delete_range (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end); static void gtk_text_buffer_real_apply_tag (GtkTextBuffer *buffer, @@ -141,7 +145,8 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) object_class->finalize = gtk_text_buffer_finalize; klass->insert_text = gtk_text_buffer_real_insert_text; - klass->delete_text = gtk_text_buffer_real_delete_text; + klass->insert_pixbuf = gtk_text_buffer_real_insert_pixbuf; + klass->delete_range = gtk_text_buffer_real_delete_range; klass->apply_tag = gtk_text_buffer_real_apply_tag; klass->remove_tag = gtk_text_buffer_real_remove_tag; klass->changed = gtk_text_buffer_real_changed; @@ -164,11 +169,27 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) GTK_TYPE_POINTER, GTK_TYPE_INT); - signals[DELETE_TEXT] = - g_signal_newc ("delete_text", + signals[INSERT_PIXBUF] = + g_signal_newc ("insert_pixbuf", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkTextBufferClass, insert_pixbuf), + NULL, + gtk_marshal_VOID__BOXED_OBJECT, + GTK_TYPE_NONE, + 2, +#if 0 + /* FIXME */ + GTK_TYPE_TEXT_ITER, +#endif + GTK_TYPE_POINTER, + GDK_TYPE_PIXBUF); + + signals[DELETE_RANGE] = + g_signal_newc ("delete_range", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkTextBufferClass, delete_text), + G_STRUCT_OFFSET (GtkTextBufferClass, delete_range), NULL, gtk_marshal_VOID__BOXED_BOXED, GTK_TYPE_NONE, @@ -211,7 +232,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) GTK_TYPE_NONE, 2, GTK_TYPE_TEXT_ITER, - G_TYPE_OBJECT); + GTK_TYPE_TEXT_MARK); signals[MARK_DELETED] = g_signal_newc ("mark_deleted", @@ -222,7 +243,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) gtk_marshal_VOID__OBJECT, GTK_TYPE_NONE, 1, - G_TYPE_OBJECT); + GTK_TYPE_TEXT_MARK); signals[APPLY_TAG] = g_signal_newc ("apply_tag", @@ -233,7 +254,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) gtk_marshal_VOID__OBJECT_BOXED_BOXED, GTK_TYPE_NONE, 3, - G_TYPE_OBJECT, + GTK_TYPE_TEXT_TAG, GTK_TYPE_TEXT_ITER, GTK_TYPE_TEXT_ITER); @@ -246,7 +267,7 @@ gtk_text_buffer_class_init (GtkTextBufferClass *klass) gtk_marshal_VOID__OBJECT_BOXED_BOXED, GTK_TYPE_NONE, 3, - G_TYPE_OBJECT, + GTK_TYPE_TEXT_TAG, GTK_TYPE_TEXT_ITER, GTK_TYPE_TEXT_ITER); @@ -1077,9 +1098,9 @@ gtk_text_buffer_insert_with_tags_by_name (GtkTextBuffer *buffer, */ static void -gtk_text_buffer_real_delete_text (GtkTextBuffer *buffer, - GtkTextIter *start, - GtkTextIter *end) +gtk_text_buffer_real_delete_range (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end) { g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); g_return_if_fail (start != NULL); @@ -1116,7 +1137,7 @@ gtk_text_buffer_emit_delete (GtkTextBuffer *buffer, * to fix. */ g_signal_emit (G_OBJECT (buffer), - signals[DELETE_TEXT], + signals[DELETE_RANGE], 0, start, end); } @@ -1129,7 +1150,7 @@ gtk_text_buffer_emit_delete (GtkTextBuffer *buffer, * * Deletes text between @start and @end. The order of @start and @end * is not actually relevant; gtk_text_buffer_delete () will reorder - * them. This function actually emits the "delete_text" signal, and + * them. This function actually emits the "delete_range" signal, and * the default handler of that signal deletes the text. Because the * buffer is modified, all outstanding iterators become invalid after * calling this function; however, the @start and @end will be @@ -1360,9 +1381,19 @@ gtk_text_buffer_get_slice (GtkTextBuffer *buffer, } /* - * Pixmaps + * Pixbufs */ +static void +gtk_text_buffer_real_insert_pixbuf (GtkTextBuffer *buffer, + GtkTextIter *iter, + GdkPixbuf *pixbuf) +{ + _gtk_text_btree_insert_pixbuf (iter, pixbuf); + + g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0); +} + void gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer, GtkTextIter *iter, @@ -1372,11 +1403,8 @@ gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer, g_return_if_fail (iter != NULL); g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); - _gtk_text_btree_insert_pixbuf (iter, pixbuf); - - /* FIXME pixbuf-specific signal like insert_text */ - - g_signal_emit (G_OBJECT (buffer), signals[CHANGED], 0); + g_signal_emit (G_OBJECT (buffer), signals[INSERT_PIXBUF], 0, + iter, pixbuf); } /* @@ -1411,7 +1439,7 @@ gtk_text_buffer_mark_set (GtkTextBuffer *buffer, const GtkTextIter *location, GtkTextMark *mark) { - /* IMO this should NOT work like insert_text and delete_text, + /* IMO this should NOT work like insert_text and delete_range, where the real action happens in the default handler. The reason is that the default handler would be _required_, diff --git a/gtk/gtktextbuffer.h b/gtk/gtktextbuffer.h index 9265103bd2..ae7f7570ce 100644 --- a/gtk/gtktextbuffer.h +++ b/gtk/gtktextbuffer.h @@ -81,10 +81,22 @@ struct _GtkTextBufferClass const gchar *text, gint length); + void (* insert_pixbuf) (GtkTextBuffer *buffer, + GtkTextIter *pos, + GdkPixbuf *pixbuf); - void (* delete_text) (GtkTextBuffer *buffer, - GtkTextIter *start, - GtkTextIter *end); +#if 0 + /* FIXME To do this, first have to implement the sequence + * gtk_text_child_anchor_new(); gtk_text_buffer_insert_child_anchor(); + */ + void (* insert_child_anchor) (GtkTextBuffer *buffer, + GtkTextIter *pos, + GtkTextChildAnchor *anchor); +#endif + + void (* delete_range) (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end); /* Only for text/widgets/pixbuf changed, marks/tags don't cause this * to be emitted diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 60e8714fb8..3782cb8250 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -75,7 +75,9 @@ */ #include "gtktextdisplay.h" -#include "gtktextiterprivate.h" +/* DO NOT go putting private headers in here. This file should only + * use the semi-public headers, as with gtktextview.c. + */ #include <pango/pango.h> @@ -741,14 +743,17 @@ gtk_text_layout_draw (GtkTextLayout *layout, if (have_selection) { GtkTextIter line_start, line_end; - gint byte_count = _gtk_text_line_byte_count (line); - - _gtk_text_btree_get_iter_at_line (_gtk_text_buffer_get_btree (layout->buffer), - &line_start, - line, 0); - _gtk_text_btree_get_iter_at_line (_gtk_text_buffer_get_btree (layout->buffer), - &line_end, - line, byte_count - 1); + gint byte_count; + + gtk_text_layout_get_iter_at_line (layout, + &line_start, + line, 0); + byte_count = gtk_text_iter_get_bytes_in_line (&line_start); + + /* FIXME the -1 assumes a newline I think */ + gtk_text_layout_get_iter_at_line (layout, + &line_end, + line, byte_count - 1); if (gtk_text_iter_compare (&selection_start, &line_end) < 0 && gtk_text_iter_compare (&selection_end, &line_start) > 0) diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index eb6e2c3233..e2e0f44cf9 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -373,7 +373,7 @@ static void check_invariants (const GtkTextIter *iter) { if (gtk_debug_flags & GTK_DEBUG_TEXT) - gtk_text_iter_check (iter); + _gtk_text_iter_check (iter); } #else #define check_invariants (x) @@ -448,7 +448,7 @@ gtk_text_iter_free (GtkTextIter *iter) } GtkTextLineSegment* -gtk_text_iter_get_indexable_segment (const GtkTextIter *iter) +_gtk_text_iter_get_indexable_segment (const GtkTextIter *iter) { GtkTextRealIter *real; @@ -467,7 +467,7 @@ gtk_text_iter_get_indexable_segment (const GtkTextIter *iter) } GtkTextLineSegment* -gtk_text_iter_get_any_segment (const GtkTextIter *iter) +_gtk_text_iter_get_any_segment (const GtkTextIter *iter) { GtkTextRealIter *real; @@ -486,7 +486,7 @@ gtk_text_iter_get_any_segment (const GtkTextIter *iter) } gint -gtk_text_iter_get_segment_byte (const GtkTextIter *iter) +_gtk_text_iter_get_segment_byte (const GtkTextIter *iter) { GtkTextRealIter *real; @@ -505,7 +505,7 @@ gtk_text_iter_get_segment_byte (const GtkTextIter *iter) } gint -gtk_text_iter_get_segment_char (const GtkTextIter *iter) +_gtk_text_iter_get_segment_char (const GtkTextIter *iter) { GtkTextRealIter *real; @@ -526,7 +526,7 @@ gtk_text_iter_get_segment_char (const GtkTextIter *iter) /* This function does not require a still-valid iterator */ GtkTextLine* -gtk_text_iter_get_text_line (const GtkTextIter *iter) +_gtk_text_iter_get_text_line (const GtkTextIter *iter) { const GtkTextRealIter *real; @@ -540,7 +540,7 @@ gtk_text_iter_get_text_line (const GtkTextIter *iter) /* This function does not require a still-valid iterator */ GtkTextBTree* -gtk_text_iter_get_btree (const GtkTextIter *iter) +_gtk_text_iter_get_btree (const GtkTextIter *iter) { const GtkTextRealIter *real; @@ -1442,7 +1442,7 @@ gtk_text_iter_get_chars_in_line (const GtkTextIter *iter) { /* We can start at the segments we've already found. */ count = real->line_char_offset - real->segment_char_offset; - seg = gtk_text_iter_get_indexable_segment (iter); + seg = _gtk_text_iter_get_indexable_segment (iter); } else { @@ -1491,7 +1491,7 @@ gtk_text_iter_get_bytes_in_line (const GtkTextIter *iter) { /* We can start at the segments we've already found. */ count = real->line_byte_offset - real->segment_byte_offset; - seg = gtk_text_iter_get_indexable_segment (iter); + seg = _gtk_text_iter_get_indexable_segment (iter); } else { @@ -1675,7 +1675,7 @@ forward_char (GtkTextRealIter *real) { /* Need to move to the next segment; if no next segment, need to move to next line. */ - return gtk_text_iter_forward_indexable_segment (iter); + return _gtk_text_iter_forward_indexable_segment (iter); } else { @@ -1719,7 +1719,7 @@ forward_char (GtkTextRealIter *real) } gboolean -gtk_text_iter_forward_indexable_segment (GtkTextIter *iter) +_gtk_text_iter_forward_indexable_segment (GtkTextIter *iter) { /* Need to move to the next segment; if no next segment, need to move to next line. */ @@ -1842,7 +1842,7 @@ at_last_indexable_segment (GtkTextRealIter *real) * ends up on a different segment if it returns TRUE) */ gboolean -gtk_text_iter_backward_indexable_segment (GtkTextIter *iter) +_gtk_text_iter_backward_indexable_segment (GtkTextIter *iter) { /* Move to the start of the previous segment; if no previous * segment, to the last segment in the previous line. This is @@ -1885,7 +1885,7 @@ gtk_text_iter_backward_indexable_segment (GtkTextIter *iter) { /* Go forward to last indexable segment in line. */ while (!at_last_indexable_segment (real)) - gtk_text_iter_forward_indexable_segment (iter); + _gtk_text_iter_forward_indexable_segment (iter); check_invariants (iter); @@ -3041,7 +3041,7 @@ gtk_text_iter_forward_to_tag_toggle (GtkTextIter *iter, next_line = _gtk_text_line_next_could_contain_tag (current_line, real->tree, tag); - while (gtk_text_iter_forward_indexable_segment (iter)) + while (_gtk_text_iter_forward_indexable_segment (iter)) { /* If we went forward to a line that couldn't contain a toggle for the tag, then skip forward to a line that could contain @@ -3129,7 +3129,7 @@ gtk_text_iter_backward_to_tag_toggle (GtkTextIter *iter, */ if (is_segment_start (real)) { - if (!gtk_text_iter_backward_indexable_segment (iter)) + if (!_gtk_text_iter_backward_indexable_segment (iter)) return FALSE; } else @@ -3164,7 +3164,7 @@ gtk_text_iter_backward_to_tag_toggle (GtkTextIter *iter, iter_set_from_byte_offset (real, prev_line, 0); while (!at_last_indexable_segment (real)) - gtk_text_iter_forward_indexable_segment (iter); + _gtk_text_iter_forward_indexable_segment (iter); } current_line = real->line; @@ -3182,7 +3182,7 @@ gtk_text_iter_backward_to_tag_toggle (GtkTextIter *iter, return TRUE; } } - while (gtk_text_iter_backward_indexable_segment (iter)); + while (_gtk_text_iter_backward_indexable_segment (iter)); /* Reached front of buffer */ return FALSE; @@ -4218,7 +4218,7 @@ _gtk_text_btree_get_iter_at_mark (GtkTextBTree *tree, iter_init_from_segment (iter, tree, seg->body.mark.line, seg); - g_assert (seg->body.mark.line == gtk_text_iter_get_text_line (iter)); + g_assert (seg->body.mark.line == _gtk_text_iter_get_text_line (iter)); check_invariants (iter); } @@ -4237,7 +4237,7 @@ _gtk_text_btree_get_iter_at_child_anchor (GtkTextBTree *tree, iter_init_from_segment (iter, tree, seg->body.child.line, seg); - g_assert (seg->body.child.line == gtk_text_iter_get_text_line (iter)); + g_assert (seg->body.child.line == _gtk_text_iter_get_text_line (iter)); check_invariants (iter); } @@ -4277,7 +4277,7 @@ gtk_text_iter_spew (const GtkTextIter *iter, const gchar *desc) } void -gtk_text_iter_check (const GtkTextIter *iter) +_gtk_text_iter_check (const GtkTextIter *iter) { const GtkTextRealIter *real = (const GtkTextRealIter*)iter; gint line_char_offset, line_byte_offset, seg_char_offset, seg_byte_offset; diff --git a/gtk/gtktextiterprivate.h b/gtk/gtktextiterprivate.h index 55f661102f..b0c38662d5 100644 --- a/gtk/gtktextiterprivate.h +++ b/gtk/gtktextiterprivate.h @@ -10,18 +10,18 @@ extern "C" { #include <gtk/gtktextiter.h> #include <gtk/gtktextbtree.h> -GtkTextLineSegment *gtk_text_iter_get_indexable_segment (const GtkTextIter *iter); -GtkTextLineSegment *gtk_text_iter_get_any_segment (const GtkTextIter *iter); -GtkTextLine * gtk_text_iter_get_text_line (const GtkTextIter *iter); -GtkTextBTree * gtk_text_iter_get_btree (const GtkTextIter *iter); -gboolean gtk_text_iter_forward_indexable_segment (GtkTextIter *iter); -gboolean gtk_text_iter_backward_indexable_segment (GtkTextIter *iter); -gint gtk_text_iter_get_segment_byte (const GtkTextIter *iter); -gint gtk_text_iter_get_segment_char (const GtkTextIter *iter); +GtkTextLineSegment *_gtk_text_iter_get_indexable_segment (const GtkTextIter *iter); +GtkTextLineSegment *_gtk_text_iter_get_any_segment (const GtkTextIter *iter); +GtkTextLine * _gtk_text_iter_get_text_line (const GtkTextIter *iter); +GtkTextBTree * _gtk_text_iter_get_btree (const GtkTextIter *iter); +gboolean _gtk_text_iter_forward_indexable_segment (GtkTextIter *iter); +gboolean _gtk_text_iter_backward_indexable_segment (GtkTextIter *iter); +gint _gtk_text_iter_get_segment_byte (const GtkTextIter *iter); +gint _gtk_text_iter_get_segment_char (const GtkTextIter *iter); /* debug */ -void gtk_text_iter_check (const GtkTextIter *iter); +void _gtk_text_iter_check (const GtkTextIter *iter); #ifdef __cplusplus } diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index b95a66c54b..458142dec5 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -384,7 +384,7 @@ gtk_text_layout_set_cursor_visible (GtkTextLayout *layout, gtk_text_layout_get_line_yrange (layout, &iter, &y, &height); gtk_text_layout_changed (layout, y, height, height); - gtk_text_layout_invalidate_cache (layout, gtk_text_iter_get_text_line (&iter)); + gtk_text_layout_invalidate_cache (layout, _gtk_text_iter_get_text_line (&iter)); } } @@ -456,7 +456,7 @@ gtk_text_layout_set_preedit_string (GtkTextLayout *layout, gtk_text_buffer_get_iter_at_mark (layout->buffer, &iter, gtk_text_buffer_get_mark (layout->buffer, "insert")); - line = gtk_text_iter_get_text_line (&iter); + line = _gtk_text_iter_get_text_line (&iter); line_data = _gtk_text_line_get_data (line, layout); if (line_data) { @@ -664,8 +664,8 @@ gtk_text_layout_real_invalidate (GtkTextLayout *layout, gtk_text_view_index_spew (end_index, "invalidate end"); #endif - last_line = gtk_text_iter_get_text_line (end); - line = gtk_text_iter_get_text_line (start); + last_line = _gtk_text_iter_get_text_line (end); + line = _gtk_text_iter_get_text_line (start); while (TRUE) { @@ -769,7 +769,7 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout, /* Validate backwards from the anchor line to y0 */ - line = gtk_text_iter_get_text_line (anchor); + line = _gtk_text_iter_get_text_line (anchor); seen = 0; while (line && seen < -y0) { @@ -798,7 +798,7 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout, } /* Validate forwards to y1 */ - line = gtk_text_iter_get_text_line (anchor); + line = _gtk_text_iter_get_text_line (anchor); seen = 0; while (line && seen < y1) { @@ -1636,7 +1636,7 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout, /* Iterate over segments, creating display chunks for them. */ byte_offset = 0; - seg = gtk_text_iter_get_any_segment (&iter); + seg = _gtk_text_iter_get_any_segment (&iter); while (seg != NULL) { /* Displayable segments */ @@ -1645,8 +1645,8 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout, seg->type == >k_text_child_type) { _gtk_text_btree_get_iter_at_line (_gtk_text_buffer_get_btree (layout->buffer), - &iter, line, - byte_offset); + &iter, line, + byte_offset); style = get_style (layout, &iter); /* We have to delay setting the paragraph values until we @@ -1912,7 +1912,7 @@ line_display_iter_to_index (GtkTextLayout *layout, { gint index; - g_return_val_if_fail (gtk_text_iter_get_text_line (iter) == display->line, 0); + g_return_val_if_fail (_gtk_text_iter_get_text_line (iter) == display->line, 0); index = gtk_text_iter_get_line_index (iter); @@ -2089,7 +2089,7 @@ gtk_text_layout_get_cursor_locations (GtkTextLayout *layout, g_return_if_fail (layout != NULL); g_return_if_fail (iter != NULL); - line = gtk_text_iter_get_text_line (iter); + line = _gtk_text_iter_get_text_line (iter); display = gtk_text_layout_get_line_display (layout, line, FALSE); index = line_display_iter_to_index (layout, display, iter); @@ -2140,9 +2140,9 @@ gtk_text_layout_get_line_yrange (GtkTextLayout *layout, GtkTextLine *line; g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); - g_return_if_fail (gtk_text_iter_get_btree (iter) == _gtk_text_buffer_get_btree (layout->buffer)); + g_return_if_fail (_gtk_text_iter_get_btree (iter) == _gtk_text_buffer_get_btree (layout->buffer)); - line = gtk_text_iter_get_text_line (iter); + line = _gtk_text_iter_get_text_line (iter); if (y) *y = _gtk_text_btree_find_line_top (_gtk_text_buffer_get_btree (layout->buffer), @@ -2170,11 +2170,11 @@ gtk_text_layout_get_iter_location (GtkTextLayout *layout, gint x_offset; g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); - g_return_if_fail (gtk_text_iter_get_btree (iter) == _gtk_text_buffer_get_btree (layout->buffer)); + g_return_if_fail (_gtk_text_iter_get_btree (iter) == _gtk_text_buffer_get_btree (layout->buffer)); g_return_if_fail (rect != NULL); - tree = gtk_text_iter_get_btree (iter); - line = gtk_text_iter_get_text_line (iter); + tree = _gtk_text_iter_get_btree (iter); + line = _gtk_text_iter_get_text_line (iter); display = gtk_text_layout_get_line_display (layout, line, FALSE); @@ -2409,7 +2409,7 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout, orig = *iter; - line = gtk_text_iter_get_text_line (iter); + line = _gtk_text_iter_get_text_line (iter); display = gtk_text_layout_get_line_display (layout, line, FALSE); line_byte = line_display_iter_to_index (layout, display, iter); @@ -2488,7 +2488,7 @@ gtk_text_layout_move_iter_to_next_line (GtkTextLayout *layout, orig = *iter; - line = gtk_text_iter_get_text_line (iter); + line = _gtk_text_iter_get_text_line (iter); while (line && !found_after) { @@ -2556,7 +2556,7 @@ gtk_text_layout_move_iter_to_line_end (GtkTextLayout *layout, orig = *iter; - line = gtk_text_iter_get_text_line (iter); + line = _gtk_text_iter_get_text_line (iter); display = gtk_text_layout_get_line_display (layout, line, FALSE); line_byte = line_display_iter_to_index (layout, display, iter); @@ -2612,7 +2612,7 @@ gtk_text_layout_iter_starts_line (GtkTextLayout *layout, g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), FALSE); g_return_val_if_fail (iter != NULL, FALSE); - line = gtk_text_iter_get_text_line (iter); + line = _gtk_text_iter_get_text_line (iter); display = gtk_text_layout_get_line_display (layout, line, FALSE); line_byte = line_display_iter_to_index (layout, display, iter); @@ -2642,6 +2642,17 @@ gtk_text_layout_iter_starts_line (GtkTextLayout *layout, return FALSE; } +void +gtk_text_layout_get_iter_at_line (GtkTextLayout *layout, + GtkTextIter *iter, + GtkTextLine *line, + gint byte_offset) +{ + _gtk_text_btree_get_iter_at_line (_gtk_text_buffer_get_btree (layout->buffer), + iter, line, byte_offset); +} + + /** * gtk_text_layout_move_iter_to_x: * @layout: a #GtkTextLayout @@ -2666,7 +2677,7 @@ gtk_text_layout_move_iter_to_x (GtkTextLayout *layout, g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); g_return_if_fail (iter != NULL); - line = gtk_text_iter_get_text_line (iter); + line = _gtk_text_iter_get_text_line (iter); display = gtk_text_layout_get_line_display (layout, line, FALSE); line_byte = line_display_iter_to_index (layout, display, iter); @@ -2736,7 +2747,7 @@ gtk_text_layout_move_iter_visually (GtkTextLayout *layout, while (count != 0) { - GtkTextLine *line = gtk_text_iter_get_text_line (iter); + GtkTextLine *line = _gtk_text_iter_get_text_line (iter); gint line_byte; gint extra_back = 0; diff --git a/gtk/gtktextlayout.h b/gtk/gtktextlayout.h index e6cde73f85..4e0ed1f228 100644 --- a/gtk/gtktextlayout.h +++ b/gtk/gtktextlayout.h @@ -356,6 +356,11 @@ gboolean gtk_text_layout_move_iter_visually (GtkTextLayout *layout, gboolean gtk_text_layout_iter_starts_line (GtkTextLayout *layout, const GtkTextIter *iter); +void gtk_text_layout_get_iter_at_line (GtkTextLayout *layout, + GtkTextIter *iter, + GtkTextLine *line, + gint byte_offset); + /* Don't use these. Use gtk_text_view_add_child_at_anchor(). * These functions are defined in gtktextchild.c, but here * since they are semi-public and require GtkTextLayout to diff --git a/gtk/gtktextsegment.c b/gtk/gtktextsegment.c index e37e78ac9c..0b1c0cc290 100644 --- a/gtk/gtktextsegment.c +++ b/gtk/gtktextsegment.c @@ -97,13 +97,13 @@ gtk_text_line_segment_split (const GtkTextIter *iter) GtkTextLine *line; int count; - line = gtk_text_iter_get_text_line (iter); - tree = gtk_text_iter_get_btree (iter); + line = _gtk_text_iter_get_text_line (iter); + tree = _gtk_text_iter_get_btree (iter); count = gtk_text_iter_get_line_index (iter); if (gtk_debug_flags & GTK_DEBUG_TEXT) - gtk_text_iter_check (iter); + _gtk_text_iter_check (iter); prev = NULL; seg = line->segments; diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 47faaef1d4..a91e6d1a91 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -541,16 +541,16 @@ gtk_text_view_class_init (GtkTextViewClass *klass) /* Moving the insertion point */ add_move_binding (binding_set, GDK_Right, 0, - GTK_MOVEMENT_POSITIONS, 1); + GTK_MOVEMENT_VISUAL_POSITIONS, 1); add_move_binding (binding_set, GDK_Left, 0, - GTK_MOVEMENT_POSITIONS, -1); + GTK_MOVEMENT_VISUAL_POSITIONS, -1); add_move_binding (binding_set, GDK_f, GDK_CONTROL_MASK, - GTK_MOVEMENT_CHARS, 1); + GTK_MOVEMENT_LOGICAL_POSITIONS, 1); add_move_binding (binding_set, GDK_b, GDK_CONTROL_MASK, - GTK_MOVEMENT_CHARS, -1); + GTK_MOVEMENT_LOGICAL_POSITIONS, -1); add_move_binding (binding_set, GDK_Right, GDK_CONTROL_MASK, GTK_MOVEMENT_WORDS, 1); @@ -3278,11 +3278,11 @@ gtk_text_view_move_cursor (GtkTextView *text_view, switch (step) { - case GTK_MOVEMENT_CHARS: + case GTK_MOVEMENT_LOGICAL_POSITIONS: gtk_text_iter_forward_cursor_positions (&newplace, count); break; - case GTK_MOVEMENT_POSITIONS: + case GTK_MOVEMENT_VISUAL_POSITIONS: gtk_text_layout_move_iter_visually (text_view->layout, &newplace, count); break; diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 755572afae..0a870ace53 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2674,12 +2674,14 @@ gtk_tree_view_draw_arrow (GtkTreeView *tree_view, { GdkRectangle area; GtkStateType state; - GtkShadowType shadow; GdkPoint points[3]; - + GtkWidget *widget; + if (! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_PARENT)) return; + widget = GTK_WIDGET (tree_view); + area.x = 0; area.y = offset + TREE_VIEW_VERTICAL_SEPARATOR; area.width = tree_view->priv->tab_offset - 2; @@ -2689,61 +2691,27 @@ gtk_tree_view_draw_arrow (GtkTreeView *tree_view, { if (x >= area.x && x <= (area.x + area.width) && y >= area.y && y <= (area.y + area.height)) - { - state = GTK_STATE_ACTIVE; - shadow = GTK_SHADOW_IN; - } + state = GTK_STATE_ACTIVE; else - { - state = GTK_STATE_NORMAL; - shadow = GTK_SHADOW_OUT; - } + state = GTK_STATE_NORMAL; } else { state = (node==tree_view->priv->prelight_node&>K_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_ARROW_PRELIT)?GTK_STATE_PRELIGHT:GTK_STATE_NORMAL); - shadow = GTK_SHADOW_OUT; } - if (node->children == NULL) - { - points[0].x = area.x + 2; - points[0].y = area.y + (area.height - TREE_VIEW_EXPANDER_HEIGHT)/2; - points[1].x = points[0].x + TREE_VIEW_EXPANDER_WIDTH/2; - points[1].y = points[0].y + TREE_VIEW_EXPANDER_HEIGHT/2; - points[2].x = points[0].x; - points[2].y = points[0].y + TREE_VIEW_EXPANDER_HEIGHT; - } - else - { - points[0].x = area.x; - points[0].y = area.y + (area.height - TREE_VIEW_EXPANDER_WIDTH/2)/2; - points[1].x = points[0].x + TREE_VIEW_EXPANDER_WIDTH; - points[1].y = points[0].y; - points[2].x = points[0].x + (TREE_VIEW_EXPANDER_WIDTH) /2; - points[2].y = points[0].y + TREE_VIEW_EXPANDER_HEIGHT/2; - } - - /* FIXME this should be in the theme engine */ - - gdk_draw_polygon (tree_view->priv->bin_window, - GTK_WIDGET (tree_view)->style->base_gc[state], - TRUE, points, 3); - gdk_draw_polygon (tree_view->priv->bin_window, - GTK_WIDGET (tree_view)->style->fg_gc[state], - FALSE, points, 3); - - /* gtk_paint_arrow (GTK_WIDGET (tree_view)->style, */ - /* tree_view->priv->bin_window, */ - /* state, */ - /* shadow, */ - /* &area, */ - /* GTK_WIDGET (tree_view), */ - /* "GtkTreeView", */ - /* arrow_dir, */ - /* TRUE, */ - /* area.x, area.y, */ - /* area.width, area.height); */ + /* FIXME expander size should come from a style property */ +#define EXPANDER_SIZE 8 + gtk_paint_expander (widget->style, + tree_view->priv->bin_window, + state, + &area, + widget, + "treeview", + area.x, + (area.y + (area.height - EXPANDER_SIZE) / 2 - (area.height + 1) % 2), + node->children != NULL); +#undef EXPANDER_SIZE } void diff --git a/gtk/gtkvruler.c b/gtk/gtkvruler.c index 2f794821c1..5c111ffcfa 100644 --- a/gtk/gtkvruler.c +++ b/gtk/gtkvruler.c @@ -256,11 +256,17 @@ gtk_vruler_draw_ticks (GtkRuler *ruler) { pango_layout_set_text (layout, unit_str + j, 1); pango_layout_get_extents (layout, NULL, &logical_rect); - - gdk_draw_layout (ruler->backing_store, gc, - xthickness + 1, - pos + digit_height * j + 2 + PANGO_PIXELS (logical_rect.y - digit_offset), - layout); + + + gtk_paint_layout (widget->style, + ruler->backing_store, + GTK_WIDGET_STATE (widget), + NULL, + widget, + "vruler", + xthickness + 1, + pos + digit_height * j + 2 + PANGO_PIXELS (logical_rect.y - digit_offset), + layout); } } } diff --git a/gtk/gtkvscale.c b/gtk/gtkvscale.c index 0beebdb887..b41798cdb0 100644 --- a/gtk/gtkvscale.c +++ b/gtk/gtkvscale.c @@ -530,17 +530,14 @@ gtk_vscale_draw_value (GtkScale *scale) if (!GTK_WIDGET_IS_SENSITIVE (scale)) state_type = GTK_STATE_INSENSITIVE; -#if 0 - gtk_paint_string (GTK_WIDGET (scale)->style, - GTK_WIDGET (scale)->window, - state_type, - NULL, GTK_WIDGET (scale), "vscale", - x, y, buffer); -#endif - - gdk_draw_layout (GTK_WIDGET (scale)->window, - GTK_WIDGET (scale)->style->fg_gc [state_type], - x, y, layout); + gtk_paint_layout (widget->style, + widget->window, + state_type, + NULL, + widget, + "vscale", + x, y, + layout); g_object_unref (G_OBJECT (layout)); } diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index c0d48baed2..c78479ce6f 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1106,7 +1106,7 @@ gtk_widget_queue_clear_child (GtkWidget *widget) * gtk_widget_unparent: * @widget: a #GtkWidget * - * INTERNAL FUNCTION, only for use in widget implementations. + * This function is only for use in widget implementations. * Should be called by implementations of the remove method * on #GtkContainer, to dissociate a child from the container. **/ @@ -1491,7 +1491,7 @@ gtk_widget_hide_all (GtkWidget *widget) * gtk_widget_map: * @widget: a #GtkWidget * - * INTERNAL FUNCTION, only for use in widget implementations. Causes + * This function is only for use in widget implementations. Causes * a widget to be mapped if it isn't already. * **/ @@ -1517,7 +1517,7 @@ gtk_widget_map (GtkWidget *widget) * gtk_widget_unmap: * @widget: a #GtkWidget * - * INTERNAL FUNCTION, only for use in widget implementations. Causes + * This function is only for use in widget implementations. Causes * a widget to be unmapped if it's currently mapped. * **/ @@ -1616,7 +1616,7 @@ gtk_widget_realize (GtkWidget *widget) * gtk_widget_unrealize: * @widget: a #GtkWidget * - * INTERNAL FUNCTION, only useful in widget implementations. + * This function is only useful in widget implementations. * Causes a widget to be unrealized (frees all GDK resources * associated with the widget, such as widget->window). * @@ -1811,7 +1811,7 @@ gtk_widget_queue_clear (GtkWidget *widget) * gtk_widget_queue_resize: * @widget: a #GtkWidget * - * INTERNAL FUNCTION, for use in widget implementations. + * This function is only for use in widget implementations. * Flags a widget to have its size renegotiated; should * be called when a widget for some reason has a new size request. * For example, when you change the text in a #GtkLabel, #GtkLabel @@ -1874,7 +1874,7 @@ gtk_widget_draw (GtkWidget *widget, * gtk_widget_draw_focus: * @widget: a #GtkWidget * - * INTERNAL FUNCTION for use in widget implementations. Invokes the + * This function is only for use in widget implementations. Invokes the * "draw_focus" virtual method/signal on @widget, causing the focus * rectangle to be drawn or undrawn according to the focus state of * the widget. Normally called from widget implementations in the @@ -1894,7 +1894,7 @@ gtk_widget_draw_focus (GtkWidget *widget) * gtk_widget_draw_default: * @widget: a #GtkWidget * - * INTERNAL FUNCTION for use in widget implementations. Invokes the + * This function is only for use in widget implementations. Invokes the * "draw_default" virtual method/signal on a widget, causing it to * draw the default rectangle (indicating that the widget is * the default widget, i.e. the one that's activated by pressing @@ -1914,7 +1914,7 @@ gtk_widget_draw_default (GtkWidget *widget) * @widget: a #GtkWidget * @requisition: a #GtkRequisition to be filled in * - * INTERNAL FUNCTION used when implementing a #GtkContainer subclass. + * This function is only used when implementing a #GtkContainer subclass. * Obtains the preferred size of a widget. The container uses this * information to arrange its child widgets and decide what size allocations * to give them with gtk_widget_size_allocate(). @@ -1947,7 +1947,7 @@ gtk_widget_size_request (GtkWidget *widget, * @widget: a #GtkWidget * @requisition: a #GtkRequisition to be filled in * - * INTERNAL FUNCTION for use in widget implementations. Obtains + * This function is only for use in widget implementations. Obtains * @widget->requisition, unless someone has forced a particular * geometry on the widget (e.g. with gtk_widget_set_usize()), in which * case it returns that geometry instead of the widget's requisition. @@ -1978,7 +1978,7 @@ gtk_widget_get_child_requisition (GtkWidget *widget, * @widget: a #GtkWidget * @allocation: position and size to be allocated to @widget * - * INTERNAL FUNCTION used by containers to assign a size + * This function is only used by #GtkContainer subclasses, to assign a size * and position to their child widgets. * **/ @@ -2257,7 +2257,7 @@ gtk_widget_real_key_release_event (GtkWidget *widget, * @widget: a #GtkWidget * @event: a #GdkEvent * - * INTERNAL FUNCTION. This function is used to emit + * Rarely-used function. This function is used to emit * the event signals on a widget (those signals should never * be emitted without using this function to do so). * If you want to synthesize an event though, don't use this function; @@ -2815,7 +2815,7 @@ gtk_widget_get_name (GtkWidget *widget) * @widget: a #GtkWidget * @state: new state for @widget * - * INTERNAL FUNCTION for use in widget implementations. Sets the state + * This function is for use in widget implementations. Sets the state * of a widget (insensitive, prelighted, etc.) Usually you should set * the state using wrapper functions such as gtk_widget_set_sensitive(). * @@ -2958,7 +2958,7 @@ gtk_widget_set_sensitive (GtkWidget *widget, * @widget: a #GtkWidget * @parent: parent container * - * INTERNAL FUNCTION for use while implementing subclasses of #GtkContainer. + * This function is useful only when implementing subclasses of #GtkContainer. * Sets the container as the parent of @widget, and takes care of * some details such as updating the state and style of the child * to reflect its new location. The opposite function is diff --git a/gtk/testtext.c b/gtk/testtext.c index 54b94a59d5..3086f0bdbd 100644 --- a/gtk/testtext.c +++ b/gtk/testtext.c @@ -2078,12 +2078,14 @@ line_numbers_expose (GtkWidget *widget, pango_layout_set_text (layout, str, -1); - - gdk_draw_layout (target, - widget->style->fg_gc [widget->state], - /* 2 is just a random padding */ - 2, pos + 2, - layout); + gtk_paint_layout (widget->style, + target, + GTK_WIDGET_STATE (widget), + NULL, + widget, + NULL, + 2, pos + 2, + layout); g_free (str); diff --git a/tests/testtext.c b/tests/testtext.c index 54b94a59d5..3086f0bdbd 100644 --- a/tests/testtext.c +++ b/tests/testtext.c @@ -2078,12 +2078,14 @@ line_numbers_expose (GtkWidget *widget, pango_layout_set_text (layout, str, -1); - - gdk_draw_layout (target, - widget->style->fg_gc [widget->state], - /* 2 is just a random padding */ - 2, pos + 2, - layout); + gtk_paint_layout (widget->style, + target, + GTK_WIDGET_STATE (widget), + NULL, + widget, + NULL, + 2, pos + 2, + layout); g_free (str); |