1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) Philip en Marijn 2008 <>
6 * main.c is free software copyrighted by Philip en Marijn.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name ``Philip en Marijn'' nor the name of any other
17 * contributor may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * main.c IS PROVIDED BY Philip en Marijn ``AS IS'' AND ANY EXPRESS
21 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL Philip en Marijn OR ANY OTHER CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
30 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include <sys/types.h>
41 #include "callbacks.h"
46 * Standard gettext macros.
51 # define _(String) dgettext (PACKAGE, String)
53 # define N_(String) gettext_noop (String)
55 # define N_(String) (String)
58 # define textdomain(String) (String)
59 # define gettext(String) (String)
60 # define dgettext(Domain,Message) (Message)
61 # define dcgettext(Domain,Message,Type) (Message)
62 # define bindtextdomain(Domain,Directory) (Domain)
63 # define _(String) (String)
64 # define N_(String) (String)
67 #include "callbacks.h"
69 /* The global builder object to be used to request handles to widgets */
70 GtkBuilder *builder = NULL;
77 if( (window = GTK_WIDGET(gtk_builder_get_object(builder, "gargoyle-gtk"))) == NULL ) {
78 error_dialog(NULL, NULL, "Error while getting main window object");
82 gtk_builder_connect_signals(builder, NULL);
89 main(int argc, char *argv[])
95 bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
96 bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
97 textdomain(GETTEXT_PACKAGE);
101 gtk_init(&argc, &argv);
103 builder = gtk_builder_new();
104 if( !gtk_builder_add_from_file(builder, "gargoyle-gtk.ui", &error) ) {
105 error_dialog(NULL, error, "Error while building interface: ");
109 window = create_window();
110 gtk_widget_show(window);
114 g_object_unref( G_OBJECT(builder) );