Blame gtk/gtkvbbox.c

Packit Service fb6fa5
/* GTK - The GIMP Toolkit
Packit Service fb6fa5
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is free software; you can redistribute it and/or
Packit Service fb6fa5
 * modify it under the terms of the GNU Lesser General Public
Packit Service fb6fa5
 * License as published by the Free Software Foundation; either
Packit Service fb6fa5
 * version 2 of the License, or (at your option) any later version.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * This library is distributed in the hope that it will be useful,
Packit Service fb6fa5
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fb6fa5
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service fb6fa5
 * Lesser General Public License for more details.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * You should have received a copy of the GNU Lesser General Public
Packit Service fb6fa5
 * License along with this library; if not, write to the
Packit Service fb6fa5
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service fb6fa5
 * Boston, MA 02111-1307, USA.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
/*
Packit Service fb6fa5
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
Packit Service fb6fa5
 * file for a list of people on the GTK+ Team.  See the ChangeLog
Packit Service fb6fa5
 * files for a list of changes.  These files are distributed with
Packit Service fb6fa5
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
#include "config.h"
Packit Service fb6fa5
#include "gtkvbbox.h"
Packit Service fb6fa5
#include "gtkorientable.h"
Packit Service fb6fa5
#include "gtkintl.h"
Packit Service fb6fa5
#include "gtkalias.h"
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * SECTION:gtkvbbox
Packit Service fb6fa5
 * @Short_description: A container for arranging buttons vertically
Packit Service fb6fa5
 * @Title: GtkVButtonBox
Packit Service fb6fa5
 * @See_also: #GtkBox, #GtkButtonBox, #GtkHButtonBox
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * A button box should be used to provide a consistent layout of buttons
Packit Service fb6fa5
 * throughout your application. The layout/spacing can be altered by the
Packit Service fb6fa5
 * programmer, or if desired, by the user to alter the 'feel' of a
Packit Service fb6fa5
 * program to a small degree.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * A #GtkVButtonBox is created with gtk_vbutton_box_new(). Buttons are
Packit Service fb6fa5
 * packed into a button box the same way widgets are added to any other
Packit Service fb6fa5
 * container, using gtk_container_add(). You can also use
Packit Service fb6fa5
 * gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both
Packit Service fb6fa5
 * these functions work just like gtk_container_add(), ie., they pack the
Packit Service fb6fa5
 * button in a way that depends on the current layout style and on
Packit Service fb6fa5
 * whether the button has had gtk_button_box_set_child_secondary() called
Packit Service fb6fa5
 * on it.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * The spacing between buttons can be set with gtk_box_set_spacing(). The
Packit Service fb6fa5
 * arrangement and layout of the buttons can be changed with
Packit Service fb6fa5
 * gtk_button_box_set_layout().
Packit Service fb6fa5
 */
Packit Service fb6fa5
Packit Service fb6fa5
static gint default_spacing = 10;
Packit Service fb6fa5
static GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE;
Packit Service fb6fa5
Packit Service fb6fa5
G_DEFINE_TYPE (GtkVButtonBox, gtk_vbutton_box, GTK_TYPE_BUTTON_BOX)
Packit Service fb6fa5
Packit Service fb6fa5
static void
Packit Service fb6fa5
gtk_vbutton_box_class_init (GtkVButtonBoxClass *class)
Packit Service fb6fa5
{
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
static void
Packit Service fb6fa5
gtk_vbutton_box_init (GtkVButtonBox *vbutton_box)
Packit Service fb6fa5
{
Packit Service fb6fa5
  gtk_orientable_set_orientation (GTK_ORIENTABLE (vbutton_box),
Packit Service fb6fa5
                                  GTK_ORIENTATION_VERTICAL);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_vbutton_box_new:
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Creates a new vertical button box.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Returns: a new button box #GtkWidget.
Packit Service fb6fa5
 */
Packit Service fb6fa5
GtkWidget *
Packit Service fb6fa5
gtk_vbutton_box_new (void)
Packit Service fb6fa5
{
Packit Service fb6fa5
  return g_object_new (GTK_TYPE_VBUTTON_BOX, NULL);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_vbutton_box_set_spacing_default:
Packit Service fb6fa5
 * @spacing: an integer value.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Changes the default spacing that is placed between widgets in an
Packit Service fb6fa5
 * vertical button box.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Deprecated: 2.0: Use gtk_box_set_spacing() instead.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_vbutton_box_set_spacing_default (gint spacing)
Packit Service fb6fa5
{
Packit Service fb6fa5
  default_spacing = spacing;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_vbutton_box_set_layout_default:
Packit Service fb6fa5
 * @layout: a new #GtkButtonBoxStyle.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Sets a new layout mode that will be used by all button boxes.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Deprecated: 2.0: Use gtk_button_box_set_layout() instead.
Packit Service fb6fa5
 */
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (layout >= GTK_BUTTONBOX_DEFAULT_STYLE &&
Packit Service fb6fa5
		    layout <= GTK_BUTTONBOX_CENTER);
Packit Service fb6fa5
Packit Service fb6fa5
  default_layout_style = layout;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_vbutton_box_get_spacing_default:
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Retrieves the current default spacing for vertical button boxes. This is the number of pixels
Packit Service fb6fa5
 * to be placed between the buttons when they are arranged.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Returns: the default number of pixels between buttons.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Deprecated: 2.0: Use gtk_box_get_spacing() instead.
Packit Service fb6fa5
 */
Packit Service fb6fa5
gint
Packit Service fb6fa5
gtk_vbutton_box_get_spacing_default (void)
Packit Service fb6fa5
{
Packit Service fb6fa5
  return default_spacing;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_vbutton_box_get_layout_default:
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Retrieves the current layout used to arrange buttons in button box widgets.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Returns: the current #GtkButtonBoxStyle.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Deprecated: 2.0: Use gtk_button_box_get_layout() instead.
Packit Service fb6fa5
 */
Packit Service fb6fa5
GtkButtonBoxStyle
Packit Service fb6fa5
gtk_vbutton_box_get_layout_default (void)
Packit Service fb6fa5
{
Packit Service fb6fa5
  return default_layout_style;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
GtkButtonBoxStyle
Packit Service fb6fa5
_gtk_vbutton_box_get_layout_default (void)
Packit Service fb6fa5
{
Packit Service fb6fa5
  return default_layout_style;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
#define __GTK_VBBOX_C__
Packit Service fb6fa5
#include "gtkaliasdef.c"