s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.

Wed Dec  2 01:39:02 1998  Tim Janik  <timj@gtk.org>

	* gtk/gtknotebook.h:
	* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.

	* incremented version number to 1.1.6 and made Gtk
 	dependant on GLib 1.1.6.

	* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
 	from guint16 to gint16, since sizes bigger than 32767 are not supported
 	anyways, and aritmethics with intermediate negative values are possible
 	now.

Tue Dec  1 00:00:04 1998  Tim Janik  <timj@gtk.org>

	* gtk/gtkscrolledwindow.c:
	implementation of GTK_POLICY_NEVER functionality, added rationales
	on the policy and size requisition handling at the top.
	(gtk_scrolled_window_size_request):
	we assume a default minimum for our child's width and height
	if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
	specified the dimension explicitely.
 	(gtk_scrolled_window_size_allocate):
	do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.

	* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
	size we require (including the child).

        * gtk/gtkclist.c:
	(gtk_clist_size_request): report the real size required.

	* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.

	* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
	need to be a static variable.

Mon Nov 30 22:41:25 1998  Tim Janik  <timj@gtk.org>

	* gtk/gtkclist.h:
	* gtk/gtkclist.c:
	* gtk/gtkviewport.h:
	* gtk/gtkviewport.c:
	* gtk/gtktext.h:
	* gtk/gtktext.c:
	* gtk/gtklayout.h:
	* gtk/gtklayout.c:
	* gtk/gtkwidget.h:
	* gtk/gtkwidget.c:
	* gtk/gtkscrolledwindow.h:
	* gtk/gtkscrolledwindow.c:
	s/scroll_adjustements/scroll_adjustments/
	s/scroll_adjustments/set_scroll_adjustments/g
This commit is contained in:
Tim Janik 1998-12-02 03:40:03 +00:00 committed by Tim Janik
parent 4ebc61c067
commit 0d15bc6687
23 changed files with 539 additions and 92 deletions

View File

@ -1,3 +1,56 @@
Wed Dec 2 01:39:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.
* incremented version number to 1.1.6 and made Gtk
dependant on GLib 1.1.6.
* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
from guint16 to gint16, since sizes bigger than 32767 are not supported
anyways, and aritmethics with intermediate negative values are possible
now.
Tue Dec 1 00:00:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkscrolledwindow.c:
implementation of GTK_POLICY_NEVER functionality, added rationales
on the policy and size requisition handling at the top.
(gtk_scrolled_window_size_request):
we assume a default minimum for our child's width and height
if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
specified the dimension explicitely.
(gtk_scrolled_window_size_allocate):
do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.
* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
size we require (including the child).
* gtk/gtkclist.c:
(gtk_clist_size_request): report the real size required.
* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.
* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
need to be a static variable.
Mon Nov 30 22:41:25 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
* gtk/gtktext.h:
* gtk/gtktext.c:
* gtk/gtklayout.h:
* gtk/gtklayout.c:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
s/scroll_adjustements/scroll_adjustments/
s/scroll_adjustments/set_scroll_adjustments/g
Tue Dec 1 22:45:58 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass): new class method/signal

View File

@ -1,3 +1,56 @@
Wed Dec 2 01:39:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.
* incremented version number to 1.1.6 and made Gtk
dependant on GLib 1.1.6.
* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
from guint16 to gint16, since sizes bigger than 32767 are not supported
anyways, and aritmethics with intermediate negative values are possible
now.
Tue Dec 1 00:00:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkscrolledwindow.c:
implementation of GTK_POLICY_NEVER functionality, added rationales
on the policy and size requisition handling at the top.
(gtk_scrolled_window_size_request):
we assume a default minimum for our child's width and height
if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
specified the dimension explicitely.
(gtk_scrolled_window_size_allocate):
do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.
* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
size we require (including the child).
* gtk/gtkclist.c:
(gtk_clist_size_request): report the real size required.
* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.
* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
need to be a static variable.
Mon Nov 30 22:41:25 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
* gtk/gtktext.h:
* gtk/gtktext.c:
* gtk/gtklayout.h:
* gtk/gtklayout.c:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
s/scroll_adjustements/scroll_adjustments/
s/scroll_adjustments/set_scroll_adjustments/g
Tue Dec 1 22:45:58 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass): new class method/signal

View File

