2 * main.c -- GTK+ 2 omnplay
3 * Copyright (C) 2011 Maksym Veremeyenko <verem@m1stereo.tv>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program 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
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
37 int main(int argc
, char **argv
)
39 char path
[ 512 ], *buf
;
40 omnplay_instance_t
*app
= NULL
;
43 bindtextdomain (GETTEXT_PACKAGE
, PACKAGE_LOCALE_DIR
);
44 bind_textdomain_codeset (GETTEXT_PACKAGE
, "UTF-8");
45 textdomain (GETTEXT_PACKAGE
);
51 gtk_init(&argc
, &argv
);
55 // Linux hack to determine path of the executable
56 memset(path
, 0, sizeof(path
));
57 readlink( "/proc/self/exe", path
, sizeof(path
));
58 g_warning ("path=(%s)\n", path
);
59 if((buf
= strstr(path
, "/bin/omnplay")))
62 strcat(path
, "/share/rugen/pixmaps");
64 else if((buf
= strstr(path
, "/src/omnplay")))
67 strcat( path
, "/pixmaps" );
70 snprintf(path
, sizeof(path
), "%s/%s/pixmaps", PACKAGE_DATA_DIR
, PACKAGE
);
72 add_pixmap_directory( path
);
73 g_warning ("add_pixmap_directory(%s)\n", path
);
77 app
= omnplay_create(argc
, argv
);
81 gtk_widget_show (app
->window
);