forked from enlightenment/efl
* ecore/ecore_pipe.c:
fix doc * ecore_file/Makefile.am: add Windows cflags * ecore_file/ecore_file_private.h: move Evil.h so that EAPI is correctly defined * ecore_wince: make window_new windowed by default. other backend that gdi might have problems. add title_set and fullscreen_set functions. do not use aygshell features anymore for fullscreen (it's not free and not always available) include missing config.h * ecore_evas: move Evas.h and Ecore_Getopt.h so that EAPI is correctly defined add title_set and fullscreen_set functions. SVN revision: 38540
This commit is contained in:
parent
a5695ae333
commit
6a337b0c4e
|
@ -89,12 +89,12 @@ case "$host_os" in
|
|||
AC_DEFINE(EFL_ECORE_WINCE_BUILD, 1, [Define to mention that ecore WinCE is built.])
|
||||
WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
|
||||
WIN32_CFLAGS="-mwin32"
|
||||
WIN32_LIBS="-lws2 -laygshell"
|
||||
WIN32_LIBS="-lws2"
|
||||
else
|
||||
if test "$host_os" = "mingw32ce" ; then
|
||||
AC_DEFINE(EFL_ECORE_WINCE_BUILD, 1, [Define to mention that ecore WinCE is built.])
|
||||
WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
|
||||
WIN32_LIBS="-lws2 -laygshell"
|
||||
WIN32_LIBS="-lws2"
|
||||
else
|
||||
WIN32_LIBS="-lws2_32"
|
||||
fi
|
||||
|
|
|
@ -148,7 +148,7 @@ static int _ecore_pipe_read(void *data,
|
|||
* pipeline = _buid_pipeline (filename, pipe);
|
||||
* if (!pipeline) {
|
||||
* g_print ("Error during the pipeline building\n");
|
||||
* ecore_pipe_free (pipe);
|
||||
* ecore_pipe_del (pipe);
|
||||
* ecore_shutdown ();
|
||||
* gst_deinit ();
|
||||
* return -1;
|
||||
|
@ -158,7 +158,7 @@ static int _ecore_pipe_read(void *data,
|
|||
*
|
||||
* ecore_main_loop_begin();
|
||||
*
|
||||
* ecore_pipe_free (pipe);
|
||||
* ecore_pipe_del (pipe);
|
||||
* ecore_shutdown ();
|
||||
* gst_deinit ();
|
||||
*
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
#ifndef _ECORE_EVAS_H
|
||||
#define _ECORE_EVAS_H
|
||||
|
||||
#include <Evas.h>
|
||||
#include <Ecore_Getopt.h>
|
||||
|
||||
#ifdef EAPI
|
||||
# undef EAPI
|
||||
#endif
|
||||
|
@ -48,9 +51,6 @@
|
|||
* - dfb back-end ??? (dfb's threads make this REALLY HARD)
|
||||
*/
|
||||
|
||||
#include <Evas.h>
|
||||
#include <Ecore_Getopt.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -212,6 +212,9 @@ struct _Ecore_Evas_Engine
|
|||
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
|
||||
struct {
|
||||
Ecore_WinCE_Window *window;
|
||||
struct {
|
||||
unsigned char fullscreen : 1;
|
||||
} state;
|
||||
} wince;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -705,14 +705,14 @@ _ecore_evas_wince_hide(Ecore_Evas *ee)
|
|||
/* ecore_wince_window_lower(ee->engine.wince.window); */
|
||||
/* } */
|
||||
|
||||
/* static void */
|
||||
/* _ecore_evas_wince_title_set(Ecore_Evas *ee, const char *title) */
|
||||
/* { */
|
||||
/* if (ee->prop.title) free(ee->prop.title); */
|
||||
/* ee->prop.title = NULL; */
|
||||
/* if (title) ee->prop.title = strdup(title); */
|
||||
/* ecore_wince_window_title_set(ee->engine.wince.window, ee->prop.title); */
|
||||
/* } */
|
||||
static void
|
||||
_ecore_evas_wince_title_set(Ecore_Evas *ee, const char *title)
|
||||
{
|
||||
if (ee->prop.title) free(ee->prop.title);
|
||||
ee->prop.title = NULL;
|
||||
if (title) ee->prop.title = strdup(title);
|
||||
ecore_wince_window_title_set(ee->engine.wince.window, ee->prop.title);
|
||||
}
|
||||
|
||||
/* static void */
|
||||
/* _ecore_evas_wince_size_min_set(Ecore_Evas *ee, int width, int height) */
|
||||
|
@ -821,17 +821,52 @@ _ecore_evas_wince_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int ho
|
|||
static void
|
||||
_ecore_evas_wince_fullscreen_set(Ecore_Evas *ee, int on)
|
||||
{
|
||||
/* if ((ee->prop.fullscreen && on) || */
|
||||
/* (!ee->prop.fullscreen && !on)) return; */
|
||||
Evas_Engine_Info_Software_16_WinCE *einfo;
|
||||
struct _Ecore_WinCE_Window *window;
|
||||
|
||||
/* ee->engine.wince.state.fullscreen = on; */
|
||||
/* ecore_wince_window_fullscreen_set(ee->engine.wince.window, ee->prop.borderless); */
|
||||
/* FIXME: what to do with that code ?? */
|
||||
/* if (ee->should_be_visible) */
|
||||
/* ecore_x_netwm_state_request_send(ee->engine.x.win, ee->engine.x.win_root, */
|
||||
/* ECORE_X_WINDOW_STATE_FULLSCREEN, -1, on); */
|
||||
/* else */
|
||||
/* _ecore_evas_wince_state_update(ee); */
|
||||
if ((ee->engine.wince.state.fullscreen && on) ||
|
||||
(!ee->engine.wince.state.fullscreen && !on))
|
||||
return;
|
||||
|
||||
ee->engine.wince.state.fullscreen = on;
|
||||
ee->prop.fullscreen = on;
|
||||
|
||||
window = (struct _Ecore_WinCE_Window *)ee->engine.wince.window;
|
||||
|
||||
if (on != 0)
|
||||
{
|
||||
/* ecore_win32_window_shape_set(ee->engine.win32.window, 0, 0, NULL); */
|
||||
ecore_wince_window_fullscreen_set(ee->engine.wince.window, on);
|
||||
ee->w = GetSystemMetrics(SM_CXSCREEN);
|
||||
ee->h = GetSystemMetrics(SM_CYSCREEN);
|
||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||
}
|
||||
else
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
|
||||
ecore_wince_window_fullscreen_set(ee->engine.wince.window, on);
|
||||
ecore_wince_window_size_get(ee->engine.wince.window, &w, &h);
|
||||
ee->w = w;
|
||||
ee->h = h;
|
||||
evas_output_size_set(ee->evas, ee->w, ee->h);
|
||||
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
||||
/* ecore_win32_window_shape_set(window, */
|
||||
/* window->shape.width, */
|
||||
/* window->shape.height, */
|
||||
/* window->shape.mask); */
|
||||
}
|
||||
|
||||
einfo = (Evas_Engine_Info_Software_16_WinCE *)evas_engine_info_get(ecore_evas_get(ee));
|
||||
if (einfo != NULL)
|
||||
{
|
||||
einfo->info.fullscreen = !!on;
|
||||
/* einfo->info.layered = window->shape.layered; */
|
||||
printf ("_ecore_evas_wince_fullscreen_set : %d\n", einfo->info.fullscreen);
|
||||
evas_engine_info_set(ecore_evas_get(ee), (Evas_Engine_Info *)einfo);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -868,7 +903,7 @@ static const Ecore_Evas_Engine_Func _ecore_wince_engine_func =
|
|||
NULL, //_ecore_evas_wince_raise,
|
||||
NULL, //_ecore_evas_wince_lower,
|
||||
NULL, //_ecore_evas_wince_activate,
|
||||
NULL, //_ecore_evas_wince_title_set,
|
||||
_ecore_evas_wince_title_set,
|
||||
NULL, /* _ecore_evas_x_name_class_set */
|
||||
NULL, //_ecore_evas_wince_size_min_set,
|
||||
NULL, //_ecore_evas_wince_size_max_set,
|
||||
|
|
|
@ -6,7 +6,8 @@ AM_CPPFLAGS = \
|
|||
-I$(top_builddir)/src/lib/ecore \
|
||||
@CURL_CFLAGS@ \
|
||||
@EVIL_CFLAGS@ \
|
||||
@EINA_CFLAGS@
|
||||
@EINA_CFLAGS@ \
|
||||
@WIN32_CPPFLAGS@
|
||||
|
||||
AM_CFLAGS = @WIN32_CFLAGS@
|
||||
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
# include <features.h>
|
||||
#endif
|
||||
|
||||
#include "Ecore.h"
|
||||
#include "ecore_private.h"
|
||||
|
||||
#ifdef HAVE_EVIL
|
||||
# include <Evil.h>
|
||||
#endif
|
||||
|
||||
#include "Ecore.h"
|
||||
#include "ecore_private.h"
|
||||
|
||||
#include "Ecore_File.h"
|
||||
|
||||
/* ecore_file_monitor */
|
||||
|
|
|
@ -37,7 +37,9 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
|
||||
#ifndef _ECORE_EVAS_H
|
||||
typedef void Ecore_WinCE_Window;
|
||||
#endif
|
||||
|
||||
|
||||
/* Events */
|
||||
|
@ -213,6 +215,9 @@ EAPI void ecore_wince_window_show(Ecore_WinCE_Window *window);
|
|||
|
||||
EAPI void ecore_wince_window_hide(Ecore_WinCE_Window *window);
|
||||
|
||||
EAPI void ecore_wince_window_title_set(Ecore_WinCE_Window *window,
|
||||
const char *title);
|
||||
|
||||
EAPI void ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend);
|
||||
|
||||
EAPI void ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend)(int));
|
||||
|
@ -231,6 +236,9 @@ EAPI void ecore_wince_window_size_get(Ecore_WinCE_Window *window,
|
|||
|
||||
EAPI void *ecore_wince_window_window_get(Ecore_WinCE_Window *window);
|
||||
|
||||
EAPI void ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
|
||||
int on);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h> /* for printf */
|
||||
|
||||
|
@ -105,8 +109,6 @@ ecore_wince_init()
|
|||
|
||||
_ecore_wince_init_count++;
|
||||
|
||||
printf ("ecore_wince : instance + class bon\n");
|
||||
|
||||
return _ecore_wince_init_count;
|
||||
}
|
||||
|
||||
|
@ -276,7 +278,7 @@ _ecore_wince_window_procedure(HWND window,
|
|||
_ecore_wince_event_handle_create_notify(data);
|
||||
return 0;
|
||||
case WM_DESTROY:
|
||||
printf (" * ecore message : destroy\n");
|
||||
printf (" *** ecore message : destroy\n");
|
||||
_ecore_wince_event_handle_destroy_notify(data);
|
||||
return 0;
|
||||
case WM_SHOWWINDOW:
|
||||
|
@ -297,7 +299,7 @@ _ecore_wince_window_procedure(HWND window,
|
|||
|
||||
return 0;
|
||||
case WM_CLOSE:
|
||||
printf (" * ecore message : close\n");
|
||||
printf (" *** ecore message : close\n");
|
||||
_ecore_wince_event_handle_delete_request(data);
|
||||
return 0;
|
||||
/* GDI notifications */
|
||||
|
@ -306,10 +308,10 @@ _ecore_wince_window_procedure(HWND window,
|
|||
RECT rect;
|
||||
PAINTSTRUCT paint;
|
||||
|
||||
printf (" * ecore message : paint\n");
|
||||
/* printf (" * ecore message : paint\n"); */
|
||||
if (BeginPaint(window, &paint))
|
||||
{
|
||||
printf (" * ecore message : painting...\n");
|
||||
/* printf (" * ecore message : painting...\n"); */
|
||||
data->update = paint.rcPaint;
|
||||
_ecore_wince_event_handle_expose(data);
|
||||
EndPaint(window, &paint);
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h> /* for printf */
|
||||
|
||||
|
@ -263,7 +267,7 @@ _ecore_wince_event_handle_enter_notify(Ecore_WinCE_Callback_Data *msg)
|
|||
Ecore_WinCE_Window *window;
|
||||
|
||||
window = (void *)GetWindowLong(msg->window, GWL_USERDATA);
|
||||
printf (" * ecore event enter notify 0\n");
|
||||
/* printf (" * ecore event enter notify 0\n"); */
|
||||
|
||||
{
|
||||
Ecore_WinCE_Event_Mouse_Move *e;
|
||||
|
@ -297,7 +301,7 @@ _ecore_wince_event_handle_enter_notify(Ecore_WinCE_Callback_Data *msg)
|
|||
|
||||
ecore_event_add(ECORE_WINCE_EVENT_MOUSE_IN, e, NULL, NULL);
|
||||
}
|
||||
printf (" * ecore event enter notify 1\n");
|
||||
/* printf (" * ecore event enter notify 1\n"); */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -36,7 +36,10 @@ struct _Ecore_WinCE_Window
|
|||
ecore_wince_suspend suspend;
|
||||
ecore_wince_resume resume;
|
||||
|
||||
RECT rect; /* used to go fullscreen to normal */
|
||||
|
||||
unsigned int pointer_is_in : 1;
|
||||
unsigned int fullscreen : 1;
|
||||
};
|
||||
|
||||
extern double _ecore_wince_double_click_time;
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h> /* for printf */
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <aygshell.h>
|
||||
|
||||
#include <Evil.h>
|
||||
|
||||
#include "Ecore_WinCE.h"
|
||||
#include "ecore_wince_private.h"
|
||||
|
@ -38,18 +40,23 @@ ecore_wince_window_new(Ecore_WinCE_Window *parent,
|
|||
if (!w)
|
||||
return NULL;
|
||||
|
||||
SetRect(&rect, 0, 0,
|
||||
GetSystemMetrics(SM_CXSCREEN),
|
||||
GetSystemMetrics(SM_CYSCREEN));
|
||||
rect.left = 0;
|
||||
rect.top = 0;
|
||||
rect.right = width;
|
||||
rect.bottom = height;
|
||||
if (!AdjustWindowRectEx(&rect, WS_CAPTION | WS_SYSMENU | WS_VISIBLE, FALSE, WS_EX_TOPMOST))
|
||||
{
|
||||
free(w);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
window = CreateWindowEx(WS_EX_TOPMOST,
|
||||
ECORE_WINCE_WINDOW_CLASS,
|
||||
L"",
|
||||
WS_VISIBLE | WS_POPUP,
|
||||
rect.left, rect.top,
|
||||
rect.right - rect.left,
|
||||
rect.bottom - rect.top,
|
||||
parent ? ((struct _Ecore_WinCE_Window *)parent)->window : NULL,
|
||||
WS_CAPTION | WS_SYSMENU | WS_VISIBLE,
|
||||
x, y,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
parent ? ((struct _Ecore_WinCE_Window *)parent)->window : NULL,
|
||||
NULL, _ecore_wince_instance, NULL);
|
||||
if (!window)
|
||||
{
|
||||
|
@ -57,9 +64,6 @@ ecore_wince_window_new(Ecore_WinCE_Window *parent,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SHFullScreen(window,
|
||||
SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
|
||||
|
||||
if (!_ecore_wince_hardware_keys_register(window))
|
||||
{
|
||||
DestroyWindow(window);
|
||||
|
@ -115,6 +119,23 @@ ecore_wince_window_hide(Ecore_WinCE_Window *window)
|
|||
SendMessage(((struct _Ecore_WinCE_Window *)window)->window, WM_SHOWWINDOW, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
ecore_wince_window_title_set(Ecore_WinCE_Window *window,
|
||||
const char *title)
|
||||
{
|
||||
wchar_t *wtitle;
|
||||
|
||||
if (!window) return;
|
||||
|
||||
if (!title || !title[0]) return;
|
||||
|
||||
wtitle = evil_char_to_wchar(title);
|
||||
if (!wtitle) return;
|
||||
|
||||
SetWindowText(((struct _Ecore_WinCE_Window *)window)->window, wtitle);
|
||||
free(wtitle);
|
||||
}
|
||||
|
||||
void
|
||||
ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend)
|
||||
{
|
||||
|
@ -211,7 +232,6 @@ ecore_wince_window_size_get(Ecore_WinCE_Window *window,
|
|||
{
|
||||
RECT rect;
|
||||
|
||||
printf ("ecore_wince_window_size_get %p\n", window);
|
||||
if (!window)
|
||||
{
|
||||
if (width) *width = GetSystemMetrics(SM_CXSCREEN);
|
||||
|
@ -242,6 +262,86 @@ ecore_wince_window_window_get(Ecore_WinCE_Window *window)
|
|||
return ((struct _Ecore_WinCE_Window *)window)->window;
|
||||
}
|
||||
|
||||
void
|
||||
ecore_wince_window_fullscreen_set(Ecore_WinCE_Window *window,
|
||||
int on)
|
||||
{
|
||||
struct _Ecore_WinCE_Window *ew;
|
||||
HWND w;
|
||||
HWND task_bar;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
if (!window) return;
|
||||
|
||||
ew = (struct _Ecore_WinCE_Window *)window;
|
||||
if (((ew->fullscreen) && (on)) ||
|
||||
((!ew->fullscreen) && (!on)))
|
||||
return;
|
||||
|
||||
ew->fullscreen = !!on;
|
||||
w = ew->window;
|
||||
|
||||
if (on)
|
||||
{
|
||||
/* save the position and size of the window */
|
||||
if (!GetWindowRect(w, &ew->rect)) return;
|
||||
|
||||
/* hide task bar */
|
||||
task_bar = FindWindow(L"HHTaskBar", NULL);
|
||||
if (!task_bar) return;
|
||||
ShowWindow(task_bar, SW_HIDE);
|
||||
EnableWindow(task_bar, FALSE);
|
||||
|
||||
/* style: visible + popup */
|
||||
if (!SetWindowLong(w, GWL_STYLE, WS_POPUP | WS_VISIBLE)) return;
|
||||
|
||||
/* resize window to fit the entire screen */
|
||||
SetWindowPos(w, HWND_TOPMOST,
|
||||
0, 0,
|
||||
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||
/*
|
||||
* It seems that SetWindowPos is not sufficient.
|
||||
* Call MoveWindow with the correct size and force painting.
|
||||
* Note that UpdateWindow (forcing repainting) is not sufficient
|
||||
*/
|
||||
MoveWindow(w,
|
||||
0, 0,
|
||||
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
|
||||
TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* show task bar */
|
||||
task_bar = FindWindow(L"HHTaskBar", NULL);
|
||||
if (!task_bar) return;
|
||||
ShowWindow(task_bar, SW_SHOW);
|
||||
EnableWindow(task_bar, TRUE);
|
||||
|
||||
/* style: visible + caption + sysmenu */
|
||||
if (!SetWindowLong(w, GWL_STYLE, WS_CAPTION | WS_SYSMENU | WS_VISIBLE)) return;
|
||||
/* restaure the position and size of the window */
|
||||
SetWindowPos(w, HWND_TOPMOST,
|
||||
ew->rect.left,
|
||||
ew->rect.top,
|
||||
ew->rect.right - ew->rect.left,
|
||||
ew->rect.bottom - ew->rect.top,
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||
/*
|
||||
* It seems that SetWindowPos is not sufficient.
|
||||
* Call MoveWindow with the correct size and force painting.
|
||||
* Note that UpdateWindow (forcing repainting) is not sufficient
|
||||
*/
|
||||
MoveWindow(w,
|
||||
ew->rect.left,
|
||||
ew->rect.top,
|
||||
ew->rect.right - ew->rect.left,
|
||||
ew->rect.bottom - ew->rect.top,
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***** Private functions definitions *****/
|
||||
|
||||
|
|
Loading…
Reference in New Issue