]> git.draconx.ca Git - aspectbin.git/blob - aspectbin.h
Update .gitignore.
[aspectbin.git] / aspectbin.h
1 /* AspectBin - A GTK+ container for packing with consrained aspect ratio.
2  * Copyright (C) 2009 Nick Bowler
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 #ifndef ASPECTBIN_H_
21 #define ASPECTBIN_H_
22
23 #include <gtk/gtk.h>
24
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)
32
33 typedef struct AspectBin      AspectBin;
34 typedef struct AspectBinClass AspectBinClass;
35
36 struct AspectBin {
37         GtkContainer parent;
38
39         GtkWidget *body, *side;
40         gfloat     body_align, side_align;
41         gfloat     ratio;
42
43         gboolean   constrain;
44         gboolean   fill;
45 };
46
47 struct AspectBinClass {
48         GtkBinClass parent_class;
49 };
50
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);
57
58 /* Registers widgets with libglade - primarily for static linking. */
59 void aspect_bin_register_widgets(void);
60
61 #endif