Update simplebuttons example.
[aspectbin.git] / aspectbin.h
blob7137e962669b8fdea5c3a49e4dd32facb337c125
1 /* AspectBin - A GTK+ container for packing with consrained aspect ratio.
2 * Copyright (C) 2009 Nick Bowler
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef ASPECTBIN_H_
21 #define ASPECTBIN_H_
23 #include <gtk/gtk.h>
25 #define ASPECT_BIN_TYPE (aspect_bin_get_type())
26 #define ASPECT_BIN(obj) GTK_CHECK_CAST((obj), ASPECT_BIN_TYPE, AspectBin)
27 #define ASPECT_BIN_CLASS(class) \
28 GTK_CHECK_CLASS_CAST((class), ASPECT_BIN_TYPE, AspectBinClass)
29 #define IS_ASPECT_BIN(obj) GTK_CHECK_TYPE((obj), ASPECT_BIN_TYPE)
30 #define IS_ASPECT_BIN_CLASS(class) \
31 GTK_CHECK_CLASS_TYPE((class), ASPECT_BIN_TYPE, AspectBinClass)
33 typedef struct AspectBin AspectBin;
34 typedef struct AspectBinClass AspectBinClass;
36 struct AspectBin {
37 GtkContainer parent;
39 GtkWidget *body, *side;
40 gfloat body_align, side_align;
41 gfloat ratio;
43 gboolean constrain;
44 gboolean fill;
47 struct AspectBinClass {
48 GtkBinClass parent_class;
51 GType aspect_bin_get_type(void);
52 GtkWidget *aspect_bin_new(void);
53 void aspect_bin_set_body(AspectBin *, GtkWidget *, gfloat);
54 void aspect_bin_set_side(AspectBin *, GtkWidget *);
55 GtkWidget *aspect_bin_get_body(AspectBin *abin);
56 GtkWidget *aspect_bin_get_side(AspectBin *abin);
58 #endif