Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2020-10-19 10:16:29 +09:00
commit ae8f741c71
5 changed files with 107 additions and 7 deletions

View File

@ -611,6 +611,8 @@ 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_activate(Ecore_Win32_Window *window);
EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
const char *title);
@ -623,6 +625,8 @@ EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
Eina_Bool on);
EAPI void ecore_win32_window_maximized_set(Ecore_Win32_Window *window,
Eina_Bool on);
EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
Eina_Bool on);

View File

@ -104,6 +104,7 @@ struct _Ecore_Win32_Window
unsigned int pointer_is_in : 1;
unsigned int borderless : 1;
unsigned int iconified : 1;
unsigned int maximized : 1;
unsigned int fullscreen : 1;
struct {

View File

@ -146,6 +146,7 @@ _ecore_win32_window_internal_new(Ecore_Win32_Window *parent,
w->pointer_is_in = 0;
w->borderless = 0;
w->iconified = 0;
w->maximized = 0;
w->fullscreen = 0;
w->drag.x = x;
@ -1154,6 +1155,29 @@ ecore_win32_window_lower(Ecore_Win32_Window *window)
}
}
/**
* @brief Activate the given window.
*
* @param window The window to activate.
*
* This functions activates the windows @p window. If @p window
* is @c NULL, this function does nothing. Otherwise, the window is
* activated. So if is minimized or maximized, the window is restored
* to its original position and size.
*
*@since 1.26
*/
EAPI void
ecore_win32_window_activate(Ecore_Win32_Window *window)
{
if (!window) return;
INF("activate window");
ShowWindow(window->window, SW_RESTORE);
window->iconified = EINA_FALSE;
}
/**
* @brief Set the title of the given window.
*
@ -1336,6 +1360,37 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
window->borderless = on;
}
/**
* @brief Maximize or restore the given window.
*
* @param window The window.
* @param on @c EINA_TRUE for maximized window, @c EINA_FALSE to
* restore it.
*
* This function maximizes @p window if @p on is set
* to @c EINA_TRUE, or restores the window if it is set to
* @c EINA_FALSE. If @p window is @c NULL or if the state
* does not change (like setting to fullscreenmaximized the window is already
* maximized), this function does nothing.
*
* @since 1.26
*/
EAPI void
ecore_win32_window_maximized_set(Ecore_Win32_Window *window,
Eina_Bool on)
{
if (!window) return;
if (((window->maximized) && (on)) ||
((!window->maximized) && (!on)))
return;
INF("maximizing window: %s", on ? "yes" : "no");
ShowWindow(window->window, on ? SW_MAXIMIZE : SW_RESTORE);
window->maximized = on;
}
/**
* @brief Set the given window to fullscreen.
*
@ -1502,8 +1557,7 @@ ecore_win32_window_state_set(Ecore_Win32_Window *window,
window->state.maximized_horz = 1;
break;
case ECORE_WIN32_WINDOW_STATE_MAXIMIZED:
window->state.maximized_horz = 1;
window->state.maximized_vert = 1;
window->state.maximized = 1;
break;
case ECORE_WIN32_WINDOW_STATE_SHADED:
window->state.shaded = 1;

View File

@ -73,6 +73,7 @@ struct _Ecore_Evas_Engine_Data_Win32
{
unsigned char region : 1;
unsigned char fullscreen : 1;
unsigned char maximized : 1;
} state;
};
@ -100,6 +101,7 @@ static Eina_Bool _ecore_evas_win32_event_window_delete_request(void *data EINA_U
static Eina_Bool _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
/* Private functions */
static int
@ -433,9 +435,11 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
{
struct {
struct {
unsigned char maximized : 1;
unsigned char fullscreen : 1;
} win32;
struct {
Eina_Bool maximized : 1;
Eina_Bool fullscreen : 1;
} prop;
} prev;
@ -455,12 +459,16 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
wdata = ee->engine.data;
prev.win32.fullscreen = wdata->state.fullscreen;
prev.win32.maximized = wdata->state.maximized;
prev.prop.fullscreen = ee->prop.fullscreen;
prev.prop.maximized = ee->prop.maximized;
wdata->state.fullscreen = 0;
wdata->state.maximized = 0;
ee->prop.fullscreen = EINA_FALSE;
ee->prop.maximized = EINA_FALSE;
/* we get the states status */
ecore_win32_window_state_get(e->window, &state, &num);
@ -474,6 +482,10 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
ee->prop.fullscreen = 1;
wdata->state.fullscreen = 1;
break;
case ECORE_WIN32_WINDOW_STATE_MAXIMIZED:
ee->prop.maximized = 1;
wdata->state.maximized = 1;
break;
default:
break;
}
@ -482,7 +494,9 @@ _ecore_evas_win32_event_window_property_change(void *data EINA_UNUSED, int type
}
if ((prev.win32.fullscreen != wdata->state.fullscreen) ||
(prev.prop.fullscreen != ee->prop.fullscreen))
(prev.prop.fullscreen != ee->prop.fullscreen) ||
(prev.win32.maximized != wdata->state.maximized) ||
(prev.prop.maximized != ee->prop.maximized))
{
if (ee->func.fn_state_change)
ee->func.fn_state_change(ee);
@ -507,6 +521,8 @@ _ecore_evas_win32_state_update(Ecore_Evas *ee)
state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED_VERT;
if (ee->prop.maximized)
state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED_HORZ;
if (ee->prop.maximized)
state[num++] = ECORE_WIN32_WINDOW_STATE_MAXIMIZED;
// if (bd->client.netwm.state.shaded)
// state[num++] = ECORE_WIN32_WINDOW_STATE_SHADED;
/* if (ee->prop.focus_skip) */
@ -830,7 +846,8 @@ _ecore_evas_win32_activate(Ecore_Evas *ee)
{
INF("ecore evas activate");
ecore_win32_window_focus((Ecore_Win32_Window *)ee->prop.window);
ecore_evas_show(ee);
ecore_win32_window_activate((Ecore_Win32_Window *)ee->prop.window);
}
static void
@ -972,6 +989,30 @@ _ecore_evas_win32_override_set(Ecore_Evas *ee, Eina_Bool on)
ee->prop.override = on;
}
static void
_ecore_evas_win32_maximized_set(Ecore_Evas *ee, Eina_Bool on)
{
Ecore_Evas_Engine_Data_Win32 *wdata = ee->engine.data;
INF("ecore evas maximized set");
wdata->state.maximized = !!on;
if (ee->should_be_visible)
{
struct _Ecore_Win32_Window *window;
window = (Ecore_Win32_Window *)ee->prop.window;
ecore_win32_window_maximized_set(window, on);
}
else
{
if (ee->prop.maximized == on) return;
ee->prop.maximized = on;
wdata->state.maximized = on;
_ecore_evas_win32_state_update(ee);
}
}
static void
_ecore_evas_win32_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
{
@ -1371,7 +1412,7 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
_ecore_evas_win32_iconified_set,
_ecore_evas_win32_borderless_set,
_ecore_evas_win32_override_set,
NULL,
_ecore_evas_win32_maximized_set,
_ecore_evas_win32_fullscreen_set,
NULL, /* _ecore_evas_x_avoid_damage_set */
NULL, /* _ecore_evas_x_withdrawn_set */

View File

@ -1734,12 +1734,12 @@ _copy_attribute(Svg_Node *to, Svg_Node *from)
break;
case SVG_NODE_POLYGON:
to->node.polygon.points_count = from->node.polygon.points_count;
to->node.polygon.points = calloc(to->node.polygon.points_count, sizeof(double));
to->node.polygon.points = malloc(to->node.polygon.points_count * sizeof(double));
memcpy(to->node.polygon.points, from->node.polygon.points, to->node.polygon.points_count * sizeof(double));
break;
case SVG_NODE_POLYLINE:
to->node.polyline.points_count = from->node.polyline.points_count;
to->node.polyline.points = calloc(to->node.polyline.points_count, sizeof(double));
to->node.polyline.points = malloc(to->node.polyline.points_count * sizeof(double));
memcpy(to->node.polyline.points, from->node.polyline.points, to->node.polyline.points_count * sizeof(double));
break;
default: