forked from enlightenment/efl
add windows support to ecore. ecore_evas is ported too (directdraw and direct3d. No opengl yet). It needs to be tested a lot, though. Remove some trailing spaces here and there. Replace WIN32 with _WIN32
SVN revision: 31513
This commit is contained in:
parent
1bd182b2f1
commit
50432552c8
|
@ -21,6 +21,7 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
|
||||||
ecore-job.pc \
|
ecore-job.pc \
|
||||||
ecore-txt.pc \
|
ecore-txt.pc \
|
||||||
ecore-x.pc \
|
ecore-x.pc \
|
||||||
|
ecore-win32.pc \
|
||||||
ecore-sdl.pc \
|
ecore-sdl.pc \
|
||||||
ecore.pc
|
ecore.pc
|
||||||
|
|
||||||
|
@ -40,6 +41,7 @@ EXTRA_DIST = AUTHORS COPYING COPYING-PLAIN ecore.c.in gendoc ecore.supp \
|
||||||
ecore-job.pc.in \
|
ecore-job.pc.in \
|
||||||
ecore-txt.pc.in \
|
ecore-txt.pc.in \
|
||||||
ecore-x.pc.in \
|
ecore-x.pc.in \
|
||||||
|
ecore-win32.pc.in \
|
||||||
ecore-sdl.pc.in \
|
ecore-sdl.pc.in \
|
||||||
ecore.spec.in ecore.spec \
|
ecore.spec.in ecore.spec \
|
||||||
debian/changelog \
|
debian/changelog \
|
||||||
|
@ -105,6 +107,11 @@ if BUILD_ECORE_X
|
||||||
px = ecore-x.pc
|
px = ecore-x.pc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if BUILD_ECORE_WIN32
|
||||||
|
pwin32 = ecore-win32.pc
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
if BUILD_ECORE_SDL
|
if BUILD_ECORE_SDL
|
||||||
psdl = ecore-sdl.pc
|
psdl = ecore-sdl.pc
|
||||||
endif
|
endif
|
||||||
|
@ -116,4 +123,5 @@ endif
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = \
|
pkgconfig_DATA = \
|
||||||
ecore.pc $(pcon) $(pconfig) $(pdfb) $(pevas) \
|
ecore.pc $(pcon) $(pconfig) $(pdfb) $(pevas) \
|
||||||
$(pfb) $(pfile) $(pdesktop) $(pipc) $(pjob) $(ptxt) $(px) $(psdl)
|
$(pfb) $(pfile) $(pdesktop) $(pipc) $(pjob) $(ptxt) \
|
||||||
|
$(px) $(pwin32) $(psdl)
|
||||||
|
|
|
@ -72,6 +72,7 @@ requirements_ecore_ipc=""
|
||||||
requirements_ecore_job=""
|
requirements_ecore_job=""
|
||||||
requirements_ecore_txt=""
|
requirements_ecore_txt=""
|
||||||
requirements_ecore_x=""
|
requirements_ecore_x=""
|
||||||
|
requirements_ecore_win32=""
|
||||||
requirements_ecore_sdl=""
|
requirements_ecore_sdl=""
|
||||||
|
|
||||||
dnl The first call to PKG_CHECK_MODULES is done conditionally,
|
dnl The first call to PKG_CHECK_MODULES is done conditionally,
|
||||||
|
@ -303,6 +304,31 @@ fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_HEADER(ddraw.h,
|
||||||
|
[ have_ddraw="yes"
|
||||||
|
AC_DEFINE(HAVE_DIRECTDRAW, 1, [Build Ecore_Win32 with DirectDraw Code])
|
||||||
|
ddraw_libs="-lddraw -ldxguid" ],
|
||||||
|
[ have_ddraw="no" ]
|
||||||
|
)
|
||||||
|
AC_SUBST(ddraw_libs)
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS(d3d9.h d3dx9.h,
|
||||||
|
[ have_direct3d="yes"
|
||||||
|
AC_DEFINE(HAVE_DIRECT3D, 1, [Build Ecore_Win32 with Direct3D Code])
|
||||||
|
direct3d_libs="-ld3d9 -ld3dx9d" ],
|
||||||
|
[ have_direct3d="no" ]
|
||||||
|
)
|
||||||
|
AC_SUBST(direct3d_libs)
|
||||||
|
|
||||||
|
have_win32="no"
|
||||||
|
if test "x${have_ddraw}" = "xyes" -o "x${have_direct3d}" = "xyes"; then
|
||||||
|
have_win32="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ECORE_CHECK_MODULE([Win32], [no], [$have_win32],
|
||||||
|
[ecore_win32_libs="$ecore_win32_libs $ddraw_libs $direct3d_libs"])
|
||||||
|
|
||||||
|
|
||||||
ECORE_CHECK_MODULE([Job], [yes])
|
ECORE_CHECK_MODULE([Job], [yes])
|
||||||
|
|
||||||
PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.16,
|
PKG_CHECK_MODULES(DIRECTFB, directfb >= 0.9.16,
|
||||||
|
@ -837,6 +863,7 @@ ecore-ipc.pc
|
||||||
ecore-job.pc
|
ecore-job.pc
|
||||||
ecore-txt.pc
|
ecore-txt.pc
|
||||||
ecore-x.pc
|
ecore-x.pc
|
||||||
|
ecore-win32.pc
|
||||||
ecore-sdl.pc
|
ecore-sdl.pc
|
||||||
ecore.pc
|
ecore.pc
|
||||||
src/Makefile
|
src/Makefile
|
||||||
|
@ -855,6 +882,7 @@ src/lib/ecore_config/Makefile
|
||||||
src/lib/ecore_file/Makefile
|
src/lib/ecore_file/Makefile
|
||||||
src/lib/ecore_desktop/Makefile
|
src/lib/ecore_desktop/Makefile
|
||||||
src/lib/ecore_directfb/Makefile
|
src/lib/ecore_directfb/Makefile
|
||||||
|
src/lib/ecore_win32/Makefile
|
||||||
README
|
README
|
||||||
ecore.spec
|
ecore.spec
|
||||||
debian/changelog
|
debian/changelog
|
||||||
|
@ -873,13 +901,15 @@ echo " Ecore_X (XCB backend)........: $have_ecore_x_xcb (Xprint: $have_ecore_x_
|
||||||
else
|
else
|
||||||
echo " Ecore_X (Xlib backend).......: $have_ecore_x (Xcursor: $use_Xcursor) (Xprint: $use_xprint) (Xinerama: $use_xinerama) (Xrandr: $use_xrandr) (Xscreensaver: $use_xss) (Xrender: $use_xrender) (Xfixes: $use_xfixes) (Xdamage: $use_xdamage) (Xdpms: $use_xdpms)"
|
echo " Ecore_X (Xlib backend).......: $have_ecore_x (Xcursor: $use_Xcursor) (Xprint: $use_xprint) (Xinerama: $use_xinerama) (Xrandr: $use_xrandr) (Xscreensaver: $use_xss) (Xrender: $use_xrender) (Xfixes: $use_xfixes) (Xdamage: $use_xdamage) (Xdpms: $use_xdpms)"
|
||||||
fi
|
fi
|
||||||
|
echo " Ecore_Win32..................: $have_ecore_win32 (DirectDraw: ${have_ddraw}) (Direct3D: ${have_direct3d})"
|
||||||
|
|
||||||
echo " Ecore_FB.....................: $have_ecore_fb"
|
echo " Ecore_FB.....................: $have_ecore_fb"
|
||||||
echo " Ecore_DFB....................: $have_ecore_directfb"
|
echo " Ecore_DFB....................: $have_ecore_directfb"
|
||||||
echo " Ecore_SDL....................: $have_ecore_sdl"
|
echo " Ecore_SDL....................: $have_ecore_sdl"
|
||||||
echo " Ecore_Evas...................: $have_ecore_evas"
|
echo " Ecore_Evas...................: $have_ecore_evas"
|
||||||
echo " Ecore_Evas GL Support........: $have_ecore_evas_gl"
|
echo " Ecore_Evas GL Support........: $have_ecore_evas_gl"
|
||||||
echo " Ecore_Evas XRender Support...: $have_ecore_evas_xrender"
|
echo " Ecore_Evas XRender Support...: $have_ecore_evas_xrender"
|
||||||
echo " Ecore_Evas X11 16bpp Support.: $have_ecore_evas_16_x11"
|
echo " Ecore_Evas X11 16bpp Support.: $have_ecore_evas_x11_16"
|
||||||
echo " Ecore_Evas FB Support........: $have_ecore_evas_fb"
|
echo " Ecore_Evas FB Support........: $have_ecore_evas_fb"
|
||||||
echo " Ecore_Evas SDL Support.......: $have_ecore_evas_sdl"
|
echo " Ecore_Evas SDL Support.......: $have_ecore_evas_sdl"
|
||||||
echo " Ecore_Evas DFB Support.......: $have_ecore_evas_dfb"
|
echo " Ecore_Evas DFB Support.......: $have_ecore_evas_dfb"
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
libdir=@libdir@
|
||||||
|
includedir=@includedir@
|
||||||
|
|
||||||
|
Name: ecore-win32
|
||||||
|
Description: E core library, Win32 module
|
||||||
|
Version: @VERSION@
|
||||||
|
Libs: -L${libdir} -lecore_win32
|
||||||
|
Libs.private: @ddraw_libs@ @direct3d_libs@
|
||||||
|
Cflags: -I${includedir}
|
|
@ -7,6 +7,7 @@ ecore_fb \
|
||||||
ecore_directfb \
|
ecore_directfb \
|
||||||
ecore_con \
|
ecore_con \
|
||||||
ecore_x \
|
ecore_x \
|
||||||
|
ecore_win32 \
|
||||||
ecore_sdl \
|
ecore_sdl \
|
||||||
ecore_ipc \
|
ecore_ipc \
|
||||||
ecore_evas \
|
ecore_evas \
|
||||||
|
|
|
@ -97,7 +97,7 @@ extern "C" {
|
||||||
};
|
};
|
||||||
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
|
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
typedef void Ecore_Exe; /**< A handle for spawned processes */
|
typedef void Ecore_Exe; /**< A handle for spawned processes */
|
||||||
#endif
|
#endif
|
||||||
typedef void Ecore_Timer; /**< A handle for timers */
|
typedef void Ecore_Timer; /**< A handle for timers */
|
||||||
|
@ -120,7 +120,7 @@ extern "C" {
|
||||||
typedef struct _Ecore_Exe_Event_Data_Line Ecore_Exe_Event_Data_Line; /**< Lines from a child process */
|
typedef struct _Ecore_Exe_Event_Data_Line Ecore_Exe_Event_Data_Line; /**< Lines from a child process */
|
||||||
typedef struct _Ecore_Exe_Event_Data Ecore_Exe_Event_Data; /**< Data from a child process */
|
typedef struct _Ecore_Exe_Event_Data Ecore_Exe_Event_Data; /**< Data from a child process */
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct _Ecore_Event_Signal_User /** User signal event */
|
struct _Ecore_Event_Signal_User /** User signal event */
|
||||||
|
@ -128,7 +128,7 @@ extern "C" {
|
||||||
int number; /**< The signal number. Either 1 or 2 */
|
int number; /**< The signal number. Either 1 or 2 */
|
||||||
void *ext_data; /**< Extension data - not used */
|
void *ext_data; /**< Extension data - not used */
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
siginfo_t data; /**< Signal info */
|
siginfo_t data; /**< Signal info */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -137,7 +137,7 @@ extern "C" {
|
||||||
{
|
{
|
||||||
void *ext_data; /**< Extension data - not used */
|
void *ext_data; /**< Extension data - not used */
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
siginfo_t data; /**< Signal info */
|
siginfo_t data; /**< Signal info */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -149,7 +149,7 @@ extern "C" {
|
||||||
int terminate : 1; /**< Set if the exit request was a terminate singal */
|
int terminate : 1; /**< Set if the exit request was a terminate singal */
|
||||||
void *ext_data; /**< Extension data - not used */
|
void *ext_data; /**< Extension data - not used */
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
siginfo_t data; /**< Signal info */
|
siginfo_t data; /**< Signal info */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -158,7 +158,7 @@ extern "C" {
|
||||||
{
|
{
|
||||||
void *ext_data; /**< Extension data - not used */
|
void *ext_data; /**< Extension data - not used */
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
siginfo_t data; /**< Signal info */
|
siginfo_t data; /**< Signal info */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -167,12 +167,12 @@ extern "C" {
|
||||||
{
|
{
|
||||||
int num; /**< The realtime signal's number */
|
int num; /**< The realtime signal's number */
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
siginfo_t data; /**< Signal info */
|
siginfo_t data; /**< Signal info */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
struct _Ecore_Exe_Event_Add /** Process add event */
|
struct _Ecore_Exe_Event_Add /** Process add event */
|
||||||
{
|
{
|
||||||
Ecore_Exe *exe; /**< The handle to the added process */
|
Ecore_Exe *exe; /**< The handle to the added process */
|
||||||
|
@ -224,7 +224,7 @@ extern "C" {
|
||||||
EAPI void *ecore_event_current_event_get(void);
|
EAPI void *ecore_event_current_event_get(void);
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
EAPI Ecore_Exe *ecore_exe_run(const char *exe_cmd, const void *data);
|
EAPI Ecore_Exe *ecore_exe_run(const char *exe_cmd, const void *data);
|
||||||
EAPI Ecore_Exe *ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data);
|
EAPI Ecore_Exe *ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data);
|
||||||
EAPI int ecore_exe_send(Ecore_Exe *exe, void *data, int size);
|
EAPI int ecore_exe_send(Ecore_Exe *exe, void *data, int size);
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
# include <langinfo.h>
|
# include <langinfo.h>
|
||||||
#endif /* WIN32 */
|
#endif /* _WIN32 */
|
||||||
#include "ecore_private.h"
|
#include "ecore_private.h"
|
||||||
#include "Ecore.h"
|
#include "Ecore.h"
|
||||||
|
|
||||||
static const char *_ecore_magic_string_get(Ecore_Magic m);
|
static const char *_ecore_magic_string_get(Ecore_Magic m);
|
||||||
static int _ecore_init_count = 0;
|
static int _ecore_init_count = 0;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
int _ecore_fps_debug = 0;
|
int _ecore_fps_debug = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ ecore_init(void)
|
||||||
printf("WARNING: not a utf8 locale!\n");
|
printf("WARNING: not a utf8 locale!\n");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
|
if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
|
||||||
if (_ecore_fps_debug) _ecore_fps_debug_init();
|
if (_ecore_fps_debug) _ecore_fps_debug_init();
|
||||||
_ecore_signal_init();
|
_ecore_signal_init();
|
||||||
|
@ -81,11 +81,11 @@ ecore_shutdown(void)
|
||||||
if (--_ecore_init_count)
|
if (--_ecore_init_count)
|
||||||
return _ecore_init_count;
|
return _ecore_init_count;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_fps_debug) _ecore_fps_debug_shutdown();
|
if (_ecore_fps_debug) _ecore_fps_debug_shutdown();
|
||||||
#endif
|
#endif
|
||||||
_ecore_animator_shutdown();
|
_ecore_animator_shutdown();
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
_ecore_exe_shutdown();
|
_ecore_exe_shutdown();
|
||||||
#endif
|
#endif
|
||||||
_ecore_idle_enterer_shutdown();
|
_ecore_idle_enterer_shutdown();
|
||||||
|
@ -94,7 +94,7 @@ ecore_shutdown(void)
|
||||||
_ecore_timer_shutdown();
|
_ecore_timer_shutdown();
|
||||||
_ecore_event_shutdown();
|
_ecore_event_shutdown();
|
||||||
_ecore_main_shutdown();
|
_ecore_main_shutdown();
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
_ecore_signal_shutdown();
|
_ecore_signal_shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ _ecore_magic_string_get(Ecore_Magic m)
|
||||||
return "<UNKNOWN>";
|
return "<UNKNOWN>";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
/* fps debug calls - for debugging how much time your app actually spends */
|
/* fps debug calls - for debugging how much time your app actually spends */
|
||||||
/* "running" (and the inverse being time spent running)... this does not */
|
/* "running" (and the inverse being time spent running)... this does not */
|
||||||
/* account for other apps and multitasking... */
|
/* account for other apps and multitasking... */
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "ecore_private.h"
|
#include "ecore_private.h"
|
||||||
#include "Ecore.h"
|
#include "Ecore.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
|
|
||||||
/* TODO: Something to let people build a command line and does auto escaping -
|
/* TODO: Something to let people build a command line and does auto escaping -
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#include <winsock.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -342,7 +342,7 @@ _ecore_main_select(double timeout)
|
||||||
if (fdh->fd > max_fd) max_fd = fdh->fd;
|
if (fdh->fd > max_fd) max_fd = fdh->fd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_signal_count_get()) return -1;
|
if (_ecore_signal_count_get()) return -1;
|
||||||
#endif
|
#endif
|
||||||
ret = select(max_fd + 1, &rfds, &wfds, &exfds, t);
|
ret = select(max_fd + 1, &rfds, &wfds, &exfds, t);
|
||||||
|
@ -454,6 +454,9 @@ _ecore_main_fd_handlers_buf_call(void)
|
||||||
static void
|
static void
|
||||||
_ecore_main_loop_iterate_internal(int once_only)
|
_ecore_main_loop_iterate_internal(int once_only)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
MSG msg;
|
||||||
|
#endif
|
||||||
double next_time;
|
double next_time;
|
||||||
int have_event = 0;
|
int have_event = 0;
|
||||||
int have_signal;
|
int have_signal;
|
||||||
|
@ -469,7 +472,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
}
|
}
|
||||||
/* any timers re-added as a result of these are allowed to go */
|
/* any timers re-added as a result of these are allowed to go */
|
||||||
_ecore_timer_enable_new();
|
_ecore_timer_enable_new();
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
/* process signals into events .... */
|
/* process signals into events .... */
|
||||||
while (_ecore_signal_count_get()) _ecore_signal_call();
|
while (_ecore_signal_count_get()) _ecore_signal_call();
|
||||||
#endif
|
#endif
|
||||||
|
@ -493,7 +496,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
ret = _ecore_main_select(0);
|
ret = _ecore_main_select(0);
|
||||||
|
|
||||||
if (ret > 0) have_event = 1;
|
if (ret > 0) have_event = 1;
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -520,7 +523,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_fps_debug)
|
if (_ecore_fps_debug)
|
||||||
{
|
{
|
||||||
t2 = ecore_time_get();
|
t2 = ecore_time_get();
|
||||||
|
@ -549,7 +552,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
|
|
||||||
ret = _ecore_main_select(-1);
|
ret = _ecore_main_select(-1);
|
||||||
if (ret > 0) have_event = 1;
|
if (ret > 0) have_event = 1;
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -564,7 +567,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
if (_ecore_event_exist()) break;
|
if (_ecore_event_exist()) break;
|
||||||
ret = _ecore_main_select(0);
|
ret = _ecore_main_select(0);
|
||||||
if (ret > 0) have_event = 1;
|
if (ret > 0) have_event = 1;
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
||||||
#endif
|
#endif
|
||||||
if (have_event || have_signal) break;
|
if (have_event || have_signal) break;
|
||||||
|
@ -584,7 +587,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
|
|
||||||
ret = _ecore_main_select(next_time);
|
ret = _ecore_main_select(next_time);
|
||||||
if (ret > 0) have_event = 1;
|
if (ret > 0) have_event = 1;
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -600,7 +603,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
if (_ecore_event_exist()) break;
|
if (_ecore_event_exist()) break;
|
||||||
ret = _ecore_main_select(0);
|
ret = _ecore_main_select(0);
|
||||||
if (ret > 0) have_event = 1;
|
if (ret > 0) have_event = 1;
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
if (_ecore_signal_count_get() > 0) have_signal = 1;
|
||||||
#endif
|
#endif
|
||||||
if ((have_event) || (have_signal)) break;
|
if ((have_event) || (have_signal)) break;
|
||||||
|
@ -614,7 +617,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
if (_ecore_fps_debug)
|
if (_ecore_fps_debug)
|
||||||
{
|
{
|
||||||
t1 = ecore_time_get();
|
t1 = ecore_time_get();
|
||||||
|
@ -630,7 +633,7 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
if (have_event) _ecore_main_fd_handlers_call();
|
if (have_event) _ecore_main_fd_handlers_call();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
/* process signals into events .... */
|
/* process signals into events .... */
|
||||||
while (_ecore_signal_count_get()) _ecore_signal_call();
|
while (_ecore_signal_count_get()) _ecore_signal_call();
|
||||||
#endif
|
#endif
|
||||||
|
@ -640,6 +643,13 @@ _ecore_main_loop_iterate_internal(int once_only)
|
||||||
_ecore_main_fd_handlers_cleanup();
|
_ecore_main_fd_handlers_cleanup();
|
||||||
}
|
}
|
||||||
while (_ecore_main_fd_handlers_buf_call());
|
while (_ecore_main_fd_handlers_buf_call());
|
||||||
|
#ifdef _WIN32
|
||||||
|
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (once_only) _ecore_idle_enterer_call();
|
if (once_only) _ecore_idle_enterer_call();
|
||||||
in_main_loop--;
|
in_main_loop--;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
# include <dlfcn.h>
|
# include <dlfcn.h>
|
||||||
# include "ecore_private.h"
|
# include "ecore_private.h"
|
||||||
# include "Ecore_Data.h"
|
# include "Ecore_Data.h"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ enum _Ecore_Exe_Flags
|
||||||
};
|
};
|
||||||
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
|
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
typedef struct _Ecore_Exe Ecore_Exe;
|
typedef struct _Ecore_Exe Ecore_Exe;
|
||||||
#endif
|
#endif
|
||||||
typedef struct _Ecore_Timer Ecore_Timer;
|
typedef struct _Ecore_Timer Ecore_Timer;
|
||||||
|
@ -235,7 +235,7 @@ typedef struct _Ecore_Event_Filter Ecore_Event_Filter;
|
||||||
typedef struct _Ecore_Event Ecore_Event;
|
typedef struct _Ecore_Event Ecore_Event;
|
||||||
typedef struct _Ecore_Animator Ecore_Animator;
|
typedef struct _Ecore_Animator Ecore_Animator;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
struct _Ecore_Exe
|
struct _Ecore_Exe
|
||||||
{
|
{
|
||||||
Ecore_List2 __list_data;
|
Ecore_List2 __list_data;
|
||||||
|
@ -412,7 +412,7 @@ void _ecore_signal_init(void);
|
||||||
int _ecore_signal_count_get(void);
|
int _ecore_signal_count_get(void);
|
||||||
void _ecore_signal_call(void);
|
void _ecore_signal_call(void);
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
void _ecore_exe_init(void);
|
void _ecore_exe_init(void);
|
||||||
void _ecore_exe_shutdown(void);
|
void _ecore_exe_shutdown(void);
|
||||||
Ecore_Exe *_ecore_exe_find(pid_t pid);
|
Ecore_Exe *_ecore_exe_find(pid_t pid);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
|
@ -1,31 +1,9 @@
|
||||||
#include <sys/time.h>
|
#ifdef _WIN32
|
||||||
#ifdef WIN32
|
# include <windows.h>
|
||||||
#include <sys/timeb.h>
|
|
||||||
#endif
|
|
||||||
#include "ecore_private.h"
|
|
||||||
#include "Ecore.h"
|
|
||||||
|
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
|
||||||
#ifdef WIN32
|
|
||||||
|
|
||||||
static int
|
|
||||||
gettimeofday(struct timeval *tv, void *unused)
|
|
||||||
{
|
|
||||||
struct _timeb t;
|
|
||||||
|
|
||||||
if (!tv) return -1;
|
|
||||||
|
|
||||||
_ftime (&t);
|
|
||||||
|
|
||||||
tv->tv_sec = t.time;
|
|
||||||
tv->tv_usec = t.millitm * 1000;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
# error "Your platform isn't supported yet"
|
# include <sys/time.h>
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
#include "Ecore.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the current system time as a floating point value in seconds.
|
* Retrieves the current system time as a floating point value in seconds.
|
||||||
|
@ -35,8 +13,16 @@ gettimeofday(struct timeval *tv, void *unused)
|
||||||
EAPI double
|
EAPI double
|
||||||
ecore_time_get(void)
|
ecore_time_get(void)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
return (double)GetTickCount() / 1000.0;
|
||||||
|
#else
|
||||||
|
# ifdef HAVE_GETTIMEOFDAY
|
||||||
struct timeval timev;
|
struct timeval timev;
|
||||||
|
|
||||||
gettimeofday(&timev, NULL);
|
gettimeofday(&timev, NULL);
|
||||||
return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
|
return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
|
||||||
|
# else
|
||||||
|
# error "Your platform isn't supported yet"
|
||||||
|
# endif
|
||||||
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#elif WIN32
|
#elif _WIN32
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void _ecore_con_cb_dns_lookup(void *data, struct hostent *he);
|
static void _ecore_con_cb_dns_lookup(void *data, struct hostent *he);
|
||||||
|
|
|
@ -53,6 +53,7 @@ extern "C" {
|
||||||
#define HAVE_ECORE_EVAS_GL 1
|
#define HAVE_ECORE_EVAS_GL 1
|
||||||
#define HAVE_ECORE_EVAS_X11_16 1
|
#define HAVE_ECORE_EVAS_X11_16 1
|
||||||
#define HAVE_ECORE_EVAS_DIRECTFB 1
|
#define HAVE_ECORE_EVAS_DIRECTFB 1
|
||||||
|
#define HAVE_ECORE_EVAS_WIN32 1
|
||||||
|
|
||||||
typedef enum _Ecore_Evas_Engine_Type
|
typedef enum _Ecore_Evas_Engine_Type
|
||||||
{
|
{
|
||||||
|
@ -63,6 +64,8 @@ typedef enum _Ecore_Evas_Engine_Type
|
||||||
ECORE_EVAS_ENGINE_XRENDER_X11,
|
ECORE_EVAS_ENGINE_XRENDER_X11,
|
||||||
ECORE_EVAS_ENGINE_DIRECTFB,
|
ECORE_EVAS_ENGINE_DIRECTFB,
|
||||||
ECORE_EVAS_ENGINE_SOFTWARE_X11_16,
|
ECORE_EVAS_ENGINE_SOFTWARE_X11_16,
|
||||||
|
ECORE_EVAS_ENGINE_SOFTWARE_DDRAW,
|
||||||
|
ECORE_EVAS_ENGINE_DIRECT3D,
|
||||||
ECORE_EVAS_ENGINE_SDL
|
ECORE_EVAS_ENGINE_SDL
|
||||||
} Ecore_Evas_Engine_Type;
|
} Ecore_Evas_Engine_Type;
|
||||||
|
|
||||||
|
@ -76,6 +79,10 @@ typedef unsigned int Ecore_X_Window;
|
||||||
typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
|
typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ECORE_WIN32_H__
|
||||||
|
typedef void Ecore_Win32_Window;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _ECORE_EVAS_PRIVATE_H
|
#ifndef _ECORE_EVAS_PRIVATE_H
|
||||||
/* basic data types */
|
/* basic data types */
|
||||||
typedef struct _Ecore_Evas Ecore_Evas;
|
typedef struct _Ecore_Evas Ecore_Evas;
|
||||||
|
@ -127,6 +134,18 @@ EAPI const int *ecore_evas_buffer_pixels_get(Ecore_Evas *ee);
|
||||||
|
|
||||||
EAPI Evas_Object *ecore_evas_object_image_new(Ecore_Evas *ee_target);
|
EAPI Evas_Object *ecore_evas_object_image_new(Ecore_Evas *ee_target);
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *ecore_evas_software_ddraw_new(Ecore_Win32_Window *parent,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
|
||||||
|
EAPI Ecore_Evas *ecore_evas_direct3d_new(Ecore_Win32_Window *parent,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
|
||||||
EAPI Ecore_Evas *ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
|
EAPI Ecore_Evas *ecore_evas_sdl_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha);
|
||||||
|
|
||||||
/* generic manipulation calls */
|
/* generic manipulation calls */
|
||||||
|
|
|
@ -30,6 +30,16 @@ ECORE_DIRECTFB_LIB =
|
||||||
ECORE_DIRECTFB_LDF =
|
ECORE_DIRECTFB_LDF =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if BUILD_ECORE_WIN32
|
||||||
|
ECORE_WIN32_INC = -I$(top_srcdir)/src/lib/ecore_win32
|
||||||
|
ECORE_WIN32_LIB = $(top_builddir)/src/lib/ecore_win32/libecore_win32.la
|
||||||
|
ECORE_WIN32_LDF = -L$(top_builddir)/src/lib/ecore_win32/.libs
|
||||||
|
else
|
||||||
|
ECORE_WIN32_INC =
|
||||||
|
ECORE_WIN32_LIB =
|
||||||
|
ECORE_WIN32_LDF =
|
||||||
|
endif
|
||||||
|
|
||||||
if BUILD_ECORE_SDL
|
if BUILD_ECORE_SDL
|
||||||
ECORE_SDL_INC = -I$(top_srcdir)/src/lib/ecore_sdl
|
ECORE_SDL_INC = -I$(top_srcdir)/src/lib/ecore_sdl
|
||||||
ECORE_SDL_LIB = $(top_builddir)/src/lib/ecore_sdl/libecore_sdl.la
|
ECORE_SDL_LIB = $(top_builddir)/src/lib/ecore_sdl/libecore_sdl.la
|
||||||
|
@ -48,6 +58,7 @@ INCLUDES = \
|
||||||
$(ECORE_X_INC) \
|
$(ECORE_X_INC) \
|
||||||
$(ECORE_FB_INC) \
|
$(ECORE_FB_INC) \
|
||||||
$(ECORE_DIRECTFB_INC) \
|
$(ECORE_DIRECTFB_INC) \
|
||||||
|
$(ECORE_WIN32_INC) \
|
||||||
$(ECORE_SDL_INC) \
|
$(ECORE_SDL_INC) \
|
||||||
@EVAS_CFLAGS@ \
|
@EVAS_CFLAGS@ \
|
||||||
@XCB_CFLAGS@
|
@XCB_CFLAGS@
|
||||||
|
@ -56,6 +67,7 @@ libecore_evas_la_LDFLAGS = -version-info 1:0:0 \
|
||||||
$(ECORE_X_LDF) \
|
$(ECORE_X_LDF) \
|
||||||
$(ECORE_FB_LDF) \
|
$(ECORE_FB_LDF) \
|
||||||
$(ECORE_DIRECTFB_LDF) \
|
$(ECORE_DIRECTFB_LDF) \
|
||||||
|
$(ECORE_WIN32_LDF) \
|
||||||
$(ECORE_SDL_LDF) \
|
$(ECORE_SDL_LDF) \
|
||||||
-L$(top_builddir)/src/lib/ecore/.libs
|
-L$(top_builddir)/src/lib/ecore/.libs
|
||||||
|
|
||||||
|
@ -72,21 +84,25 @@ ecore_evas_x.c \
|
||||||
ecore_evas_fb.c \
|
ecore_evas_fb.c \
|
||||||
ecore_evas_buffer.c \
|
ecore_evas_buffer.c \
|
||||||
ecore_evas_directfb.c \
|
ecore_evas_directfb.c \
|
||||||
|
ecore_evas_win32.c \
|
||||||
ecore_evas_sdl.c
|
ecore_evas_sdl.c
|
||||||
|
|
||||||
libecore_evas_la_LIBADD = \
|
libecore_evas_la_LIBADD = \
|
||||||
$(ECORE_X_LIB) \
|
$(ECORE_X_LIB) \
|
||||||
$(ECORE_FB_LIB) \
|
$(ECORE_FB_LIB) \
|
||||||
$(ECORE_DIRECTFB_LIB) \
|
$(ECORE_DIRECTFB_LIB) \
|
||||||
|
$(ECORE_WIN32_LIB) \
|
||||||
$(ECORE_SDL_LIB) \
|
$(ECORE_SDL_LIB) \
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la \
|
$(top_builddir)/src/lib/ecore/libecore.la \
|
||||||
@EVAS_LIBS@ \
|
@EVAS_LIBS@ \
|
||||||
@XCB_LIBS@
|
@XCB_LIBS@ \
|
||||||
|
@create_shared_lib@
|
||||||
|
|
||||||
libecore_evas_la_DEPENDENCIES = \
|
libecore_evas_la_DEPENDENCIES = \
|
||||||
$(ECORE_X_LIB) \
|
$(ECORE_X_LIB) \
|
||||||
$(ECORE_FB_LIB) \
|
$(ECORE_FB_LIB) \
|
||||||
$(ECORE_DIRECTFB_LIB) \
|
$(ECORE_DIRECTFB_LIB) \
|
||||||
|
$(ECORE_WIN32_LIB) \
|
||||||
$(ECORE_SDL_LIB) \
|
$(ECORE_SDL_LIB) \
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la
|
$(top_builddir)/src/lib/ecore/libecore.la
|
||||||
|
|
||||||
|
@ -99,4 +115,5 @@ ecore_evas_x.c \
|
||||||
ecore_evas_fb.c \
|
ecore_evas_fb.c \
|
||||||
ecore_evas_buffer.c \
|
ecore_evas_buffer.c \
|
||||||
ecore_evas_directfb.c \
|
ecore_evas_directfb.c \
|
||||||
|
ecore_evas_win32.c \
|
||||||
ecore_evas_sdl.c
|
ecore_evas_sdl.c
|
||||||
|
|
|
@ -1726,7 +1726,7 @@ ecore_evas_ignore_events_get(Ecore_Evas *ee)
|
||||||
return ee->ignore_events ? 1 : 0;
|
return ee->ignore_events ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
/* fps debug calls - for debugging how much time your app actually spends */
|
/* fps debug calls - for debugging how much time your app actually spends */
|
||||||
/* rendering graphics... :) */
|
/* rendering graphics... :) */
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
#ifdef BUILD_ECORE_EVAS_BUFFER
|
#ifdef BUILD_ECORE_EVAS_BUFFER
|
||||||
static int _ecore_evas_init_count = 0;
|
static int _ecore_evas_init_count = 0;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
static int _ecore_evas_fps_debug = 0;
|
static int _ecore_evas_fps_debug = 0;
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
static Ecore_Evas *ecore_evases = NULL;
|
static Ecore_Evas *ecore_evases = NULL;
|
||||||
|
|
||||||
|
@ -24,8 +26,10 @@ _ecore_evas_buffer_init(void)
|
||||||
{
|
{
|
||||||
_ecore_evas_init_count++;
|
_ecore_evas_init_count++;
|
||||||
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
||||||
|
#ifndef _WIN32
|
||||||
if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
|
if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
|
||||||
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
|
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
|
||||||
|
#endif /* _WIN32 */
|
||||||
return _ecore_evas_init_count;
|
return _ecore_evas_init_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +99,9 @@ _ecore_evas_buffer_shutdown(void)
|
||||||
{
|
{
|
||||||
_ecore_evas_free((Ecore_Evas *)ecore_evases);
|
_ecore_evas_free((Ecore_Evas *)ecore_evases);
|
||||||
}
|
}
|
||||||
|
#ifndef _WIN32
|
||||||
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
|
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
|
||||||
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
||||||
return _ecore_evas_init_count;
|
return _ecore_evas_init_count;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -61,6 +61,16 @@
|
||||||
#ifdef BUILD_ECORE_EVAS_BUFFER
|
#ifdef BUILD_ECORE_EVAS_BUFFER
|
||||||
# include <Evas_Engine_Buffer.h>
|
# include <Evas_Engine_Buffer.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef BUILD_ECORE_WIN32
|
||||||
|
# include "Ecore_Win32.h"
|
||||||
|
# ifdef HAVE_DIRECTDRAW
|
||||||
|
# include <Evas_Engine_Software_DDraw.h>
|
||||||
|
# endif
|
||||||
|
# ifdef HAVE_DIRECT3D
|
||||||
|
# include <Evas_Engine_Direct3D.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define IDLE_FLUSH_TIME 0.5
|
#define IDLE_FLUSH_TIME 0.5
|
||||||
|
|
||||||
|
@ -168,6 +178,13 @@ struct _Ecore_Evas_Engine
|
||||||
Ecore_DirectFB_Window *window;
|
Ecore_DirectFB_Window *window;
|
||||||
} directfb;
|
} directfb;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef BUILD_ECORE_WIN32
|
||||||
|
struct {
|
||||||
|
Ecore_Win32_Window *parent;
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
} win32;
|
||||||
|
#endif
|
||||||
|
|
||||||
Ecore_Timer *idle_flush_timer;
|
Ecore_Timer *idle_flush_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
/* static Ecore_List *ecore_evas_input_devices = NULL; */
|
/* static Ecore_List *ecore_evas_input_devices = NULL; */
|
||||||
|
|
||||||
static int _ecore_evas_init_count = 0;
|
static int _ecore_evas_init_count = 0;
|
||||||
|
#ifndef _WIN32
|
||||||
static int _ecore_evas_fps_debug = 0;
|
static int _ecore_evas_fps_debug = 0;
|
||||||
|
#endif /* _WIN32 */
|
||||||
static Ecore_Evas *ecore_evases = NULL;
|
static Ecore_Evas *ecore_evases = NULL;
|
||||||
static Ecore_Event_Handler *ecore_evas_event_handlers[10] = {
|
static Ecore_Event_Handler *ecore_evas_event_handlers[10] = {
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||||
|
@ -216,10 +218,12 @@ _ecore_evas_idle_enter(void *data __UNUSED__)
|
||||||
double t1 = 0.;
|
double t1 = 0.;
|
||||||
double t2 = 0.;
|
double t2 = 0.;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
if (_ecore_evas_fps_debug)
|
if (_ecore_evas_fps_debug)
|
||||||
{
|
{
|
||||||
t1 = ecore_time_get();
|
t1 = ecore_time_get();
|
||||||
}
|
}
|
||||||
|
#endif /* _WIN32 */
|
||||||
for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
|
for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
|
||||||
{
|
{
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
@ -236,11 +240,13 @@ _ecore_evas_idle_enter(void *data __UNUSED__)
|
||||||
else
|
else
|
||||||
evas_norender(ee->evas);
|
evas_norender(ee->evas);
|
||||||
}
|
}
|
||||||
|
#ifndef _WIN32
|
||||||
if (_ecore_evas_fps_debug)
|
if (_ecore_evas_fps_debug)
|
||||||
{
|
{
|
||||||
t2 = ecore_time_get();
|
t2 = ecore_time_get();
|
||||||
_ecore_evas_fps_debug_rendertime_add(t2 - t1);
|
_ecore_evas_fps_debug_rendertime_add(t2 - t1);
|
||||||
}
|
}
|
||||||
|
#endif /* _WIN32 */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,10 +264,14 @@ _ecore_evas_sdl_init(int w, int h)
|
||||||
_ecore_evas_init_count++;
|
_ecore_evas_init_count++;
|
||||||
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
|
if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
|
||||||
|
#endif /* _WIN32 */
|
||||||
ecore_evas_idle_enterer = ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
|
ecore_evas_idle_enterer = ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
|
||||||
ecore_evas_event = ecore_timer_add(0.008, _ecore_evas_sdl_event, NULL);
|
ecore_evas_event = ecore_timer_add(0.008, _ecore_evas_sdl_event, NULL);
|
||||||
|
#ifndef _WIN32
|
||||||
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
|
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_SDL_EVENT_KEY_DOWN, _ecore_evas_sdl_event_key_down, NULL);
|
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_SDL_EVENT_KEY_DOWN, _ecore_evas_sdl_event_key_down, NULL);
|
||||||
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_SDL_EVENT_KEY_UP, _ecore_evas_sdl_event_key_up, NULL);
|
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_SDL_EVENT_KEY_UP, _ecore_evas_sdl_event_key_up, NULL);
|
||||||
|
@ -292,7 +302,9 @@ _ecore_evas_sdl_shutdown(void)
|
||||||
ecore_evas_idle_enterer = NULL;
|
ecore_evas_idle_enterer = NULL;
|
||||||
ecore_timer_del(ecore_evas_event);
|
ecore_timer_del(ecore_evas_event);
|
||||||
ecore_evas_event = NULL;
|
ecore_evas_event = NULL;
|
||||||
|
#ifndef _WIN32
|
||||||
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
|
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
|
||||||
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
||||||
return _ecore_evas_init_count;
|
return _ecore_evas_init_count;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#elif WIN32
|
#elif _WIN32
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DLT_ZERO 0
|
#define DLT_ZERO 0
|
||||||
|
|
|
@ -20,7 +20,7 @@ Ecore_Sdl_Keys.h
|
||||||
|
|
||||||
libecore_sdl_la_LIBADD = \
|
libecore_sdl_la_LIBADD = \
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la \
|
$(top_builddir)/src/lib/ecore/libecore.la \
|
||||||
@sdl_libs@
|
@sdl_libs@ @create_shared_lib@
|
||||||
|
|
||||||
libecore_sdl_la_DEPENDENCIES = \
|
libecore_sdl_la_DEPENDENCIES = \
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la
|
$(top_builddir)/src/lib/ecore/libecore.la
|
||||||
|
|
|
@ -0,0 +1,292 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ECORE_WIN32_H__
|
||||||
|
#define __ECORE_WIN32_H__
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef EAPI
|
||||||
|
# undef EAPI
|
||||||
|
#endif
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# ifdef BUILDING_DLL
|
||||||
|
# define EAPI __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define EAPI __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifdef __GNUC__
|
||||||
|
# if __GNUC__ >= 4
|
||||||
|
# define EAPI __attribute__ ((visibility("default")))
|
||||||
|
# else
|
||||||
|
# define EAPI
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# define EAPI
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
typedef void Ecore_Win32_Window;
|
||||||
|
typedef void Ecore_Win32_DDraw_Object;
|
||||||
|
typedef void Ecore_Win32_DDraw_Surface;
|
||||||
|
typedef void Ecore_Win32_Direct3D_Object;
|
||||||
|
typedef void Ecore_Win32_Direct3D_Device;
|
||||||
|
typedef void Ecore_Win32_Direct3D_Sprite;
|
||||||
|
typedef void Ecore_Win32_Direct3D_Texture;
|
||||||
|
|
||||||
|
/* Events */
|
||||||
|
|
||||||
|
typedef struct _Ecore_Win32_Event_Key_Down Ecore_Win32_Event_Key_Down;
|
||||||
|
typedef struct _Ecore_Win32_Event_Key_Up Ecore_Win32_Event_Key_Up;
|
||||||
|
typedef struct _Ecore_Win32_Event_Mouse_Button_Down Ecore_Win32_Event_Mouse_Button_Down;
|
||||||
|
typedef struct _Ecore_Win32_Event_Mouse_Button_Up Ecore_Win32_Event_Mouse_Button_Up;
|
||||||
|
typedef struct _Ecore_Win32_Event_Mouse_Move Ecore_Win32_Event_Mouse_Move;
|
||||||
|
typedef struct _Ecore_Win32_Event_Mouse_In Ecore_Win32_Event_Mouse_In;
|
||||||
|
typedef struct _Ecore_Win32_Event_Mouse_Out Ecore_Win32_Event_Mouse_Out;
|
||||||
|
typedef struct _Ecore_Win32_Event_Window_Focus_In Ecore_Win32_Event_Window_Focus_In;
|
||||||
|
typedef struct _Ecore_Win32_Event_Window_Focus_Out Ecore_Win32_Event_Window_Focus_Out;
|
||||||
|
typedef struct _Ecore_Win32_Event_Window_Damage Ecore_Win32_Event_Window_Damage;
|
||||||
|
typedef struct _Ecore_Win32_Event_Window_Destroy Ecore_Win32_Event_Window_Destroy;
|
||||||
|
typedef struct _Ecore_Win32_Event_Window_Hide Ecore_Win32_Event_Window_Hide;
|
||||||
|
typedef struct _Ecore_Win32_Event_Window_Show Ecore_Win32_Event_Window_Show;
|
||||||
|
typedef struct _Ecore_Win32_Event_Window_Delete Ecore_Win32_Event_Window_Delete;
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Key_Down
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
char *keyname;
|
||||||
|
char *keysymbol;
|
||||||
|
char *keycompose;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Key_Up
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
char *keyname;
|
||||||
|
char *keysymbol;
|
||||||
|
char *keycompose;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Mouse_Button_Down
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
int button;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
double time;
|
||||||
|
unsigned int double_click : 1;
|
||||||
|
unsigned int triple_click : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Mouse_Button_Up
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
int button;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
double time;
|
||||||
|
unsigned int double_click : 1;
|
||||||
|
unsigned int triple_click : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Mouse_Move
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Mouse_In
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Mouse_Out
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Window_Focus_In
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Window_Focus_Out
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Window_Damage
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Window_Destroy
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Window_Hide
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Window_Show
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Event_Window_Delete
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
double time;
|
||||||
|
};
|
||||||
|
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_KEY_DOWN;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_KEY_UP;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_MOUSE_BUTTON_UP;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_MOUSE_MOVE;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW;
|
||||||
|
EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE;
|
||||||
|
|
||||||
|
|
||||||
|
/* Core */
|
||||||
|
EAPI int ecore_win32_init();
|
||||||
|
EAPI int ecore_win32_shutdown();
|
||||||
|
EAPI double ecore_win32_current_time_get(void);
|
||||||
|
EAPI void ecore_win32_message_loop_begin (void);
|
||||||
|
|
||||||
|
/* Window */
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_del(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
|
||||||
|
int x,
|
||||||
|
int y);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
|
||||||
|
int *width,
|
||||||
|
int *height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
|
||||||
|
int min_width,
|
||||||
|
int min_height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
|
||||||
|
int max_width,
|
||||||
|
int max_height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
|
||||||
|
int base_width,
|
||||||
|
int base_height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
|
||||||
|
int step_width,
|
||||||
|
int step_height);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
|
||||||
|
const char *title);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_focus_set(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
|
||||||
|
int on);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
||||||
|
int on);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||||
|
int on);
|
||||||
|
|
||||||
|
/* DirectDraw */
|
||||||
|
|
||||||
|
EAPI int ecore_win32_ddraw_init(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_ddraw_shutdown(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_DDraw_Object *ecore_win32_ddraw_object_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_DDraw_Surface *ecore_win32_ddraw_surface_primary_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_DDraw_Surface *ecore_win32_ddraw_surface_back_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI int ecore_win32_ddraw_depth_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
/* Direct3D */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EAPI int ecore_win32_direct3d_init(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI void ecore_win32_direct3d_shutdown(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Object *ecore_win32_direct3d_object_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Device *ecore_win32_direct3d_device_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Sprite *ecore_win32_direct3d_sprite_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Texture *ecore_win32_direct3d_texture_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
EAPI int ecore_win32_direct3d_depth_get(Ecore_Win32_Window *window);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __ECORE_WIN32_H__ */
|
|
@ -0,0 +1,40 @@
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
|
INCLUDES = \
|
||||||
|
-I$(top_srcdir)/src/lib/ecore \
|
||||||
|
-I$(top_builddir)/src/lib/ecore
|
||||||
|
|
||||||
|
libecore_win32_la_LDFLAGS = \
|
||||||
|
-version-info 1:0:0 \
|
||||||
|
-L$(top_builddir)/src/lib/ecore/.libs
|
||||||
|
|
||||||
|
|
||||||
|
if BUILD_ECORE_WIN32
|
||||||
|
|
||||||
|
lib_LTLIBRARIES = libecore_win32.la
|
||||||
|
include_HEADERS = \
|
||||||
|
Ecore_Win32.h
|
||||||
|
|
||||||
|
libecore_win32_la_SOURCES = \
|
||||||
|
ecore_win32.c \
|
||||||
|
ecore_win32_direct3d.cpp \
|
||||||
|
ecore_win32_ddraw.c \
|
||||||
|
ecore_win32_event.c \
|
||||||
|
ecore_win32_window.c \
|
||||||
|
ecore_win32_private.h
|
||||||
|
|
||||||
|
libecore_win32_la_LIBADD = \
|
||||||
|
@ddraw_libs@ @direct3d_libs@ \
|
||||||
|
@create_shared_lib@ -lwsock32 \
|
||||||
|
$(top_builddir)/src/lib/ecore/libecore.la
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
Ecore_Win32.h \
|
||||||
|
ecore_win32.c \
|
||||||
|
ecore_win32_direct3d.cpp \
|
||||||
|
ecore_win32_ddraw.c \
|
||||||
|
ecore_win32_event.c \
|
||||||
|
ecore_win32_window.c \
|
||||||
|
ecore_win32_private.h
|
|
@ -0,0 +1,348 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <windowsx.h>
|
||||||
|
|
||||||
|
#include "Ecore.h"
|
||||||
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
<raster> hmmm
|
||||||
|
<raster> yeah window's way of doing eventys is very different
|
||||||
|
<raster> not select + timeout
|
||||||
|
<raster> to doa timeout u need to queue up a timed message
|
||||||
|
<raster> for timers
|
||||||
|
<raster> etc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* typedef LRESULT CALLBACK _ecore_win32_event_callback(HWND, UINT, WPARAM, LPARAM); */
|
||||||
|
|
||||||
|
Ecore_List *_ecore_win32_windows_list = NULL;
|
||||||
|
HINSTANCE _ecore_win32_instance = NULL;
|
||||||
|
double _ecore_win32_double_click_time = 0.25;
|
||||||
|
double _ecore_win32_event_last_time = 0.0;
|
||||||
|
Ecore_Win32_Window *_ecore_win32_event_last_window = NULL;
|
||||||
|
|
||||||
|
static int _ecore_win32_init_count = 0;
|
||||||
|
|
||||||
|
|
||||||
|
LRESULT CALLBACK
|
||||||
|
_ecore_win32_window_procedure(HWND window,
|
||||||
|
UINT message,
|
||||||
|
WPARAM window_param,
|
||||||
|
LPARAM data_param)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Callback_Data *data;
|
||||||
|
POINTS pt;
|
||||||
|
DWORD coord;
|
||||||
|
|
||||||
|
data = (Ecore_Win32_Callback_Data *)malloc(sizeof(Ecore_Win32_Callback_Data));
|
||||||
|
if (!data) return DefWindowProc(window, message, window_param, data_param);
|
||||||
|
|
||||||
|
data->window = window;
|
||||||
|
data->message = message;
|
||||||
|
data->window_param = window_param;
|
||||||
|
data->data_param = data_param;
|
||||||
|
data->time = GetMessageTime();
|
||||||
|
coord = GetMessagePos();
|
||||||
|
pt = MAKEPOINTS(coord);
|
||||||
|
data->x = pt.x;
|
||||||
|
data->y = pt.y;
|
||||||
|
|
||||||
|
switch (data->message)
|
||||||
|
{
|
||||||
|
case WM_KEYDOWN:
|
||||||
|
printf (" * ecore message : keystroke down\n");
|
||||||
|
_ecore_win32_event_handle_key_press(data, 1);
|
||||||
|
return 0;
|
||||||
|
case WM_CHAR:
|
||||||
|
_ecore_win32_event_handle_key_press(data, 0);
|
||||||
|
return 0;
|
||||||
|
case WM_KEYUP:
|
||||||
|
printf (" * ecore message : keystroke up\n");
|
||||||
|
_ecore_win32_event_handle_key_release(data, 1);
|
||||||
|
return 0;
|
||||||
|
case WM_LBUTTONDOWN:
|
||||||
|
printf (" * ecore message : lbuttondown\n");
|
||||||
|
_ecore_win32_event_handle_button_press(data, 1);
|
||||||
|
return 0;
|
||||||
|
case WM_MBUTTONDOWN:
|
||||||
|
printf (" * ecore message : mbuttondown\n");
|
||||||
|
_ecore_win32_event_handle_button_press(data, 2);
|
||||||
|
return 0;
|
||||||
|
case WM_RBUTTONDOWN:
|
||||||
|
printf (" * ecore message : rbuttondown\n");
|
||||||
|
_ecore_win32_event_handle_button_press(data, 3);
|
||||||
|
return 0;
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
printf (" * ecore message : lbuttonup\n");
|
||||||
|
_ecore_win32_event_handle_button_release(data, 1);
|
||||||
|
return 0;
|
||||||
|
case WM_MBUTTONUP:
|
||||||
|
printf (" * ecore message : mbuttonup\n");
|
||||||
|
_ecore_win32_event_handle_button_release(data, 2);
|
||||||
|
return 0;
|
||||||
|
case WM_RBUTTONUP:
|
||||||
|
printf (" * ecore message : rbuttonup\n");
|
||||||
|
_ecore_win32_event_handle_button_release(data, 3);
|
||||||
|
return 0;
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
struct _Ecore_Win32_Window *w = NULL;
|
||||||
|
|
||||||
|
ecore_list_first_goto(_ecore_win32_windows_list);
|
||||||
|
while ((w = ecore_list_next(_ecore_win32_windows_list)))
|
||||||
|
{
|
||||||
|
if (w->window == window)
|
||||||
|
{
|
||||||
|
ecore_list_remove(_ecore_win32_windows_list);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetClientRect(window, &rect))
|
||||||
|
{
|
||||||
|
POINT pt;
|
||||||
|
|
||||||
|
pt.x = GET_X_LPARAM(data_param);
|
||||||
|
pt.y = GET_Y_LPARAM(data_param);
|
||||||
|
if (!PtInRect(&rect, pt))
|
||||||
|
{
|
||||||
|
if (w->pointer_is_in)
|
||||||
|
{
|
||||||
|
w->pointer_is_in = 0;
|
||||||
|
_ecore_win32_event_handle_leave_notify(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!w->pointer_is_in)
|
||||||
|
{
|
||||||
|
w->pointer_is_in = 1;
|
||||||
|
_ecore_win32_event_handle_enter_notify(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ecore_win32_event_handle_motion_notify(data);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
case WM_DESTROY:
|
||||||
|
printf (" * ecore message : destroy\n");
|
||||||
|
_ecore_win32_event_handle_destroy_notify(data);
|
||||||
|
return 0;
|
||||||
|
case WM_SHOWWINDOW:
|
||||||
|
printf (" * ecore message : show\n");
|
||||||
|
if ((data->data_param == SW_OTHERUNZOOM) ||
|
||||||
|
(data->data_param == SW_OTHERUNZOOM))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (data->window_param)
|
||||||
|
_ecore_win32_event_handle_map_notify(data);
|
||||||
|
else
|
||||||
|
_ecore_win32_event_handle_unmap_notify(data);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
case WM_PAINT:
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
|
printf (" * ecore message : paint\n");
|
||||||
|
if (GetUpdateRect(window, &rect, FALSE))
|
||||||
|
{
|
||||||
|
PAINTSTRUCT ps;
|
||||||
|
HDC hdc;
|
||||||
|
|
||||||
|
hdc = BeginPaint(window, &ps);
|
||||||
|
EndPaint(window, &ps);
|
||||||
|
printf ("%ld %ld %ld %ld\n",
|
||||||
|
rect.left,
|
||||||
|
rect.top,
|
||||||
|
rect.right - rect.left,
|
||||||
|
rect.bottom - rect.top);
|
||||||
|
data->update = rect;
|
||||||
|
_ecore_win32_event_handle_expose(data);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
case WM_CLOSE:
|
||||||
|
printf (" * ecore message : close\n");
|
||||||
|
_ecore_win32_event_handle_delete(data);
|
||||||
|
return 0;
|
||||||
|
case WM_SETFOCUS:
|
||||||
|
printf (" * ecore message : focus in\n");
|
||||||
|
_ecore_win32_event_handle_focus_in(data);
|
||||||
|
return 0;
|
||||||
|
case WM_KILLFOCUS:
|
||||||
|
printf (" * ecore message : focus out\n");
|
||||||
|
_ecore_win32_event_handle_focus_out(data);
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return DefWindowProc(window, message, window_param, data_param);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
Events:
|
||||||
|
|
||||||
|
x * key down
|
||||||
|
* key sys down
|
||||||
|
x * key up
|
||||||
|
* key sys up
|
||||||
|
x * mouse button down left
|
||||||
|
x * mouse button down middle
|
||||||
|
x * mouse button down right
|
||||||
|
x * mouse button up left
|
||||||
|
x * mouse button up middle
|
||||||
|
x * mouse button up right
|
||||||
|
* mouse move (contains enter)
|
||||||
|
* mouse leave
|
||||||
|
* focus in
|
||||||
|
* focus out
|
||||||
|
* expose
|
||||||
|
* create
|
||||||
|
* destroy
|
||||||
|
* resize
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
EAPI int ECORE_WIN32_EVENT_KEY_DOWN = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_KEY_UP = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_MOUSE_BUTTON_UP = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_MOUSE_MOVE = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_MOUSE_IN = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_MOUSE_OUT = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_WINDOW_DAMAGE = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_WINDOW_DESTROY = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_WINDOW_SHOW = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_WINDOW_HIDE = 0;
|
||||||
|
EAPI int ECORE_WIN32_EVENT_WINDOW_DELETE = 0;
|
||||||
|
|
||||||
|
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_init()
|
||||||
|
{
|
||||||
|
WNDCLASS wc;
|
||||||
|
|
||||||
|
if (_ecore_win32_init_count > 0)
|
||||||
|
{
|
||||||
|
_ecore_win32_init_count++;
|
||||||
|
return _ecore_win32_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ecore_win32_instance = GetModuleHandle(0);
|
||||||
|
if (!_ecore_win32_instance)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
memset (&wc, 0, sizeof (WNDCLASS));
|
||||||
|
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wc.lpfnWndProc = _ecore_win32_window_procedure;
|
||||||
|
wc.cbClsExtra = 0;
|
||||||
|
wc.cbWndExtra = 0;
|
||||||
|
wc.hInstance = _ecore_win32_instance;
|
||||||
|
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
|
||||||
|
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||||
|
wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
|
||||||
|
wc.lpszMenuName = NULL;
|
||||||
|
wc.lpszClassName = ECORE_WIN32_WINDOW_CLASS;
|
||||||
|
|
||||||
|
if(!RegisterClass(&wc))
|
||||||
|
{
|
||||||
|
UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance);
|
||||||
|
FreeLibrary(_ecore_win32_instance);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ecore_win32_windows_list = ecore_list_new();
|
||||||
|
if (!_ecore_win32_windows_list)
|
||||||
|
{
|
||||||
|
UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance);
|
||||||
|
FreeLibrary(_ecore_win32_instance);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ECORE_WIN32_EVENT_KEY_DOWN)
|
||||||
|
{
|
||||||
|
ECORE_WIN32_EVENT_KEY_DOWN = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_KEY_UP = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_MOUSE_MOVE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_MOUSE_IN = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_MOUSE_OUT = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_DAMAGE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_DESTROY = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_SHOW = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_HIDE = ecore_event_type_new();
|
||||||
|
ECORE_WIN32_EVENT_WINDOW_DELETE = ecore_event_type_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
_ecore_win32_init_count++;
|
||||||
|
|
||||||
|
return _ecore_win32_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_shutdown()
|
||||||
|
{
|
||||||
|
_ecore_win32_init_count++;
|
||||||
|
if (_ecore_win32_init_count > 0) return _ecore_win32_init_count;
|
||||||
|
if (!_ecore_win32_instance) return _ecore_win32_init_count;
|
||||||
|
|
||||||
|
ecore_list_destroy(_ecore_win32_windows_list);
|
||||||
|
|
||||||
|
UnregisterClass(ECORE_WIN32_WINDOW_CLASS, _ecore_win32_instance);
|
||||||
|
FreeLibrary(_ecore_win32_instance);
|
||||||
|
_ecore_win32_instance = NULL;
|
||||||
|
|
||||||
|
if (_ecore_win32_init_count < 0) _ecore_win32_init_count = 0;
|
||||||
|
|
||||||
|
return _ecore_win32_init_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the timeout for a double and triple clicks to be flagged.
|
||||||
|
*
|
||||||
|
* This sets the time between clicks before the double_click flag is
|
||||||
|
* set in a button down event. If 3 clicks occur within double this
|
||||||
|
* time, the triple_click flag is also set.
|
||||||
|
*
|
||||||
|
* @param t The time in seconds
|
||||||
|
*/
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_double_click_time_set(double t)
|
||||||
|
{
|
||||||
|
if (t < 0.0) t = 0.0;
|
||||||
|
_ecore_win32_double_click_time = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the double and triple click flag timeout.
|
||||||
|
*
|
||||||
|
* See @ref ecore_win32_double_click_time_set for more information.
|
||||||
|
*
|
||||||
|
* @return The timeout for double clicks in seconds.
|
||||||
|
*/
|
||||||
|
EAPI double
|
||||||
|
ecore_win32_double_click_time_get(void)
|
||||||
|
{
|
||||||
|
return _ecore_win32_double_click_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the last event time
|
||||||
|
*/
|
||||||
|
EAPI double
|
||||||
|
ecore_win32_current_time_get(void)
|
||||||
|
{
|
||||||
|
return _ecore_win32_event_last_time;
|
||||||
|
}
|
|
@ -0,0 +1,165 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "ecore_win32_private.h"
|
||||||
|
#include "Ecore_Win32.h"
|
||||||
|
|
||||||
|
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_ddraw_init(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECTDRAW
|
||||||
|
DDSURFACEDESC2 surface_desc;
|
||||||
|
DDPIXELFORMAT pixel_format;
|
||||||
|
RECT rect;
|
||||||
|
DDSURFACEDESC2 *sd;
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
|
||||||
|
if (FAILED(DirectDrawCreateEx(0, (void **)&w->ddraw.object,
|
||||||
|
&IID_IDirectDraw7, NULL)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (FAILED(IDirectDraw7_SetCooperativeLevel(w->ddraw.object,
|
||||||
|
w->window, DDSCL_NORMAL)))
|
||||||
|
goto no_coop_level;
|
||||||
|
|
||||||
|
if (FAILED(IDirectDraw7_CreateClipper(w->ddraw.object, 0,
|
||||||
|
&w->ddraw.clipper, NULL)))
|
||||||
|
goto no_clipper;
|
||||||
|
|
||||||
|
if (FAILED(IDirectDrawClipper_SetHWnd(w->ddraw.clipper, 0, w->window)))
|
||||||
|
goto no_clipper_set_window;
|
||||||
|
|
||||||
|
memset (&surface_desc, 0, sizeof (surface_desc));
|
||||||
|
surface_desc.dwSize = sizeof (surface_desc);
|
||||||
|
surface_desc.dwFlags = DDSD_CAPS;
|
||||||
|
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
|
||||||
|
|
||||||
|
/* Hack to cleanly remove a warning */
|
||||||
|
sd = &surface_desc;
|
||||||
|
if (FAILED(IDirectDraw7_CreateSurface(w->ddraw.object,
|
||||||
|
(DDSURFACEDESC *)sd,
|
||||||
|
&w->ddraw.surface_primary,
|
||||||
|
NULL)))
|
||||||
|
goto no_primary_surf;
|
||||||
|
|
||||||
|
if (FAILED(IDirectDrawSurface7_SetClipper(w->ddraw.surface_primary,
|
||||||
|
w->ddraw.clipper)))
|
||||||
|
goto no_primary_surf_set_clipper;
|
||||||
|
|
||||||
|
if (!GetClientRect(w->window, &rect))
|
||||||
|
goto no_get_client;
|
||||||
|
|
||||||
|
memset (&surface_desc, 0, sizeof (surface_desc));
|
||||||
|
surface_desc.dwSize = sizeof (surface_desc);
|
||||||
|
surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
|
||||||
|
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
||||||
|
surface_desc.dwWidth = rect.right - rect.left;
|
||||||
|
surface_desc.dwHeight = rect.bottom - rect.top;
|
||||||
|
|
||||||
|
/* Hack to cleanly remove a warning */
|
||||||
|
sd = &surface_desc;
|
||||||
|
if (FAILED(IDirectDraw7_CreateSurface(w->ddraw.object,
|
||||||
|
(DDSURFACEDESC *)sd,
|
||||||
|
&w->ddraw.surface_back,
|
||||||
|
NULL)))
|
||||||
|
goto no_back_surf;
|
||||||
|
|
||||||
|
ZeroMemory(&pixel_format, sizeof(pixel_format));
|
||||||
|
pixel_format.dwSize = sizeof(pixel_format);
|
||||||
|
|
||||||
|
if (FAILED(IDirectDrawSurface7_GetPixelFormat(w->ddraw.surface_primary,
|
||||||
|
&pixel_format)))
|
||||||
|
goto no_get_pix_fmt;
|
||||||
|
|
||||||
|
w->ddraw.depth = pixel_format.dwRGBBitCount;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
no_get_pix_fmt:
|
||||||
|
/* no need to release the back surface. the next call free its memory */
|
||||||
|
no_back_surf:
|
||||||
|
no_get_client:
|
||||||
|
no_primary_surf_set_clipper:
|
||||||
|
IDirectDrawSurface7_Release(w->ddraw.surface_primary);
|
||||||
|
no_primary_surf:
|
||||||
|
no_clipper_set_window:
|
||||||
|
IDirectDrawClipper_Release(w->ddraw.clipper);
|
||||||
|
no_clipper:
|
||||||
|
no_coop_level:
|
||||||
|
IDirectDraw7_Release(w->ddraw.object);
|
||||||
|
#endif /* HAVE_DIRECTDRAW */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_ddraw_shutdown(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECTDRAW
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window)
|
||||||
|
return;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
|
||||||
|
if (w->ddraw.surface_primary)
|
||||||
|
IDirectDrawSurface7_Release(w->ddraw.surface_primary);
|
||||||
|
|
||||||
|
/* no need to release the back surface. the previous call free its memory */
|
||||||
|
|
||||||
|
if (w->ddraw.clipper)
|
||||||
|
IDirectDrawClipper_Release(w->ddraw.clipper);
|
||||||
|
|
||||||
|
if (w->ddraw.object)
|
||||||
|
IDirectDraw7_Release(w->ddraw.object);
|
||||||
|
#endif /* HAVE_DIRECTDRAW */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_DDraw_Object *
|
||||||
|
ecore_win32_ddraw_object_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECTDRAW
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->ddraw.object;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_DIRECTDRAW */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_DDraw_Surface *
|
||||||
|
ecore_win32_ddraw_surface_primary_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECTDRAW
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->ddraw.surface_primary;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_DIRECTDRAW */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_DDraw_Surface *
|
||||||
|
ecore_win32_ddraw_surface_back_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECTDRAW
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->ddraw.surface_back;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_DIRECTDRAW */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_ddraw_depth_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECTDRAW
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->ddraw.depth;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif /* HAVE_DIRECTDRAW */
|
||||||
|
}
|
|
@ -0,0 +1,193 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "ecore_win32_private.h"
|
||||||
|
#include "Ecore_Win32.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_direct3d_init(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
D3DPRESENT_PARAMETERS pp;
|
||||||
|
D3DDISPLAYMODE dm;
|
||||||
|
D3DSURFACE_DESC sd;
|
||||||
|
D3DCAPS9 caps;
|
||||||
|
RECT rect;
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
DWORD flag;
|
||||||
|
|
||||||
|
if (!window)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
|
||||||
|
w->d3d.object = Direct3DCreate9 (D3D_SDK_VERSION);
|
||||||
|
if (!w->d3d.object)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (FAILED (w->d3d.object->GetAdapterDisplayMode (D3DADAPTER_DEFAULT,
|
||||||
|
&dm)))
|
||||||
|
goto no_get_adapter;
|
||||||
|
|
||||||
|
if (FAILED (w->d3d.object->GetDeviceCaps (D3DADAPTER_DEFAULT,
|
||||||
|
D3DDEVTYPE_HAL,
|
||||||
|
&caps)))
|
||||||
|
goto no_caps;
|
||||||
|
|
||||||
|
if (!GetClientRect(w->window, &rect))
|
||||||
|
goto no_get_client;
|
||||||
|
|
||||||
|
flag = (caps.VertexProcessingCaps != 0)
|
||||||
|
? D3DCREATE_HARDWARE_VERTEXPROCESSING
|
||||||
|
: D3DCREATE_SOFTWARE_VERTEXPROCESSING;
|
||||||
|
|
||||||
|
ZeroMemory(&pp, sizeof(pp));
|
||||||
|
pp.BackBufferWidth = rect.right - rect.left;
|
||||||
|
pp.BackBufferHeight = rect.bottom - rect.top;
|
||||||
|
pp.BackBufferFormat = dm.Format;
|
||||||
|
pp.BackBufferCount = 1;
|
||||||
|
pp.MultiSampleType = D3DMULTISAMPLE_NONE;
|
||||||
|
pp.MultiSampleQuality = 0;
|
||||||
|
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
|
||||||
|
pp.hDeviceWindow = w->window;
|
||||||
|
pp.Windowed = TRUE;
|
||||||
|
pp.EnableAutoDepthStencil = FALSE;
|
||||||
|
pp.FullScreen_RefreshRateInHz = 0;
|
||||||
|
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
|
||||||
|
|
||||||
|
if (FAILED(w->d3d.object->CreateDevice (D3DADAPTER_DEFAULT,
|
||||||
|
D3DDEVTYPE_HAL,
|
||||||
|
w->window,
|
||||||
|
flag,
|
||||||
|
&pp,
|
||||||
|
&w->d3d.device)))
|
||||||
|
goto no_device;
|
||||||
|
|
||||||
|
if (FAILED (D3DXCreateSprite (w->d3d.device, &w->d3d.sprite)))
|
||||||
|
goto no_sprite;
|
||||||
|
|
||||||
|
if (FAILED (w->d3d.device->CreateTexture (rect.right - rect.left,
|
||||||
|
rect.bottom - rect.top,
|
||||||
|
1,
|
||||||
|
D3DUSAGE_DYNAMIC,
|
||||||
|
dm.Format,
|
||||||
|
D3DPOOL_DEFAULT,
|
||||||
|
&w->d3d.texture, NULL)))
|
||||||
|
goto no_texture;
|
||||||
|
|
||||||
|
if (FAILED (w->d3d.texture->GetLevelDesc (0, &sd)))
|
||||||
|
goto no_level_desc;
|
||||||
|
|
||||||
|
switch (sd.Format) {
|
||||||
|
case D3DFMT_A8R8G8B8:
|
||||||
|
case D3DFMT_X8R8G8B8:
|
||||||
|
w->d3d.depth = 32;
|
||||||
|
break;
|
||||||
|
case D3DFMT_R5G6B5:
|
||||||
|
w->d3d.depth = 16;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
goto no_supported_depth;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
no_supported_depth:
|
||||||
|
no_level_desc:
|
||||||
|
w->d3d.texture->Release();
|
||||||
|
no_texture:
|
||||||
|
w->d3d.sprite->Release();
|
||||||
|
no_sprite:
|
||||||
|
w->d3d.device->Release();
|
||||||
|
no_device:
|
||||||
|
no_get_client:
|
||||||
|
no_caps:
|
||||||
|
no_get_adapter:
|
||||||
|
w->d3d.object->Release();
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_direct3d_shutdown(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window)
|
||||||
|
return;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
|
||||||
|
if (w->d3d.texture)
|
||||||
|
w->d3d.texture->Release();
|
||||||
|
|
||||||
|
if (w->d3d.sprite)
|
||||||
|
w->d3d.sprite->Release();
|
||||||
|
|
||||||
|
if (w->d3d.device)
|
||||||
|
w->d3d.device->Release();
|
||||||
|
|
||||||
|
if (w->d3d.object)
|
||||||
|
w->d3d.object->Release();
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Object *
|
||||||
|
ecore_win32_direct3d_object_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->d3d.object;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Device *
|
||||||
|
ecore_win32_direct3d_device_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->d3d.device;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Sprite *
|
||||||
|
ecore_win32_direct3d_sprite_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->d3d.sprite;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Direct3D_Texture *
|
||||||
|
ecore_win32_direct3d_texture_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->d3d.texture;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI int
|
||||||
|
ecore_win32_direct3d_depth_get(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
return ((struct _Ecore_Win32_Window *)window)->d3d.depth;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,776 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <windowsx.h>
|
||||||
|
|
||||||
|
#include "Ecore.h"
|
||||||
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
|
||||||
|
static Ecore_Win32_Window *_ecore_win32_mouse_down_last_window = NULL;
|
||||||
|
static Ecore_Win32_Window *_ecore_win32_mouse_down_last_last_window = NULL;
|
||||||
|
static double _ecore_win32_mouse_down_last_time = 0;
|
||||||
|
static double _ecore_win32_mouse_down_last_last_time = 0;
|
||||||
|
static int _ecore_win32_mouse_down_did_triple = 0;
|
||||||
|
static int _ecore_win32_mouse_up_count = 0;
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_win32_event_free_key_down(void *data,
|
||||||
|
void *ev)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Key_Down *e;
|
||||||
|
|
||||||
|
e = ev;
|
||||||
|
if (e->keyname) free(e->keyname);
|
||||||
|
if (e->keysymbol) free(e->keysymbol);
|
||||||
|
if (e->keycompose) free(e->keycompose);
|
||||||
|
free(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_ecore_win32_event_free_key_up(void *data,
|
||||||
|
void *ev)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Key_Up *e;
|
||||||
|
|
||||||
|
e = ev;
|
||||||
|
if (e->keyname) free(e->keyname);
|
||||||
|
if (e->keysymbol) free(e->keysymbol);
|
||||||
|
if (e->keycompose) free(e->keycompose);
|
||||||
|
free(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_ecore_win32_event_keystroke_get(int key,
|
||||||
|
char **keyname,
|
||||||
|
char **keysymbol,
|
||||||
|
char **keycompose)
|
||||||
|
{
|
||||||
|
char *kn;
|
||||||
|
char *ks;
|
||||||
|
char *kc;
|
||||||
|
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
*keycompose = NULL;
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
/* Keystroke */
|
||||||
|
case VK_PRIOR:
|
||||||
|
kn = "KP_Prior";
|
||||||
|
ks = "KP_Prior";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_NEXT:
|
||||||
|
kn = "KP_Next";
|
||||||
|
ks = "KP_Next";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_END:
|
||||||
|
kn = "KP_End";
|
||||||
|
ks = "KP_End";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_HOME:
|
||||||
|
kn = "KP_Home";
|
||||||
|
ks = "KP_Home";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_LEFT:
|
||||||
|
kn = "KP_Left";
|
||||||
|
ks = "KP_Left";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_UP:
|
||||||
|
kn = "KP_Up";
|
||||||
|
ks = "KP_Up";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_RIGHT:
|
||||||
|
kn = "KP_Right";
|
||||||
|
ks = "KP_Right";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_DOWN:
|
||||||
|
kn = "KP_Down";
|
||||||
|
ks = "KP_Down";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_INSERT:
|
||||||
|
kn = "KP_Insert";
|
||||||
|
ks = "KP_Insert";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_DELETE:
|
||||||
|
kn = "KP_Delete";
|
||||||
|
ks = "KP_Delete";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F1:
|
||||||
|
kn = "F1";
|
||||||
|
ks = "F1";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F2:
|
||||||
|
kn = "F2";
|
||||||
|
ks = "F2";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F3:
|
||||||
|
kn = "F3";
|
||||||
|
ks = "F3";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F4:
|
||||||
|
kn = "F4";
|
||||||
|
ks = "F4";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F5:
|
||||||
|
kn = "F5";
|
||||||
|
ks = "F5";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F6:
|
||||||
|
kn = "F6";
|
||||||
|
ks = "F6";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F7:
|
||||||
|
kn = "F7";
|
||||||
|
ks = "F7";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F8:
|
||||||
|
kn = "F8";
|
||||||
|
ks = "F8";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F9:
|
||||||
|
kn = "F9";
|
||||||
|
ks = "F9";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F10:
|
||||||
|
kn = "F10";
|
||||||
|
ks = "F10";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F11:
|
||||||
|
kn = "F11";
|
||||||
|
ks = "F11";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F12:
|
||||||
|
kn = "F12";
|
||||||
|
ks = "F12";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F13:
|
||||||
|
kn = "F13";
|
||||||
|
ks = "F13";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F14:
|
||||||
|
kn = "F14";
|
||||||
|
ks = "F14";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F15:
|
||||||
|
kn = "F15";
|
||||||
|
ks = "F15";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F16:
|
||||||
|
kn = "F16";
|
||||||
|
ks = "F16";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F17:
|
||||||
|
kn = "F17";
|
||||||
|
ks = "F17";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F18:
|
||||||
|
kn = "F18";
|
||||||
|
ks = "F18";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F19:
|
||||||
|
kn = "F19";
|
||||||
|
ks = "F19";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F20:
|
||||||
|
kn = "F20";
|
||||||
|
ks = "F20";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F21:
|
||||||
|
kn = "F21";
|
||||||
|
ks = "F21";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F22:
|
||||||
|
kn = "F22";
|
||||||
|
ks = "F22";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F23:
|
||||||
|
kn = "F23";
|
||||||
|
ks = "F23";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_F24:
|
||||||
|
kn = "F24";
|
||||||
|
ks = "F24";
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* other non keystroke characters */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*keyname = strdup(kn);
|
||||||
|
if (!*keyname) return 0;
|
||||||
|
*keysymbol = strdup(ks);
|
||||||
|
if (!*keysymbol)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
*keyname = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*keycompose = strdup(kc);
|
||||||
|
if (!*keycompose)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
free(*keysymbol);
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_ecore_win32_event_char_get(int key,
|
||||||
|
char **keyname,
|
||||||
|
char **keysymbol,
|
||||||
|
char **keycompose)
|
||||||
|
{
|
||||||
|
char kn[32];
|
||||||
|
char ks[32];
|
||||||
|
char *kc;
|
||||||
|
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
*keycompose = NULL;
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case VK_BACK:
|
||||||
|
strncpy(kn, "Backspace", 32);
|
||||||
|
strncpy(ks, "Backspace", 32);
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_TAB:
|
||||||
|
strncpy(kn, "Tab", 32);
|
||||||
|
strncpy(ks, "Tab", 32);
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case 0x0a:
|
||||||
|
/* Line feed (Shift + Enter) */
|
||||||
|
strncpy(kn, "LineFeed", 32);
|
||||||
|
strncpy(ks, "LineFeed", 32);
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_RETURN:
|
||||||
|
strncpy(kn, "Return", 32);
|
||||||
|
strncpy(ks, "Return", 32);
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
case VK_ESCAPE:
|
||||||
|
strncpy(kn, "Escape", 32);
|
||||||
|
strncpy(ks, "Escape", 32);
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* displayable characters */
|
||||||
|
printf (" * key : %d\n", key);
|
||||||
|
kn[0] = (TCHAR)key;
|
||||||
|
kn[1] = '\0';
|
||||||
|
ks[0] = (TCHAR)key;
|
||||||
|
ks[1] = '\0';
|
||||||
|
kc = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*keyname = strdup(kn);
|
||||||
|
if (!*keyname) return 0;
|
||||||
|
*keysymbol = strdup(ks);
|
||||||
|
if (!*keysymbol)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
*keyname = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
*keycompose = strdup(kc);
|
||||||
|
if (!*keycompose)
|
||||||
|
{
|
||||||
|
free(*keyname);
|
||||||
|
free(*keysymbol);
|
||||||
|
*keyname = NULL;
|
||||||
|
*keysymbol = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ecore_Win32_Window *
|
||||||
|
_ecore_win32_event_window_get(HWND window)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *w = NULL;
|
||||||
|
|
||||||
|
ecore_list_first_goto(_ecore_win32_windows_list);
|
||||||
|
while ((w = ecore_list_next(_ecore_win32_windows_list)))
|
||||||
|
{
|
||||||
|
if (((struct _Ecore_Win32_Window *)w)->window == window)
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg, int is_keystroke)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Key_Down *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Key_Down *)malloc(sizeof(Ecore_Win32_Event_Key_Down));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
if (is_keystroke)
|
||||||
|
{
|
||||||
|
if (!_ecore_win32_event_keystroke_get(LOWORD(msg->window_param),
|
||||||
|
&e->keyname,
|
||||||
|
&e->keysymbol,
|
||||||
|
&e->keycompose))
|
||||||
|
{
|
||||||
|
free(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
goto store_key;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!_ecore_win32_event_char_get(LOWORD(msg->window_param),
|
||||||
|
&e->keyname,
|
||||||
|
&e->keysymbol,
|
||||||
|
&e->keycompose))
|
||||||
|
{
|
||||||
|
free(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
store_key:
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_KEY_DOWN, e, _ecore_win32_event_free_key_down, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg, int is_keystroke)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Key_Up *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Key_Up *)calloc(1, sizeof(Ecore_Win32_Event_Key_Up));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
if (is_keystroke)
|
||||||
|
{
|
||||||
|
if (!_ecore_win32_event_keystroke_get(LOWORD(msg->window_param),
|
||||||
|
&e->keyname,
|
||||||
|
&e->keysymbol,
|
||||||
|
&e->keycompose))
|
||||||
|
{
|
||||||
|
free(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
goto store_key;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!_ecore_win32_event_char_get(LOWORD(msg->window_param),
|
||||||
|
&e->keyname,
|
||||||
|
&e->keysymbol,
|
||||||
|
&e->keycompose))
|
||||||
|
{
|
||||||
|
free(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
store_key:
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_KEY_UP, e, _ecore_win32_event_free_key_up, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg,
|
||||||
|
int button)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
|
||||||
|
window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Move *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = window;
|
||||||
|
e->x = GET_X_LPARAM(msg->data_param);
|
||||||
|
e->y = GET_Y_LPARAM(msg->data_param);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
_ecore_win32_event_last_window = e->window;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_MOVE, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Button_Down *e;
|
||||||
|
|
||||||
|
if (_ecore_win32_mouse_down_did_triple)
|
||||||
|
{
|
||||||
|
_ecore_win32_mouse_down_last_window = NULL;
|
||||||
|
_ecore_win32_mouse_down_last_last_window = NULL;
|
||||||
|
_ecore_win32_mouse_down_last_time = 0.0;
|
||||||
|
_ecore_win32_mouse_down_last_last_time = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Button_Down *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Button_Down));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = window;
|
||||||
|
e->button = button;
|
||||||
|
e->x = GET_X_LPARAM(msg->data_param);
|
||||||
|
e->y = GET_Y_LPARAM(msg->data_param);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
if (((e->time - _ecore_win32_mouse_down_last_time) <= _ecore_win32_double_click_time) &&
|
||||||
|
(e->window == _ecore_win32_mouse_down_last_window))
|
||||||
|
e->double_click = 1;
|
||||||
|
|
||||||
|
if (((e->time - _ecore_win32_mouse_down_last_last_time) <= (2.0 * _ecore_win32_double_click_time)) &&
|
||||||
|
(e->window == _ecore_win32_mouse_down_last_window) &&
|
||||||
|
(e->window == _ecore_win32_mouse_down_last_last_window))
|
||||||
|
{
|
||||||
|
e->triple_click = 1;
|
||||||
|
_ecore_win32_mouse_down_did_triple = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_ecore_win32_mouse_down_did_triple = 0;
|
||||||
|
|
||||||
|
if (!e->double_click && !e->triple_click)
|
||||||
|
_ecore_win32_mouse_up_count = 0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
_ecore_win32_event_last_window = e->window;
|
||||||
|
|
||||||
|
if (!_ecore_win32_mouse_down_did_triple)
|
||||||
|
{
|
||||||
|
_ecore_win32_mouse_down_last_last_window = _ecore_win32_mouse_down_last_window;
|
||||||
|
_ecore_win32_mouse_down_last_window = e->window;
|
||||||
|
_ecore_win32_mouse_down_last_last_time = _ecore_win32_mouse_down_last_time;
|
||||||
|
_ecore_win32_mouse_down_last_time = e->time;
|
||||||
|
}
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
printf (" * ecore event button press\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg,
|
||||||
|
int button)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *window;
|
||||||
|
|
||||||
|
window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Move *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = window;
|
||||||
|
e->x = GET_X_LPARAM(msg->data_param);
|
||||||
|
e->y = GET_Y_LPARAM(msg->data_param);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
_ecore_win32_event_last_window = e->window;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_MOVE, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Button_Up *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Button_Up *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Button_Up));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = window;
|
||||||
|
e->button = button;
|
||||||
|
e->x = GET_X_LPARAM(msg->data_param);
|
||||||
|
e->y = GET_Y_LPARAM(msg->data_param);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_mouse_up_count++;
|
||||||
|
|
||||||
|
if ((_ecore_win32_mouse_up_count >= 2) &&
|
||||||
|
((e->time - _ecore_win32_mouse_down_last_time) <= _ecore_win32_double_click_time) &&
|
||||||
|
(e->window == _ecore_win32_mouse_down_last_window))
|
||||||
|
e->double_click = 1;
|
||||||
|
|
||||||
|
if ((_ecore_win32_mouse_up_count >= 3) &&
|
||||||
|
((e->time - _ecore_win32_mouse_down_last_last_time) <= (2.0 * _ecore_win32_double_click_time)) &&
|
||||||
|
(e->window == _ecore_win32_mouse_down_last_window) &&
|
||||||
|
(e->window == _ecore_win32_mouse_down_last_last_window))
|
||||||
|
e->triple_click = 1;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
_ecore_win32_event_last_window = e->window;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ecore_Win32_Event_Mouse_Button_Up *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Button_Up *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Button_Up));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->button = button;
|
||||||
|
e->x = GET_X_LPARAM(msg->data_param);
|
||||||
|
e->y = GET_Y_LPARAM(msg->data_param);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
|
||||||
|
printf (" * ecore event button release\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Move *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->x = GET_X_LPARAM(msg->data_param);
|
||||||
|
e->y = GET_Y_LPARAM(msg->data_param);
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_MOVE, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Move *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->x = msg->x;
|
||||||
|
e->y = msg->y;
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
_ecore_win32_event_last_window = e->window;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_MOVE, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_In *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_In *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_In));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->x = msg->x;
|
||||||
|
e->y = msg->y;
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_IN, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Move *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Move *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Move));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->x = msg->x;
|
||||||
|
e->y = msg->y;
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
_ecore_win32_event_last_window = e->window;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_MOVE, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Mouse_Out *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Mouse_Out *)calloc(1, sizeof(Ecore_Win32_Event_Mouse_Out));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->x = msg->x;
|
||||||
|
e->y = msg->y;
|
||||||
|
e->time = (double)msg->time / 1000.0;
|
||||||
|
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_MOUSE_OUT, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_focus_in(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Window_Focus_In *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Window_Focus_In *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_In));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
|
||||||
|
e->time = _ecore_win32_event_last_time;
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_IN, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_focus_out(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Window_Focus_Out *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Window_Focus_Out *)calloc(1, sizeof(Ecore_Win32_Event_Window_Focus_Out));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
|
||||||
|
e->time = _ecore_win32_event_last_time;
|
||||||
|
_ecore_win32_event_last_time = e->time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Window_Damage *e;
|
||||||
|
|
||||||
|
e = (Ecore_Win32_Event_Window_Damage *)calloc(1, sizeof(Ecore_Win32_Event_Window_Damage));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
|
||||||
|
e->x = msg->update.left;
|
||||||
|
e->y = msg->update.top;
|
||||||
|
e->width = msg->update.right - msg->update.left;
|
||||||
|
e->height = msg->update.bottom - msg->update.top;
|
||||||
|
printf (" * ecore : event expose %d %d\n", e->width, e->height);
|
||||||
|
|
||||||
|
e->time = _ecore_win32_event_last_time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DAMAGE, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Window_Destroy *e;
|
||||||
|
|
||||||
|
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Destroy));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->time = _ecore_win32_event_last_time;
|
||||||
|
if (e->window == _ecore_win32_event_last_window) _ecore_win32_event_last_window = NULL;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DESTROY, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Window_Show *e;
|
||||||
|
|
||||||
|
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Show));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->time = _ecore_win32_event_last_time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_SHOW, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Window_Hide *e;
|
||||||
|
|
||||||
|
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Hide));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->time = _ecore_win32_event_last_time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_HIDE, e, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_ecore_win32_event_handle_delete(Ecore_Win32_Callback_Data *msg)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Event_Window_Delete *e;
|
||||||
|
|
||||||
|
e = calloc(1, sizeof(Ecore_Win32_Event_Window_Delete));
|
||||||
|
if (!e) return;
|
||||||
|
|
||||||
|
e->window = _ecore_win32_event_window_get(msg->window);
|
||||||
|
e->time = _ecore_win32_event_last_time;
|
||||||
|
|
||||||
|
ecore_event_add(ECORE_WIN32_EVENT_WINDOW_DELETE, e, NULL, NULL);
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ECORE_WIN32_PRIVATE_H__
|
||||||
|
#define __ECORE_WIN32_PRIVATE_H__
|
||||||
|
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <ddraw.h>
|
||||||
|
#include <d3d9.h>
|
||||||
|
#include <d3dx9.h>
|
||||||
|
|
||||||
|
#include <Ecore_Data.h>
|
||||||
|
|
||||||
|
#include "Ecore_Win32.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define ECORE_WIN32_WINDOW_CLASS "Ecore_Win32_Window_Class"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _Ecore_Win32_Callback_Data Ecore_Win32_Callback_Data;
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Callback_Data
|
||||||
|
{
|
||||||
|
RECT update;
|
||||||
|
HWND window;
|
||||||
|
unsigned int message;
|
||||||
|
WPARAM window_param;
|
||||||
|
LPARAM data_param;
|
||||||
|
long time;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _Ecore_Win32_Window
|
||||||
|
{
|
||||||
|
HWND window;
|
||||||
|
|
||||||
|
#ifdef HAVE_DIRECTDRAW
|
||||||
|
struct {
|
||||||
|
LPDIRECTDRAW object;
|
||||||
|
LPDIRECTDRAWSURFACE surface_primary;
|
||||||
|
LPDIRECTDRAWSURFACE surface_back;
|
||||||
|
LPDIRECTDRAWCLIPPER clipper;
|
||||||
|
int depth;
|
||||||
|
} ddraw;
|
||||||
|
#endif /* HAVE_DIRECTDRAW */
|
||||||
|
|
||||||
|
#ifdef HAVE_DIRECT3D
|
||||||
|
struct {
|
||||||
|
LPDIRECT3D9 object;
|
||||||
|
LPDIRECT3DDEVICE9 device;
|
||||||
|
LPD3DXSPRITE sprite;
|
||||||
|
LPDIRECT3DTEXTURE9 texture;
|
||||||
|
int depth;
|
||||||
|
} d3d;
|
||||||
|
#endif /* HAVE_DIRECT3D */
|
||||||
|
|
||||||
|
DWORD style; /* used to go fullscreen to normal */
|
||||||
|
RECT rect; /* used to go fullscreen to normal */
|
||||||
|
|
||||||
|
unsigned int min_width;
|
||||||
|
unsigned int min_height;
|
||||||
|
unsigned int max_width;
|
||||||
|
unsigned int max_height;
|
||||||
|
unsigned int base_width;
|
||||||
|
unsigned int base_height;
|
||||||
|
unsigned int step_width;
|
||||||
|
unsigned int step_height;
|
||||||
|
|
||||||
|
unsigned int pointer_is_in : 1;
|
||||||
|
unsigned int borderless : 1;
|
||||||
|
unsigned int iconified : 1;
|
||||||
|
unsigned int fullscreen : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
extern Ecore_List *_ecore_win32_windows_list;
|
||||||
|
extern HINSTANCE _ecore_win32_instance;
|
||||||
|
extern double _ecore_win32_double_click_time;
|
||||||
|
extern double _ecore_win32_event_last_time;
|
||||||
|
extern Ecore_Win32_Window *_ecore_win32_event_last_window;
|
||||||
|
|
||||||
|
|
||||||
|
char *_ecore_win32_hwnd_str_get(HWND window);
|
||||||
|
|
||||||
|
void _ecore_win32_event_handle_key_press(Ecore_Win32_Callback_Data *msg, int is_keystroke);
|
||||||
|
void _ecore_win32_event_handle_key_release(Ecore_Win32_Callback_Data *msg, int is_keystroke);
|
||||||
|
void _ecore_win32_event_handle_button_press(Ecore_Win32_Callback_Data *msg, int button);
|
||||||
|
void _ecore_win32_event_handle_button_release(Ecore_Win32_Callback_Data *msg, int button);
|
||||||
|
void _ecore_win32_event_handle_motion_notify(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_enter_notify(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_leave_notify(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_focus_in(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_focus_out(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_expose(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_destroy_notify(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_map_notify(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_unmap_notify(Ecore_Win32_Callback_Data *msg);
|
||||||
|
void _ecore_win32_event_handle_delete(Ecore_Win32_Callback_Data *msg);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __ECORE_WIN32_PRIVATE_H__ */
|
|
@ -0,0 +1,480 @@
|
||||||
|
/*
|
||||||
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Ecore.h>
|
||||||
|
|
||||||
|
#include "ecore_win32_private.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum _Ecore_Win32_Window_Z_Order Ecore_Win32_Window_Z_Order;
|
||||||
|
enum _Ecore_Win32_Window_Z_Order
|
||||||
|
{
|
||||||
|
ECORE_WIN32_WINDOW_Z_ORDER_BOTTOM,
|
||||||
|
ECORE_WIN32_WINDOW_Z_ORDER_NOTOPMOST,
|
||||||
|
ECORE_WIN32_WINDOW_Z_ORDER_TOP,
|
||||||
|
ECORE_WIN32_WINDOW_Z_ORDER_TOPMOST
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
EAPI Ecore_Win32_Window *
|
||||||
|
ecore_win32_window_new(Ecore_Win32_Window *parent,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
int minimal_width;
|
||||||
|
int minimal_height;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)calloc(1, sizeof(struct _Ecore_Win32_Window));
|
||||||
|
if (!w)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
printf (" * ecore : new debut : %d %d %d\n",
|
||||||
|
width, height, GetSystemMetrics(SM_CXMIN));
|
||||||
|
rect.left = 0;
|
||||||
|
rect.top = 0;
|
||||||
|
rect.right = width;
|
||||||
|
rect.bottom = height;
|
||||||
|
if (!AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, FALSE))
|
||||||
|
{
|
||||||
|
free(w);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
printf (" * ecore : new debut : %ld %d\n",
|
||||||
|
rect.right - rect.left, GetSystemMetrics(SM_CXMIN));
|
||||||
|
|
||||||
|
minimal_width = GetSystemMetrics(SM_CXMIN);
|
||||||
|
minimal_height = GetSystemMetrics(SM_CYMIN);
|
||||||
|
if (((rect.right - rect.left) < minimal_width) ||
|
||||||
|
((rect.bottom - rect.top) < minimal_height))
|
||||||
|
{
|
||||||
|
printf ("[Ecore] [Win32] ERROR !!\n");
|
||||||
|
printf (" Wrong size %ld\n", rect.right - rect.left);
|
||||||
|
free(w);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
w->window = CreateWindow(ECORE_WIN32_WINDOW_CLASS, "",
|
||||||
|
WS_OVERLAPPEDWINDOW | WS_SIZEBOX,
|
||||||
|
x, y,
|
||||||
|
rect.right - rect.left,
|
||||||
|
rect.bottom - rect.top,
|
||||||
|
parent ? ((struct _Ecore_Win32_Window *)parent)->window : NULL,
|
||||||
|
NULL, _ecore_win32_instance, NULL);
|
||||||
|
if (!w->window)
|
||||||
|
{
|
||||||
|
free(w);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ecore_list_append(_ecore_win32_windows_list, w) == FALSE)
|
||||||
|
{
|
||||||
|
ecore_win32_ddraw_shutdown(w);
|
||||||
|
DestroyWindow(w->window);
|
||||||
|
free(w);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
w->min_width = width;
|
||||||
|
w->min_height = height;
|
||||||
|
w->max_width = width;
|
||||||
|
w->max_height = height;
|
||||||
|
w->base_width = 0;
|
||||||
|
w->base_height = 0;
|
||||||
|
w->step_width = 1;
|
||||||
|
w->step_height = 1;
|
||||||
|
|
||||||
|
w->pointer_is_in = 0;
|
||||||
|
w->borderless = 0;
|
||||||
|
w->iconified = 0;
|
||||||
|
w->fullscreen = 0;
|
||||||
|
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_del(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
ecore_list_first_goto(_ecore_win32_windows_list);
|
||||||
|
while ((w = ecore_list_next(_ecore_win32_windows_list)))
|
||||||
|
{
|
||||||
|
if (w == window)
|
||||||
|
{
|
||||||
|
ecore_list_remove(_ecore_win32_windows_list);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ecore_list_remove(_ecore_win32_windows_list);
|
||||||
|
|
||||||
|
ecore_win32_ddraw_shutdown(window);
|
||||||
|
DestroyWindow(((struct _Ecore_Win32_Window *)window)->window);
|
||||||
|
free(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_configure(Ecore_Win32_Window *window,
|
||||||
|
Ecore_Win32_Window_Z_Order order,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
|
{
|
||||||
|
HWND w;
|
||||||
|
|
||||||
|
switch (order)
|
||||||
|
{
|
||||||
|
case ECORE_WIN32_WINDOW_Z_ORDER_BOTTOM:
|
||||||
|
w = HWND_BOTTOM;
|
||||||
|
break;
|
||||||
|
case ECORE_WIN32_WINDOW_Z_ORDER_NOTOPMOST:
|
||||||
|
w = HWND_NOTOPMOST;
|
||||||
|
break;
|
||||||
|
case ECORE_WIN32_WINDOW_Z_ORDER_TOP:
|
||||||
|
w = HWND_TOP;
|
||||||
|
break;
|
||||||
|
case ECORE_WIN32_WINDOW_Z_ORDER_TOPMOST:
|
||||||
|
w = HWND_TOPMOST;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SetWindowPos((struct _Ecore_Win32_Window *)window->window, w, x, y, width, height, ???);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_move(Ecore_Win32_Window *window,
|
||||||
|
int x,
|
||||||
|
int y)
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
HWND w;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
w = ((struct _Ecore_Win32_Window *)window)->window;
|
||||||
|
if (!GetWindowRect(w, &rect))
|
||||||
|
return;
|
||||||
|
|
||||||
|
MoveWindow(w, x, y,
|
||||||
|
rect.right - rect.left,
|
||||||
|
rect.bottom - rect.top,
|
||||||
|
TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_resize(Ecore_Win32_Window *window,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
DWORD style;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
if (!GetWindowRect(w->window, &rect)) return;
|
||||||
|
|
||||||
|
x = rect.left;
|
||||||
|
y = rect.top;
|
||||||
|
rect.left = 0;
|
||||||
|
rect.top = 0;
|
||||||
|
if (width < w->min_width) width = w->min_width;
|
||||||
|
if (width > w->max_width) width = w->max_width;
|
||||||
|
if (height < w->min_height) height = w->min_height;
|
||||||
|
if (height > w->max_height) height = w->max_height;
|
||||||
|
rect.right = width;
|
||||||
|
rect.bottom = height;
|
||||||
|
style = GetWindowLong(w->window, GWL_STYLE);
|
||||||
|
if (!AdjustWindowRect(&rect, style, FALSE))
|
||||||
|
return;
|
||||||
|
|
||||||
|
MoveWindow(w->window, x, y,
|
||||||
|
rect.right - rect.left,
|
||||||
|
rect.bottom - rect.top,
|
||||||
|
TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_move_resize(Ecore_Win32_Window *window,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int width,
|
||||||
|
int height)
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
DWORD style;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
w = ((struct _Ecore_Win32_Window *)window);
|
||||||
|
rect.left = 0;
|
||||||
|
rect.top = 0;
|
||||||
|
if (width < w->min_width) width = w->min_width;
|
||||||
|
if (width > w->max_width) width = w->max_width;
|
||||||
|
if (height < w->min_height) height = w->min_height;
|
||||||
|
if (height > w->max_height) height = w->max_height;
|
||||||
|
rect.right = width;
|
||||||
|
rect.bottom = height;
|
||||||
|
style = GetWindowLong(w->window, GWL_STYLE);
|
||||||
|
if (!AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, FALSE))
|
||||||
|
return;
|
||||||
|
|
||||||
|
MoveWindow(w->window, x, y,
|
||||||
|
rect.right - rect.left,
|
||||||
|
rect.bottom - rect.top,
|
||||||
|
TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_size_get(Ecore_Win32_Window *window,
|
||||||
|
int *width,
|
||||||
|
int *height)
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
if (!GetClientRect(((struct _Ecore_Win32_Window *)window)->window,
|
||||||
|
&rect))
|
||||||
|
{
|
||||||
|
if (width) *width = 0;
|
||||||
|
if (height) *height = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (width) *width = rect.right - rect.left;
|
||||||
|
if (height) *height = rect.bottom - rect.top;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
|
||||||
|
int min_width,
|
||||||
|
int min_height)
|
||||||
|
{
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
w->min_width = min_width;
|
||||||
|
w->min_height = min_height;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
|
||||||
|
int max_width,
|
||||||
|
int max_height)
|
||||||
|
{
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
w->max_width = max_width;
|
||||||
|
w->max_height = max_height;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
|
||||||
|
int base_width,
|
||||||
|
int base_height)
|
||||||
|
{
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
w->base_width = base_width;
|
||||||
|
w->base_height = base_height;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
|
||||||
|
int step_width,
|
||||||
|
int step_height)
|
||||||
|
{
|
||||||
|
struct _Ecore_Win32_Window *w;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
w = (struct _Ecore_Win32_Window *)window;
|
||||||
|
w->step_width = step_width;
|
||||||
|
w->step_height = step_height;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: ecore_win32_window_shaped_set */
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_show(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_SHOWNORMAL);
|
||||||
|
UpdateWindow(((struct _Ecore_Win32_Window *)window)->window);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: seems to block the taskbar */
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_hide(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
ShowWindow(((struct _Ecore_Win32_Window *)window)->window, SW_HIDE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_raise(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
SetWindowPos(((struct _Ecore_Win32_Window *)window)->window,
|
||||||
|
HWND_TOP, 0, 0, 0, 0,
|
||||||
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_lower(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
SetWindowPos(((struct _Ecore_Win32_Window *)window)->window,
|
||||||
|
HWND_BOTTOM, 0, 0, 0, 0,
|
||||||
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_title_set(Ecore_Win32_Window *window,
|
||||||
|
const char *title)
|
||||||
|
{
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
if (!title || !title[0]) return;
|
||||||
|
|
||||||
|
SetWindowText(((struct _Ecore_Win32_Window *)window)->window, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_focus_set(Ecore_Win32_Window *window)
|
||||||
|
{
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
SetFocus(((struct _Ecore_Win32_Window *)window)->window);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
|
||||||
|
int on)
|
||||||
|
{
|
||||||
|
struct _Ecore_Win32_Window *ew;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
ew = (struct _Ecore_Win32_Window *)window;
|
||||||
|
if (((ew->iconified) && (on)) ||
|
||||||
|
((!ew->iconified) && (!on)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
ShowWindow(ew->window,
|
||||||
|
SW_MINIMIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowWindow(ew->window,
|
||||||
|
SW_RESTORE);
|
||||||
|
}
|
||||||
|
ew->iconified = on;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
|
||||||
|
int on)
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
DWORD style;
|
||||||
|
struct _Ecore_Win32_Window *ew;
|
||||||
|
HWND w;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
ew = (struct _Ecore_Win32_Window *)window;
|
||||||
|
if (((ew->borderless) && (on)) ||
|
||||||
|
((!ew->borderless) && (!on)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
w = ew->window;
|
||||||
|
|
||||||
|
style = GetWindowLong(w, GWL_STYLE);
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
if (!GetClientRect(w, &rect)) return;
|
||||||
|
SetWindowLong(w, GWL_STYLE, style & ~WS_CAPTION);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!GetWindowRect(w, &rect)) return;
|
||||||
|
style |= WS_CAPTION;
|
||||||
|
AdjustWindowRect (&rect, style, FALSE);
|
||||||
|
SetWindowLong(w, GWL_STYLE, style);
|
||||||
|
}
|
||||||
|
SetWindowPos(w, HWND_TOPMOST,
|
||||||
|
rect.left, rect.top,
|
||||||
|
rect.right - rect.left, rect.bottom - rect.top,
|
||||||
|
SWP_NOMOVE | SWP_FRAMECHANGED);
|
||||||
|
ew->borderless = on;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
|
||||||
|
int on)
|
||||||
|
{
|
||||||
|
struct _Ecore_Win32_Window *ew;
|
||||||
|
HWND w;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
ew = (struct _Ecore_Win32_Window *)window;
|
||||||
|
if (((ew->fullscreen) && (on)) ||
|
||||||
|
((!ew->fullscreen) && (!on)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
w = ew->window;
|
||||||
|
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
if (!GetWindowRect(w, &ew->rect)) return;
|
||||||
|
width = GetSystemMetrics (SM_CXSCREEN);
|
||||||
|
height = GetSystemMetrics (SM_CYSCREEN);
|
||||||
|
ew->style = GetWindowLong(w, GWL_STYLE);
|
||||||
|
SetWindowLong(w, GWL_STYLE, (ew->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
|
||||||
|
SetWindowPos(w, HWND_TOP, 0, 0, width, height,
|
||||||
|
SWP_NOCOPYBITS | SWP_SHOWWINDOW);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetWindowLong(w, GWL_STYLE, ew->style);
|
||||||
|
SetWindowPos(w, HWND_NOTOPMOST,
|
||||||
|
ew->rect.left,
|
||||||
|
ew->rect.top,
|
||||||
|
ew->rect.right - ew->rect.left,
|
||||||
|
ew->rect.bottom - ew->rect.right,
|
||||||
|
SWP_NOCOPYBITS | SWP_SHOWWINDOW);
|
||||||
|
}
|
||||||
|
ew->fullscreen = on;
|
||||||
|
}
|
Loading…
Reference in New Issue