gtkvbbox.c 2.46 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
2 3 4
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
6 7 8 9 10 11
 * 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
12
 * Lesser General Public License for more details.
Elliot Lee's avatar
Elliot Lee committed
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
15 16 17
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
Elliot Lee's avatar
Elliot Lee committed
18
 */
19 20

/*
21
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22 23
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
24
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25 26
 */

27
#include "config.h"
Elliot Lee's avatar
Elliot Lee committed
28
#include "gtkvbbox.h"
29
#include "gtkorientable.h"
30
#include "gtkintl.h"
31
#include "gtkalias.h"
Elliot Lee's avatar
Elliot Lee committed
32 33 34


static gint default_spacing = 10;
35
static GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE;
Elliot Lee's avatar
Elliot Lee committed
36

Matthias Clasen's avatar
Matthias Clasen committed
37
G_DEFINE_TYPE (GtkVButtonBox, gtk_vbutton_box, GTK_TYPE_BUTTON_BOX)
Elliot Lee's avatar
Elliot Lee committed
38 39 40 41 42 43 44 45 46

static void
gtk_vbutton_box_class_init (GtkVButtonBoxClass *class)
{
}

static void
gtk_vbutton_box_init (GtkVButtonBox *vbutton_box)
{
47
  gtk_orientable_set_orientation (GTK_ORIENTABLE (vbutton_box),
48
                                  GTK_ORIENTATION_VERTICAL);
Elliot Lee's avatar
Elliot Lee committed
49 50
}

51
GtkWidget *
52
gtk_vbutton_box_new (void)
Elliot Lee's avatar
Elliot Lee committed
53
{
54
  return g_object_new (GTK_TYPE_VBUTTON_BOX, NULL);
Elliot Lee's avatar
Elliot Lee committed
55 56 57 58 59 60
}



/* set default value for spacing */

61 62
void
gtk_vbutton_box_set_spacing_default (gint spacing)
Elliot Lee's avatar
Elliot Lee committed
63 64 65 66 67 68 69
{
  default_spacing = spacing;
}


/* set default value for layout style */

70 71
void
gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout)
Elliot Lee's avatar
Elliot Lee committed
72
{
73
  g_return_if_fail (layout >= GTK_BUTTONBOX_DEFAULT_STYLE &&
74
		    layout <= GTK_BUTTONBOX_CENTER);
75

Elliot Lee's avatar
Elliot Lee committed
76 77 78 79 80
  default_layout_style = layout;
}

/* get default value for spacing */

81 82
gint
gtk_vbutton_box_get_spacing_default (void)
Elliot Lee's avatar
Elliot Lee committed
83 84 85 86 87 88 89 90
{
  return default_spacing;
}



/* get default value for layout style */

91 92
GtkButtonBoxStyle
gtk_vbutton_box_get_layout_default (void)
Elliot Lee's avatar
Elliot Lee committed
93 94 95 96
{
  return default_layout_style;
}

97 98 99 100 101 102 103
GtkButtonBoxStyle
_gtk_vbutton_box_get_layout_default (void)
{
  return default_layout_style;
}


104
#define __GTK_VBBOX_C__
105
#include "gtkaliasdef.c"