// prevent pathname of positional file argument provided by OS X being be mistaken for option name
// (price is that we won't recognize Windows option format anymore).
# define SLASH '-'
+# define IMG ".png"
// redefine some defaults
# undef ICS_LOGON
# undef DATADIR
char masterSettings[MSG_SIZ];
#else
# define SLASH '/'
+# define IMG ".svg"
#endif
#ifdef __EMX__
gtk_window_resize(GTK_WINDOW(shells[DummyDlg]), slaveW + opt->max, slaveH + opt->value);
}
+GdkPixbuf *
+LoadIconFile (gchar *svgFilename)
+{
+ char buf[MSG_SIZ];
+
+ snprintf(buf, MSG_SIZ, "%s/%s" IMG, svgDir, svgFilename);
+ return gdk_pixbuf_new_from_file(buf, NULL);
+}
+
#ifdef __APPLE__
static char clickedFile[MSG_SIZ];
static int suppress;
theApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
strncpy(dataDir, path, MSG_SIZ);
snprintf(masterSettings, MSG_SIZ, "%s/Contents/Resources/etc/xboard.conf", path);
+ snprintf(svgDir, MSG_SIZ, "%s/Contents/Resources/share/xboard/themes/default", path);
suppress = (argc == 1 || argc > 1 && argv[1][00] != '-'); // OSX sends signal even if name was already argv[1]!
g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL);
// we must call application ready before we can get the signal,
/*
* Create an icon. (Use two icons, to indicate whther it is white's or black's turn.)
*/
- WhiteIcon = gdk_pixbuf_new_from_file(SVGDIR "/icon_white.svg", NULL);
- BlackIcon = gdk_pixbuf_new_from_file(SVGDIR "/icon_black.svg", NULL);
+ WhiteIcon = LoadIconFile("icon_white");
+ BlackIcon = LoadIconFile("icon_black");
SetClockIcon(0); // sets white icon