File: main.c

package info (click to toggle)
screentest 2.0-2.2
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 1,652 kB
  • ctags: 149
  • sloc: sh: 8,940; ansic: 802; makefile: 65
file content (62 lines) | stat: -rw-r--r-- 1,932 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
/*
 *  Screentest - CRT/LCD monitor testing utility.
 *  http://screentest.sourceforge.net/
 *  Copyright (C) 2001 Jan "Yenya" Kasprzak <kas@fi.muni.cz>
 *  Copyright (C) 2006-2007 Tobias Gruetzmacher <tobias@portfolio16.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <stdlib.h>
#include <gtk/gtk.h>
#include <glade/glade.h>

#include "main.h"
#include "gettext.h"
#define _(String) gettext(String)

GladeXML *glade;

int main(int argc, char *argv[])
{
	bindtextdomain(PACKAGE, LOCALEDIR);
	bind_textdomain_codeset(PACKAGE, "UTF-8");
	textdomain(PACKAGE);

	gtk_init(&argc, &argv);

	glade = glade_xml_new(DATADIR "/screentest.glade", NULL, NULL);
	if (glade == NULL)
		glade = glade_xml_new("screentest.glade", NULL, NULL);
	if (glade == NULL) {
		GtkWidget *dialog = gtk_message_dialog_new(NULL,
			GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
			GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
			_("The GLADE interface definition file was not found.\n"
			"Please make sure this program is installed correctly."));
		gtk_window_set_title(GTK_WINDOW(dialog), PACKAGE_NAME);
		gtk_dialog_run(GTK_DIALOG(dialog));
		exit(1);
	}

	glade_xml_signal_autoconnect(glade);

	gtk_widget_show(glade_xml_get_widget(glade, "mainwin"));
	gtk_main();
	return 0;
}