X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkvscrollbar.c;h=8e87c885eec652f7cab174c33d79b13e7d3b7878;hb=902628f593caf2580f5553623de849d7ab92caa3;hp=e10636e9d59690033849291b182b388cc86366b4;hpb=85d726f9aa22ff9f6b9487b4f3e380a40f731f4b;p=~andy%2Fgtk diff --git a/gtk/gtkvscrollbar.c b/gtk/gtkvscrollbar.c index e10636e9d..8e87c885e 100644 --- a/gtk/gtkvscrollbar.c +++ b/gtk/gtkvscrollbar.c @@ -22,43 +22,31 @@ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +#include "config.h" + +#include "gtkorientable.h" #include "gtkvscrollbar.h" -#include "gdk/gdkkeysyms.h" #include "gtkintl.h" +#include "gtkalias.h" -static void gtk_vscrollbar_class_init (GtkVScrollbarClass *klass); -static void gtk_vscrollbar_init (GtkVScrollbar *vscrollbar); +/** + * SECTION:gtkvscrollbar + * @Short_description: A vertical scrollbar + * @Title: GtkVScrollbar + * @See_also:#GtkScrollbar, #GtkScrolledWindow + * + * The #GtkVScrollbar widget is a widget arranged vertically creating a + * scrollbar. See #GtkScrollbar for details on + * scrollbars. #GtkAdjustment pointers may be added to handle the + * adjustment of the scrollbar or it may be left %NULL in which case one + * will be created for you. See #GtkScrollbar for a description of what the + * fields in an adjustment represent for a scrollbar. + */ -GType -gtk_vscrollbar_get_type (void) -{ - static GType vscrollbar_type = 0; - - if (!vscrollbar_type) - { - static const GTypeInfo vscrollbar_info = - { - sizeof (GtkVScrollbarClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_vscrollbar_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkVScrollbar), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_vscrollbar_init, - }; - - vscrollbar_type = - g_type_register_static (GTK_TYPE_SCROLLBAR, "GtkVScrollbar", - &vscrollbar_info, 0); - } - - return vscrollbar_type; -} +G_DEFINE_TYPE (GtkVScrollbar, gtk_vscrollbar, GTK_TYPE_SCROLLBAR) static void gtk_vscrollbar_class_init (GtkVScrollbarClass *class) @@ -69,21 +57,28 @@ gtk_vscrollbar_class_init (GtkVScrollbarClass *class) static void gtk_vscrollbar_init (GtkVScrollbar *vscrollbar) { - GtkRange *range; - - range = GTK_RANGE (vscrollbar); - - range->orientation = GTK_ORIENTATION_VERTICAL; + gtk_orientable_set_orientation (GTK_ORIENTABLE (vscrollbar), + GTK_ORIENTATION_VERTICAL); } -GtkWidget* +/** + * gtk_vscrollbar_new: + * @adjustment: (allow-none): the #GtkAdjustment to use, or %NULL to create a new adjustment + * + * Creates a new vertical scrollbar. + * + * Returns: the new #GtkVScrollbar + */ +GtkWidget * gtk_vscrollbar_new (GtkAdjustment *adjustment) { - GtkWidget *vscrollbar; - - vscrollbar = g_object_new (GTK_TYPE_VSCROLLBAR, - "adjustment", adjustment, - NULL); - - return vscrollbar; + g_return_val_if_fail (adjustment == NULL || GTK_IS_ADJUSTMENT (adjustment), + NULL); + + return g_object_new (GTK_TYPE_VSCROLLBAR, + "adjustment", adjustment, + NULL); } + +#define __GTK_VSCROLLBAR_C__ +#include "gtkaliasdef.c"