]> git.sur5r.net Git - glabels/blob - glabels1/src/prop_size.h
Initial revision
[glabels] / glabels1 / src / prop_size.h
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  prop_size.h:  size properties widget module header file
5  *
6  *  Copyright (C) 2000, 2001  Jim Evins <evins@snaught.com>.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  */
22
23 #ifndef __PROP_SIZE_H__
24 #define __PROP_SIZE_H__
25
26 #include <gnome.h>
27 #include "label.h"
28
29 #define GL_TYPE_PROP_SIZE (gl_prop_size_get_type ())
30 #define GL_PROP_SIZE(obj) \
31         (GTK_CHECK_CAST((obj), GL_TYPE_PROP_SIZE, glPropSize ))
32 #define GL_PROP_SIZE_CLASS(klass) \
33         (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_PROP_SIZE, glPropSizeClass))
34 #define GL_IS_PROP_SIZE(obj) \
35         (GTK_CHECK_TYPE ((obj), GL_TYPE_PROP_SIZE))
36 #define GL_IS_PROP_SIZE_CLASS(klass) \
37         (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_PROP_SIZE))
38
39 typedef struct _glPropSize glPropSize;
40 typedef struct _glPropSizeClass glPropSizeClass;
41
42 struct _glPropSize {
43         GtkVBox parent_widget;
44
45         gdouble w, h;
46         gdouble aspect_ratio;
47         gdouble w_max, h_max;
48         gdouble w_max_orig, h_max_orig;
49
50         GtkWidget *w_spin;
51         GtkWidget *h_spin;
52         GtkWidget *units_label;
53         GtkWidget *aspect_checkbox;
54 };
55
56 struct _glPropSizeClass {
57         GtkVBoxClass parent_class;
58
59         void (*changed) (glPropSize * size, gpointer user_data);
60 };
61
62 extern guint gl_prop_size_get_type (void);
63
64 extern GtkWidget *gl_prop_size_new (gchar * label);
65
66 extern void gl_prop_size_get_size (glPropSize * size,
67                                    gdouble * w, gdouble * h,
68                                    gboolean * keep_aspect_ratio_flag);
69
70 extern void gl_prop_size_set_params (glPropSize * size,
71                                      gdouble w, gdouble h,
72                                      gboolean keep_aspect_ratio_flag,
73                                      gdouble w_max, gdouble h_max);
74
75 #endif