@ -1,3 +1,56 @@
Wed Dec 2 01:39:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.
* incremented version number to 1.1.6 and made Gtk
dependant on GLib 1.1.6.
* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
from guint16 to gint16, since sizes bigger than 32767 are not supported
anyways, and aritmethics with intermediate negative values are possible
now.
Tue Dec 1 00:00:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkscrolledwindow.c:
implementation of GTK_POLICY_NEVER functionality, added rationales
on the policy and size requisition handling at the top.
(gtk_scrolled_window_size_request):
we assume a default minimum for our child's width and height
if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
specified the dimension explicitely.
(gtk_scrolled_window_size_allocate):
do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.
* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
size we require (including the child).
* gtk/gtkclist.c:
(gtk_clist_size_request): report the real size required.
* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.
* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
need to be a static variable.
Mon Nov 30 22:41:25 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
* gtk/gtktext.h:
* gtk/gtktext.c:
* gtk/gtklayout.h:
* gtk/gtklayout.c:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
s/scroll_adjustements/scroll_adjustments/
s/scroll_adjustments/set_scroll_adjustments/g
Tue Dec 1 22:45:58 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass): new class method/signal

View File

@ -1,3 +1,56 @@
Wed Dec 2 01:39:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.
* incremented version number to 1.1.6 and made Gtk
dependant on GLib 1.1.6.
* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
from guint16 to gint16, since sizes bigger than 32767 are not supported
anyways, and aritmethics with intermediate negative values are possible
now.
Tue Dec 1 00:00:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkscrolledwindow.c:
implementation of GTK_POLICY_NEVER functionality, added rationales
on the policy and size requisition handling at the top.
(gtk_scrolled_window_size_request):
we assume a default minimum for our child's width and height
if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
specified the dimension explicitely.
(gtk_scrolled_window_size_allocate):
do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.
* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
size we require (including the child).
* gtk/gtkclist.c:
(gtk_clist_size_request): report the real size required.
* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.
* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
need to be a static variable.
Mon Nov 30 22:41:25 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
* gtk/gtktext.h:
* gtk/gtktext.c:
* gtk/gtklayout.h:
* gtk/gtklayout.c:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
s/scroll_adjustements/scroll_adjustments/
s/scroll_adjustments/set_scroll_adjustments/g
Tue Dec 1 22:45:58 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass): new class method/signal

View File

@ -1,3 +1,56 @@
Wed Dec 2 01:39:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.
* incremented version number to 1.1.6 and made Gtk
dependant on GLib 1.1.6.
* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
from guint16 to gint16, since sizes bigger than 32767 are not supported
anyways, and aritmethics with intermediate negative values are possible
now.
Tue Dec 1 00:00:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkscrolledwindow.c:
implementation of GTK_POLICY_NEVER functionality, added rationales
on the policy and size requisition handling at the top.
(gtk_scrolled_window_size_request):
we assume a default minimum for our child's width and height
if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
specified the dimension explicitely.
(gtk_scrolled_window_size_allocate):
do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.
* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
size we require (including the child).
* gtk/gtkclist.c:
(gtk_clist_size_request): report the real size required.
* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.
* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
need to be a static variable.
Mon Nov 30 22:41:25 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
* gtk/gtktext.h:
* gtk/gtktext.c:
* gtk/gtklayout.h:
* gtk/gtklayout.c:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
s/scroll_adjustements/scroll_adjustments/
s/scroll_adjustments/set_scroll_adjustments/g
Tue Dec 1 22:45:58 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass): new class method/signal

View File

@ -1,3 +1,56 @@
Wed Dec 2 01:39:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.
* incremented version number to 1.1.6 and made Gtk
dependant on GLib 1.1.6.
* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
from guint16 to gint16, since sizes bigger than 32767 are not supported
anyways, and aritmethics with intermediate negative values are possible
now.
Tue Dec 1 00:00:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkscrolledwindow.c:
implementation of GTK_POLICY_NEVER functionality, added rationales
on the policy and size requisition handling at the top.
(gtk_scrolled_window_size_request):
we assume a default minimum for our child's width and height
if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
specified the dimension explicitely.
(gtk_scrolled_window_size_allocate):
do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.
* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
size we require (including the child).
* gtk/gtkclist.c:
(gtk_clist_size_request): report the real size required.
* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.
* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
need to be a static variable.
Mon Nov 30 22:41:25 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
* gtk/gtktext.h:
* gtk/gtktext.c:
* gtk/gtklayout.h:
* gtk/gtklayout.c:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
s/scroll_adjustements/scroll_adjustments/
s/scroll_adjustments/set_scroll_adjustments/g
Tue Dec 1 22:45:58 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass): new class method/signal

View File

@ -1,3 +1,56 @@
Wed Dec 2 01:39:02 1998 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: s/gtk_notebook_nth_page/gtk_notebook_get_nth_page/.
* incremented version number to 1.1.6 and made Gtk
dependant on GLib 1.1.6.
* gtk/gtkwidget.h (struct _GtkRequisition): changed width and height
from guint16 to gint16, since sizes bigger than 32767 are not supported
anyways, and aritmethics with intermediate negative values are possible
now.
Tue Dec 1 00:00:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkscrolledwindow.c:
implementation of GTK_POLICY_NEVER functionality, added rationales
on the policy and size requisition handling at the top.
(gtk_scrolled_window_size_request):
we assume a default minimum for our child's width and height
if [hv]scrollbar_policy != GTK_POLICY_NEVER, except when the user
specified the dimension explicitely.
(gtk_scrolled_window_size_allocate):
do not show scrollbars if [hv]scrollbar_policy == GTK_POLICY_NEVER.
* gtk/gtkviewport.c (gtk_viewport_size_request): report the real
size we require (including the child).
* gtk/gtkclist.c:
(gtk_clist_size_request): report the real size required.
* gtk/gtkenums.h (enum GtkPolicyType): added GTK_POLICY_NEVER.
* gtk/gtkobject.c (gtk_object_init_type): object_type doesn't
need to be a static variable.
Mon Nov 30 22:41:25 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
* gtk/gtktext.h:
* gtk/gtktext.c:
* gtk/gtklayout.h:
* gtk/gtklayout.c:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
s/scroll_adjustements/scroll_adjustments/
s/scroll_adjustments/set_scroll_adjustments/g
Tue Dec 1 22:45:58 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListClass): new class method/signal

View File

