1 /* -*- Mode: C; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 3 -*- */
2 
3 /*
4  * GImageView
5  * Copyright (C) 2001 Takuro Ashie
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  *
21  * $Id: gimv_zalbum.h,v 1.5 2004/09/21 08:44:32 makeinu Exp $
22  */
23 
24 /*
25  *  These codes are mostly taken from ProView image viewer.
26  *
27  *  ProView image viewer Author:
28  *     promax <promax@users.sourceforge.net>
29  */
30 
31 /*
32  *  modification file from Another X image viewer
33  *  David Ramboz <dramboz@users.sourceforge.net>
34  */
35 
36 #ifndef __GIMV_ZALBUM_H__
37 #define __GIMV_ZALBUM_H__
38 
39 #ifdef HAVE_CONFIG_H
40 #include "config.h"
41 #endif
42 
43 #include "gimv_zlist.h"
44 
45 #define GIMV_TYPE_ZALBUM            (gimv_zalbum_get_type ())
46 #define GIMV_ZALBUM(widget)         (GTK_CHECK_CAST ((widget), GIMV_TYPE_ZALBUM, GimvZAlbum))
47 #define GIMV_ZALBUM_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GIMV_TYPE_ZALBUM, GimvZAlbumClass))
48 #define GIMV_IS_ZALBUM(widget)      (GTK_CHECK_TYPE ((widget), GIMV_TYPE_ZALBUM))
49 #define GIMV_IS_ZALBUM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMV_TYPE_ZALBUM))
50 
51 typedef struct _GimvZAlbum            GimvZAlbum;
52 typedef struct _GimvZAlbumCell        GimvZAlbumCell;
53 typedef struct _GimvZAlbumClass       GimvZAlbumClass;
54 typedef struct _GimvZAlbumColumnInfo  GimvZAlbumColumnInfo;
55 
56 enum
57 {
58    GIMV_ZALBUM_CELL_SELECTED = 1 << 1,
59 };
60 
61 typedef enum
62 {
63    GIMV_ZALBUM_CELL_LABEL_BOTTOM,
64    GIMV_ZALBUM_CELL_LABEL_TOP,
65    GIMV_ZALBUM_CELL_LABEL_RIGHT,
66    GIMV_ZALBUM_CELL_LABEL_LEFT,
67 } GimvZAlbumLabelPosition;
68 
69 struct _GimvZAlbum
70 {
71    GimvZList list;
72 
73    guint8 label_pos;
74 
75    gint max_pix_width;
76    gint max_pix_height;
77 
78    gint max_cell_width;
79    gint max_cell_height;
80 
81    guint len;
82 };
83 
84 struct _GimvZAlbumClass
85 {
86    GimvZListClass parent_class;
87 };
88 
89 struct _GimvZAlbumCell
90 {
91    gint flags;
92    const gchar *name;
93 
94    GdkPixmap *ipix;
95    GdkBitmap *imask;
96 
97    gpointer user_data;
98    GtkDestroyNotify destroy;
99 };
100 
101 
102 GtkType    gimv_zalbum_get_type                  (void);
103 GtkWidget *gimv_zalbum_new                       (void);
104 guint      gimv_zalbum_add                       (GimvZAlbum       *album,
105                                                   const gchar      *name);
106 guint      gimv_zalbum_insert                    (GimvZAlbum       *album,
107                                                   guint             pos,
108                                                   const gchar      *name);
109 void       gimv_zalbum_remove                    (GimvZAlbum       *album,
110                                                   guint             pos);
111 void       gimv_zalbum_set_label_position        (GimvZAlbum       *album,
112                                                   GimvZAlbumLabelPosition pos);
113 void       gimv_zalbum_set_min_pixmap_size       (GimvZAlbum       *album,
114                                                   guint             width,
115                                                   guint             height);
116 void       gimv_zalbum_set_min_cell_size         (GimvZAlbum       *album,
117                                                   guint             width,
118                                                   guint             height);
119 void       gimv_zalbum_set_pixmap                (GimvZAlbum       *album,
120                                                   guint             idx,
121                                                   GdkPixmap        *pixmap,
122                                                   GdkBitmap        *mask);
123 void       gimv_zalbum_set_cell_data             (GimvZAlbum       *album,
124                                                   guint             idx,
125                                                   gpointer          user_data);
126 void       gimv_zalbum_set_cell_data_full        (GimvZAlbum       *album,
127                                                   guint             idx,
128                                                   gpointer          data,
129                                                   GtkDestroyNotify  destroy);
130 gpointer   gimv_zalbum_get_cell_data             (GimvZAlbum       *album,
131                                                   guint             idx);
132 
133 #define gimv_zalbum_freeze(album) (gimv_scrolled_freeze(GIMV_SCROLLED(album)))
134 #define gimv_zalbum_thawn(album)  (gimv_scrolled_thawn(GIMV_SCROLLED(album)))
135 
136 #endif /* __GIMV_ZALBUM_H__ */
137