annotate src/bar_exif.c @ 1293:48e064b37ba6

separated "normal" and advanced exif, "Normal" exif is now in the generic bar, advanced exif is in separate window.
author nadvornik
date Sun, 15 Feb 2009 09:36:53 +0000
parents 10073464e6aa
children 55ea4962887a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
196
f6e307c7bad6 rename GQview -> Geeqie over the code
nadvornik
parents: 188
diff changeset
2 * Geeqie
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * (C) 2004 John Ellis
1284
8b89e3ff286b Add year 2009 to copyright info everywhere.
zas_
parents: 1189
diff changeset
4 * Copyright (C) 2008 - 2009 The Geeqie Team
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 * Author: John Ellis
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This software is released under the GNU General Public License (GNU GPL).
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * Please read the included file COPYING for more information.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * This software comes with no warranty of any kind, use at your own risk!
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13
281
9995c5fb202a gqview.h -> main.h
zas_
parents: 258
diff changeset
14 #include "main.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 #include "bar_exif.h"
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17 #include "exif.h"
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
18 #include "metadata.h"
1022
9962b24b6b43 Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents: 902
diff changeset
19 #include "filedata.h"
902
c414002a1f27 Move history_list_*() functions to separate files:
zas_
parents: 895
diff changeset
20 #include "history_list.h"
1022
9962b24b6b43 Move miscellaneous functions to their own files (new misc.[ch]).
zas_
parents: 902
diff changeset
21 #include "misc.h"
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 #include "ui_misc.h"
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
23 #include "bar.h"
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
24
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #include <math.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
28 ExifUI ExifUIList[]={
1189
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
29 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Camera")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
30 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("DateTime")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
31 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ShutterSpeed")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
32 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Aperture")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
33 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ExposureBias")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
34 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ISOSpeedRating")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
35 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("FocalLength")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
36 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("FocalLength35mmFilm")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
37 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Flash")},
325
a0fcd4934266 Only display defined exif tags by default.
zas_
parents: 324
diff changeset
38 { 0, 0, EXIF_UI_IFSET, "Exif.Photo.ExposureProgram"},
a0fcd4934266 Only display defined exif tags by default.
zas_
parents: 324
diff changeset
39 { 0, 0, EXIF_UI_IFSET, "Exif.Photo.MeteringMode"},
a0fcd4934266 Only display defined exif tags by default.
zas_
parents: 324
diff changeset
40 { 0, 0, EXIF_UI_IFSET, "Exif.Photo.LightSource"},
1189
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
41 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("ColorProfile")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
42 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("SubjectDistance")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
43 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("Resolution")},
325
a0fcd4934266 Only display defined exif tags by default.
zas_
parents: 324
diff changeset
44 { 0, 0, EXIF_UI_IFSET, "Exif.Image.Orientation"},
1189
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
45 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("GPSPosition")},
9e424170e958 Do not hardcode exif formatted prefix.
zas_
parents: 1069
diff changeset
46 { 0, 0, EXIF_UI_IFSET, EXIF_FORMATTED("GPSAltitude")},
325
a0fcd4934266 Only display defined exif tags by default.
zas_
parents: 324
diff changeset
47 { 0, 0, EXIF_UI_IFSET, "Exif.Image.ImageDescription"},
a0fcd4934266 Only display defined exif tags by default.
zas_
parents: 324
diff changeset
48 { 0, 0, EXIF_UI_IFSET, "Exif.Image.Copyright"},
a0fcd4934266 Only display defined exif tags by default.
zas_
parents: 324
diff changeset
49 { 0, 0, EXIF_UI_OFF, NULL}
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
50 };
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
51
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54 *-------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 * table util
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
56 *-------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
57 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
58
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
59 static void table_add_line_custom(GtkWidget *table, gint x, gint y,
442
4b2d7f9af171 Big whitespaces cleanup:
zas_
parents: 438
diff changeset
60 const gchar *text1, const gchar *text2,
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
61 GtkWidget **label1, GtkWidget **label2,
1065
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
62 GtkWidget **remove)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
63 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
64 GtkWidget *label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
65 gchar *buf;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
66
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
67 buf = g_strconcat((text1) ? text1 : "fixme", ":", NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
68 if (!text2) text2 = "";
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
69
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
70 label = gtk_label_new(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
71 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
72 pref_label_bold(label, TRUE, FALSE);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
73 gtk_table_attach(GTK_TABLE(table), label,
1065
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
74 x + 1, x + 2, y, y + 1,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
75 GTK_FILL, GTK_FILL,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
76 2, 2);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
77 *label1 = label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
78
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
79 label = gtk_label_new(text2);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
80 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
81 gtk_table_attach(GTK_TABLE(table), label,
1065
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
82 x + 2, x + 3, y, y + 1,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
83 GTK_FILL, GTK_FILL,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
84 2, 2);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
85 *label2 = label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
86
1065
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
87 if (remove)
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
88 {
1065
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
89 *remove = gtk_check_button_new();
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
90 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(*remove), TRUE);
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
91
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
92 gtk_table_attach(GTK_TABLE(table), *remove,
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
93 x, x + 1, y, y + 1,
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
94 GTK_FILL, GTK_FILL,
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
95 2, 2);
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
96 }
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
97
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
98 g_free(buf);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
99 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
100
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
101 static GtkWidget *table_add_line(GtkWidget *table, gint x, gint y,
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
102 const gchar *description, const gchar *text,
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
103 GtkWidget **keyret)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
104 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
105 GtkWidget *key;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
106 GtkWidget *label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
107
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
108 table_add_line_custom(table, x, y, description, text, &key, &label, NULL);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
109 gtk_widget_show(key);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
110 gtk_widget_show(label);
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
111 if (keyret) *keyret = key;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
112
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
113 return label;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
114 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
115
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
116
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
117 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
118 *-------------------------------------------------------------------
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
119 * EXIF widget
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
120 *-------------------------------------------------------------------
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
121 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
122
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
123 typedef struct _PaneExifData PaneExifData;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
124 struct _PaneExifData
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
125 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
126 PaneData pane;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
127 GtkWidget *vbox;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
128 GtkWidget *scrolled;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
129 GtkWidget *table;
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
130 GtkWidget **keys;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
131 GtkWidget **labels;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
132
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
133 GtkWidget *custom_sep;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
134 GtkWidget *custom_name[EXIF_BAR_CUSTOM_COUNT];
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
135 GtkWidget *custom_value[EXIF_BAR_CUSTOM_COUNT];
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
136 GtkWidget *custom_remove[EXIF_BAR_CUSTOM_COUNT];
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
137
138
71e1ebee420e replaced gchar* path with FileData *fd
nadvornik
parents: 114
diff changeset
138 FileData *fd;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
139
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
140 gint allow_search;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
141 };
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
142
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
143 static void bar_pane_exif_sensitive(PaneExifData *ped, gint enable)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
144 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
145 gtk_widget_set_sensitive(ped->table, enable);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
146 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
147
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
148 static void bar_pane_exif_update(PaneExifData *ped)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
149 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
150 ExifData *exif;
233
f9634d21ad35 Remove unused variable declarations.
zas_
parents: 222
diff changeset
151 gint i;
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
152 GList *list;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
153
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
154 /* do we have any exif at all ? */
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
155 exif = exif_read_fd(ped->fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
156
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
157 if (!exif)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
158 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
159 bar_pane_exif_sensitive(ped, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
160 return;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
161 }
1069
aeae25d5d50d infrastructure for preprocessing of metadata
nadvornik
parents: 1068
diff changeset
162 else
aeae25d5d50d infrastructure for preprocessing of metadata
nadvornik
parents: 1068
diff changeset
163 {
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
164 /* we will use high level functions so we can release it for now.
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
165 it will stay in the cache */
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
166 exif_free_fd(ped->fd, exif);
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
167 exif = NULL;
1069
aeae25d5d50d infrastructure for preprocessing of metadata
nadvornik
parents: 1068
diff changeset
168 }
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
169
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
170
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
171 bar_pane_exif_sensitive(ped, TRUE);
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
172
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
173 for (i = 0; ExifUIList[i].key; i++)
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
174 {
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
175 gchar *text;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
176
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
177 if (ExifUIList[i].current == EXIF_UI_OFF)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
178 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
179 gtk_widget_hide(ped->labels[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
180 gtk_widget_hide(ped->keys[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
181 continue;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
182 }
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
183 text = metadata_read_string(ped->fd, ExifUIList[i].key, METADATA_FORMATTED);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
184 if (ExifUIList[i].current == EXIF_UI_IFSET
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
185 && (!text || !*text))
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
186 {
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
187 gtk_widget_hide(ped->labels[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
188 gtk_widget_hide(ped->keys[i]);
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
189 g_free(text);
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
190 continue;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
191 }
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
192 gtk_widget_show(ped->labels[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
193 gtk_widget_show(ped->keys[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
194 gtk_label_set_text(GTK_LABEL(ped->labels[i]), text);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
195 g_free(text);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
196 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
197
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
198 list = g_list_last(history_list_get_by_key("exif_extras"));
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
199 if (list)
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
200 {
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
201 gtk_widget_show(ped->custom_sep);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
202 }
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
203 else
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
204 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
205 gtk_widget_hide(ped->custom_sep);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
206 }
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
207 i = 0;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
208 while (list && i < EXIF_BAR_CUSTOM_COUNT)
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
209 {
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
210 gchar *text;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
211 gchar *name;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
212 gchar *buf;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
213 gchar *description;
1288
10073464e6aa use metadata_read_* functions where possible
nadvornik
parents: 1284
diff changeset
214
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
215 name = list->data;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
216 list = list->prev;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
217
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
218 text = metadata_read_string(ped->fd, name, METADATA_FORMATTED);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
219
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
220 description = exif_get_tag_description_by_key(name);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
221 if (!description || *description == '\0')
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
222 {
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
223 g_free(description);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
224 description = g_strdup(name);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
225 }
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
226 buf = g_strconcat(description, ":", NULL);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
227 g_free(description);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
228
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
229 gtk_label_set_text(GTK_LABEL(ped->custom_name[i]), buf);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
230 g_free(buf);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
231 gtk_label_set_text(GTK_LABEL(ped->custom_value[i]), text);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
232 g_free(text);
767
e73d30e0c896 Make utf8_validate_or_convert() to always allocate a new string.
zas_
parents: 680
diff changeset
233
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
234 gtk_widget_show(ped->custom_name[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
235 gtk_widget_show(ped->custom_value[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
236 g_object_set_data(G_OBJECT(ped->custom_remove[i]), "key", name);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
237 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ped->custom_remove[i]), TRUE);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
238 gtk_widget_show(ped->custom_remove[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
239
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
240 i++;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
241 }
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
242 while (i < EXIF_BAR_CUSTOM_COUNT)
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
243 {
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
244 g_object_set_data(G_OBJECT(ped->custom_remove[i]), "key", NULL);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
245 gtk_widget_hide(ped->custom_name[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
246 gtk_widget_hide(ped->custom_value[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
247 gtk_widget_hide(ped->custom_remove[i]);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
248
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
249 i++;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
250 }
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
251 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
252
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
253 static void bar_pane_exif_clear(PaneExifData *ped)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
254 {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
255 gint i;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
256
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
257 if (!GTK_WIDGET_SENSITIVE(ped->labels[0])) return;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
258
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
259 for (i = 0; ExifUIList[i].key; i++)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
260 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
261 gtk_label_set_text(GTK_LABEL(ped->labels[i]), "");
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
262 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
263 for (i = 0; i < EXIF_BAR_CUSTOM_COUNT; i++)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
264 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
265 gtk_label_set_text(GTK_LABEL(ped->custom_value[i]), "");
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
266 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
267 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
268
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
269 void bar_pane_exif_set_fd(GtkWidget *widget, FileData *fd)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
270 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
271 PaneExifData *ped;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
272
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
273 ped = g_object_get_data(G_OBJECT(widget), "pane_data");
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
274 if (!ped) return;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
275
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
276 /* store this, advanced view toggle needs to reload data */
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
277 file_data_unref(ped->fd);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
278 ped->fd = file_data_ref(fd);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
279
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
280 bar_pane_exif_clear(ped);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
281 bar_pane_exif_update(ped);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
282 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
283
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
284 static void bar_pane_exif_remove_advanced_cb(GtkWidget *widget, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
285 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
286 PaneExifData *ped = data;
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
287 const gchar *key;
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
288
1065
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
289 /* continue only if the toggle was deactivated */
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
290 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) return;
6a8402e0eaea improved custom exif look:
nadvornik
parents: 1062
diff changeset
291
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
292 key = g_object_get_data(G_OBJECT(widget), "key");
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
293 if (!key) return;
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
294
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
295 history_list_item_change("exif_extras", key, NULL);
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
296
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
297 bar_pane_exif_update(ped);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
298 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
299
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
300 void bar_pane_exif_close(GtkWidget *widget)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
301 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
302 PaneExifData *ped;
48
6948407f52a5 Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents: 9
diff changeset
303
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
304 ped = g_object_get_data(G_OBJECT(widget), "pane_data");
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
305 if (!ped) return;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
306
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
307 gtk_widget_destroy(ped->vbox);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
308 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
309
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
310 static void bar_pane_exif_destroy(GtkWidget *widget, gpointer data)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
311 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
312 PaneExifData *ped = data;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
313
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
314 g_free(ped->keys);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
315 g_free(ped->labels);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
316 file_data_unref(ped->fd);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
317 g_free(ped);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
318 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
319
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
320 GtkWidget *bar_pane_exif_new(const gchar *title)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
321 {
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
322 PaneExifData *ped;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
323 GtkWidget *table;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
324 GtkWidget *viewport;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
325 GtkWidget *hbox;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
326 gint i;
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
327 gint exif_len;
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
328
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
329 for (exif_len = 0; ExifUIList[exif_len].key; exif_len++)
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
330 ;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
331
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
332 ped = g_new0(PaneExifData, 1);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
333
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
334 ped->pane.pane_set_fd = bar_pane_exif_set_fd;
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
335 ped->pane.title = g_strdup(title);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
336
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
337 ped->keys = g_new0(GtkWidget *, exif_len);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
338 ped->labels = g_new0(GtkWidget *, exif_len);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
339
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
340 ped->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
341 g_object_set_data(G_OBJECT(ped->vbox), "pane_data", ped);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
342 g_signal_connect_after(G_OBJECT(ped->vbox), "destroy",
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
343 G_CALLBACK(bar_pane_exif_destroy), ped);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
344
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
345
1062
2e661b3e7ca0 Add a button for each advanced entry in Properties Exif Panel that allow to remove it from display. It fixes bug 1962611.
zas_
parents: 1055
diff changeset
346 table = gtk_table_new(3, exif_len + 1 + EXIF_BAR_CUSTOM_COUNT, FALSE);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
347
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
348 ped->table = table;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
349
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
350 for (i = 0; ExifUIList[i].key; i++)
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
351 {
1053
77ca9a5d42be fixed charset of exiv2 strings in non-utf8 locales
nadvornik
parents: 1052
diff changeset
352 gchar *text;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
353
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
354 text = exif_get_description_by_key(ExifUIList[i].key);
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
355 ped->labels[i] = table_add_line(table, 0, i, text, NULL,
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
356 &ped->keys[i]);
1053
77ca9a5d42be fixed charset of exiv2 strings in non-utf8 locales
nadvornik
parents: 1052
diff changeset
357 g_free(text);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
358 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
359
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
360 ped->custom_sep = gtk_hseparator_new();
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
361 gtk_table_attach(GTK_TABLE(table), ped->custom_sep, 0, 3,
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
362 exif_len, exif_len + 1,
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
363 GTK_FILL, GTK_FILL, 2, 2);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
364
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
365 for (i = 0; i < EXIF_BAR_CUSTOM_COUNT; i++)
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
366 {
222
77f1bcc6c161 various exif improvements based on patch by Uwe Ohse
nadvornik
parents: 204
diff changeset
367 table_add_line_custom(table, 0, exif_len + 1 + i,
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
368 "", "", &ped->custom_name[i], &ped->custom_value[i],
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
369 &ped->custom_remove[i]);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
370 g_signal_connect(G_OBJECT(ped->custom_remove[i]), "clicked",
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
371 G_CALLBACK(bar_pane_exif_remove_advanced_cb), ped);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
372 }
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
373
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
374 ped->scrolled = gtk_scrolled_window_new(NULL, NULL);
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
375 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ped->scrolled),
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
376 GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
377
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
378 viewport = gtk_viewport_new(NULL, NULL);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
379 gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
380 gtk_container_add(GTK_CONTAINER(ped->scrolled), viewport);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
381 gtk_widget_show(viewport);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
382
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
383 gtk_container_add(GTK_CONTAINER(viewport), table);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
384 gtk_widget_show(table);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
385
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
386 gtk_box_pack_start(GTK_BOX(ped->vbox), ped->scrolled, TRUE, TRUE, 0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
387
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
388 hbox = gtk_hbox_new(FALSE, PREF_PAD_SPACE);
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
389 gtk_box_pack_end(GTK_BOX(ped->vbox), hbox, FALSE, FALSE, 0);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
390 gtk_widget_show(hbox);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
391
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
392 gtk_widget_show(ped->scrolled);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
393
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
394 gtk_widget_show(ped->vbox);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
395
1293
48e064b37ba6 separated "normal" and advanced exif, "Normal" exif is now in the
nadvornik
parents: 1288
diff changeset
396 return ped->vbox;
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
397 }
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 1053
diff changeset
398 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */