391
393
br_extract_prefix (const char *path)
393
char *end, *tmp, *result;
395
398
br_return_val_if_fail (path != (char*)NULL, (char*)NULL);
425
428
#endif /* __cplusplus */
435
* Provide a similar mechanism for Win32. Enable a macro,
436
* WIN32_DATADIR, that can look up subpaths for inkscape resources
440
#include <glibmm/ustring.h>
443
* Return the directory of the .exe that is currently running
445
static Glib::ustring win32_getExePath()
447
char exeName[MAX_PATH+1];
448
GetModuleFileName(NULL, exeName, MAX_PATH);
449
char *slashPos = strrchr(exeName, '\\');
452
Glib::ustring s = exeName;
458
* Return the relocatable version of the datadir,
459
* probably c:\inkscape
461
static Glib::ustring win32_getDataDir()
463
Glib::ustring dir = win32_getExePath();
464
if (INKSCAPE_DATADIR && *INKSCAPE_DATADIR &&
465
strcmp(INKSCAPE_DATADIR, ".") != 0)
468
dir += INKSCAPE_DATADIR;
473
static Glib::ustring win32_getResourcePath(const Glib::ustring &childPath)
475
Glib::ustring dir = win32_getDataDir();
476
if (childPath.size() > 0)
486
* This is the visible utility function
488
char *win32_relative_path(const char *childPath)
490
static char *returnPath = NULL;
493
Glib::ustring resourcePath = win32_getResourcePath(childPath);
496
returnPath = strdup(resourcePath.c_str());
499
#endif /* __WIN32__ */
427
504
#endif /* _PREFIX_C */