Commit 50512ddc authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Remove reallocate-redraws property. This is something that only a widget

Fri May 18 14:25:20 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkcontainer.c: Remove reallocate-redraws property.
	This is something that only a widget writer would ever want
	to change.

	* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
	gtk_signal_emit_by_name().

	* gtk/gtkviewport.c: Fix some warnings.

	* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
	allowing the requisitions of multiple widgets to be grouped
	together.

	* tests/testgtk.c: Add GtkSizeGroup test

	* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.

	* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
	warnings.

	* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
parent 02d5f41c
Fri May 18 14:25:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c: Remove reallocate-redraws property.
This is something that only a widget writer would ever want
to change.
* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
gtk_signal_emit_by_name().
* gtk/gtkviewport.c: Fix some warnings.
* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
allowing the requisitions of multiple widgets to be grouped
together.
* tests/testgtk.c: Add GtkSizeGroup test
* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.
* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
warnings.
* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
2001-04-28 Martin Baulig <baulig@suse.de>
* gtk/gtkimagemenuitem.[ch]: Renamed gtk_image_menu_item_add_icon()
......
Fri May 18 14:25:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c: Remove reallocate-redraws property.
This is something that only a widget writer would ever want
to change.
* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
gtk_signal_emit_by_name().
* gtk/gtkviewport.c: Fix some warnings.
* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
allowing the requisitions of multiple widgets to be grouped
together.
* tests/testgtk.c: Add GtkSizeGroup test
* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.
* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
warnings.
* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
2001-04-28 Martin Baulig <baulig@suse.de>
* gtk/gtkimagemenuitem.[ch]: Renamed gtk_image_menu_item_add_icon()
......
Fri May 18 14:25:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c: Remove reallocate-redraws property.
This is something that only a widget writer would ever want
to change.
* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
gtk_signal_emit_by_name().
* gtk/gtkviewport.c: Fix some warnings.
* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
allowing the requisitions of multiple widgets to be grouped
together.
* tests/testgtk.c: Add GtkSizeGroup test
* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.
* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
warnings.
* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
2001-04-28 Martin Baulig <baulig@suse.de>
* gtk/gtkimagemenuitem.[ch]: Renamed gtk_image_menu_item_add_icon()
......
Fri May 18 14:25:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c: Remove reallocate-redraws property.
This is something that only a widget writer would ever want
to change.
* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
gtk_signal_emit_by_name().
* gtk/gtkviewport.c: Fix some warnings.
* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
allowing the requisitions of multiple widgets to be grouped
together.
* tests/testgtk.c: Add GtkSizeGroup test
* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.
* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
warnings.
* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
2001-04-28 Martin Baulig <baulig@suse.de>
* gtk/gtkimagemenuitem.[ch]: Renamed gtk_image_menu_item_add_icon()
......
Fri May 18 14:25:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c: Remove reallocate-redraws property.
This is something that only a widget writer would ever want
to change.
* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
gtk_signal_emit_by_name().
* gtk/gtkviewport.c: Fix some warnings.
* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
allowing the requisitions of multiple widgets to be grouped
together.
* tests/testgtk.c: Add GtkSizeGroup test
* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.
* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
warnings.
* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
2001-04-28 Martin Baulig <baulig@suse.de>
* gtk/gtkimagemenuitem.[ch]: Renamed gtk_image_menu_item_add_icon()
......
Fri May 18 14:25:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c: Remove reallocate-redraws property.
This is something that only a widget writer would ever want
to change.
* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
gtk_signal_emit_by_name().
* gtk/gtkviewport.c: Fix some warnings.
* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
allowing the requisitions of multiple widgets to be grouped
together.
* tests/testgtk.c: Add GtkSizeGroup test
* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.
* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
warnings.
* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
2001-04-28 Martin Baulig <baulig@suse.de>
* gtk/gtkimagemenuitem.[ch]: Renamed gtk_image_menu_item_add_icon()
......
Fri May 18 14:25:20 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c: Remove reallocate-redraws property.
This is something that only a widget writer would ever want
to change.
* gtk/gtksignal.c: Handle G_SIGNAL_TYPE_STATIC_SCOPE for
gtk_signal_emit_by_name().
* gtk/gtkviewport.c: Fix some warnings.
* gtk/gtkwidget.c gtk/gtksizegroup.c: Add "size group" facility
allowing the requisitions of multiple widgets to be grouped
together.
* tests/testgtk.c: Add GtkSizeGroup test
* demos/gtk-demo/sizegroup.c: Add GtkSizeGroup demo.
* demos/gtk-demo/main.c demos/gtk-demo/pixbufs.c: Fix some
warnings.
* configure.in: Switch to using AM_GLIB_GNU_GETTEXT.
2001-04-28 Martin Baulig <baulig@suse.de>
* gtk/gtkimagemenuitem.[ch]: Renamed gtk_image_menu_item_add_icon()
......
......@@ -77,7 +77,7 @@ esac
if test -z "$ACLOCAL_FLAGS"; then
acdir=`aclocal --print-ac-dir`
m4list="glib-2.0.m4 gettext.m4"
m4list="glib-2.0.m4 glib-gettext.m4"
for file in $m4list
do
......@@ -93,18 +93,6 @@ if test -z "$ACLOCAL_FLAGS"; then
done
fi
echo "Running gettextize... Ignore non-fatal messages."
# Hmm, we specify --force here, since otherwise things dont'
# get added reliably, but we don't want to overwrite intl
# while making dist.
echo "no" | gettextize --copy --force
#
# Really bad hack
echo "Munging po/Makefile.in.in"
sed s%@PACKAGE@%@GETTEXT_PACKAGE@% < po/Makefile.in.in > po/Makefile.in.in.new
mv po/Makefile.in.in.new po/Makefile.in.in
aclocal $ACLOCAL_FLAGS
# optionally feature autoheader
......
......@@ -226,10 +226,10 @@ AC_SUBST(STRIP_END)
# i18n stuff
ALL_LINGUAS="az ca cs da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
AM_GTK_GNU_GETTEXT
AM_GLIB_GNU_GETTEXT
LIBS="$LIBS $INTLLIBS"
# AM_GTK_GNU_GETTEXT above substs $DATADIRNAME
# AM_GLIB_GNU_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
gtklocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(gtklocaledir)
......
......@@ -14,6 +14,7 @@ demos = @STRIP_BEGIN@ \
menus.c \
panes.c \
pixbufs.c \
sizegroup.c \
textview.c \
@STRIP_END@
......
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
......@@ -546,7 +547,7 @@ button_press_event_cb (GtkTreeView *tree_view,
gtk_signal_connect (GTK_OBJECT (window),
"destroy",
window_closed_cb,
GTK_SIGNAL_FUNC (window_closed_cb),
cbdata);
}
else
......@@ -598,7 +599,7 @@ row_activated_cb (GtkTreeView *tree_view,
gtk_signal_connect (GTK_OBJECT (window),
"destroy",
window_closed_cb,
GTK_SIGNAL_FUNC (window_closed_cb),
cbdata);
}
}
......@@ -714,7 +715,7 @@ create_tree (void)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
GTK_TREE_VIEW_COLUMN (column));
gtk_signal_connect (GTK_OBJECT (selection), "selection_changed", selection_cb, model);
gtk_signal_connect (GTK_OBJECT (selection), "selection_changed", GTK_SIGNAL_FUNC (selection_cb), model);
gtk_signal_connect (GTK_OBJECT (tree_view), "row_activated", GTK_SIGNAL_FUNC (row_activated_cb), model);
return tree_view;
......
......@@ -47,7 +47,7 @@ static const char *installed_image_names[] = {
#define N_IMAGES G_N_ELEMENTS (relative_image_names)
/* demo window */
static GtkWindow *window = NULL;
static GtkWidget *window = NULL;
/* Current frame */
static GdkPixbuf *frame;
......
/* Size Groups
*
* GtkSizeGroup provides a mechanism for grouping a number of
* widgets together so they all request the same amount of space.
* This is typically useful when you want a column of widgets to
* have the same size, but you can't use a GtkTable widget.
*
* Note that size groups only affect the amount of space requested,
* not the size that the widgets finally receive. If you want the
* widgets in a GtkSizeGroup to actually be the same size, you need
* to pack them in such a way that they get the size they request
* and not more. For example, if you are packing your widgets
* into a table, you would not include the GTK_FILL flag.
*/
#include <gtk/gtk.h>
static GtkWidget *window = NULL;
/* Convenience function to create an option menu holding a number of strings
*/
GtkWidget *
create_option_menu (const char **strings)
{
GtkWidget *menu;
GtkWidget *option_menu;
const char **str;
menu = gtk_menu_new ();
for (str = strings; *str; str++)
{
GtkWidget *menu_item = gtk_menu_item_new_with_label (*str);
gtk_widget_show (menu_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
}
option_menu = gtk_option_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
return option_menu;
}
static void
add_row (GtkTable *table,
int row,
GtkSizeGroup *size_group,
const char *label_text,
const char **options)
{
GtkWidget *option_menu;
GtkWidget *label;
label = gtk_label_new (label_text);
gtk_misc_set_alignment (GTK_MISC (label), 0, 1);
gtk_table_attach (GTK_TABLE (table), label,
0, 1, row, row + 1,
GTK_EXPAND | GTK_FILL, 0,
0, 0);
option_menu = create_option_menu (options);
gtk_size_group_add_widget (size_group, option_menu);
gtk_table_attach (GTK_TABLE (table), option_menu,
1, 2, row, row + 1,
0, 0,
0, 0);
}
static void
toggle_grouping (GtkToggleButton *check_button,
GtkSizeGroup *size_group)
{
GtkSizeGroupMode new_mode;
/* GTK_SIZE_GROUP_NONE is not generally useful, but is useful
* here to show the effect of GTK_SIZE_GROUP_HORIZONTAL by
* contrast.
*/
if (gtk_toggle_button_get_active (check_button))
new_mode = GTK_SIZE_GROUP_HORIZONTAL;
else
new_mode = GTK_SIZE_GROUP_NONE;
gtk_size_group_set_mode (size_group, new_mode);
}
GtkWidget *
do_sizegroup (void)
{
GtkWidget *table;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *check_button;
GtkSizeGroup *size_group;
static const char *color_options[] = {
"Red", "Green", "Blue", NULL
};
static const char *dash_options[] = {
"Solid", "Dashed", "Dotted", NULL
};
static const char *end_options[] = {
"Square", "Round", "Arrow", NULL
};
if (!window)
{
window = gtk_dialog_new_with_buttons ("GtkSizeGroup",
NULL, 0,
GTK_STOCK_BUTTON_CLOSE,
GTK_RESPONSE_NONE,
NULL);
gtk_window_set_resizeable (GTK_WINDOW (window), FALSE);
gtk_signal_connect (GTK_OBJECT (window), "response",
GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/* Create one frame holding color options
*/
frame = gtk_frame_new ("Color Options");
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
table = gtk_table_new (2, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
gtk_container_add (GTK_CONTAINER (frame), table);
add_row (GTK_TABLE (table), 0, size_group, "Foreground", color_options);
add_row (GTK_TABLE (table), 1, size_group, "Background", color_options);
/* And another frame holding line style options
*/
frame = gtk_frame_new ("Line Options");
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
table = gtk_table_new (2, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
gtk_container_add (GTK_CONTAINER (frame), table);
add_row (GTK_TABLE (table), 0, size_group, "Dashing", dash_options);
add_row (GTK_TABLE (table), 1, size_group, "Line ends", end_options);
/* And a check button to turn grouping on and off */
check_button = gtk_check_button_new_with_label ("Enable grouping");
gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
GTK_SIGNAL_FUNC (toggle_grouping), size_group);
}
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show_all (window);
else
gtk_widget_destroy (window);
return window;
}
......@@ -142,6 +142,7 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
gtkseparator.h \
gtksettings.h \
gtksignal.h \
gtksizegroup.h \
gtksocket.h \
gtkspinbutton.h \
gtkstyle.h \
......@@ -301,6 +302,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtkseparator.c \
gtksettings.c \
gtksignal.c \
gtksizegroup.c \
gtkspinbutton.c \
gtkstock.c \
gtkstyle.c \
......
......@@ -125,6 +125,7 @@
#include <gtk/gtkseparatormenuitem.h>
#include <gtk/gtksettings.h>
#include <gtk/gtksignal.h>
#include <gtk/gtksizegroup.h>
#include <gtk/gtksocket.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkstock.h>
......
......@@ -49,7 +49,6 @@ enum {
PROP_BORDER_WIDTH,
PROP_RESIZE_MODE,
PROP_CHILD,
PROP_REALLOCATE_REDRAWS
};
typedef struct _GtkChildArgInfo GtkChildArgInfo;
......@@ -200,13 +199,7 @@ gtk_container_class_init (GtkContainerClass *class)
_("Can be used to add a new child to the container."),
GTK_TYPE_WIDGET,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class,
PROP_REALLOCATE_REDRAWS,
g_param_spec_boolean ("reallocate_redraws",
_("Reallocate redraws"),
_("Whether redraws should be reallocated"),
FALSE,
G_PARAM_READWRITE));
object_class->destroy = gtk_container_destroy;
widget_class->show_all = gtk_container_show_all;
......@@ -689,10 +682,6 @@ gtk_container_set_property (GObject *object,
case PROP_RESIZE_MODE:
gtk_container_set_resize_mode (container, g_value_get_enum (value));
break;
case PROP_REALLOCATE_REDRAWS:
gtk_container_set_reallocate_redraws (container,
g_value_get_boolean (value));
break;
case PROP_CHILD:
gtk_container_add (container, GTK_WIDGET (g_value_get_object (value)));
break;
......@@ -720,9 +709,6 @@ gtk_container_get_property (GObject *object,
case PROP_RESIZE_MODE:
g_value_set_enum (value, container->resize_mode);
break;
case PROP_REALLOCATE_REDRAWS:
g_value_set_boolean (value, container->reallocate_redraws);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -889,15 +875,7 @@ gtk_container_set_reallocate_redraws (GtkContainer *container,
{
g_return_if_fail (GTK_IS_CONTAINER (container));
needs_redraws = needs_redraws ? TRUE : FALSE;
if (needs_redraws != container->reallocate_redraws)
{
container->reallocate_redraws = needs_redraws;
g_object_notify (G_OBJECT (container), "reallocate_redraws");
if (container->reallocate_redraws)
gtk_widget_queue_draw (GTK_WIDGET (container));
}
container->reallocate_redraws = needs_redraws ? TRUE : FALSE;
}
static GtkContainer*
......@@ -1092,7 +1070,7 @@ gtk_container_resize_children (GtkContainer *container)
/* we first check out if we actually need to perform a resize,
* which is not the case if we got another container queued for
* a resize in our anchestry. also we can skip the whole
* a resize in our ancestry. also we can skip the whole
* resize_widgets checks if we are a toplevel and NEED_RESIZE.
* this code assumes that our allocation is sufficient for our
* requisition, since otherwise we would NEED_RESIZE.
......@@ -1119,7 +1097,7 @@ gtk_container_resize_children (GtkContainer *container)
resize_container = GTK_WIDGET (container);
/* we now walk the anchestry for all resize widgets as long
/* we now walk the ancestry for all resize widgets as long
* as they are our children and as long as their allocation
* is insufficient, since we don't need to reallocate below that.
*/
......@@ -1141,9 +1119,9 @@ gtk_container_resize_children (GtkContainer *container)
}
/* for the newly setup resize_widgets list, we now walk each widget's
* anchestry to sort those widgets out that have RESIZE_NEEDED parents.
* ancestry to sort those widgets out that have RESIZE_NEEDED parents.
* we can safely stop the walk if we are the parent, since we checked
* our own anchestry already.
* our own ancestry already.
*/
resize_containers = NULL;
for (node = resize_widgets; node; node = node->next)
......
......@@ -321,11 +321,12 @@ gtk_signal_emitv (GtkObject *object,
GValue *value = params + 1 + i;
GtkArg *arg = args + i;
g_value_init (value, arg->type);
g_value_init (value, arg->type & ~G_SIGNAL_TYPE_STATIC_SCOPE);
if (!gtk_arg_static_to_value (arg, value))
{
g_warning ("%s: failed to convert arg type `%s' to value type `%s'",
G_STRLOC, g_type_name (arg->type), g_type_name (G_VALUE_TYPE (value)));
G_STRLOC, g_type_name (arg->type & ~G_SIGNAL_TYPE_STATIC_SCOPE),
g_type_name (G_VALUE_TYPE (value)));
return;
}
}
......
This diff is collapsed.
/* GTK - The GIMP Toolkit
* gtksizegroup.h:
* Copyright (C) 2000 Red Hat Software
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_SIZE_GROUP_H__
#define __GTK_SIZE_GROUP_H__
#include <gtk/gtkwidget.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_SIZE_GROUP (gtk_size_group_get_type ())
#define GTK_SIZE_GROUP(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SIZE_GROUP, GtkSizeGroup))
#define GTK_SIZE_GROUP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SIZE_GROUP, GtkSizeGroupClass))
#define GTK_IS_SIZE_GROUP(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SIZE_GROUP))
#define GTK_IS_SIZE_GROUP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SIZE_GROUP))
#define GTK_SIZE_GROUP_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_SIZE_GROUP, GtkSizeGroupClass))
typedef struct _GtkSizeGroup GtkSizeGroup;
typedef struct _GtkSizeGroupClass GtkSizeGroupClass;
struct _GtkSizeGroup
{
GObject parent_instance;
GSList *widgets;
guint8 mode;
guint have_width : 1;
guint have_height : 1;
GtkRequisition requisition;
};
struct _GtkSizeGroupClass
{
GObjectClass parent_class;
};
/**
* GtkSizeGroupMode:
* @GTK_SIZE_GROUP_NONE: group has no effect
* @GTK_SIZE_GROUP_HORIZONTAL: group effects horizontal requisition
* @GTK_SIZE_GROUP_VERTICAL: group effects vertical requisition
* @GTK_SIZE_GROUP_BOTH: group effects both horizontal and vertical requisition
*
* The mode of the size group determines the directions in which the size
* group effects the requested sizes of its component widgets.
**/
typedef enum {
GTK_SIZE_GROUP_NONE,
GTK_SIZE_GROUP_HORIZONTAL,
GTK_SIZE_GROUP_VERTICAL,
GTK_SIZE_GROUP_BOTH
} GtkSizeGroupMode;
GType gtk_size_group_get_type (void) G_GNUC_CONST;;
GtkSizeGroup * gtk_size_group_new (GtkSizeGroupMode mode);
void gtk_size_group_set_mode (GtkSizeGroup *size_group,
GtkSizeGroupMode type);
GtkSizeGroupMode gtk_size_group_get_mode (GtkSizeGroup *size_group);
void gtk_size_group_add_widget (GtkSizeGroup *size_group,
GtkWidget *widget);
void gtk_size_group_remove_widget (GtkSizeGroup *size_group,
GtkWidget *widget);
void _gtk_size_group_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition);
void _gtk_size_group_compute_requisition (GtkWidget *widget,
GtkRequisition *requisition);
void _gtk_size_group_queue_resize (GtkWidget *widget);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GTK_SIZE_GROUP_H__ */
......@@ -203,10 +203,10 @@ gtk_viewport_get_property (GObject *object,
switch (prop_id)
{
case PROP_HADJUSTMENT:
g_value_set_object (value, viewport->hadjustment);
g_value_set_object (value, G_OBJECT (viewport->hadjustment));
break;
case PROP_VADJUSTMENT:
g_value_set_object (value, viewport->vadjustment);
g_value_set_object (value, G_OBJECT (viewport->vadjustment));
break;
case PROP_SHADOW_TYPE:
g_value_set_enum (value, viewport->shadow_type);
......
......@@ -34,6 +34,7 @@
#include "gtkrc.h"
#include "gtkselection.h"
#include "gtksettings.h"
#include "gtksizegroup.h"
#include "gtksignal.h"
#include "gtkwidget.h"
#include "gtkwindow.h"
......@@ -2081,15 +2082,9 @@ gtk_widget_queue_resize (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
if (GTK_IS_RESIZE_CONTAINER (widget))
gtk_container_clear_resize_widgets (GTK_CONTAINER (widget));
gtk_widget_queue_clear (widget);
if (widget->parent)
gtk_container_queue_resize (GTK_CONTAINER (widget->parent));
else if (GTK_WIDGET_TOPLEVEL (widget) && GTK_IS_CONTAINER (widget))
gtk_container_queue_resize (GTK_CONTAINER (widget));
_gtk_size_group_queue_resize (widget);
}
/**
......@@ -2149,15 +2144,14 @@ gtk_widget_size_request (GtkWidget *widget,
g_warning ("gtk_widget_size_request() called on child widget with request equal\n to widget->requisition. gtk_widget_set_usize() may not work properly.");
#endif /* G_ENABLE_DEBUG */
gtk_widget_ref (widget);
gtk_widget_ensure_style (widget);
gtk_signal_emit (GTK_OBJECT (widget), widget_signals[SIZE_REQUEST],
&widget->requisition);
_gtk_size_group_compute_requisition (widget, requisition);
#if 0
if (requisition)
gtk_widget_get_child_requisition (widget, requisition);
gtk_widget_unref (widget);
#endif
}
/**
......@@ -2174,21 +2168,7 @@ void
gtk_widget_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWidgetAuxInfo *aux_info;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));