Enlightenment CVS committal
Author : doursse
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore
Modified Files:
Ecore.h Ecore_Data.h Ecore_Str.h Makefile.am ecore.c
ecore_main.c ecore_plugin.c ecore_private.h ecore_time.c
Log Message:
integration of evil in ecore. It's compiling on windows and my ubuntu. The
commit is big, please report any problem
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/Ecore.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -3 -r1.63 -r1.64
--- Ecore.h 20 May 2008 12:37:51 -0000 1.63
+++ Ecore.h 26 May 2008 05:16:32 -0000 1.64
@@ -2,14 +2,19 @@
#define _ECORE_H
#ifdef EAPI
-#undef EAPI
+# undef EAPI
#endif
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_ECORE_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
-# endif
+# endif /* ! EFL_ECORE_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -20,7 +25,7 @@
# else
# define EAPI
# endif
-#endif
+#endif /* ! _WIN32 */
/**
* @file Ecore.h
@@ -119,6 +124,7 @@
typedef void Ecore_Event; /**< A handle for an event */
typedef void Ecore_Animator; /**< A handle for animators */
typedef void Ecore_Poller; /**< A handle for pollers */
+ typedef void Ecore_Pipe; /**< A handle for pipes */
#endif
typedef struct _Ecore_Event_Signal_User Ecore_Event_Signal_User; /**<
User signal event */
typedef struct _Ecore_Event_Signal_Hup Ecore_Event_Signal_Hup; /**<
Hup signal event */
@@ -292,6 +298,11 @@
EAPI double ecore_poller_poll_interval_get(Ecore_Poller_Type type);
EAPI Ecore_Poller *ecore_poller_add(Ecore_Poller_Type type, int interval,
int (*func) (void *data), const void *data);
EAPI void *ecore_poller_del(Ecore_Poller *poller);
+
+ EAPI Ecore_Pipe *ecore_pipe_new (void (*handler) (void *data));
+ EAPI void ecore_pipe_free(Ecore_Pipe *pipe);
+ EAPI void ecore_pipe_write(Ecore_Pipe *pipe,
+ void *data);
#ifdef __cplusplus
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/Ecore_Data.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- Ecore_Data.h 16 Mar 2008 23:05:50 -0000 1.54
+++ Ecore_Data.h 26 May 2008 05:16:32 -0000 1.55
@@ -2,14 +2,19 @@
# define _ECORE_DATA_H
#ifdef EAPI
-#undef EAPI
+# undef EAPI
#endif
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_ECORE_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
-# endif
+# endif /* ! EFL_ECORE_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -20,7 +25,7 @@
# else
# define EAPI
# endif
-#endif
+#endif /* ! _WIN32 */
/* we need this for size_t */
#include <stddef.h>
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/Ecore_Str.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- Ecore_Str.h 25 Jan 2008 18:10:46 -0000 1.10
+++ Ecore_Str.h 26 May 2008 05:16:32 -0000 1.11
@@ -2,14 +2,19 @@
# define _ECORE_STR_H
#ifdef EAPI
-#undef EAPI
+# undef EAPI
#endif
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_ECORE_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
-# endif
+# endif /* ! EFL_ECORE_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -20,7 +25,7 @@
# else
# define EAPI
# endif
-#endif
+#endif /* ! _WIN32 */
/**
* @file Ecore_Str.h
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/Makefile.am,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- Makefile.am 11 Jan 2008 07:33:56 -0000 1.14
+++ Makefile.am 26 May 2008 05:16:32 -0000 1.15
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
-AM_CPPFLAGS =
+AM_CFLAGS = @WIN32_CFLAGS@
lib_LTLIBRARIES = libecore.la
include_HEADERS = \
@@ -34,5 +34,5 @@
ecore_poll.c \
ecore_private.h
-libecore_la_LIBADD = @dlopen_libs@ @winsock_libs@ -lm
-libecore_la_LDFLAGS = @create_shared_lib@ -version-info @version_info@
+libecore_la_LIBADD = @dlopen_libs@ @EVIL_LIBS@ @WIN32_LIBS@ -lm
+libecore_la_LDFLAGS = @lt_no_undefined@ @lt_enable_auto_import@ -version-info
@version_info@
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- ecore.c 28 Jan 2008 11:20:57 -0000 1.24
+++ ecore.c 26 May 2008 05:16:32 -0000 1.25
@@ -1,18 +1,22 @@
-#include <config.h>
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
+
#ifdef HAVE_LANGINFO_H
# include <langinfo.h>
#endif
-#ifdef HAVE_WINDOWS_H
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
-#endif
-#include "ecore_private.h"
#include "Ecore.h"
+#include "ecore_private.h"
+
+#ifdef HAVE_EVIL
+# include <Evil.h>
+#endif
static const char *_ecore_magic_string_get(Ecore_Magic m);
static int _ecore_init_count = 0;
@@ -54,7 +58,9 @@
{
if (++_ecore_init_count == 1)
{
+#ifdef HAVE_LOCALE_H
setlocale(LC_CTYPE, "");
+#endif
/*
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
{
@@ -169,28 +175,26 @@
/* account for other apps and multitasking... */
static int _ecore_fps_debug_init_count = 0;
-#ifndef _WIN32
static int _ecore_fps_debug_fd = -1;
unsigned int *_ecore_fps_runtime_mmap = NULL;
-#else
-static HANDLE _ecore_fps_debug_fd = NULL;
-static HANDLE _ecore_fps_debug_fm = NULL;
-unsigned int *_ecore_fps_runtime_mmap = NULL;
-#endif /* _WIN32 */
void
_ecore_fps_debug_init(void)
{
- char buf[4096];
-#ifdef _WIN32
+ char buf[4096];
char *tmp;
-#endif /* _WIN32 */
+ int pid;
_ecore_fps_debug_init_count++;
if (_ecore_fps_debug_init_count > 1) return;
-#ifndef _WIN32
- snprintf(buf, sizeof(buf), "/tmp/.ecore_fps_debug-%i", (int)getpid());
+#ifndef HAVE_EVIL
+ tmp = "/tmp";
+#else
+ tmp = (char *)evil_tmpdir_get ();
+#endif /* HAVE_EVIL */
+ pid = (int)getpid();
+ snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp, pid);
_ecore_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
if (_ecore_fps_debug_fd < 0)
{
@@ -207,45 +211,6 @@
MAP_SHARED,
_ecore_fps_debug_fd, 0);
}
-#else
- tmp = getenv("TMP");
- if (!tmp) tmp = getenv("TEMP");
- if (!tmp) tmp = getenv("USERPROFILE");
- if (!tmp) tmp = getenv("windir");
- if (!tmp) tmp = "C:";
- snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp,
(int)GetCurrentProcessId());
- _ecore_fps_debug_fd = CreateFile(buf,
- FILE_READ_DATA | FILE_WRITE_DATA,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- CREATE_NEW,// | TRUNCATE_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if (_ecore_fps_debug_fd)
- {
- unsigned int zero = 0;
- DWORD out;
-
- _ecore_fps_debug_fm = CreateFileMapping(_ecore_fps_debug_fd,
- NULL,
- PAGE_READWRITE,
- 0,
- (DWORD)sizeof(unsigned int),
- NULL);
- if (_ecore_fps_debug_fm)
- {
- WriteFile(_ecore_fps_debug_fd,
- &zero, sizeof(unsigned int),
- &out, NULL);
- _ecore_fps_runtime_mmap = MapViewOfFile(_ecore_fps_debug_fm,
- FILE_MAP_WRITE,
- 0, 0,
- sizeof(unsigned int));
- }
- else
- CloseHandle(_ecore_fps_debug_fd);
- }
-#endif /* _WIN32 */
}
void
@@ -256,27 +221,16 @@
if (_ecore_fps_debug_fd >= 0)
{
char buf[4096];
-#ifdef _WIN32
char *tmp;
+ int pid;
- tmp = getenv("TMP");
- if (!tmp) tmp = getenv("TEMP");
- if (!tmp) tmp = getenv("USERPROFILE");
- if (!tmp) tmp = getenv("windir");
- if (!tmp) tmp = "C:/";
- snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp,
(int)GetCurrentProcessId());
- if (_ecore_fps_runtime_mmap)
- {
- UnmapViewOfFile(_ecore_fps_runtime_mmap);
- _ecore_fps_runtime_mmap = NULL;
- }
- CloseHandle(_ecore_fps_debug_fm);
- CloseHandle(_ecore_fps_debug_fd);
- _ecore_fps_debug_fd = NULL;
- _ecore_fps_debug_fm = NULL;
- _unlink(buf);
+#ifndef HAVE_EVIL
+ tmp = "/tmp";
#else
- snprintf(buf, sizeof(buf), "/tmp/.ecore_fps_debug-%i", (int)getpid());
+ tmp = (char *)evil_tmpdir_get ();
+#endif /* HAVE_EVIL */
+ pid = (int)getpid();
+ snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp, pid);
unlink(buf);
if (_ecore_fps_runtime_mmap)
{
@@ -285,7 +239,6 @@
}
close(_ecore_fps_debug_fd);
_ecore_fps_debug_fd = -1;
-#endif /* _WIN32 */
}
}
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_main.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ecore_main.c 24 Feb 2008 08:42:39 -0000 1.35
+++ ecore_main.c 26 May 2008 05:16:32 -0000 1.36
@@ -4,7 +4,7 @@
#include <config.h>
-#ifdef HAVE_WINSOCK2_H
+#ifdef _WIN32
# include <winsock2.h>
#endif
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_plugin.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ecore_plugin.c 26 Jan 2008 05:40:52 -0000 1.17
+++ ecore_plugin.c 26 May 2008 05:16:32 -0000 1.18
@@ -2,96 +2,23 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#ifdef HAVE_DLFCN_H
# include <dlfcn.h>
#endif
-#ifdef HAVE_WINDOWS_H
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
-#endif
-
#include <stdlib.h>
#include <stdio.h>
-#include "ecore_private.h"
-#include "Ecore_Data.h"
-
-/* FIXME: that hack is a temporary one. That code will be in MinGW soon */
-#if defined(_WIN32) && !defined(HAVE_DLFCN_H)
-
-# define RTLD_LAZY 1 /* lazy function call binding */
-# define RTLD_NOW 2 /* immediate function call binding */
-# define RTLD_GLOBAL 4 /* symbols in this dlopen'ed obj are visible
- to other dlopen'ed objs */
-
-static char *dlerr_ptr;
-static char dlerr_data[80];
-
-void *dlopen (const char *file, int mode)
-{
- HMODULE hmodule;
-
- hmodule = LoadLibrary(file);
- if (hmodule == NULL)
- {
- int error;
-
- error = GetLastError();
- sprintf(dlerr_data, "LoadLibraryEx returned %d.", error);
- dlerr_ptr = dlerr_data;
- }
- return hmodule;
-}
-
-int dlclose (void *handle)
-{
- if (FreeLibrary(handle))
- {
- return 0;
- }
- else
- {
- int error;
-
- error = GetLastError();
- sprintf(dlerr_data, "FreeLibrary returned %d.", error);
- dlerr_ptr = dlerr_data;
- return -1;
- }
-}
-
-void *dlsym (void *handle, const char *name)
-{
- FARPROC fp;
-
- fp = GetProcAddress(handle, name);
- if (fp == NULL)
- {
- int error;
-
- error = GetLastError();
- sprintf(dlerr_data, "GetProcAddress returned %d.", error);
- dlerr_ptr = dlerr_data;
- }
- return fp;
-}
-
-char *dlerror (void)
-{
- if (dlerr_ptr != NULL)
- {
- dlerr_ptr = NULL;
- return dlerr_data;
- }
- else
- return NULL;
-}
-
+#ifdef HAVE_EVIL_H
+# include <evil.h>
#endif
+
+#include "Ecore_Data.h"
+#include "ecore_private.h"
static Ecore_List *loaded_plugins = NULL;
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_private.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- ecore_private.h 10 Mar 2008 06:44:32 -0000 1.52
+++ ecore_private.h 26 May 2008 05:16:32 -0000 1.53
@@ -24,12 +24,17 @@
#ifdef EAPI
# undef EAPI
#endif
-#ifdef _MSC_VER
-# ifdef BUILDING_DLL
-# define EAPI __declspec(dllexport)
+
+#ifdef _WIN32
+# ifdef EFL_ECORE_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
-# endif
+# endif /* ! EFL_ECORE_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
@@ -40,7 +45,7 @@
# else
# define EAPI
# endif
-#endif
+#endif /* ! _WIN32 */
#ifdef __GNUC__
# if __GNUC__ >= 4
@@ -242,6 +247,7 @@
typedef struct _Ecore_Event Ecore_Event;
typedef struct _Ecore_Animator Ecore_Animator;
typedef struct _Ecore_Poller Ecore_Poller;
+typedef struct _Ecore_Pipe Ecore_Pipe;
#ifndef _WIN32
struct _Ecore_Exe
@@ -389,6 +395,14 @@
signed char delete_me : 1;
int (*func) (void *data);
void *data;
+};
+
+struct _Ecore_Pipe
+{
+ int fd_read;
+ int fd_write;
+ int event_data;
+ void (*handler) (void *data);
};
#endif
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_time.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- ecore_time.c 26 Jan 2008 05:40:52 -0000 1.14
+++ ecore_time.c 26 May 2008 05:16:32 -0000 1.15
@@ -2,17 +2,16 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
-#include <config.h>
-#ifdef HAVE_WINDOWS_H
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
+#ifdef HAVE_CONFIG_H
+# include <config.h>
#endif
+
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-#include "ecore_private.h"
+
#include "Ecore.h"
+#include "ecore_private.h"
/* FIXME: clock_gettime() is an option... */
@@ -24,22 +23,12 @@
EAPI double
ecore_time_get(void)
{
-#ifdef _WIN32
- FILETIME ft;
- double time;
-
- GetSystemTimeAsFileTime(&ft);
- time = (double)ft.dwLowDateTime + 4294967296.0 * (double)ft.dwHighDateTime;
-
- return time / 10000000;
-#else
-# ifdef HAVE_GETTIMEOFDAY
+#ifdef HAVE_GETTIMEOFDAY
struct timeval timev;
gettimeofday(&timev, NULL);
return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
-# else
-# error "Your platform isn't supported yet"
-# endif
-#endif /* _WIN32 */
+#else
+# error "Your platform isn't supported yet"
+#endif
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs