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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* gtk/gtkctree.h :
......
......@@ -23,6 +23,14 @@
(tabbed GTK_CTREE_LINES_TABBED)
(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"
(define-flags GtkDebugFlag
......@@ -362,6 +370,13 @@
(color-context GDK_DEBUG_COLOR_CONTEXT)
(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"
(define-enum GdkWindowType
......
......@@ -53,7 +53,7 @@ gtk_adjustment_get_type (void)
(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;
......
......@@ -30,9 +30,11 @@ extern "C" {
#endif /* __cplusplus */
#define GTK_ADJUSTMENT(obj) (GTK_CHECK_CAST (obj, gtk_adjustment_get_type (), GtkAdjustment))
#define GTK_ADJUSTMENT_CLASS(klass) (GTK_CHECK_CLASS_CAST (klass, gtk_adjustment_get_type (), GtkAdjustmentClass))
#define GTK_IS_ADJUSTMENT(obj) (GTK_CHECK_TYPE (obj, gtk_adjustment_get_type ()))
#define GTK_TYPE_ADJUSTMENT (gtk_adjustment_get_type ())
#define GTK_ADJUSTMENT(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_ADJUSTMENT, GtkAdjustment))
#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;
......
......@@ -26,6 +26,7 @@
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
......
......@@ -402,7 +402,7 @@ gtk_clist_get_type (void)
(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;
......@@ -419,7 +419,7 @@ gtk_clist_class_init (GtkCListClass * klass)
widget_class = (GtkWidgetClass *) 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] =
gtk_signal_new ("select_row",
......@@ -961,7 +961,7 @@ gtk_clist_new_with_titles (gint columns,
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);
......@@ -976,7 +976,7 @@ gtk_clist_new (gint columns)
if (columns < 1)
return NULL;
clist = gtk_type_new (gtk_clist_get_type ());
clist = gtk_type_new (GTK_TYPE_CLIST);
gtk_clist_construct (clist, columns, NULL);
return GTK_WIDGET (clist);
}
......
......@@ -57,15 +57,15 @@ typedef enum
GTK_CELL_WIDGET
} GtkCellType;
#define GTK_TYPE_CLIST (gtk_clist_get_type ())
#define GTK_CLIST(obj) (GTK_CHECK_CAST ((obj), gtk_clist_get_type (), GtkCList))
#define GTK_CLIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), gtk_clist_get_type (), GtkCListClass))
#define GTK_IS_CLIST(obj) (GTK_CHECK_TYPE ((obj), gtk_clist_get_type ()))
#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_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_TYPE_CLIST (gtk_clist_get_type ())
#define GTK_CLIST(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CLIST, GtkCList))
#define GTK_CLIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CLIST, GtkCListClass))
#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_CLIST_FLAGS(clist) (GTK_CLIST (clist)->flags)
#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_FROZEN(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_FROZEN)
#define GTK_CLIST_IN_DRAG(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_IN_DRAG)
......
......@@ -265,7 +265,7 @@ gtk_ctree_get_type (void)
(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;
......@@ -337,8 +337,8 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
container_class = (GtkContainerClass *) klass;
clist_class = (GtkCListClass *) klass;
parent_class = gtk_type_class (gtk_clist_get_type ());
container_class = gtk_type_class (gtk_container_get_type ());
parent_class = gtk_type_class (GTK_TYPE_CLIST);
container_class = gtk_type_class (GTK_TYPE_CONTAINER);
ctree_signals[TREE_SELECT_ROW] =
gtk_signal_new ("tree_select_row",
......@@ -3728,7 +3728,7 @@ gtk_ctree_new_with_titles (gint columns,
g_return_val_if_fail (columns > 0, 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);
return widget;
}
......
......@@ -31,12 +31,12 @@ extern "C"
{
#endif /* __cplusplus */
#define GTK_CTREE(obj) \
(GTK_CHECK_CAST ((obj), gtk_ctree_get_type (), GtkCTree))
#define GTK_CTREE_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), gtk_ctree_get_type (), GtkCTreeClass))
#define GTK_IS_CTREE(obj) \
(GTK_CHECK_TYPE ((obj), gtk_ctree_get_type ()))
#define GTK_TYPE_CTREE (gtk_ctree_get_type ())
#define GTK_CTREE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CTREE, GtkCTree))
#define GTK_CTREE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CTREE, GtkCTreeClass))
#define GTK_IS_CTREE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CTREE))
#define GTK_IS_CTREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CTREE))
#define GTK_CTREE_ROW(_glist_) ((GtkCTreeRow *)((_glist_)->data))
#define GTK_CTREE_TREE(_ctree_, _glist_) \
((GtkCellTree *) &(((GtkCTreeRow *)((_glist_)->data))->cell[(_ctree_)->tree_col]))
......
......@@ -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_type > GTK_TYPE_NONE);
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);
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)
object_arg_info_ht = g_hash_table_new (gtk_arg_info_hash,
gtk_arg_info_equal);
......
......@@ -22,9 +22,22 @@
#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_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_finalize (GtkObject *object);
static void gtk_scrolled_window_map (GtkWidget *widget);
......@@ -51,10 +64,10 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adju
static GtkContainerClass *parent_class = NULL;
guint
GtkType
gtk_scrolled_window_get_type (void)
{
static guint scrolled_window_type = 0;
static GtkType scrolled_window_type = 0;
if (!scrolled_window_type)
{
......@@ -70,7 +83,7 @@ gtk_scrolled_window_get_type (void)
(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;
......@@ -86,9 +99,23 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
parent_class = gtk_type_class (gtk_container_get_type ());
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
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->finalize = gtk_scrolled_window_finalize;
......@@ -105,6 +132,67 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
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:
gtk_scrolled_window_set_policy (scrolled_window,
scrolled_window->hscrollbar_policy,
GTK_VALUE_ENUM (*arg));
break;
default:
break;
}
}
static void
gtk_scrolled_window_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
{
GtkScrolledWindow *scrolled_window;
scrolled_window = GTK_SCROLLED_WINDOW (object);
switch (arg_id)
{
case ARG_VIEWPORT:
GTK_VALUE_POINTER (*arg) = scrolled_window->viewport;
break;
case ARG_HSCROLLBAR_POLICY:
GTK_VALUE_ENUM (*arg) = scrolled_window->hscrollbar_policy;
break;
case ARG_VSCROLLBAR_POLICY:
GTK_VALUE_ENUM (*arg) = scrolled_window->vscrollbar_policy;
break;
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
static void
gtk_scrolled_window_init (GtkScrolledWindow *scrolled_window)
{
......@@ -124,7 +212,7 @@ gtk_scrolled_window_new (GtkAdjustment *hadjustment,
{
GtkWidget *scrolled_window;
scrolled_window = gtk_type_new (gtk_scrolled_window_get_type ());
scrolled_window = gtk_type_new (GTK_TYPE_SCROLLED_WINDOW);
gtk_scrolled_window_construct (GTK_SCROLLED_WINDOW (scrolled_window), hadjustment, vadjustment);
......@@ -138,9 +226,14 @@ gtk_scrolled_window_construct (GtkScrolledWindow *scrolled_window,
{
g_return_if_fail (scrolled_window != NULL);
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window));
g_return_if_fail (scrolled_window->viewport == NULL);
g_return_if_fail (scrolled_window->hscrollbar == NULL);
g_return_if_fail (scrolled_window->vscrollbar == NULL);
if (scrolled_window->viewport)
g_return_if_fail (hadjustment == NULL && vadjustment == NULL);
else
scrolled_window->viewport = gtk_viewport_new (hadjustment, vadjustment);
scrolled_window->viewport = gtk_viewport_new (hadjustment, vadjustment);
hadjustment = gtk_viewport_get_hadjustment (GTK_VIEWPORT (scrolled_window->viewport));
vadjustment = gtk_viewport_get_vadjustment (GTK_VIEWPORT (scrolled_window->viewport));
gtk_container_set_resize_mode (GTK_CONTAINER (scrolled_window->viewport), GTK_RESIZE_PARENT);
......
......@@ -31,9 +31,11 @@ extern "C" {
#endif /* __cplusplus */
#define GTK_SCROLLED_WINDOW(obj) GTK_CHECK_CAST (obj, gtk_scrolled_window_get_type (), GtkScrolledWindow)
#define GTK_SCROLLED_WINDOW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_scrolled_window_get_type (), GtkScrolledWindowClass)
#define GTK_IS_SCROLLED_WINDOW(obj) GTK_CHECK_TYPE (obj, gtk_scrolled_window_get_type ())
#define GTK_TYPE_SCROLLED_WINDOW (gtk_scrolled_window_get_type ())
#define GTK_SCROLLED_WINDOW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindow))
#define GTK_SCROLLED_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindowClass))
#define GTK_IS_SCROLLED_WINDOW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SCROLLED_WINDOW))
#define GTK_IS_SCROLLED_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCROLLED_WINDOW))
typedef struct _GtkScrolledWindow GtkScrolledWindow;
......@@ -61,7 +63,7 @@ struct _GtkScrolledWindowClass
};
guint gtk_scrolled_window_get_type (void);
GtkType gtk_scrolled_window_get_type (void);
GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
void gtk_scrolled_window_construct (GtkScrolledWindow *scrolled_window,
......
......@@ -3,6 +3,7 @@
extern GtkType GTK_TYPE_CELL_TYPE;
extern GtkType GTK_TYPE_C_TREE_POS;
extern GtkType GTK_TYPE_C_TREE_LINE_STYLE;
extern GtkType GTK_TYPE_C_TREE_EXPANSION;
extern GtkType GTK_TYPE_DEBUG_FLAG;
extern GtkType GTK_TYPE_ACCEL_FLAGS;
extern GtkType GTK_TYPE_ARROW_TYPE;
......@@ -50,6 +51,7 @@ extern GtkType GTK_TYPE_TREE_VIEW_MODE;
extern GtkType GTK_TYPE_FUNDAMENTAL_TYPE;
extern GtkType GTK_TYPE_WIDGET_FLAGS;
extern GtkType GTK_TYPE_GDK_DEBUG_FLAG;
extern GtkType GTK_TYPE_GDK_RGB_DITHER;
extern GtkType GTK_TYPE_GDK_WINDOW_TYPE;
extern GtkType GTK_TYPE_GDK_WINDOW_CLASS;
extern GtkType GTK_TYPE_GDK_IMAGE_TYPE;
......@@ -101,4 +103,4 @@ extern GtkType GTK_TYPE_GDK_WINDOW;
extern GtkType GTK_TYPE_GDK_EVENT;
extern GtkType GTK_TYPE_GDK_COLOR;
#define GTK_TYPE_NUM_BUILTINS (100)
#define GTK_TYPE_NUM_BUILTINS (102)
......@@ -21,6 +21,15 @@ static GtkEnumValue _gtk_c_tree_line_style_values[] = {
{ GTK_CTREE_LINES_NONE, "GTK_CTREE_LINES_NONE", "none" },
{ 0, NULL, NULL }
};
static GtkEnumValue _gtk_c_tree_expansion_values[] = {
{ GTK_CTREE_EXPANSION_EXPAND, "GTK_CTREE_EXPANSION_EXPAND", "expand" },
{ GTK_CTREE_EXPANSION_EXPAND_RECURSIVE, "GTK_CTREE_EXPANSION_EXPAND_RECURSIVE", "expand-recursive" },
{ GTK_CTREE_EXPANSION_COLLAPSE, "GTK_CTREE_EXPANSION_COLLAPSE", "collapse" },
{ GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE, "GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE", "collapse-recursive" },
{ GTK_CTREE_EXPANSION_TOGGLE, "GTK_CTREE_EXPANSION_TOGGLE", "toggle" },
{ GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE, "GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE", "toggle-recursive" },
{ 0, NULL, NULL }
};
static GtkEnumValue _gtk_debug_flag_values[] = {
{ GTK_DEBUG_OBJECTS, "GTK_DEBUG_OBJECTS", "objects" },
{ GTK_DEBUG_MISC, "GTK_DEBUG_MISC", "misc" },
......@@ -383,6 +392,12 @@ static GtkEnumValue _gdk_debug_flag_values[] = {
{ GDK_DEBUG_XIM, "GDK_DEBUG_XIM", "xim" },
{ 0, NULL, NULL }
};
static GtkEnumValue _gdk_rgb_dither_values[] = {
{ GDK_RGB_DITHER_NONE, "GDK_RGB_DITHER_NONE", "none" },
{ GDK_RGB_DITHER_NORMAL, "GDK_RGB_DITHER_NORMAL", "normal" },
{ GDK_RGB_DITHER_MAX, "GDK_RGB_DITHER_MAX", "max" },
{ 0, NULL, NULL }
};
static GtkEnumValue _gdk_window_type_values[] = {
{ GDK_WINDOW_ROOT, "GDK_WINDOW_ROOT", "root" },
{ GDK_WINDOW_TOPLEVEL, "GDK_WINDOW_TOPLEVEL", "toplevel" },
......
......@@ -6,6 +6,8 @@
GTK_TYPE_ENUM, _gtk_c_tree_pos_values },
{ "GtkCTreeLineStyle", &GTK_TYPE_C_TREE_LINE_STYLE,
GTK_TYPE_ENUM, _gtk_c_tree_line_style_values },
{ "GtkCTreeExpansion", &GTK_TYPE_C_TREE_EXPANSION,
GTK_TYPE_ENUM, _gtk_c_tree_expansion_values },
{ "GtkDebugFlag", &GTK_TYPE_DEBUG_FLAG,
GTK_TYPE_FLAGS, _gtk_debug_flag_values },
{ "GtkAccelFlags", &GTK_TYPE_ACCEL_FLAGS,
......@@ -100,6 +102,8 @@
GTK_TYPE_FLAGS, _gtk_widget_flags_values },
{ "GdkDebugFlag", &GTK_TYPE_GDK_DEBUG_FLAG,
GTK_TYPE_FLAGS, _gdk_debug_flag_values },
{ "GdkRgbDither", &GTK_TYPE_GDK_RGB_DITHER,
GTK_TYPE_ENUM, _gdk_rgb_dither_values },
{ "GdkWindowType", &GTK_TYPE_GDK_WINDOW_TYPE,
GTK_TYPE_ENUM, _gdk_window_type_values },
{ "GdkWindowClass", &GTK_TYPE_GDK_WINDOW_CLASS,
......
......@@ -3,6 +3,7 @@
GtkType GTK_TYPE_CELL_TYPE = 0;
GtkType GTK_TYPE_C_TREE_POS = 0;
GtkType GTK_TYPE_C_TREE_LINE_STYLE = 0;
GtkType GTK_TYPE_C_TREE_EXPANSION = 0;
GtkType GTK_TYPE_DEBUG_FLAG = 0;
GtkType GTK_TYPE_ACCEL_FLAGS = 0;
GtkType GTK_TYPE_ARROW_TYPE = 0;
......@@ -50,6 +51,7 @@ GtkType GTK_TYPE_TREE_VIEW_MODE = 0;
GtkType GTK_TYPE_FUNDAMENTAL_TYPE = 0;
GtkType GTK_TYPE_WIDGET_FLAGS = 0;
GtkType GTK_TYPE_GDK_DEBUG_FLAG = 0;
GtkType GTK_TYPE_GDK_RGB_DITHER = 0;
GtkType GTK_TYPE_GDK_WINDOW_TYPE = 0;
GtkType GTK_TYPE_GDK_WINDOW_CLASS = 0;
GtkType GTK_TYPE_GDK_IMAGE_TYPE = 0;
......
......@@ -19,10 +19,24 @@
#include "gtksignal.h"
#include "gtkviewport.h"
enum {
ARG_0,
ARG_HADJUSTMENT,
ARG_VADJUSTMENT,
ARG_SHADOW_TYPE
};
static void gtk_viewport_class_init (GtkViewportClass *klass);
static void gtk_viewport_init (GtkViewport *viewport);
static void gtk_viewport_finalize (GtkObject *object);
static void gtk_viewport_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_viewport_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_viewport_map (GtkWidget *widget);
static void gtk_viewport_unmap (GtkWidget *widget);
static void gtk_viewport_realize (GtkWidget *widget);
......@@ -46,10 +60,10 @@ static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment,
static GtkBinClass *parent_class;
guint
GtkType
gtk_viewport_get_type (void)
{
static guint viewport_type = 0;
static GtkType viewport_type = 0;
if (!viewport_type)
{
......@@ -65,7 +79,7 @@ gtk_viewport_get_type (void)
(GtkClassInitFunc) NULL,
};
viewport_type = gtk_type_unique (gtk_bin_get_type (), &viewport_info);
viewport_type = gtk_type_unique (GTK_TYPE_BIN, &viewport_info);
}
return viewport_type;
......@@ -81,8 +95,23 @@ gtk_viewport_class_init (GtkViewportClass *class)
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
parent_class = (GtkBinClass*) gtk_type_class (gtk_bin_get_type ());
parent_class = (GtkBinClass*) gtk_type_class (GTK_TYPE_BIN);
gtk_object_add_arg_type ("GtkViewport::hadjustment",
GTK_TYPE_ADJUSTMENT,
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT,
ARG_HADJUSTMENT);