1 /* Exif-display -- display information about digital pictures
2  *
3  * Copyright (C) 2009 The Free Software Foundation
4  *
5  * Author: Emmanuel Touzery  <emmanuel.touzery@free.fr>
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 
22 #ifndef __EOG_EXIF_DISPLAY_PLUGIN_H__
23 #define __EOG_EXIF_DISPLAY_PLUGIN_H__
24 
25 #include <glib.h>
26 #include <glib-object.h>
27 #include <gtk/gtk.h>
28 #include <eog/eog-thumb-view.h>
29 #include <eog/eog-window.h>
30 #include <libpeas/peas-extension-base.h>
31 #include <libpeas/peas-object-module.h>
32 
33 G_BEGIN_DECLS
34 
35 /*
36  * Type checking and casting macros
37  */
38 #define EOG_TYPE_EXIF_DISPLAY_PLUGIN		(eog_exif_display_plugin_get_type ())
39 #define EOG_EXIF_DISPLAY_PLUGIN(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), EOG_TYPE_EXIF_DISPLAY_PLUGIN, EogExifDisplayPlugin))
40 #define EOG_EXIF_DISPLAY_PLUGIN_CLASS(k)	G_TYPE_CHECK_CLASS_CAST((k),      EOG_TYPE_EXIF_DISPLAY_PLUGIN, EogExifDisplayPluginClass))
41 #define EOG_IS_EXIF_DISPLAY_PLUGIN(o)	        (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOG_TYPE_EXIF_DISPLAY_PLUGIN))
42 #define EOG_IS_EXIF_DISPLAY_PLUGIN_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k),    EOG_TYPE_EXIF_DISPLAY_PLUGIN))
43 #define EOG_EXIF_DISPLAY_PLUGIN_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o),  EOG_TYPE_EXIF_DISPLAY_PLUGIN, EogExifDisplayPluginClass))
44 
45 /* Private structure type */
46 typedef struct _EogExifDisplayPluginPrivate	EogExifDisplayPluginPrivate;
47 
48 /*
49  * Main object structure
50  */
51 typedef struct _EogExifDisplayPlugin		EogExifDisplayPlugin;
52 
53 struct _EogExifDisplayPlugin
54 {
55 	PeasExtensionBase parent_instance;
56 
57 	EogThumbView *thumbview;
58 	EogWindow *window;
59 
60 	GtkWidget *statusbar_exif;
61 
62 	GtkBuilder *sidebar_builder;
63 	GtkWidget *gtkbuilder_widget;
64 	GtkDrawingArea *drawing_area;
65 
66 	int *histogram_values_red;
67 	int *histogram_values_green;
68 	int *histogram_values_blue;
69 
70 	int *histogram_values_rgb;
71 
72 	int max_of_array_sums;
73 	int max_of_array_sums_rgb;
74 
75 	/* Handlers ids */
76 	guint selection_changed_id;
77 
78 	/* Settings */
79 	gboolean enable_statusbar;
80 	gboolean draw_chan_histogram;
81 	gboolean draw_rgb_histogram;
82 };
83 
84 /*
85  * Class definition
86  */
87 typedef struct _EogExifDisplayPluginClass	EogExifDisplayPluginClass;
88 
89 struct _EogExifDisplayPluginClass
90 {
91 	PeasExtensionBaseClass parent_class;
92 };
93 
94 /*
95  * Public methods
96  */
97 GType	eog_exif_display_plugin_get_type		(void) G_GNUC_CONST;
98 
99 /* All the plugins must implement this function */
100 G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
101 
102 G_END_DECLS
103 
104 #endif /* __EOG_EXIF_DISPLAY_PLUGIN_H__ */
105