Blame gtk/gtkorientable.c

Packit 98cdb6
/* GTK - The GIMP Toolkit
Packit 98cdb6
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
Packit 98cdb6
 *
Packit 98cdb6
 * gtkorientable.c
Packit 98cdb6
 * Copyright (C) 2008 Imendio AB
Packit 98cdb6
 * Contact: Michael Natterer <mitch@imendio.com>
Packit 98cdb6
 *
Packit 98cdb6
 * This library is free software; you can redistribute it and/or
Packit 98cdb6
 * modify it under the terms of the GNU Lesser General Public
Packit 98cdb6
 * License as published by the Free Software Foundation; either
Packit 98cdb6
 * version 2 of the License, or (at your option) any later version.
Packit 98cdb6
 *
Packit 98cdb6
 * This library is distributed in the hope that it will be useful,
Packit 98cdb6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 98cdb6
 * Lesser General Public License for more details.
Packit 98cdb6
 *
Packit 98cdb6
 * You should have received a copy of the GNU Lesser General Public
Packit 98cdb6
 * License along with this library; if not, write to the
Packit 98cdb6
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 98cdb6
 * Boston, MA 02111-1307, USA.
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
#include "config.h"
Packit 98cdb6
Packit 98cdb6
#include "gtkorientable.h"
Packit 98cdb6
#include "gtkprivate.h"
Packit 98cdb6
#include "gtkintl.h"
Packit 98cdb6
#include "gtkalias.h"
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
typedef GtkOrientableIface GtkOrientableInterface;
Packit 98cdb6
G_DEFINE_INTERFACE (GtkOrientable, gtk_orientable, G_TYPE_OBJECT)
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
gtk_orientable_default_init (GtkOrientableInterface *iface)
Packit 98cdb6
{
Packit 98cdb6
  /**
Packit 98cdb6
   * GtkOrientable:orientation:
Packit 98cdb6
   *
Packit 98cdb6
   * The orientation of the orientable.
Packit 98cdb6
   *
Packit 98cdb6
   * Since: 2.16
Packit 98cdb6
   **/
Packit 98cdb6
  g_object_interface_install_property (iface,
Packit 98cdb6
                                       g_param_spec_enum ("orientation",
Packit 98cdb6
                                                          P_("Orientation"),
Packit 98cdb6
                                                          P_("The orientation of the orientable"),
Packit 98cdb6
                                                          GTK_TYPE_ORIENTATION,
Packit 98cdb6
                                                          GTK_ORIENTATION_HORIZONTAL,
Packit 98cdb6
                                                          GTK_PARAM_READWRITE));
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
/**
Packit 98cdb6
 * gtk_orientable_set_orientation:
Packit 98cdb6
 * @orientable: a #GtkOrientable
Packit 98cdb6
 * @orientation: the orientable's new orientation.
Packit 98cdb6
 *
Packit 98cdb6
 * Sets the orientation of the @orientable.
Packit 98cdb6
 *
Packit 98cdb6
 * Since: 2.16
Packit 98cdb6
 **/
Packit 98cdb6
void
Packit 98cdb6
gtk_orientable_set_orientation (GtkOrientable  *orientable,
Packit 98cdb6
                                GtkOrientation  orientation)
Packit 98cdb6
{
Packit 98cdb6
  g_return_if_fail (GTK_IS_ORIENTABLE (orientable));
Packit 98cdb6
Packit 98cdb6
  g_object_set (orientable,
Packit 98cdb6
                "orientation", orientation,
Packit 98cdb6
                NULL);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
/**
Packit 98cdb6
 * gtk_orientable_get_orientation:
Packit 98cdb6
 * @orientable: a #GtkOrientable
Packit 98cdb6
 *
Packit 98cdb6
 * Retrieves the orientation of the @orientable.
Packit 98cdb6
 *
Packit 98cdb6
 * Return value: the orientation of the @orientable.
Packit 98cdb6
 *
Packit 98cdb6
 * Since: 2.16
Packit 98cdb6
 **/
Packit 98cdb6
GtkOrientation
Packit 98cdb6
gtk_orientable_get_orientation (GtkOrientable *orientable)
Packit 98cdb6
{
Packit 98cdb6
  GtkOrientation orientation;
Packit 98cdb6
Packit 98cdb6
  g_return_val_if_fail (GTK_IS_ORIENTABLE (orientable),
Packit 98cdb6
                        GTK_ORIENTATION_HORIZONTAL);
Packit 98cdb6
Packit 98cdb6
  g_object_get (orientable,
Packit 98cdb6
                "orientation", &orientation,
Packit 98cdb6
                NULL);
Packit 98cdb6
Packit 98cdb6
  return orientation;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
#define __GTK_ORIENTABLE_C__
Packit 98cdb6
#include "gtkaliasdef.c"