Blame gtk/gtkorientable.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
 * gtkorientable.c
Packit Service fb6fa5
 * Copyright (C) 2008 Imendio AB
Packit Service fb6fa5
 * Contact: Michael Natterer <mitch@imendio.com>
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
#include "config.h"
Packit Service fb6fa5
Packit Service fb6fa5
#include "gtkorientable.h"
Packit Service fb6fa5
#include "gtkprivate.h"
Packit Service fb6fa5
#include "gtkintl.h"
Packit Service fb6fa5
#include "gtkalias.h"
Packit Service fb6fa5
Packit Service fb6fa5
Packit Service fb6fa5
typedef GtkOrientableIface GtkOrientableInterface;
Packit Service fb6fa5
G_DEFINE_INTERFACE (GtkOrientable, gtk_orientable, G_TYPE_OBJECT)
Packit Service fb6fa5
Packit Service fb6fa5
static void
Packit Service fb6fa5
gtk_orientable_default_init (GtkOrientableInterface *iface)
Packit Service fb6fa5
{
Packit Service fb6fa5
  /**
Packit Service fb6fa5
   * GtkOrientable:orientation:
Packit Service fb6fa5
   *
Packit Service fb6fa5
   * The orientation of the orientable.
Packit Service fb6fa5
   *
Packit Service fb6fa5
   * Since: 2.16
Packit Service fb6fa5
   **/
Packit Service fb6fa5
  g_object_interface_install_property (iface,
Packit Service fb6fa5
                                       g_param_spec_enum ("orientation",
Packit Service fb6fa5
                                                          P_("Orientation"),
Packit Service fb6fa5
                                                          P_("The orientation of the orientable"),
Packit Service fb6fa5
                                                          GTK_TYPE_ORIENTATION,
Packit Service fb6fa5
                                                          GTK_ORIENTATION_HORIZONTAL,
Packit Service fb6fa5
                                                          GTK_PARAM_READWRITE));
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_orientable_set_orientation:
Packit Service fb6fa5
 * @orientable: a #GtkOrientable
Packit Service fb6fa5
 * @orientation: the orientable's new orientation.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Sets the orientation of the @orientable.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Since: 2.16
Packit Service fb6fa5
 **/
Packit Service fb6fa5
void
Packit Service fb6fa5
gtk_orientable_set_orientation (GtkOrientable  *orientable,
Packit Service fb6fa5
                                GtkOrientation  orientation)
Packit Service fb6fa5
{
Packit Service fb6fa5
  g_return_if_fail (GTK_IS_ORIENTABLE (orientable));
Packit Service fb6fa5
Packit Service fb6fa5
  g_object_set (orientable,
Packit Service fb6fa5
                "orientation", orientation,
Packit Service fb6fa5
                NULL);
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
/**
Packit Service fb6fa5
 * gtk_orientable_get_orientation:
Packit Service fb6fa5
 * @orientable: a #GtkOrientable
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Retrieves the orientation of the @orientable.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Return value: the orientation of the @orientable.
Packit Service fb6fa5
 *
Packit Service fb6fa5
 * Since: 2.16
Packit Service fb6fa5
 **/
Packit Service fb6fa5
GtkOrientation
Packit Service fb6fa5
gtk_orientable_get_orientation (GtkOrientable *orientable)
Packit Service fb6fa5
{
Packit Service fb6fa5
  GtkOrientation orientation;
Packit Service fb6fa5
Packit Service fb6fa5
  g_return_val_if_fail (GTK_IS_ORIENTABLE (orientable),
Packit Service fb6fa5
                        GTK_ORIENTATION_HORIZONTAL);
Packit Service fb6fa5
Packit Service fb6fa5
  g_object_get (orientable,
Packit Service fb6fa5
                "orientation", &orientation,
Packit Service fb6fa5
                NULL);
Packit Service fb6fa5
Packit Service fb6fa5
  return orientation;
Packit Service fb6fa5
}
Packit Service fb6fa5
Packit Service fb6fa5
#define __GTK_ORIENTABLE_C__
Packit Service fb6fa5
#include "gtkaliasdef.c"