1 |
/* |
/* |
2 |
* Copyright (C) 2007, 2008 Andreas Persson |
* Copyright (C) 2007-2009 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
79 |
void close_window(); |
void close_window(); |
80 |
}; |
}; |
81 |
|
|
82 |
|
#ifdef WIN32 |
83 |
|
HINSTANCE gigedit_dll_handle = 0; |
84 |
|
#endif |
85 |
|
|
86 |
void init_app() { |
void init_app() { |
87 |
static bool process_initialized = false; |
static bool process_initialized = false; |
88 |
if (!process_initialized) { |
if (!process_initialized) { |
95 |
#ifdef WIN32 |
#ifdef WIN32 |
96 |
#if GLIB_CHECK_VERSION(2, 16, 0) |
#if GLIB_CHECK_VERSION(2, 16, 0) |
97 |
gchar* root = |
gchar* root = |
98 |
g_win32_get_package_installation_directory_of_module(NULL); |
g_win32_get_package_installation_directory_of_module(gigedit_dll_handle); |
99 |
#else |
#else |
100 |
gchar* root = |
gchar* root = |
101 |
g_win32_get_package_installation_directory(NULL, NULL); |
g_win32_get_package_installation_directory(NULL, NULL); |
308 |
mutex.unlock(); |
mutex.unlock(); |
309 |
close.wait(); // sleep until window is closed |
close.wait(); // sleep until window is closed |
310 |
} |
} |
311 |
|
|
312 |
|
#if defined(WIN32) |
313 |
|
extern "C" { |
314 |
|
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) |
315 |
|
{ |
316 |
|
switch (reason) { |
317 |
|
case DLL_PROCESS_ATTACH: |
318 |
|
gigedit_dll_handle = instance; |
319 |
|
break; |
320 |
|
} |
321 |
|
return TRUE; |
322 |
|
} |
323 |
|
} |
324 |
|
#endif |