Code

e4d935ae92395266a16e06c4d051eee6fb1af78b
[inkscape.git] / src / dialogs / eek-preview.h
1 /** @file
2  * @brief EEK preview stuff
3  */
4 /* ***** BEGIN LICENSE BLOCK *****
5  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * The Original Code is Eek Preview Stuffs.
18  *
19  * The Initial Developer of the Original Code is
20  * Jon A. Cruz.
21  * Portions created by the Initial Developer are Copyright (C) 2005-2008
22  * the Initial Developer. All Rights Reserved.
23  *
24  * Contributor(s):
25  *
26  * Alternatively, the contents of this file may be used under the terms of
27  * either the GNU General Public License Version 2 or later (the "GPL"), or
28  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29  * in which case the provisions of the GPL or the LGPL are applicable instead
30  * of those above. If you wish to allow use of your version of this file only
31  * under the terms of either the GPL or the LGPL, and not to allow others to
32  * use your version of this file under the terms of the MPL, indicate your
33  * decision by deleting the provisions above and replace them with the notice
34  * and other provisions required by the GPL or the LGPL. If you do not delete
35  * the provisions above, a recipient may use your version of this file under
36  * the terms of any one of the MPL, the GPL or the LGPL.
37  *
38  * ***** END LICENSE BLOCK ***** */
40 #ifndef SEEN_EEK_PREVIEW_H
41 #define SEEN_EEK_PREVIEW_H
43 #include <gdk/gdkpixbuf.h>
44 #include <gtk/gtkdrawingarea.h>
46 G_BEGIN_DECLS
49 #define EEK_PREVIEW_TYPE            (eek_preview_get_type())
50 #define EEK_PREVIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST( (obj), EEK_PREVIEW_TYPE, EekPreview))
51 #define EEK_PREVIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST( (klass), EEK_PREVIEW_TYPE, EekPreviewClass))
52 #define IS_EEK_PREVIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE( (obj), EEK_PREVIEW_TYPE))
53 #define IS_EEK_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE( (klass), EEK_PREVIEW_TYPE))
54 #define EEK_PREVIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS( (obj), EEK_PREVIEW_TYPE, EekPreviewClass))
56 typedef enum {
57     PREVIEW_STYLE_ICON = 0,
58     PREVIEW_STYLE_PREVIEW,
59     PREVIEW_STYLE_NAME,
60     PREVIEW_STYLE_BLURB,
61     PREVIEW_STYLE_ICON_NAME,
62     PREVIEW_STYLE_ICON_BLURB,
63     PREVIEW_STYLE_PREVIEW_NAME,
64     PREVIEW_STYLE_PREVIEW_BLURB
65 } PreviewStyle;
67 typedef enum {
68     VIEW_TYPE_LIST = 0,
69     VIEW_TYPE_GRID
70 } ViewType;
72 typedef enum {
73     PREVIEW_SIZE_TINY = 0,
74     PREVIEW_SIZE_SMALL,
75     PREVIEW_SIZE_MEDIUM,
76     PREVIEW_SIZE_BIG,
77     PREVIEW_SIZE_BIGGER,
78     PREVIEW_SIZE_HUGE
79 } PreviewSize;
81 typedef enum {
82   PREVIEW_LINK_NONE = 0,
83   PREVIEW_LINK_IN = 1,
84   PREVIEW_LINK_OUT = 2,
85   PREVIEW_LINK_OTHER = 4,
86   PREVIEW_LINK_ALL = 7
87 } LinkType;
89 typedef struct _EekPreview       EekPreview;
90 typedef struct _EekPreviewClass  EekPreviewClass;
93 struct _EekPreview
94 {
95     GtkDrawingArea drawing;
97     int _r;
98     int _g;
99     int _b;
101     gboolean _hot;
102     gboolean _within;
103     gboolean _takesFocus;
105     PreviewStyle _prevstyle;
106     ViewType _view;
107     PreviewSize _size;
108     guint _ratio;
109     guint _linked;
110     GdkPixbuf* _previewPixbuf;
111 };
113 struct _EekPreviewClass
115     GtkDrawingAreaClass parent_class;
117     void (*clicked) (EekPreview* splat);
118 };
121 GType      eek_preview_get_type(void) G_GNUC_CONST;
122 GtkWidget* eek_preview_new(void);
124 void eek_preview_set_details( EekPreview* splat, PreviewStyle prevstyle, ViewType view, PreviewSize size, guint ratio );
125 void eek_preview_set_color( EekPreview* splat, int r, int g, int b );
126 void eek_preview_set_pixbuf( EekPreview* splat, GdkPixbuf* pixbuf );
128 void eek_preview_set_linked( EekPreview* splat, LinkType link );
129 LinkType eek_preview_get_linked( EekPreview* splat );
131 gboolean eek_preview_get_focus_on_click( EekPreview* preview );
132 void eek_preview_set_focus_on_click( EekPreview* preview, gboolean focus_on_click );
134 void eek_preview_set_size_mappings( guint count, GtkIconSize const* sizes );
136 G_END_DECLS
138 #endif /* SEEN_EEK_PREVIEW_H */
140 /*
141   Local Variables:
142   mode:c++
143   c-file-style:"stroustrup"
144   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
145   indent-tabs-mode:nil
146   fill-column:99
147   End:
148 */
149 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :