Changeset 55531 in webkit
- Timestamp:
- Mar 4, 2010 10:00:12 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55530 r55531 1 2010-03-04 Fridrich Strba <fridrich.strba@bluewin.ch> 2 3 Reviewed by Holger Freyther. 4 5 Make paths relocatable on runtime on Windows 6 https://bugs.webkit.org/show_bug.cgi?id=32711 7 8 * platform/graphics/gtk/ImageGtk.cpp: 9 (get_webkit_datadir): 10 (WebCore::Image::loadPlatformResource): 11 1 12 2010-03-04 Pavel Feldman <pfeldman@chromium.org> 2 13 -
trunk/WebCore/platform/graphics/gtk/ImageGtk.cpp
r55420 r55531 33 33 #include <gtk/gtk.h> 34 34 35 #ifdef _WIN32 36 # include <mbstring.h> 37 # include <shlobj.h> 38 /* search for data relative to where we are installed */ 39 40 static HMODULE hmodule; 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 BOOL WINAPI 46 DllMain(HINSTANCE hinstDLL, 47 DWORD fdwReason, 48 LPVOID lpvReserved) 49 { 50 switch (fdwReason) { 51 case DLL_PROCESS_ATTACH: 52 hmodule = hinstDLL; 53 break; 54 } 55 56 return TRUE; 57 } 58 #ifdef __cplusplus 59 } 60 #endif 61 62 static char * 63 get_webkit_datadir(void) 64 { 65 static char retval[1000]; 66 static int beenhere = 0; 67 68 unsigned char *p; 69 70 if (beenhere) 71 return retval; 72 73 if (!GetModuleFileName (hmodule, (CHAR *) retval, sizeof(retval) - 10)) 74 return DATA_DIR; 75 76 p = _mbsrchr((const unsigned char *) retval, '\\'); 77 *p = '\0'; 78 p = _mbsrchr((const unsigned char *) retval, '\\'); 79 if (p) { 80 if (!stricmp((const char *) (p+1), "bin")) 81 *p = '\0'; 82 } 83 strcat(retval, "\\share"); 84 85 beenhere = 1; 86 87 return retval; 88 } 89 90 #undef DATA_DIR 91 #define DATA_DIR get_webkit_datadir () 92 #endif 93 94 35 95 namespace WTF { 36 96 … … 97 157 if (!strcmp("missingImage", name)) 98 158 fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16); 99 if (fileName.isNull()) 100 fileName = String::format("%s/webkit-1.0/images/%s.png", DATA_DIR, name).utf8(); 159 if (fileName.isNull()) { 160 gchar* imagename = g_strdup_printf("%s.png", name); 161 gchar* glibFileName = g_build_filename(DATA_DIR, "webkit-1.0", "images", imagename, 0); 162 fileName = glib_file_name; 163 g_free(imagename); 164 g_free(glibFileName); 165 } 101 166 102 167 return loadImageFromFile(fileName);
Note: See TracChangeset
for help on using the changeset viewer.