File: test-libexif-gtk.c

package info (click to toggle)
libexif-gtk 0.3.5-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 2,200 kB
  • ctags: 676
  • sloc: sh: 8,848; ansic: 3,837; makefile: 111; sed: 16
file content (77 lines) | stat: -rw-r--r-- 2,175 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* test-libexif-gtk.c
 *
 * Copyright  2002 Lutz Mller <lutz@users.sourceforge.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#include "config.h"

#include <gtk/gtkmain.h>
#include <gtk/gtkwindow.h>

#include <libexif-gtk/gtk-exif-browser.h>

#ifdef ENABLE_NLS
#  include <libintl.h>
#  undef _
#  define _(String) dgettext (PACKAGE, String)
#  ifdef gettext_noop
#    define N_(String) gettext_noop (String)
#  else
#    define N_(String) (String)
#  endif
#else
#  define textdomain(String) (String)
#  define gettext(String) (String)
#  define dgettext(Domain,Message) (Message)
#  define dcgettext(Domain,Message,Type) (Message)
#  define bindtextdomain(Domain,Directory) (Domain)
#  define _(String) (String)
#  define N_(String) (String)
#endif

int
main (int argc, char **argv)
{
	GtkWidget *w, *b;
	ExifData *ed;

	if (argc != 2)
		g_error ("You need to supply exactly one file to load.");

	gtk_set_locale ();
	textdomain (PACKAGE);

	g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
	gtk_init (&argc, &argv);

	w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	gtk_widget_show (w);
	b = gtk_exif_browser_new ();
	ed = exif_data_new_from_file (argv[1]);
	if (!ed)
		g_error ("Could not load EXIF data from '%s'.", argv[1]);
	gtk_exif_browser_set_data (GTK_EXIF_BROWSER (b), ed);
	gtk_widget_show (b);
	gtk_container_add (GTK_CONTAINER (w), b);
	g_signal_connect (G_OBJECT (w), "delete_event",
			  G_CALLBACK (gtk_main_quit), NULL);

	gtk_main ();

	return (0);
}