1 #ifndef SEEN_EEK_PREVIEW_H
2 #define SEEN_EEK_PREVIEW_H
3 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
4 *
5 */
6 /* ***** BEGIN LICENSE BLOCK *****
7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
8 *
9 * The contents of this file are subject to the Mozilla Public License Version
10 * 1.1 (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 * http://www.mozilla.org/MPL/
13 *
14 * Software distributed under the License is distributed on an "AS IS" basis,
15 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
16 * for the specific language governing rights and limitations under the
17 * License.
18 *
19 * The Original Code is Eek Preview Stuffs.
20 *
21 * The Initial Developer of the Original Code is
22 * Jon A. Cruz.
23 * Portions created by the Initial Developer are Copyright (C) 2005
24 * the Initial Developer. All Rights Reserved.
25 *
26 * Contributor(s):
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * either the GNU General Public License Version 2 or later (the "GPL"), or
30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the GPL or the LGPL are applicable instead
32 * of those above. If you wish to allow use of your version of this file only
33 * under the terms of either the GPL or the LGPL, and not to allow others to
34 * use your version of this file under the terms of the MPL, indicate your
35 * decision by deleting the provisions above and replace them with the notice
36 * and other provisions required by the GPL or the LGPL. If you do not delete
37 * the provisions above, a recipient may use your version of this file under
38 * the terms of any one of the MPL, the GPL or the LGPL.
39 *
40 * ***** END LICENSE BLOCK ***** */
42 #include <gtk/gtkdrawingarea.h>
44 G_BEGIN_DECLS
47 #define EEK_PREVIEW_TYPE (eek_preview_get_type())
48 #define EEK_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST( (obj), EEK_PREVIEW_TYPE, EekPreview))
49 #define EEK_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST( (klass), EEK_PREVIEW_TYPE, EekPreviewClass))
50 #define IS_EEK_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE( (obj), EEK_PREVIEW_TYPE))
51 #define IS_EEK_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE( (klass), EEK_PREVIEW_TYPE))
52 #define EEK_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS( (obj), EEK_PREVIEW_TYPE, EekPreviewClass))
54 typedef enum {
55 PREVIEW_STYLE_ICON = 0,
56 PREVIEW_STYLE_PREVIEW,
57 PREVIEW_STYLE_NAME,
58 PREVIEW_STYLE_BLURB,
59 PREVIEW_STYLE_ICON_NAME,
60 PREVIEW_STYLE_ICON_BLURB,
61 PREVIEW_STYLE_PREVIEW_NAME,
62 PREVIEW_STYLE_PREVIEW_BLURB
63 } PreviewStyle;
65 typedef enum {
66 VIEW_TYPE_LIST = 0,
67 VIEW_TYPE_GRID
68 } ViewType;
70 typedef enum {
71 PREVIEW_LINK_NONE = 0,
72 PREVIEW_LINK_IN = 1,
73 PREVIEW_LINK_OUT = 2,
74 PREVIEW_LINK_OTHER = 4,
75 PREVIEW_LINK_ALL = 7
76 } LinkType;
78 typedef struct _EekPreview EekPreview;
79 typedef struct _EekPreviewClass EekPreviewClass;
82 struct _EekPreview
83 {
84 GtkDrawingArea drawing;
86 int _r;
87 int _g;
88 int _b;
90 gboolean _hot;
91 gboolean _within;
92 gboolean _takesFocus;
94 PreviewStyle _prevstyle;
95 ViewType _view;
96 GtkIconSize _size;
97 guint _linked;
98 };
100 struct _EekPreviewClass
101 {
102 GtkDrawingAreaClass parent_class;
104 void (*clicked) (EekPreview* splat);
105 };
108 GType eek_preview_get_type(void) G_GNUC_CONST;
109 GtkWidget* eek_preview_new(void);
111 void eek_preview_set_details( EekPreview* splat, PreviewStyle prevstyle, ViewType view, GtkIconSize size );
112 void eek_preview_set_color( EekPreview* splat, int r, int g, int b );
114 void eek_preview_set_linked( EekPreview* splat, LinkType link );
115 LinkType eek_preview_get_linked( EekPreview* splat );
117 gboolean eek_preview_get_focus_on_click( EekPreview* preview );
118 void eek_preview_set_focus_on_click( EekPreview* preview, gboolean focus_on_click );
120 G_END_DECLS
123 #endif /* SEEN_EEK_PREVIEW_H */