@ -14,7 +14,7 @@ cflags_set=${CFLAGS+set}
#
GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=1
GTK_MICRO_VERSION=5
GTK_MICRO_VERSION=6
GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
@ -175,7 +175,7 @@ fi
if test x$with_glib = x ; then
# Look for separately installed glib
AM_PATH_GLIB(1.1.5,,
AM_PATH_GLIB(1.1.6,,
AC_MSG_ERROR([
*** GLIB 1.1.5 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org.]),

View File

@ -171,9 +171,9 @@ static void gtk_clist_get_arg (GtkObject *object,
guint arg_id);
/* GtkWidget Methods */
static void gtk_clist_scroll_adjustments (GtkCList *clist,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
static void gtk_clist_set_scroll_adjustments (GtkCList *clist,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
static void gtk_clist_realize (GtkWidget *widget);
static void gtk_clist_unrealize (GtkWidget *widget);
static void gtk_clist_map (GtkWidget *widget);
@ -450,11 +450,11 @@ gtk_clist_class_init (GtkCListClass *klass)
object_class->finalize = gtk_clist_finalize;
widget_class->scroll_adjustments_signal =
gtk_signal_new ("scroll_adjustments",
widget_class->set_scroll_adjustments_signal =
gtk_signal_new ("set_scroll_adjustments",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkCListClass, scroll_adjustments),
GTK_SIGNAL_OFFSET (GtkCListClass, set_scroll_adjustments),
gtk_marshal_NONE__POINTER_POINTER,
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
@ -602,7 +602,7 @@ gtk_clist_class_init (GtkCListClass *klass)
container_class->focus = gtk_clist_focus;
container_class->set_focus_child = gtk_clist_set_focus_child;
klass->scroll_adjustments = gtk_clist_scroll_adjustments;
klass->set_scroll_adjustments = gtk_clist_set_scroll_adjustments;
klass->refresh = clist_refresh;
klass->select_row = real_select_row;
klass->unselect_row = real_unselect_row;
@ -1138,9 +1138,9 @@ gtk_clist_get_vadjustment (GtkCList *clist)
}
static void
gtk_clist_scroll_adjustments (GtkCList *clist,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
gtk_clist_set_scroll_adjustments (GtkCList *clist,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
{
if (clist->hadjustment != hadjustment)
gtk_clist_set_hadjustment (clist, hadjustment);
@ -5271,10 +5271,10 @@ gtk_clist_size_request (GtkWidget *widget,
(widget->style->klass->ythickness +
GTK_CONTAINER (widget)->border_width) * 2);
if (!clist->hadjustment)
requisition->width += list_requisition_width (clist);
if (!clist->vadjustment)
requisition->height += LIST_HEIGHT (clist);
/* if (!clist->hadjustment) */
requisition->width += list_requisition_width (clist);
/* if (!clist->vadjustment) */
requisition->height += LIST_HEIGHT (clist);
}
static void

View File

@ -189,9 +189,9 @@ struct _GtkCListClass
{
GtkContainerClass parent_class;
void (*scroll_adjustments) (GtkCList *clist,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void (*set_scroll_adjustments) (GtkCList *clist,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void (*refresh) (GtkCList *clist);
void (*select_row) (GtkCList *clist,
gint row,

View File

@ -343,11 +343,11 @@ gtk_layout_class_init (GtkLayoutClass *class)
widget_class->draw = gtk_layout_draw;
widget_class->expose_event = gtk_layout_expose;
widget_class->scroll_adjustments_signal =
gtk_signal_new ("scroll_adjustments",
widget_class->set_scroll_adjustments_signal =
gtk_signal_new ("set_scroll_adjustments",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkLayoutClass, scroll_adjustments),
GTK_SIGNAL_OFFSET (GtkLayoutClass, set_scroll_adjustments),
gtk_marshal_NONE__POINTER_POINTER,
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
@ -356,7 +356,7 @@ gtk_layout_class_init (GtkLayoutClass *class)
container_class->remove = gtk_layout_remove;
container_class->forall = gtk_layout_forall;
class->scroll_adjustments = gtk_layout_set_adjustments;
class->set_scroll_adjustments = gtk_layout_set_adjustments;
}
static void
@ -532,6 +532,9 @@ gtk_layout_size_request (GtkWidget *widget,
layout = GTK_LAYOUT (widget);
requisition->width = 0;
requisition->height = 0;
tmp_list = layout->children;
while (tmp_list)

View File

@ -77,9 +77,9 @@ struct _GtkLayout {
struct _GtkLayoutClass {
GtkContainerClass parent_class;
void (*scroll_adjustments) (GtkLayout *text,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void (*set_scroll_adjustments) (GtkLayout *layout,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
};
GtkType gtk_layout_get_type (void);

View File

@ -3565,9 +3565,9 @@ gtk_notebook_get_current_page (GtkNotebook *notebook)
return g_list_index (notebook->children, notebook->cur_page);
}
GtkWidget *
gtk_notebook_nth_page (GtkNotebook *notebook,
gint page_num)
GtkWidget*
gtk_notebook_get_nth_page (GtkNotebook *notebook,
gint page_num)
{
GtkNotebookPage *page;

View File

@ -132,9 +132,9 @@ void gtk_notebook_remove_page (GtkNotebook *notebook,
* query, set current NoteebookPage *
***********************************************************/
gint gtk_notebook_get_current_page (GtkNotebook *notebook);
GtkWidget * gtk_notebook_nth_page (GtkNotebook *notebook,
gint page_num);
gint gtk_notebook_get_current_page (GtkNotebook *notebook);
GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook,
gint page_num);
gint gtk_notebook_page_num (GtkNotebook *notebook,
GtkWidget *child);
void gtk_notebook_set_page (GtkNotebook *notebook,

View File

@ -96,7 +96,6 @@ gtk_object_debug (void)
void
gtk_object_init_type (void)
{
static GtkType object_type = 0;
static const GtkTypeInfo object_info =
{
"GtkObject",
@ -108,6 +107,7 @@ gtk_object_init_type (void)
/* reserved_2 */ NULL,
(GtkClassInitFunc) gtk_object_base_class_init,
};
GtkType object_type;
object_type = gtk_type_unique (0, &object_info);
g_assert (object_type == GTK_TYPE_OBJECT);

View File

@ -20,6 +20,41 @@
#include "gtksignal.h"
/* scrolled window policy and size requisition handling:
*
* gtk size requisition works as follows:
* a widget upon size-request reports the width and height that it finds
* to be best suited to display its contents, including children.
* the width and/or height reported from a widget upon size requisition
* may be overidden by the user by specifying a width and/or height
* other than 0 through gtk_widget_set_usize().
*
* a scrolled window needs (for imlementing all three policy types) to
* request its width and height based on two different rationales.
* 1) the user wants the scrolled window to just fit into the space
* that it gets allocated for a specifc dimension.
* 1.1) this does not apply if the user specified a concrete value
* value for that specific dimension by either specifying usize for the
* scrolled window or for its child.
* 2) the user wants the scrolled window to take as much space up as
* is desired by the child for a specifc dimension (i.e. POLICY_NEVER).
*
* also, kinda obvious:
* 3) a user would certainly not have choosen a scrolled window as a container
* for the child, if the resulting allocation takes up more space than the
* child would have allocated without the scrolled window.
*
* conclusions:
* A) from 1) follows: the scrolled window shouldn't request more space for a
* specifc dimension than is required at minimum.
* B) from 1.1) follows: the requisition may be overidden by usize of the scrolled
* window (done automatically) or by usize of the child (needs to be checked).
* C) from 2) follows: for POLICY_NEVER, the scrolled window simply reports the
* child's dimension.
* D) from 3) follows: the scrolled window child's minimum width and minimum height
* under A) at least correspond to the space taken up by its scrollbars.
*/
#define SCROLLBAR_SPACING(w) (GTK_SCROLLED_WINDOW_CLASS (GTK_OBJECT (w)->klass)->scrollbar_spacing)
enum {
@ -306,9 +341,9 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
gtk_scrolled_window_adjustment_changed (hadjustment, scrolled_window);
if (bin->child)
gtk_widget_scroll_adjustements (bin->child,
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar)),
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar)));
gtk_widget_set_scroll_adjustments (bin->child,
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar)),
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar)));
}
void
@ -359,9 +394,9 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
gtk_scrolled_window_adjustment_changed (vadjustment, scrolled_window);
if (bin->child)
gtk_widget_scroll_adjustements (bin->child,
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar)),
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar)));
gtk_widget_set_scroll_adjustments (bin->child,
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar)),
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar)));
}
GtkAdjustment*
@ -565,13 +600,46 @@ gtk_scrolled_window_size_request (GtkWidget *widget,
requisition->width = 0;
requisition->height = 0;
gtk_widget_size_request (scrolled_window->hscrollbar,
&scrolled_window->hscrollbar->requisition);
gtk_widget_size_request (scrolled_window->vscrollbar,
&scrolled_window->vscrollbar->requisition);
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
static guint quark_aux_info = 0;
if (!quark_aux_info)
quark_aux_info = g_quark_from_static_string ("gtk-aux-info");
gtk_widget_size_request (bin->child, &bin->child->requisition);
requisition->width += bin->child->requisition.width;
requisition->height += bin->child->requisition.height;
if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
requisition->width += bin->child->requisition.width;
else
{
GtkWidgetAuxInfo *aux_info;
aux_info = gtk_object_get_data_by_id (GTK_OBJECT (bin->child), quark_aux_info);
if (aux_info && aux_info->width > 0)
requisition->width += aux_info->width;
else
requisition->width += scrolled_window->vscrollbar->requisition.width;
}
if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
requisition->height += bin->child->requisition.height;
else
{
GtkWidgetAuxInfo *aux_info;
aux_info = gtk_object_get_data_by_id (GTK_OBJECT (bin->child), quark_aux_info);
if (aux_info && aux_info->height > 0)
requisition->height += aux_info->height;
else
requisition->height += scrolled_window->hscrollbar->requisition.height;
}
}
extra_width = 0;
@ -580,9 +648,6 @@ gtk_scrolled_window_size_request (GtkWidget *widget,
if ((scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC) ||
GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
{
gtk_widget_size_request (scrolled_window->hscrollbar,
&scrolled_window->hscrollbar->requisition);
requisition->width = MAX (requisition->width, scrolled_window->hscrollbar->requisition.width);
extra_height = SCROLLBAR_SPACING (scrolled_window) + scrolled_window->hscrollbar->requisition.height;
}
@ -590,9 +655,6 @@ gtk_scrolled_window_size_request (GtkWidget *widget,
if ((scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC) ||
GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
{
gtk_widget_size_request (scrolled_window->vscrollbar,
&scrolled_window->vscrollbar->requisition);
requisition->height = MAX (requisition->height, scrolled_window->vscrollbar->requisition.height);
extra_width = SCROLLBAR_SPACING (scrolled_window) + scrolled_window->vscrollbar->requisition.width;
}
@ -661,8 +723,12 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
if (scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
scrolled_window->hscrollbar_visible = TRUE;
else if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
scrolled_window->hscrollbar_visible = FALSE;
if (scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS)
scrolled_window->vscrollbar_visible = TRUE;
else if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
scrolled_window->vscrollbar_visible = FALSE;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
@ -813,9 +879,9 @@ gtk_scrolled_window_add (GtkContainer *container,
bin->child = child;
/* this is a temporary message */
if (!gtk_widget_scroll_adjustements (child,
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar)),
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar))))
if (!gtk_widget_set_scroll_adjustments (child,
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->hscrollbar)),
gtk_range_get_adjustment (GTK_RANGE (scrolled_window->vscrollbar))))
g_message ("gtk_scrolled_window_add(): cannot add non scrollable widget "
"use gtk_scrolled_window_add_with_viewport() instead");
@ -843,7 +909,7 @@ gtk_scrolled_window_remove (GtkContainer *container,
g_return_if_fail (child != NULL);
g_return_if_fail (GTK_BIN (container)->child == child);
gtk_widget_scroll_adjustements (child, NULL, NULL);
gtk_widget_set_scroll_adjustments (child, NULL, NULL);
/* chain parent class handler to remove child */
GTK_CONTAINER_CLASS (parent_class)->remove (container, child);

View File

@ -571,11 +571,11 @@ gtk_text_class_init (GtkTextClass *class)
widget_class->focus_in_event = gtk_text_focus_in;
widget_class->focus_out_event = gtk_text_focus_out;
widget_class->scroll_adjustments_signal =
gtk_signal_new ("scroll_adjustments",
widget_class->set_scroll_adjustments_signal =
gtk_signal_new ("set_scroll_adjustments",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkTextClass, scroll_adjustments),
GTK_SIGNAL_OFFSET (GtkTextClass, set_scroll_adjustments),
gtk_marshal_NONE__POINTER_POINTER,
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
@ -598,7 +598,7 @@ gtk_text_class_init (GtkTextClass *class)
editable_class->set_selection = gtk_text_set_selection;
editable_class->set_position = gtk_text_set_position;
class->scroll_adjustments = gtk_text_set_adjustments;
class->set_scroll_adjustments = gtk_text_set_adjustments;
}
static void

View File

@ -157,9 +157,9 @@ struct _GtkTextClass
{
GtkEditableClass parent_class;
void (*scroll_adjustments) (GtkText *text,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void (*set_scroll_adjustments) (GtkText *text,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
};

View File

@ -37,7 +37,7 @@ static void gtk_viewport_set_arg (GtkObject *object,
static void gtk_viewport_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_viewport_scroll_adjustments (GtkViewport *viewport,
static void gtk_viewport_set_scroll_adjustments (GtkViewport *viewport,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
static void gtk_viewport_map (GtkWidget *widget);
@ -130,17 +130,17 @@ gtk_viewport_class_init (GtkViewportClass *class)
widget_class->size_allocate = gtk_viewport_size_allocate;
widget_class->style_set = gtk_viewport_style_set;
widget_class->scroll_adjustments_signal =
gtk_signal_new ("scroll_adjustments",
widget_class->set_scroll_adjustments_signal =
gtk_signal_new ("set_scroll_adjustments",
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkViewportClass, scroll_adjustments),
GTK_SIGNAL_OFFSET (GtkViewportClass, set_scroll_adjustments),
gtk_marshal_NONE__POINTER_POINTER,
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
container_class->add = gtk_viewport_add;
class->scroll_adjustments = gtk_viewport_scroll_adjustments;
class->set_scroll_adjustments = gtk_viewport_set_scroll_adjustments;
}
static void
@ -341,9 +341,9 @@ gtk_viewport_set_vadjustment (GtkViewport *viewport,
}
static void
gtk_viewport_scroll_adjustments (GtkViewport *viewport,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
gtk_viewport_set_scroll_adjustments (GtkViewport *viewport,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
{
if (viewport->hadjustment != hadjustment)
gtk_viewport_set_hadjustment (viewport, hadjustment);
@ -636,7 +636,11 @@ gtk_viewport_size_request (GtkWidget *widget,
GTK_WIDGET (widget)->style->klass->ythickness) * 2 + 5;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
gtk_widget_size_request (bin->child, &bin->child->requisition);
{
gtk_widget_size_request (bin->child, &bin->child->requisition);
requisition->width += bin->child->requisition.width;
requisition->height += bin->child->requisition.height;
}
}
static void

View File

@ -55,9 +55,9 @@ struct _GtkViewportClass
{
GtkBinClass parent_class;
void (*scroll_adjustments) (GtkViewport *viewport,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void (*set_scroll_adjustments) (GtkViewport *viewport,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
};

View File

@ -703,7 +703,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
object_class->finalize = gtk_widget_finalize;
klass->activate_signal = 0;
klass->scroll_adjustments_signal = 0;
klass->set_scroll_adjustments_signal = 0;
klass->show = gtk_widget_real_show;
klass->show_all = gtk_widget_show;
klass->hide = gtk_widget_real_hide;
@ -2638,9 +2638,9 @@ gtk_widget_activate (GtkWidget *widget)
}
gboolean
gtk_widget_scroll_adjustements (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
gtk_widget_set_scroll_adjustments (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
@ -2649,11 +2649,11 @@ gtk_widget_scroll_adjustements (GtkWidget *widget,
if (vadjustment)
g_return_val_if_fail (GTK_IS_ADJUSTMENT (vadjustment), FALSE);
if (WIDGET_CLASS (widget)->scroll_adjustments_signal)
if (WIDGET_CLASS (widget)->set_scroll_adjustments_signal)
{
/* FIXME: we should eventually check the signals signature here */
gtk_signal_emit (GTK_OBJECT (widget),
WIDGET_CLASS (widget)->scroll_adjustments_signal,
WIDGET_CLASS (widget)->set_scroll_adjustments_signal,
hadjustment, vadjustment);
return TRUE;
}

View File

@ -110,8 +110,8 @@ typedef void (*GtkCallback) (GtkWidget *widget,
*/
struct _GtkRequisition
{
guint16 width;
guint16 height;
gint16 width;
gint16 height;
};
/* An allocation is a size and position. Where a widget
@ -235,7 +235,7 @@ struct _GtkWidgetClass
* handles the emission.
* Implementation of this signal is optional.
*/
guint scroll_adjustments_signal;
guint set_scroll_adjustments_signal;
/* basics */
void (* show) (GtkWidget *widget);
@ -470,10 +470,10 @@ void gtk_widget_unlock_accelerators (GtkWidget *widget);
gint gtk_widget_event (GtkWidget *widget,
GdkEvent *event);
gboolean gtk_widget_activate (GtkWidget *widget);
gboolean gtk_widget_scroll_adjustements (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
gboolean gtk_widget_activate (GtkWidget *widget);
gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void gtk_widget_reparent (GtkWidget *widget,
GtkWidget *new_parent);

View File

@ -680,22 +680,24 @@ gtk_window_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWindow *window;
GtkBin *bin;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WINDOW (widget));
g_return_if_fail (requisition != NULL);
window = GTK_WINDOW (widget);
bin = GTK_BIN (window);
requisition->width = GTK_CONTAINER (window)->border_width * 2;
requisition->height = GTK_CONTAINER (window)->border_width * 2;
if (window->bin.child)
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
requisition->width = GTK_CONTAINER (window)->border_width * 2;
requisition->height = GTK_CONTAINER (window)->border_width * 2;
gtk_widget_size_request (bin->child, &bin->child->requisition);
gtk_widget_size_request (window->bin.child, &window->bin.child->requisition);
requisition->width += window->bin.child->requisition.width;
requisition->height += window->bin.child->requisition.height;
requisition->width += bin->child->requisition.width;
requisition->height += bin->child->requisition.height;
}
else
{
@ -1292,7 +1294,8 @@ gtk_window_set_hints (GtkWidget *widget,
if (!window->allow_grow)
flags |= GDK_HINT_MAX_SIZE;
gdk_window_set_hints (widget->window, ux, uy,
gdk_window_set_hints (widget->window,
ux, uy,
requisition->width, requisition->height,
requisition->width, requisition->height,
flags);