2008-07-01 22:57:50 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
1998-06-16 05:20:05 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2010-09-09 13:35:58 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtktable.h"
|
2010-09-09 13:35:58 +00:00
|
|
|
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2010-09-09 13:35:58 +00:00
|
|
|
#include "gtksizerequest.h"
|
2001-03-30 15:46:17 +00:00
|
|
|
#include "gtkintl.h"
|
2010-07-09 17:22:23 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
|
2010-08-26 17:15:37 +00:00
|
|
|
struct _GtkTablePrivate
|
2010-07-13 01:55:37 +00:00
|
|
|
{
|
|
|
|
GtkTableRowCol *cols;
|
|
|
|
GtkTableRowCol *rows;
|
|
|
|
|
|
|
|
GList *children;
|
|
|
|
|
|
|
|
guint16 column_spacing;
|
|
|
|
guint16 ncols;
|
|
|
|
guint16 nrows;
|
|
|
|
guint16 row_spacing;
|
|
|
|
|
|
|
|
guint homogeneous : 1;
|
|
|
|
};
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
enum
|
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_N_ROWS,
|
|
|
|
PROP_N_COLUMNS,
|
|
|
|
PROP_COLUMN_SPACING,
|
|
|
|
PROP_ROW_SPACING,
|
|
|
|
PROP_HOMOGENEOUS
|
1998-06-16 05:20:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
CHILD_PROP_0,
|
|
|
|
CHILD_PROP_LEFT_ATTACH,
|
|
|
|
CHILD_PROP_RIGHT_ATTACH,
|
|
|
|
CHILD_PROP_TOP_ATTACH,
|
|
|
|
CHILD_PROP_BOTTOM_ATTACH,
|
|
|
|
CHILD_PROP_X_OPTIONS,
|
|
|
|
CHILD_PROP_Y_OPTIONS,
|
|
|
|
CHILD_PROP_X_PADDING,
|
|
|
|
CHILD_PROP_Y_PADDING
|
1998-06-16 05:20:05 +00:00
|
|
|
};
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
static void gtk_table_finalize (GObject *object);
|
1998-06-16 05:20:05 +00:00
|
|
|
static void gtk_table_size_request (GtkWidget *widget,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkRequisition *requisition);
|
1998-06-16 05:20:05 +00:00
|
|
|
static void gtk_table_size_allocate (GtkWidget *widget,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkAllocation *allocation);
|
1998-06-16 05:20:05 +00:00
|
|
|
static void gtk_table_add (GtkContainer *container,
|
|
|
|
GtkWidget *widget);
|
|
|
|
static void gtk_table_remove (GtkContainer *container,
|
|
|
|
GtkWidget *widget);
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
static void gtk_table_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkCallback callback,
|
1998-06-16 05:20:05 +00:00
|
|
|
gpointer callback_data);
|
2001-03-30 15:46:17 +00:00
|
|
|
static void gtk_table_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_table_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
static void gtk_table_set_child_property (GtkContainer *container,
|
|
|
|
GtkWidget *child,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_table_get_child_property (GtkContainer *container,
|
|
|
|
GtkWidget *child,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2002-10-10 01:02:25 +00:00
|
|
|
static GType gtk_table_child_type (GtkContainer *container);
|
1998-06-16 05:20:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void gtk_table_size_request_init (GtkTable *table);
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_table_size_request_pass1 (GtkTable *table);
|
|
|
|
static void gtk_table_size_request_pass2 (GtkTable *table);
|
|
|
|
static void gtk_table_size_request_pass3 (GtkTable *table);
|
|
|
|
|
|
|
|
static void gtk_table_size_allocate_init (GtkTable *table);
|
|
|
|
static void gtk_table_size_allocate_pass1 (GtkTable *table);
|
|
|
|
static void gtk_table_size_allocate_pass2 (GtkTable *table);
|
|
|
|
|
|
|
|
|
2006-05-14 04:25:34 +00:00
|
|
|
G_DEFINE_TYPE (GtkTable, gtk_table, GTK_TYPE_CONTAINER)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_class_init (GtkTableClass *class)
|
|
|
|
{
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
|
|
|
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
|
1998-06-16 05:20:05 +00:00
|
|
|
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
gobject_class->finalize = gtk_table_finalize;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
gobject_class->get_property = gtk_table_get_property;
|
|
|
|
gobject_class->set_property = gtk_table_set_property;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
widget_class->size_request = gtk_table_size_request;
|
|
|
|
widget_class->size_allocate = gtk_table_size_allocate;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
container_class->add = gtk_table_add;
|
|
|
|
container_class->remove = gtk_table_remove;
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
container_class->forall = gtk_table_forall;
|
1998-06-16 05:20:05 +00:00
|
|
|
container_class->child_type = gtk_table_child_type;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
container_class->set_child_property = gtk_table_set_child_property;
|
|
|
|
container_class->get_child_property = gtk_table_get_child_property;
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_N_ROWS,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("n-rows",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Rows"),
|
|
|
|
P_("The number of rows in the table"),
|
2007-12-28 19:20:26 +00:00
|
|
|
1,
|
2008-10-09 15:57:55 +00:00
|
|
|
65535,
|
2007-12-28 19:20:26 +00:00
|
|
|
1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-03-30 15:46:17 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_N_COLUMNS,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("n-columns",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Columns"),
|
|
|
|
P_("The number of columns in the table"),
|
2007-12-28 19:20:26 +00:00
|
|
|
1,
|
2008-10-09 15:57:55 +00:00
|
|
|
65535,
|
2007-12-28 19:20:26 +00:00
|
|
|
1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-03-30 15:46:17 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_ROW_SPACING,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("row-spacing",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Row spacing"),
|
|
|
|
P_("The amount of space between two consecutive rows"),
|
2001-03-30 15:46:17 +00:00
|
|
|
0,
|
2008-10-09 15:57:55 +00:00
|
|
|
65535,
|
2001-03-30 15:46:17 +00:00
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-03-30 15:46:17 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_COLUMN_SPACING,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("column-spacing",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Column spacing"),
|
|
|
|
P_("The amount of space between two consecutive columns"),
|
2001-03-30 15:46:17 +00:00
|
|
|
0,
|
2008-10-09 15:57:55 +00:00
|
|
|
65535,
|
2001-03-30 15:46:17 +00:00
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-03-30 15:46:17 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_HOMOGENEOUS,
|
|
|
|
g_param_spec_boolean ("homogeneous",
|
2006-07-06 05:14:03 +00:00
|
|
|
P_("Homogeneous"),
|
|
|
|
P_("If TRUE, the table cells are all the same width/height"),
|
2001-03-30 15:46:17 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-03-30 15:46:17 +00:00
|
|
|
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_LEFT_ATTACH,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("left-attach",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Left attachment"),
|
|
|
|
P_("The column number to attach the left side of the child to"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
0, 65535, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_RIGHT_ATTACH,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("right-attach",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Right attachment"),
|
|
|
|
P_("The column number to attach the right side of a child widget to"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
1, 65535, 1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_TOP_ATTACH,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("top-attach",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Top attachment"),
|
|
|
|
P_("The row number to attach the top of a child widget to"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
0, 65535, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_BOTTOM_ATTACH,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("bottom-attach",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Bottom attachment"),
|
|
|
|
P_("The row number to attach the bottom of the child to"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
1, 65535, 1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_X_OPTIONS,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_flags ("x-options",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Horizontal options"),
|
|
|
|
P_("Options specifying the horizontal behaviour of the child"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GTK_TYPE_ATTACH_OPTIONS, GTK_EXPAND | GTK_FILL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_Y_OPTIONS,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_flags ("y-options",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Vertical options"),
|
|
|
|
P_("Options specifying the vertical behaviour of the child"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GTK_TYPE_ATTACH_OPTIONS, GTK_EXPAND | GTK_FILL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_X_PADDING,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("x-padding",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Horizontal padding"),
|
|
|
|
P_("Extra space to put between the child and its left and right neighbors, in pixels"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
0, 65535, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_container_class_install_child_property (container_class,
|
|
|
|
CHILD_PROP_Y_PADDING,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uint ("y-padding",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Vertical padding"),
|
|
|
|
P_("Extra space to put between the child and its upper and lower neighbors, in pixels"),
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
0, 65535, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2010-07-13 01:55:37 +00:00
|
|
|
|
2010-08-26 17:15:37 +00:00
|
|
|
g_type_class_add_private (class, sizeof (GtkTablePrivate));
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
2002-10-10 01:02:25 +00:00
|
|
|
static GType
|
1998-06-16 05:20:05 +00:00
|
|
|
gtk_table_child_type (GtkContainer *container)
|
|
|
|
{
|
|
|
|
return GTK_TYPE_WIDGET;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
gtk_table_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
GtkTable *table = GTK_TABLE (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
switch (prop_id)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_N_ROWS:
|
2010-07-13 01:55:37 +00:00
|
|
|
g_value_set_uint (value, priv->nrows);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_N_COLUMNS:
|
2010-07-13 01:55:37 +00:00
|
|
|
g_value_set_uint (value, priv->ncols);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_ROW_SPACING:
|
2010-07-13 01:55:37 +00:00
|
|
|
g_value_set_uint (value, priv->row_spacing);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_COLUMN_SPACING:
|
2010-07-13 01:55:37 +00:00
|
|
|
g_value_set_uint (value, priv->column_spacing);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_HOMOGENEOUS:
|
2010-07-13 01:55:37 +00:00
|
|
|
g_value_set_boolean (value, priv->homogeneous);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-01-27 23:40:51 +00:00
|
|
|
static void
|
2001-03-30 15:46:17 +00:00
|
|
|
gtk_table_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
GtkTable *table = GTK_TABLE (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2001-03-30 15:46:17 +00:00
|
|
|
switch (prop_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_N_ROWS:
|
2010-07-13 01:55:37 +00:00
|
|
|
gtk_table_resize (table, g_value_get_uint (value), priv->ncols);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_N_COLUMNS:
|
2010-07-13 01:55:37 +00:00
|
|
|
gtk_table_resize (table, priv->nrows, g_value_get_uint (value));
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_ROW_SPACING:
|
|
|
|
gtk_table_set_row_spacings (table, g_value_get_uint (value));
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_COLUMN_SPACING:
|
|
|
|
gtk_table_set_col_spacings (table, g_value_get_uint (value));
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
2001-03-30 15:46:17 +00:00
|
|
|
case PROP_HOMOGENEOUS:
|
|
|
|
gtk_table_set_homogeneous (table, g_value_get_boolean (value));
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
|
|
|
default:
|
2001-03-30 15:46:17 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-01-27 23:40:51 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-27 23:40:51 +00:00
|
|
|
static void
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_table_set_child_property (GtkContainer *container,
|
|
|
|
GtkWidget *child,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
1998-01-27 23:40:51 +00:00
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GtkTable *table = GTK_TABLE (container);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1998-06-16 05:20:05 +00:00
|
|
|
GtkTableChild *table_child;
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
table_child = NULL;
|
2010-07-13 01:55:37 +00:00
|
|
|
for (list = priv->children; list; list = list->next)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
table_child = list->data;
|
|
|
|
|
|
|
|
if (table_child->widget == child)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!list)
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
{
|
|
|
|
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
|
|
|
return;
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
switch (property_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_LEFT_ATTACH:
|
|
|
|
table_child->left_attach = g_value_get_uint (value);
|
1998-10-10 01:55:09 +00:00
|
|
|
if (table_child->right_attach <= table_child->left_attach)
|
|
|
|
table_child->right_attach = table_child->left_attach + 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (table_child->right_attach >= priv->ncols)
|
|
|
|
gtk_table_resize (table, priv->nrows, table_child->right_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_RIGHT_ATTACH:
|
|
|
|
table_child->right_attach = g_value_get_uint (value);
|
|
|
|
if (table_child->right_attach <= table_child->left_attach)
|
|
|
|
table_child->left_attach = table_child->right_attach - 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (table_child->right_attach >= priv->ncols)
|
|
|
|
gtk_table_resize (table, priv->nrows, table_child->right_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_TOP_ATTACH:
|
|
|
|
table_child->top_attach = g_value_get_uint (value);
|
1998-10-10 01:55:09 +00:00
|
|
|
if (table_child->bottom_attach <= table_child->top_attach)
|
|
|
|
table_child->bottom_attach = table_child->top_attach + 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (table_child->bottom_attach >= priv->nrows)
|
|
|
|
gtk_table_resize (table, table_child->bottom_attach, priv->ncols);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_BOTTOM_ATTACH:
|
|
|
|
table_child->bottom_attach = g_value_get_uint (value);
|
|
|
|
if (table_child->bottom_attach <= table_child->top_attach)
|
|
|
|
table_child->top_attach = table_child->bottom_attach - 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (table_child->bottom_attach >= priv->nrows)
|
|
|
|
gtk_table_resize (table, table_child->bottom_attach, priv->ncols);
|
1998-10-10 01:55:09 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_X_OPTIONS:
|
|
|
|
table_child->xexpand = (g_value_get_flags (value) & GTK_EXPAND) != 0;
|
|
|
|
table_child->xshrink = (g_value_get_flags (value) & GTK_SHRINK) != 0;
|
|
|
|
table_child->xfill = (g_value_get_flags (value) & GTK_FILL) != 0;
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_Y_OPTIONS:
|
|
|
|
table_child->yexpand = (g_value_get_flags (value) & GTK_EXPAND) != 0;
|
|
|
|
table_child->yshrink = (g_value_get_flags (value) & GTK_SHRINK) != 0;
|
|
|
|
table_child->yfill = (g_value_get_flags (value) & GTK_FILL) != 0;
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_X_PADDING:
|
|
|
|
table_child->xpadding = g_value_get_uint (value);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_Y_PADDING:
|
|
|
|
table_child->ypadding = g_value_get_uint (value);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
|
|
|
default:
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (child) &&
|
|
|
|
gtk_widget_get_visible (GTK_WIDGET (table)))
|
1998-06-24 06:25:14 +00:00
|
|
|
gtk_widget_queue_resize (child);
|
1998-01-27 23:40:51 +00:00
|
|
|
}
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
static void
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
gtk_table_get_child_property (GtkContainer *container,
|
|
|
|
GtkWidget *child,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
1998-01-27 23:40:51 +00:00
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GtkTable *table = GTK_TABLE (container);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1998-06-16 05:20:05 +00:00
|
|
|
GtkTableChild *table_child;
|
|
|
|
GList *list;
|
1998-01-27 23:40:51 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
table_child = NULL;
|
2010-07-13 01:55:37 +00:00
|
|
|
for (list = priv->children; list; list = list->next)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
table_child = list->data;
|
1998-01-27 23:40:51 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
if (table_child->widget == child)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!list)
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
{
|
|
|
|
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
|
|
|
return;
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
switch (property_id)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_LEFT_ATTACH:
|
|
|
|
g_value_set_uint (value, table_child->left_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_RIGHT_ATTACH:
|
|
|
|
g_value_set_uint (value, table_child->right_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_TOP_ATTACH:
|
|
|
|
g_value_set_uint (value, table_child->top_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_BOTTOM_ATTACH:
|
|
|
|
g_value_set_uint (value, table_child->bottom_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_X_OPTIONS:
|
|
|
|
g_value_set_flags (value, (table_child->xexpand * GTK_EXPAND |
|
|
|
|
table_child->xshrink * GTK_SHRINK |
|
|
|
|
table_child->xfill * GTK_FILL));
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_Y_OPTIONS:
|
|
|
|
g_value_set_flags (value, (table_child->yexpand * GTK_EXPAND |
|
|
|
|
table_child->yshrink * GTK_SHRINK |
|
|
|
|
table_child->yfill * GTK_FILL));
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_X_PADDING:
|
|
|
|
g_value_set_uint (value, table_child->xpadding);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
case CHILD_PROP_Y_PADDING:
|
|
|
|
g_value_set_uint (value, table_child->ypadding);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
|
|
|
default:
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_init (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
table->priv = G_TYPE_INSTANCE_GET_PRIVATE (table,
|
|
|
|
GTK_TYPE_TABLE,
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate);
|
2010-07-13 01:55:37 +00:00
|
|
|
priv = table->priv;
|
|
|
|
|
2010-03-06 10:29:31 +00:00
|
|
|
gtk_widget_set_has_window (GTK_WIDGET (table), FALSE);
|
2001-11-04 22:57:03 +00:00
|
|
|
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (table), FALSE);
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv->children = NULL;
|
|
|
|
priv->rows = NULL;
|
|
|
|
priv->cols = NULL;
|
|
|
|
priv->nrows = 0;
|
|
|
|
priv->ncols = 0;
|
|
|
|
priv->column_spacing = 0;
|
|
|
|
priv->row_spacing = 0;
|
|
|
|
priv->homogeneous = FALSE;
|
1998-06-17 08:48:22 +00:00
|
|
|
|
|
|
|
gtk_table_resize (table, 1, 1);
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
gtk_table_new (guint rows,
|
|
|
|
guint columns,
|
|
|
|
gboolean homogeneous)
|
|
|
|
{
|
|
|
|
GtkTable *table;
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
1998-01-27 23:40:51 +00:00
|
|
|
|
1998-06-23 15:55:51 +00:00
|
|
|
if (rows == 0)
|
2002-10-10 01:02:25 +00:00
|
|
|
rows = 1;
|
1998-06-23 15:55:51 +00:00
|
|
|
if (columns == 0)
|
2002-10-10 01:02:25 +00:00
|
|
|
columns = 1;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2002-10-10 01:02:25 +00:00
|
|
|
table = g_object_new (GTK_TYPE_TABLE, NULL);
|
2010-07-13 01:55:37 +00:00
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
priv->homogeneous = (homogeneous ? TRUE : FALSE);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
gtk_table_resize (table, rows, columns);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return GTK_WIDGET (table);
|
|
|
|
}
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
void
|
|
|
|
gtk_table_resize (GtkTable *table,
|
|
|
|
guint n_rows,
|
|
|
|
guint n_cols)
|
1998-01-27 23:40:51 +00:00
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
2008-10-09 15:57:55 +00:00
|
|
|
g_return_if_fail (n_rows > 0 && n_rows <= 65535);
|
|
|
|
g_return_if_fail (n_cols > 0 && n_cols <= 65535);
|
1998-01-27 23:40:51 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
priv = table->priv;
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
n_rows = MAX (n_rows, 1);
|
|
|
|
n_cols = MAX (n_cols, 1);
|
2001-06-08 16:50:58 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
if (n_rows != priv->nrows ||
|
|
|
|
n_cols != priv->ncols)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
for (list = priv->children; list; list = list->next)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
GtkTableChild *child;
|
|
|
|
|
|
|
|
child = list->data;
|
|
|
|
|
1998-06-16 21:09:24 +00:00
|
|
|
n_rows = MAX (n_rows, child->bottom_attach);
|
|
|
|
n_cols = MAX (n_cols, child->right_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
if (n_rows != priv->nrows)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
i = priv->nrows;
|
|
|
|
priv->nrows = n_rows;
|
|
|
|
priv->rows = g_realloc (priv->rows, priv->nrows * sizeof (GtkTableRowCol));
|
|
|
|
|
|
|
|
for (; i < priv->nrows; i++)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[i].requisition = 0;
|
|
|
|
priv->rows[i].allocation = 0;
|
|
|
|
priv->rows[i].spacing = priv->row_spacing;
|
|
|
|
priv->rows[i].need_expand = 0;
|
|
|
|
priv->rows[i].need_shrink = 0;
|
|
|
|
priv->rows[i].expand = 0;
|
|
|
|
priv->rows[i].shrink = 0;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
2001-03-30 15:46:17 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (table), "n-rows");
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
if (n_cols != priv->ncols)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
i = priv->ncols;
|
|
|
|
priv->ncols = n_cols;
|
|
|
|
priv->cols = g_realloc (priv->cols, priv->ncols * sizeof (GtkTableRowCol));
|
|
|
|
|
|
|
|
for (; i < priv->ncols; i++)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[i].requisition = 0;
|
|
|
|
priv->cols[i].allocation = 0;
|
|
|
|
priv->cols[i].spacing = priv->column_spacing;
|
|
|
|
priv->cols[i].need_expand = 0;
|
|
|
|
priv->cols[i].need_shrink = 0;
|
|
|
|
priv->cols[i].expand = 0;
|
|
|
|
priv->cols[i].shrink = 0;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
2001-03-30 15:46:17 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (table), "n-columns");
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
1998-01-27 23:40:51 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
1998-06-16 05:20:05 +00:00
|
|
|
gtk_table_attach (GtkTable *table,
|
|
|
|
GtkWidget *child,
|
|
|
|
guint left_attach,
|
|
|
|
guint right_attach,
|
|
|
|
guint top_attach,
|
|
|
|
guint bottom_attach,
|
|
|
|
GtkAttachOptions xoptions,
|
|
|
|
GtkAttachOptions yoptions,
|
|
|
|
guint xpadding,
|
|
|
|
guint ypadding)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *table_child;
|
1998-01-27 23:40:51 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
1998-06-16 05:20:05 +00:00
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
2010-08-11 20:53:42 +00:00
|
|
|
g_return_if_fail (gtk_widget_get_parent (child) == NULL);
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
/* g_return_if_fail (left_attach >= 0); */
|
1998-01-27 23:40:51 +00:00
|
|
|
g_return_if_fail (left_attach < right_attach);
|
1998-06-16 05:20:05 +00:00
|
|
|
/* g_return_if_fail (top_attach >= 0); */
|
1998-01-27 23:40:51 +00:00
|
|
|
g_return_if_fail (top_attach < bottom_attach);
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
if (right_attach >= priv->ncols)
|
|
|
|
gtk_table_resize (table, priv->nrows, right_attach);
|
|
|
|
|
|
|
|
if (bottom_attach >= priv->nrows)
|
|
|
|
gtk_table_resize (table, bottom_attach, priv->ncols);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
table_child = g_new (GtkTableChild, 1);
|
|
|
|
table_child->widget = child;
|
|
|
|
table_child->left_attach = left_attach;
|
|
|
|
table_child->right_attach = right_attach;
|
|
|
|
table_child->top_attach = top_attach;
|
|
|
|
table_child->bottom_attach = bottom_attach;
|
|
|
|
table_child->xexpand = (xoptions & GTK_EXPAND) != 0;
|
|
|
|
table_child->xshrink = (xoptions & GTK_SHRINK) != 0;
|
|
|
|
table_child->xfill = (xoptions & GTK_FILL) != 0;
|
|
|
|
table_child->xpadding = xpadding;
|
|
|
|
table_child->yexpand = (yoptions & GTK_EXPAND) != 0;
|
|
|
|
table_child->yshrink = (yoptions & GTK_SHRINK) != 0;
|
|
|
|
table_child->yfill = (yoptions & GTK_FILL) != 0;
|
|
|
|
table_child->ypadding = ypadding;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv->children = g_list_prepend (priv->children, table_child);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_set_parent (child, GTK_WIDGET (table));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_table_attach_defaults (GtkTable *table,
|
|
|
|
GtkWidget *widget,
|
1998-06-16 05:20:05 +00:00
|
|
|
guint left_attach,
|
|
|
|
guint right_attach,
|
|
|
|
guint top_attach,
|
|
|
|
guint bottom_attach)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
gtk_table_attach (table, widget,
|
|
|
|
left_attach, right_attach,
|
|
|
|
top_attach, bottom_attach,
|
|
|
|
GTK_EXPAND | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_FILL,
|
|
|
|
0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_table_set_row_spacing (GtkTable *table,
|
1998-06-16 05:20:05 +00:00
|
|
|
guint row,
|
|
|
|
guint spacing)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
g_return_if_fail (row < priv->nrows);
|
|
|
|
|
|
|
|
if (priv->rows[row].spacing != spacing)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].spacing = spacing;
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (GTK_WIDGET (table)))
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (table));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_table_get_row_spacing:
|
|
|
|
* @table: a #GtkTable
|
|
|
|
* @row: a row in the table, 0 indicates the first row
|
|
|
|
*
|
|
|
|
* Gets the amount of space between row @row, and
|
|
|
|
* row @row + 1. See gtk_table_set_row_spacing().
|
|
|
|
*
|
|
|
|
* Return value: the row spacing
|
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gtk_table_get_row_spacing (GtkTable *table,
|
|
|
|
guint row)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TABLE (table), 0);
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
g_return_val_if_fail (row < priv->nrows - 1, 0);
|
|
|
|
|
|
|
|
return priv->rows[row].spacing;
|
2001-06-24 15:34:48 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_table_set_col_spacing (GtkTable *table,
|
1998-06-16 05:20:05 +00:00
|
|
|
guint column,
|
|
|
|
guint spacing)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
g_return_if_fail (column < priv->ncols);
|
|
|
|
|
|
|
|
if (priv->cols[column].spacing != spacing)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[column].spacing = spacing;
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (GTK_WIDGET (table)))
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (table));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_table_get_col_spacing:
|
|
|
|
* @table: a #GtkTable
|
2001-09-08 06:24:46 +00:00
|
|
|
* @column: a column in the table, 0 indicates the first column
|
2001-06-24 15:34:48 +00:00
|
|
|
*
|
|
|
|
* Gets the amount of space between column @col, and
|
|
|
|
* column @col + 1. See gtk_table_set_col_spacing().
|
|
|
|
*
|
|
|
|
* Return value: the column spacing
|
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gtk_table_get_col_spacing (GtkTable *table,
|
|
|
|
guint column)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TABLE (table), 0);
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
g_return_val_if_fail (column < priv->ncols, 0);
|
|
|
|
|
|
|
|
return priv->cols[column].spacing;
|
2001-06-24 15:34:48 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_table_set_row_spacings (GtkTable *table,
|
1998-06-16 05:20:05 +00:00
|
|
|
guint spacing)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
1998-06-16 05:20:05 +00:00
|
|
|
guint row;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
priv->row_spacing = spacing;
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
|
|
|
priv->rows[row].spacing = spacing;
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (GTK_WIDGET (table)))
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (table));
|
2002-01-28 18:52:49 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (table), "row-spacing");
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_table_get_default_row_spacing:
|
|
|
|
* @table: a #GtkTable
|
|
|
|
*
|
|
|
|
* Gets the default row spacing for the table. This is
|
|
|
|
* the spacing that will be used for newly added rows.
|
|
|
|
* (See gtk_table_set_row_spacings())
|
|
|
|
*
|
2007-11-26 20:15:15 +00:00
|
|
|
* Return value: the default row spacing
|
2001-06-24 15:34:48 +00:00
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gtk_table_get_default_row_spacing (GtkTable *table)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TABLE (table), 0);
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
return table->priv->row_spacing;
|
2001-06-24 15:34:48 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_table_set_col_spacings (GtkTable *table,
|
1998-06-16 05:20:05 +00:00
|
|
|
guint spacing)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
1998-06-16 05:20:05 +00:00
|
|
|
guint col;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv = table->priv;
|
|
|
|
|
|
|
|
priv->column_spacing = spacing;
|
|
|
|
for (col = 0; col < priv->ncols; col++)
|
|
|
|
priv->cols[col].spacing = spacing;
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (GTK_WIDGET (table)))
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (table));
|
2002-01-28 18:52:49 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (table), "column-spacing");
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_table_get_default_col_spacing:
|
|
|
|
* @table: a #GtkTable
|
|
|
|
*
|
|
|
|
* Gets the default column spacing for the table. This is
|
|
|
|
* the spacing that will be used for newly added columns.
|
|
|
|
* (See gtk_table_set_col_spacings())
|
|
|
|
*
|
2007-11-26 20:15:15 +00:00
|
|
|
* Return value: the default column spacing
|
2001-06-24 15:34:48 +00:00
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gtk_table_get_default_col_spacing (GtkTable *table)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TABLE (table), 0);
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
return table->priv->column_spacing;
|
2001-06-24 15:34:48 +00:00
|
|
|
}
|
|
|
|
|
1998-04-06 22:33:32 +00:00
|
|
|
void
|
|
|
|
gtk_table_set_homogeneous (GtkTable *table,
|
1998-06-16 05:20:05 +00:00
|
|
|
gboolean homogeneous)
|
1998-04-06 22:33:32 +00:00
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
1998-04-06 22:33:32 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
priv = table->priv;
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
homogeneous = (homogeneous != 0);
|
2010-07-13 01:55:37 +00:00
|
|
|
if (homogeneous != priv->homogeneous)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->homogeneous = homogeneous;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (GTK_WIDGET (table)))
|
1998-06-16 05:20:05 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (table));
|
2002-01-28 18:52:49 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (table), "homogeneous");
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
1998-04-06 22:33:32 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_table_get_homogeneous:
|
|
|
|
* @table: a #GtkTable
|
|
|
|
*
|
|
|
|
* Returns whether the table cells are all constrained to the same
|
|
|
|
* width and height. (See gtk_table_set_homogenous ())
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the cells are all constrained to the same size
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_table_get_homogeneous (GtkTable *table)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TABLE (table), FALSE);
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
return table->priv->homogeneous;
|
2001-06-24 15:34:48 +00:00
|
|
|
}
|
|
|
|
|
2010-06-24 15:28:18 +00:00
|
|
|
/**
|
|
|
|
* gtk_table_get_size:
|
|
|
|
* @table: a #GtkTable
|
2010-06-24 16:10:03 +00:00
|
|
|
* @rows: (out) (allow-none): return location for the number of
|
2010-06-24 15:28:18 +00:00
|
|
|
* rows, or %NULL
|
2010-06-24 16:10:03 +00:00
|
|
|
* @columns: (out) (allow-none): return location for the number
|
2010-06-24 15:28:18 +00:00
|
|
|
* of columns, or %NULL
|
|
|
|
*
|
|
|
|
* Returns the number of rows and columns in the table.
|
|
|
|
*
|
|
|
|
* Since: 2.22
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_table_get_size (GtkTable *table,
|
|
|
|
guint *rows,
|
|
|
|
guint *columns)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
2010-06-24 15:28:18 +00:00
|
|
|
g_return_if_fail (GTK_IS_TABLE (table));
|
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
priv = table->priv;
|
|
|
|
|
2010-06-24 15:28:18 +00:00
|
|
|
if (rows)
|
2010-07-13 01:55:37 +00:00
|
|
|
*rows = priv->nrows;
|
2010-06-24 15:28:18 +00:00
|
|
|
|
|
|
|
if (columns)
|
2010-07-13 01:55:37 +00:00
|
|
|
*columns = priv->ncols;
|
2010-06-24 15:28:18 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
documented necessary changes for 1.4 transition.
Fri May 12 17:13:32 2000 Tim Janik <timj@gtk.org>
* docs/Changes-1.4.txt: documented necessary changes for 1.4 transition.
* gtk/gtktext.c: made the adjustments no-construct args, simply
provide default adjustments.
(gtk_text_destroy): release adjustments.
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): made the
adjustment argument non-construct.
* gtk/gtkprogress.c (gtk_progress_destroy): release adjustment here,
instead of in finalize.
(gtk_progress_get_text_from_value):
(gtk_progress_get_current_text):
(gtk_progress_set_value):
(gtk_progress_get_percentage_from_value):
(gtk_progress_get_current_percentage):
(gtk_progress_set_percentage):
(gtk_progress_configure): ensure an adjustment is present.
Thu May 11 01:24:08 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcolorsel.[hc]:
* gtk/gtkcolorseldialog.[hc]:
* gtk/gtkhsv.[hc]: major code cleanups, destroy handlers need to chain
their parent implementation, use bit fields for boolean values, don't
create unused widgets, usage of glib types, braces go on their own
lines, function argument alignment, #include directives etc. etc. etc..
* gtk/Makefile.am (gtk_public_h_sources): install gtkhsv.h.
Wed May 10 23:29:52 2000 Tim Janik <timj@gtk.org>
* gtk/gtktoolbar.c (gtk_toolbar_destroy): don't unref a NULL tooltips.
* gtk/gtkfilesel.c (gtk_file_selection_destroy): don't free a cmpl_state
of NULL.
* gtk/gtkcombo.c (gtk_combo_item_destroy): don#t keep references
to freed data.
(gtk_combo_destroy): don't keep a pointer to a destroyed window.
* gtk/gtkmenu.c (gtk_menu_init): reset the menu's toplevel pointer
to NULL when the toplevel is getting destroyed.
(gtk_menu_set_tearoff_state): same here for the tearoff_window.
(gtk_menu_destroy):
(gtk_menu_init): store the information of whether we have to
readd the initial child ref_count during destruction in a new
GtkMenu field needs_destruction_ref_count.
* gtk/gtkviewport.c: SHAME! ok this one is tricky, so i note it
here, those reading: learn from my mistake! ;)
in order for set_?adjustment to support a default adjustemnt if
invoked with an adjustment pointer of NULL, the code read (pseudo):
if (v->adjustment) unref (v->adjustment);
if (!adjustment) adjustment = adjustment_new ();
if (v->adjustment != adjustment) v->adjustment = ref (adjustment);
now imagine the first unref to actually free the old adjustment and
adjustment_new() creating a new adjustment from the very same memory
portion. here, the latter comparision will unintendedly fail, and
all hell breaks loose.
(gtk_viewport_set_hadjustment):
(gtk_viewport_set_vadjustment): reset viewport->?adjustment to NULL
after unreferencing it.
* gtk/gtkcontainer.[hc]: removed toplevel registration
functions: gtk_container_register_toplevel(),
gtk_container_unregister_toplevel() and
gtk_container_get_toplevels() which had wrong semantics
anyways: it didn't reference and copy the list.
* gtk/gtkwindow.c: we take over the container toplevel registration
bussiness now. windows are registered across multiple destructions,
untill they are finalized. the initial implicit reference count
users are holding on windows is removed with the first destruction
though.
(gtk_window_init): ref & sink and set has_user_ref_count, got
rid of gtk_container_register_toplevel() call. add window to
toplevel_list.
(gtk_window_destroy): unref the window if has_user_ref_count
is still set, got rid of call to
gtk_container_unregister_toplevel().
(gtk_window_finalize): remove window from toplevel list.
(gtk_window_list_toplevels): new function to return a newly
created list with referenced toplevels.
(gtk_window_read_rcfiles): use gtk_window_list_toplevels().
* gtk/gtkhscale.c (gtk_hscale_class_init): made the GtkRange
adjustment a non-construct arg.
* gtk/gtkvscale.c (gtk_vscale_class_init): likewise.
* gtk/gtkhscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkvscrollbar.c (gtk_vscrollbar_class_init): likewise.
* gtk/gtkrange.c: added some realized checks.
(gtk_range_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize. remove timer.
(gtk_range_get_adjustment): demand create adjustment.
* gtk/gtkviewport.c: made h/v adjustment non-construct args.
we simply create them on demand now and get rid of them in
the destroy handler.
(gtk_viewport_destroy): get rid of the h/v adjustments in the
destroy handler instead of finalize.
(gtk_viewport_get_hadjustment):
(gtk_viewport_get_vadjustment):
(gtk_viewport_size_allocate): demand create h/v adjustment
if required.
* gtk/gtkwidget.c (gtk_widget_finalize): duplicate part of the
gtk_widget_real_destroy () functionality.
(gtk_widget_real_destroy): reinitialize with a new style, instead
of setting widget->style to NULL.
Fri May 5 13:02:09 2000 Tim Janik <timj@gtk.org>
* gtk/gtkcalendar.c:
* gtk/gtkbutton.c: ported _get_type() implementation over to
GType, either to preserve memchunks allocation facilities,
or because Gtk+ 1.0 GtkTypeInfo was still being used.
* gtk/gtkobject.[hc]: derive from GObject. ported various functions
over. prepare for ::destroy to be emitted multiple times.
removed reference tracer magic. chain into GObjectClass.shutdown()
to emit ::destroy signal.
* gtk/gtksignal.c: removed assumptions about GTK_TYPE_OBJECT being
fundamental.
* gtk/gtkmain.c: removed gtk_object_post_arg_parsing_init()
cludge.
* gtk/gtksocket.c:
* gtk/gtkplug.c:
* gtk/gtklayout.c:
* gtk/gtklabel.c:
* gtk/gtkargcollector.c:
* gtk/gtkarg.c: various fixups to work with GTK_TYPE_OBJECT
not being a fundamental anymore, and to work with the new
type system (nuked fundamental type varargs clutter).
* gtk/*.c: install finalize handlers in the GObjectClass
part of the class structure.
changed direct GTK_OBJECT()->klass accesses to
GTK_*_GET_CLASS().
changed direct object_class->type accesses to GTK_CLASS_TYPE().
* gtktypeutils.[hc]: use the reserved fundamental ids provided by
GType. made most of the GTK_*() type macros and Gtk* typedefs
simple wrappers around macros and types provided by GType.
most notably, a significant portion of the old API vanished:
GTK_TYPE_MAKE(),
GTK_TYPE_SEQNO(),
GTK_TYPE_FLAT_FIRST, GTK_TYPE_FLAT_LAST,
GTK_TYPE_STRUCTURED_FIRST, GTK_TYPE_STRUCTURED_LAST,
GTK_TYPE_ARGS,
GTK_TYPE_CALLBACK,
GTK_TYPE_C_CALLBACK,
GTK_TYPE_FOREIGN,
GtkTypeQuery,
gtk_type_query(),
gtk_type_set_varargs_type(),
gtk_type_get_varargs_type(),
gtk_type_check_object_cast(),
gtk_type_check_class_cast(),
gtk_type_describe_tree(),
gtk_type_describe_heritage(),
gtk_type_free(),
gtk_type_children_types(),
gtk_type_set_chunk_alloc(),
gtk_type_register_enum(),
gtk_type_register_flags(),
gtk_type_parent_class().
replacements, where available are described in ../docs/Changes-1.4.txt.
implemented compatibility functions for the remaining API.
* configure.in: depend on glib 1.3.1, use gobject module.
2000-05-12 15:25:50 +00:00
|
|
|
gtk_table_finalize (GObject *object)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2008-02-27 11:30:10 +00:00
|
|
|
GtkTable *table = GTK_TABLE (object);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
g_free (priv->rows);
|
|
|
|
g_free (priv->cols);
|
2008-02-27 11:30:10 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_OBJECT_CLASS (gtk_table_parent_class)->finalize (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
2008-02-27 11:30:10 +00:00
|
|
|
GtkTable *table = GTK_TABLE (widget);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint row, col;
|
2010-06-02 04:28:22 +00:00
|
|
|
guint border_width;
|
2008-02-27 11:30:10 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
requisition->width = 0;
|
|
|
|
requisition->height = 0;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_table_size_request_init (table);
|
|
|
|
gtk_table_size_request_pass1 (table);
|
|
|
|
gtk_table_size_request_pass2 (table);
|
|
|
|
gtk_table_size_request_pass3 (table);
|
|
|
|
gtk_table_size_request_pass2 (table);
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (col = 0; col < priv->ncols; col++)
|
|
|
|
requisition->width += priv->cols[col].requisition;
|
|
|
|
for (col = 0; col + 1 < priv->ncols; col++)
|
|
|
|
requisition->width += priv->cols[col].spacing;
|
|
|
|
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
|
|
|
requisition->height += priv->rows[row].requisition;
|
|
|
|
for (row = 0; row + 1 < priv->nrows; row++)
|
|
|
|
requisition->height += priv->rows[row].spacing;
|
2010-06-02 04:28:22 +00:00
|
|
|
|
|
|
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
|
|
|
|
requisition->width += border_width * 2;
|
|
|
|
requisition->height += border_width * 2;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
2008-02-27 11:30:10 +00:00
|
|
|
GtkTable *table = GTK_TABLE (widget);
|
|
|
|
|
2010-08-11 20:53:42 +00:00
|
|
|
gtk_widget_set_allocation (widget, allocation);
|
2008-02-27 11:30:10 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_table_size_allocate_init (table);
|
|
|
|
gtk_table_size_allocate_pass1 (table);
|
|
|
|
gtk_table_size_allocate_pass2 (table);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_add (GtkContainer *container,
|
|
|
|
GtkWidget *widget)
|
|
|
|
{
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (container), widget, 0, 1, 0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_remove (GtkContainer *container,
|
|
|
|
GtkWidget *widget)
|
|
|
|
{
|
2008-02-27 11:30:10 +00:00
|
|
|
GtkTable *table = GTK_TABLE (container);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *child;
|
2010-03-01 06:47:38 +00:00
|
|
|
GtkWidget *widget_container = GTK_WIDGET (container);
|
1997-11-24 22:37:52 +00:00
|
|
|
GList *children;
|
2008-02-27 11:30:10 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
children = priv->children;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (child->widget == widget)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2010-03-01 06:47:38 +00:00
|
|
|
gboolean was_visible = gtk_widget_get_visible (widget);
|
1998-05-01 04:23:59 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_unparent (widget);
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
priv->children = g_list_remove (priv->children, child);
|
1998-06-16 05:20:05 +00:00
|
|
|
g_free (child);
|
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (was_visible && gtk_widget_get_visible (widget_container))
|
|
|
|
gtk_widget_queue_resize (widget_container);
|
1998-06-16 05:20:05 +00:00
|
|
|
break;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
gtk_table_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
|
|
|
GtkCallback callback,
|
|
|
|
gpointer callback_data)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2008-02-27 11:30:10 +00:00
|
|
|
GtkTable *table = GTK_TABLE (container);
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *child;
|
|
|
|
GList *children;
|
2008-02-27 11:30:10 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
children = priv->children;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
(* callback) (child->widget, callback_data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_request_init (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *child;
|
|
|
|
GList *children;
|
|
|
|
gint row, col;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
2002-03-03 20:36:54 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].requisition = 0;
|
|
|
|
priv->rows[row].expand = FALSE;
|
2002-03-03 20:36:54 +00:00
|
|
|
}
|
2010-07-13 01:55:37 +00:00
|
|
|
for (col = 0; col < priv->ncols; col++)
|
2002-03-03 20:36:54 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].requisition = 0;
|
|
|
|
priv->cols[col].expand = FALSE;
|
2002-03-03 20:36:54 +00:00
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
children = priv->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (child->widget))
|
1999-02-10 02:35:09 +00:00
|
|
|
gtk_widget_size_request (child->widget, NULL);
|
2002-03-03 20:36:54 +00:00
|
|
|
|
|
|
|
if (child->left_attach == (child->right_attach - 1) && child->xexpand)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[child->left_attach].expand = TRUE;
|
2002-03-03 20:36:54 +00:00
|
|
|
|
|
|
|
if (child->top_attach == (child->bottom_attach - 1) && child->yexpand)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[child->top_attach].expand = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_request_pass1 (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *child;
|
|
|
|
GList *children;
|
|
|
|
gint width;
|
|
|
|
gint height;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
children = priv->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (child->widget))
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
2010-09-09 13:35:58 +00:00
|
|
|
|
|
|
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
|
|
|
&child_requisition, NULL);
|
1999-02-10 02:35:09 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
/* Child spans a single column.
|
|
|
|
*/
|
|
|
|
if (child->left_attach == (child->right_attach - 1))
|
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
width = child_requisition.width + child->xpadding * 2;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[child->left_attach].requisition = MAX (priv->cols[child->left_attach].requisition, width);
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Child spans a single row.
|
|
|
|
*/
|
|
|
|
if (child->top_attach == (child->bottom_attach - 1))
|
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
height = child_requisition.height + child->ypadding * 2;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[child->top_attach].requisition = MAX (priv->rows[child->top_attach].requisition, height);
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_request_pass2 (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint max_width;
|
|
|
|
gint max_height;
|
|
|
|
gint row, col;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
if (priv->homogeneous)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
max_width = 0;
|
|
|
|
max_height = 0;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (col = 0; col < priv->ncols; col++)
|
|
|
|
max_width = MAX (max_width, priv->cols[col].requisition);
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
|
|
|
max_height = MAX (max_height, priv->rows[row].requisition);
|
|
|
|
|
|
|
|
for (col = 0; col < priv->ncols; col++)
|
|
|
|
priv->cols[col].requisition = max_width;
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
|
|
|
priv->rows[row].requisition = max_height;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_request_pass3 (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *child;
|
|
|
|
GList *children;
|
|
|
|
gint width, height;
|
|
|
|
gint row, col;
|
|
|
|
gint extra;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
children = priv->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (child->widget))
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
/* Child spans multiple columns.
|
|
|
|
*/
|
|
|
|
if (child->left_attach != (child->right_attach - 1))
|
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
|
|
|
|
2010-09-09 13:35:58 +00:00
|
|
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
|
|
|
&child_requisition, NULL);
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
/* Check and see if there is already enough space
|
|
|
|
* for the child.
|
|
|
|
*/
|
|
|
|
width = 0;
|
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
width += priv->cols[col].requisition;
|
1998-06-16 05:20:05 +00:00
|
|
|
if ((col + 1) < child->right_attach)
|
2010-07-13 01:55:37 +00:00
|
|
|
width += priv->cols[col].spacing;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If we need to request more space for this child to fill
|
2002-03-03 20:36:54 +00:00
|
|
|
* its requisition, then divide up the needed space amongst the
|
|
|
|
* columns it spans, favoring expandable columns if any.
|
1998-06-16 05:20:05 +00:00
|
|
|
*/
|
1999-02-10 02:35:09 +00:00
|
|
|
if (width < child_requisition.width + child->xpadding * 2)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2002-03-03 20:36:54 +00:00
|
|
|
gint n_expand = 0;
|
|
|
|
gboolean force_expand = FALSE;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2002-03-03 20:36:54 +00:00
|
|
|
width = child_requisition.width + child->xpadding * 2 - width;
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->cols[col].expand)
|
2002-03-03 20:36:54 +00:00
|
|
|
n_expand++;
|
|
|
|
|
|
|
|
if (n_expand == 0)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2002-03-03 20:36:54 +00:00
|
|
|
n_expand = (child->right_attach - child->left_attach);
|
|
|
|
force_expand = TRUE;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
2002-03-03 20:36:54 +00:00
|
|
|
|
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
2010-07-13 01:55:37 +00:00
|
|
|
if (force_expand || priv->cols[col].expand)
|
2002-03-03 20:36:54 +00:00
|
|
|
{
|
|
|
|
extra = width / n_expand;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].requisition += extra;
|
2002-03-03 20:36:54 +00:00
|
|
|
width -= extra;
|
|
|
|
n_expand--;
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Child spans multiple rows.
|
|
|
|
*/
|
|
|
|
if (child->top_attach != (child->bottom_attach - 1))
|
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
|
|
|
|
2010-09-09 13:35:58 +00:00
|
|
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
|
|
|
&child_requisition, NULL);
|
1999-02-10 02:35:09 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
/* Check and see if there is already enough space
|
|
|
|
* for the child.
|
|
|
|
*/
|
|
|
|
height = 0;
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
height += priv->rows[row].requisition;
|
1998-06-16 05:20:05 +00:00
|
|
|
if ((row + 1) < child->bottom_attach)
|
2010-07-13 01:55:37 +00:00
|
|
|
height += priv->rows[row].spacing;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If we need to request more space for this child to fill
|
2002-03-03 20:36:54 +00:00
|
|
|
* its requisition, then divide up the needed space amongst the
|
|
|
|
* rows it spans, favoring expandable rows if any.
|
1998-06-16 05:20:05 +00:00
|
|
|
*/
|
1999-02-10 02:35:09 +00:00
|
|
|
if (height < child_requisition.height + child->ypadding * 2)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2002-03-03 20:36:54 +00:00
|
|
|
gint n_expand = 0;
|
|
|
|
gboolean force_expand = FALSE;
|
|
|
|
|
1999-02-10 02:35:09 +00:00
|
|
|
height = child_requisition.height + child->ypadding * 2 - height;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->rows[row].expand)
|
2002-03-03 20:36:54 +00:00
|
|
|
n_expand++;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
2002-03-03 20:36:54 +00:00
|
|
|
|
|
|
|
if (n_expand == 0)
|
|
|
|
{
|
|
|
|
n_expand = (child->bottom_attach - child->top_attach);
|
|
|
|
force_expand = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
2010-07-13 01:55:37 +00:00
|
|
|
if (force_expand || priv->rows[row].expand)
|
2002-03-03 20:36:54 +00:00
|
|
|
{
|
|
|
|
extra = height / n_expand;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].requisition += extra;
|
2002-03-03 20:36:54 +00:00
|
|
|
height -= extra;
|
|
|
|
n_expand--;
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_allocate_init (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *child;
|
|
|
|
GList *children;
|
|
|
|
gint row, col;
|
|
|
|
gint has_expand;
|
|
|
|
gint has_shrink;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Initialize the rows and cols.
|
|
|
|
* By default, rows and cols do not expand and do shrink.
|
|
|
|
* Those values are modified by the children that occupy
|
|
|
|
* the rows and cols.
|
|
|
|
*/
|
2010-07-13 01:55:37 +00:00
|
|
|
for (col = 0; col < priv->ncols; col++)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].allocation = priv->cols[col].requisition;
|
|
|
|
priv->cols[col].need_expand = FALSE;
|
|
|
|
priv->cols[col].need_shrink = TRUE;
|
|
|
|
priv->cols[col].expand = FALSE;
|
|
|
|
priv->cols[col].shrink = TRUE;
|
|
|
|
priv->cols[col].empty = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2010-07-13 01:55:37 +00:00
|
|
|
for (row = 0; row < priv->nrows; row++)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].allocation = priv->rows[row].requisition;
|
|
|
|
priv->rows[row].need_expand = FALSE;
|
|
|
|
priv->rows[row].need_shrink = TRUE;
|
|
|
|
priv->rows[row].expand = FALSE;
|
|
|
|
priv->rows[row].shrink = TRUE;
|
|
|
|
priv->rows[row].empty = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Loop over all the children and adjust the row and col values
|
|
|
|
* based on whether the children want to be allowed to expand
|
|
|
|
* or shrink. This loop handles children that occupy a single
|
|
|
|
* row or column.
|
|
|
|
*/
|
2010-07-13 01:55:37 +00:00
|
|
|
children = priv->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (child->widget))
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
if (child->left_attach == (child->right_attach - 1))
|
|
|
|
{
|
|
|
|
if (child->xexpand)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[child->left_attach].expand = TRUE;
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
if (!child->xshrink)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[child->left_attach].shrink = FALSE;
|
|
|
|
|
|
|
|
priv->cols[child->left_attach].empty = FALSE;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (child->top_attach == (child->bottom_attach - 1))
|
|
|
|
{
|
|
|
|
if (child->yexpand)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[child->top_attach].expand = TRUE;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
|
|
|
if (!child->yshrink)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[child->top_attach].shrink = FALSE;
|
1998-08-04 14:55:04 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[child->top_attach].empty = FALSE;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Loop over all the children again and this time handle children
|
|
|
|
* which span multiple rows or columns.
|
|
|
|
*/
|
2010-07-13 01:55:37 +00:00
|
|
|
children = priv->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (child->widget))
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
if (child->left_attach != (child->right_attach - 1))
|
|
|
|
{
|
1998-08-04 14:55:04 +00:00
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].empty = FALSE;
|
1998-08-04 14:55:04 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
if (child->xexpand)
|
|
|
|
{
|
|
|
|
has_expand = FALSE;
|
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->cols[col].expand)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
has_expand = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!has_expand)
|
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].need_expand = TRUE;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!child->xshrink)
|
|
|
|
{
|
|
|
|
has_shrink = TRUE;
|
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
2010-07-13 01:55:37 +00:00
|
|
|
if (!priv->cols[col].shrink)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
has_shrink = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_shrink)
|
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].need_shrink = FALSE;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (child->top_attach != (child->bottom_attach - 1))
|
|
|
|
{
|
1998-08-04 14:55:04 +00:00
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].empty = FALSE;
|
1998-08-04 14:55:04 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
if (child->yexpand)
|
|
|
|
{
|
|
|
|
has_expand = FALSE;
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->rows[row].expand)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
has_expand = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!has_expand)
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].need_expand = TRUE;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!child->yshrink)
|
|
|
|
{
|
|
|
|
has_shrink = TRUE;
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
2010-07-13 01:55:37 +00:00
|
|
|
if (!priv->rows[row].shrink)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
has_shrink = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (has_shrink)
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].need_shrink = FALSE;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Loop over the columns and set the expand and shrink values
|
|
|
|
* if the column can be expanded or shrunk.
|
|
|
|
*/
|
2010-07-13 01:55:37 +00:00
|
|
|
for (col = 0; col < priv->ncols; col++)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->cols[col].empty)
|
1998-08-04 14:55:04 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].expand = FALSE;
|
|
|
|
priv->cols[col].shrink = FALSE;
|
1998-08-04 14:55:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->cols[col].need_expand)
|
|
|
|
priv->cols[col].expand = TRUE;
|
|
|
|
if (!priv->cols[col].need_shrink)
|
|
|
|
priv->cols[col].shrink = FALSE;
|
1998-08-04 14:55:04 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Loop over the rows and set the expand and shrink values
|
|
|
|
* if the row can be expanded or shrunk.
|
|
|
|
*/
|
2010-07-13 01:55:37 +00:00
|
|
|
for (row = 0; row < priv->nrows; row++)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->rows[row].empty)
|
1998-08-04 14:55:04 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].expand = FALSE;
|
|
|
|
priv->rows[row].shrink = FALSE;
|
1998-08-04 14:55:04 +00:00
|
|
|
}
|
1998-08-04 15:07:55 +00:00
|
|
|
else
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->rows[row].need_expand)
|
|
|
|
priv->rows[row].expand = TRUE;
|
|
|
|
if (!priv->rows[row].need_shrink)
|
|
|
|
priv->rows[row].shrink = FALSE;
|
1998-08-04 15:07:55 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_allocate_pass1 (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
2010-08-11 20:53:42 +00:00
|
|
|
GtkAllocation allocation;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint real_width;
|
|
|
|
gint real_height;
|
|
|
|
gint width, height;
|
|
|
|
gint row, col;
|
|
|
|
gint nexpand;
|
|
|
|
gint nshrink;
|
|
|
|
gint extra;
|
2010-06-02 04:28:22 +00:00
|
|
|
guint border_width;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* If we were allocated more space than we requested
|
|
|
|
* then we have to expand any expandable rows and columns
|
|
|
|
* to fill in the extra space.
|
|
|
|
*/
|
2010-08-11 20:53:42 +00:00
|
|
|
gtk_widget_get_allocation (GTK_WIDGET (table), &allocation);
|
2010-06-02 04:28:22 +00:00
|
|
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
|
2010-08-11 20:53:42 +00:00
|
|
|
real_width = allocation.width - border_width * 2;
|
|
|
|
real_height = allocation.height - border_width * 2;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
if (priv->homogeneous)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
if (!priv->children)
|
2002-02-13 05:48:56 +00:00
|
|
|
nexpand = 1;
|
|
|
|
else
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2002-02-13 05:48:56 +00:00
|
|
|
nexpand = 0;
|
2010-07-13 01:55:37 +00:00
|
|
|
for (col = 0; col < priv->ncols; col++)
|
|
|
|
if (priv->cols[col].expand)
|
2002-02-13 05:48:56 +00:00
|
|
|
{
|
|
|
|
nexpand += 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nexpand)
|
|
|
|
{
|
|
|
|
width = real_width;
|
2010-07-13 01:55:37 +00:00
|
|
|
for (col = 0; col + 1 < priv->ncols; col++)
|
|
|
|
width -= priv->cols[col].spacing;
|
|
|
|
|
|
|
|
for (col = 0; col < priv->ncols; col++)
|
2002-02-13 05:48:56 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
extra = width / (priv->ncols - col);
|
|
|
|
priv->cols[col].allocation = MAX (1, extra);
|
2002-02-13 05:48:56 +00:00
|
|
|
width -= extra;
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
width = 0;
|
|
|
|
nexpand = 0;
|
|
|
|
nshrink = 0;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (col = 0; col < priv->ncols; col++)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
width += priv->cols[col].requisition;
|
|
|
|
if (priv->cols[col].expand)
|
1998-06-16 05:20:05 +00:00
|
|
|
nexpand += 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->cols[col].shrink)
|
1998-06-16 05:20:05 +00:00
|
|
|
nshrink += 1;
|
|
|
|
}
|
2010-07-13 01:55:37 +00:00
|
|
|
for (col = 0; col + 1 < priv->ncols; col++)
|
|
|
|
width += priv->cols[col].spacing;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Check to see if we were allocated more width than we requested.
|
|
|
|
*/
|
|
|
|
if ((width < real_width) && (nexpand >= 1))
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
width = real_width - width;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (col = 0; col < priv->ncols; col++)
|
|
|
|
if (priv->cols[col].expand)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
extra = width / nexpand;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].allocation += extra;
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
width -= extra;
|
|
|
|
nexpand -= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-03-14 19:57:25 +00:00
|
|
|
/* Check to see if we were allocated less width than we requested,
|
|
|
|
* then shrink until we fit the size give.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
2000-03-14 19:57:25 +00:00
|
|
|
if (width > real_width)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2000-03-14 19:57:25 +00:00
|
|
|
gint total_nshrink = nshrink;
|
|
|
|
|
|
|
|
extra = width - real_width;
|
|
|
|
while (total_nshrink > 0 && extra > 0)
|
|
|
|
{
|
|
|
|
nshrink = total_nshrink;
|
2010-07-13 01:55:37 +00:00
|
|
|
for (col = 0; col < priv->ncols; col++)
|
|
|
|
if (priv->cols[col].shrink)
|
2000-03-14 19:57:25 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
gint allocation = priv->cols[col].allocation;
|
2000-03-14 19:57:25 +00:00
|
|
|
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].allocation = MAX (1, (gint) priv->cols[col].allocation - extra / nshrink);
|
|
|
|
extra -= allocation - priv->cols[col].allocation;
|
2000-03-14 19:57:25 +00:00
|
|
|
nshrink -= 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->cols[col].allocation < 2)
|
2000-03-14 19:57:25 +00:00
|
|
|
{
|
|
|
|
total_nshrink -= 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->cols[col].shrink = FALSE;
|
2000-03-14 19:57:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
if (priv->homogeneous)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
if (!priv->children)
|
2002-02-13 05:48:56 +00:00
|
|
|
nexpand = 1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nexpand = 0;
|
2010-07-13 01:55:37 +00:00
|
|
|
for (row = 0; row < priv->nrows; row++)
|
|
|
|
if (priv->rows[row].expand)
|
2002-02-13 05:48:56 +00:00
|
|
|
{
|
|
|
|
nexpand += 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nexpand)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2002-02-13 05:48:56 +00:00
|
|
|
height = real_height;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (row = 0; row + 1 < priv->nrows; row++)
|
|
|
|
height -= priv->rows[row].spacing;
|
|
|
|
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
2002-02-13 05:48:56 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
extra = height / (priv->nrows - row);
|
|
|
|
priv->rows[row].allocation = MAX (1, extra);
|
2002-02-13 05:48:56 +00:00
|
|
|
height -= extra;
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
height = 0;
|
|
|
|
nexpand = 0;
|
|
|
|
nshrink = 0;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
height += priv->rows[row].requisition;
|
|
|
|
if (priv->rows[row].expand)
|
1998-06-16 05:20:05 +00:00
|
|
|
nexpand += 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->rows[row].shrink)
|
1998-06-16 05:20:05 +00:00
|
|
|
nshrink += 1;
|
|
|
|
}
|
2010-07-13 01:55:37 +00:00
|
|
|
for (row = 0; row + 1 < priv->nrows; row++)
|
|
|
|
height += priv->rows[row].spacing;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Check to see if we were allocated more height than we requested.
|
|
|
|
*/
|
|
|
|
if ((height < real_height) && (nexpand >= 1))
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
height = real_height - height;
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
for (row = 0; row < priv->nrows; row++)
|
|
|
|
if (priv->rows[row].expand)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
|
|
|
extra = height / nexpand;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].allocation += extra;
|
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
height -= extra;
|
|
|
|
nexpand -= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Check to see if we were allocated less height than we requested.
|
2000-03-14 19:57:25 +00:00
|
|
|
* then shrink until we fit the size give.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
2000-03-14 19:57:25 +00:00
|
|
|
if (height > real_height)
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
2000-03-14 19:57:25 +00:00
|
|
|
gint total_nshrink = nshrink;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2000-03-14 19:57:25 +00:00
|
|
|
extra = height - real_height;
|
|
|
|
while (total_nshrink > 0 && extra > 0)
|
|
|
|
{
|
|
|
|
nshrink = total_nshrink;
|
2010-07-13 01:55:37 +00:00
|
|
|
for (row = 0; row < priv->nrows; row++)
|
|
|
|
if (priv->rows[row].shrink)
|
2000-03-14 19:57:25 +00:00
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
gint allocation = priv->rows[row].allocation;
|
|
|
|
|
|
|
|
priv->rows[row].allocation = MAX (1, (gint) priv->rows[row].allocation - extra / nshrink);
|
|
|
|
extra -= allocation - priv->rows[row].allocation;
|
2000-03-14 19:57:25 +00:00
|
|
|
nshrink -= 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
if (priv->rows[row].allocation < 2)
|
2000-03-14 19:57:25 +00:00
|
|
|
{
|
|
|
|
total_nshrink -= 1;
|
2010-07-13 01:55:37 +00:00
|
|
|
priv->rows[row].shrink = FALSE;
|
2000-03-14 19:57:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_table_size_allocate_pass2 (GtkTable *table)
|
|
|
|
{
|
2010-08-26 17:15:37 +00:00
|
|
|
GtkTablePrivate *priv = table->priv;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkTableChild *child;
|
|
|
|
GList *children;
|
|
|
|
gint max_width;
|
|
|
|
gint max_height;
|
|
|
|
gint x, y;
|
|
|
|
gint row, col;
|
|
|
|
GtkAllocation allocation;
|
2010-08-11 20:53:42 +00:00
|
|
|
GtkAllocation table_allocation, widget_allocation;
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (table);
|
2010-07-13 01:55:37 +00:00
|
|
|
|
|
|
|
children = priv->children;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (children)
|
|
|
|
{
|
|
|
|
child = children->data;
|
|
|
|
children = children->next;
|
1998-06-16 05:20:05 +00:00
|
|
|
|
2010-03-01 06:47:38 +00:00
|
|
|
if (gtk_widget_get_visible (child->widget))
|
1998-06-16 05:20:05 +00:00
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
2010-06-02 04:28:22 +00:00
|
|
|
guint border_width;
|
|
|
|
|
2010-09-09 13:35:58 +00:00
|
|
|
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
|
|
|
|
&child_requisition, NULL);
|
1999-02-10 02:35:09 +00:00
|
|
|
|
2010-08-11 20:53:42 +00:00
|
|
|
gtk_widget_get_allocation (GTK_WIDGET (table), &table_allocation);
|
2010-06-02 04:28:22 +00:00
|
|
|
border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
|
2010-08-11 20:53:42 +00:00
|
|
|
x = table_allocation.x + border_width;
|
|
|
|
y = table_allocation.y + border_width;
|
1998-06-16 05:20:05 +00:00
|
|
|
max_width = 0;
|
|
|
|
max_height = 0;
|
|
|
|
|
|
|
|
for (col = 0; col < child->left_attach; col++)
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
x += priv->cols[col].allocation;
|
|
|
|
x += priv->cols[col].spacing;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (col = child->left_attach; col < child->right_attach; col++)
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
max_width += priv->cols[col].allocation;
|
1998-06-16 05:20:05 +00:00
|
|
|
if ((col + 1) < child->right_attach)
|
2010-07-13 01:55:37 +00:00
|
|
|
max_width += priv->cols[col].spacing;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (row = 0; row < child->top_attach; row++)
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
y += priv->rows[row].allocation;
|
|
|
|
y += priv->rows[row].spacing;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (row = child->top_attach; row < child->bottom_attach; row++)
|
|
|
|
{
|
2010-07-13 01:55:37 +00:00
|
|
|
max_height += priv->rows[row].allocation;
|
1998-06-16 05:20:05 +00:00
|
|
|
if ((row + 1) < child->bottom_attach)
|
2010-07-13 01:55:37 +00:00
|
|
|
max_height += priv->rows[row].spacing;
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (child->xfill)
|
|
|
|
{
|
1999-01-14 06:04:55 +00:00
|
|
|
allocation.width = MAX (1, max_width - (gint)child->xpadding * 2);
|
1998-06-16 05:20:05 +00:00
|
|
|
allocation.x = x + (max_width - allocation.width) / 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
allocation.width = child_requisition.width;
|
1998-06-16 05:20:05 +00:00
|
|
|
allocation.x = x + (max_width - allocation.width) / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (child->yfill)
|
|
|
|
{
|
1999-01-14 06:04:55 +00:00
|
|
|
allocation.height = MAX (1, max_height - (gint)child->ypadding * 2);
|
1998-06-16 05:20:05 +00:00
|
|
|
allocation.y = y + (max_height - allocation.height) / 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
allocation.height = child_requisition.height;
|
1998-06-16 05:20:05 +00:00
|
|
|
allocation.y = y + (max_height - allocation.height) / 2;
|
|
|
|
}
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
|
2010-08-11 20:53:42 +00:00
|
|
|
gtk_widget_get_allocation (widget, &widget_allocation);
|
Remove all references to offscreen flag which was no longer used.
Thu Jun 1 23:05:13 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c: Remove all references to
offscreen flag which was no longer used.
* gtk/gtkprivate.h (enum): Remove unused flags and compress.
* gtk/gtkframe.c (gtk_frame_set_label_widget): Check
for non-null label_widget->parent.
* gtk/gtkentry.c: Get rid of code to deal with PangoAttribute
which no longer was used.
* gdk/gdkpango.c (gdk_pango_context_get_info): make static.
* gdk/gdkpango.c (gdk_draw_layout[_line]): Add checks
for null arguments.
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): add
check for destroyed windows.
Thu Jun 1 13:48:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c: Add a finalize method and unref
the slave context there.
* gtk/gtkinvisible.[ch]: Make reference counting behavior
identical to GtkWindow.
Thu Jun 1 01:54:11 2000 Owen Taylor <otaylor@redhat.com>
* Makefile.am gdk/gdkpango.c: Copy the layout render function from
pangox to here, so we can write them independent of rendering
system, using GDK primitives.
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c
gdk/x11/gdkdrawable-x11.c: Remove draw_layout() from the vtable,
since we have a rendering-system independent implementation in
terms of draw_glyphs().
* gdk/gdkpango.c gdkdrawable.h (gdk_draw_layout_line): New
function to render a single line.
* gdk/x11/gdkpango.c: Move the guts of this file mostly
into ../gdkpango.c, which simplifies things, since we
don't have to deal with raw X gc's.
Fri May 19 04:28:16 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch]: Add get_log_attrs() function to
get the logical attributes for a given GtkTextLine.
Tue May 30 16:05:39 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Track
g_locale_get_codeset() to g_get_codeset() change.
Tue May 30 15:03:19 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testcalendar.c (calendar_font_selection_ok): Use font
descriptions.
* gtk/gtkentry.c (gtk_entry_draw_text): Center text within
the entry.
* gtk/gtkfontsel.c (gtk_font_selection_dialog_init): Start of
redoing (vastly simplifying) for Pango. Still needs quite
a bit of work. (Size selection is currently poor. List of
predefined sizes is not a good idea, since all of these
sizes won't necessarily be distinct.)
Tue May 30 13:50:19 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkfont-x11.c (gdk_font_charset_for_locale): Handle
CODESET results for LANG=C.
Mon May 29 15:49:10 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.[ch]: Add a 'font_name' declaration to RC
which takes a stringized pango font description;
ignore the older 'font' and 'fontset' declarations.
* gtk/gtkstyle.c gtk/gtkrc.c: Fill in the style->font
field with a GdkFont derived via gdk_font_from_description(),
for compatibility. (Should we just remove it entirely?
Probably too much compatibility breakage, but people
should be migrating to the new Pango stuff as quickly
as possible.)
Mon May 29 15:47:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtkclist.c: s/pango_font_unref/g_object_unref/.
Mon May 29 15:44:46 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcalender.c: Roughly pango-ized. Really needs
redoing; there are some bugs in size allocation right
now, the semi-existant distinction between header / day
fonts was removed, but, with Pango, could actually
be made functional in a nice way.
* gtk/testcalender: Move calender from examples into this
directory as a test program. (We really need to restrcture
testgtk into a whole directory full of tests for every
widget or functionality group, separated into multiple .c
files.)
Mon May 29 15:19:56 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (file_exists): Fix stupid typo that
was keeping RC file from being loaded.
* gtk/testgtkrc gtk/testgtkrc2: Test new pango-ized
RC file font code.
Mon May 29 14:31:27 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkfont.h gdk/x11/gdkfont-x11.c (gdk_font_from_description):
Add function to load a GdkFont from a PangoFontDescription.
Fri May 26 17:16:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/frame.[ch] gtkaspectframe.c: Make frame widgets able
to have any widget for the label, use a GtkLabel widget
to display the text. (Based partially on a patch from
Anders Carlson.)
(Quite a bit of code reorganization - strip 90% of the
guts out of gtkaspectframe and add a single virtual
func to GtkFrameClass - compute_child_allocation.)
Fri May 26 12:00:02 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c gtk/gtkclist.[ch]: Pangoized.
(Removed clist->row_center_offset field because caching
it wasn't saving time or code, added private function
_gtk_clist_create_cell_layout()).
Wed May 24 15:59:37 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccellabel.c: Pangoized.
* gtk/[hv]ruler.c: Pangoized
Mon May 22 19:23:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init):
Use gtk_clist_set_column_auto_resize() to remove need
need for manual column width computations.
Mon May 22 18:50:26 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.[ch]: Replace custom drawing with a GtkLabel,
ensuring Pango correctness, and considerably simplifying the
code.
* gtk/gtklabel.c gtk[hv]scale.c: 1000 => PANGO_SCALE.
* gtk/gtklabel.c (gtk_label_size_request): Fixed incorrect
getting of numbers of lines.
* gtk/gtklabel.c (gtk_label_size_request): Set the requisition
to the actual requested width of the lable, not to the wrap
width we set.
* gtk/gtktextchild.h: Remove extraneous include of gtk/gtk.h.
* gtk/gtktextbtree.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
gtk/gtktextview.c gtk/gtktextview.[ch]: Fix up includes.
* gtk/gtktextview.c: Fix structure inheritance.
* gtk/gtkprogressbar.c: Pangoize.
Mon May 22 15:47:30 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_get_first_para_iter): Encapsulate
in a function.
* gtk/gtktextlayout.c (find_display_line_above): Fixed
bug with computing line tops.
* gtk/gtktextview.c (changed_handler): Fix < , <= confusion.
Thu May 18 18:53:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix up the x_offset
and y_offset coordinates to do what we need now. (The offset between
buffer and layout coordinates has been reintroduced, but is a
bit different than before.)
* gtk/gtktextview.[ch]: No longer inherit from GtkLayout; instead
handle the adjustments ourselves, and scroll as necessary using
the new gdk_window_scroll().
The advantage of this is that when we are incrementally revalidating,
we are essentially rearranging things around the visible portion
of the screen. With the old setup, the visible portion of the
screen was moved around in the layout, so scrolling and redrawing
to track that caused jumping of the display. Since we now
control the scrolling ourselves, we can suppress this and
only redraw when things actually change.
Thu May 18 18:47:25 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (redisplay_mark): We need to invalidate
the region not just redisplay it after-all, since we store the
cursors in the LineDisplay. (Ugly interactions here between
GtkLayout and GtkTextBTree here.)
* gtk/gtktextbtree.c (redisplay_region): Fixed reversed comparison.
Thu May 18 18:43:21 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.h gdk/x11/gdkgeometry-x11.c (gdk_window_scroll):
Added function to scroll contents of a window while keeping the
window constant. Works by XCopyArea or guffaw-scrolling depending
on the details of how the window is set up. (guffaw-scrolling
still needs to be filled in.)
Wed May 17 22:36:53 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextiter.c gtk/gtkmain.c: Add a debug key for the text widget,
move the debugging that was tied to a global variable
to that.
* gtk/gtkmarshal.list: Add NONE:INT,INT,INT
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.c: Keep a separate
validated flag, in line data instead of setting height/width to
-1. This allows us to perform operations with partially invalid
buffer (using the old size for invalid lines) and thus to do
incremental vaidation. Keep height/width aggregates up to date
when deleting text and rebalancing the tree.
* gtk/gtktextbtree.[ch]: Add functions validate a line
(gtk_text_btree_validate_line), and to validate up
to a number of pixels (gtk_text_btree_validate).
* gtk/gtktextlayout.[ch]: Add an ::invalidated signal
that indicates that something is changed and a revalidation
pass is needed. Change ::need_repaint to ::changed, and
make it take old and new yranges instead of a rectangle.
* gtk/gtktextbtree.[ch] gtk/gtktextlayout.[ch]: Move
the line_data_destroy() function from
gtk_text_btree_add_view() to a virtual function in
GtkTextLayout
* gtk/gtktextbtree.[ch]: Remove gtk_text_btree_get_damage_range(),
since we are handling partial repaints in a different fashion
now.
* gtk/gtktextbtree.[ch]: Only repaint the changed portion
of the selection instead of queueing a repaint on the
entire widget.
* gtk/gtktextbuffer.[ch] gtk/gtktextbtree.[ch]: Move
get_selection_bounds() down to btree, make the function
in buffer a wrapper around the btree function.
* gtk/gtktextlayout.[ch]: Add functions to check if the
layout is valid and to recompute either a range of pixels
aroudn a line or a certain total number of pixels.
* gtk/gtktextlayout.[ch]: Cache a single line display;
now that we only redraw the needed portions, the hit rate
for this cache is quite high.
* gtk/gtktextview.[ch]: Keep track of the first paragraph
on the screen so that when re-laying-out the buffer, we can
keep the same place. This requires connecting to ::value_changed
on the adjustments
* gtk/gtktextview.[ch]: Add idle functions to revalidate
the buffer after we receive an ::invalidated signal.
Wed May 17 22:10:47 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_size_allocate): Set upper
to max of allocation and layout size, not just to the
layout size.
* gtk/gtk[hv]scrollbar.c (gtk_[hv]scrollbar_calc_slider_size):
Invalidate window so it gets redrawn properly.
* gdk/gdkwindow.c (gdk_window_invalidate_rect): Allow rect == NULL
to mean the entire window.
* gdk/gdkevents.h: Move definition for GDK_PRIORITY_REDRAW
into public header.
Mon May 15 14:51:31 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextmark.c (gtk_text_mark_get_name): Add function
to get the name of a mark.
* gtk/gtktextlayout.c (gtk_text_layout_get_line_at_y): Add a function
to find the paragraph from a y position.
Thu May 11 12:57:20 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextbtree.c (gtk_text_btree_node_invalidate_upward): Valid
nodes have width/height >= 0, not > 0.
Tue May 9 21:29:06 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c (gtk_text_layout_get_line_display):
Add a size_only flag, so when we only need the size, we don't create
useless appearance attributes.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Remove
duplicate setting of font description.
* gtk/gtkscale.c: Use PANGO_SCALE instead of 1000
Wed Apr 26 01:53:23 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (EXTRA_DIST): Add OLD_STAMP into
EXTRA_DIST. It does not work well when the file that
everything depends on is not in the tarball.
Wed Apr 26 00:56:14 2000 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c: Some hacks and fixes so that it basically
works when not sitting in the GTK+ build tree.
2000-05-03 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (gtk_text_line_next_could_contain_tag):
Properly determine the ordering of the tag root and the current
line within the tree. Previous algorithm only worked if the tag
root's immediate parent was the common root of both the current
line and the tag root.
Wed Apr 26 00:43:00 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (set_para_values): Fix some bugs in
alignment.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Track
the widget text directional dynamically.
* gtk/gtktextview.[ch]: Added functions to get and set default
wrap mode.
Tue Apr 25 23:47:38 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_get_iter_location): Fix bug
in cursor location computation.
Tue Apr 25 23:22:59 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_set_size): Clamp hadjustment/
vadjusment values properly when layout gets smaller.
* gtk/gtktextview.c (need_repaint_handler): Areas being
passed in are far completely inaccurate, and sometimes
too small, so, for now, just queue a redraw on the
whole visible region.
2000-04-25 Havoc Pennington <hp@redhat.com>
* gtk/gtktextbtree.c (summary_destroy): new function to
destroy tag summary nodes
(gtk_text_line_next_could_contain_tag): this function was
totally broken if the line passed in wasn't below the tag
root. Fix it.
(gtk_text_btree_first_could_contain_tag): In the tag == NULL
"wildcard" case, we have to do a linear scan. Blah.
(gtk_text_btree_last_could_contain_tag): In tag == NULL case,
we have to do the linear scan
(tag_removed_cb): When a tag is removed from the tag table,
remove the GtkTextTagInfo node from the btree.
(gtk_text_btree_spew): Implement the spew function, for
our debugging pleasure.
Tue Apr 25 19:40:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_buffer): Fix
a problem with referring to the wrong buffer.
* gtk/gtkentry.c: Fix focus-in/focus-out confusion.
* gtk/gtkrc.c gtk/gtkstyle.c: Moving setting default
font description to gtk_style_new() - otherwise things
don't work without a .gtkrc file.
* gtk/gtktextbuffer.c (gtk_text_buffer_new): Sink the
tags table if we create it ourself, too.
* gdk/gdktypes.h (enum): Move GDK_RELEASE_MASK, since
it was conflicting with XKB modifiers.
* gtk/gtktextview.[ch]: Add simple support for
GtkIMContext.
Mon Apr 24 19:34:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_move_cursor_visually): Fix problem
with deletion from last commit.
Mon Apr 24 19:29:40 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_create_pango_context): Set the language
in the context from the current locale.
* gtk/gtkentry.c (gtk_entry_size_request): Use language from the
context, not hardcoded value.
* gtk/gtkentry.c (gtk_entry_move_cursor): Make character movement visual,
not logical.
Sun Apr 23 23:39:18 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c gtk/gtktextdisplay.c: Don't handle selections as
attributes - that doesn't handle partial-glyph selection
properly. Instead use new pango_layout_line_get_x_ranges()
functionality to draw the selection.
* gtk/gtkentry.c: Simplify code since pango_layout_line_index_to_x()
now properly handles out-of-range coordinates.
* gtk/gtktextbuffer.c: Emit "mark_set" when the cursor is moved.
* gtk/gtktextiter.h gtk/gtktextiterprivate.h: Make gtk_text_iter_get_line_byte()
public.
* gtk/gtktextlayout.[ch]: Properly set the direction in the PangoContext
for paragraphs opposite to the base direction of the widget.
* gtk/gtktextlayout.[ch] gtk/gtktextdisplay.c: Fixes for alignment.
* gtk/gtktextlayout.c: Don't split segments on marks, since that
causes Arabic words to reshape as you cursor through.
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Implement virtual
cursor position when moving vertically with the arrow keys and
scrolling with page-up/page-down. (Arrow keys save only the X,
scrolling saves both X and Y.)
This means you can line-up / line-down or page-up / page-down
without losing your place, and also that moving vertically
with the cursor keys keeps the same X position, not the same
character count:
* gtk/gtktextlayout.[ch] gtk/gtktextview.[ch]: Make vertical
arrow keys move by display lines, not paragraphs.
Tue Apr 18 14:16:50 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c: Make sure that the bin window is at least
as big as the allocation. (Should we also make sure that the
bin window is big enough to completely cover widget->window?)
* gtk/gtktextview.c (gtk_text_view_get_visible_rect): Add
function to get the onscreen rectangle.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_pointer): Correctly account
for offsets in window coordinates.
Sun Apr 16 16:13:27 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_get_cursor_locations): Fix index/offset
confusion.
* gtk/gtktextview.c (gtk_text_view_ensure_layout): Set the default direction
from the widget direction.
* gtk/gtktexttag.c gtk/gtktexttagprivate.h (gtk_text_tag_set_arg):
Add a "direction" attribute.
* gtk/gtktextview.c: global s/tkxt/text_view/.
* gtk/testtext.c: Added long block of text in Arabic, to test out
the direction attributes. (Some problems with the shaping system
for arabic become obvious - like the fact the cursor splits words
into unjoined pieces.)
Fri Apr 14 12:54:34 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextdisplay.c (render_layout): Add overstrike handling.
* gtk/gtktextlayout.c: Fix up alignment.
* gtk/testtext.c: Add some tests for centering, wrapping.
Fri Apr 14 09:26:22 2000 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdrawable.h gdk/gdkdraw.c gdk/gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add a draw_glyphs() operation to the drawable vtable and gdk_draw_glyphs().
If we wrote GTK+-specific layout-render function this could just replace
the draw_layout() operation in the vtable.
* gtk/gtkentry.c: Move guts of gtk_entry_get_cursor_locations to
pango_layout_get_cursor_pos() and use that function.
* gtk/gtktextchild.[ch]: add gtk_ onto pixmap_segment_new(), since it
is a non-static symbol.
* gtk/gtktextbtree.[ch]: Replace gtk_text_btree_find_line_data_by_y()
with gtk_text_btree_find_line_by_y()
* gtk/gtktextdisplay.c: Rewrote for Pango - uses a custom layout
renderer that handles GtkTextAppearance attributes.
* gtk/gtktexttag.[ch] gtk/gtktexttagprivate.h:
- Move the values in the style that don't affect geometry into a
GtkTextAppearance structure.
- Change underline to take a PangoUnderline and "font" a string
representation of a font description
- Add a "font_desc" attribute which takes a FontDescription structure.
* gtk/gtktextlayout.[ch]:
- Get rid of the display-line list per each line. Instead, we
generate, on demand, a GtkTextLineDisplay structure which]
contains a PangoLayout * and other necesary information
(offsets, cursor locations) for displaying a paragraph.
- Get rid of the code to wrap lines, create display chunks,
etc. Instead, we just go through a paragraph and convert
it into the necessary inputs to a PangoLayout.
- Implement a new attribute type, GtkTextAttrAppearance. This
holds a GtkTextAppearance, and is used to pass colors,
stipple, etc, through from the layout to the display without
having to use lots and lots of individual attributes.
- Reimplement gtk_layout_get_iter_at_pixel() gtk_layout_get_iter_pos()
in terms of PangoLayout functions.
* gtk/gtktextview.c:
- Handle passing the necessary PangoContext to the layout
- Some fixups in painting to deal with the automatic backing store
and offsetting of GTK+-1.4
- Add a style_set handler so that the default style reacts
properly to theme changes.
* gtk/gtktext?*.[ch]: Random code-style fixes.
* gtk/testtext.c: Substitute in languages that Pango handles now for Thai
Mon Apr 10 10:33:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext?*.[ch]: Check in Havoc's port of the Tk text widget,
in original form preparatory to Pango-ization and gdkimcontext-ization.
Thu Apr 6 19:25:39 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.c: Move default implementations to real_* vfuncs,
so that we can derive from gtkimcontext in language bindings properly.
Thu Apr 6 16:02:52 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontextsimple.[ch]: Use gdk_keyval_to_unicode to gdk_unicode_to_keyval.
Add a compose table including (almost) all the compose combinations
from X. This is 6k of static, shared data as opposed to 50k or so of dynamic
data in the XIM implementation.
* gdk/gdk.h gdk/gdkkeyuni.c gdk/win32/gdkevents-win32.c (gdk_keyval_to_unicode, gdk_unicode_to_keyval):
Moved functions to convert keyvalues from and to unicode here from
the win32 port and made them public.
Wed Apr 5 16:37:29 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkeditable.c (gtk_editable_insert_text): Allow new_text_length == -1.
Wed Apr 5 16:27:45 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimcontext.[ch]: Base class for new input context system
* gtk/gtkimmulticontext.[ch]: Proxy input context that allows
the real input context implementation to be loaded from modules
and switched on the fly.
* gtk/gtkcontextsimple.[ch]: Simple implementation of an input
context that just does direct keysymbol => unicode translation.
* gtk/gtkentry.[ch]: Start switching editing over to using
GtkInputContext. (No handling of preedit yet.)
Wed Apr 5 15:48:41 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h (GTK_CHECK_GET_CLASS): Fix problem with one too
many substitutions. (klass should not be subsituted.)
Wed Apr 5 00:18:14 2000 Owen Taylor <otaylor@redhat.com>
* configure.in: Add checks for Pango
* configure.in docs/Makefile.am: Add test for sgml2html
and allow 'make dist' without building html, but print out
warnings in that case. (For making snapshots)
* gdk/Makefile.am gdk/x11/Makefile.am gtk/Makefile.am:
Add Pango libraries and C flags
* gdk/gdkdraw.c gdk/gdkdrawable.h gdkwindow.c gdk/x11/gdkdrawable-x11.c:
Add function (gdk_draw_layout) to draw a pango layout.
* gdk/gdkpango.h gdk/x11/gdkpango-x11.c: New file with functions
for getting Pango contexts for GDK.
* gtk/gtkeditable.c: Get rid of dead code gtk_editable_parent_set()
* gtk/gtkentry.[ch]: Complete rewrite to use Pango, add bidirectional
editing.
* gtk/gtkentry.c: Hack in simple Hebrew input with direct
keysym => unicode translations. More languages can be added
here, but real input-method support is needed.
* docs/Changes-1.4.txt: Added note about entry behavior.
* gtk/gtkenums.h gtk/gtkwidget.[ch] testgtk.c gtkprivate.h: Add functions
to set the reading direction for a widget and the global direction.
Add test which allows toggling the global direction. Two private
flags are used to store the direction. (GTK_DIRECTION_SET + GTK_DIRECTION_LTR)
* gtk/gtkcheckbutton.c gtk/gtkframe.c gtk/gtkhbbox.c gtk/gtkhbox.c
gtk/gtkradiobutton.c gtk/gtkspinbutton.c gtk/gtktable.c
* gtk/gtk[hv]scale.c gtk/gtkscale.[ch]: Draw numbers using Pango
* gtk/gtklabel.[ch]: Moved to Pango and considerably rewritten. Line breaking,
underlining now handled by Pango.
* gtk/gtkstyle.[ch] gtk/gtkrc.[ch]: Add a PangoFontDescription
to RCStyle and Style. (Having both this and the old font name and GdkFont
is temporary.)
* gtk/gtkwidget.[ch] (gtk_widget_create_pango_{context,layout}): Added
convenience functions for creating contexts and layouts for widgets.
* gtk/testgtk.c: Enhance label tests with multilingual labels.
2000-06-02 03:14:07 +00:00
|
|
|
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
2010-08-11 20:53:42 +00:00
|
|
|
allocation.x = widget_allocation.x + widget_allocation.width
|
|
|
|
- (allocation.x - widget_allocation.x) - allocation.width;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_size_allocate (child->widget, &allocation);
|
1998-06-16 05:20:05 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|