~ubuntu-branches/ubuntu/utopic/libexif-gtk/utopic

« back to all changes in this revision

Viewing changes to tests/test-libexif-gtk.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-10-17 12:37:39 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041017123739-e1mrx18xphkrsigs
Tags: 0.3.3-6
Adopted package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* test-libexif-gtk.c
 
2
 *
 
3
 * Copyright � 2002 Lutz M�ller <lutz@users.sourceforge.net>
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2.1 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful, 
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Lesser General Public License for more details. 
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public
 
16
 * License along with this library; if not, write to the
 
17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
 * Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#include "config.h"
 
22
 
 
23
#include <gtk/gtkmain.h>
 
24
#include <gtk/gtkwindow.h>
 
25
 
 
26
#include <libexif-gtk/gtk-exif-browser.h>
 
27
 
 
28
#ifdef ENABLE_NLS
 
29
#  include <libintl.h>
 
30
#  undef _
 
31
#  define _(String) dgettext (PACKAGE, String)
 
32
#  ifdef gettext_noop
 
33
#    define N_(String) gettext_noop (String)
 
34
#  else
 
35
#    define N_(String) (String)
 
36
#  endif
 
37
#else
 
38
#  define textdomain(String) (String)
 
39
#  define gettext(String) (String)
 
40
#  define dgettext(Domain,Message) (Message)
 
41
#  define dcgettext(Domain,Message,Type) (Message)
 
42
#  define bindtextdomain(Domain,Directory) (Domain)
 
43
#  define _(String) (String)
 
44
#  define N_(String) (String)
 
45
#endif
 
46
 
 
47
int
 
48
main (int argc, char **argv)
 
49
{
 
50
        GtkWidget *w, *b;
 
51
        ExifData *ed;
 
52
 
 
53
        if (argc != 2)
 
54
                g_error ("You need to supply exactly one file to load.");
 
55
 
 
56
        gtk_set_locale ();
 
57
        textdomain (PACKAGE);
 
58
 
 
59
        g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);
 
60
        gtk_init (&argc, &argv);
 
61
 
 
62
        w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
63
        gtk_widget_show (w);
 
64
        b = gtk_exif_browser_new ();
 
65
        ed = exif_data_new_from_file (argv[1]);
 
66
        if (!ed)
 
67
                g_error ("Could not load EXIF data from '%s'.", argv[1]);
 
68
        gtk_exif_browser_set_data (GTK_EXIF_BROWSER (b), ed);
 
69
        gtk_widget_show (b);
 
70
        gtk_container_add (GTK_CONTAINER (w), b);
 
71
        g_signal_connect (G_OBJECT (w), "delete_event",
 
72
                          G_CALLBACK (gtk_main_quit), NULL);
 
73
 
 
74
        gtk_main ();
 
75
 
 
76
        return (0);
 
77
}