X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmain.c;h=a6ce43d8fb64510a8a14f9532b256fc72771cd81;hb=e026fa7b787111f88332588c2c4ce9f01ab4183d;hp=94edc7a15f06425e1c9e2beeacc78831c97dd26a;hpb=e44b8496425b348e22165e767b3e8fa52dcad953;p=omnplay diff --git a/src/main.c b/src/main.c index 94edc7a..a6ce43d 100644 --- a/src/main.c +++ b/src/main.c @@ -34,6 +34,31 @@ #include "omnplay.h" #include "support.h" +#ifdef _WIN32 +#include +#include + +char *strcasestr(char *haystack, char *needle) +{ + char *p, *startn = 0, *np = 0; + + for (p = haystack; *p; p++) { + if (np) { + if (toupper(*p) == toupper(*np)) { + if (!*++np) + return startn; + } else + np = 0; + } else if (toupper(*p) == toupper(*needle)) { + np = needle + 1; + startn = p; + } + } + + return 0; +}; +#endif /* _WIN32 */ + int main(int argc, char **argv) { char path[ 512 ], *buf; @@ -50,16 +75,23 @@ int main(int argc, char **argv) gtk_set_locale(); gtk_init(&argc, &argv); + memset(path, 0, sizeof(path)); #ifdef _WIN32 + GetModuleFileName(NULL, path, sizeof(path)); +// g_warning("GetModuleFileName [%s]\n", path); + if((buf = strstr(path, "\\bin\\omnplay.exe"))) + { + buf[0] = 0; + strcat(path, "\\share\\omnplay\\pixmaps"); + } #else // Linux hack to determine path of the executable - memset(path, 0, sizeof(path)); readlink( "/proc/self/exe", path, sizeof(path)); g_warning ("path=(%s)\n", path); if((buf = strstr(path, "/bin/omnplay"))) { buf[0] = 0; - strcat(path, "/share/rugen/pixmaps"); + strcat(path, "/share/omnplay/pixmaps"); } else if((buf = strstr(path, "/src/omnplay"))) { @@ -68,12 +100,11 @@ int main(int argc, char **argv) } else snprintf(path, sizeof(path), "%s/%s/pixmaps", PACKAGE_DATA_DIR, PACKAGE); +#endif /* _WIN32 */ add_pixmap_directory( path ); g_warning ("add_pixmap_directory(%s)\n", path); -#endif /* _WIN32 */ - app = omnplay_create(argc, argv); if(app->window) @@ -82,7 +113,6 @@ int main(int argc, char **argv) gdk_threads_enter(); omnplay_init(app); gtk_main (); - omnplay_release(app); gdk_threads_leave(); };