From: Andrea Zagli Date: Tue, 17 Feb 2015 12:21:15 +0000 (+0100) Subject: Aggiunta la funzione Territorio::get_module_handle. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=e9c2ecc4f8160fde6881227fc7fcbd4f05ccbf66;p=solipa%2Fterritorio Aggiunta la funzione Territorio::get_module_handle. --- diff --git a/.cproject b/.cproject index 6812572..1eb897c 100644 --- a/.cproject +++ b/.cproject @@ -1,313 +1,264 @@ - - - + - - + + + + + + - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index 199ade0..2708b3e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ missing stamp-h1 *exe tests/widget +compile diff --git a/config.h.in b/config.h.in index 423fcf8..8de1159 100644 --- a/config.h.in +++ b/config.h.in @@ -30,8 +30,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ diff --git a/libreria/Makefile.am b/libreria/Makefile.am index 465dd06..64ee5b1 100644 --- a/libreria/Makefile.am +++ b/libreria/Makefile.am @@ -14,6 +14,7 @@ lib_LTLIBRARIES = libterritorio.la libterritorio_la_SOURCES = \ ../src/aggregazioneterritoriale.c \ ../src/aggregazioniterritoriali.c \ + ../src/commons.c \ ../src/comune.c \ ../src/comuni.c \ ../src/province.c \ diff --git a/src/Makefile.am b/src/Makefile.am index ff3b094..8ae956d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,6 +15,7 @@ territorio_SOURCES = \ aggregazioneterritoriale.h \ aggregazioniterritoriali.c \ aggregazioniterritoriali.h \ + commons.c \ commons.h \ comune.c \ comune.h \ diff --git a/src/commons.c b/src/commons.c new file mode 100644 index 0000000..a4846d8 --- /dev/null +++ b/src/commons.c @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2015 Andrea Zagli + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include + +#ifdef G_OS_WIN32 +#include +#endif + +#ifdef G_OS_WIN32 +static HMODULE hmodule; + +BOOL WINAPI +DllMain (HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + hmodule = hinstDLL; + break; + } + + return TRUE; +} + + +gpointer +territorio_get_module_handle () +{ + return (gpointer)hmodule; +} +#endif diff --git a/src/commons.h b/src/commons.h index 91b71af..1436d10 100644 --- a/src/commons.h +++ b/src/commons.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Andrea Zagli + * Copyright (C) 2010-2015 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,11 +25,19 @@ #include +#ifdef G_OS_WIN32 +#include +#endif + #include #include #include #include + +G_BEGIN_DECLS + + typedef struct { gchar *guidir; @@ -48,4 +56,14 @@ typedef struct Solipa *solipa; } TerritorioCommons; + + +#ifdef G_OS_WIN32 +gpointer territorio_get_module_handle (void); +#endif + + +G_END_DECLS + + #endif /* __TERRITORIO_COMMONS_H__ */