Commit af24aef7 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

handle negative values similar to gtk_widget_set_uposition(). that is:

Thu Jul 16 01:27:15 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.h:
        * gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
        similar to gtk_widget_set_uposition(). that is: -1=unspecified,
        -2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
        to be gint16s rather than guint16s, since that's what the code expected
        (for a long time actually).

        * gtk/gtkviewport.c:
        added support for object arguments: GtkViewport::shadow_type,
        GtkViewport::vadjustment and GtkViewport::hadjustment.
        (gtk_viewport_add): chain gtk_bin_add.

        * gtk/gtkscrolledwindow.c:
        added support for object argument: GtkScrolledWindow::hscrollbar_policy,
        GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.

        * gtk/gtkadjustment.h:
        * gtk/gtkadjustment.c:
        * gtk/gtkctree.h:
        * gtk/gtkclist.h:
        * gtk/gtkctree.c:
        * gtk/gtkclist.c:
        * gtk/gtkscrolledwindow.h:
        * gtk/gtkscrolledwindow.c:
        * gtk/gtkviewport.h:
        * gtk/gtkviewport.c:
        GtkType and macro fixups.
parent 8b9b7b9d
Thu Jul 16 01:27:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
similar to gtk_widget_set_uposition(). that is: -1=unspecified,
-2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
to be gint16s rather than guint16s, since that's what the code expected
(for a long time actually).
* gtk/gtkviewport.c:
added support for object arguments: GtkViewport::shadow_type,
GtkViewport::vadjustment and GtkViewport::hadjustment.
(gtk_viewport_add): chain gtk_bin_add.
* gtk/gtkscrolledwindow.c:
added support for object argument: GtkScrolledWindow::hscrollbar_policy,
GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.
* gtk/gtkadjustment.h:
* gtk/gtkadjustment.c:
* gtk/gtkctree.h:
* gtk/gtkclist.h:
* gtk/gtkctree.c:
* gtk/gtkclist.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
GtkType and macro fixups.
Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org> Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h : * gtk/gtkctree.h :
......
Thu Jul 16 01:27:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
similar to gtk_widget_set_uposition(). that is: -1=unspecified,
-2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
to be gint16s rather than guint16s, since that's what the code expected
(for a long time actually).
* gtk/gtkviewport.c:
added support for object arguments: GtkViewport::shadow_type,
GtkViewport::vadjustment and GtkViewport::hadjustment.
(gtk_viewport_add): chain gtk_bin_add.
* gtk/gtkscrolledwindow.c:
added support for object argument: GtkScrolledWindow::hscrollbar_policy,
GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.
* gtk/gtkadjustment.h:
* gtk/gtkadjustment.c:
* gtk/gtkctree.h:
* gtk/gtkclist.h:
* gtk/gtkctree.c:
* gtk/gtkclist.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
GtkType and macro fixups.
Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org> Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h : * gtk/gtkctree.h :
......
Thu Jul 16 01:27:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
similar to gtk_widget_set_uposition(). that is: -1=unspecified,
-2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
to be gint16s rather than guint16s, since that's what the code expected
(for a long time actually).
* gtk/gtkviewport.c:
added support for object arguments: GtkViewport::shadow_type,
GtkViewport::vadjustment and GtkViewport::hadjustment.
(gtk_viewport_add): chain gtk_bin_add.
* gtk/gtkscrolledwindow.c:
added support for object argument: GtkScrolledWindow::hscrollbar_policy,
GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.
* gtk/gtkadjustment.h:
* gtk/gtkadjustment.c:
* gtk/gtkctree.h:
* gtk/gtkclist.h:
* gtk/gtkctree.c:
* gtk/gtkclist.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
GtkType and macro fixups.
Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org> Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h : * gtk/gtkctree.h :
......
Thu Jul 16 01:27:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
similar to gtk_widget_set_uposition(). that is: -1=unspecified,
-2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
to be gint16s rather than guint16s, since that's what the code expected
(for a long time actually).
* gtk/gtkviewport.c:
added support for object arguments: GtkViewport::shadow_type,
GtkViewport::vadjustment and GtkViewport::hadjustment.
(gtk_viewport_add): chain gtk_bin_add.
* gtk/gtkscrolledwindow.c:
added support for object argument: GtkScrolledWindow::hscrollbar_policy,
GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.
* gtk/gtkadjustment.h:
* gtk/gtkadjustment.c:
* gtk/gtkctree.h:
* gtk/gtkclist.h:
* gtk/gtkctree.c:
* gtk/gtkclist.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
GtkType and macro fixups.
Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org> Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h : * gtk/gtkctree.h :
......
Thu Jul 16 01:27:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
similar to gtk_widget_set_uposition(). that is: -1=unspecified,
-2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
to be gint16s rather than guint16s, since that's what the code expected
(for a long time actually).
* gtk/gtkviewport.c:
added support for object arguments: GtkViewport::shadow_type,
GtkViewport::vadjustment and GtkViewport::hadjustment.
(gtk_viewport_add): chain gtk_bin_add.
* gtk/gtkscrolledwindow.c:
added support for object argument: GtkScrolledWindow::hscrollbar_policy,
GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.
* gtk/gtkadjustment.h:
* gtk/gtkadjustment.c:
* gtk/gtkctree.h:
* gtk/gtkclist.h:
* gtk/gtkctree.c:
* gtk/gtkclist.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
GtkType and macro fixups.
Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org> Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h : * gtk/gtkctree.h :
......
Thu Jul 16 01:27:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
similar to gtk_widget_set_uposition(). that is: -1=unspecified,
-2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
to be gint16s rather than guint16s, since that's what the code expected
(for a long time actually).
* gtk/gtkviewport.c:
added support for object arguments: GtkViewport::shadow_type,
GtkViewport::vadjustment and GtkViewport::hadjustment.
(gtk_viewport_add): chain gtk_bin_add.
* gtk/gtkscrolledwindow.c:
added support for object argument: GtkScrolledWindow::hscrollbar_policy,
GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.
* gtk/gtkadjustment.h:
* gtk/gtkadjustment.c:
* gtk/gtkctree.h:
* gtk/gtkclist.h:
* gtk/gtkctree.c:
* gtk/gtkclist.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
GtkType and macro fixups.
Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org> Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h : * gtk/gtkctree.h :
......
Thu Jul 16 01:27:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_set_usize): handle negative values
similar to gtk_widget_set_uposition(). that is: -1=unspecified,
-2=leave untouched. changed the width/height field of GtkWidgetAuxInfo
to be gint16s rather than guint16s, since that's what the code expected
(for a long time actually).
* gtk/gtkviewport.c:
added support for object arguments: GtkViewport::shadow_type,
GtkViewport::vadjustment and GtkViewport::hadjustment.
(gtk_viewport_add): chain gtk_bin_add.
* gtk/gtkscrolledwindow.c:
added support for object argument: GtkScrolledWindow::hscrollbar_policy,
GtkScrolledWindow::vscrollbar_policy and GtkScrolledWindow::viewport.
* gtk/gtkadjustment.h:
* gtk/gtkadjustment.c:
* gtk/gtkctree.h:
* gtk/gtkclist.h:
* gtk/gtkctree.c:
* gtk/gtkclist.c:
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
* gtk/gtkviewport.h:
* gtk/gtkviewport.c:
GtkType and macro fixups.
Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org> Thu Jul 16 01:10:02 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h : * gtk/gtkctree.h :
......
...@@ -23,6 +23,14 @@ ...@@ -23,6 +23,14 @@
(tabbed GTK_CTREE_LINES_TABBED) (tabbed GTK_CTREE_LINES_TABBED)
(none GTK_CTREE_LINES_NONE)) (none GTK_CTREE_LINES_NONE))
(define-enum GtkCTreeExpansion
(expand GTK_CTREE_EXPANSION_EXPAND)
(expand-recursive GTK_CTREE_EXPANSION_EXPAND_RECURSIVE)
(collapse GTK_CTREE_EXPANSION_COLLAPSE)
(collapse-recursive GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE)
(toggle GTK_CTREE_EXPANSION_TOGGLE)
(toggle-recursive GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE))
; enumerations from "./gtkdebug.h" ; enumerations from "./gtkdebug.h"
(define-flags GtkDebugFlag (define-flags GtkDebugFlag
...@@ -362,6 +370,13 @@ ...@@ -362,6 +370,13 @@
(color-context GDK_DEBUG_COLOR_CONTEXT) (color-context GDK_DEBUG_COLOR_CONTEXT)
(xim GDK_DEBUG_XIM)) (xim GDK_DEBUG_XIM))
; enumerations from "../gdk/gdkrgb.h"
(define-enum GdkRgbDither
(none GDK_RGB_DITHER_NONE)
(normal GDK_RGB_DITHER_NORMAL)
(max GDK_RGB_DITHER_MAX))
; enumerations from "../gdk/gdktypes.h" ; enumerations from "../gdk/gdktypes.h"
(define-enum GdkWindowType (define-enum GdkWindowType
......
...@@ -53,7 +53,7 @@ gtk_adjustment_get_type (void) ...@@ -53,7 +53,7 @@ gtk_adjustment_get_type (void)
(GtkClassInitFunc) NULL, (GtkClassInitFunc) NULL,
}; };
adjustment_type = gtk_type_unique (gtk_data_get_type (), &adjustment_info); adjustment_type = gtk_type_unique (GTK_TYPE_DATA, &adjustment_info);
} }
return adjustment_type; return adjustment_type;
......
...@@ -30,9 +30,11 @@ extern "C" { ...@@ -30,9 +30,11 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#define GTK_ADJUSTMENT(obj) (GTK_CHECK_CAST (obj, gtk_adjustment_get_type (), GtkAdjustment)) #define GTK_TYPE_ADJUSTMENT (gtk_adjustment_get_type ())
#define GTK_ADJUSTMENT_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, gtk_adjustment_get_type (), GtkAdjustmentClass)) #define GTK_ADJUSTMENT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_ADJUSTMENT, GtkAdjustment))
#define GTK_IS_ADJUSTMENT(obj) (GTK_CHECK_TYPE (obj, gtk_adjustment_get_type ())) #define GTK_ADJUSTMENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ADJUSTMENT, GtkAdjustmentClass))
#define GTK_IS_ADJUSTMENT(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_ADJUSTMENT))
#define GTK_IS_ADJUSTMENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ADJUSTMENT))
typedef struct _GtkAdjustment GtkAdjustment; typedef struct _GtkAdjustment GtkAdjustment;
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#pragma }
#endif /* __cplusplus */ #endif /* __cplusplus */
......
...@@ -402,7 +402,7 @@ gtk_clist_get_type (void) ...@@ -402,7 +402,7 @@ gtk_clist_get_type (void)
(GtkClassInitFunc) NULL, (GtkClassInitFunc) NULL,
}; };
clist_type = gtk_type_unique (gtk_container_get_type (), &clist_info); clist_type = gtk_type_unique (GTK_TYPE_CONTAINER, &clist_info);
} }
return clist_type; return clist_type;
...@@ -419,7 +419,7 @@ gtk_clist_class_init (GtkCListClass * klass) ...@@ -419,7 +419,7 @@ gtk_clist_class_init (GtkCListClass * klass)
widget_class = (GtkWidgetClass *) klass; widget_class = (GtkWidgetClass *) klass;
container_class = (GtkContainerClass *) klass; container_class = (GtkContainerClass *) klass;
parent_class = gtk_type_class (gtk_container_get_type ()); parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
clist_signals[SELECT_ROW] = clist_signals[SELECT_ROW] =
gtk_signal_new ("select_row", gtk_signal_new ("select_row",
...@@ -961,7 +961,7 @@ gtk_clist_new_with_titles (gint columns, ...@@ -961,7 +961,7 @@ gtk_clist_new_with_titles (gint columns,
g_return_val_if_fail (titles != NULL, NULL); g_return_val_if_fail (titles != NULL, NULL);
widget = gtk_type_new (gtk_clist_get_type ()); widget = gtk_type_new (GTK_TYPE_CLIST);
gtk_clist_construct (GTK_CLIST (widget), columns, titles); gtk_clist_construct (GTK_CLIST (widget), columns, titles);
...@@ -976,7 +976,7 @@ gtk_clist_new (gint columns) ...@@ -976,7 +976,7 @@ gtk_clist_new (gint columns)
if (columns < 1) if (columns < 1)
return NULL; return NULL;
clist = gtk_type_new (gtk_clist_get_type ()); clist = gtk_type_new (GTK_TYPE_CLIST);
gtk_clist_construct (clist, columns, NULL); gtk_clist_construct (clist, columns, NULL);
return GTK_WIDGET (clist); return GTK_WIDGET (clist);
} }
......
...@@ -57,15 +57,15 @@ typedef enum ...@@ -57,15 +57,15 @@ typedef enum
GTK_CELL_WIDGET GTK_CELL_WIDGET
} GtkCellType; } GtkCellType;
#define GTK_TYPE_CLIST (gtk_clist_get_type ()) #define GTK_TYPE_CLIST (gtk_clist_get_type ())
#define GTK_CLIST(obj) (GTK_CHECK_CAST ((obj), gtk_clist_get_type (), GtkCList)) #define GTK_CLIST(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CLIST, GtkCList))
#define GTK_CLIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), gtk_clist_get_type (), GtkCListClass)) #define GTK_CLIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CLIST, GtkCListClass))
#define GTK_IS_CLIST(obj) (GTK_CHECK_TYPE ((obj), gtk_clist_get_type ())) #define GTK_IS_CLIST(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CLIST))
#define GTK_IS_CLIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CLIST)) #define GTK_IS_CLIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CLIST))
#define GTK_CLIST_FLAGS(clist) (GTK_CLIST (clist)->flags) #define GTK_CLIST_FLAGS(clist) (GTK_CLIST (clist)->flags)
#define GTK_CLIST_SET_FLAG(clist,flag) (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag)) #define GTK_CLIST_SET_FLAG(clist,flag) (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag))
#define GTK_CLIST_UNSET_FLAG(clist,flag) (GTK_CLIST_FLAGS (clist) &= ~(GTK_ ## flag)) #define GTK_CLIST_UNSET_FLAG(clist,flag) (GTK_CLIST_FLAGS (clist) &= ~(GTK_ ## flag))
#define GTK_CLIST_FROZEN(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_FROZEN) #define GTK_CLIST_FROZEN(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_FROZEN)
#define GTK_CLIST_IN_DRAG(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_IN_DRAG) #define GTK_CLIST_IN_DRAG(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_IN_DRAG)
......
...@@ -265,7 +265,7 @@ gtk_ctree_get_type (void) ...@@ -265,7 +265,7 @@ gtk_ctree_get_type (void)
(GtkClassInitFunc) NULL, (GtkClassInitFunc) NULL,
}; };
ctree_type = gtk_type_unique (gtk_clist_get_type (), &ctree_info); ctree_type = gtk_type_unique (GTK_TYPE_CLIST, &ctree_info);
} }
return ctree_type; return ctree_type;
...@@ -337,8 +337,8 @@ gtk_ctree_class_init (GtkCTreeClass *klass) ...@@ -337,8 +337,8 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
container_class = (GtkContainerClass *) klass; container_class = (GtkContainerClass *) klass;
clist_class = (GtkCListClass *) klass; clist_class = (GtkCListClass *) klass;
parent_class = gtk_type_class (gtk_clist_get_type ()); parent_class = gtk_type_class (GTK_TYPE_CLIST);
container_class = gtk_type_class (gtk_container_get_type ()); container_class = gtk_type_class (GTK_TYPE_CONTAINER);
ctree_signals[TREE_SELECT_ROW] = ctree_signals[TREE_SELECT_ROW] =
gtk_signal_new ("tree_select_row", gtk_signal_new ("tree_select_row",
...@@ -3728,7 +3728,7 @@ gtk_ctree_new_with_titles (gint columns, ...@@ -3728,7 +3728,7 @@ gtk_ctree_new_with_titles (gint columns,
g_return_val_if_fail (columns > 0, NULL); g_return_val_if_fail (columns > 0, NULL);
g_return_val_if_fail (tree_column >= 0 && tree_column < columns, NULL); g_return_val_if_fail (tree_column >= 0 && tree_column < columns, NULL);
widget = gtk_type_new (gtk_ctree_get_type ()); widget = gtk_type_new (GTK_TYPE_CTREE);
gtk_ctree_construct (GTK_CTREE (widget), columns, tree_column, titles); gtk_ctree_construct (GTK_CTREE (widget), columns, tree_column, titles);
return widget; return widget;
} }
......
...@@ -31,12 +31,12 @@ extern "C" ...@@ -31,12 +31,12 @@ extern "C"
{ {
#endif /* __cplusplus */ #endif /* __cplusplus */
#define GTK_CTREE(obj) \ #define GTK_TYPE_CTREE (gtk_ctree_get_type ())
(GTK_CHECK_CAST ((obj), gtk_ctree_get_type (), GtkCTree)) #define GTK_CTREE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CTREE, GtkCTree))
#define GTK_CTREE_CLASS(klass) \ #define GTK_CTREE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CTREE, GtkCTreeClass))
(GTK_CHECK_CLASS_CAST ((klass), gtk_ctree_get_type (), GtkCTreeClass)) #define GTK_IS_CTREE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CTREE))
#define GTK_IS_CTREE(obj) \ #define GTK_IS_CTREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CTREE))
(GTK_CHECK_TYPE ((obj), gtk_ctree_get_type ()))
#define GTK_CTREE_ROW(_glist_) ((GtkCTreeRow *)((_glist_)->data)) #define GTK_CTREE_ROW(_glist_) ((GtkCTreeRow *)((_glist_)->data))
#define GTK_CTREE_TREE(_ctree_, _glist_) \ #define GTK_CTREE_TREE(_ctree_, _glist_) \
((GtkCellTree *) &(((GtkCTreeRow *)((_glist_)->data))->cell[(_ctree_)->tree_col])) ((GtkCellTree *) &(((GtkCTreeRow *)((_glist_)->data))->cell[(_ctree_)->tree_col]))
......
...@@ -855,9 +855,12 @@ gtk_object_add_arg_type (const char *arg_name, ...@@ -855,9 +855,12 @@ gtk_object_add_arg_type (const char *arg_name,
g_return_if_fail (arg_name != NULL); g_return_if_fail (arg_name != NULL);
g_return_if_fail (arg_type > GTK_TYPE_NONE); g_return_if_fail (arg_type > GTK_TYPE_NONE);
g_return_if_fail (arg_id > 0); g_return_if_fail (arg_id > 0);
g_return_if_fail ((arg_flags & GTK_ARG_READWRITE) != 0);
g_return_if_fail ((arg_flags & GTK_ARG_CHILD_ARG) == 0); g_return_if_fail ((arg_flags & GTK_ARG_CHILD_ARG) == 0);
if (arg_flags & GTK_ARG_CONSTRUCT)
g_return_if_fail ((arg_flags & GTK_ARG_READWRITE) == GTK_ARG_READWRITE);
else
g_return_if_fail ((arg_flags & GTK_ARG_READWRITE) != 0);
if (!object_arg_info_ht) if (!object_arg_info_ht)
object_arg_info_ht = g_hash_table_new (gtk_arg_info_hash, object_arg_info_ht = g_hash_table_new (gtk_arg_info_hash,
gtk_arg_info_equal); gtk_arg_info_equal);
......
...@@ -22,9 +22,22 @@ ...@@ -22,9 +22,22 @@
#define SCROLLBAR_SPACING(w) (GTK_SCROLLED_WINDOW_CLASS (GTK_OBJECT (w)->klass)->scrollbar_spacing) #define SCROLLBAR_SPACING(w) (GTK_SCROLLED_WINDOW_CLASS (GTK_OBJECT (w)->klass)->scrollbar_spacing)
enum {
ARG_0,
ARG_VIEWPORT,
ARG_HSCROLLBAR_POLICY,
ARG_VSCROLLBAR_POLICY
};
static void gtk_scrolled_window_class_init (GtkScrolledWindowClass *klass); static void gtk_scrolled_window_class_init (GtkScrolledWindowClass *klass);
static void gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window); static void gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window);
static void gtk_scrolled_window_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_scrolled_window_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_scrolled_window_destroy (GtkObject *object); static void gtk_scrolled_window_destroy (GtkObject *object);
static void gtk_scrolled_window_finalize (GtkObject *object); static void gtk_scrolled_window_finalize (GtkObject *object);
static void gtk_scrolled_window_map (GtkWidget *widget); static void gtk_scrolled_window_map (GtkWidget *widget);
...@@ -51,10 +64,10 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adju ...@@ -51,10 +64,10 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adju
static GtkContainerClass *parent_class = NULL; static GtkContainerClass *parent_class = NULL;
guint GtkType
gtk_scrolled_window_get_type (void) gtk_scrolled_window_get_type (void)
{ {
static guint scrolled_window_type = 0; static GtkType scrolled_window_type = 0;
if (!scrolled_window_type) if (!scrolled_window_type)
{ {
...@@ -70,7 +83,7 @@ gtk_scrolled_window_get_type (void) ...@@ -70,7 +83,7 @@ gtk_scrolled_window_get_type (void)
(GtkClassInitFunc) NULL, (GtkClassInitFunc) NULL,
}; };
scrolled_window_type = gtk_type_unique (gtk_container_get_type (), &scrolled_window_info); scrolled_window_type = gtk_type_unique (GTK_TYPE_CONTAINER, &scrolled_window_info);
} }
return scrolled_window_type; return scrolled_window_type;
...@@ -86,9 +99,23 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) ...@@ -86,9 +99,23 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
object_class = (GtkObjectClass*) class; object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class; widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class; container_class = (GtkContainerClass*) class;
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
parent_class = gtk_type_class (gtk_container_get_type ());
gtk_object_add_arg_type ("GtkScrolledWindow::viewport",
GTK_TYPE_VIEWPORT,
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
ARG_VIEWPORT);
gtk_object_add_arg_type ("GtkScrolledWindow::hscrollbar_policy",
GTK_TYPE_POLICY_TYPE,
GTK_ARG_READWRITE,
ARG_HSCROLLBAR_POLICY);
gtk_object_add_arg_type ("GtkScrolledWindow::vscrollbar_policy",
GTK_TYPE_POLICY_TYPE,
GTK_ARG_READWRITE,
ARG_VSCROLLBAR_POLICY);
object_class->set_arg = gtk_scrolled_window_set_arg;
object_class->get_arg = gtk_scrolled_window_get_arg;
object_class->destroy = gtk_scrolled_window_destroy; object_class->destroy = gtk_scrolled_window_destroy;
object_class->finalize = gtk_scrolled_window_finalize; object_class->finalize = gtk_scrolled_window_finalize;
...@@ -105,6 +132,67 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) ...@@ -105,6 +132,67 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
class->scrollbar_spacing = 5; class->scrollbar_spacing = 5;
} }
static void
gtk_scrolled_window_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkScrolledWindow *scrolled_window;
scrolled_window = GTK_SCROLLED_WINDOW (object);
switch (arg_id)
{
GtkWidget *viewport;
case ARG_VIEWPORT:
g_return_if_fail (scrolled_window->viewport == NULL);
viewport = GTK_VALUE_POINTER (*arg);
if (!viewport)
viewport = gtk_viewport_new (NULL, NULL);
scrolled_window->viewport = viewport;
gtk_scrolled_window_construct (scrolled_window, NULL, NULL);
case ARG_HSCROLLBAR_POLICY:
gtk_scrolled_window_set_policy (scrolled_window,
GTK_VALUE_ENUM (*arg),
scrolled_window->vscrollbar_policy);
break;
case ARG_VSCROLLBAR_POLICY: