]> git.sur5r.net Git - glabels/blob - glabels2/src/wdgt-mini-preview.h
Initial revision
[glabels] / glabels2 / src / wdgt-mini-preview.h
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  wdgt_mini_preview.h:  mini-preview widget module header file
5  *
6  *  Copyright (C) 2001-2002  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 __WDGT_MINI_PREVIEW_H__
24 #define __WDGT_MINI_PREVIEW_H__
25
26 #include <gnome.h>
27 #include "label.h"
28
29 #define GL_TYPE_WDGT_MINI_PREVIEW (gl_wdgt_mini_preview_get_type ())
30 #define GL_WDGT_MINI_PREVIEW(obj) \
31         (GTK_CHECK_CAST((obj), GL_TYPE_WDGT_MINI_PREVIEW, glWdgtMiniPreview ))
32 #define GL_WDGT_MINI_PREVIEW_CLASS(klass) \
33         (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_WDGT_MINI_PREVIEW, glWdgtMiniPreviewClass))
34 #define GL_IS_WDGT_MINI_PREVIEW(obj) \
35         (GTK_CHECK_TYPE ((obj), GL_TYPE_WDGT_MINI_PREVIEW))
36 #define GL_IS_WDGT_MINI_PREVIEW_CLASS(klass) \
37         (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_WDGT_MINI_PREVIEW))
38
39 typedef struct _glWdgtMiniPreview      glWdgtMiniPreview;
40 typedef struct _glWdgtMiniPreviewClass glWdgtMiniPreviewClass;
41
42 struct _glWdgtMiniPreview {
43         GtkHBox         parent_widget;
44
45         gint            height;
46         gint            width;
47
48         GtkWidget       *canvas;
49         GnomeCanvasItem *paper_item;
50         GnomeCanvasItem *shadow_item;
51
52         gint            labels_per_sheet;
53         GList           *label_items;
54 };
55
56 struct _glWdgtMiniPreviewClass {
57         GtkHBoxClass    parent_class;
58
59         void (*clicked) (glWdgtMiniPreview *preview,
60                          gint index,
61                          gpointer user_data);
62
63         void (*pressed) (glWdgtMiniPreview *preview,
64                          gint index1,
65                          gint index2,
66                          gpointer user_data);
67 };
68
69 extern guint     gl_wdgt_mini_preview_get_type   (void);
70
71 extern GtkWidget *gl_wdgt_mini_preview_new       (gint height, gint width);
72
73 extern void gl_wdgt_mini_preview_set_label       (glWdgtMiniPreview * preview,
74                                                   gchar * name);
75
76 extern void gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview * preview,
77                                                   gint first_label,
78                                                   gint last_label);
79
80 #endif