2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2018-04-03 04:27:30 -07:00
|
|
|
#define EFL_ACCESS_OBJECT_PROTECTED
|
2017-09-11 23:49:29 -07:00
|
|
|
#define EFL_ACCESS_COMPONENT_PROTECTED
|
2017-11-15 18:31:26 -08:00
|
|
|
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
|
2016-08-30 23:41:12 -07:00
|
|
|
#define EFL_INPUT_EVENT_PROTECTED
|
2019-02-21 09:19:45 -08:00
|
|
|
#define EFL_GFX_HINT_PROTECTED
|
2017-05-16 05:47:52 -07:00
|
|
|
#define EFL_CANVAS_OBJECT_PROTECTED
|
2018-12-21 14:46:10 -08:00
|
|
|
#define EFL_UI_L10N_PROTECTED
|
2017-08-17 07:48:06 -07:00
|
|
|
#define EFL_UI_WIN_INLINED_PROTECTED
|
2017-11-14 09:56:08 -08:00
|
|
|
#define EFL_UI_FOCUS_OBJECT_PROTECTED
|
2018-05-16 10:30:28 -07:00
|
|
|
#define EFL_UI_WIDGET_FOCUS_MANAGER_PROTECTED
|
2018-05-03 16:34:17 -07:00
|
|
|
#define EFL_PART_PROTECTED
|
2018-08-08 06:37:29 -07:00
|
|
|
#define IPA_YLNO_ESU_LANRETNI_MLE
|
2014-10-17 08:56:11 -07:00
|
|
|
|
2012-01-12 01:10:27 -08:00
|
|
|
#include <Elementary.h>
|
2012-08-06 05:05:53 -07:00
|
|
|
#include <Elementary_Cursor.h>
|
2013-04-25 22:13:00 -07:00
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
#include "elm_priv.h"
|
2013-01-17 14:11:27 -08:00
|
|
|
#include "elm_widget_menu.h"
|
2016-04-07 11:14:14 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
# include "ecore_evas_wayland_private.h"
|
|
|
|
#endif
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2016-04-25 02:15:19 -07:00
|
|
|
#include "../evas/canvas/evas_box.eo.h"
|
|
|
|
|
2016-06-01 22:36:55 -07:00
|
|
|
#define EFL_INTERNAL_UNSTABLE
|
|
|
|
#include "interfaces/efl_common_internal.h"
|
|
|
|
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
#include "elm_part_helper.h"
|
edje/elm: Rename _internal_ to _part_ (EO)
In Edje and Elementary, we have part objects, which are what is returned
by the interface efl_part(). Those objects can't be of an opaque type as
this doesn't work nicely with strongly typed languages such as C++ or
C#. In JS, Lua, C the types are weak and mostly runtime-based so it
doesn't matter much.
As a consequence, the documentation and the types need to look nice in
this EO API. Thus, we remove the abusive term "internal" and explicitly
call all those classes "part" something.
Eventually we want the types to be declared in the EO file so bindings
(C#, C++, ...) can generate the proper access methods, returning the
best possible types.
Note that right now a few of those part types are used in the legacy API
but don't actually need to be exposed externally.
This is kind of a mega commit that does all the renaming at once, but
it's really just a big sed operation. The power of good IDEs :)
Ref T5315
Ref T5306
2017-09-12 21:29:25 -07:00
|
|
|
#include "efl_ui_win_part.eo.h"
|
2017-12-11 17:02:23 -08:00
|
|
|
#include "elm_plug.eo.h"
|
2018-04-02 00:46:14 -07:00
|
|
|
#include "efl_ui_win_legacy.eo.h"
|
2018-05-31 05:39:34 -07:00
|
|
|
#include "efl_ui_win_socket_legacy.eo.h"
|
|
|
|
#include "efl_ui_win_inlined_legacy.eo.h"
|
2019-02-27 10:52:14 -08:00
|
|
|
#include "efl_ui_widget_common.h"
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
#define MY_CLASS EFL_UI_WIN_CLASS
|
2016-07-12 02:03:54 -07:00
|
|
|
#define MY_CLASS_NAME "Efl.Ui.Win"
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_win"
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2016-12-07 02:27:05 -08:00
|
|
|
#define FRAME_OBJ_THEME_MIN_VERSION 119
|
|
|
|
|
2018-08-16 07:17:23 -07:00
|
|
|
Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
|
|
|
|
Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
|
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
static const Elm_Win_Trap *trap = NULL;
|
|
|
|
|
2017-09-25 15:48:53 -07:00
|
|
|
static int _paused_windows = 0;
|
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
#define TRAP(sd, name, ...) \
|
|
|
|
do \
|
|
|
|
{ \
|
2015-01-09 21:33:55 -08:00
|
|
|
if (sd->type != ELM_WIN_FAKE) \
|
|
|
|
if ((!trap) || (!trap->name) || \
|
|
|
|
((trap->name) && \
|
|
|
|
(trap->name(sd->trap_data, sd->obj, ## __VA_ARGS__)))) \
|
|
|
|
ecore_evas_##name(sd->ee, ##__VA_ARGS__); \
|
2012-07-18 21:35:50 -07:00
|
|
|
} \
|
|
|
|
while (0)
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
#define ELM_WIN_DATA_GET(o, sd) \
|
2016-08-15 06:44:41 -07:00
|
|
|
Efl_Ui_Win_Data * sd = efl_data_scope_get(o, MY_CLASS)
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2016-04-26 23:21:49 -07:00
|
|
|
#define ELM_WIN_DATA_GET_OR_RETURN(o, ptr, ...) \
|
2012-05-03 15:42:15 -07:00
|
|
|
ELM_WIN_DATA_GET(o, ptr); \
|
|
|
|
if (!ptr) \
|
|
|
|
{ \
|
2018-01-31 19:16:28 -08:00
|
|
|
ERR("No widget data for object %p (%s)", \
|
2016-08-15 06:44:41 -07:00
|
|
|
o, efl_class_name_get(o)); \
|
2016-04-26 23:21:49 -07:00
|
|
|
return __VA_ARGS__; \
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
2017-08-10 18:24:54 -07:00
|
|
|
// Ecore_Evas callbacks are unsafe unlike EO calls. As a consequence a user
|
|
|
|
// callback (eg evas cb, efl event cb, ...) could be triggered that deletes the
|
|
|
|
// object. This macro ensures the sd data is still valid after a foreign call.
|
|
|
|
#define ELM_WIN_DATA_ALIVE_CHECK(_obj, _sd, ...) do { \
|
|
|
|
_sd = efl_data_scope_safe_get(_obj, MY_CLASS); \
|
|
|
|
if (EINA_UNLIKELY(!(_sd))) { return __VA_ARGS__; } \
|
|
|
|
} while (0)
|
|
|
|
|
2015-06-16 21:54:42 -07:00
|
|
|
#define ENGINE_GET() (_elm_preferred_engine ? _elm_preferred_engine : _elm_config->engine)
|
2012-06-15 07:11:47 -07:00
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
typedef struct _Efl_Ui_Win_Data Efl_Ui_Win_Data;
|
2016-08-30 23:41:12 -07:00
|
|
|
typedef struct _Input_Pointer_Iterator Input_Pointer_Iterator;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
struct _Efl_Ui_Win_Data
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2012-07-17 11:46:18 -07:00
|
|
|
Ecore_Evas *ee;
|
|
|
|
Evas *evas;
|
|
|
|
Evas_Object *parent; /* parent *window* object*/
|
|
|
|
Evas_Object *img_obj, *frame_obj;
|
2016-11-17 00:46:14 -08:00
|
|
|
Eo /* wref */ *bg, *content;
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj; /* The object itself */
|
2017-12-11 17:02:23 -08:00
|
|
|
Evas_Object *indicator;
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-06-06 01:25:12 -07:00
|
|
|
struct
|
|
|
|
{
|
2012-07-17 11:46:18 -07:00
|
|
|
Ecore_X_Window xwin;
|
|
|
|
Ecore_Event_Handler *client_message_handler;
|
2012-11-19 08:51:44 -08:00
|
|
|
Ecore_Event_Handler *property_handler;
|
2018-07-11 12:50:09 -07:00
|
|
|
Eina_Bool shaped : 1;
|
2012-06-06 01:25:12 -07:00
|
|
|
} x;
|
2010-09-24 09:41:25 -07:00
|
|
|
#endif
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2012-06-06 06:55:15 -07:00
|
|
|
struct
|
|
|
|
{
|
2015-10-01 07:25:23 -07:00
|
|
|
Ecore_Wl2_Window *win;
|
2016-03-23 13:58:23 -07:00
|
|
|
Ecore_Event_Handler *configure_handler;
|
2012-06-06 06:55:15 -07:00
|
|
|
} wl;
|
|
|
|
#endif
|
2015-10-08 03:01:38 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
struct {
|
|
|
|
Ecore_Cocoa_Window *win;
|
|
|
|
} cocoa;
|
|
|
|
#endif
|
2015-10-15 14:13:42 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Ecore_Win32_Window *win;
|
2017-06-14 23:58:05 -07:00
|
|
|
Ecore_Event_Handler *key_down_handler;
|
2015-10-15 14:13:42 -07:00
|
|
|
} win32;
|
|
|
|
#endif
|
2012-06-06 06:55:15 -07:00
|
|
|
|
2018-01-17 23:20:21 -08:00
|
|
|
unsigned /* Efl_Ui_Win_Type */ type;
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Keyboard_Mode kbdmode;
|
2017-12-11 17:02:23 -08:00
|
|
|
Efl_Ui_Win_Indicator_Mode indimode;
|
2012-03-28 02:02:22 -07:00
|
|
|
struct
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
|
|
|
const char *info;
|
|
|
|
Ecore_Timer *timer;
|
|
|
|
int repeat_count;
|
|
|
|
int shot_counter;
|
|
|
|
} shot;
|
|
|
|
int *autodel_clear, rot;
|
2012-03-28 02:02:22 -07:00
|
|
|
struct
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
} screen;
|
2012-03-28 02:02:22 -07:00
|
|
|
struct
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2016-10-25 11:19:57 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
Ecore_Wl2_Window *win;
|
|
|
|
struct wl_surface *surf;
|
2015-04-29 01:30:18 -07:00
|
|
|
#endif
|
2016-10-25 11:19:57 -07:00
|
|
|
Ecore_Evas *ee;
|
2018-04-03 11:22:10 -07:00
|
|
|
Evas_Object *obj;
|
2012-05-03 15:42:15 -07:00
|
|
|
int hot_x, hot_y;
|
2017-01-30 07:58:55 -08:00
|
|
|
Eina_Bool visible : 1;
|
2012-05-03 15:42:15 -07:00
|
|
|
} pointer;
|
2012-03-28 02:02:22 -07:00
|
|
|
struct
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2013-08-04 01:37:30 -07:00
|
|
|
Evas_Object *fobj; /* focus highlight edje object */
|
2010-10-04 05:48:15 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
Evas_Object *target;
|
|
|
|
Eina_Bool visible : 1;
|
2014-02-10 05:27:08 -08:00
|
|
|
Eina_Bool in_theme: 1; /**< focus highlight is handled by theme.
|
2014-02-04 16:57:34 -08:00
|
|
|
this is set true if edc data item "focus_highlight" is set to "on" during focus in callback. */
|
2012-05-03 15:42:15 -07:00
|
|
|
} cur, prev;
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
const char *style;
|
|
|
|
Ecore_Job *reconf_job;
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
Eina_Bool enabled : 1;
|
2013-08-04 01:09:44 -07:00
|
|
|
Eina_Bool theme_changed : 1; /* set true when the focus theme is changed */
|
2013-08-04 01:52:54 -07:00
|
|
|
Eina_Bool animate : 1; /* set true when the focus highlight animate is enabled */
|
2013-08-11 02:58:28 -07:00
|
|
|
Eina_Bool animate_supported : 1; /* set true when the focus highlight animate is supported by theme */
|
2012-05-03 15:42:15 -07:00
|
|
|
Eina_Bool geometry_changed : 1;
|
2015-03-04 00:47:54 -08:00
|
|
|
Eina_Bool auto_enabled : 1;
|
|
|
|
Eina_Bool auto_animate : 1;
|
2012-05-03 15:42:15 -07:00
|
|
|
} focus_highlight;
|
2012-02-28 03:20:35 -08:00
|
|
|
|
2012-02-29 04:06:12 -08:00
|
|
|
Evas_Object *icon;
|
2012-05-03 15:42:15 -07:00
|
|
|
const char *title;
|
|
|
|
const char *icon_name;
|
|
|
|
const char *role;
|
2016-12-08 00:49:23 -08:00
|
|
|
const char *stack_id;
|
|
|
|
const char *stack_master_id;
|
2015-04-17 15:10:11 -07:00
|
|
|
Eina_Stringshare *name;
|
2016-06-22 19:06:22 -07:00
|
|
|
Eina_Stringshare *accel_pref;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2018-03-12 12:21:15 -07:00
|
|
|
Eina_Future *finalize_future;
|
|
|
|
|
2012-12-27 05:38:33 -08:00
|
|
|
Evas_Object *main_menu;
|
|
|
|
|
2017-10-12 12:25:49 -07:00
|
|
|
Efl_Ui_Focus_Parent_Provider_Standard *provider;
|
2016-11-04 09:44:37 -07:00
|
|
|
|
2012-12-04 22:50:27 -08:00
|
|
|
struct
|
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
Eina_Stringshare *name; /* Current profile in use */
|
|
|
|
Eina_Array *available; /* Never NULL, contains Eina_Stringshare */
|
2012-12-04 22:50:27 -08:00
|
|
|
} profile;
|
2014-02-10 05:09:45 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
int preferred_rot; /* indicates preferred rotation value, -1 means invalid. */
|
|
|
|
int *rots; /* indicates available rotations */
|
|
|
|
unsigned int count; /* number of elements in available rotations */
|
|
|
|
Eina_Bool wm_supported : 1; /* set true when the window manager support window rotation */
|
2018-08-31 01:45:31 -07:00
|
|
|
Eina_Bool use : 1; /* set true when application use window manager rotation. */
|
2014-02-10 05:09:45 -08:00
|
|
|
} wm_rot;
|
2012-12-04 22:50:27 -08:00
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
void *trap_data;
|
|
|
|
|
2016-06-07 23:24:08 -07:00
|
|
|
double aspect; /* defined as w/h or 0 */
|
2012-06-12 03:15:19 -07:00
|
|
|
int size_base_w, size_base_h;
|
|
|
|
int size_step_w, size_step_h;
|
2017-05-12 03:19:29 -07:00
|
|
|
int req_x, req_y, req_w, req_h;
|
2016-11-29 20:55:54 -08:00
|
|
|
int max_w, max_h;
|
2012-08-21 01:48:47 -07:00
|
|
|
int norender;
|
2014-04-09 03:04:55 -07:00
|
|
|
int modal_count;
|
2016-03-24 23:11:38 -07:00
|
|
|
int response;
|
2019-02-27 10:52:14 -08:00
|
|
|
int rotation;
|
2017-05-12 03:19:29 -07:00
|
|
|
Eina_Bool req_wh : 1;
|
|
|
|
Eina_Bool req_xy : 1;
|
2016-06-13 01:28:36 -07:00
|
|
|
|
|
|
|
struct {
|
|
|
|
short pointer_move;
|
|
|
|
short pointer_down;
|
|
|
|
short pointer_up;
|
|
|
|
short pointer_in;
|
|
|
|
short pointer_out;
|
|
|
|
short pointer_cancel;
|
|
|
|
short pointer_wheel;
|
2016-08-30 23:41:12 -07:00
|
|
|
short finger_move;
|
|
|
|
short finger_down;
|
|
|
|
short finger_up;
|
2016-06-13 01:28:36 -07:00
|
|
|
short key_down;
|
|
|
|
short key_up;
|
|
|
|
short render_pre;
|
|
|
|
short render_post;
|
|
|
|
short focus_in;
|
|
|
|
short focus_out;
|
|
|
|
short object_focus_in;
|
|
|
|
short object_focus_out;
|
|
|
|
short device_changed;
|
|
|
|
} event_forward;
|
|
|
|
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
struct {
|
2016-11-17 00:46:14 -08:00
|
|
|
/* frame_obj is always used except for FAKE */
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
Eina_Bool need : 1; /**< if true, application draws its own csd */
|
|
|
|
Eina_Bool need_shadow : 1; /**< if true, application draws its csd and shadow */
|
|
|
|
Eina_Bool need_borderless : 1;
|
|
|
|
Eina_Bool need_bg_solid : 1;
|
2016-11-29 22:06:09 -08:00
|
|
|
Eina_Bool need_bg_standard : 1;
|
2016-11-28 00:24:18 -08:00
|
|
|
Eina_Bool need_menu : 1;
|
2016-11-20 22:48:09 -08:00
|
|
|
Eina_Bool need_unresizable : 1;
|
2017-12-11 17:02:23 -08:00
|
|
|
Eina_Bool need_indicator : 1;
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
Eina_Bool cur_borderless : 1;
|
|
|
|
Eina_Bool cur_shadow : 1;
|
|
|
|
Eina_Bool cur_focus : 1;
|
|
|
|
Eina_Bool cur_maximized : 1;
|
|
|
|
Eina_Bool cur_bg_solid : 1;
|
2016-11-29 22:06:09 -08:00
|
|
|
Eina_Bool cur_bg_standard : 1;
|
2016-11-28 00:24:18 -08:00
|
|
|
Eina_Bool cur_menu : 1;
|
2016-11-20 22:48:09 -08:00
|
|
|
Eina_Bool cur_unresizable : 1;
|
2017-12-11 17:02:23 -08:00
|
|
|
Eina_Bool cur_indicator : 1;
|
2016-11-23 03:21:57 -08:00
|
|
|
Eina_Bool wayland : 1;
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
} csd;
|
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
struct {
|
|
|
|
Evas_Object *box, *edje;
|
2017-12-11 17:02:23 -08:00
|
|
|
Elm_Win_Indicator_Mode indmode;
|
|
|
|
Elm_Win_Indicator_Opacity_Mode ind_o_mode;
|
2016-11-17 00:46:14 -08:00
|
|
|
Eina_Bool forbidden : 1; /**< Marks some legacy APIs as not allowed. */
|
2016-11-22 00:34:17 -08:00
|
|
|
Eina_Bool bg_must_swallow : 1; /**< Legacy theme compatibility (elm_bg for standard window) */
|
|
|
|
Eina_Bool bg_must_swallow_init : 1;
|
2017-05-16 05:47:52 -07:00
|
|
|
Eina_Bool ctor : 1; /**< legacy constructor: elm_win~add */
|
2016-11-17 00:46:14 -08:00
|
|
|
} legacy;
|
|
|
|
|
2019-01-31 08:54:58 -08:00
|
|
|
Eina_Value exit_on_close;
|
|
|
|
|
2016-12-05 22:19:03 -08:00
|
|
|
Eina_Bool first_draw : 1;
|
|
|
|
Eina_Bool deferred_resize_job : 1;
|
2012-05-03 15:42:15 -07:00
|
|
|
Eina_Bool urgent : 1;
|
|
|
|
Eina_Bool modal : 1;
|
|
|
|
Eina_Bool demand_attention : 1;
|
|
|
|
Eina_Bool autodel : 1;
|
2015-07-01 07:40:57 -07:00
|
|
|
Eina_Bool autohide : 1;
|
2012-05-03 15:42:15 -07:00
|
|
|
Eina_Bool constrain : 1;
|
|
|
|
Eina_Bool resizing : 1;
|
2019-02-28 02:21:43 -08:00
|
|
|
Eina_Bool minimized : 1;
|
2012-05-03 15:42:15 -07:00
|
|
|
Eina_Bool withdrawn : 1;
|
|
|
|
Eina_Bool sticky : 1;
|
|
|
|
Eina_Bool fullscreen : 1;
|
|
|
|
Eina_Bool maximized : 1;
|
|
|
|
Eina_Bool skip_focus : 1;
|
2012-09-14 06:06:57 -07:00
|
|
|
Eina_Bool floating : 1;
|
2014-07-20 19:39:32 -07:00
|
|
|
Eina_Bool noblank : 1;
|
2014-12-15 09:09:16 -08:00
|
|
|
Eina_Bool theme_alpha : 1; /**< alpha value fetched by a theme. this has higher priority than application_alpha */
|
|
|
|
Eina_Bool application_alpha : 1; /**< alpha value set by an elm_win_alpha_set() api. this has lower priority than theme_alpha */
|
2016-11-29 20:55:54 -08:00
|
|
|
Eina_Bool tmp_updating_hints : 1;
|
2016-11-30 21:41:06 -08:00
|
|
|
Eina_Bool single_edje_content: 1; /* hack for E */
|
2016-12-08 00:49:23 -08:00
|
|
|
Eina_Bool shown : 1;
|
2016-12-18 22:39:36 -08:00
|
|
|
Eina_Bool stack_base : 1;
|
2017-09-25 15:48:53 -07:00
|
|
|
Eina_Bool paused : 1;
|
2008-09-29 23:58:56 -07:00
|
|
|
};
|
|
|
|
|
2016-08-30 23:41:12 -07:00
|
|
|
struct _Input_Pointer_Iterator
|
|
|
|
{
|
|
|
|
Eina_Iterator iterator;
|
|
|
|
Eina_List *list;
|
|
|
|
Eina_Iterator *real_iterator;
|
|
|
|
const Eo *object;
|
|
|
|
};
|
|
|
|
|
2011-04-21 17:42:32 -07:00
|
|
|
static const char SIG_DELETE_REQUEST[] = "delete,request";
|
2015-10-19 11:44:50 -07:00
|
|
|
static const char SIG_FOCUS_OUT[] = "focus,out"; // deprecated. use "unfocused" instead.
|
|
|
|
static const char SIG_FOCUS_IN[] = "focus,in"; // deprecated. use "focused" instead.
|
2011-04-21 17:42:32 -07:00
|
|
|
static const char SIG_MOVED[] = "moved";
|
2012-02-28 03:20:35 -08:00
|
|
|
static const char SIG_WITHDRAWN[] = "withdrawn";
|
2019-02-28 02:21:43 -08:00
|
|
|
static const char SIG_MINIMIZED[] = "minimized";
|
2012-02-28 03:20:35 -08:00
|
|
|
static const char SIG_NORMAL[] = "normal";
|
|
|
|
static const char SIG_STICK[] = "stick";
|
|
|
|
static const char SIG_UNSTICK[] = "unstick";
|
|
|
|
static const char SIG_FULLSCREEN[] = "fullscreen";
|
|
|
|
static const char SIG_UNFULLSCREEN[] = "unfullscreen";
|
|
|
|
static const char SIG_MAXIMIZED[] = "maximized";
|
|
|
|
static const char SIG_UNMAXIMIZED[] = "unmaximized";
|
2012-08-05 21:09:02 -07:00
|
|
|
static const char SIG_IOERR[] = "ioerr";
|
2012-09-02 23:55:07 -07:00
|
|
|
static const char SIG_INDICATOR_PROP_CHANGED[] = "indicator,prop,changed";
|
|
|
|
static const char SIG_ROTATION_CHANGED[] = "rotation,changed";
|
2012-12-04 22:50:27 -08:00
|
|
|
static const char SIG_PROFILE_CHANGED[] = "profile,changed";
|
2014-02-10 05:09:45 -08:00
|
|
|
static const char SIG_WM_ROTATION_CHANGED[] = "wm,rotation,changed";
|
2011-04-21 17:42:32 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2011-04-21 17:42:32 -07:00
|
|
|
{SIG_DELETE_REQUEST, ""},
|
|
|
|
{SIG_FOCUS_OUT, ""},
|
|
|
|
{SIG_FOCUS_IN, ""},
|
|
|
|
{SIG_MOVED, ""},
|
2012-02-28 03:20:35 -08:00
|
|
|
{SIG_WITHDRAWN, ""},
|
2019-02-28 02:21:43 -08:00
|
|
|
{SIG_MINIMIZED, ""},
|
2012-02-28 03:20:35 -08:00
|
|
|
{SIG_NORMAL, ""},
|
|
|
|
{SIG_STICK, ""},
|
|
|
|
{SIG_UNSTICK, ""},
|
|
|
|
{SIG_FULLSCREEN, ""},
|
|
|
|
{SIG_UNFULLSCREEN, ""},
|
|
|
|
{SIG_MAXIMIZED, ""},
|
|
|
|
{SIG_UNMAXIMIZED, ""},
|
2012-08-05 21:09:02 -07:00
|
|
|
{SIG_IOERR, ""},
|
2012-09-02 23:55:07 -07:00
|
|
|
{SIG_INDICATOR_PROP_CHANGED, ""},
|
|
|
|
{SIG_ROTATION_CHANGED, ""},
|
2012-12-04 22:50:27 -08:00
|
|
|
{SIG_PROFILE_CHANGED, ""},
|
2014-02-10 05:09:45 -08:00
|
|
|
{SIG_WM_ROTATION_CHANGED, ""},
|
2014-07-14 10:06:10 -07:00
|
|
|
{SIG_WIDGET_FOCUSED, ""}, /**< handled by elm_widget */
|
|
|
|
{SIG_WIDGET_UNFOCUSED, ""}, /**< handled by elm_widget */
|
2011-04-21 17:42:32 -07:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2014-04-15 18:38:34 -07:00
|
|
|
static Eina_Bool _key_action_return(Evas_Object *obj, const char *params);
|
|
|
|
static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
|
|
|
|
|
|
|
|
static const Elm_Action key_actions[] = {
|
|
|
|
{"return", _key_action_return},
|
|
|
|
{"move", _key_action_move},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2010-04-12 01:27:10 -07:00
|
|
|
Eina_List *_elm_win_list = NULL;
|
2011-03-09 22:35:33 -08:00
|
|
|
int _elm_win_deferred_free = 0;
|
2019-01-31 08:54:54 -08:00
|
|
|
static Eina_Value exit_on_all_windows_closed;
|
2008-10-06 18:23:49 -07:00
|
|
|
|
2016-06-14 02:03:32 -07:00
|
|
|
static Eina_Bool _elm_win_throttle_ok = EINA_FALSE;
|
2012-08-28 03:37:02 -07:00
|
|
|
static int _elm_win_count = 0;
|
|
|
|
|
|
|
|
static Eina_Bool _elm_win_auto_throttled = EINA_FALSE;
|
|
|
|
|
2015-05-27 20:27:59 -07:00
|
|
|
static Ecore_Timer *_elm_win_state_eval_timer = NULL;
|
2012-08-28 03:37:02 -07:00
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
static void _elm_win_legacy_init(Efl_Ui_Win_Data *sd);
|
2013-01-17 14:11:15 -08:00
|
|
|
static void
|
|
|
|
_elm_win_on_resize_obj_changed_size_hints(void *data,
|
|
|
|
Evas *e,
|
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info);
|
2014-02-17 23:15:55 -08:00
|
|
|
static void
|
|
|
|
_elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj);
|
2018-11-19 20:56:37 -08:00
|
|
|
static Efl_Ui_Theme_Apply_Result _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd);
|
2017-01-13 01:04:17 -08:00
|
|
|
static void _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
static void _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool calc);
|
|
|
|
static inline void _elm_win_need_frame_adjust(Efl_Ui_Win_Data *sd, const char *engine);
|
2017-07-04 02:18:07 -07:00
|
|
|
static void _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize);
|
2018-04-17 11:55:35 -07:00
|
|
|
static void _elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force);
|
2014-02-17 23:15:55 -08:00
|
|
|
|
2014-02-10 05:09:45 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2016-06-07 07:41:48 -07:00
|
|
|
static void _elm_win_xwin_update(Efl_Ui_Win_Data *sd);
|
2014-02-10 05:09:45 -08:00
|
|
|
#endif
|
2013-01-17 14:11:15 -08:00
|
|
|
|
2013-03-20 01:37:40 -07:00
|
|
|
EAPI double _elm_startup_time = 0;
|
|
|
|
|
|
|
|
static void
|
2013-08-11 01:30:56 -07:00
|
|
|
_elm_win_first_frame_do(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
|
2013-03-20 01:37:40 -07:00
|
|
|
{
|
2014-11-02 21:38:17 -08:00
|
|
|
double end = ecore_time_unix_get();
|
2013-08-11 01:30:56 -07:00
|
|
|
char *first = data;
|
2013-03-20 01:37:40 -07:00
|
|
|
|
|
|
|
switch (*first)
|
|
|
|
{
|
|
|
|
case 'A': abort();
|
|
|
|
case 'E':
|
|
|
|
case 'D': exit(-1);
|
2013-08-01 04:03:19 -07:00
|
|
|
case 'T': fprintf(stderr, "Startup time: '%f' - '%f' = '%f' sec\n", end, _elm_startup_time, end - _elm_startup_time);
|
2013-08-11 01:30:56 -07:00
|
|
|
break;
|
2013-03-20 01:37:40 -07:00
|
|
|
}
|
|
|
|
|
2013-08-11 01:30:56 -07:00
|
|
|
evas_event_callback_del_full(e, EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, data);
|
2013-03-20 01:37:40 -07:00
|
|
|
}
|
|
|
|
|
2014-07-20 19:39:32 -07:00
|
|
|
static void
|
|
|
|
_win_noblank_eval(void)
|
|
|
|
{
|
2016-05-15 06:41:12 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2014-07-20 19:39:32 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
|
|
|
int noblanks = 0;
|
2014-08-07 07:19:24 -07:00
|
|
|
Eina_Bool change = EINA_FALSE;
|
2014-07-20 19:39:32 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
2019-02-28 02:21:43 -08:00
|
|
|
if ((sd->noblank) && (!sd->minimized) && (!sd->withdrawn) &&
|
2014-07-20 19:39:32 -07:00
|
|
|
evas_object_visible_get(obj))
|
2014-08-07 07:19:24 -07:00
|
|
|
noblanks++;
|
|
|
|
|
|
|
|
change = EINA_TRUE;
|
2014-07-20 19:39:32 -07:00
|
|
|
}
|
|
|
|
}
|
2014-07-24 10:50:39 -07:00
|
|
|
|
2014-08-07 07:19:24 -07:00
|
|
|
if (!change) return;
|
|
|
|
|
2015-02-05 03:44:49 -08:00
|
|
|
if (noblanks > 0) ecore_x_screensaver_suspend();
|
2014-08-10 15:59:45 -07:00
|
|
|
else ecore_x_screensaver_resume();
|
2014-07-20 19:39:32 -07:00
|
|
|
#endif
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-07-20 19:39:32 -07:00
|
|
|
// XXX: no wl implementation of this yet - maybe higher up at prop level
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-09-03 23:09:10 -07:00
|
|
|
static Elm_Process_State _elm_process_state = ELM_PROCESS_STATE_FOREGROUND;
|
|
|
|
|
|
|
|
EAPI Elm_Process_State
|
|
|
|
elm_process_state_get(void)
|
|
|
|
{
|
|
|
|
return _elm_process_state;
|
|
|
|
}
|
|
|
|
|
2014-12-10 21:43:53 -08:00
|
|
|
static void
|
2018-07-11 12:50:09 -07:00
|
|
|
_elm_win_apply_alpha(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2014-12-10 21:43:53 -08:00
|
|
|
{
|
|
|
|
Eina_Bool enabled;
|
|
|
|
|
2016-10-27 00:55:16 -07:00
|
|
|
if (!sd->ee) return;
|
|
|
|
|
2014-12-10 21:43:53 -08:00
|
|
|
enabled = sd->theme_alpha | sd->application_alpha;
|
|
|
|
if (sd->img_obj)
|
|
|
|
{
|
|
|
|
evas_object_image_alpha_set(sd->img_obj, enabled);
|
|
|
|
ecore_evas_alpha_set(sd->ee, enabled);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
2016-11-29 17:51:51 -08:00
|
|
|
enabled |= (sd->csd.need && !sd->fullscreen);
|
2018-07-11 12:50:09 -07:00
|
|
|
if (!ecore_x_screen_is_composited(0))
|
2014-12-10 21:43:53 -08:00
|
|
|
{
|
2018-07-11 12:50:09 -07:00
|
|
|
if (enabled || (!sd->x.shaped))
|
|
|
|
TRAP(sd, shaped_set, enabled);
|
2014-12-10 21:43:53 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
TRAP(sd, alpha_set, enabled);
|
|
|
|
}
|
|
|
|
else
|
2016-05-15 06:41:12 -07:00
|
|
|
#else
|
|
|
|
(void)obj;
|
2014-12-10 21:43:53 -08:00
|
|
|
#endif
|
|
|
|
TRAP(sd, alpha_set, enabled);
|
|
|
|
}
|
|
|
|
}
|
2014-09-03 23:09:10 -07:00
|
|
|
|
2018-04-17 12:01:39 -07:00
|
|
|
/* auto norender withdrawn is really only for X11.
|
|
|
|
* On other backends like wayland, there's actually
|
|
|
|
* no way for a client to tell if the window is
|
2019-02-28 02:21:43 -08:00
|
|
|
* minimized or not. You can request minimized state
|
|
|
|
* but there's no explicit feedback for minimization
|
2018-04-17 12:01:39 -07:00
|
|
|
* or return to normal state.
|
|
|
|
*
|
|
|
|
* So, blocking drawing based on client side thinking
|
2019-02-28 02:21:43 -08:00
|
|
|
* it's minimized, and having the compositor think
|
2018-04-17 12:01:39 -07:00
|
|
|
* the client should be drawing will lead to
|
|
|
|
* predictably disappointing results.
|
|
|
|
*
|
|
|
|
* If you maintain a backend that is really capable
|
|
|
|
* of handling this properly, feel free to extend
|
|
|
|
* the whitelist.
|
|
|
|
*/
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_win_auto_norender_withdrawn(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
const char *engine;
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
|
|
|
|
if (!sd)
|
|
|
|
return _elm_config->auto_norender_withdrawn;
|
|
|
|
|
|
|
|
engine = ecore_evas_engine_name_get(sd->ee);
|
|
|
|
if (!strcmp(engine, ELM_SOFTWARE_X11) || !strcmp(engine, ELM_OPENGL_X11))
|
|
|
|
return _elm_config->auto_norender_withdrawn;
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-27 20:27:59 -07:00
|
|
|
static Eina_Bool
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_state_eval(void *data EINA_UNUSED)
|
2012-08-28 03:37:02 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
2013-01-14 01:46:25 -08:00
|
|
|
int _elm_win_count_shown = 0;
|
2019-02-28 02:21:43 -08:00
|
|
|
int _elm_win_count_minimized = 0;
|
2013-01-14 01:46:25 -08:00
|
|
|
int _elm_win_count_withdrawn = 0;
|
2014-09-03 23:09:10 -07:00
|
|
|
Eina_Bool throttle = EINA_FALSE;
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2015-05-27 20:27:59 -07:00
|
|
|
_elm_win_state_eval_timer = NULL;
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2015-05-27 20:27:59 -07:00
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
2012-08-28 03:37:02 -07:00
|
|
|
{
|
2018-04-17 12:01:39 -07:00
|
|
|
if (_elm_win_auto_norender_withdrawn(obj))
|
2012-08-28 03:37:02 -07:00
|
|
|
{
|
|
|
|
if ((elm_win_withdrawn_get(obj)) ||
|
2012-10-10 17:35:00 -07:00
|
|
|
((elm_win_iconified_get(obj) &&
|
2012-08-28 03:37:02 -07:00
|
|
|
(_elm_config->auto_norender_iconified_same_as_withdrawn))))
|
|
|
|
{
|
|
|
|
if (!evas_object_data_get(obj, "__win_auto_norender"))
|
|
|
|
{
|
|
|
|
Evas *evas = evas_object_evas_get(obj);
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2012-08-28 03:37:02 -07:00
|
|
|
elm_win_norender_push(obj);
|
|
|
|
evas_object_data_set(obj, "__win_auto_norender", obj);
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2012-08-28 03:37:02 -07:00
|
|
|
if (_elm_config->auto_flush_withdrawn)
|
|
|
|
{
|
|
|
|
edje_file_cache_flush();
|
|
|
|
edje_collection_cache_flush();
|
|
|
|
evas_image_cache_flush(evas);
|
|
|
|
evas_font_cache_flush(evas);
|
|
|
|
}
|
|
|
|
if (_elm_config->auto_dump_withdrawn)
|
|
|
|
{
|
|
|
|
evas_render_dump(evas);
|
|
|
|
}
|
|
|
|
}
|
2017-09-25 15:48:53 -07:00
|
|
|
|
2017-11-15 16:27:22 -08:00
|
|
|
if (elm_win_iconified_get(obj))
|
|
|
|
efl_event_callback_call(obj, EFL_UI_WIN_EVENT_PAUSE, NULL);
|
2015-08-06 23:29:49 -07:00
|
|
|
continue;
|
2012-08-28 03:37:02 -07:00
|
|
|
}
|
|
|
|
}
|
2015-08-06 23:29:49 -07:00
|
|
|
if (evas_object_data_get(obj, "__win_auto_norender"))
|
2015-05-27 20:27:59 -07:00
|
|
|
{
|
2015-08-06 23:29:49 -07:00
|
|
|
elm_win_norender_pop(obj);
|
|
|
|
evas_object_data_del(obj, "__win_auto_norender");
|
2015-05-27 20:27:59 -07:00
|
|
|
}
|
2012-08-28 03:37:02 -07:00
|
|
|
}
|
2013-07-25 06:17:52 -07:00
|
|
|
if (((_elm_config->auto_throttle) &&
|
|
|
|
(elm_policy_get(ELM_POLICY_THROTTLE) != ELM_POLICY_THROTTLE_NEVER)) ||
|
|
|
|
(elm_policy_get(ELM_POLICY_THROTTLE) == ELM_POLICY_THROTTLE_HIDDEN_ALWAYS))
|
2014-09-03 23:09:10 -07:00
|
|
|
throttle = EINA_TRUE;
|
|
|
|
if (_elm_win_count == 0)
|
2012-08-28 03:37:02 -07:00
|
|
|
{
|
2016-06-14 02:03:32 -07:00
|
|
|
if ((_elm_win_throttle_ok) && (_elm_win_auto_throttled))
|
2012-08-28 03:37:02 -07:00
|
|
|
{
|
2014-09-03 23:09:10 -07:00
|
|
|
_elm_process_state = ELM_PROCESS_STATE_FOREGROUND;
|
|
|
|
ecore_event_add(ELM_EVENT_PROCESS_FOREGROUND, NULL, NULL, NULL);
|
|
|
|
if (throttle)
|
|
|
|
ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
|
|
|
|
_elm_win_auto_throttled = EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
|
|
|
{
|
|
|
|
if (elm_win_withdrawn_get(obj)) _elm_win_count_withdrawn++;
|
2019-02-28 02:21:43 -08:00
|
|
|
else if (elm_win_iconified_get(obj)) _elm_win_count_minimized++;
|
2014-09-03 23:09:10 -07:00
|
|
|
else if (evas_object_visible_get(obj)) _elm_win_count_shown++;
|
|
|
|
}
|
|
|
|
if (_elm_win_count_shown <= 0)
|
|
|
|
{
|
2016-06-14 02:03:32 -07:00
|
|
|
if ((_elm_win_throttle_ok) && (!_elm_win_auto_throttled))
|
2012-08-28 03:37:02 -07:00
|
|
|
{
|
2014-09-03 23:09:10 -07:00
|
|
|
_elm_process_state = ELM_PROCESS_STATE_BACKGROUND;
|
|
|
|
ecore_event_add(ELM_EVENT_PROCESS_BACKGROUND, NULL, NULL, NULL);
|
|
|
|
if (throttle)
|
|
|
|
ecore_throttle_adjust(_elm_config->auto_throttle_amount);
|
|
|
|
_elm_win_auto_throttled = EINA_TRUE;
|
2012-08-28 03:37:02 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-06-14 02:03:32 -07:00
|
|
|
if ((_elm_win_throttle_ok) && (_elm_win_auto_throttled))
|
2012-08-28 03:37:02 -07:00
|
|
|
{
|
2014-09-03 23:09:10 -07:00
|
|
|
_elm_process_state = ELM_PROCESS_STATE_FOREGROUND;
|
|
|
|
ecore_event_add(ELM_EVENT_PROCESS_FOREGROUND, NULL, NULL, NULL);
|
|
|
|
if (throttle)
|
|
|
|
ecore_throttle_adjust(-_elm_config->auto_throttle_amount);
|
|
|
|
_elm_win_auto_throttled = EINA_FALSE;
|
2012-08-28 03:37:02 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-07-20 19:39:32 -07:00
|
|
|
_win_noblank_eval();
|
2015-05-27 20:27:59 -07:00
|
|
|
return EINA_FALSE;
|
2012-08-28 03:37:02 -07:00
|
|
|
}
|
|
|
|
|
2015-07-01 07:40:57 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_elm_win_policy_quit_triggered(Eo* triggering_obj)
|
|
|
|
{
|
|
|
|
if (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *win;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, win)
|
|
|
|
if (win != triggering_obj && evas_object_visible_get(win) == EINA_TRUE)
|
|
|
|
{
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_flush_cache_and_exit(Eo *obj)
|
|
|
|
{
|
|
|
|
edje_file_cache_flush();
|
|
|
|
edje_collection_cache_flush();
|
|
|
|
evas_image_cache_flush(evas_object_evas_get(obj));
|
|
|
|
evas_font_cache_flush(evas_object_evas_get(obj));
|
|
|
|
elm_exit();
|
|
|
|
}
|
|
|
|
|
2012-08-28 03:37:02 -07:00
|
|
|
static void
|
|
|
|
_elm_win_state_eval_queue(void)
|
|
|
|
{
|
2015-05-27 20:27:59 -07:00
|
|
|
if (_elm_win_state_eval_timer) ecore_timer_del(_elm_win_state_eval_timer);
|
|
|
|
_elm_win_state_eval_timer = ecore_timer_add(0.5, _elm_win_state_eval, NULL);
|
2012-08-28 03:37:02 -07:00
|
|
|
}
|
|
|
|
|
2012-05-16 00:28:29 -07:00
|
|
|
// example shot spec (wait 0.1 sec then save as my-window.png):
|
2011-05-04 03:09:59 -07:00
|
|
|
// ELM_ENGINE="shot:delay=0.1:file=my-window.png"
|
|
|
|
|
|
|
|
static double
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_delay_get(Efl_Ui_Win_Data *sd)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
|
|
|
char *p, *pd;
|
2012-05-03 15:42:15 -07:00
|
|
|
char *d = strdup(sd->shot.info);
|
2011-05-07 01:37:47 -07:00
|
|
|
|
2011-05-04 03:09:59 -07:00
|
|
|
if (!d) return 0.5;
|
2012-05-03 15:42:15 -07:00
|
|
|
for (p = (char *)sd->shot.info; *p; p++)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
|
|
|
if (!strncmp(p, "delay=", 6))
|
|
|
|
{
|
|
|
|
double v;
|
2011-05-07 01:37:47 -07:00
|
|
|
|
2011-05-04 03:09:59 -07:00
|
|
|
for (pd = d, p += 6; (*p) && (*p != ':'); p++, pd++)
|
|
|
|
{
|
|
|
|
*pd = *p;
|
|
|
|
}
|
|
|
|
*pd = 0;
|
2012-04-25 20:32:18 -07:00
|
|
|
v = _elm_atof(d);
|
2011-05-04 03:09:59 -07:00
|
|
|
free(d);
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(d);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2011-05-04 03:09:59 -07:00
|
|
|
return 0.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_file_get(Efl_Ui_Win_Data *sd)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
|
|
|
char *p;
|
2012-05-03 15:42:15 -07:00
|
|
|
char *tmp = strdup(sd->shot.info);
|
2011-07-05 01:17:39 -07:00
|
|
|
char *repname = NULL;
|
2011-05-07 01:37:47 -07:00
|
|
|
|
2011-05-04 03:09:59 -07:00
|
|
|
if (!tmp) return NULL;
|
2011-07-05 01:17:39 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
for (p = (char *)sd->shot.info; *p; p++)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
|
|
|
if (!strncmp(p, "file=", 5))
|
|
|
|
{
|
|
|
|
strcpy(tmp, p + 5);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (!sd->shot.repeat_count) return tmp;
|
2011-07-05 01:17:39 -07:00
|
|
|
else
|
|
|
|
{
|
2011-07-10 21:15:42 -07:00
|
|
|
char *dotptr = strrchr(tmp, '.');
|
2011-07-05 01:17:39 -07:00
|
|
|
if (dotptr)
|
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
size_t size = sizeof(char) * (strlen(tmp) + 16);
|
2012-01-02 21:30:13 -08:00
|
|
|
repname = malloc(size);
|
2017-08-02 00:42:04 -07:00
|
|
|
if (repname)
|
|
|
|
{
|
|
|
|
strncpy(repname, tmp, dotptr - tmp);
|
|
|
|
snprintf(repname + (dotptr - tmp), size -
|
|
|
|
(dotptr - tmp), "%03i",
|
|
|
|
sd->shot.shot_counter + 1);
|
|
|
|
strcat(repname, dotptr);
|
|
|
|
}
|
2011-10-16 23:53:10 -07:00
|
|
|
free(tmp);
|
2011-07-05 01:17:39 -07:00
|
|
|
return repname;
|
|
|
|
}
|
|
|
|
}
|
2011-05-04 03:09:59 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
free(tmp);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (!sd->shot.repeat_count) return strdup("out.png");
|
2012-01-02 21:30:13 -08:00
|
|
|
|
|
|
|
repname = malloc(sizeof(char) * 24);
|
2017-08-02 00:42:04 -07:00
|
|
|
if (!repname) return NULL;
|
2012-05-03 15:42:15 -07:00
|
|
|
snprintf(repname, sizeof(char) * 24, "out%03i.png",
|
|
|
|
sd->shot.shot_counter + 1);
|
|
|
|
|
2012-01-02 21:30:13 -08:00
|
|
|
return repname;
|
2011-07-05 01:17:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_repeat_count_get(Efl_Ui_Win_Data *sd)
|
2011-07-05 01:17:39 -07:00
|
|
|
{
|
|
|
|
char *p, *pd;
|
2012-05-03 15:42:15 -07:00
|
|
|
char *d = strdup(sd->shot.info);
|
2011-07-05 01:17:39 -07:00
|
|
|
|
|
|
|
if (!d) return 0;
|
2012-05-03 15:42:15 -07:00
|
|
|
for (p = (char *)sd->shot.info; *p; p++)
|
2011-07-05 01:17:39 -07:00
|
|
|
{
|
|
|
|
if (!strncmp(p, "repeat=", 7))
|
|
|
|
{
|
|
|
|
int v;
|
|
|
|
|
|
|
|
for (pd = d, p += 7; (*p) && (*p != ':'); p++, pd++)
|
|
|
|
{
|
|
|
|
*pd = *p;
|
|
|
|
}
|
|
|
|
*pd = 0;
|
|
|
|
v = atoi(d);
|
|
|
|
if (v < 0) v = 0;
|
|
|
|
if (v > 1000) v = 999;
|
|
|
|
free(d);
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(d);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2011-07-05 01:17:39 -07:00
|
|
|
return 0;
|
2011-05-04 03:09:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_key_get(Efl_Ui_Win_Data *sd EINA_UNUSED)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_flags_get(Efl_Ui_Win_Data *sd EINA_UNUSED)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_do(Efl_Ui_Win_Data *sd)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
Evas_Object *o;
|
|
|
|
unsigned int *pixels;
|
|
|
|
int w, h;
|
|
|
|
char *file, *key, *flags;
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
ecore_evas_manual_render(sd->ee);
|
|
|
|
pixels = (void *)ecore_evas_buffer_pixels_get(sd->ee);
|
2011-05-04 03:09:59 -07:00
|
|
|
if (!pixels) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
|
2011-05-04 03:09:59 -07:00
|
|
|
if ((w < 1) || (h < 1)) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
file = _shot_file_get(sd);
|
2011-05-04 03:09:59 -07:00
|
|
|
if (!file) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
key = _shot_key_get(sd);
|
|
|
|
flags = _shot_flags_get(sd);
|
2011-05-04 03:09:59 -07:00
|
|
|
ee = ecore_evas_buffer_new(1, 1);
|
|
|
|
o = evas_object_image_add(ecore_evas_get(ee));
|
2014-12-10 21:43:53 -08:00
|
|
|
evas_object_image_alpha_set(o,
|
|
|
|
sd->theme_alpha | sd->application_alpha);
|
2011-05-04 03:09:59 -07:00
|
|
|
evas_object_image_size_set(o, w, h);
|
|
|
|
evas_object_image_data_set(o, pixels);
|
|
|
|
if (!evas_object_image_save(o, file, key, flags))
|
|
|
|
{
|
|
|
|
ERR("Cannot save window to '%s' (key '%s', flags '%s')",
|
|
|
|
file, key, flags);
|
|
|
|
}
|
|
|
|
free(file);
|
2014-01-21 18:08:47 -08:00
|
|
|
free(key);
|
|
|
|
free(flags);
|
2011-05-04 03:09:59 -07:00
|
|
|
ecore_evas_free(ee);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->shot.repeat_count) sd->shot.shot_counter++;
|
2011-05-04 03:09:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_shot_delay(void *data)
|
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
_shot_do(sd);
|
|
|
|
if (sd->shot.repeat_count)
|
2011-07-05 01:17:39 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
int remainshot = (sd->shot.repeat_count - sd->shot.shot_counter);
|
2011-07-05 01:17:39 -07:00
|
|
|
if (remainshot > 0) return EINA_TRUE;
|
2011-07-05 09:59:23 -07:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->shot.timer = NULL;
|
2011-05-04 03:09:59 -07:00
|
|
|
elm_exit();
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2011-05-04 03:09:59 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2011-07-05 01:17:39 -07:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_init(Efl_Ui_Win_Data *sd)
|
2011-07-05 01:17:39 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
if (!sd->shot.info) return;
|
|
|
|
|
|
|
|
sd->shot.repeat_count = _shot_repeat_count_get(sd);
|
|
|
|
sd->shot.shot_counter = 0;
|
2011-07-05 01:17:39 -07:00
|
|
|
}
|
|
|
|
|
2011-05-04 03:09:59 -07:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_shot_handle(Efl_Ui_Win_Data *sd)
|
2011-05-04 03:09:59 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
if (!sd->shot.info) return;
|
|
|
|
|
2013-05-20 03:09:13 -07:00
|
|
|
if (!sd->shot.timer)
|
|
|
|
sd->shot.timer = ecore_timer_add(_shot_delay_get(sd), _shot_delay,
|
|
|
|
sd->obj);
|
2011-05-04 03:09:59 -07:00
|
|
|
}
|
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
/* elm-win specific associate, does the trap while ecore_evas_object_associate()
|
|
|
|
* does not.
|
|
|
|
*/
|
2016-06-07 07:41:48 -07:00
|
|
|
static Efl_Ui_Win_Data *
|
2012-07-18 21:35:50 -07:00
|
|
|
_elm_win_associate_get(const Ecore_Evas *ee)
|
|
|
|
{
|
2014-02-17 22:58:57 -08:00
|
|
|
Evas_Object *obj = ecore_evas_data_get(ee, "elm_win");
|
2017-08-10 18:24:54 -07:00
|
|
|
return efl_data_scope_safe_get(obj, MY_CLASS);
|
2012-07-18 21:35:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Interceptors Callbacks */
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_obj_intercept_raise(void *data, Evas_Object *obj EINA_UNUSED)
|
2012-07-18 21:35:50 -07:00
|
|
|
{
|
2017-08-31 00:45:08 -07:00
|
|
|
// Note: This is probably not necessary anymore (Win implements raise)
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, raise);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_obj_intercept_lower(void *data, Evas_Object *obj EINA_UNUSED)
|
2012-07-18 21:35:50 -07:00
|
|
|
{
|
2017-08-31 00:58:02 -07:00
|
|
|
// Note: This is probably not necessary anymore (Win ignores lower)
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, lower);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_obj_intercept_stack_above(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *above EINA_UNUSED)
|
2012-07-18 21:35:50 -07:00
|
|
|
{
|
|
|
|
INF("TODO: %s", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_obj_intercept_stack_below(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Object *below EINA_UNUSED)
|
2012-07-18 21:35:50 -07:00
|
|
|
{
|
|
|
|
INF("TODO: %s", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj EINA_UNUSED, int l)
|
2012-07-18 21:35:50 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, layer_set, l);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Event Callbacks */
|
|
|
|
|
|
|
|
static void
|
2016-11-30 23:35:58 -08:00
|
|
|
_elm_win_size_hints_update(Efl_Ui_Win *win, Efl_Ui_Win_Data *sd)
|
2012-07-18 21:35:50 -07:00
|
|
|
{
|
2017-09-18 00:22:01 -07:00
|
|
|
Eina_Size2D min, max;
|
2012-07-18 21:35:50 -07:00
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
min = efl_gfx_hint_size_combined_min_get(win);
|
|
|
|
max = efl_gfx_hint_size_max_get(win);
|
2017-09-17 22:07:56 -07:00
|
|
|
if (max.w < 1) max.w = -1;
|
|
|
|
if (max.h < 1) max.h = -1;
|
2012-07-18 21:35:50 -07:00
|
|
|
|
2017-09-18 00:22:01 -07:00
|
|
|
TRAP(sd, size_min_set, min.w, min.h);
|
2017-09-17 22:07:56 -07:00
|
|
|
TRAP(sd, size_max_set, max.w, max.h);
|
2012-07-18 21:35:50 -07:00
|
|
|
}
|
2016-11-30 23:35:58 -08:00
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_obj_callback_changed_size_hints(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj, void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (sd->tmp_updating_hints) return;
|
|
|
|
_elm_win_size_hints_update(obj, sd);
|
|
|
|
}
|
2012-07-18 21:35:50 -07:00
|
|
|
/* end of elm-win specific associate */
|
|
|
|
|
2009-12-01 03:03:14 -08:00
|
|
|
static void
|
|
|
|
_elm_win_move(Ecore_Evas *ee)
|
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2009-12-01 03:03:14 -08:00
|
|
|
int x, y;
|
2017-08-10 18:24:54 -07:00
|
|
|
Eo *obj;
|
2010-09-24 09:41:25 -07:00
|
|
|
|
2014-02-17 22:58:57 -08:00
|
|
|
if (!sd) return;
|
2017-08-10 18:24:54 -07:00
|
|
|
obj = sd->obj;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2009-12-01 03:03:14 -08:00
|
|
|
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->screen.x = x;
|
|
|
|
sd->screen.y = y;
|
2019-02-21 10:01:56 -08:00
|
|
|
efl_event_callback_legacy_call(sd->obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, NULL);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2014-03-26 01:08:24 -07:00
|
|
|
evas_nochange_push(evas_object_evas_get(sd->obj));
|
2016-03-24 23:11:38 -07:00
|
|
|
sd->response++;
|
2017-05-12 03:19:29 -07:00
|
|
|
sd->req_xy = EINA_FALSE;
|
2014-03-26 01:08:24 -07:00
|
|
|
evas_object_move(sd->obj, x, y);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2016-03-24 23:11:38 -07:00
|
|
|
sd->response--;
|
2014-03-26 01:08:24 -07:00
|
|
|
evas_nochange_pop(evas_object_evas_get(sd->obj));
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_resize_job(void *data)
|
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
int w, h;
|
|
|
|
|
2015-12-10 12:53:31 -08:00
|
|
|
sd->deferred_resize_job = EINA_FALSE;
|
2016-02-20 06:07:36 -08:00
|
|
|
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->constrain)
|
|
|
|
{
|
|
|
|
int sw, sh;
|
|
|
|
ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
|
|
|
|
w = MIN(w, sw);
|
|
|
|
h = MIN(h, sh);
|
|
|
|
}
|
2012-07-30 03:06:28 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->frame_obj)
|
2013-03-25 10:50:12 -07:00
|
|
|
{
|
2013-04-29 07:25:02 -07:00
|
|
|
int fx, fy, fw, fh;
|
2013-03-25 10:50:12 -07:00
|
|
|
|
2013-04-29 07:25:02 -07:00
|
|
|
evas_output_framespace_get(sd->evas, &fx, &fy, &fw, &fh);
|
2018-11-21 07:53:11 -08:00
|
|
|
evas_object_geometry_set(sd->frame_obj, -fx, -fy, w + fw, h + fh);
|
2013-03-25 10:50:12 -07:00
|
|
|
}
|
2016-11-28 01:26:39 -08:00
|
|
|
|
|
|
|
if (sd->main_menu)
|
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
Eina_Position2D pos;
|
2016-11-28 01:26:39 -08:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
pos = efl_gfx_entity_position_get(sd->main_menu);
|
2017-09-14 20:14:32 -07:00
|
|
|
elm_menu_move(sd->main_menu, pos.x, pos.y);
|
2016-11-28 01:26:39 -08:00
|
|
|
}
|
|
|
|
|
2016-03-24 23:11:38 -07:00
|
|
|
sd->response++;
|
2018-06-25 20:25:17 -07:00
|
|
|
sd->req_wh = EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
evas_object_resize(sd->obj, w, h);
|
2016-11-17 00:46:14 -08:00
|
|
|
evas_object_resize(sd->legacy.edje, w, h);
|
2016-03-24 23:11:38 -07:00
|
|
|
sd->response--;
|
2009-12-01 03:03:14 -08:00
|
|
|
}
|
|
|
|
|
2015-12-10 12:53:31 -08:00
|
|
|
static void
|
|
|
|
_elm_win_pre_render(Ecore_Evas *ee)
|
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2017-08-10 18:24:54 -07:00
|
|
|
Eo *obj;
|
|
|
|
|
2015-12-16 02:39:20 -08:00
|
|
|
if (!sd) return;
|
2017-08-10 18:24:54 -07:00
|
|
|
obj = sd->obj;
|
2015-12-10 12:53:31 -08:00
|
|
|
|
2016-06-14 02:03:32 -07:00
|
|
|
_elm_win_throttle_ok = EINA_TRUE;
|
2016-12-05 22:19:03 -08:00
|
|
|
if (!sd->first_draw)
|
|
|
|
{
|
2018-04-17 11:55:35 -07:00
|
|
|
int mw, mh;
|
|
|
|
|
2018-07-25 11:57:14 -07:00
|
|
|
if (sd->type != ELM_WIN_FAKE)
|
|
|
|
{
|
|
|
|
edje_object_thaw(sd->frame_obj);
|
|
|
|
evas_object_show(sd->frame_obj);
|
|
|
|
}
|
|
|
|
|
2018-04-16 10:17:42 -07:00
|
|
|
_elm_win_frame_style_update(sd, 1, 1);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2018-04-17 11:52:19 -07:00
|
|
|
|
2018-06-19 10:40:43 -07:00
|
|
|
if (sd->frame_obj)
|
|
|
|
{
|
|
|
|
/* force initial sizing on frame to enable sizing of content */
|
|
|
|
edje_object_size_min_calc(sd->frame_obj, &mw, &mh);
|
|
|
|
evas_object_resize(sd->frame_obj, mw, mh);
|
|
|
|
}
|
2018-04-17 11:55:35 -07:00
|
|
|
|
2018-04-17 11:52:19 -07:00
|
|
|
if (sd->img_obj)
|
|
|
|
{
|
|
|
|
evas_object_show(sd->img_obj);
|
|
|
|
}
|
|
|
|
if (sd->pointer.obj) evas_object_show(sd->pointer.obj);
|
|
|
|
#ifdef ELEMENTARY_X
|
|
|
|
if (sd->type == ELM_WIN_TOOLTIP)
|
|
|
|
ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0);
|
|
|
|
#endif
|
|
|
|
sd->first_draw = EINA_TRUE;
|
2018-10-11 04:28:13 -07:00
|
|
|
/* set this to handle ecore-evas engine code which incorrectly
|
|
|
|
* assumes that a client resize call is the same as a server resize
|
|
|
|
* event, or which has no server event
|
|
|
|
*/
|
|
|
|
sd->deferred_resize_job = EINA_TRUE;
|
2016-12-05 22:19:03 -08:00
|
|
|
}
|
2015-12-10 12:53:31 -08:00
|
|
|
if (sd->deferred_resize_job)
|
2018-04-17 11:55:35 -07:00
|
|
|
{
|
|
|
|
_elm_win_resize_job(sd->obj);
|
|
|
|
_elm_win_frame_obj_update(sd, 1);
|
|
|
|
}
|
2015-12-10 12:53:31 -08:00
|
|
|
}
|
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
static void
|
2008-10-06 18:23:49 -07:00
|
|
|
_elm_win_resize(Ecore_Evas *ee)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2014-02-17 22:58:57 -08:00
|
|
|
if (!sd) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2015-12-10 12:53:31 -08:00
|
|
|
sd->deferred_resize_job = EINA_TRUE;
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2012-03-28 02:02:22 -07:00
|
|
|
static void
|
2012-01-08 03:23:59 -08:00
|
|
|
_elm_win_mouse_in(Ecore_Evas *ee)
|
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2014-02-17 22:58:57 -08:00
|
|
|
if (!sd) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2016-06-14 02:03:32 -07:00
|
|
|
_elm_win_throttle_ok = EINA_TRUE;
|
2016-10-30 23:30:18 -07:00
|
|
|
sd->resizing = EINA_FALSE;
|
2016-06-01 10:10:26 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2016-10-28 06:06:48 -07:00
|
|
|
if ((sd->wl.win) && (sd->pointer.ee))
|
|
|
|
{
|
2017-01-30 07:58:55 -08:00
|
|
|
sd->pointer.visible = EINA_TRUE;
|
2016-10-28 06:06:48 -07:00
|
|
|
sd->pointer.surf = ecore_wl2_window_surface_get(sd->pointer.win);
|
2017-01-30 09:59:29 -08:00
|
|
|
_elm_win_wl_cursor_set(sd->obj, NULL);
|
2017-08-10 18:24:54 -07:00
|
|
|
//ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2016-10-28 06:06:48 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_mouse_out(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
|
|
|
if (!sd) return;
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if ((sd->wl.win) && (sd->pointer.ee))
|
2017-09-01 11:28:36 -07:00
|
|
|
sd->pointer.visible = EINA_FALSE;
|
2016-06-01 10:10:26 -07:00
|
|
|
#endif
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_highlight_reconfigure_job_stop(Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2013-05-29 05:11:46 -07:00
|
|
|
ELM_SAFE_FREE(sd->focus_highlight.reconf_job, ecore_job_del);
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_highlight_visible_set(Efl_Ui_Win_Data *sd,
|
2012-05-03 15:42:15 -07:00
|
|
|
Eina_Bool visible)
|
|
|
|
{
|
2013-08-04 01:38:02 -07:00
|
|
|
Evas_Object *fobj = sd->focus_highlight.fobj;
|
|
|
|
if (!fobj) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
if (visible)
|
|
|
|
{
|
2013-08-04 01:38:02 -07:00
|
|
|
evas_object_show(fobj);
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_signal_emit(fobj, "elm,action,focus,show", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(fobj, "efl,action,focus,show", "efl");
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_signal_emit(fobj, "elm,action,focus,hide", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(fobj, "efl,action,focus,hide", "efl");
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-12 21:45:21 -07:00
|
|
|
Evas_Object *
|
|
|
|
_elm_win_focus_highlight_object_get(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
return sd->focus_highlight.fobj;
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_highlight_anim_setup(Efl_Ui_Win_Data *sd,
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas_Object *obj)
|
|
|
|
{
|
2017-09-13 19:59:44 -07:00
|
|
|
Eina_Rect rt, rp;
|
2012-05-03 15:42:15 -07:00
|
|
|
Edje_Message_Int_Set *m;
|
|
|
|
Evas_Object *target = sd->focus_highlight.cur.target;
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
rp = efl_gfx_entity_geometry_get(obj);
|
2017-08-28 23:59:40 -07:00
|
|
|
rt = elm_widget_focus_highlight_geometry_get(target);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_geometry_set(obj, rt);
|
2014-03-08 10:39:23 -08:00
|
|
|
|
2017-09-13 19:59:44 -07:00
|
|
|
if (eina_rectangle_equal(&rp.rect, &rt.rect)) return;
|
2014-04-03 03:10:53 -07:00
|
|
|
|
2014-03-08 10:39:23 -08:00
|
|
|
if (!_elm_config->focus_highlight_clip_disable)
|
|
|
|
evas_object_clip_unset(obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
m = alloca(sizeof(*m) + (sizeof(int) * 8));
|
|
|
|
m->count = 8;
|
2017-09-13 00:49:04 -07:00
|
|
|
m->val[0] = rp.x - rt.x;
|
|
|
|
m->val[1] = rp.y - rt.y;
|
|
|
|
m->val[2] = rp.w;
|
|
|
|
m->val[3] = rp.h;
|
2013-03-04 03:16:35 -08:00
|
|
|
m->val[4] = 0;
|
|
|
|
m->val[5] = 0;
|
2017-08-28 23:59:40 -07:00
|
|
|
m->val[6] = rt.w;
|
|
|
|
m->val[7] = rt.h;
|
2012-05-03 15:42:15 -07:00
|
|
|
edje_object_message_send(obj, EDJE_MESSAGE_INT_SET, 1, m);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_highlight_simple_setup(Efl_Ui_Win_Data *sd,
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *clip, *target = sd->focus_highlight.cur.target;
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_geometry_set(obj, elm_widget_focus_highlight_geometry_get(target));
|
2014-03-08 10:39:23 -08:00
|
|
|
|
|
|
|
if (!_elm_config->focus_highlight_clip_disable)
|
|
|
|
{
|
|
|
|
clip = evas_object_clip_get(target);
|
|
|
|
if (clip) evas_object_clip_set(obj, clip);
|
|
|
|
}
|
2014-03-27 22:17:02 -07:00
|
|
|
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_signal_emit(obj, "elm,state,anim,stop", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(obj, "efl,state,anim,stop", "efl");
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
2014-05-22 19:07:59 -07:00
|
|
|
static void
|
|
|
|
_elm_win_focus_prev_target_del(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
|
|
|
sd->focus_highlight.prev.target = NULL;
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
static void
|
2014-03-06 10:32:01 -08:00
|
|
|
_elm_win_focus_highlight_reconfigure_job(void *data)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2014-03-06 10:32:01 -08:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas_Object *target = sd->focus_highlight.cur.target;
|
|
|
|
Evas_Object *previous = sd->focus_highlight.prev.target;
|
2013-08-04 01:37:30 -07:00
|
|
|
Evas_Object *fobj = sd->focus_highlight.fobj;
|
2012-05-03 15:42:15 -07:00
|
|
|
Eina_Bool visible_changed;
|
|
|
|
Eina_Bool common_visible;
|
|
|
|
const char *sig = NULL;
|
|
|
|
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_stop(sd);
|
|
|
|
|
|
|
|
visible_changed = (sd->focus_highlight.cur.visible !=
|
|
|
|
sd->focus_highlight.prev.visible);
|
|
|
|
|
|
|
|
if ((target == previous) && (!visible_changed) &&
|
2013-03-18 02:44:19 -07:00
|
|
|
(!sd->focus_highlight.geometry_changed) &&
|
2013-08-04 01:09:44 -07:00
|
|
|
(!sd->focus_highlight.theme_changed))
|
2012-05-03 15:42:15 -07:00
|
|
|
return;
|
|
|
|
|
2015-04-05 18:54:15 -07:00
|
|
|
if (previous)
|
2014-05-22 19:07:59 -07:00
|
|
|
{
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(previous, EVAS_CALLBACK_DEL, _elm_win_focus_prev_target_del, data);
|
2015-04-05 18:54:15 -07:00
|
|
|
if (sd->focus_highlight.prev.in_theme)
|
2018-04-26 04:24:09 -07:00
|
|
|
{
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
elm_widget_signal_emit
|
|
|
|
(previous, "elm,action,focus_highlight,hide", "elm");
|
|
|
|
else
|
|
|
|
elm_widget_signal_emit
|
|
|
|
(previous, "efl,action,focus_highlight,hide", "efl");
|
|
|
|
}
|
2014-05-22 19:07:59 -07:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
if (!target)
|
|
|
|
common_visible = EINA_FALSE;
|
2014-02-04 16:57:34 -08:00
|
|
|
else if (sd->focus_highlight.cur.in_theme)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
|
|
|
common_visible = EINA_FALSE;
|
2018-04-26 04:24:09 -07:00
|
|
|
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
{
|
|
|
|
if (sd->focus_highlight.cur.visible)
|
|
|
|
sig = "elm,action,focus_highlight,show";
|
|
|
|
else
|
|
|
|
sig = "elm,action,focus_highlight,hide";
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
else
|
2018-04-26 04:24:09 -07:00
|
|
|
{
|
|
|
|
if (sd->focus_highlight.cur.visible)
|
|
|
|
sig = "efl,action,focus_highlight,show";
|
|
|
|
else
|
|
|
|
sig = "efl,action,focus_highlight,hide";
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
common_visible = sd->focus_highlight.cur.visible;
|
|
|
|
|
|
|
|
if (sig)
|
2018-04-26 04:24:09 -07:00
|
|
|
{
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
elm_widget_signal_emit(target, sig, "elm");
|
|
|
|
else
|
|
|
|
elm_widget_signal_emit(target, sig, "efl");
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2014-02-04 16:57:34 -08:00
|
|
|
if ((!target) || (!common_visible) || (sd->focus_highlight.cur.in_theme))
|
2015-08-12 21:45:21 -07:00
|
|
|
{
|
|
|
|
if (target)
|
2015-09-18 00:49:14 -07:00
|
|
|
_elm_win_focus_highlight_simple_setup(sd, fobj);
|
2015-08-12 21:45:21 -07:00
|
|
|
goto the_end;
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2019-02-27 11:00:39 -08:00
|
|
|
if (sd->focus_highlight.theme_changed)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
|
|
|
const char *str;
|
2014-02-05 02:17:41 -08:00
|
|
|
|
2019-02-27 11:00:39 -08:00
|
|
|
if (sd->focus_highlight.style)
|
2012-05-03 15:42:15 -07:00
|
|
|
str = sd->focus_highlight.style;
|
|
|
|
else
|
|
|
|
str = "default";
|
2014-02-05 02:17:41 -08:00
|
|
|
|
2017-11-17 00:24:39 -08:00
|
|
|
elm_widget_theme_object_set
|
2013-08-04 01:37:30 -07:00
|
|
|
(sd->obj, fobj, "focus_highlight", "top", str);
|
2013-08-04 01:09:44 -07:00
|
|
|
sd->focus_highlight.theme_changed = EINA_FALSE;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2015-03-04 00:47:54 -08:00
|
|
|
if ((sd->focus_highlight.animate) || (sd->focus_highlight.auto_animate))
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2013-08-04 01:37:30 -07:00
|
|
|
str = edje_object_data_get(sd->focus_highlight.fobj, "animate");
|
2013-08-11 02:58:28 -07:00
|
|
|
sd->focus_highlight.animate_supported = ((str) && (!strcmp(str, "on")));
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
2013-08-15 06:42:59 -07:00
|
|
|
else
|
|
|
|
sd->focus_highlight.animate_supported = EINA_FALSE;
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
2013-08-11 02:58:28 -07:00
|
|
|
if ((sd->focus_highlight.animate_supported) && (previous) &&
|
2014-02-04 16:57:34 -08:00
|
|
|
(!sd->focus_highlight.prev.in_theme))
|
2013-08-04 01:37:30 -07:00
|
|
|
_elm_win_focus_highlight_anim_setup(sd, fobj);
|
2012-05-03 15:42:15 -07:00
|
|
|
else
|
2013-08-04 01:37:30 -07:00
|
|
|
_elm_win_focus_highlight_simple_setup(sd, fobj);
|
|
|
|
evas_object_raise(fobj);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
the_end:
|
2014-01-22 21:12:46 -08:00
|
|
|
_elm_win_focus_highlight_visible_set(sd, common_visible);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->focus_highlight.geometry_changed = EINA_FALSE;
|
|
|
|
sd->focus_highlight.prev = sd->focus_highlight.cur;
|
2016-08-26 01:09:38 -07:00
|
|
|
if (sd->focus_highlight.prev.target)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->focus_highlight.prev.target,
|
|
|
|
EVAS_CALLBACK_DEL, _elm_win_focus_prev_target_del, data);
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2014-01-21 06:16:41 -08:00
|
|
|
ecore_job_del(sd->focus_highlight.reconf_job);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
sd->focus_highlight.reconf_job = ecore_job_add(
|
2013-04-24 04:41:37 -07:00
|
|
|
_elm_win_focus_highlight_reconfigure_job, sd->obj);
|
2012-01-08 03:23:59 -08:00
|
|
|
}
|
|
|
|
|
2009-04-04 09:58:28 -07:00
|
|
|
static void
|
|
|
|
_elm_win_focus_in(Ecore_Evas *ee)
|
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2012-07-18 21:35:50 -07:00
|
|
|
Evas_Object *obj;
|
2010-09-24 09:41:25 -07:00
|
|
|
|
2014-04-09 03:04:55 -07:00
|
|
|
if ((!sd) || (sd->modal_count)) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2016-06-14 02:03:32 -07:00
|
|
|
_elm_win_throttle_ok = EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
obj = sd->obj;
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_widget_top_win_focused_set(obj, EINA_TRUE);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2015-01-11 12:18:02 -08:00
|
|
|
if (sd->type != ELM_WIN_FAKE)
|
2011-09-06 18:41:19 -07:00
|
|
|
{
|
2017-09-26 16:07:20 -07:00
|
|
|
Efl_Ui_Focus_Manager *man = sd->obj;
|
|
|
|
while(efl_ui_focus_manager_redirect_get(man))
|
2015-01-11 12:18:02 -08:00
|
|
|
{
|
2017-09-26 16:07:20 -07:00
|
|
|
man = efl_ui_focus_manager_redirect_get(man);
|
2015-09-10 04:04:23 -07:00
|
|
|
}
|
2017-09-26 16:07:20 -07:00
|
|
|
|
|
|
|
Evas_Object *focused = efl_ui_focus_manager_focus_get(man);
|
2018-06-19 10:40:27 -07:00
|
|
|
if (focused)
|
|
|
|
efl_ui_focus_object_focus_set(focused, EINA_TRUE);
|
2011-09-06 18:41:19 -07:00
|
|
|
}
|
2017-08-10 18:24:54 -07:00
|
|
|
|
2015-07-06 04:38:34 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_FOCUS_IN, NULL);
|
2018-04-12 05:35:06 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_WIDGET_FOCUSED, NULL);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->focus_highlight.cur.visible = EINA_TRUE;
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2012-08-22 02:21:28 -07:00
|
|
|
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2015-05-13 06:37:47 -07:00
|
|
|
{
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_activated_signal_emit(obj);
|
2017-10-18 18:13:54 -07:00
|
|
|
efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_ACTIVE, EINA_TRUE);
|
2015-05-13 06:37:47 -07:00
|
|
|
}
|
2015-04-29 06:08:57 -07:00
|
|
|
|
2012-08-22 02:21:28 -07:00
|
|
|
/* do nothing */
|
|
|
|
/* else if (sd->img_obj) */
|
|
|
|
/* { */
|
|
|
|
/* } */
|
2018-02-13 01:12:11 -08:00
|
|
|
if ((!efl_ui_focus_manager_focus_get(sd->obj)) &&
|
|
|
|
(!efl_ui_focus_manager_redirect_get(sd->obj)))
|
2018-02-11 10:04:06 -08:00
|
|
|
{
|
|
|
|
Efl_Ui_Focus_Object *child;
|
|
|
|
|
|
|
|
child = efl_ui_focus_manager_request_subchild(sd->obj, sd->obj);
|
|
|
|
|
|
|
|
if (child)
|
|
|
|
efl_ui_focus_manager_focus_set(sd->obj, sd->obj);
|
2018-02-13 01:12:11 -08:00
|
|
|
else if (!evas_focus_get(evas_object_evas_get(sd->obj)))
|
|
|
|
evas_object_focus_set(obj, EINA_TRUE);
|
2018-02-11 10:04:06 -08:00
|
|
|
}
|
2009-04-04 09:58:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_focus_out(Ecore_Evas *ee)
|
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2012-07-18 21:35:50 -07:00
|
|
|
Evas_Object *obj;
|
2010-09-24 09:41:25 -07:00
|
|
|
|
2014-02-17 22:58:57 -08:00
|
|
|
if (!sd) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
obj = sd->obj;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
_elm_widget_top_win_focused_set(obj, EINA_FALSE);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2015-07-06 04:38:34 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_FOCUS_OUT, NULL);
|
2018-04-12 05:35:06 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_WIDGET_UNFOCUSED, NULL);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->focus_highlight.cur.visible = EINA_FALSE;
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
if (!sd->resizing)
|
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2012-08-22 02:21:28 -07:00
|
|
|
|
2013-03-06 23:59:51 -08:00
|
|
|
/* access */
|
2013-10-31 07:01:56 -07:00
|
|
|
_elm_access_object_highlight_disable(evas_object_evas_get(obj));
|
2013-03-06 23:59:51 -08:00
|
|
|
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2015-05-13 06:37:47 -07:00
|
|
|
{
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_deactivated_signal_emit(obj);
|
2017-10-18 18:13:54 -07:00
|
|
|
efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_ACTIVE, EINA_FALSE);
|
2015-05-13 06:37:47 -07:00
|
|
|
}
|
2015-04-29 06:08:57 -07:00
|
|
|
|
2017-11-13 05:15:04 -08:00
|
|
|
if (sd->type != ELM_WIN_FAKE)
|
|
|
|
{
|
|
|
|
Efl_Ui_Focus_Manager *man = sd->obj;
|
|
|
|
while(efl_ui_focus_manager_redirect_get(man))
|
|
|
|
{
|
|
|
|
man = efl_ui_focus_manager_redirect_get(man);
|
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Object *focused = efl_ui_focus_manager_focus_get(man);
|
|
|
|
efl_ui_focus_object_focus_set(focused, EINA_FALSE);
|
|
|
|
}
|
2012-08-22 02:21:28 -07:00
|
|
|
/* do nothing */
|
|
|
|
/* if (sd->img_obj) */
|
|
|
|
/* { */
|
|
|
|
/* } */
|
2009-04-04 09:58:28 -07:00
|
|
|
}
|
|
|
|
|
2012-12-04 22:50:27 -08:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_available_profiles_del(Efl_Ui_Win_Data *sd)
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
Eina_Stringshare *prof;
|
|
|
|
Eina_Iterator *it;
|
2012-12-04 22:50:27 -08:00
|
|
|
|
2017-08-31 01:57:40 -07:00
|
|
|
it = eina_array_iterator_new(sd->profile.available);
|
|
|
|
EINA_ITERATOR_FOREACH(it, prof)
|
|
|
|
eina_stringshare_del(prof);
|
|
|
|
eina_iterator_free(it);
|
|
|
|
eina_array_flush(sd->profile.available);
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_profile_del(Efl_Ui_Win_Data *sd)
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
2013-05-29 05:11:46 -07:00
|
|
|
ELM_SAFE_FREE(sd->profile.name, eina_stringshare_del);
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2016-06-07 07:41:48 -07:00
|
|
|
_internal_elm_win_profile_set(Efl_Ui_Win_Data *sd, const char *profile)
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
|
|
|
Eina_Bool changed = EINA_FALSE;
|
2017-08-31 01:57:40 -07:00
|
|
|
|
|
|
|
if (profile == sd->profile.name) return EINA_FALSE;
|
2012-12-04 22:50:27 -08:00
|
|
|
if (profile)
|
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
if (eina_stringshare_replace(&sd->profile.name, profile))
|
|
|
|
changed = EINA_TRUE;
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
_elm_win_profile_del(sd);
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
}
|
|
|
|
|
2017-08-31 01:57:40 -07:00
|
|
|
static inline Eina_Bool
|
|
|
|
_profile_exists(Efl_Ui_Win_Data *sd, const char *profile)
|
|
|
|
{
|
|
|
|
Eina_Bool found = EINA_FALSE;
|
|
|
|
Eina_Stringshare *prof;
|
|
|
|
Eina_Iterator *it;
|
|
|
|
|
|
|
|
if (!profile) return EINA_FALSE;
|
|
|
|
it = eina_array_iterator_new(sd->profile.available);
|
|
|
|
EINA_ITERATOR_FOREACH(it, prof)
|
|
|
|
if (!strcmp(profile, prof))
|
|
|
|
{
|
|
|
|
found = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
eina_iterator_free(it);
|
|
|
|
return found;
|
|
|
|
}
|
|
|
|
|
2012-12-04 22:50:27 -08:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_profile_update(Efl_Ui_Win_Data *sd)
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
2015-05-27 22:58:47 -07:00
|
|
|
if (getenv("ELM_PROFILE")) return;
|
|
|
|
|
2017-08-31 01:57:40 -07:00
|
|
|
if (eina_array_count(sd->profile.available))
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
Eina_Bool found = _profile_exists(sd, sd->profile.name);
|
2012-12-04 22:50:27 -08:00
|
|
|
|
|
|
|
/* If current profile is not present in an available profiles,
|
|
|
|
* change current profile to the 1st element of an array.
|
|
|
|
*/
|
|
|
|
if (!found)
|
2017-08-31 01:57:40 -07:00
|
|
|
_internal_elm_win_profile_set(sd, eina_array_data_get(sd->profile.available, 0));
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
|
|
|
|
2016-01-05 05:15:00 -08:00
|
|
|
_config_profile_lock = EINA_TRUE;
|
2012-12-04 22:50:27 -08:00
|
|
|
_elm_config_profile_set(sd->profile.name);
|
|
|
|
|
|
|
|
/* update sub ee */
|
|
|
|
Ecore_Evas *ee2;
|
|
|
|
Eina_List *sub, *l = NULL;
|
|
|
|
|
|
|
|
sub = ecore_evas_sub_ecore_evas_list_get(sd->ee);
|
|
|
|
EINA_LIST_FOREACH(sub, l, ee2)
|
|
|
|
ecore_evas_window_profile_set(ee2, sd->profile.name);
|
|
|
|
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(sd->obj, EFL_UI_WIN_EVENT_PROFILE_CHANGED, NULL);
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
|
|
|
|
2016-11-01 23:04:24 -07:00
|
|
|
static inline void
|
|
|
|
_elm_win_frame_geometry_adjust(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
int l = 0, t = 0, r = 0, b = 0;
|
|
|
|
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
if (sd->frame_obj && sd->csd.need && !sd->fullscreen)
|
2016-11-01 23:04:24 -07:00
|
|
|
{
|
|
|
|
int fw, fh, ox, oy, ow, oh;
|
|
|
|
evas_object_geometry_get(sd->frame_obj, NULL, NULL, &fw, &fh);
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.opaque",
|
|
|
|
&ox, &oy, &ow, &oh);
|
|
|
|
else
|
|
|
|
edje_object_part_geometry_get(sd->frame_obj, "efl.spacer.opaque",
|
|
|
|
&ox, &oy, &ow, &oh);
|
2016-11-01 23:04:24 -07:00
|
|
|
l = ox;
|
|
|
|
t = oy;
|
|
|
|
r = fw - ow - l;
|
|
|
|
b = fh - oh - t;
|
|
|
|
}
|
|
|
|
ecore_evas_shadow_geometry_set(sd->ee, l, r, t, b);
|
|
|
|
}
|
|
|
|
|
2016-12-05 22:19:03 -08:00
|
|
|
static inline Eina_Bool
|
|
|
|
_elm_win_framespace_set(Efl_Ui_Win_Data *sd, int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
int fx, fy, fw, fh;
|
|
|
|
|
|
|
|
evas_output_framespace_get(sd->evas, &fx, &fy, &fw, &fh);
|
|
|
|
evas_output_framespace_set(sd->evas, x, y, w, h);
|
|
|
|
|
|
|
|
// return true if framespace geometry changed
|
|
|
|
return ((fx != x) || (fy != y) || (fw != w) || (fh != h));
|
|
|
|
}
|
|
|
|
|
2015-07-20 14:35:00 -07:00
|
|
|
static void
|
2018-04-17 11:55:35 -07:00
|
|
|
_elm_win_frame_obj_update(Efl_Ui_Win_Data *sd, Eina_Bool force)
|
2015-07-20 14:35:00 -07:00
|
|
|
{
|
|
|
|
int ox, oy, ow, oh;
|
2016-12-05 22:19:03 -08:00
|
|
|
int cx, cy, cw, ch;
|
2017-08-07 10:26:41 -07:00
|
|
|
int w, h;
|
2015-03-03 11:59:03 -08:00
|
|
|
|
2016-11-28 01:26:39 -08:00
|
|
|
if (!sd->frame_obj) return;
|
2018-08-14 14:11:53 -07:00
|
|
|
if (!sd->csd.need) return;
|
2016-11-01 23:04:24 -07:00
|
|
|
_elm_win_frame_geometry_adjust(sd);
|
2016-12-05 22:19:03 -08:00
|
|
|
evas_object_geometry_get(sd->frame_obj, &ox, &oy, &ow, &oh);
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_geometry_get(sd->frame_obj, "elm.spacer.content", &cx, &cy, &cw, &ch);
|
|
|
|
else
|
|
|
|
edje_object_part_geometry_get(sd->frame_obj, "efl.spacer.content", &cx, &cy, &cw, &ch);
|
|
|
|
|
2018-04-17 11:55:35 -07:00
|
|
|
if (!_elm_win_framespace_set(sd, cx, cy, ow - cw, oh - ch) && (!force)) return;
|
2017-08-07 10:26:41 -07:00
|
|
|
_elm_win_frame_geometry_adjust(sd);
|
2018-12-07 08:46:11 -08:00
|
|
|
|
|
|
|
if (!sd->first_draw) return;
|
|
|
|
|
|
|
|
evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
|
2018-06-25 20:25:17 -07:00
|
|
|
if (w && h)
|
|
|
|
TRAP(sd, resize, w, h);
|
2015-11-17 15:19:15 -08:00
|
|
|
}
|
|
|
|
|
2019-02-27 10:52:14 -08:00
|
|
|
static int
|
|
|
|
_win_rotation_degree_check(int rotation)
|
|
|
|
{
|
|
|
|
if ((rotation > 360) || (rotation < 0))
|
|
|
|
{
|
|
|
|
WRN("Rotation degree should be 0 ~ 360 (passed degree: %d)", rotation);
|
|
|
|
rotation %= 360;
|
|
|
|
if (rotation < 0) rotation += 360;
|
|
|
|
}
|
|
|
|
return rotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This API resizes the internal window(ex: X window) and evas_output.
|
|
|
|
* But this does not resize the elm window object and its contents.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
_win_rotate(Evas_Object *obj, Efl_Ui_Win_Data *sd, int rotation, Eina_Bool resize)
|
|
|
|
{
|
|
|
|
rotation = _win_rotation_degree_check(rotation);
|
|
|
|
if (sd->rot == rotation) return;
|
|
|
|
sd->rot = rotation;
|
|
|
|
if (resize) TRAP(sd, rotation_with_resize_set, rotation);
|
|
|
|
else TRAP(sd, rotation_set, rotation);
|
|
|
|
efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(-1, -1));
|
|
|
|
efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, -1));
|
|
|
|
_elm_win_resize_objects_eval(obj, EINA_FALSE);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
_elm_win_frame_obj_update(sd, 0);
|
|
|
|
efl_event_callback_legacy_call
|
|
|
|
(obj, EFL_UI_WIN_EVENT_ROTATION_CHANGED, NULL);
|
|
|
|
if (_elm_config->atspi_mode)
|
|
|
|
{
|
|
|
|
Evas_Coord x = 0, y = 0, width = 0, height = 0;
|
|
|
|
elm_win_screen_size_get(obj, &x, &y, &width, &height);
|
|
|
|
if ((sd->rot == 0) || (sd->rot == 180))
|
|
|
|
{
|
|
|
|
efl_access_bounds_changed_signal_emit(obj, x, y, width, height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
efl_access_bounds_changed_signal_emit(obj, x, y, height, width);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_win_win_rotation_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, Efl_Orient rotation)
|
|
|
|
{
|
|
|
|
Efl_Ui_Widget *widget;
|
|
|
|
Eina_Iterator *it;
|
|
|
|
int rot = rotation %360;
|
|
|
|
|
|
|
|
if (pd->rot == rot) return;
|
|
|
|
|
|
|
|
_win_rotate(obj, pd, rot, EINA_FALSE);
|
|
|
|
|
|
|
|
it = efl_ui_widget_tree_widget_iterator(obj);
|
|
|
|
EINA_ITERATOR_FOREACH(it, widget)
|
|
|
|
{
|
|
|
|
if (!efl_isa(widget, EFL_UI_LAYOUT_CLASS)) continue;
|
|
|
|
|
|
|
|
if (efl_ui_layout_automatic_theme_rotation_get(widget))
|
|
|
|
efl_ui_layout_theme_rotation_apply(widget, rot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Efl_Orient
|
|
|
|
_efl_ui_win_win_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
|
|
|
|
{
|
|
|
|
return pd->rotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_rotation_set(Evas_Object *obj, int rotation)
|
|
|
|
{
|
|
|
|
efl_ui_win_rotation_set(obj, rotation);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
elm_win_rotation_get(const Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return efl_ui_win_rotation_get(obj);
|
|
|
|
}
|
|
|
|
|
2012-03-28 02:02:22 -07:00
|
|
|
static void
|
2012-02-28 03:20:35 -08:00
|
|
|
_elm_win_state_change(Ecore_Evas *ee)
|
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2012-02-28 03:20:35 -08:00
|
|
|
Evas_Object *obj;
|
|
|
|
Eina_Bool ch_withdrawn = EINA_FALSE;
|
|
|
|
Eina_Bool ch_sticky = EINA_FALSE;
|
2019-02-28 02:21:43 -08:00
|
|
|
Eina_Bool ch_minimized = EINA_FALSE;
|
2012-02-28 03:20:35 -08:00
|
|
|
Eina_Bool ch_fullscreen = EINA_FALSE;
|
|
|
|
Eina_Bool ch_maximized = EINA_FALSE;
|
2012-12-04 22:50:27 -08:00
|
|
|
Eina_Bool ch_profile = EINA_FALSE;
|
2014-02-10 05:09:45 -08:00
|
|
|
Eina_Bool ch_wm_rotation = EINA_FALSE;
|
2012-12-04 22:50:27 -08:00
|
|
|
const char *profile;
|
2012-02-28 03:20:35 -08:00
|
|
|
|
2014-02-17 22:58:57 -08:00
|
|
|
if (!sd) return;
|
2012-03-28 02:02:22 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
obj = sd->obj;
|
2012-02-28 03:20:35 -08:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
|
2012-02-28 03:20:35 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
|
2012-02-28 03:20:35 -08:00
|
|
|
ch_withdrawn = EINA_TRUE;
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->sticky != ecore_evas_sticky_get(sd->ee))
|
2012-02-28 03:20:35 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->sticky = ecore_evas_sticky_get(sd->ee);
|
2012-02-28 03:20:35 -08:00
|
|
|
ch_sticky = EINA_TRUE;
|
|
|
|
}
|
2019-02-28 02:21:43 -08:00
|
|
|
if (sd->minimized != ecore_evas_iconified_get(sd->ee))
|
2012-02-28 03:20:35 -08:00
|
|
|
{
|
2019-02-28 02:21:43 -08:00
|
|
|
sd->minimized = ecore_evas_iconified_get(sd->ee);
|
|
|
|
ch_minimized = EINA_TRUE;
|
2012-02-28 03:20:35 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->fullscreen != ecore_evas_fullscreen_get(sd->ee))
|
2012-02-28 03:20:35 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->fullscreen = ecore_evas_fullscreen_get(sd->ee);
|
2012-02-28 03:20:35 -08:00
|
|
|
ch_fullscreen = EINA_TRUE;
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->maximized != ecore_evas_maximized_get(sd->ee))
|
2012-02-28 03:20:35 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->maximized = ecore_evas_maximized_get(sd->ee);
|
2012-02-28 03:20:35 -08:00
|
|
|
ch_maximized = EINA_TRUE;
|
|
|
|
}
|
2012-08-28 03:37:02 -07:00
|
|
|
|
2015-02-05 22:06:49 -08:00
|
|
|
if (ecore_evas_window_profile_supported_get(sd->ee))
|
|
|
|
{
|
|
|
|
profile = ecore_evas_window_profile_get(sd->ee);
|
|
|
|
ch_profile = _internal_elm_win_profile_set(sd, profile);
|
|
|
|
}
|
2012-12-04 22:50:27 -08:00
|
|
|
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2014-02-10 05:09:45 -08:00
|
|
|
if (sd->wm_rot.use)
|
|
|
|
{
|
|
|
|
if (sd->rot != ecore_evas_rotation_get(sd->ee))
|
|
|
|
{
|
|
|
|
ch_wm_rotation = EINA_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-28 03:37:02 -07:00
|
|
|
_elm_win_state_eval_queue();
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2019-02-28 02:21:43 -08:00
|
|
|
if ((ch_withdrawn) || (ch_minimized))
|
2012-02-28 03:20:35 -08:00
|
|
|
{
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->withdrawn)
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_WITHDRAWN, NULL);
|
2019-02-28 02:21:43 -08:00
|
|
|
else if (sd->minimized)
|
2015-04-29 06:08:57 -07:00
|
|
|
{
|
2019-02-28 02:21:43 -08:00
|
|
|
efl_event_callback_call(obj, EFL_UI_WIN_EVENT_MINIMIZED, NULL);
|
|
|
|
evas_object_smart_callback_call(obj, "iconified", NULL);
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_minimized_signal_emit(obj);
|
2015-04-29 06:08:57 -07:00
|
|
|
}
|
2012-02-28 03:20:35 -08:00
|
|
|
else
|
2015-04-29 06:08:57 -07:00
|
|
|
{
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_NORMAL, NULL);
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_restored_signal_emit(obj);
|
2015-04-29 06:08:57 -07:00
|
|
|
}
|
2012-02-28 03:20:35 -08:00
|
|
|
}
|
|
|
|
if (ch_sticky)
|
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->sticky)
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_STICK, NULL);
|
2012-02-28 03:20:35 -08:00
|
|
|
else
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_UNSTICK, NULL);
|
2012-02-28 03:20:35 -08:00
|
|
|
}
|
2017-05-17 13:02:53 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if (sd->wl.win)
|
|
|
|
{
|
|
|
|
if (sd->csd.cur_focus != ecore_wl2_window_activated_get(sd->wl.win))
|
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
|
|
|
}
|
|
|
|
#endif
|
2012-02-28 03:20:35 -08:00
|
|
|
if (ch_fullscreen)
|
|
|
|
{
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->fullscreen)
|
2015-03-03 11:59:33 -08:00
|
|
|
{
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-06-07 07:41:48 -07:00
|
|
|
(obj, EFL_UI_WIN_EVENT_FULLSCREEN, NULL);
|
2015-03-03 11:59:33 -08:00
|
|
|
}
|
2012-02-28 03:20:35 -08:00
|
|
|
else
|
2015-03-03 11:59:33 -08:00
|
|
|
{
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-06-07 07:41:48 -07:00
|
|
|
(obj, EFL_UI_WIN_EVENT_UNFULLSCREEN, NULL);
|
2015-03-03 11:59:33 -08:00
|
|
|
}
|
2012-02-28 03:20:35 -08:00
|
|
|
}
|
|
|
|
if (ch_maximized)
|
|
|
|
{
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->maximized)
|
2015-04-29 06:08:57 -07:00
|
|
|
{
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_MAXIMIZED, NULL);
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_maximized_signal_emit(obj);
|
2015-04-29 06:08:57 -07:00
|
|
|
}
|
2012-02-28 03:20:35 -08:00
|
|
|
else
|
2015-04-29 06:08:57 -07:00
|
|
|
{
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_UNMAXIMIZED, NULL);
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_restored_signal_emit(obj);
|
2015-04-29 06:08:57 -07:00
|
|
|
}
|
2012-02-28 03:20:35 -08:00
|
|
|
}
|
2012-12-04 22:50:27 -08:00
|
|
|
if (ch_profile)
|
|
|
|
{
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2012-12-04 22:50:27 -08:00
|
|
|
_elm_win_profile_update(sd);
|
|
|
|
}
|
2014-02-10 05:09:45 -08:00
|
|
|
if (ch_wm_rotation)
|
|
|
|
{
|
2019-02-27 10:52:14 -08:00
|
|
|
efl_ui_win_rotation_set(obj, ecore_evas_rotation_get(sd->ee));
|
|
|
|
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-06-07 07:41:48 -07:00
|
|
|
(obj, EFL_UI_WIN_EVENT_WM_ROTATION_CHANGED, NULL);
|
2014-02-10 05:09:45 -08:00
|
|
|
}
|
2012-02-28 03:20:35 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-01-19 00:25:47 -08:00
|
|
|
_efl_ui_win_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Win_Data *sd)
|
2010-10-21 11:58:43 -07:00
|
|
|
{
|
2018-01-19 00:25:47 -08:00
|
|
|
if (!efl_ui_focus_object_on_focus_update(efl_super(obj, MY_CLASS)))
|
2017-08-30 23:15:58 -07:00
|
|
|
return EINA_TRUE;
|
2011-04-20 07:16:51 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->img_obj)
|
2017-11-29 00:39:42 -08:00
|
|
|
evas_object_focus_set(sd->img_obj, efl_ui_focus_object_focus_get(obj));
|
2010-10-21 11:58:43 -07:00
|
|
|
else
|
2017-11-29 00:39:42 -08:00
|
|
|
evas_object_focus_set(obj, efl_ui_focus_object_focus_get(obj));
|
2014-03-27 06:15:52 -07:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
2010-10-21 11:58:43 -07:00
|
|
|
}
|
|
|
|
|
2014-04-15 18:38:34 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_key_action_return(Evas_Object *obj EINA_UNUSED, const char *params EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_key_action_move(Evas_Object *obj, const char *params)
|
|
|
|
{
|
|
|
|
const char *dir = params;
|
|
|
|
|
2015-09-10 02:29:24 -07:00
|
|
|
_elm_widget_focus_auto_show(obj);
|
2016-12-20 08:27:45 -08:00
|
|
|
|
|
|
|
Efl_Ui_Focus_Direction focus_dir;
|
|
|
|
|
2014-04-15 18:38:34 -07:00
|
|
|
if (!strcmp(dir, "previous"))
|
2017-08-16 06:56:57 -07:00
|
|
|
focus_dir = EFL_UI_FOCUS_DIRECTION_PREVIOUS;
|
2014-04-15 18:38:34 -07:00
|
|
|
else if (!strcmp(dir, "next"))
|
2016-12-20 08:27:45 -08:00
|
|
|
focus_dir = EFL_UI_FOCUS_DIRECTION_NEXT;
|
2014-04-15 18:38:34 -07:00
|
|
|
else if (!strcmp(dir, "left"))
|
2016-12-20 08:27:45 -08:00
|
|
|
focus_dir = EFL_UI_FOCUS_DIRECTION_LEFT;
|
2014-04-15 18:38:34 -07:00
|
|
|
else if (!strcmp(dir, "right"))
|
2016-12-20 08:27:45 -08:00
|
|
|
focus_dir = EFL_UI_FOCUS_DIRECTION_RIGHT;
|
2014-04-15 18:38:34 -07:00
|
|
|
else if (!strcmp(dir, "up"))
|
2016-12-20 08:27:45 -08:00
|
|
|
focus_dir = EFL_UI_FOCUS_DIRECTION_UP;
|
2014-04-15 18:38:34 -07:00
|
|
|
else if (!strcmp(dir, "down"))
|
2016-12-20 08:27:45 -08:00
|
|
|
focus_dir = EFL_UI_FOCUS_DIRECTION_DOWN;
|
2014-04-15 18:38:34 -07:00
|
|
|
else return EINA_FALSE;
|
|
|
|
|
2016-12-20 08:27:45 -08:00
|
|
|
|
2018-04-12 12:28:49 -07:00
|
|
|
// The handling for legacy is different due to elm_object_next set
|
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
elm_object_focus_next(obj, focus_dir);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Efl_Ui_Widget *o;
|
|
|
|
|
|
|
|
o = efl_ui_focus_manager_move(obj, focus_dir);
|
|
|
|
if (!o)
|
|
|
|
{
|
|
|
|
if (focus_dir == EFL_UI_FOCUS_DIRECTION_NEXT || focus_dir == EFL_UI_FOCUS_DIRECTION_PREVIOUS)
|
|
|
|
{
|
|
|
|
Efl_Ui_Focus_Object *root;
|
|
|
|
|
|
|
|
root = efl_ui_focus_manager_root_get(obj);
|
|
|
|
efl_ui_focus_manager_setup_on_first_touch(obj, focus_dir, root);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-08-30 13:33:04 -07:00
|
|
|
|
2014-04-15 18:38:34 -07:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2016-06-01 22:36:55 -07:00
|
|
|
/* forward events sent to evas to the window */
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_evas_event_key_cb(void *data, const Efl_Event *ev)
|
2016-06-01 22:36:55 -07:00
|
|
|
{
|
|
|
|
Eo *win = data;
|
|
|
|
Eo *evt = ev->info;
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Key_Data *evdata;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
evdata = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS);
|
2016-06-01 22:36:55 -07:00
|
|
|
if (!evdata || evdata->win_fed)
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2018-11-17 06:28:59 -08:00
|
|
|
// evas_callbacks will send the event to the focused object (ie. this win)
|
2016-06-01 22:36:55 -07:00
|
|
|
if (evas_focus_get(evas_object_evas_get(win)) == win)
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2016-08-30 23:41:12 -07:00
|
|
|
efl_event_callback_call(win, ev->desc, evt);
|
2016-06-01 22:36:55 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_evas_event_pointer_cb(void *data, const Efl_Event *ev)
|
2016-05-30 03:51:31 -07:00
|
|
|
{
|
|
|
|
Eo *win = data;
|
|
|
|
Eo *evt = ev->info;
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Pointer_Data *evdata;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
evdata = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS);
|
2016-06-01 22:36:55 -07:00
|
|
|
if (!evdata || evdata->win_fed)
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2016-05-30 03:51:31 -07:00
|
|
|
|
2016-08-30 23:41:12 -07:00
|
|
|
efl_event_callback_call(win, ev->desc, evt);
|
2016-05-30 03:51:31 -07:00
|
|
|
}
|
|
|
|
|
2016-06-01 22:36:55 -07:00
|
|
|
/* feed events from the window to evas - for fake inputs */
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_evas_event_key_feed_fake_cb(void *data, const Efl_Event *ev)
|
2016-06-01 22:36:55 -07:00
|
|
|
{
|
|
|
|
Eo *evas = data;
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Event *evt = ev->info;
|
|
|
|
Efl_Input_Key_Data *evdata;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
if (!efl_input_fake_get(evt))
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
evdata = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS);
|
2016-06-01 22:36:55 -07:00
|
|
|
if (!evdata || evdata->win_fed)
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2016-06-01 22:36:55 -07:00
|
|
|
evdata->win_fed = EINA_TRUE;
|
|
|
|
|
2016-08-30 23:41:12 -07:00
|
|
|
efl_event_callback_call(evas, ev->desc, evt);
|
2016-06-01 22:36:55 -07:00
|
|
|
evdata->win_fed = EINA_FALSE;
|
|
|
|
evdata->evas_done = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_evas_event_pointer_feed_fake_cb(void *data, const Efl_Event *ev)
|
2016-06-01 22:36:55 -07:00
|
|
|
{
|
|
|
|
Eo *evas = data;
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl_Input_Event *evt = ev->info;
|
|
|
|
Efl_Input_Pointer_Data *evdata;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
if (!efl_input_fake_get(evt))
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2016-06-01 22:36:55 -07:00
|
|
|
|
2016-08-25 03:20:10 -07:00
|
|
|
evdata = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS);
|
2016-06-01 22:36:55 -07:00
|
|
|
if (!evdata || evdata->win_fed)
|
2016-06-20 07:31:31 -07:00
|
|
|
return;
|
2016-06-01 22:36:55 -07:00
|
|
|
evdata->win_fed = EINA_TRUE;
|
|
|
|
|
2016-08-30 23:41:12 -07:00
|
|
|
efl_event_callback_call(evas, ev->desc, evt);
|
2016-06-01 22:36:55 -07:00
|
|
|
evdata->win_fed = EINA_FALSE;
|
|
|
|
evdata->evas_done = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(_elm_win_evas_feed_fake_callbacks,
|
2016-06-01 22:36:55 -07:00
|
|
|
{ EFL_EVENT_POINTER_MOVE, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_POINTER_DOWN, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_POINTER_UP, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_POINTER_IN, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_POINTER_OUT, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_POINTER_CANCEL, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_POINTER_WHEEL, _evas_event_pointer_feed_fake_cb },
|
2016-08-30 23:41:12 -07:00
|
|
|
{ EFL_EVENT_FINGER_MOVE, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_FINGER_DOWN, _evas_event_pointer_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_FINGER_UP, _evas_event_pointer_feed_fake_cb },
|
2016-06-01 22:36:55 -07:00
|
|
|
{ EFL_EVENT_KEY_DOWN, _evas_event_key_feed_fake_cb },
|
|
|
|
{ EFL_EVENT_KEY_UP, _evas_event_key_feed_fake_cb })
|
2016-05-30 03:51:31 -07:00
|
|
|
|
2016-06-07 21:55:21 -07:00
|
|
|
static void
|
|
|
|
_elm_win_evas_render_post(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Efl_Gfx_Event_Render_Post *ev = event_info;
|
|
|
|
Eo *win = data;
|
|
|
|
|
2018-03-26 06:21:21 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_RENDER_POST, ev);
|
2016-06-07 21:55:21 -07:00
|
|
|
}
|
|
|
|
|
2016-06-12 23:48:29 -07:00
|
|
|
static void
|
|
|
|
_elm_win_evas_render_pre(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *win = data;
|
|
|
|
|
2016-06-14 02:03:32 -07:00
|
|
|
_elm_win_throttle_ok = EINA_TRUE;
|
2018-03-26 06:21:21 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, NULL);
|
2016-06-12 23:48:29 -07:00
|
|
|
}
|
|
|
|
|
2016-06-13 00:28:17 -07:00
|
|
|
static void
|
|
|
|
_elm_win_evas_focus_in(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *win = data;
|
|
|
|
|
2016-06-14 02:03:32 -07:00
|
|
|
_elm_win_throttle_ok = EINA_TRUE;
|
2018-03-26 06:21:21 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_FOCUS_IN, NULL);
|
2016-06-13 00:28:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_evas_focus_out(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *win = data;
|
|
|
|
|
2018-03-26 06:21:21 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_FOCUS_OUT, NULL);
|
2016-06-13 00:28:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_evas_object_focus_in(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Eo *object = event_info;
|
|
|
|
Eo *win = data;
|
|
|
|
|
2016-06-14 02:03:32 -07:00
|
|
|
_elm_win_throttle_ok = EINA_TRUE;
|
2018-03-26 06:21:21 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN, object);
|
2016-06-13 00:28:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_evas_object_focus_out(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Eo *object = event_info;
|
|
|
|
Eo *win = data;
|
|
|
|
|
2018-03-26 06:21:21 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT, object);
|
2016-06-13 00:28:17 -07:00
|
|
|
}
|
|
|
|
|
2016-06-13 00:31:03 -07:00
|
|
|
static void
|
|
|
|
_elm_win_evas_device_changed(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Eo *device = event_info;
|
|
|
|
Eo *win = data;
|
|
|
|
|
2018-03-26 06:21:21 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED, device);
|
2016-06-13 00:31:03 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_win_event_add_cb(void *data, const Efl_Event *ev)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
2018-02-27 04:19:17 -08:00
|
|
|
const Efl_Callback_Array_Item_Full *array = ev->info;
|
2016-06-13 01:28:36 -07:00
|
|
|
Efl_Ui_Win_Data *sd = data;
|
|
|
|
Efl_Ui_Win *win = ev->object;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; array[i].desc; i++)
|
|
|
|
{
|
2016-08-30 23:41:12 -07:00
|
|
|
if (array[i].desc == EFL_EVENT_POINTER_MOVE)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.pointer_move++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_DOWN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.pointer_down++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_UP)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.pointer_up++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_IN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.pointer_in++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_OUT)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.pointer_out++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_CANCEL)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.pointer_cancel++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_WHEEL)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.pointer_wheel++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_FINGER_MOVE)
|
|
|
|
{
|
|
|
|
if (!(sd->event_forward.finger_move++))
|
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
|
|
|
else if (array[i].desc == EFL_EVENT_FINGER_DOWN)
|
|
|
|
{
|
|
|
|
if (!(sd->event_forward.finger_down++))
|
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
|
|
|
else if (array[i].desc == EFL_EVENT_FINGER_UP)
|
|
|
|
{
|
|
|
|
if (!(sd->event_forward.finger_up++))
|
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
|
|
|
else if (array[i].desc == EFL_EVENT_KEY_DOWN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
2017-10-18 04:56:26 -07:00
|
|
|
// Legacy API: Must grab key
|
|
|
|
if (elm_widget_is_legacy(win)) return;
|
2016-06-13 01:28:36 -07:00
|
|
|
if (!(sd->event_forward.key_down++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_key_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_KEY_UP)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
2017-10-18 04:56:26 -07:00
|
|
|
// Legacy API: Must grab key
|
|
|
|
if (elm_widget_is_legacy(win)) return;
|
2016-06-13 01:28:36 -07:00
|
|
|
if (!(sd->event_forward.key_up++))
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_key_cb, win);
|
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_POST)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.render_post++))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_POST,
|
|
|
|
_elm_win_evas_render_post, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_PRE)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.render_pre++))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_RENDER_PRE,
|
|
|
|
_elm_win_evas_render_pre, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_IN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.focus_in++))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_IN,
|
|
|
|
_elm_win_evas_focus_in, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_OUT)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.focus_out++))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_FOCUS_OUT,
|
|
|
|
_elm_win_evas_focus_out, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.object_focus_in++))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
|
|
|
_elm_win_evas_object_focus_in, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.object_focus_out++))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
|
|
|
_elm_win_evas_object_focus_out, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(sd->event_forward.device_changed++))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_DEVICE_CHANGED,
|
|
|
|
_elm_win_evas_device_changed, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_win_event_del_cb(void *data, const Efl_Event *ev)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
2018-02-27 04:19:17 -08:00
|
|
|
const Efl_Callback_Array_Item_Full *array = ev->info;
|
2016-06-13 01:28:36 -07:00
|
|
|
Efl_Ui_Win_Data *sd = data;
|
|
|
|
Efl_Ui_Win *win = ev->object;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; array[i].desc; i++)
|
|
|
|
{
|
2016-08-30 23:41:12 -07:00
|
|
|
if (array[i].desc == EFL_EVENT_POINTER_MOVE)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.pointer_move))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_DOWN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.pointer_down))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_UP)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.pointer_up))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_IN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.pointer_in))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_OUT)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.pointer_out))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_CANCEL)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.pointer_cancel))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_POINTER_WHEEL)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.pointer_wheel))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_FINGER_MOVE)
|
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.finger_move))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-08-30 23:41:12 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
|
|
|
else if (array[i].desc == EFL_EVENT_FINGER_DOWN)
|
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.finger_down))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-08-30 23:41:12 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
|
|
|
else if (array[i].desc == EFL_EVENT_FINGER_UP)
|
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.finger_up))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-08-30 23:41:12 -07:00
|
|
|
_evas_event_pointer_cb, win);
|
|
|
|
}
|
|
|
|
else if (array[i].desc == EFL_EVENT_KEY_DOWN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
2017-10-18 04:56:26 -07:00
|
|
|
// Legacy API: Must grab key
|
|
|
|
if (elm_widget_is_legacy(win)) return;
|
2016-06-13 01:28:36 -07:00
|
|
|
if (!(--sd->event_forward.key_down))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_key_cb, win);
|
|
|
|
}
|
2016-08-30 23:41:12 -07:00
|
|
|
else if (array[i].desc == EFL_EVENT_KEY_UP)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
2017-10-18 04:56:26 -07:00
|
|
|
// Legacy API: Must grab key
|
|
|
|
if (elm_widget_is_legacy(win)) return;
|
2016-06-13 01:28:36 -07:00
|
|
|
if (!(--sd->event_forward.key_up))
|
2016-11-23 05:08:28 -08:00
|
|
|
efl_event_callback_del(sd->evas, array[i].desc,
|
2016-06-13 01:28:36 -07:00
|
|
|
_evas_event_key_cb, win);
|
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_POST)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.render_post))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_RENDER_POST,
|
|
|
|
_elm_win_evas_render_post, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_RENDER_PRE)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.render_pre))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_RENDER_PRE,
|
|
|
|
_elm_win_evas_render_pre, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_IN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.focus_in))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_FOCUS_IN,
|
|
|
|
_elm_win_evas_focus_in, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_FOCUS_OUT)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.focus_out))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_FOCUS_OUT,
|
|
|
|
_elm_win_evas_focus_out, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_IN)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.object_focus_in))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
|
|
|
_elm_win_evas_object_focus_in, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_OBJECT_FOCUS_OUT)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.object_focus_out))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
|
|
|
_elm_win_evas_object_focus_out, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
2018-03-26 06:21:21 -07:00
|
|
|
else if (array[i].desc == EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED)
|
2016-06-13 01:28:36 -07:00
|
|
|
{
|
|
|
|
if (!(--sd->event_forward.device_changed))
|
2017-04-05 22:43:04 -07:00
|
|
|
evas_event_callback_del_full(sd->evas, EVAS_CALLBACK_DEVICE_CHANGED,
|
|
|
|
_elm_win_evas_device_changed, win);
|
2016-06-13 01:28:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-25 15:48:53 -07:00
|
|
|
static void
|
|
|
|
_win_paused(void *data, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
Efl_Ui_Win_Data *sd = data;
|
|
|
|
|
|
|
|
if (sd->paused)
|
|
|
|
{
|
|
|
|
ERR("A window did receive a pause event while still paused. Dismissing.");
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
sd->paused = EINA_TRUE;
|
|
|
|
_paused_windows++;
|
|
|
|
|
|
|
|
if (_elm_win_count == _paused_windows)
|
2018-02-27 04:19:17 -08:00
|
|
|
efl_event_callback_call(efl_loop_get(ev->object), EFL_APP_EVENT_PAUSE, NULL);
|
2017-09-25 15:48:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(_elm_win_tracking,
|
2017-09-26 09:56:06 -07:00
|
|
|
{ EFL_EVENT_CALLBACK_ADD, _win_event_add_cb },
|
|
|
|
{ EFL_EVENT_CALLBACK_DEL, _win_event_del_cb },
|
2017-09-25 15:48:53 -07:00
|
|
|
{ EFL_UI_WIN_EVENT_PAUSE, _win_paused })
|
|
|
|
|
2016-11-21 03:51:15 -08:00
|
|
|
static void
|
|
|
|
_elm_win_cb_mouse_up(void *data, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
DBG("Evas mouse up event");
|
|
|
|
/*Currently wayland server didn't send mouse up event after resize the window*/
|
|
|
|
Efl_Ui_Win_Data *sd = data;
|
|
|
|
if(sd->resizing) sd->resizing = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2017-09-25 15:48:53 -07:00
|
|
|
static void
|
|
|
|
_elm_win_resume(void *data, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
Efl_Ui_Win_Data *sd = data;
|
|
|
|
|
|
|
|
if (!sd->paused) return ;
|
|
|
|
|
|
|
|
efl_event_callback_call(sd->obj, EFL_UI_WIN_EVENT_RESUME, NULL);
|
|
|
|
sd->paused = EINA_FALSE;
|
|
|
|
|
|
|
|
if (_elm_win_count == _paused_windows)
|
2018-02-27 04:19:17 -08:00
|
|
|
efl_event_callback_call(efl_loop_get(ev->object), EFL_APP_EVENT_RESUME, NULL);
|
2017-09-25 15:48:53 -07:00
|
|
|
|
|
|
|
_paused_windows--;
|
|
|
|
}
|
|
|
|
|
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(_elm_evas_tracking,
|
|
|
|
{ EFL_EVENT_POINTER_UP, _elm_win_cb_mouse_up },
|
2018-03-26 06:21:21 -07:00
|
|
|
{ EFL_CANVAS_SCENE_EVENT_RENDER_PRE, _elm_win_resume })
|
2017-09-25 15:48:53 -07:00
|
|
|
|
2008-10-24 19:11:06 -07:00
|
|
|
static void
|
|
|
|
_deferred_ecore_evas_free(void *data)
|
|
|
|
{
|
|
|
|
ecore_evas_free(data);
|
2011-03-09 22:35:33 -08:00
|
|
|
_elm_win_deferred_free--;
|
2008-10-24 19:11:06 -07:00
|
|
|
}
|
|
|
|
|
2016-11-22 03:29:58 -08:00
|
|
|
static inline Edje_Object *
|
|
|
|
_elm_win_modal_blocker_edje_get(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
/* Legacy theme compatibility */
|
2016-12-07 02:27:05 -08:00
|
|
|
const char *version = edje_object_data_get(sd->legacy.edje, "version");
|
2016-11-22 03:29:58 -08:00
|
|
|
int v = version ? atoi(version) : 0;
|
2016-12-07 02:27:05 -08:00
|
|
|
if (v < FRAME_OBJ_THEME_MIN_VERSION)
|
2016-11-22 03:29:58 -08:00
|
|
|
{
|
|
|
|
DBG("Detected legacy theme (<1.19) for modal window blocker.");
|
|
|
|
return sd->legacy.edje;
|
|
|
|
}
|
|
|
|
return sd->frame_obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_modality_increment(Efl_Ui_Win_Data *modalsd)
|
|
|
|
{
|
|
|
|
Efl_Ui_Win *current;
|
|
|
|
Eina_List *l;
|
2018-04-26 04:24:09 -07:00
|
|
|
Eina_Bool is_legacy = elm_widget_is_legacy(modalsd->obj);
|
2016-11-22 03:29:58 -08:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, current)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET_OR_RETURN(current, cursd);
|
|
|
|
if (modalsd != cursd)
|
|
|
|
cursd->modal_count++;
|
|
|
|
if (cursd->modal_count > 0)
|
|
|
|
{
|
|
|
|
Edje_Object *ed = _elm_win_modal_blocker_edje_get(cursd);
|
2018-04-26 04:24:09 -07:00
|
|
|
if (is_legacy)
|
|
|
|
edje_object_signal_emit(ed, "elm,action,show_blocker", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(ed, "efl,action,show_blocker", "efl");
|
2016-11-22 03:29:58 -08:00
|
|
|
efl_event_callback_legacy_call
|
|
|
|
(cursd->main_menu, EFL_UI_WIN_EVENT_ELM_ACTION_BLOCK_MENU, NULL);
|
|
|
|
_elm_win_frame_style_update(cursd, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_modality_decrement(Efl_Ui_Win_Data *modalsd)
|
|
|
|
{
|
|
|
|
Efl_Ui_Win *current;
|
|
|
|
Eina_List *l;
|
2018-04-26 04:24:09 -07:00
|
|
|
Eina_Bool is_legacy = elm_widget_is_legacy(modalsd->obj);
|
2016-11-22 03:29:58 -08:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, current)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET_OR_RETURN(current, cursd);
|
|
|
|
if ((modalsd != cursd) && (cursd->modal_count > 0))
|
|
|
|
cursd->modal_count--;
|
|
|
|
if (cursd->modal_count == 0)
|
|
|
|
{
|
|
|
|
Edje_Object *ed = _elm_win_modal_blocker_edje_get(cursd);
|
2018-04-26 04:24:09 -07:00
|
|
|
if (is_legacy)
|
|
|
|
edje_object_signal_emit(ed, "elm,action,hide_blocker", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(ed, "efl,action,hide_blocker", "efl");
|
2016-11-22 03:29:58 -08:00
|
|
|
efl_event_callback_legacy_call
|
|
|
|
(cursd->main_menu, ELM_MENU_EVENT_ELM_ACTION_UNBLOCK_MENU, NULL);
|
|
|
|
_elm_win_frame_style_update(cursd, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-10 02:59:42 -07:00
|
|
|
static void
|
|
|
|
_efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
|
2010-10-21 11:58:43 -07:00
|
|
|
{
|
2016-02-18 01:15:00 -08:00
|
|
|
Eina_Bool do_eval = EINA_FALSE;
|
2014-04-09 03:04:55 -07:00
|
|
|
|
2016-12-08 00:49:23 -08:00
|
|
|
sd->shown = EINA_TRUE;
|
2016-10-10 02:59:42 -07:00
|
|
|
if (sd->modal_count)
|
|
|
|
{
|
|
|
|
/* FIXME FIXME FIXME
|
|
|
|
* Ugly code flow: legacy code had an early return in smart_show, ie.
|
|
|
|
* evas object show would be processed but smart object show would be
|
|
|
|
* aborted. This super call tries to simulate that. */
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_TRUE);
|
2016-10-10 02:59:42 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-04-09 03:04:55 -07:00
|
|
|
if ((sd->modal) && (!evas_object_visible_get(obj)))
|
2016-11-22 03:29:58 -08:00
|
|
|
_elm_win_modality_increment(sd);
|
2014-04-09 03:04:55 -07:00
|
|
|
|
2016-11-22 00:59:33 -08:00
|
|
|
if (!evas_object_visible_get(obj)) do_eval = EINA_TRUE;
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
|
2016-11-22 00:59:33 -08:00
|
|
|
|
2016-03-23 14:41:29 -07:00
|
|
|
if (sd->deferred_resize_job)
|
|
|
|
_elm_win_resize_job(sd->obj);
|
2015-08-27 20:20:36 -07:00
|
|
|
evas_smart_objects_calculate(evas_object_evas_get(obj));
|
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, show);
|
|
|
|
|
2015-10-08 03:23:15 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
|
|
|
{
|
2015-09-09 04:58:14 -07:00
|
|
|
Eo *root;
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_created_signal_emit(obj);
|
2019-02-09 09:45:27 -08:00
|
|
|
root = efl_access_object_access_root_get();
|
2015-09-09 04:58:14 -07:00
|
|
|
if (root)
|
2017-10-18 18:13:54 -07:00
|
|
|
efl_access_children_changed_added_signal_emit(root, obj);
|
2015-10-08 03:23:15 -07:00
|
|
|
}
|
|
|
|
|
2016-02-18 01:15:00 -08:00
|
|
|
if (do_eval)
|
|
|
|
{
|
|
|
|
if (_elm_win_state_eval_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(_elm_win_state_eval_timer);
|
|
|
|
_elm_win_state_eval_timer = NULL;
|
|
|
|
}
|
|
|
|
_elm_win_state_eval(NULL);
|
|
|
|
}
|
2018-08-20 08:00:09 -07:00
|
|
|
|
|
|
|
if (sd->shot.info) _shot_handle(sd);
|
|
|
|
|
2018-07-24 07:18:50 -07:00
|
|
|
if (!sd->first_draw) return;
|
|
|
|
if (sd->frame_obj)
|
|
|
|
{
|
|
|
|
evas_object_show(sd->frame_obj);
|
|
|
|
}
|
|
|
|
if (sd->img_obj)
|
|
|
|
{
|
|
|
|
evas_object_show(sd->img_obj);
|
|
|
|
}
|
|
|
|
if (sd->pointer.obj)
|
|
|
|
{
|
|
|
|
evas_object_show(sd->pointer.obj);
|
|
|
|
}
|
2010-10-21 11:58:43 -07:00
|
|
|
}
|
|
|
|
|
2016-10-10 02:59:42 -07:00
|
|
|
static void
|
|
|
|
_efl_ui_win_hide(Eo *obj, Efl_Ui_Win_Data *sd)
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2016-10-10 02:59:42 -07:00
|
|
|
if (sd->modal_count)
|
|
|
|
{
|
|
|
|
/* FIXME FIXME FIXME
|
|
|
|
* Ugly code flow: legacy code had an early return in smart_show, ie.
|
|
|
|
* evas object show would be processed but smart object show would be
|
|
|
|
* aborted. This super call tries to simulate that. */
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_FALSE);
|
2016-10-10 02:59:42 -07:00
|
|
|
return;
|
|
|
|
}
|
2014-04-09 03:04:55 -07:00
|
|
|
|
2016-10-10 02:59:42 -07:00
|
|
|
_elm_win_state_eval_queue();
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2014-04-09 03:04:55 -07:00
|
|
|
if ((sd->modal) && (evas_object_visible_get(obj)))
|
2016-11-22 03:29:58 -08:00
|
|
|
_elm_win_modality_decrement(sd);
|
2014-04-09 03:04:55 -07:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, hide);
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->frame_obj)
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_hide(sd->frame_obj);
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2012-08-22 02:21:28 -07:00
|
|
|
if (sd->img_obj)
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_hide(sd->img_obj);
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->pointer.obj)
|
2012-02-10 00:37:16 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_hide(sd->pointer.obj);
|
2012-02-10 00:37:16 -08:00
|
|
|
}
|
2016-10-27 10:13:32 -07:00
|
|
|
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2015-10-08 03:23:15 -07:00
|
|
|
{
|
2015-09-09 04:58:14 -07:00
|
|
|
Eo *root;
|
2019-02-09 09:45:27 -08:00
|
|
|
root = efl_access_object_access_root_get();
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_destroyed_signal_emit(obj);
|
2015-09-09 04:58:14 -07:00
|
|
|
if (root)
|
2017-10-18 18:13:54 -07:00
|
|
|
efl_access_children_changed_del_signal_emit(root, obj);
|
2015-10-08 03:23:15 -07:00
|
|
|
}
|
2015-07-01 07:40:57 -07:00
|
|
|
|
|
|
|
if (_elm_win_policy_quit_triggered(obj))
|
|
|
|
_elm_win_flush_cache_and_exit(obj);
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
|
|
|
|
2016-10-10 02:59:42 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_ui_win_efl_gfx_entity_visible_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool vis)
|
2016-10-10 02:59:42 -07:00
|
|
|
{
|
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (vis) _efl_ui_win_show(obj, sd);
|
|
|
|
else _efl_ui_win_hide(obj, sd);
|
|
|
|
}
|
|
|
|
|
2019-02-14 12:21:15 -08:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_win_efl_canvas_scene_pointer_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eo *dev, Eina_Position2D *pos)
|
2016-06-16 19:00:22 -07:00
|
|
|
{
|
2019-02-14 12:21:15 -08:00
|
|
|
return efl_canvas_scene_pointer_position_get(sd->evas, dev, pos);
|
2016-06-16 19:00:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_canvas_pointer_pointer_inside_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eo *dev)
|
2016-06-16 19:00:22 -07:00
|
|
|
{
|
2017-10-31 00:30:43 -07:00
|
|
|
return efl_canvas_pointer_inside_get(sd->evas, dev);
|
2016-06-16 19:00:22 -07:00
|
|
|
}
|
|
|
|
|
2016-08-30 23:41:12 -07:00
|
|
|
/* multi touch support */
|
|
|
|
static Eina_Bool
|
|
|
|
_input_pointer_iterator_next(Input_Pointer_Iterator *it, void **data)
|
|
|
|
{
|
|
|
|
Eo *sub;
|
|
|
|
|
|
|
|
if (!eina_iterator_next(it->real_iterator, (void **) &sub))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
if (data) *data = sub;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eo *
|
|
|
|
_input_pointer_iterator_get_container(Input_Pointer_Iterator *it)
|
|
|
|
{
|
|
|
|
return (Eo *) it->object;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_input_pointer_iterator_free(Input_Pointer_Iterator *it)
|
|
|
|
{
|
|
|
|
Efl_Input_Pointer *ptr;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(it->list, ptr)
|
2018-05-04 13:00:53 -07:00
|
|
|
efl_unref(ptr);
|
2016-08-30 23:41:12 -07:00
|
|
|
eina_iterator_free(it->real_iterator);
|
|
|
|
free(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Iterator *
|
2019-02-14 10:59:54 -08:00
|
|
|
_efl_ui_win_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *sd,
|
2017-09-25 02:47:49 -07:00
|
|
|
Eina_Bool hover EINA_UNUSED)
|
2016-08-30 23:41:12 -07:00
|
|
|
{
|
|
|
|
Input_Pointer_Iterator *it;
|
|
|
|
Eina_List *list = NULL;
|
|
|
|
int i, cnt;
|
|
|
|
|
|
|
|
// Note: "hover" is here as a possible extension to this API. At the moment
|
|
|
|
// I don't have any device that could track the position of hovering fingers
|
|
|
|
// and Evas also wouldn't track those.
|
|
|
|
|
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
|
|
|
|
2017-05-14 23:17:38 -07:00
|
|
|
cnt = evas_touch_point_list_count(sd->evas);
|
2016-08-30 23:41:12 -07:00
|
|
|
if (!cnt) return NULL;
|
|
|
|
|
|
|
|
it = calloc(1, sizeof(*it));
|
|
|
|
if (!it) return NULL;
|
|
|
|
|
|
|
|
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
|
|
|
|
|
|
|
|
for (i = 0; i < cnt; i++)
|
|
|
|
{
|
|
|
|
Efl_Input_Pointer_Data *ptrdata;
|
|
|
|
Evas_Touch_Point_State state;
|
|
|
|
Efl_Input_Pointer *ptr;
|
|
|
|
double x, y;
|
|
|
|
|
2019-02-09 10:08:45 -08:00
|
|
|
ptr = efl_input_pointer_instance_get( (Eo *) obj, (void **) &ptrdata);
|
2016-08-30 23:41:12 -07:00
|
|
|
if (!ptrdata) break;
|
|
|
|
|
2017-05-14 23:17:38 -07:00
|
|
|
ptrdata->tool = evas_touch_point_list_nth_id_get(sd->evas, i);
|
2016-08-30 23:41:12 -07:00
|
|
|
_efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_TOOL);
|
|
|
|
|
|
|
|
// Note that "still" maps to "down" here.
|
2017-05-14 23:17:38 -07:00
|
|
|
state = evas_touch_point_list_nth_state_get(sd->evas, i);
|
2016-08-30 23:41:12 -07:00
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case EVAS_TOUCH_POINT_DOWN: ptrdata->action = EFL_POINTER_ACTION_DOWN; break;
|
|
|
|
case EVAS_TOUCH_POINT_UP: ptrdata->action = EFL_POINTER_ACTION_UP; break;
|
|
|
|
case EVAS_TOUCH_POINT_MOVE: ptrdata->action = EFL_POINTER_ACTION_MOVE; break;
|
|
|
|
case EVAS_TOUCH_POINT_STILL: ptrdata->action = EFL_POINTER_ACTION_DOWN; break;
|
|
|
|
case EVAS_TOUCH_POINT_CANCEL: ptrdata->action = EFL_POINTER_ACTION_CANCEL; break;
|
|
|
|
default: ptrdata->action = EFL_POINTER_ACTION_NONE; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
evas_canvas_touch_point_list_nth_xy_get(sd->evas, i, &x, &y);
|
|
|
|
_efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_X);
|
|
|
|
_efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_Y);
|
|
|
|
ptrdata->cur.x = x;
|
|
|
|
ptrdata->cur.y = y;
|
|
|
|
ptrdata->prev = ptrdata->cur;
|
|
|
|
|
|
|
|
list = eina_list_append(list, ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
it->list = list;
|
|
|
|
it->real_iterator = eina_list_iterator_new(it->list);
|
|
|
|
it->iterator.version = EINA_ITERATOR_VERSION;
|
|
|
|
it->iterator.next = FUNC_ITERATOR_NEXT(_input_pointer_iterator_next);
|
|
|
|
it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_input_pointer_iterator_get_container);
|
|
|
|
it->iterator.free = FUNC_ITERATOR_FREE(_input_pointer_iterator_free);
|
|
|
|
it->object = obj;
|
|
|
|
|
|
|
|
return &it->iterator;
|
|
|
|
}
|
|
|
|
|
2016-06-16 19:00:22 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-03-26 06:21:21 -07:00
|
|
|
_efl_ui_win_efl_canvas_scene_image_max_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D *max)
|
2016-06-16 19:00:22 -07:00
|
|
|
{
|
2018-03-26 06:21:21 -07:00
|
|
|
return efl_canvas_scene_image_max_size_get(sd->evas, max);
|
2016-06-16 19:00:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-02-25 10:59:18 -08:00
|
|
|
_efl_ui_win_efl_canvas_scene_group_objects_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-06-16 19:00:22 -07:00
|
|
|
{
|
|
|
|
evas_smart_objects_calculate(sd->evas);
|
|
|
|
}
|
|
|
|
|
2016-06-17 00:32:38 -07:00
|
|
|
EOLIAN static Eina_Iterator *
|
2018-03-26 06:21:21 -07:00
|
|
|
_efl_ui_win_efl_canvas_scene_objects_at_xy_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2016-06-17 00:32:38 -07:00
|
|
|
{
|
|
|
|
Eina_List *objs = NULL;
|
2017-09-18 01:55:50 -07:00
|
|
|
objs = evas_objects_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
|
|
|
|
return eina_list_iterator_new(objs); // FIXME: This leaks the list!
|
2016-06-17 00:32:38 -07:00
|
|
|
}
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
EOLIAN static Efl_Gfx_Entity *
|
2018-03-26 06:21:21 -07:00
|
|
|
_efl_ui_win_efl_canvas_scene_object_top_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2016-06-17 00:32:38 -07:00
|
|
|
{
|
2017-09-18 01:55:50 -07:00
|
|
|
return evas_object_top_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
|
2016-06-17 00:32:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Iterator *
|
2018-03-26 06:21:21 -07:00
|
|
|
_efl_ui_win_efl_canvas_scene_objects_in_rectangle_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2016-06-17 00:32:38 -07:00
|
|
|
{
|
|
|
|
Eina_List *objs = NULL;
|
2017-09-18 01:55:50 -07:00
|
|
|
objs = evas_objects_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
|
|
|
|
return eina_list_iterator_new(objs); // FIXME: This leaks the list!
|
2016-06-17 00:32:38 -07:00
|
|
|
}
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
EOLIAN static Efl_Gfx_Entity *
|
2018-03-26 06:21:21 -07:00
|
|
|
_efl_ui_win_efl_canvas_scene_object_top_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
|
2016-06-17 00:32:38 -07:00
|
|
|
{
|
2017-09-18 01:55:50 -07:00
|
|
|
return evas_object_top_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
|
2016-06-17 00:32:38 -07:00
|
|
|
}
|
|
|
|
|
2017-06-14 18:38:33 -07:00
|
|
|
EOLIAN static Efl_Input_Device *
|
2018-03-26 06:21:21 -07:00
|
|
|
_efl_ui_win_efl_canvas_scene_device_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *name)
|
2017-06-14 18:38:33 -07:00
|
|
|
{
|
2018-03-26 06:21:21 -07:00
|
|
|
return efl_canvas_scene_device_get(sd->evas, name);
|
2017-06-14 18:38:33 -07:00
|
|
|
}
|
|
|
|
|
2019-02-14 11:32:52 -08:00
|
|
|
EOLIAN static Efl_Input_Device *
|
|
|
|
_efl_ui_win_efl_canvas_scene_seat_default_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
return efl_canvas_scene_seat_default_get(sd->evas);
|
|
|
|
}
|
|
|
|
|
2017-06-14 18:38:33 -07:00
|
|
|
EOLIAN static Efl_Input_Device *
|
2018-03-26 06:21:21 -07:00
|
|
|
_efl_ui_win_efl_canvas_scene_seat_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int id)
|
2017-06-14 18:38:33 -07:00
|
|
|
{
|
2018-03-26 06:21:21 -07:00
|
|
|
return efl_canvas_scene_seat_get(sd->evas, id);
|
2017-06-14 18:38:33 -07:00
|
|
|
}
|
|
|
|
|
2011-04-14 03:48:43 -07:00
|
|
|
static void
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_on_parent_del(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
void *event_info EINA_UNUSED)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (obj == sd->parent) sd->parent = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_focus_target_move(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
sd->focus_highlight.geometry_changed = EINA_TRUE;
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_focus_target_resize(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
sd->focus_highlight.geometry_changed = EINA_TRUE;
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_focus_target_del(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
sd->focus_highlight.cur.target = NULL;
|
|
|
|
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_elm_win_focus_target_get(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *o = obj;
|
|
|
|
|
2018-07-09 10:32:58 -07:00
|
|
|
while (o)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
if (elm_widget_is(o))
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
if (!elm_widget_highlight_ignore_get(o))
|
|
|
|
break;
|
|
|
|
}
|
2018-01-23 22:36:08 -08:00
|
|
|
o = elm_widget_parent_widget_get(o);
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_target_callbacks_add(Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
|
|
|
Evas_Object *obj = sd->focus_highlight.cur.target;
|
2012-12-07 23:00:55 -08:00
|
|
|
if (!obj) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_target_callbacks_del(Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
|
|
|
Evas_Object *obj = sd->focus_highlight.cur.target;
|
|
|
|
|
|
|
|
evas_object_event_callback_del_full
|
2013-04-24 04:41:37 -07:00
|
|
|
(obj, EVAS_CALLBACK_MOVE, _elm_win_focus_target_move, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_event_callback_del_full
|
2013-04-24 04:41:37 -07:00
|
|
|
(obj, EVAS_CALLBACK_RESIZE, _elm_win_focus_target_resize, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_object_focus_in(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
2012-05-03 15:42:15 -07:00
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Object *obj = event_info, *target;
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
if (sd->focus_highlight.cur.target == obj)
|
|
|
|
return;
|
|
|
|
|
|
|
|
target = _elm_win_focus_target_get(obj);
|
|
|
|
sd->focus_highlight.cur.target = target;
|
|
|
|
|
2016-08-29 19:04:31 -07:00
|
|
|
if (target)
|
|
|
|
{
|
|
|
|
if (elm_widget_highlight_in_theme_get(target))
|
|
|
|
sd->focus_highlight.cur.in_theme = EINA_TRUE;
|
|
|
|
else
|
|
|
|
_elm_win_focus_target_callbacks_add(sd);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(target, EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
|
|
|
|
}
|
2015-08-04 22:46:01 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_object_focus_out(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
if (!sd->focus_highlight.cur.target)
|
|
|
|
return;
|
|
|
|
|
2014-02-04 16:57:34 -08:00
|
|
|
if (!sd->focus_highlight.cur.in_theme)
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_target_callbacks_del(sd);
|
|
|
|
|
2015-08-04 22:46:01 -07:00
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->focus_highlight.cur.target,
|
|
|
|
EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->focus_highlight.cur.target = NULL;
|
2014-02-04 16:57:34 -08:00
|
|
|
sd->focus_highlight.cur.in_theme = EINA_FALSE;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_highlight_shutdown(Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_stop(sd);
|
|
|
|
if (sd->focus_highlight.cur.target)
|
|
|
|
{
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
elm_widget_signal_emit(sd->focus_highlight.cur.target,
|
|
|
|
"elm,action,focus_highlight,hide", "elm");
|
|
|
|
else
|
|
|
|
elm_widget_signal_emit(sd->focus_highlight.cur.target,
|
|
|
|
"efl,action,focus_highlight,hide", "efl");
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_target_callbacks_del(sd);
|
2015-08-04 22:46:01 -07:00
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(sd->focus_highlight.cur.target,
|
|
|
|
EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->focus_highlight.cur.target = NULL;
|
|
|
|
}
|
2013-08-04 01:37:30 -07:00
|
|
|
ELM_SAFE_FREE(sd->focus_highlight.fobj, evas_object_del);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
evas_event_callback_del_full
|
|
|
|
(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
2013-04-24 04:41:37 -07:00
|
|
|
_elm_win_object_focus_in, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_event_callback_del_full
|
|
|
|
(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
2013-04-24 04:41:37 -07:00
|
|
|
_elm_win_object_focus_out, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
2014-02-17 23:15:55 -08:00
|
|
|
static void
|
|
|
|
_win_img_hide(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
2017-09-26 16:07:20 -07:00
|
|
|
Efl_Ui_Win *real_win = elm_widget_top_get(data);
|
|
|
|
efl_ui_focus_manager_redirect_set(real_win, NULL);
|
2014-02-17 23:15:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_win_img_mouse_up(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Up *ev = event_info;
|
|
|
|
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
|
2017-08-30 19:27:49 -07:00
|
|
|
elm_widget_focus_mouse_up_handle(evas_object_widget_parent_find(data));
|
2014-02-17 23:15:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_win_img_focus_in(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
2017-09-26 16:07:20 -07:00
|
|
|
Efl_Ui_Win *real_win = elm_widget_top_get(data);
|
|
|
|
efl_ui_focus_manager_redirect_set(real_win, data);
|
|
|
|
efl_ui_focus_manager_focus_set(data, efl_ui_focus_manager_root_get(data));
|
2014-02-17 23:15:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_win_img_focus_out(void *data,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
2017-09-26 16:07:20 -07:00
|
|
|
Efl_Ui_Win *real_win = elm_widget_top_get(data);
|
|
|
|
efl_ui_focus_manager_redirect_set(real_win, NULL);
|
2014-02-17 23:15:55 -08:00
|
|
|
}
|
|
|
|
|
2012-07-23 01:23:01 -07:00
|
|
|
static void
|
|
|
|
_elm_win_on_img_obj_del(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-07-23 01:23:01 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2014-02-17 23:15:55 -08:00
|
|
|
_elm_win_img_callbacks_del(sd->obj, sd->img_obj);
|
2012-07-23 01:23:01 -07:00
|
|
|
sd->img_obj = NULL;
|
|
|
|
}
|
|
|
|
|
2014-02-17 23:15:55 -08:00
|
|
|
static void
|
|
|
|
_elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
|
|
|
|
{
|
2017-02-16 04:45:12 -08:00
|
|
|
if (!imgobj) return;
|
2014-02-17 23:15:55 -08:00
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
|
|
|
|
evas_object_event_callback_del_full
|
|
|
|
(imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2014-04-09 03:04:55 -07:00
|
|
|
if ((sd->modal) && (evas_object_visible_get(obj)))
|
2016-11-22 03:29:58 -08:00
|
|
|
_elm_win_modality_decrement(sd);
|
2014-04-09 03:04:55 -07:00
|
|
|
|
2016-12-20 08:27:45 -08:00
|
|
|
if ((sd->modal) && (sd->modal_count > 0))
|
2014-04-09 03:04:55 -07:00
|
|
|
ERR("Deleted modal win was blocked by another modal win which was created after creation of that win.");
|
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
evas_object_event_callback_del_full(sd->legacy.edje,
|
2013-01-18 07:56:25 -08:00
|
|
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
|
|
|
_elm_win_on_resize_obj_changed_size_hints,
|
|
|
|
obj);
|
2016-06-07 21:55:21 -07:00
|
|
|
|
2017-09-26 15:21:12 -07:00
|
|
|
efl_event_callback_array_del(sd->evas, _elm_evas_tracking(), sd);
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_array_del(obj, _elm_win_evas_feed_fake_callbacks(), sd->evas);
|
2017-09-26 15:21:12 -07:00
|
|
|
efl_event_callback_array_del(obj, _elm_win_tracking(), sd);
|
2016-11-17 00:46:14 -08:00
|
|
|
evas_object_del(sd->legacy.box);
|
|
|
|
evas_object_del(sd->legacy.edje);
|
2013-01-17 14:11:15 -08:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
/* NB: child deletion handled by parent's smart del */
|
|
|
|
|
2015-06-16 14:00:44 -07:00
|
|
|
if ((sd->type != ELM_WIN_FAKE) && (trap) && (trap->del))
|
2012-07-18 21:35:50 -07:00
|
|
|
trap->del(sd->trap_data, obj);
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->parent)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del_full
|
2013-04-24 04:41:37 -07:00
|
|
|
(sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->parent = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sd->autodel_clear) *(sd->autodel_clear) = -1;
|
|
|
|
|
2015-09-03 05:07:23 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_destroyed_signal_emit(obj);
|
2015-09-03 05:07:23 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_list = eina_list_remove(_elm_win_list, obj);
|
2012-08-28 03:37:02 -07:00
|
|
|
_elm_win_count--;
|
|
|
|
_elm_win_state_eval_queue();
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2017-09-25 15:48:53 -07:00
|
|
|
if (_elm_win_count == _paused_windows)
|
2018-02-27 04:19:17 -08:00
|
|
|
efl_event_callback_call(efl_loop_get(obj), EFL_APP_EVENT_PAUSE, NULL);
|
2017-09-25 15:48:53 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->ee)
|
|
|
|
{
|
|
|
|
ecore_evas_callback_delete_request_set(sd->ee, NULL);
|
|
|
|
ecore_evas_callback_resize_set(sd->ee, NULL);
|
|
|
|
}
|
2013-05-22 23:54:49 -07:00
|
|
|
|
2014-01-21 06:16:41 -08:00
|
|
|
eina_stringshare_del(sd->shot.info);
|
|
|
|
ecore_timer_del(sd->shot.timer);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2012-05-02 18:19:05 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2014-01-21 06:16:41 -08:00
|
|
|
ecore_event_handler_del(sd->x.client_message_handler);
|
|
|
|
ecore_event_handler_del(sd->x.property_handler);
|
2012-05-02 18:19:05 -07:00
|
|
|
#endif
|
2016-03-23 13:58:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
ecore_event_handler_del(sd->wl.configure_handler);
|
2016-10-27 10:13:32 -07:00
|
|
|
if (sd->pointer.obj) evas_object_del(sd->pointer.obj);
|
|
|
|
if (sd->pointer.ee) ecore_evas_free(sd->pointer.ee);
|
2016-10-28 06:06:48 -07:00
|
|
|
sd->pointer.surf = NULL;
|
2016-03-23 13:58:23 -07:00
|
|
|
#endif
|
2017-06-14 23:58:05 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
ecore_event_handler_del(sd->win32.key_down_handler);
|
|
|
|
#endif
|
2008-10-06 18:23:49 -07:00
|
|
|
|
2017-02-16 04:45:12 -08:00
|
|
|
if (sd->type == ELM_WIN_INLINED_IMAGE)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2014-02-17 23:15:55 -08:00
|
|
|
_elm_win_img_callbacks_del(obj, sd->img_obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->img_obj = NULL;
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-06-16 14:01:02 -07:00
|
|
|
if (sd->ee && (sd->type != ELM_WIN_FAKE))
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2018-04-16 13:29:46 -07:00
|
|
|
ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
|
|
|
|
edje_object_freeze(sd->frame_obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
ecore_job_add(_deferred_ecore_evas_free, sd->ee);
|
2012-05-02 18:19:05 -07:00
|
|
|
_elm_win_deferred_free++;
|
|
|
|
}
|
|
|
|
}
|
2011-03-09 22:35:33 -08:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_shutdown(sd);
|
|
|
|
eina_stringshare_del(sd->focus_highlight.style);
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2014-01-21 17:12:44 -08:00
|
|
|
eina_stringshare_del(sd->title);
|
|
|
|
eina_stringshare_del(sd->icon_name);
|
|
|
|
eina_stringshare_del(sd->role);
|
2015-04-17 15:10:11 -07:00
|
|
|
eina_stringshare_del(sd->name);
|
2016-06-22 19:06:22 -07:00
|
|
|
eina_stringshare_del(sd->accel_pref);
|
2016-12-08 00:49:23 -08:00
|
|
|
eina_stringshare_del(sd->stack_id);
|
|
|
|
eina_stringshare_del(sd->stack_master_id);
|
2014-01-21 17:12:44 -08:00
|
|
|
evas_object_del(sd->icon);
|
2014-01-21 17:38:55 -08:00
|
|
|
evas_object_del(sd->main_menu);
|
2017-12-11 17:02:23 -08:00
|
|
|
evas_object_del(sd->indicator);
|
2012-12-27 05:38:33 -08:00
|
|
|
|
2016-04-02 00:02:07 -07:00
|
|
|
sd->focus_highlight.style = NULL;
|
|
|
|
sd->title = NULL;
|
|
|
|
sd->icon_name = NULL;
|
|
|
|
sd->role = NULL;
|
|
|
|
sd->name = NULL;
|
|
|
|
sd->icon = NULL;
|
|
|
|
sd->main_menu = NULL;
|
|
|
|
|
2012-12-04 22:50:27 -08:00
|
|
|
_elm_win_profile_del(sd);
|
|
|
|
_elm_win_available_profiles_del(sd);
|
2017-08-31 01:57:40 -07:00
|
|
|
eina_array_free(sd->profile.available);
|
|
|
|
sd->profile.available = NULL;
|
2012-12-04 22:50:27 -08:00
|
|
|
|
2015-09-22 17:40:31 -07:00
|
|
|
free(sd->wm_rot.rots);
|
2016-04-02 00:02:07 -07:00
|
|
|
sd->wm_rot.rots = NULL;
|
2015-09-22 17:40:31 -07:00
|
|
|
|
2012-07-19 21:20:06 -07:00
|
|
|
/* Don't let callback in the air that point to sd */
|
2017-09-25 23:00:53 -07:00
|
|
|
if (sd->ee)
|
|
|
|
{
|
|
|
|
ecore_evas_callback_mouse_in_set(sd->ee, NULL);
|
|
|
|
ecore_evas_callback_focus_in_set(sd->ee, NULL);
|
|
|
|
ecore_evas_callback_focus_out_set(sd->ee, NULL);
|
|
|
|
ecore_evas_callback_move_set(sd->ee, NULL);
|
|
|
|
ecore_evas_callback_state_change_set(sd->ee, NULL);
|
|
|
|
ecore_evas_callback_pre_render_set(sd->ee, NULL);
|
|
|
|
}
|
2012-07-19 21:20:06 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_del(efl_super(obj, MY_CLASS));
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2019-01-31 08:54:58 -08:00
|
|
|
if (eina_value_type_get(&sd->exit_on_close))
|
|
|
|
efl_loop_quit(efl_loop_get(obj), sd->exit_on_close);
|
|
|
|
else if (!_elm_win_list)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2019-01-10 12:48:10 -08:00
|
|
|
if (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED)
|
|
|
|
_elm_win_flush_cache_and_exit(obj);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
2019-01-10 12:48:10 -08:00
|
|
|
if (!_elm_win_list)
|
2019-01-31 08:54:54 -08:00
|
|
|
{
|
2019-02-09 09:45:27 -08:00
|
|
|
efl_event_callback_call(efl_app_main_get(), EFL_APP_EVENT_STANDBY, NULL);
|
2019-01-31 08:54:54 -08:00
|
|
|
if (eina_value_type_get(&exit_on_all_windows_closed))
|
|
|
|
efl_loop_quit(efl_loop_get(obj), exit_on_all_windows_closed);
|
|
|
|
}
|
2012-05-02 09:58:56 -07:00
|
|
|
}
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_ui_win_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Position2D pos)
|
2011-03-23 06:29:26 -07:00
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
|
2016-10-10 20:39:05 -07:00
|
|
|
return;
|
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
if (sd->img_obj)
|
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
if ((pos.x != sd->screen.x) || (pos.y != sd->screen.y))
|
2012-07-18 21:35:50 -07:00
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
sd->screen.x = pos.x;
|
|
|
|
sd->screen.y = pos.y;
|
2019-02-21 10:01:56 -08:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, NULL);
|
2012-07-18 21:35:50 -07:00
|
|
|
}
|
2016-10-10 20:39:05 -07:00
|
|
|
goto super_skip;
|
2012-07-18 21:35:50 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-05-12 03:19:29 -07:00
|
|
|
if (!sd->response)
|
|
|
|
{
|
|
|
|
sd->req_xy = EINA_TRUE;
|
2017-09-14 20:14:32 -07:00
|
|
|
sd->req_x = pos.x;
|
|
|
|
sd->req_y = pos.y;
|
|
|
|
TRAP(sd, move, pos.x, pos.y);
|
2017-05-12 03:19:29 -07:00
|
|
|
}
|
2016-10-10 20:39:05 -07:00
|
|
|
if (!ecore_evas_override_get(sd->ee)) goto super_skip;
|
2012-07-18 21:35:50 -07:00
|
|
|
}
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (ecore_evas_override_get(sd->ee))
|
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
sd->screen.x = pos.x;
|
|
|
|
sd->screen.y = pos.y;
|
2019-02-21 10:01:56 -08:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, NULL);
|
2011-03-23 06:29:26 -07:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->frame_obj)
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
/* TODO */
|
|
|
|
/* ecore_wl_window_update_location(sd->wl.win, x, y); */
|
2015-01-08 02:46:52 -08:00
|
|
|
#endif
|
2017-09-14 20:14:32 -07:00
|
|
|
sd->screen.x = pos.x;
|
|
|
|
sd->screen.y = pos.y;
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2012-08-22 02:21:28 -07:00
|
|
|
if (sd->img_obj)
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
sd->screen.x = pos.x;
|
|
|
|
sd->screen.y = pos.y;
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2016-10-10 20:39:05 -07:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
super_skip:
|
|
|
|
/* FIXME FIXME FIXME
|
|
|
|
* Ugly code flow: legacy code had an early return in smart_move, ie.
|
|
|
|
* evas object move would be processed but smart object move would be
|
|
|
|
* aborted. This super call tries to simulate that. */
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_position_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), pos);
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2018-04-05 01:47:26 -07:00
|
|
|
_efl_ui_win_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2017-09-15 02:37:25 -07:00
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
|
evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
- intercept
- smart resize (do stuff), super, super, super
- evas object resize
The new code is more like:
- intercept
- super, super, super, evas object resize
- do stuff
But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-11 00:54:31 -07:00
|
|
|
return;
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->img_obj)
|
|
|
|
{
|
|
|
|
if (sd->constrain)
|
2011-12-03 14:51:12 -08:00
|
|
|
{
|
|
|
|
int sw, sh;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sw, &sh);
|
2017-09-15 02:37:25 -07:00
|
|
|
sz.w = MIN(sz.w, sw);
|
|
|
|
sz.h = MIN(sz.h, sh);
|
2011-12-03 14:51:12 -08:00
|
|
|
}
|
2017-09-15 02:37:25 -07:00
|
|
|
if (sz.w < 1) sz.w = 1;
|
|
|
|
if (sz.h < 1) sz.h = 1;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-09-15 02:37:25 -07:00
|
|
|
evas_object_image_size_set(sd->img_obj, sz.w, sz.h);
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2012-07-18 21:35:50 -07:00
|
|
|
|
2016-10-28 00:48:56 -07:00
|
|
|
_elm_win_frame_geometry_adjust(sd);
|
2017-05-12 03:19:29 -07:00
|
|
|
if (!sd->response)
|
|
|
|
{
|
|
|
|
sd->req_wh = EINA_TRUE;
|
2017-09-15 02:37:25 -07:00
|
|
|
sd->req_w = sz.w;
|
|
|
|
sd->req_h = sz.h;
|
|
|
|
TRAP(sd, resize, sz.w, sz.h);
|
2017-05-12 03:19:29 -07:00
|
|
|
}
|
evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
- intercept
- smart resize (do stuff), super, super, super
- evas object resize
The new code is more like:
- intercept
- super, super, super, evas object resize
- do stuff
But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-11 00:54:31 -07:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
|
2018-07-24 07:18:53 -07:00
|
|
|
/* if window is hidden during a resize,
|
|
|
|
* revert to initial state where pre-render triggers recalc and other resizes are deferred
|
|
|
|
*/
|
|
|
|
if (efl_gfx_entity_visible_get(obj)) return;
|
|
|
|
if (!sd->first_draw) return;
|
|
|
|
sd->first_draw = EINA_FALSE;
|
|
|
|
edje_object_freeze(sd->frame_obj);
|
2011-03-23 06:29:26 -07:00
|
|
|
}
|
|
|
|
|
2008-09-29 23:58:56 -07:00
|
|
|
static void
|
|
|
|
_elm_win_delete_request(Ecore_Evas *ee)
|
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd = _elm_win_associate_get(ee);
|
2012-07-18 21:35:50 -07:00
|
|
|
Evas_Object *obj;
|
2008-09-29 23:58:56 -07:00
|
|
|
|
2014-02-17 22:58:57 -08:00
|
|
|
if (!sd) return;
|
2012-07-18 21:35:50 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
obj = sd->obj;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
int autodel = sd->autodel;
|
|
|
|
sd->autodel_clear = &autodel;
|
|
|
|
evas_object_ref(obj);
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_DELETE_REQUEST, NULL);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2015-07-01 07:40:57 -07:00
|
|
|
if (sd->autohide)
|
|
|
|
evas_object_hide(obj);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2015-04-29 06:08:57 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_destroyed_signal_emit(obj);
|
2017-08-10 18:24:54 -07:00
|
|
|
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (autodel) evas_object_del(obj);
|
|
|
|
else sd->autodel_clear = NULL;
|
|
|
|
evas_object_unref(obj);
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2012-07-11 04:53:29 -07:00
|
|
|
Ecore_X_Window
|
2012-05-28 05:28:46 -07:00
|
|
|
_elm_ee_xwin_get(const Ecore_Evas *ee)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2012-05-29 21:57:31 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2014-01-07 16:05:08 -08:00
|
|
|
const char *engine_name;
|
2012-05-28 05:28:46 -07:00
|
|
|
if (!ee) return 0;
|
2014-01-07 16:05:08 -08:00
|
|
|
|
|
|
|
engine_name = ecore_evas_engine_name_get(ee);
|
|
|
|
if (EINA_UNLIKELY(!engine_name)) return 0;
|
|
|
|
|
|
|
|
if (!strcmp(engine_name, ELM_SOFTWARE_X11))
|
2010-11-01 14:10:07 -07:00
|
|
|
{
|
2014-01-07 16:05:08 -08:00
|
|
|
return ecore_evas_software_x11_window_get(ee);
|
2010-11-01 14:10:07 -07:00
|
|
|
}
|
2014-01-07 16:05:08 -08:00
|
|
|
else if (!strcmp(engine_name, ELM_OPENGL_X11))
|
2010-11-01 14:10:07 -07:00
|
|
|
{
|
2014-01-07 16:05:08 -08:00
|
|
|
return ecore_evas_gl_x11_window_get(ee);
|
2010-11-01 14:10:07 -07:00
|
|
|
}
|
2014-03-08 06:54:34 -08:00
|
|
|
#else
|
|
|
|
(void)ee;
|
2012-05-28 05:28:46 -07:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_internal_elm_win_xwindow_get(Efl_Ui_Win_Data *sd)
|
2012-05-28 05:28:46 -07:00
|
|
|
{
|
2017-01-12 01:01:15 -08:00
|
|
|
Ecore_X_Window pwin = sd->x.xwin;
|
2012-06-06 01:25:12 -07:00
|
|
|
sd->x.xwin = _elm_ee_xwin_get(sd->ee);
|
2017-01-12 01:01:15 -08:00
|
|
|
if (sd->x.xwin != pwin)
|
|
|
|
{
|
|
|
|
char buf[128];
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%x", sd->x.xwin);
|
|
|
|
eina_stringshare_del(sd->stack_id);
|
|
|
|
sd->stack_id = eina_stringshare_add(buf);
|
|
|
|
}
|
2008-11-18 22:23:08 -08:00
|
|
|
}
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2008-11-18 22:23:08 -08:00
|
|
|
|
2015-10-01 07:25:23 -07:00
|
|
|
Ecore_Wl2_Window *
|
2013-11-15 02:14:08 -08:00
|
|
|
_elm_ee_wlwin_get(const Ecore_Evas *ee)
|
|
|
|
{
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-01-07 16:05:08 -08:00
|
|
|
const char *engine_name;
|
2013-11-15 02:14:08 -08:00
|
|
|
|
|
|
|
if (!ee) return NULL;
|
2014-01-07 16:05:08 -08:00
|
|
|
|
|
|
|
engine_name = ecore_evas_engine_name_get(ee);
|
|
|
|
if (EINA_UNLIKELY(!engine_name)) return NULL;
|
|
|
|
|
|
|
|
if ((!strcmp(engine_name, ELM_WAYLAND_SHM)) ||
|
|
|
|
(!strcmp(engine_name, ELM_WAYLAND_EGL)))
|
2013-11-15 02:14:08 -08:00
|
|
|
{
|
2016-01-07 11:56:30 -08:00
|
|
|
return ecore_evas_wayland2_window_get(ee);
|
2013-11-15 02:14:08 -08:00
|
|
|
}
|
2013-11-15 04:52:19 -08:00
|
|
|
#else
|
|
|
|
(void)ee;
|
2013-11-15 02:14:08 -08:00
|
|
|
#endif
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2013-11-15 02:14:08 -08:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_wlwindow_get(Efl_Ui_Win_Data *sd)
|
2013-11-15 02:14:08 -08:00
|
|
|
{
|
2017-08-04 13:08:42 -07:00
|
|
|
Ecore_Wl2_Window *pwin = sd->wl.win;
|
2013-11-15 02:14:08 -08:00
|
|
|
sd->wl.win = _elm_ee_wlwin_get(sd->ee);
|
2017-08-04 13:08:42 -07:00
|
|
|
if (sd->wl.win != pwin)
|
|
|
|
{
|
|
|
|
char buf[128];
|
|
|
|
int id;
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "%u||%p", getpid(), sd->wl.win);
|
|
|
|
eina_stringshare_replace(&sd->stack_id, buf);
|
|
|
|
id = ecore_evas_aux_hint_id_get(sd->ee, "stack_id");
|
|
|
|
if (id >= 0) ecore_evas_aux_hint_val_set(sd->ee, id, sd->stack_id);
|
|
|
|
else ecore_evas_aux_hint_add(sd->ee, "stack_id", sd->stack_id);
|
|
|
|
}
|
2013-11-15 02:14:08 -08:00
|
|
|
}
|
2016-10-28 10:59:31 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
_elm_win_wl_cursor_set(Evas_Object *obj, const char *cursor)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
|
|
|
|
if (!sd) return;
|
|
|
|
|
|
|
|
if (sd->pointer.obj)
|
|
|
|
{
|
|
|
|
Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
|
|
|
|
|
|
|
|
if (cursor)
|
|
|
|
{
|
2017-11-17 00:24:39 -08:00
|
|
|
if (!elm_widget_theme_object_set(sd->obj, sd->pointer.obj,
|
2016-10-28 10:59:31 -07:00
|
|
|
"cursor", cursor, "default"))
|
|
|
|
{
|
2017-11-17 00:24:39 -08:00
|
|
|
elm_widget_theme_object_set(sd->obj, sd->pointer.obj,
|
2016-10-28 10:59:31 -07:00
|
|
|
"pointer", "base", "default");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2017-11-17 00:24:39 -08:00
|
|
|
elm_widget_theme_object_set(sd->obj, sd->pointer.obj,
|
2016-10-28 10:59:31 -07:00
|
|
|
"pointer", "base", "default");
|
|
|
|
|
|
|
|
edje_object_size_min_get(sd->pointer.obj, &mw, &mh);
|
|
|
|
edje_object_size_min_restricted_calc(sd->pointer.obj, &mw, &mh, mw, mh);
|
|
|
|
if ((mw < 32) || (mh < 32))
|
|
|
|
{
|
|
|
|
mw = 32;
|
|
|
|
mh = 32;
|
|
|
|
}
|
2018-11-21 07:53:11 -08:00
|
|
|
evas_object_geometry_set(sd->pointer.obj, 0, 0, mw, mh);
|
2018-04-26 05:00:35 -07:00
|
|
|
if (elm_widget_is_legacy(obj))
|
2018-04-26 03:27:43 -07:00
|
|
|
edje_object_part_geometry_get(sd->pointer.obj,
|
|
|
|
"elm.swallow.hotspot",
|
|
|
|
&hx, &hy, NULL, NULL);
|
|
|
|
else
|
|
|
|
edje_object_part_geometry_get(sd->pointer.obj,
|
|
|
|
"efl.hotspot",
|
|
|
|
&hx, &hy, NULL, NULL);
|
|
|
|
|
2016-10-28 10:59:31 -07:00
|
|
|
sd->pointer.hot_x = hx;
|
|
|
|
sd->pointer.hot_y = hy;
|
2017-02-27 07:09:34 -08:00
|
|
|
|
|
|
|
ecore_evas_resize(sd->pointer.ee, mw, mh);
|
2016-10-28 10:59:31 -07:00
|
|
|
}
|
|
|
|
|
2017-01-30 07:58:55 -08:00
|
|
|
if ((sd->wl.win) && (sd->pointer.surf) && (sd->pointer.visible))
|
2017-05-17 13:02:53 -07:00
|
|
|
{
|
|
|
|
/* FIXME: multiseat */
|
|
|
|
Ecore_Wl2_Input *input;
|
2017-06-23 14:43:58 -07:00
|
|
|
Eina_Iterator *it;
|
2017-05-17 13:02:53 -07:00
|
|
|
|
2018-04-04 11:50:43 -07:00
|
|
|
/* FIXME: Here be dragons...
|
|
|
|
pointer_set_cursor is totally unsynchronized, and on a cursor
|
|
|
|
change we get here before the new cursor is rendered. So
|
|
|
|
the cursor frequently moves to its new hotspot with the old
|
|
|
|
cursor image, causing an ugly jump.
|
|
|
|
Forcing manual render causes us to render first then set the
|
|
|
|
cursor, which is still racey but far more likely to win the
|
|
|
|
race.
|
|
|
|
The right way to do this is to create an entirely new surface
|
|
|
|
on every cursor change.
|
|
|
|
*/
|
|
|
|
ecore_evas_manual_render(sd->pointer.ee);
|
2017-06-23 14:43:58 -07:00
|
|
|
it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(sd->wl.win));
|
|
|
|
EINA_ITERATOR_FOREACH(it, input)
|
|
|
|
ecore_wl2_input_pointer_set(input, sd->pointer.surf, sd->pointer.hot_x, sd->pointer.hot_y);
|
|
|
|
eina_iterator_free(it);
|
2017-05-17 13:02:53 -07:00
|
|
|
}
|
2016-10-28 10:59:31 -07:00
|
|
|
}
|
2013-11-15 02:14:08 -08:00
|
|
|
#endif
|
|
|
|
|
2015-10-08 03:01:38 -07:00
|
|
|
Ecore_Cocoa_Window *
|
|
|
|
_elm_ee_cocoa_win_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
const char *engine_name;
|
|
|
|
|
|
|
|
if (!ee) return NULL;
|
|
|
|
|
|
|
|
engine_name = ecore_evas_engine_name_get(ee);
|
|
|
|
if (EINA_UNLIKELY(!engine_name)) return NULL;
|
|
|
|
|
2015-12-09 23:06:22 -08:00
|
|
|
if (!strcmp(engine_name, "opengl_cocoa") ||
|
|
|
|
!strcmp(engine_name, "gl_cocoa"))
|
|
|
|
return ecore_evas_cocoa_window_get(ee);
|
2015-10-15 14:13:42 -07:00
|
|
|
#else
|
|
|
|
(void)ee;
|
|
|
|
#endif
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
Ecore_Win32_Window *
|
|
|
|
_elm_ee_win32win_get(const Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
const char *engine_name;
|
|
|
|
|
|
|
|
if (!ee) return NULL;
|
|
|
|
|
|
|
|
engine_name = ecore_evas_engine_name_get(ee);
|
|
|
|
if (EINA_UNLIKELY(!engine_name)) return NULL;
|
|
|
|
|
2015-12-09 23:06:22 -08:00
|
|
|
if ((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
|
|
|
|
(!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))
|
|
|
|
{
|
|
|
|
return ecore_evas_win32_window_get(ee);
|
|
|
|
}
|
2015-10-08 03:01:38 -07:00
|
|
|
#else
|
|
|
|
(void)ee;
|
|
|
|
#endif
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_cocoawindow_get(Efl_Ui_Win_Data *sd)
|
2015-10-08 03:01:38 -07:00
|
|
|
{
|
|
|
|
sd->cocoa.win = _elm_ee_cocoa_win_get(sd->ee);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-10-15 14:13:42 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_internal_elm_win_win32window_get(Efl_Ui_Win_Data *sd)
|
2015-10-15 14:13:42 -07:00
|
|
|
{
|
|
|
|
sd->win32.win = _elm_ee_win32win_get(sd->ee);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2008-11-18 22:23:08 -08:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_xwin_update(Efl_Ui_Win_Data *sd)
|
2008-11-18 22:23:08 -08:00
|
|
|
{
|
2012-02-29 04:06:12 -08:00
|
|
|
const char *s;
|
2012-03-28 02:02:22 -07:00
|
|
|
|
2015-01-09 21:33:55 -08:00
|
|
|
if (sd->type == ELM_WIN_FAKE) return;
|
2014-03-27 06:15:52 -07:00
|
|
|
_internal_elm_win_xwindow_get(sd);
|
2016-12-08 00:49:23 -08:00
|
|
|
|
|
|
|
if (!sd->x.xwin) return; /* nothing more to do */
|
|
|
|
|
|
|
|
if (sd->stack_master_id)
|
|
|
|
{
|
2016-12-08 22:27:10 -08:00
|
|
|
Ecore_X_Window win = strtol(sd->stack_master_id, NULL, 16);
|
|
|
|
if (win)
|
|
|
|
{
|
|
|
|
ecore_x_icccm_transient_for_set(sd->x.xwin, win);
|
2016-12-18 22:39:36 -08:00
|
|
|
if (sd->stack_base)
|
|
|
|
ecore_x_e_stack_type_set(sd->x.xwin, ECORE_X_STACK_BASE);
|
|
|
|
else
|
|
|
|
ecore_x_e_stack_type_set(sd->x.xwin, ECORE_X_STACK_STANDARD);
|
2016-12-08 22:27:10 -08:00
|
|
|
}
|
2016-12-08 00:49:23 -08:00
|
|
|
}
|
|
|
|
else
|
2008-10-06 18:23:49 -07:00
|
|
|
{
|
2016-12-08 00:49:23 -08:00
|
|
|
if (sd->parent)
|
2011-04-01 04:20:18 -07:00
|
|
|
{
|
2016-12-08 00:49:23 -08:00
|
|
|
ELM_WIN_DATA_GET(sd->parent, sdp);
|
|
|
|
if (sdp) ecore_x_icccm_transient_for_set(sd->x.xwin, sdp->x.xwin);
|
2011-04-01 04:20:18 -07:00
|
|
|
}
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
2009-04-14 19:08:07 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
s = sd->title;
|
2012-02-29 04:06:12 -08:00
|
|
|
if (!s) s = _elm_appname;
|
|
|
|
if (!s) s = "";
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->icon_name) s = sd->icon_name;
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_icccm_icon_name_set(sd->x.xwin, s);
|
|
|
|
ecore_x_netwm_icon_name_set(sd->x.xwin, s);
|
2012-02-29 04:06:12 -08:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
s = sd->role;
|
2012-06-06 01:25:12 -07:00
|
|
|
if (s) ecore_x_icccm_window_role_set(sd->x.xwin, s);
|
2012-03-28 02:02:22 -07:00
|
|
|
|
2012-02-29 04:06:12 -08:00
|
|
|
// set window icon
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->icon)
|
2012-02-29 04:06:12 -08:00
|
|
|
{
|
2017-02-16 03:40:22 -08:00
|
|
|
Eo *image = NULL;
|
2012-02-29 04:06:12 -08:00
|
|
|
|
2017-02-16 03:05:04 -08:00
|
|
|
if (efl_isa(sd->icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
|
2017-02-16 03:40:22 -08:00
|
|
|
image = sd->icon;
|
2017-08-31 02:32:02 -07:00
|
|
|
else if (efl_isa(sd->icon, EFL_UI_IMAGE_CLASS))
|
|
|
|
image = elm_image_object_get(sd->icon);
|
2017-02-16 03:40:22 -08:00
|
|
|
|
|
|
|
if (image)
|
2016-11-27 05:50:03 -08:00
|
|
|
{
|
2017-02-16 03:40:22 -08:00
|
|
|
int w = 0, h = 0, stride, x, y;
|
|
|
|
Eina_Bool unmap = EINA_FALSE;
|
|
|
|
Eina_Rw_Slice sl = {};
|
|
|
|
|
|
|
|
if (efl_isa(image, EFL_CANVAS_IMAGE_CLASS))
|
|
|
|
{
|
2017-09-18 03:30:30 -07:00
|
|
|
Eina_Rect rect = {};
|
|
|
|
|
2017-02-16 03:40:22 -08:00
|
|
|
unmap = EINA_TRUE;
|
2017-09-18 03:30:30 -07:00
|
|
|
rect.size = efl_gfx_buffer_size_get(image);
|
2017-09-18 03:59:11 -07:00
|
|
|
sl = efl_gfx_buffer_map(image, EFL_GFX_BUFFER_ACCESS_MODE_READ,
|
|
|
|
&rect, EFL_GFX_COLORSPACE_ARGB8888, 0,
|
|
|
|
&stride);
|
2017-09-18 03:30:30 -07:00
|
|
|
w = rect.w;
|
|
|
|
h = rect.h;
|
2017-02-16 03:40:22 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_object_image_size_get(image, &w, &h);
|
|
|
|
stride = evas_object_image_stride_get(image);
|
|
|
|
sl.mem = evas_object_image_data_get(image, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sl.mem)
|
2012-02-29 04:06:12 -08:00
|
|
|
{
|
2016-11-27 05:50:03 -08:00
|
|
|
Ecore_X_Icon ic;
|
|
|
|
|
2017-02-16 03:40:22 -08:00
|
|
|
ic.width = w;
|
|
|
|
ic.height = h;
|
2016-11-27 05:50:03 -08:00
|
|
|
if ((w > 0) && (h > 0) &&
|
|
|
|
(stride >= (int)(w * sizeof(unsigned int))))
|
2012-02-29 04:06:12 -08:00
|
|
|
{
|
2017-02-16 03:40:22 -08:00
|
|
|
if (stride == (int)(w * sizeof(unsigned int)))
|
2012-02-29 04:06:12 -08:00
|
|
|
{
|
2017-02-16 03:40:22 -08:00
|
|
|
ic.data = sl.mem;
|
|
|
|
ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ic.data = malloc(w * h * sizeof(unsigned int));
|
|
|
|
if (ic.data)
|
2012-02-29 04:06:12 -08:00
|
|
|
{
|
2017-02-16 03:40:22 -08:00
|
|
|
unsigned char *p = sl.mem;
|
|
|
|
unsigned int *p2 = ic.data;
|
|
|
|
|
|
|
|
for (y = 0; y < h; y++)
|
2016-11-27 05:50:03 -08:00
|
|
|
{
|
2017-02-16 03:40:22 -08:00
|
|
|
for (x = 0; x < w; x++)
|
|
|
|
{
|
|
|
|
*p2 = *((unsigned int *)p);
|
|
|
|
p += sizeof(unsigned int);
|
|
|
|
p2++;
|
|
|
|
}
|
|
|
|
p += (stride - (w * sizeof(unsigned int)));
|
2016-11-27 05:50:03 -08:00
|
|
|
}
|
2017-02-16 03:40:22 -08:00
|
|
|
ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
|
|
|
|
free(ic.data);
|
2012-02-29 04:06:12 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-09-18 03:59:11 -07:00
|
|
|
if (unmap) efl_gfx_buffer_unmap(image, sl);
|
2017-02-16 03:40:22 -08:00
|
|
|
else evas_object_image_data_set(image, sl.mem);
|
2012-02-29 04:06:12 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-03-28 02:02:22 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
switch (sd->type)
|
2008-10-06 18:23:49 -07:00
|
|
|
{
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_BASIC:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_NORMAL);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_DIALOG_BASIC:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DIALOG);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_DESKTOP:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DESKTOP);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_DOCK:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DOCK);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_TOOLBAR:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLBAR);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_MENU:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_MENU);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_UTILITY:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_UTILITY);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
case ELM_WIN_SPLASH:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_SPLASH);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2011-03-22 08:46:52 -07:00
|
|
|
case ELM_WIN_DROPDOWN_MENU:
|
2012-05-03 15:42:15 -07:00
|
|
|
ecore_x_netwm_window_type_set
|
2012-06-06 01:25:12 -07:00
|
|
|
(sd->x.xwin, ECORE_X_WINDOW_TYPE_DROPDOWN_MENU);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2011-03-22 08:46:52 -07:00
|
|
|
case ELM_WIN_POPUP_MENU:
|
2012-05-03 15:42:15 -07:00
|
|
|
ecore_x_netwm_window_type_set
|
2012-06-06 01:25:12 -07:00
|
|
|
(sd->x.xwin, ECORE_X_WINDOW_TYPE_POPUP_MENU);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2011-03-22 08:46:52 -07:00
|
|
|
case ELM_WIN_TOOLTIP:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_TOOLTIP);
|
2014-12-07 16:36:19 -08:00
|
|
|
ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2011-03-22 08:46:52 -07:00
|
|
|
case ELM_WIN_NOTIFICATION:
|
2012-05-03 15:42:15 -07:00
|
|
|
ecore_x_netwm_window_type_set
|
2012-06-06 01:25:12 -07:00
|
|
|
(sd->x.xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2011-03-22 08:46:52 -07:00
|
|
|
case ELM_WIN_COMBO:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_COMBO);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2011-03-22 08:46:52 -07:00
|
|
|
case ELM_WIN_DND:
|
2012-06-06 01:25:12 -07:00
|
|
|
ecore_x_netwm_window_type_set(sd->x.xwin, ECORE_X_WINDOW_TYPE_DND);
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
|
|
|
|
2009-04-14 19:08:07 -07:00
|
|
|
default:
|
2012-05-03 15:42:15 -07:00
|
|
|
break;
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
2009-04-14 19:08:07 -07:00
|
|
|
ecore_x_e_virtual_keyboard_state_set
|
2012-06-06 01:25:12 -07:00
|
|
|
(sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->legacy.indmode == ELM_WIN_INDICATOR_SHOW)
|
2012-02-24 21:14:19 -08:00
|
|
|
ecore_x_e_illume_indicator_state_set
|
2012-06-06 01:25:12 -07:00
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
|
2017-12-11 17:02:23 -08:00
|
|
|
else if (sd->legacy.indmode == ELM_WIN_INDICATOR_HIDE)
|
2012-02-24 21:14:19 -08:00
|
|
|
ecore_x_e_illume_indicator_state_set
|
2012-06-06 01:25:12 -07:00
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
|
2015-08-19 22:11:55 -07:00
|
|
|
|
|
|
|
if ((sd->wm_rot.count) && (sd->wm_rot.rots))
|
|
|
|
ecore_evas_wm_rotation_available_rotations_set(sd->ee,
|
|
|
|
sd->wm_rot.rots,
|
|
|
|
sd->wm_rot.count);
|
|
|
|
if (sd->wm_rot.preferred_rot != -1)
|
|
|
|
ecore_evas_wm_rotation_preferred_rotation_set(sd->ee,
|
|
|
|
sd->wm_rot.preferred_rot);
|
2016-10-27 23:26:59 -07:00
|
|
|
|
2016-11-23 18:28:05 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->csd.need && sd->x.xwin)
|
2016-10-27 23:26:59 -07:00
|
|
|
TRAP(sd, borderless_set, EINA_TRUE);
|
2016-11-23 18:28:05 -08:00
|
|
|
#endif
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
2012-07-17 11:46:18 -07:00
|
|
|
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2008-09-29 23:58:56 -07:00
|
|
|
|
2013-07-02 21:19:56 -07:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*
|
|
|
|
* Resize the window according to window layout's min and weight.
|
|
|
|
* If the window layout's weight is 0.0, the window max is limited to layout's
|
|
|
|
* min size.
|
|
|
|
*
|
|
|
|
* This is called when the window layout's weight hint is changed or when the
|
|
|
|
* window is rotated.
|
|
|
|
*
|
|
|
|
* @param obj window object
|
|
|
|
*/
|
2008-10-06 18:23:49 -07:00
|
|
|
static void
|
2017-07-04 02:18:07 -07:00
|
|
|
_elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize)
|
2008-10-06 18:23:49 -07:00
|
|
|
{
|
2016-11-30 21:41:06 -08:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_get(obj, MY_CLASS);
|
2016-11-29 20:55:54 -08:00
|
|
|
Evas_Coord w, h, minw, minh, maxw, maxh, ow, oh;
|
2016-11-20 22:48:09 -08:00
|
|
|
Eina_Bool unresizable;
|
2008-10-06 18:23:49 -07:00
|
|
|
double wx, wy;
|
|
|
|
|
2017-09-18 00:22:01 -07:00
|
|
|
evas_object_size_hint_combined_min_get(sd->legacy.edje, &minw, &minh);
|
efl_ui_win: make win work for evas_norender
The evas_norender updates the canvas internal objects.
But efl_ui_win does not evaluate its internal objects, when evas_norender is
called before showing, after resizing as below.
evas_object_resize(win, 300, 600);
evas_norender(evas_object_evas_get(win));
evas_object_show(win);
This problem could be verified by checking if a resize function of internal
object is called or not.
minw,h is 0 in _elm_win_resize_objects_eval but deferred_resize_job is TRUE.
evas_norender -> _window_layout_stack -> _elm_win_resize_objects_eval
So if _elm_win_resize_objects_eval does not return if deferred_resize_job is
TRUE even if minw,h is 0, and calls _elm_win_resize_job, then it will work.
_elm_win_resize_objects_eval -> _elm_win_resize_job ->
evas_object_geometry_set -> _efl_canvas_group_group_need_recalculate_set ->
_window_layout_stack -> evas_object_geometry_set -> resize function.
I have checked this behavior without elementary. It seems that evas_norender
works between resize and show in this case. Let me share examples.
ecore_evas_resize(ee, 100, 100);
evas_norender(evas);
ecore_evas_show(ee);
Differential Revision: https://phab.enlightenment.org/D7425
2018-12-18 02:40:33 -08:00
|
|
|
if ((!minw) && (!minh) && (!sd->deferred_resize_job)) return;
|
2011-04-01 04:20:18 -07:00
|
|
|
|
2016-11-30 21:41:06 -08:00
|
|
|
// If content has a weight, make resizable
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_get(sd->legacy.edje, &wx, &wy);
|
2016-11-30 21:41:06 -08:00
|
|
|
|
|
|
|
// Content max hint is ignored
|
2016-11-29 20:55:54 -08:00
|
|
|
maxw = sd->max_w;
|
|
|
|
maxh = sd->max_h;
|
2016-11-30 21:41:06 -08:00
|
|
|
|
|
|
|
// Compatibility hack (for E)
|
|
|
|
if (sd->single_edje_content && !wx && !wy)
|
|
|
|
wx = wy = 1;
|
|
|
|
|
2013-01-17 14:11:21 -08:00
|
|
|
if (!wx) maxw = minw;
|
2016-11-29 20:55:54 -08:00
|
|
|
else if (maxw < 1) maxw = 32767;
|
2013-01-17 14:11:21 -08:00
|
|
|
if (!wy) maxh = minh;
|
2016-11-29 20:55:54 -08:00
|
|
|
else if (maxh < 1) maxh = 32767;
|
|
|
|
if (maxw < minw) maxw = minw;
|
|
|
|
if (maxh < minh) maxh = minh;
|
|
|
|
if (maxw > 32767) maxw = 32767;
|
|
|
|
if (maxh > 32767) maxh = 32767;
|
2013-01-17 14:11:21 -08:00
|
|
|
|
2016-11-20 22:48:09 -08:00
|
|
|
unresizable = ((minw == maxw) && (minh == maxh));
|
|
|
|
if (sd->csd.need_unresizable != unresizable)
|
|
|
|
{
|
|
|
|
sd->csd.need_unresizable = unresizable;
|
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
|
|
|
}
|
|
|
|
|
2016-07-13 06:40:22 -07:00
|
|
|
if (sd->frame_obj)
|
|
|
|
{
|
2016-07-27 09:02:51 -07:00
|
|
|
int fw, fh;
|
2016-07-13 06:40:22 -07:00
|
|
|
|
2016-07-27 09:02:51 -07:00
|
|
|
evas_output_framespace_get(sd->evas, NULL, NULL, &fw, &fh);
|
2016-07-13 06:40:22 -07:00
|
|
|
minw += fw;
|
|
|
|
minh += fh;
|
2016-07-27 08:12:23 -07:00
|
|
|
maxw += fw;
|
|
|
|
maxh += fh;
|
2016-07-13 06:40:22 -07:00
|
|
|
}
|
|
|
|
|
2016-11-29 20:55:54 -08:00
|
|
|
sd->tmp_updating_hints = 1;
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
|
|
|
|
efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(maxw, maxh));
|
2016-11-29 20:55:54 -08:00
|
|
|
sd->tmp_updating_hints = 0;
|
2016-11-30 23:35:58 -08:00
|
|
|
_elm_win_size_hints_update(obj, sd);
|
2016-07-27 08:12:23 -07:00
|
|
|
|
efl_ui_win: make win work for evas_norender
The evas_norender updates the canvas internal objects.
But efl_ui_win does not evaluate its internal objects, when evas_norender is
called before showing, after resizing as below.
evas_object_resize(win, 300, 600);
evas_norender(evas_object_evas_get(win));
evas_object_show(win);
This problem could be verified by checking if a resize function of internal
object is called or not.
minw,h is 0 in _elm_win_resize_objects_eval but deferred_resize_job is TRUE.
evas_norender -> _window_layout_stack -> _elm_win_resize_objects_eval
So if _elm_win_resize_objects_eval does not return if deferred_resize_job is
TRUE even if minw,h is 0, and calls _elm_win_resize_job, then it will work.
_elm_win_resize_objects_eval -> _elm_win_resize_job ->
evas_object_geometry_set -> _efl_canvas_group_group_need_recalculate_set ->
_window_layout_stack -> evas_object_geometry_set -> resize function.
I have checked this behavior without elementary. It seems that evas_norender
works between resize and show in this case. Let me share examples.
ecore_evas_resize(ee, 100, 100);
evas_norender(evas);
ecore_evas_show(ee);
Differential Revision: https://phab.enlightenment.org/D7425
2018-12-18 02:40:33 -08:00
|
|
|
if (sd->deferred_resize_job)
|
|
|
|
_elm_win_resize_job(sd->obj);
|
|
|
|
|
|
|
|
/* do not need to go below. if you go, ee could become 0. */
|
|
|
|
if ((!minw) && (!minh)) return;
|
|
|
|
|
2016-11-29 20:55:54 -08:00
|
|
|
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
|
|
|
w = ow;
|
|
|
|
h = oh;
|
2008-10-06 18:23:49 -07:00
|
|
|
if (w < minw) w = minw;
|
|
|
|
if (h < minh) h = minh;
|
2013-01-17 14:11:21 -08:00
|
|
|
if (w > maxw) w = maxw;
|
|
|
|
if (h > maxh) h = maxh;
|
2017-07-04 02:18:07 -07:00
|
|
|
if (!force_resize && (w == ow) && (h == oh))
|
|
|
|
return;
|
|
|
|
|
2017-05-12 03:19:29 -07:00
|
|
|
sd->req_wh = EINA_FALSE;
|
2016-01-20 01:15:35 -08:00
|
|
|
if (sd->img_obj) evas_object_resize(obj, w, h);
|
2016-03-24 23:11:38 -07:00
|
|
|
else
|
|
|
|
{
|
2016-10-28 00:48:56 -07:00
|
|
|
_elm_win_frame_geometry_adjust(sd);
|
2017-05-12 03:19:29 -07:00
|
|
|
if (!sd->response)
|
|
|
|
{
|
|
|
|
sd->req_wh = EINA_TRUE;
|
|
|
|
sd->req_w = w;
|
|
|
|
sd->req_h = h;
|
|
|
|
TRAP(sd, resize, w, h);
|
|
|
|
}
|
2016-03-24 23:11:38 -07:00
|
|
|
}
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_on_resize_obj_changed_size_hints(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2008-10-06 18:23:49 -07:00
|
|
|
{
|
2017-07-04 02:18:07 -07:00
|
|
|
_elm_win_resize_objects_eval(data, EINA_FALSE);
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_elm_win_shutdown(void)
|
|
|
|
{
|
2014-09-26 02:09:15 -07:00
|
|
|
while (_elm_win_list)
|
|
|
|
{
|
|
|
|
Eina_List *itr = _elm_win_list;
|
|
|
|
evas_object_del(itr->data);
|
|
|
|
if (_elm_win_list == itr)
|
|
|
|
{
|
|
|
|
_elm_win_list = eina_list_remove_list(_elm_win_list, _elm_win_list);
|
|
|
|
}
|
|
|
|
}
|
2015-05-27 20:27:59 -07:00
|
|
|
ELM_SAFE_FREE(_elm_win_state_eval_timer, ecore_timer_del);
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
|
|
|
|
2008-11-14 22:09:04 -08:00
|
|
|
void
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_rescale(Elm_Theme *th,
|
|
|
|
Eina_Bool use_theme)
|
2008-11-14 22:09:04 -08:00
|
|
|
{
|
2009-02-25 11:50:45 -08:00
|
|
|
const Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
2009-11-14 17:51:39 -08:00
|
|
|
|
2010-11-05 01:37:31 -07:00
|
|
|
if (!use_theme)
|
|
|
|
{
|
2012-08-05 21:09:02 -07:00
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
2010-11-05 01:37:31 -07:00
|
|
|
elm_widget_theme(obj);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-08-05 21:09:02 -07:00
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
2010-11-05 01:37:31 -07:00
|
|
|
elm_widget_theme_specific(obj, th, EINA_FALSE);
|
|
|
|
}
|
2008-11-14 22:09:04 -08:00
|
|
|
}
|
|
|
|
|
2012-08-18 06:52:03 -07:00
|
|
|
void
|
|
|
|
_elm_win_access(Eina_Bool is_access)
|
|
|
|
{
|
2013-04-10 01:28:08 -07:00
|
|
|
Evas *evas;
|
2012-08-18 06:52:03 -07:00
|
|
|
const Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
2013-08-05 22:00:50 -07:00
|
|
|
Evas_Object *fobj;
|
2012-08-18 06:52:03 -07:00
|
|
|
|
2012-08-28 03:37:02 -07:00
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
2013-04-10 01:28:08 -07:00
|
|
|
{
|
|
|
|
elm_widget_access(obj, is_access);
|
2013-08-05 22:00:50 -07:00
|
|
|
|
|
|
|
/* floating orphan object. if there are A, B, C objects and user does
|
|
|
|
as below, then there would be floating orphan objects.
|
|
|
|
|
|
|
|
1. elm_object_content_set(layout, A);
|
|
|
|
2. elm_object_content_set(layout, B);
|
|
|
|
3. elm_object_content_set(layout, C);
|
|
|
|
|
|
|
|
now, the object A and B are floating orphan objects */
|
|
|
|
|
|
|
|
fobj = obj;
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
fobj = evas_object_below_get(fobj);
|
|
|
|
if (!fobj) break;
|
|
|
|
|
|
|
|
if (elm_widget_is(fobj) && !elm_widget_parent_get(fobj))
|
|
|
|
{
|
|
|
|
elm_widget_access(fobj, is_access);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-10 01:28:08 -07:00
|
|
|
if (!is_access)
|
|
|
|
{
|
|
|
|
evas = evas_object_evas_get(obj);
|
2013-10-31 07:01:56 -07:00
|
|
|
if (evas) _elm_access_object_highlight_disable(evas);
|
2013-04-10 01:28:08 -07:00
|
|
|
}
|
|
|
|
}
|
2012-08-18 06:52:03 -07:00
|
|
|
}
|
|
|
|
|
2011-10-19 07:17:14 -07:00
|
|
|
void
|
|
|
|
_elm_win_translate(void)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
2012-08-05 21:09:02 -07:00
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
2018-12-21 14:46:10 -08:00
|
|
|
efl_ui_l10n_translation_update(obj);
|
2011-10-19 07:17:14 -07:00
|
|
|
}
|
|
|
|
|
2016-03-18 00:38:26 -07:00
|
|
|
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2010-06-25 02:58:14 -07:00
|
|
|
static Eina_Bool
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_client_message(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
int type EINA_UNUSED,
|
2012-05-03 15:42:15 -07:00
|
|
|
void *event)
|
2010-04-12 01:27:10 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2010-04-12 01:27:10 -07:00
|
|
|
Ecore_X_Event_Client_Message *e = event;
|
|
|
|
|
2010-06-25 02:58:14 -07:00
|
|
|
if (e->format != 32) return ECORE_CALLBACK_PASS_ON;
|
2010-04-12 01:27:10 -07:00
|
|
|
if (e->message_type == ECORE_X_ATOM_E_COMP_FLUSH)
|
|
|
|
{
|
2012-06-06 01:25:12 -07:00
|
|
|
if ((unsigned int)e->data.l[0] == sd->x.xwin)
|
2010-04-12 01:27:10 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas *evas = evas_object_evas_get(sd->obj);
|
2010-04-21 00:46:03 -07:00
|
|
|
if (evas)
|
2010-04-12 01:27:10 -07:00
|
|
|
{
|
|
|
|
edje_file_cache_flush();
|
|
|
|
edje_collection_cache_flush();
|
2010-04-21 00:46:03 -07:00
|
|
|
evas_image_cache_flush(evas);
|
|
|
|
evas_font_cache_flush(evas);
|
2010-04-12 01:27:10 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_COMP_DUMP)
|
|
|
|
{
|
2012-06-06 01:25:12 -07:00
|
|
|
if ((unsigned int)e->data.l[0] == sd->x.xwin)
|
2010-04-12 01:27:10 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas *evas = evas_object_evas_get(sd->obj);
|
2010-04-21 00:46:03 -07:00
|
|
|
if (evas)
|
2010-04-12 01:27:10 -07:00
|
|
|
{
|
|
|
|
edje_file_cache_flush();
|
|
|
|
edje_collection_cache_flush();
|
2010-04-21 00:46:03 -07:00
|
|
|
evas_image_cache_flush(evas);
|
|
|
|
evas_font_cache_flush(evas);
|
|
|
|
evas_render_dump(evas);
|
2010-04-12 01:27:10 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-05-22 05:13:49 -07:00
|
|
|
else if (e->message_type == ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL)
|
|
|
|
{
|
2012-06-06 01:25:12 -07:00
|
|
|
if ((unsigned int)e->data.l[0] == sd->x.xwin)
|
2012-05-22 05:13:49 -07:00
|
|
|
{
|
|
|
|
if ((unsigned int)e->data.l[1] ==
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
|
|
|
|
{
|
|
|
|
// XXX: call right access func
|
|
|
|
}
|
|
|
|
else if ((unsigned int)e->data.l[1] ==
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV)
|
|
|
|
{
|
|
|
|
// XXX: call right access func
|
|
|
|
}
|
2012-07-17 11:46:18 -07:00
|
|
|
else if ((unsigned int)e->data.l[1] ==
|
2012-05-22 05:13:49 -07:00
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
|
|
|
|
{
|
2012-09-16 20:01:46 -07:00
|
|
|
_elm_access_highlight_object_activate
|
2017-10-15 21:33:52 -07:00
|
|
|
(sd->obj, EFL_UI_ACTIVATE_DEFAULT);
|
2012-05-22 05:13:49 -07:00
|
|
|
}
|
|
|
|
else if ((unsigned int)e->data.l[1] ==
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
|
|
|
|
{
|
2012-11-30 03:50:52 -08:00
|
|
|
/* there would be better way to read highlight object */
|
2013-01-17 03:32:14 -08:00
|
|
|
Evas *evas;
|
|
|
|
evas = evas_object_evas_get(sd->obj);
|
|
|
|
if (!evas) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
|
|
|
|
_elm_access_mouse_event_enabled_set(EINA_TRUE);
|
|
|
|
|
|
|
|
evas_event_feed_mouse_in(evas, 0, NULL);
|
|
|
|
evas_event_feed_mouse_move
|
|
|
|
(evas, e->data.l[2], e->data.l[3], 0, NULL);
|
|
|
|
|
|
|
|
_elm_access_mouse_event_enabled_set(EINA_FALSE);
|
2012-05-22 05:13:49 -07:00
|
|
|
}
|
2012-07-17 11:46:18 -07:00
|
|
|
else if ((unsigned int)e->data.l[1] ==
|
2012-05-22 05:13:49 -07:00
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT)
|
|
|
|
{
|
2012-11-30 03:50:52 -08:00
|
|
|
_elm_access_highlight_cycle(sd->obj, ELM_FOCUS_NEXT);
|
2012-05-22 05:13:49 -07:00
|
|
|
}
|
2012-07-17 11:46:18 -07:00
|
|
|
else if ((unsigned int)e->data.l[1] ==
|
2012-05-22 05:13:49 -07:00
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV)
|
|
|
|
{
|
2012-11-30 03:50:52 -08:00
|
|
|
_elm_access_highlight_cycle(sd->obj, ELM_FOCUS_PREVIOUS);
|
2012-05-22 05:13:49 -07:00
|
|
|
}
|
2012-09-03 02:43:35 -07:00
|
|
|
else if ((unsigned int)e->data.l[1] ==
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
|
|
|
|
{
|
2012-09-16 20:01:46 -07:00
|
|
|
_elm_access_highlight_object_activate
|
2017-10-15 21:33:52 -07:00
|
|
|
(sd->obj, EFL_UI_ACTIVATE_UP);
|
2012-09-03 02:43:35 -07:00
|
|
|
}
|
|
|
|
else if ((unsigned int)e->data.l[1] ==
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
|
|
|
|
{
|
2012-09-16 20:01:46 -07:00
|
|
|
_elm_access_highlight_object_activate
|
2017-10-15 21:33:52 -07:00
|
|
|
(sd->obj, EFL_UI_ACTIVATE_DOWN);
|
2012-09-03 02:43:35 -07:00
|
|
|
}
|
2012-05-22 05:13:49 -07:00
|
|
|
}
|
|
|
|
}
|
2010-06-25 02:58:14 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2010-04-12 01:27:10 -07:00
|
|
|
}
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-11-19 08:51:44 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_elm_win_property_change(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
int type EINA_UNUSED,
|
2012-11-19 08:51:44 -08:00
|
|
|
void *event)
|
|
|
|
{
|
2013-05-03 03:23:53 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-11-19 08:51:44 -08:00
|
|
|
Ecore_X_Event_Window_Property *e = event;
|
|
|
|
|
|
|
|
if (e->atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE)
|
|
|
|
{
|
|
|
|
if (e->win == sd->x.xwin)
|
|
|
|
{
|
2017-12-11 17:02:23 -08:00
|
|
|
sd->legacy.indmode = (Elm_Win_Indicator_Mode)ecore_x_e_illume_indicator_state_get(e->win);
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-06-07 07:41:48 -07:00
|
|
|
(sd->obj, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, NULL);
|
2012-11-19 08:51:44 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
#endif
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
|
2017-06-14 23:58:05 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_win_key_down(void *data,
|
|
|
|
int type EINA_UNUSED,
|
|
|
|
void *event)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
|
|
|
Ecore_Event_Key *e = event;
|
|
|
|
if ((e->modifiers & ECORE_EVENT_MODIFIER_ALT) &&
|
|
|
|
(strcmp(e->key, "F4") == 0))
|
|
|
|
_elm_win_delete_request(sd->ee);
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_focus_highlight_hide(void *data EINA_UNUSED,
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_hide(obj);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_anim_end(void *data,
|
|
|
|
Evas_Object *obj,
|
2014-01-06 06:30:02 -08:00
|
|
|
const char *emission EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_simple_setup(sd, obj);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_focus_highlight_init(Efl_Ui_Win_Data *sd)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
|
2013-04-24 04:41:37 -07:00
|
|
|
_elm_win_object_focus_in, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_event_callback_add(sd->evas,
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
|
2013-04-24 04:41:37 -07:00
|
|
|
_elm_win_object_focus_out, sd->obj);
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
|
2014-07-03 19:16:59 -07:00
|
|
|
sd->focus_highlight.cur.target = _elm_win_focus_target_get(evas_focus_get(sd->evas));
|
|
|
|
if (sd->focus_highlight.cur.target)
|
|
|
|
{
|
|
|
|
if (elm_widget_highlight_in_theme_get(sd->focus_highlight.cur.target))
|
|
|
|
sd->focus_highlight.cur.in_theme = EINA_TRUE;
|
|
|
|
else
|
|
|
|
_elm_win_focus_target_callbacks_add(sd);
|
2015-08-04 22:46:01 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->focus_highlight.cur.target,
|
|
|
|
EVAS_CALLBACK_DEL, _elm_win_focus_target_del, sd->obj);
|
2014-07-03 19:16:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
sd->focus_highlight.prev.target = NULL;
|
2013-08-04 01:09:44 -07:00
|
|
|
sd->focus_highlight.theme_changed = EINA_TRUE;
|
2016-03-04 15:37:17 -08:00
|
|
|
if (!sd->focus_highlight.fobj)
|
|
|
|
{
|
|
|
|
sd->focus_highlight.fobj = edje_object_add(sd->evas);
|
2018-04-26 04:24:09 -07:00
|
|
|
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
{
|
|
|
|
edje_object_signal_callback_add(sd->focus_highlight.fobj,
|
|
|
|
"elm,action,focus,hide,end", "*",
|
|
|
|
_elm_win_focus_highlight_hide, NULL);
|
|
|
|
edje_object_signal_callback_add(sd->focus_highlight.fobj,
|
|
|
|
"elm,action,focus,anim,end", "*",
|
|
|
|
_elm_win_focus_highlight_anim_end, sd->obj);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_signal_callback_add(sd->focus_highlight.fobj,
|
|
|
|
"efl,action,focus,hide,end", "*",
|
|
|
|
_elm_win_focus_highlight_hide, NULL);
|
|
|
|
edje_object_signal_callback_add(sd->focus_highlight.fobj,
|
|
|
|
"efl,action,focus,anim,end", "*",
|
|
|
|
_elm_win_focus_highlight_anim_end, sd->obj);
|
|
|
|
}
|
2016-03-04 15:37:17 -08:00
|
|
|
}
|
2013-08-04 01:37:30 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
typedef struct _resize_info {
|
|
|
|
const char *source;
|
|
|
|
const char *cursor;
|
|
|
|
Efl_Ui_Win_Move_Resize_Mode mode;
|
|
|
|
int wl_location;
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
#define XDIR(d) , ECORE_X_NETWM_DIRECTION_##d
|
|
|
|
Ecore_X_Netwm_Direction x_dir;
|
2016-11-24 11:24:19 -08:00
|
|
|
#else
|
|
|
|
# define XDIR(d)
|
2016-11-22 23:38:58 -08:00
|
|
|
#endif
|
|
|
|
} resize_info;
|
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
static const resize_info _resize_infos_legacy[8] = {
|
2016-11-22 23:38:58 -08:00
|
|
|
{ "elm.event.resize.t", ELM_CURSOR_TOP_SIDE, EFL_UI_WIN_MOVE_RESIZE_TOP, 1 XDIR(SIZE_T) },
|
|
|
|
{ "elm.event.resize.b", ELM_CURSOR_BOTTOM_SIDE, EFL_UI_WIN_MOVE_RESIZE_BOTTOM, 2 XDIR(SIZE_B) },
|
|
|
|
{ "elm.event.resize.l", ELM_CURSOR_LEFT_SIDE, EFL_UI_WIN_MOVE_RESIZE_LEFT, 4 XDIR(SIZE_L) },
|
|
|
|
{ "elm.event.resize.r", ELM_CURSOR_RIGHT_SIDE, EFL_UI_WIN_MOVE_RESIZE_RIGHT, 8 XDIR(SIZE_R) },
|
|
|
|
{ "elm.event.resize.tl", ELM_CURSOR_TOP_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT, 5 XDIR(SIZE_TL) },
|
|
|
|
{ "elm.event.resize.bl", ELM_CURSOR_BOTTOM_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT, 6 XDIR(SIZE_BL) },
|
|
|
|
{ "elm.event.resize.br", ELM_CURSOR_BOTTOM_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 10 XDIR(SIZE_BR) },
|
|
|
|
{ "elm.event.resize.tr", ELM_CURSOR_TOP_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 9 XDIR(SIZE_TR) },
|
|
|
|
};
|
2013-08-28 06:24:49 -07:00
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
static const resize_info _resize_infos[8] = {
|
|
|
|
{ "efl.event.resize.t", ELM_CURSOR_TOP_SIDE, EFL_UI_WIN_MOVE_RESIZE_TOP, 1 XDIR(SIZE_T) },
|
|
|
|
{ "efl.event.resize.b", ELM_CURSOR_BOTTOM_SIDE, EFL_UI_WIN_MOVE_RESIZE_BOTTOM, 2 XDIR(SIZE_B) },
|
|
|
|
{ "efl.event.resize.l", ELM_CURSOR_LEFT_SIDE, EFL_UI_WIN_MOVE_RESIZE_LEFT, 4 XDIR(SIZE_L) },
|
|
|
|
{ "efl.event.resize.r", ELM_CURSOR_RIGHT_SIDE, EFL_UI_WIN_MOVE_RESIZE_RIGHT, 8 XDIR(SIZE_R) },
|
|
|
|
{ "efl.event.resize.tl", ELM_CURSOR_TOP_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT, 5 XDIR(SIZE_TL) },
|
|
|
|
{ "efl.event.resize.bl", ELM_CURSOR_BOTTOM_LEFT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT, 6 XDIR(SIZE_BL) },
|
|
|
|
{ "efl.event.resize.br", ELM_CURSOR_BOTTOM_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 10 XDIR(SIZE_BR) },
|
|
|
|
{ "efl.event.resize.tr", ELM_CURSOR_TOP_RIGHT_CORNER, EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT, 9 XDIR(SIZE_TR) },
|
|
|
|
};
|
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
static inline Efl_Ui_Win_Move_Resize_Mode
|
|
|
|
_move_resize_mode_rotate(int rotation, Efl_Ui_Win_Move_Resize_Mode mode)
|
|
|
|
{
|
|
|
|
const Efl_Ui_Win_Move_Resize_Mode edges[4] = {
|
|
|
|
EFL_UI_WIN_MOVE_RESIZE_TOP, EFL_UI_WIN_MOVE_RESIZE_LEFT,
|
|
|
|
EFL_UI_WIN_MOVE_RESIZE_BOTTOM, EFL_UI_WIN_MOVE_RESIZE_RIGHT
|
|
|
|
};
|
2013-08-28 06:24:49 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
const Efl_Ui_Win_Move_Resize_Mode corners[4] = {
|
|
|
|
EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT,
|
|
|
|
EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT,
|
|
|
|
EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT,
|
|
|
|
EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT,
|
|
|
|
};
|
2016-10-30 23:30:18 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
const int i = rotation / 90;
|
|
|
|
int k;
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
for (k = 0; k < 4; k++)
|
|
|
|
if (mode == edges[k])
|
|
|
|
return edges[(k + i) % 4];
|
2016-10-30 23:30:18 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
for (k = 0; k < 4; k++)
|
|
|
|
if (mode == corners[k])
|
|
|
|
return corners[(k + i) % 4];
|
2016-10-30 23:30:18 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
return EFL_UI_WIN_MOVE_RESIZE_MOVE;
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
static const resize_info *
|
2018-04-26 03:27:43 -07:00
|
|
|
_resize_info_get(Evas_Object *obj, int rotation, Efl_Ui_Win_Move_Resize_Mode mode)
|
2013-08-28 06:24:49 -07:00
|
|
|
{
|
2016-11-22 23:38:58 -08:00
|
|
|
if (rotation)
|
2018-04-26 03:27:43 -07:00
|
|
|
return _resize_info_get(obj, 0, _move_resize_mode_rotate(rotation, mode));
|
2013-08-28 06:24:49 -07:00
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(obj))
|
2016-11-22 23:38:58 -08:00
|
|
|
{
|
2018-04-26 03:27:43 -07:00
|
|
|
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos_legacy); k++)
|
|
|
|
{
|
|
|
|
if (_resize_infos_legacy[k].mode == mode)
|
|
|
|
return &_resize_infos_legacy[k];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
|
|
|
|
{
|
|
|
|
if (_resize_infos[k].mode == mode)
|
|
|
|
return &_resize_infos[k];
|
|
|
|
}
|
2016-11-22 23:38:58 -08:00
|
|
|
}
|
2016-10-25 11:19:57 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
return NULL;
|
2013-08-28 06:24:49 -07:00
|
|
|
}
|
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
static Efl_Ui_Win_Move_Resize_Mode
|
2018-04-26 03:27:43 -07:00
|
|
|
_move_resize_mode_get(Evas_Object *obj, const char *source)
|
2013-04-24 16:22:22 -07:00
|
|
|
{
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
{
|
|
|
|
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos_legacy); k++)
|
|
|
|
if (!strcmp(source, _resize_infos_legacy[k].source))
|
|
|
|
return _resize_infos_legacy[k].mode;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
|
|
|
|
if (!strcmp(source, _resize_infos[k].source))
|
|
|
|
return _resize_infos[k].mode;
|
|
|
|
}
|
2013-04-24 16:22:22 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
return EFL_UI_WIN_MOVE_RESIZE_MOVE;
|
|
|
|
}
|
2013-04-24 16:22:22 -07:00
|
|
|
|
2013-10-29 03:42:41 -07:00
|
|
|
static void
|
|
|
|
_elm_win_frame_obj_move(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2013-10-29 03:42:41 -07:00
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd;
|
2013-10-29 03:42:41 -07:00
|
|
|
|
|
|
|
if (!(sd = data)) return;
|
2016-11-17 00:46:14 -08:00
|
|
|
if (!sd->legacy.edje) return;
|
2013-10-29 03:42:41 -07:00
|
|
|
|
2018-04-17 11:55:35 -07:00
|
|
|
_elm_win_frame_obj_update(sd, 0);
|
2013-10-29 03:42:41 -07:00
|
|
|
}
|
|
|
|
|
2013-08-23 00:36:24 -07:00
|
|
|
static void
|
|
|
|
_elm_win_frame_obj_resize(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2013-08-23 00:36:24 -07:00
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data *sd;
|
2013-08-23 00:36:24 -07:00
|
|
|
|
|
|
|
if (!(sd = data)) return;
|
2016-11-17 00:46:14 -08:00
|
|
|
if (!sd->legacy.edje) return;
|
2013-08-23 00:36:24 -07:00
|
|
|
|
2018-04-17 11:55:35 -07:00
|
|
|
_elm_win_frame_obj_update(sd, 0);
|
2013-08-23 00:36:24 -07:00
|
|
|
}
|
|
|
|
|
2012-08-06 05:05:53 -07:00
|
|
|
static void
|
|
|
|
_elm_win_frame_cb_resize_show(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED,
|
2012-08-06 05:05:53 -07:00
|
|
|
const char *source)
|
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-08-06 05:05:53 -07:00
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
if (!sd) return;
|
2012-08-06 05:05:53 -07:00
|
|
|
if (sd->resizing) return;
|
|
|
|
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2016-10-25 11:19:57 -07:00
|
|
|
if (sd->pointer.obj)
|
|
|
|
{
|
2018-04-26 03:27:43 -07:00
|
|
|
Efl_Ui_Win_Move_Resize_Mode mode = _move_resize_mode_get(sd->obj, source);
|
|
|
|
const resize_info *ri = _resize_info_get(sd->obj, sd->rot, mode);
|
2017-11-17 00:24:39 -08:00
|
|
|
if (ri) elm_widget_theme_object_set(sd->obj, sd->pointer.obj, "pointer", "base", ri->cursor);
|
2016-10-25 11:19:57 -07:00
|
|
|
}
|
2012-08-08 01:10:22 -07:00
|
|
|
#else
|
|
|
|
(void)source;
|
2012-08-06 05:05:53 -07:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-08-16 02:40:02 -07:00
|
|
|
static void
|
|
|
|
_elm_win_frame_cb_resize_hide(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2012-08-16 02:40:02 -07:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-08-16 02:40:02 -07:00
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
if (!sd) return;
|
2012-08-16 02:40:02 -07:00
|
|
|
if (sd->resizing) return;
|
|
|
|
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2016-10-25 11:19:57 -07:00
|
|
|
if (sd->pointer.obj)
|
2017-11-17 00:24:39 -08:00
|
|
|
elm_widget_theme_object_set(sd->obj, sd->pointer.obj,
|
2016-10-25 11:19:57 -07:00
|
|
|
"pointer", "base", "default");
|
2012-08-16 02:40:02 -07:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2018-05-08 11:26:35 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
/* This only works when called from an edje event
|
|
|
|
* that propagates seat info...
|
|
|
|
*/
|
|
|
|
static Ecore_Wl2_Input *
|
|
|
|
_elm_win_wayland_input_get(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *di;
|
|
|
|
char *sname;
|
|
|
|
const char *engine;
|
|
|
|
|
|
|
|
engine = ecore_evas_engine_name_get(sd->ee);
|
|
|
|
if (strcmp(engine, ELM_WAYLAND_SHM) &&
|
|
|
|
strcmp(engine, ELM_WAYLAND_EGL))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
di = ecore_wl2_window_display_get(sd->wl.win);
|
|
|
|
|
|
|
|
sname = edje_object_signal_callback_seat_data_get();
|
|
|
|
if (!sname) return NULL;
|
|
|
|
return ecore_wl2_display_input_find_by_name(di, sname);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
static inline Eina_Bool
|
|
|
|
_win_move_start(Efl_Ui_Win_Data *sd)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2016-11-22 23:38:58 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if (sd->wl.win)
|
|
|
|
{
|
2018-05-08 11:26:35 -07:00
|
|
|
Ecore_Wl2_Input *ei;
|
|
|
|
|
|
|
|
ei = _elm_win_wayland_input_get(sd);
|
|
|
|
ecore_wl2_window_move(sd->wl.win, ei);
|
2016-11-22 23:38:58 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
#endif
|
2012-05-02 18:19:05 -07:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
sd->resizing = EINA_TRUE;
|
|
|
|
ecore_x_pointer_ungrab();
|
|
|
|
ecore_x_pointer_root_xy_get(&x, &y);
|
|
|
|
ecore_x_netwm_moveresize_request_send(sd->x.xwin, x, y,
|
|
|
|
ECORE_X_NETWM_DIRECTION_MOVE, 1);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
#endif
|
2012-01-08 03:23:59 -08:00
|
|
|
|
2016-11-22 23:38:58 -08:00
|
|
|
INF("Window move request not supported for this window!");
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_win_move_resize_start(Efl_Ui_Win_Data *sd, Efl_Ui_Win_Move_Resize_Mode mode)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_FALSE);
|
|
|
|
const resize_info *ri;
|
|
|
|
|
|
|
|
// 2. check move_resize already started
|
|
|
|
if (sd->resizing)
|
|
|
|
{
|
|
|
|
ERR("Window is already being resized.");
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mode == EFL_UI_WIN_MOVE_RESIZE_MOVE)
|
|
|
|
return _win_move_start(sd);
|
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
ri = _resize_info_get(sd->obj, sd->rot, mode);
|
2016-11-22 23:38:58 -08:00
|
|
|
if (!ri)
|
2016-10-30 23:30:18 -07:00
|
|
|
{
|
2016-11-22 23:38:58 -08:00
|
|
|
ERR("Unsupported move_resize mode %#x", (int) mode);
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
sd->resizing = EINA_TRUE;
|
|
|
|
|
2016-10-30 23:30:18 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2016-11-22 23:38:58 -08:00
|
|
|
if (sd->wl.win)
|
|
|
|
{
|
2018-05-08 11:26:35 -07:00
|
|
|
Ecore_Wl2_Input *ei;
|
|
|
|
|
|
|
|
ei = _elm_win_wayland_input_get(sd);
|
|
|
|
ecore_wl2_window_resize(sd->wl.win, ei, ri->wl_location);
|
2016-11-22 23:38:58 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2016-10-30 23:30:18 -07:00
|
|
|
#endif
|
2016-11-22 23:38:58 -08:00
|
|
|
|
2016-10-30 23:30:18 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2016-11-22 23:38:58 -08:00
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
ecore_x_pointer_ungrab();
|
|
|
|
ecore_x_pointer_root_xy_get(&x, &y);
|
|
|
|
ecore_x_netwm_moveresize_request_send(sd->x.xwin, x, y, ri->x_dir, 1);
|
|
|
|
return EINA_TRUE;
|
2016-10-30 23:30:18 -07:00
|
|
|
}
|
2016-11-22 23:38:58 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
INF("Window resize request not supported for this window!");
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_frame_cb_move_start(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET_OR_RETURN(data, sd);
|
|
|
|
|
|
|
|
_win_move_resize_start(sd, EFL_UI_WIN_MOVE_RESIZE_MOVE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_frame_cb_resize_start(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED, const char *source)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET_OR_RETURN(data, sd);
|
|
|
|
Efl_Ui_Win_Move_Resize_Mode mode;
|
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
mode = _move_resize_mode_get(sd->obj, source);
|
2016-11-22 23:38:58 -08:00
|
|
|
if (mode == EFL_UI_WIN_MOVE_RESIZE_MOVE) return;
|
|
|
|
|
|
|
|
_win_move_resize_start(sd, mode);
|
2012-01-04 01:30:05 -08:00
|
|
|
}
|
|
|
|
|
2012-03-28 02:02:22 -07:00
|
|
|
static void
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_frame_cb_minimize(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2012-01-04 01:30:05 -08:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-01-04 01:30:05 -08:00
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
if (!sd) return;
|
2019-02-28 02:21:43 -08:00
|
|
|
// sd->minimized = EINA_TRUE;
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, iconified_set, EINA_TRUE);
|
2012-01-03 12:41:49 -08:00
|
|
|
}
|
|
|
|
|
2012-03-28 02:02:22 -07:00
|
|
|
static void
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_frame_cb_maximize(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2012-01-03 12:41:49 -08:00
|
|
|
{
|
2013-10-29 03:39:40 -07:00
|
|
|
Eina_Bool value;
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-01-04 01:30:05 -08:00
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
if (!sd) return;
|
2013-10-29 03:39:40 -07:00
|
|
|
if (sd->maximized) value = EINA_FALSE;
|
|
|
|
else value = EINA_TRUE;
|
|
|
|
|
2016-11-01 23:04:24 -07:00
|
|
|
efl_ui_win_maximized_set(sd->obj, value);
|
2012-01-04 01:30:05 -08:00
|
|
|
}
|
|
|
|
|
2016-07-19 11:14:23 -07:00
|
|
|
static void
|
|
|
|
_elm_win_frame_cb_menu(void *data,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2017-01-04 11:23:52 -08:00
|
|
|
Ecore_Wl2_Input *input;
|
2016-07-19 11:14:23 -07:00
|
|
|
int x, y, wx, wy;
|
|
|
|
|
2017-01-04 11:23:52 -08:00
|
|
|
if (!sd->wl.win) return;
|
2017-10-31 00:36:32 -07:00
|
|
|
evas_pointer_canvas_xy_get(sd->evas, &x, &y);
|
2016-07-19 11:14:23 -07:00
|
|
|
ecore_wl2_window_geometry_get(sd->wl.win, &wx, &wy, NULL, NULL);
|
|
|
|
if (x < 0) x += wx;
|
|
|
|
if (y < 0) y += wy;
|
2017-01-04 11:23:52 -08:00
|
|
|
|
2017-06-23 14:43:58 -07:00
|
|
|
{
|
|
|
|
Eina_Iterator *it;
|
2018-01-17 14:33:57 -08:00
|
|
|
Ecore_Wl2_Display *display = ecore_wl2_window_display_get(sd->wl.win);
|
|
|
|
it = ecore_wl2_display_inputs_get(display);
|
2017-06-23 14:43:58 -07:00
|
|
|
EINA_ITERATOR_FOREACH(it, input) break;
|
|
|
|
eina_iterator_free(it);
|
|
|
|
}
|
2018-01-08 10:42:11 -08:00
|
|
|
if (sd->wl.win->xdg_toplevel)
|
2018-01-18 07:47:01 -08:00
|
|
|
{
|
|
|
|
xdg_toplevel_show_window_menu(sd->wl.win->xdg_toplevel,
|
2018-01-08 10:42:11 -08:00
|
|
|
ecore_wl2_input_seat_get(input), 0, x, y);
|
2018-01-18 07:47:01 -08:00
|
|
|
ecore_wl2_display_flush(input->display);
|
|
|
|
}
|
2018-01-08 10:42:11 -08:00
|
|
|
else if (sd->wl.win->zxdg_toplevel)
|
2018-01-18 07:47:01 -08:00
|
|
|
{
|
|
|
|
zxdg_toplevel_v6_show_window_menu(sd->wl.win->zxdg_toplevel,
|
2017-01-04 11:23:52 -08:00
|
|
|
ecore_wl2_input_seat_get(input), 0, x, y);
|
2018-01-18 07:47:01 -08:00
|
|
|
ecore_wl2_display_flush(input->display);
|
|
|
|
}
|
2016-07-19 11:14:23 -07:00
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
#endif
|
|
|
|
}
|
2012-03-28 02:02:22 -07:00
|
|
|
static void
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_frame_cb_close(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
const char *sig EINA_UNUSED,
|
|
|
|
const char *source EINA_UNUSED)
|
2012-01-04 01:30:05 -08:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-08-06 07:34:25 -07:00
|
|
|
Evas_Object *win;
|
|
|
|
|
|
|
|
/* FIXME: After the current freeze, this should be handled differently.
|
2012-10-10 17:35:00 -07:00
|
|
|
*
|
|
|
|
* Ideally, we would want to mimic the X11 backend and use something
|
|
|
|
* like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
|
|
|
|
* inside of ecore_evas. That would be the 'proper' way, but since we are
|
|
|
|
* in a freeze right now, I cannot add a new event value, or a new
|
2012-08-06 07:34:25 -07:00
|
|
|
* event structure to ecore_wayland.
|
2012-10-10 17:35:00 -07:00
|
|
|
*
|
|
|
|
* So yes, this is a temporary 'stop-gap' solution which will be fixed
|
|
|
|
* when the freeze is over, but it does fix a trac bug for now, and in a
|
2012-08-06 07:34:25 -07:00
|
|
|
* way which does not break API or the freeze. - dh
|
|
|
|
*/
|
2012-01-04 01:30:05 -08:00
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
if (!sd) return;
|
2012-08-06 07:34:25 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
win = sd->obj;
|
2012-08-06 07:34:25 -07:00
|
|
|
|
|
|
|
int autodel = sd->autodel;
|
|
|
|
sd->autodel_clear = &autodel;
|
|
|
|
evas_object_ref(win);
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, NULL);
|
2015-07-01 07:40:57 -07:00
|
|
|
if (sd->autohide)
|
|
|
|
evas_object_hide(win);
|
2012-08-06 07:34:25 -07:00
|
|
|
// FIXME: if above callback deletes - then the below will be invalid
|
|
|
|
if (autodel) evas_object_del(win);
|
|
|
|
else sd->autodel_clear = NULL;
|
|
|
|
evas_object_unref(win);
|
2012-01-04 01:30:05 -08:00
|
|
|
}
|
|
|
|
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2016-03-23 13:58:23 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_elm_win_wl_configure(void *data, int t EINA_UNUSED, void *event)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Event_Window_Configure *ev = event;
|
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2018-07-06 07:16:21 -07:00
|
|
|
if (sd->wl.win != ev->win) return ECORE_CALLBACK_RENEW;
|
2016-03-23 13:58:23 -07:00
|
|
|
|
|
|
|
if (sd->resizing && (!ev->edges)) sd->resizing = EINA_FALSE;
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2015-07-20 14:35:00 -07:00
|
|
|
#endif
|
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
static inline void
|
|
|
|
_elm_object_part_cursor_set(Evas_Object *obj, Evas_Object *edj,
|
|
|
|
const char *part, const char *cursor)
|
2016-12-07 02:27:05 -08:00
|
|
|
{
|
2018-06-25 08:30:11 -07:00
|
|
|
Evas_Object *sub;
|
|
|
|
|
|
|
|
edje_object_freeze(edj);
|
|
|
|
sub = (Evas_Object *)edje_object_part_object_get(edj, part);
|
|
|
|
edje_object_thaw(edj);
|
2018-04-26 03:27:43 -07:00
|
|
|
if (!sub) return;
|
2016-12-07 02:27:05 -08:00
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
elm_object_sub_cursor_set(sub, obj, cursor);
|
2016-12-07 02:27:05 -08:00
|
|
|
}
|
|
|
|
|
2018-05-27 03:48:48 -07:00
|
|
|
static char *
|
|
|
|
_efl_system_theme_path_get(void)
|
|
|
|
{
|
|
|
|
// Find the default theme from EFL install. Quite ugly.
|
|
|
|
const char *sysdir;
|
|
|
|
char *version;
|
|
|
|
char path[PATH_MAX];
|
|
|
|
int v;
|
|
|
|
|
|
|
|
sysdir = elm_theme_system_dir_get();
|
|
|
|
if (!sysdir) return NULL;
|
|
|
|
|
|
|
|
eina_file_path_join(path, PATH_MAX, sysdir, "default.edj");
|
|
|
|
version = edje_file_data_get(path, "version");
|
|
|
|
v = version ? atoi(version) : 0;
|
|
|
|
free(version);
|
|
|
|
if (v < FRAME_OBJ_THEME_MIN_VERSION)
|
|
|
|
{
|
|
|
|
ERR("Default system theme is too old, something is wrong with your installation of EFL.");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return strdup(path);
|
|
|
|
}
|
|
|
|
|
2012-03-28 02:02:22 -07:00
|
|
|
static void
|
2017-01-13 01:04:17 -08:00
|
|
|
_elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
|
2012-02-10 00:37:16 -08:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj = sd->obj;
|
2018-04-16 10:17:42 -07:00
|
|
|
int w, h, v;
|
2016-12-07 02:27:05 -08:00
|
|
|
const char *version;
|
2012-11-20 20:21:24 -08:00
|
|
|
|
2016-04-06 13:44:44 -07:00
|
|
|
if (sd->frame_obj) return;
|
2016-12-07 02:27:05 -08:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->frame_obj = edje_object_add(sd->evas);
|
2016-12-07 02:27:05 -08:00
|
|
|
|
|
|
|
// Verify theme version. Border requires an exact theme API.
|
2018-05-25 10:14:36 -07:00
|
|
|
version = elm_theme_data_get(elm_widget_theme_get(sd->obj), "version");
|
2016-12-07 02:27:05 -08:00
|
|
|
v = version ? atoi(version) : 0;
|
|
|
|
if (EINA_LIKELY(v >= FRAME_OBJ_THEME_MIN_VERSION))
|
2013-05-21 12:32:48 -07:00
|
|
|
{
|
2017-11-17 00:24:39 -08:00
|
|
|
if (!elm_widget_theme_object_set
|
2017-01-13 01:04:17 -08:00
|
|
|
(sd->obj, sd->frame_obj, "border", element, style))
|
2016-12-07 02:27:05 -08:00
|
|
|
{
|
|
|
|
ERR("Failed to set main border theme for the window.");
|
|
|
|
ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Verify border.edc version as well
|
|
|
|
version = edje_object_data_get(sd->frame_obj, "version");
|
|
|
|
v = version ? atoi(version) : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (v < FRAME_OBJ_THEME_MIN_VERSION)
|
|
|
|
{
|
2018-05-27 03:48:48 -07:00
|
|
|
// Theme compatibility
|
|
|
|
const char *key = "elm/border/base/default"; // FIXME?
|
|
|
|
char *sys_theme;
|
|
|
|
|
2016-12-07 02:27:05 -08:00
|
|
|
WRN("Selected theme does not support the required border theme API "
|
|
|
|
"(version = %d, requires >= %d).",
|
|
|
|
v, FRAME_OBJ_THEME_MIN_VERSION);
|
2018-05-27 03:48:48 -07:00
|
|
|
sys_theme = _efl_system_theme_path_get();
|
|
|
|
if (!sys_theme ||
|
|
|
|
!edje_object_file_set(sd->frame_obj, sys_theme, key))
|
2016-12-07 02:27:05 -08:00
|
|
|
{
|
|
|
|
ERR("Failed to set main border theme for the window.");
|
|
|
|
ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
|
2018-05-27 03:48:48 -07:00
|
|
|
free(sys_theme);
|
2016-12-07 02:27:05 -08:00
|
|
|
return;
|
|
|
|
}
|
2018-05-27 03:48:48 -07:00
|
|
|
free(sys_theme);
|
2013-05-21 12:32:48 -07:00
|
|
|
}
|
|
|
|
|
2018-04-16 10:17:42 -07:00
|
|
|
edje_object_freeze(sd->frame_obj);
|
2016-11-16 01:09:37 -08:00
|
|
|
/* Small hack: The special value 2 means this is the top frame object.
|
|
|
|
* We propagate to the children now (the edc group contents), but subsequent
|
|
|
|
* calls to smart_member_add will not propagate the flag further. Note that
|
|
|
|
* this little hack will fall apart if edje creates and destroys objects on
|
|
|
|
* the fly. */
|
|
|
|
efl_canvas_object_is_frame_object_set(sd->frame_obj, 2);
|
2013-08-23 00:36:24 -07:00
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_swallow(sd->frame_obj, "elm.swallow.client", sd->legacy.edje);
|
|
|
|
else
|
|
|
|
edje_object_part_swallow(sd->frame_obj, "efl.client", sd->legacy.edje);
|
2013-09-11 05:41:05 -07:00
|
|
|
|
2016-04-07 11:04:21 -07:00
|
|
|
if (sd->icon)
|
|
|
|
evas_object_show(sd->icon);
|
|
|
|
else
|
2015-06-25 10:33:57 -07:00
|
|
|
{
|
2016-04-07 11:04:21 -07:00
|
|
|
Eina_Bool set = EINA_FALSE;
|
2015-06-25 10:33:57 -07:00
|
|
|
|
|
|
|
sd->icon = elm_icon_add(sd->obj);
|
|
|
|
|
2016-04-07 11:04:21 -07:00
|
|
|
if (sd->icon_name)
|
|
|
|
set = elm_icon_standard_set(sd->icon, sd->icon_name);
|
2017-09-25 20:20:43 -07:00
|
|
|
if (((!sd->icon_name) || (!set)) && _elm_appname)
|
2015-06-25 10:33:57 -07:00
|
|
|
{
|
2016-04-07 11:04:21 -07:00
|
|
|
Efreet_Desktop *d;
|
|
|
|
d = efreet_util_desktop_exec_find(_elm_appname);
|
|
|
|
if (d)
|
|
|
|
{
|
|
|
|
elm_icon_standard_set(sd->icon, d->icon);
|
|
|
|
efreet_desktop_free(d);
|
|
|
|
}
|
2015-06-25 10:33:57 -07:00
|
|
|
}
|
2018-04-03 04:27:30 -07:00
|
|
|
efl_access_object_access_type_set(sd->icon, EFL_ACCESS_TYPE_DISABLED);
|
2015-06-25 10:33:57 -07:00
|
|
|
}
|
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);
|
|
|
|
else
|
|
|
|
edje_object_part_swallow(sd->frame_obj, "efl.icon", sd->icon);
|
|
|
|
|
2016-11-16 01:09:37 -08:00
|
|
|
efl_canvas_object_is_frame_object_set(sd->icon, EINA_TRUE);
|
2015-06-25 10:33:57 -07:00
|
|
|
|
2013-08-23 00:36:24 -07:00
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->frame_obj, EVAS_CALLBACK_MOVE, _elm_win_frame_obj_move, sd);
|
|
|
|
evas_object_event_callback_add
|
|
|
|
(sd->frame_obj, EVAS_CALLBACK_RESIZE, _elm_win_frame_obj_resize, sd);
|
2012-05-15 07:48:30 -07:00
|
|
|
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
{
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,move,start", "elm",
|
|
|
|
_elm_win_frame_cb_move_start, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,resize,show", "*",
|
|
|
|
_elm_win_frame_cb_resize_show, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,resize,hide", "*",
|
|
|
|
_elm_win_frame_cb_resize_hide, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,resize,start", "*",
|
|
|
|
_elm_win_frame_cb_resize_start, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,minimize", "elm",
|
|
|
|
_elm_win_frame_cb_minimize, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,maximize", "elm",
|
|
|
|
_elm_win_frame_cb_maximize, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,close", "elm",
|
|
|
|
_elm_win_frame_cb_close, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "elm,action,menu", "elm",
|
|
|
|
_elm_win_frame_cb_menu, obj);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,move,start", "efl",
|
|
|
|
_elm_win_frame_cb_move_start, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,resize,show", "*",
|
|
|
|
_elm_win_frame_cb_resize_show, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,resize,hide", "*",
|
|
|
|
_elm_win_frame_cb_resize_hide, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,resize,start", "*",
|
|
|
|
_elm_win_frame_cb_resize_start, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,minimize", "efl",
|
|
|
|
_elm_win_frame_cb_minimize, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,maximize", "efl",
|
|
|
|
_elm_win_frame_cb_maximize, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,close", "efl",
|
|
|
|
_elm_win_frame_cb_close, obj);
|
|
|
|
edje_object_signal_callback_add
|
|
|
|
(sd->frame_obj, "efl,action,menu", "efl",
|
|
|
|
_elm_win_frame_cb_menu, obj);
|
|
|
|
}
|
2012-08-15 03:57:31 -07:00
|
|
|
|
2016-10-30 21:42:33 -07:00
|
|
|
if (!sd->pointer.obj)
|
|
|
|
{
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
{
|
|
|
|
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos_legacy); k++)
|
|
|
|
{
|
|
|
|
const resize_info *ri = &_resize_infos_legacy[k];
|
|
|
|
_elm_object_part_cursor_set(obj, sd->frame_obj, ri->source, ri->cursor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2016-11-22 23:38:58 -08:00
|
|
|
{
|
2018-04-26 03:27:43 -07:00
|
|
|
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(_resize_infos); k++)
|
|
|
|
{
|
|
|
|
const resize_info *ri = &_resize_infos[k];
|
|
|
|
_elm_object_part_cursor_set(obj, sd->frame_obj, ri->source, ri->cursor);
|
|
|
|
}
|
2016-11-22 23:38:58 -08:00
|
|
|
}
|
2016-10-30 21:42:33 -07:00
|
|
|
}
|
|
|
|
|
2012-08-15 03:57:31 -07:00
|
|
|
if (sd->title)
|
|
|
|
{
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_text_escaped_set(sd->frame_obj, "elm.text.title", sd->title);
|
|
|
|
else
|
|
|
|
edje_object_part_text_escaped_set(sd->frame_obj, "efl.text.title", sd->title);
|
2012-08-15 03:57:31 -07:00
|
|
|
}
|
2013-05-06 16:08:58 -07:00
|
|
|
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
{
|
|
|
|
// HACK: Force render mode of bg rect to COPY. This avoids render garbage.
|
2018-04-26 03:27:43 -07:00
|
|
|
Eo *bgrect;
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
bgrect = (Eo *) edje_object_part_object_get(sd->frame_obj, "elm.rect.background");
|
|
|
|
else
|
|
|
|
bgrect = (Eo *) edje_object_part_object_get(sd->frame_obj, "efl.rect.background");
|
|
|
|
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
efl_canvas_object_render_op_set(bgrect, EFL_GFX_RENDER_OP_COPY);
|
|
|
|
}
|
|
|
|
|
2018-04-16 10:17:42 -07:00
|
|
|
if (sd->first_draw)
|
|
|
|
edje_object_thaw(sd->frame_obj);
|
|
|
|
if (!efl_finalized_get(obj)) return;
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_frame_style_update(sd, 1, 1);
|
2016-10-28 00:48:56 -07:00
|
|
|
_elm_win_frame_geometry_adjust(sd);
|
2013-05-06 16:08:58 -07:00
|
|
|
ecore_evas_geometry_get(sd->ee, NULL, NULL, &w, &h);
|
2017-07-21 13:17:55 -07:00
|
|
|
if ((w > 1) && (h > 1))
|
|
|
|
ecore_evas_resize(sd->ee, w, h);
|
2012-08-15 03:57:31 -07:00
|
|
|
}
|
|
|
|
|
2012-10-10 17:35:00 -07:00
|
|
|
static void
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool calc)
|
2012-08-15 03:57:31 -07:00
|
|
|
{
|
2016-11-28 00:24:18 -08:00
|
|
|
Eina_Bool borderless, maximized, shadow, focus, bg_solid, menu, unresizable,
|
2017-12-11 17:02:23 -08:00
|
|
|
alpha, bg_standard, indicator;
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
Eina_Bool changed = EINA_FALSE;
|
2012-08-15 03:57:31 -07:00
|
|
|
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
if (!sd->frame_obj)
|
|
|
|
{
|
2017-07-06 23:34:02 -07:00
|
|
|
if (!efl_finalized_get(sd->obj)) return;
|
2017-08-23 11:24:11 -07:00
|
|
|
if (EINA_LIKELY(sd->type == ELM_WIN_FAKE))
|
2018-02-12 13:09:14 -08:00
|
|
|
return;
|
2018-11-29 11:09:09 -08:00
|
|
|
if (!_elm_config->win_no_border)
|
|
|
|
CRI("Window has no frame object!");
|
2016-11-24 00:45:14 -08:00
|
|
|
return;
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
}
|
2016-11-21 21:23:46 -08:00
|
|
|
|
|
|
|
if ((sd->type == ELM_WIN_INLINED_IMAGE) ||
|
2017-08-11 15:43:15 -07:00
|
|
|
(sd->type == ELM_WIN_SOCKET_IMAGE) ||
|
|
|
|
(sd->type == ELM_WIN_TOOLTIP) ||
|
|
|
|
(sd->type == ELM_WIN_COMBO) ||
|
|
|
|
(sd->type == ELM_WIN_MENU) ||
|
|
|
|
(sd->type == ELM_WIN_POPUP_MENU))
|
2016-11-21 21:23:46 -08:00
|
|
|
{
|
|
|
|
sd->csd.need_shadow = EINA_FALSE;
|
|
|
|
sd->csd.need_borderless = EINA_TRUE;
|
|
|
|
sd->csd.need_unresizable = EINA_TRUE;
|
2016-11-28 00:24:18 -08:00
|
|
|
sd->csd.need_menu = EINA_FALSE;
|
2017-12-11 17:02:23 -08:00
|
|
|
sd->csd.need_indicator = EINA_FALSE;
|
2016-11-21 21:23:46 -08:00
|
|
|
}
|
2018-11-29 11:09:09 -08:00
|
|
|
else if (_elm_config->win_no_border)
|
|
|
|
sd->csd.need_borderless = EINA_TRUE;
|
2016-11-24 18:28:16 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
sd->csd.need_shadow = sd->csd.need && (!sd->maximized);
|
|
|
|
}
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
|
2016-11-24 00:45:14 -08:00
|
|
|
alpha = sd->application_alpha || sd->theme_alpha;
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
borderless = sd->csd.need_borderless || (!sd->csd.need) || sd->fullscreen;
|
|
|
|
maximized = sd->maximized;
|
2017-08-07 10:26:41 -07:00
|
|
|
shadow = sd->csd.need_shadow && (!sd->fullscreen) && (!sd->maximized) && (!borderless);
|
2016-11-24 00:45:14 -08:00
|
|
|
if (alpha && borderless) shadow = 0;
|
2017-05-17 13:02:53 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if (sd->wl.win)
|
|
|
|
focus = ecore_wl2_window_activated_get(sd->wl.win);
|
|
|
|
else
|
|
|
|
#endif
|
2017-05-23 13:45:06 -07:00
|
|
|
focus = ecore_evas_focus_get(sd->ee);
|
2016-11-29 22:06:09 -08:00
|
|
|
bg_standard = sd->csd.need_bg_standard;
|
2016-11-20 22:48:09 -08:00
|
|
|
unresizable = sd->csd.need_unresizable;
|
2016-11-28 00:24:18 -08:00
|
|
|
menu = sd->csd.need_menu;
|
2017-12-11 17:02:23 -08:00
|
|
|
indicator = sd->csd.need_indicator;
|
2018-12-04 17:35:30 -08:00
|
|
|
bg_solid = sd->csd.need_bg_solid;
|
|
|
|
/* Set background transparent if window supports alpha.
|
|
|
|
* If alpha window does not emit signal to show background rectangle, then
|
|
|
|
* the background color set by _efl_ui_win_part_color_set cannot be applied
|
|
|
|
* because the background rectangle remains hidden.
|
|
|
|
*/
|
|
|
|
if (alpha && bg_solid && !(sd->csd.cur_bg_solid))
|
|
|
|
edje_object_color_class_set(sd->frame_obj, "elm/win/background", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
|
2016-11-23 18:28:05 -08:00
|
|
|
/* FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
|
|
|
|
* At the moment, E Wayland uses SSD for its internal windows. Which means
|
|
|
|
* we must hide the shadow if the borderless flag is set. "trap" here means
|
|
|
|
* we are likely to be running inside E compositor.
|
|
|
|
* FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME */
|
|
|
|
if (trap && sd->csd.wayland && sd->csd.need_borderless)
|
|
|
|
shadow = 0;
|
|
|
|
|
2018-04-26 04:24:09 -07:00
|
|
|
#define STATE_SET(state, s1, s2, s3) do { \
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
if (force_emit || (state != sd->csd.cur_##state)) \
|
|
|
|
{ \
|
|
|
|
const char *sig = state ? s1 : s2; \
|
2018-04-26 04:24:09 -07:00
|
|
|
edje_object_signal_emit(sd->frame_obj, sig, s3); \
|
2016-11-23 03:21:57 -08:00
|
|
|
DBG("frame style emit: %p %s", sd->obj, sig); \
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
sd->csd.cur_##state = state; \
|
|
|
|
changed = EINA_TRUE; \
|
|
|
|
} } while (0)
|
|
|
|
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
{
|
|
|
|
STATE_SET(borderless, "elm,state,borderless,on", "elm,state,borderless,off", "elm");
|
|
|
|
STATE_SET(shadow, "elm,state,shadow,on", "elm,state,shadow,off", "elm");
|
|
|
|
STATE_SET(maximized, "elm,state,maximized", "elm,state,unmaximized", "elm");
|
|
|
|
STATE_SET(focus, "elm,action,focus", "elm,action,unfocus", "elm");
|
|
|
|
STATE_SET(bg_solid, "elm,state,background,solid,on", "elm,state,background,solid,off", "elm");
|
|
|
|
STATE_SET(bg_standard, "elm,state,background,standard,on", "elm,state,background,standard,off", "elm");
|
|
|
|
STATE_SET(unresizable, "elm,state,unresizable,on", "elm,state,unresizable,off", "elm");
|
|
|
|
STATE_SET(menu, "elm,action,show_menu", "elm,action,hide_menu", "elm");
|
|
|
|
STATE_SET(indicator, "elm,action,show_indicator", "elm,action,hide_indicator", "elm");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
STATE_SET(borderless, "efl,state,borderless,on", "efl,state,borderless,off", "efl");
|
|
|
|
STATE_SET(shadow, "efl,state,shadow,on", "efl,state,shadow,off", "efl");
|
|
|
|
STATE_SET(maximized, "efl,state,maximized", "efl,state,unmaximized", "efl");
|
|
|
|
STATE_SET(focus, "efl,action,focus", "efl,action,unfocus", "efl");
|
|
|
|
STATE_SET(bg_solid, "efl,state,background,solid,on", "efl,state,background,solid,off", "efl");
|
|
|
|
STATE_SET(bg_standard, "efl,state,background,standard,on", "efl,state,background,standard,off", "efl");
|
|
|
|
STATE_SET(unresizable, "efl,state,unresizable,on", "efl,state,unresizable,off", "efl");
|
|
|
|
STATE_SET(menu, "efl,action,show_menu", "efl,action,hide_menu", "efl");
|
|
|
|
STATE_SET(indicator, "efl,action,show_indicator", "efl,action,hide_indicator", "efl");
|
|
|
|
}
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
|
|
|
|
#undef STATE_SET
|
|
|
|
|
|
|
|
if (changed)
|
|
|
|
{
|
|
|
|
if (calc || force_emit)
|
|
|
|
edje_object_message_signal_process(sd->frame_obj);
|
|
|
|
if (calc)
|
|
|
|
evas_object_smart_calculate(sd->frame_obj);
|
2018-04-17 11:55:35 -07:00
|
|
|
_elm_win_frame_obj_update(sd, 0);
|
2012-08-15 03:57:31 -07:00
|
|
|
}
|
2012-02-10 00:37:16 -08:00
|
|
|
}
|
|
|
|
|
2010-10-20 05:38:30 -07:00
|
|
|
#ifdef ELM_DEBUG
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_debug_key_down(void *data EINA_UNUSED,
|
|
|
|
Evas *e EINA_UNUSED,
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas_Object *obj,
|
|
|
|
void *event_info)
|
2010-10-20 05:38:30 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Key_Down *ev = event_info;
|
|
|
|
|
|
|
|
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
2011-04-01 04:20:18 -07:00
|
|
|
return;
|
2010-10-20 05:38:30 -07:00
|
|
|
|
2013-07-30 23:14:09 -07:00
|
|
|
if ((strcmp(ev->key, "F12")) ||
|
2010-10-20 05:38:30 -07:00
|
|
|
(!evas_key_modifier_is_set(ev->modifiers, "Control")))
|
|
|
|
return;
|
|
|
|
|
2013-06-06 21:46:47 -07:00
|
|
|
INF("Tree graph generated.");
|
2010-10-20 05:38:30 -07:00
|
|
|
elm_object_tree_dot_dump(obj, "./dump.dot");
|
|
|
|
}
|
2016-10-25 07:50:43 -07:00
|
|
|
|
2010-10-20 05:38:30 -07:00
|
|
|
#endif
|
|
|
|
|
2011-12-04 20:26:32 -08:00
|
|
|
static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_win_inlined_image_set(Efl_Ui_Win_Data *sd)
|
2011-12-04 20:26:32 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);
|
|
|
|
evas_object_image_filled_set(sd->img_obj, EINA_TRUE);
|
2012-05-02 09:58:56 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(sd->img_obj, EVAS_CALLBACK_HIDE, _win_img_hide, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(sd->img_obj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(sd->img_obj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, sd->obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(sd->img_obj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, sd->obj);
|
2011-12-04 20:26:32 -08:00
|
|
|
}
|
|
|
|
|
2012-02-29 04:06:12 -08:00
|
|
|
static void
|
2017-08-31 02:32:02 -07:00
|
|
|
_elm_win_on_icon_del(void *data, const Efl_Event *ev)
|
2012-02-29 04:06:12 -08:00
|
|
|
{
|
2013-04-24 04:41:37 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-08-31 02:32:02 -07:00
|
|
|
if (sd->icon == ev->object) sd->icon = NULL;
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_efl_ui_win_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_add(efl_super(obj, MY_CLASS));
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-11-14 03:38:49 -08:00
|
|
|
elm_widget_theme_klass_set(obj, "win");
|
2012-05-03 15:42:15 -07:00
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
|
|
|
|
|
|
|
elm_widget_highlight_ignore_set(obj, EINA_TRUE);
|
2012-05-02 09:58:56 -07:00
|
|
|
}
|
|
|
|
|
2012-08-05 21:09:02 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_x_io_err(void *data EINA_UNUSED)
|
2012-08-05 21:09:02 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Evas_Object *obj;
|
2012-08-06 03:30:55 -07:00
|
|
|
|
2012-08-05 21:09:02 -07:00
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, obj)
|
2018-01-17 21:06:45 -08:00
|
|
|
evas_object_smart_callback_call(obj, "ioerr", NULL);
|
2012-08-05 21:09:02 -07:00
|
|
|
elm_exit();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-01-10 03:53:39 -08:00
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_cb_hide(void *data EINA_UNUSED,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2013-01-10 03:53:39 -08:00
|
|
|
{
|
|
|
|
_elm_win_state_eval_queue();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-06 06:30:02 -08:00
|
|
|
_elm_win_cb_show(void *data EINA_UNUSED,
|
|
|
|
Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2013-01-10 03:53:39 -08:00
|
|
|
{
|
|
|
|
_elm_win_state_eval_queue();
|
|
|
|
}
|
|
|
|
|
2017-02-13 00:11:56 -08:00
|
|
|
static inline const char *
|
|
|
|
_efl_ui_win_accel(Efl_Ui_Win_Data *sd)
|
2014-03-28 00:28:31 -07:00
|
|
|
{
|
2017-02-13 00:11:56 -08:00
|
|
|
const char *str = sd->accel_pref;
|
|
|
|
const char *env;
|
2014-09-24 08:32:24 -07:00
|
|
|
|
2016-06-22 19:06:22 -07:00
|
|
|
/* current elm config */
|
2017-02-13 00:11:56 -08:00
|
|
|
if (!str)
|
|
|
|
{
|
|
|
|
if (_elm_config->accel) str = _elm_config->accel;
|
|
|
|
if (_elm_accel_preference) str = _elm_accel_preference;
|
|
|
|
}
|
2016-06-22 19:06:22 -07:00
|
|
|
|
|
|
|
/* global overrides */
|
2014-09-24 08:32:24 -07:00
|
|
|
if ((_elm_config->accel_override) && (_elm_config->accel))
|
|
|
|
str = _elm_config->accel;
|
2017-02-13 00:11:56 -08:00
|
|
|
|
|
|
|
/* env var wins */
|
2014-09-24 08:32:24 -07:00
|
|
|
env = getenv("ELM_ACCEL");
|
|
|
|
if (env) str = env;
|
2017-02-13 00:11:56 -08:00
|
|
|
|
|
|
|
return str;
|
2014-03-28 00:28:31 -07:00
|
|
|
}
|
|
|
|
|
2016-10-26 18:32:45 -07:00
|
|
|
static inline void
|
|
|
|
_elm_win_need_frame_adjust(Efl_Ui_Win_Data *sd, const char *engine)
|
|
|
|
{
|
|
|
|
const char *s;
|
|
|
|
|
|
|
|
/* this is for debug only - don't keep forever, it's not an api! */
|
|
|
|
s = getenv("EFL_WIN_FRAME_MODE");
|
2016-11-23 03:21:57 -08:00
|
|
|
sd->csd.wayland = (eina_streq(engine, ELM_WAYLAND_SHM) ||
|
|
|
|
eina_streq(engine, ELM_WAYLAND_EGL));
|
|
|
|
|
2016-11-21 21:23:46 -08:00
|
|
|
if (sd->type == ELM_WIN_FAKE)
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
sd->csd.need = EINA_FALSE;
|
2016-10-26 18:32:45 -07:00
|
|
|
else if (eina_streq(s, "on"))
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
sd->csd.need = EINA_TRUE;
|
2016-10-26 18:32:45 -07:00
|
|
|
else if (eina_streq(s, "off"))
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
sd->csd.need = EINA_FALSE;
|
2016-10-26 18:32:45 -07:00
|
|
|
else
|
2016-11-23 03:21:57 -08:00
|
|
|
sd->csd.need = sd->csd.wayland;
|
2016-10-26 18:32:45 -07:00
|
|
|
}
|
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
static void
|
|
|
|
_indicator_resized(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET_OR_RETURN(data, sd);
|
|
|
|
Evas_Object *indicator = event->object;
|
|
|
|
Evas_Coord_Size *size = (Evas_Coord_Size *)event->info;
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_restricted_min_set(indicator, EINA_SIZE2D(size->w, size->h));
|
2018-04-17 11:55:35 -07:00
|
|
|
_elm_win_frame_obj_update(sd, 0);
|
2017-12-11 17:02:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object*
|
|
|
|
_create_indicator(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
Evas_Object *indicator = NULL;
|
|
|
|
const char *indicator_serv_name;
|
|
|
|
|
|
|
|
indicator_serv_name = "elm_indicator_portrait";
|
|
|
|
|
|
|
|
indicator = elm_plug_add(obj);
|
|
|
|
if (!indicator)
|
|
|
|
{
|
|
|
|
ERR("Conformant cannot create plug to server[%s]", indicator_serv_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!elm_plug_connect(indicator, indicator_serv_name, 0, EINA_FALSE))
|
|
|
|
{
|
|
|
|
ERR("Conformant cannot connect to server[%s]", indicator_serv_name);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return indicator;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_indicator_add(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
Eo *obj = sd->obj;
|
|
|
|
|
|
|
|
sd->indicator = _create_indicator(obj);
|
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
if (!sd->indicator)
|
2017-12-11 17:02:23 -08:00
|
|
|
return;
|
|
|
|
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
{
|
|
|
|
if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.indicator", sd->indicator))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!edje_object_part_swallow(sd->frame_obj, "efl.indicator", sd->indicator))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
efl_event_callback_add
|
|
|
|
(sd->indicator, ELM_PLUG_EVENT_IMAGE_RESIZED, _indicator_resized, obj);
|
|
|
|
|
|
|
|
efl_canvas_object_is_frame_object_set(sd->indicator, EINA_TRUE);
|
|
|
|
sd->csd.need_indicator = EINA_TRUE;
|
|
|
|
|
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_indicator_del(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
Eo *obj = sd->obj;
|
|
|
|
|
|
|
|
efl_event_callback_del
|
|
|
|
(sd->indicator, ELM_PLUG_EVENT_IMAGE_RESIZED, _indicator_resized, obj);
|
|
|
|
|
|
|
|
efl_del(sd->indicator);
|
|
|
|
sd->indicator = NULL;
|
|
|
|
|
|
|
|
sd->csd.need_indicator = EINA_FALSE;
|
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
|
|
|
}
|
|
|
|
|
2017-12-19 03:37:25 -08:00
|
|
|
static Eina_Value
|
|
|
|
_win_finalize_job_cb(void *data, const Eina_Value value)
|
|
|
|
{
|
2018-03-12 12:21:15 -07:00
|
|
|
Efl_Ui_Win_Data *sd = data;
|
|
|
|
sd->finalize_future = NULL;
|
|
|
|
if (!efl_invalidated_get(sd->obj))
|
|
|
|
evas_render_pending_objects_flush(sd->evas);
|
2017-12-19 03:37:25 -08:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2019-01-04 00:03:52 -08:00
|
|
|
static void
|
|
|
|
_gesture_manager_config_load(Eo *obj)
|
|
|
|
{
|
|
|
|
Eina_Value val;
|
|
|
|
Efl_Canvas_Gesture_Manager *gm = efl_provider_find(obj, EFL_CANVAS_GESTURE_MANAGER_CLASS);
|
|
|
|
|
|
|
|
eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE);
|
|
|
|
eina_value_set(&val, _elm_config->glayer_long_tap_start_timeout);
|
|
|
|
efl_gesture_manager_config_set(gm, "glayer_long_tap_start_timeout", &val);
|
|
|
|
|
|
|
|
eina_value_set(&val, _elm_config->glayer_double_tap_timeout);
|
|
|
|
efl_gesture_manager_config_set(gm, "glayer_double_tap_timeout", &val);
|
|
|
|
|
|
|
|
eina_value_setup(&val, EINA_VALUE_TYPE_INT);
|
|
|
|
eina_value_set(&val, _elm_config->glayer_tap_finger_size);
|
|
|
|
efl_gesture_manager_config_set(gm, "glayer_tap_finger_size", &val);
|
|
|
|
}
|
|
|
|
|
2015-05-20 08:31:04 -07:00
|
|
|
static Eo *
|
2017-11-16 02:00:48 -08:00
|
|
|
_elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_Ui_Win_Type type)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-04-03 09:23:03 -07:00
|
|
|
Evas_Object *parent = NULL;
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas *e;
|
2009-02-25 11:50:45 -08:00
|
|
|
const Eina_List *l;
|
2014-03-08 07:49:33 -08:00
|
|
|
const char *fontpath, *engine = NULL, *enginelist[32], *disp;
|
2016-06-22 19:06:22 -07:00
|
|
|
int gl_depth = _elm_config->gl_depth;
|
|
|
|
int gl_stencil = _elm_config->gl_stencil;
|
|
|
|
int gl_msaa = _elm_config->gl_msaa;
|
|
|
|
Eina_Stringshare *accel = NULL;
|
2017-02-13 00:11:56 -08:00
|
|
|
Eina_Bool is_gl_accel;
|
2014-08-26 04:11:02 -07:00
|
|
|
int i, p = 0;
|
2018-08-08 06:37:29 -07:00
|
|
|
Ecore_Window parent_id = 0;
|
2009-07-06 23:46:51 -07:00
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
Efl_Ui_Win_Data tmp_sd;
|
2010-11-01 14:10:07 -07:00
|
|
|
|
2017-08-17 07:48:06 -07:00
|
|
|
if ((sd->type == ELM_WIN_INLINED_IMAGE) &&
|
|
|
|
!efl_isa(obj, EFL_UI_WIN_INLINED_CLASS))
|
|
|
|
{
|
|
|
|
ERR("Failed to create an inlined window!");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
parent = efl_parent_get(obj);
|
2018-04-02 00:46:14 -07:00
|
|
|
if (!(efl_isa(parent, EFL_UI_WIN_CLASS) ||
|
|
|
|
efl_isa(parent, EFL_UI_WIN_LEGACY_CLASS) ||
|
|
|
|
efl_isa(parent, EFL_UI_WIN_INLINED_CLASS))) parent = NULL;
|
2013-09-24 21:33:39 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
/* just to store some data while trying out to create a canvas */
|
2016-06-07 07:41:48 -07:00
|
|
|
memset(&tmp_sd, 0, sizeof(Efl_Ui_Win_Data));
|
2011-04-14 03:48:43 -07:00
|
|
|
|
2017-02-13 00:11:56 -08:00
|
|
|
is_gl_accel = _elm_config_accel_preference_parse
|
|
|
|
(_efl_ui_win_accel(sd), &accel, &gl_depth, &gl_stencil, &gl_msaa);
|
2016-06-22 19:06:22 -07:00
|
|
|
|
2017-08-17 07:48:06 -07:00
|
|
|
switch ((int) type)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2015-01-09 21:33:55 -08:00
|
|
|
case ELM_WIN_FAKE:
|
2015-01-12 02:13:34 -08:00
|
|
|
tmp_sd.ee = sd->ee;
|
2015-01-09 21:33:55 -08:00
|
|
|
break;
|
2011-04-14 03:48:43 -07:00
|
|
|
case ELM_WIN_INLINED_IMAGE:
|
2011-07-23 10:27:39 -07:00
|
|
|
if (!parent) break;
|
2013-11-15 00:47:54 -08:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-02-27 07:44:36 -08:00
|
|
|
e = evas_object_evas_get(parent);
|
2013-11-15 00:47:54 -08:00
|
|
|
if (!e) break;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2013-11-15 00:47:54 -08:00
|
|
|
ee = ecore_evas_ecore_evas_get(e);
|
|
|
|
if (!ee) break;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2013-11-15 00:47:54 -08:00
|
|
|
tmp_sd.img_obj = ecore_evas_object_image_new(ee);
|
|
|
|
if (!tmp_sd.img_obj) break;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2013-11-15 00:47:54 -08:00
|
|
|
tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
|
|
|
|
if (!tmp_sd.ee)
|
|
|
|
{
|
2014-01-21 17:38:55 -08:00
|
|
|
ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
|
2013-11-15 00:47:54 -08:00
|
|
|
}
|
|
|
|
}
|
2011-04-14 03:48:43 -07:00
|
|
|
break;
|
2012-01-16 09:18:20 -08:00
|
|
|
|
|
|
|
case ELM_WIN_SOCKET_IMAGE:
|
2012-05-03 15:42:15 -07:00
|
|
|
tmp_sd.ee = ecore_evas_extn_socket_new(1, 1);
|
2012-01-16 09:18:20 -08:00
|
|
|
break;
|
|
|
|
|
2011-04-14 03:48:43 -07:00
|
|
|
default:
|
2014-03-08 07:49:33 -08:00
|
|
|
disp = getenv("ELM_DISPLAY");
|
2014-08-26 04:11:02 -07:00
|
|
|
if ((disp) && (!strcmp(disp, "ews")))
|
|
|
|
{
|
|
|
|
enginelist[p++] = ELM_EWS;
|
|
|
|
}
|
|
|
|
else if ((disp) && (!strcmp(disp, "buffer")))
|
|
|
|
{
|
|
|
|
enginelist[p++] = ELM_BUFFER;
|
|
|
|
}
|
|
|
|
else if ((disp) && (!strcmp(disp, "shot")))
|
|
|
|
{
|
|
|
|
enginelist[p++] = ENGINE_GET();
|
|
|
|
}
|
|
|
|
// welcome to ifdef hell! :)
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
else if ((disp) && (!strcmp(disp, "x11")))
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2017-02-13 00:11:56 -08:00
|
|
|
if (is_gl_accel)
|
2014-03-08 08:22:33 -08:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_OPENGL_X11;
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_X11;
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_SOFTWARE_X11;
|
|
|
|
enginelist[p++] = ELM_OPENGL_X11;
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
|
|
|
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-03-08 07:49:33 -08:00
|
|
|
else if ((disp) && (!strcmp(disp, "wl")))
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2017-02-13 00:11:56 -08:00
|
|
|
if (is_gl_accel)
|
2014-03-08 08:22:33 -08:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_EGL;
|
|
|
|
enginelist[p++] = ELM_WAYLAND_SHM;
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_SHM;
|
|
|
|
enginelist[p++] = ELM_WAYLAND_EGL;
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
2014-03-08 07:49:33 -08:00
|
|
|
else if ((disp) && (!strcmp(disp, "win")))
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_SOFTWARE_WIN32;
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_DDRAW;
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_SDL
|
2014-03-08 07:49:33 -08:00
|
|
|
else if ((disp) && (!strcmp(disp, "sdl")))
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2017-02-23 09:39:02 -08:00
|
|
|
if (is_gl_accel)
|
2014-03-08 08:22:33 -08:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_OPENGL_SDL;
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_SDL;
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_SOFTWARE_SDL;
|
|
|
|
enginelist[p++] = ELM_OPENGL_SDL;
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
2014-03-08 07:49:33 -08:00
|
|
|
else if ((disp) && (!strcmp(disp, "mac")))
|
2011-11-05 10:50:09 -07:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_OPENGL_COCOA;
|
2011-04-14 03:48:43 -07:00
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
|
|
|
|
2015-08-03 05:39:54 -07:00
|
|
|
#if defined(HAVE_ELEMENTARY_DRM) || defined(HAVE_ELEMENTARY_FB)
|
2014-03-08 07:49:33 -08:00
|
|
|
else if ((disp) && (!strcmp(disp, "fb")))
|
2011-04-14 03:48:43 -07:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_DRM
|
2019-01-08 06:41:30 -08:00
|
|
|
if (is_gl_accel)
|
|
|
|
{
|
|
|
|
enginelist[p++] = ELM_GL_DRM;
|
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_DRM;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_FB
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_FB;
|
|
|
|
#endif
|
2011-11-02 12:26:29 -07:00
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2015-02-10 02:48:21 -08:00
|
|
|
else if (!_elm_preferred_engine &&
|
2014-12-12 04:56:26 -08:00
|
|
|
getenv("DISPLAY") && !getenv("ELM_ENGINE"))
|
2014-08-05 08:04:11 -07:00
|
|
|
{
|
2017-02-13 00:11:56 -08:00
|
|
|
if (is_gl_accel)
|
2014-08-05 08:04:11 -07:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_OPENGL_X11;
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_X11;
|
2014-08-05 08:04:11 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_SOFTWARE_X11;
|
|
|
|
enginelist[p++] = ELM_OPENGL_X11;
|
2014-08-05 08:04:11 -07:00
|
|
|
}
|
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2015-02-10 02:48:21 -08:00
|
|
|
else if (!_elm_preferred_engine &&
|
2014-12-12 04:56:26 -08:00
|
|
|
getenv("WAYLAND_DISPLAY") && !getenv("ELM_ENGINE"))
|
2014-08-05 08:04:11 -07:00
|
|
|
{
|
2017-02-13 00:11:56 -08:00
|
|
|
if (is_gl_accel)
|
2014-08-05 08:04:11 -07:00
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_EGL;
|
|
|
|
enginelist[p++] = ELM_WAYLAND_SHM;
|
2014-08-05 08:04:11 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_SHM;
|
|
|
|
enginelist[p++] = ELM_WAYLAND_EGL;
|
2014-08-05 08:04:11 -07:00
|
|
|
}
|
|
|
|
}
|
2014-08-26 04:11:02 -07:00
|
|
|
#endif
|
2014-03-08 07:49:33 -08:00
|
|
|
else
|
2012-01-12 01:10:27 -08:00
|
|
|
{
|
2017-02-13 00:11:56 -08:00
|
|
|
if (is_gl_accel)
|
2014-03-08 08:22:33 -08:00
|
|
|
{
|
2015-02-10 02:48:21 -08:00
|
|
|
// add all engines with selected engine first - if any
|
2016-02-04 23:15:29 -08:00
|
|
|
if (ENGINE_GET())
|
|
|
|
enginelist[p++] = ENGINE_GET();
|
2014-08-26 04:11:02 -07:00
|
|
|
|
|
|
|
// add all engines with gl/accelerated ones first - only engines compiled
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
enginelist[p++] = ELM_OPENGL_X11;
|
|
|
|
#endif
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_EGL;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_DRM
|
2019-01-08 06:41:30 -08:00
|
|
|
enginelist[p++] = ELM_GL_DRM;
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_DRM;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_FB
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_FB;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
enginelist[p++] = ELM_OPENGL_COCOA;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_SDL
|
|
|
|
enginelist[p++] = ELM_OPENGL_SDL;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_X11;
|
|
|
|
#endif
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_SHM;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_WIN32;
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_DDRAW;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_SDL
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_SDL;
|
|
|
|
#endif
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-08-26 04:11:02 -07:00
|
|
|
// add all engines with selected engine first - if any
|
2015-08-06 23:10:02 -07:00
|
|
|
if (elm_config_preferred_engine_get())
|
|
|
|
enginelist[p++] = elm_config_preferred_engine_get();
|
|
|
|
// add check _elm_gl_preference whether "none" or not
|
2016-02-04 23:15:29 -08:00
|
|
|
else if (_elm_config->engine &&
|
2016-06-22 19:06:22 -07:00
|
|
|
((elm_config_accel_preference_get() &&
|
|
|
|
!strcmp(elm_config_accel_preference_get(), "none"))
|
|
|
|
|| (accel && !strcmp(accel, "none"))))
|
2015-08-06 23:30:49 -07:00
|
|
|
enginelist[p++] = _elm_config->engine;
|
2014-08-26 04:11:02 -07:00
|
|
|
// add all engines with gl/accelerated ones first - only engines compiled
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_X11;
|
|
|
|
#endif
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_SHM;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_DRM
|
|
|
|
enginelist[p++] = ELM_DRM;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_FB
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_FB;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
enginelist[p++] = ELM_OPENGL_COCOA;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_WIN32;
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_DDRAW;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_SDL
|
|
|
|
enginelist[p++] = ELM_SOFTWARE_SDL;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
enginelist[p++] = ELM_OPENGL_X11;
|
|
|
|
#endif
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_WAYLAND_EGL;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_DRM
|
2019-01-08 06:41:30 -08:00
|
|
|
enginelist[p++] = ELM_GL_DRM;
|
2014-08-26 04:11:02 -07:00
|
|
|
enginelist[p++] = ELM_DRM;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_SDL
|
|
|
|
enginelist[p++] = ELM_OPENGL_SDL;
|
|
|
|
#endif
|
2014-03-08 08:22:33 -08:00
|
|
|
}
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
2017-08-11 15:43:15 -07:00
|
|
|
if (parent) parent_id = elm_win_window_id_get(parent);
|
2016-07-08 05:28:18 -07:00
|
|
|
for (i = 0; i < p; i++)
|
2012-05-02 18:19:05 -07:00
|
|
|
{
|
2014-03-08 07:49:33 -08:00
|
|
|
if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
|
2017-07-21 13:17:55 -07:00
|
|
|
tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 0, 0);
|
2014-03-08 07:49:33 -08:00
|
|
|
else if (!strcmp(enginelist[i], ELM_OPENGL_X11))
|
|
|
|
{
|
2015-03-15 22:14:12 -07:00
|
|
|
int opt[20], opt_i = 0;
|
2014-03-08 07:49:33 -08:00
|
|
|
|
|
|
|
if (_elm_config->vsync)
|
|
|
|
{
|
|
|
|
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_VSYNC;
|
|
|
|
opt[opt_i++] = 1;
|
|
|
|
}
|
2016-06-22 19:06:22 -07:00
|
|
|
if (gl_depth)
|
2015-03-15 22:14:12 -07:00
|
|
|
{
|
|
|
|
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_DEPTH;
|
2016-06-22 19:06:22 -07:00
|
|
|
opt[opt_i++] = gl_depth;
|
2015-03-15 22:14:12 -07:00
|
|
|
}
|
2016-06-22 19:06:22 -07:00
|
|
|
if (gl_stencil)
|
2015-03-15 22:14:12 -07:00
|
|
|
{
|
|
|
|
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_STENCIL;
|
2016-06-22 19:06:22 -07:00
|
|
|
opt[opt_i++] = gl_stencil;
|
2015-03-15 22:14:12 -07:00
|
|
|
}
|
2016-06-22 19:06:22 -07:00
|
|
|
if (gl_msaa)
|
2015-03-15 22:14:12 -07:00
|
|
|
{
|
|
|
|
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_MSAA;
|
2016-06-22 19:06:22 -07:00
|
|
|
opt[opt_i++] = gl_msaa;
|
2015-03-15 22:14:12 -07:00
|
|
|
}
|
|
|
|
opt[opt_i] = 0;
|
2014-03-08 07:49:33 -08:00
|
|
|
if (opt_i > 0)
|
2017-07-21 13:17:55 -07:00
|
|
|
tmp_sd.ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 0, 0, opt);
|
2014-03-08 07:49:33 -08:00
|
|
|
else
|
2017-07-21 13:17:55 -07:00
|
|
|
tmp_sd.ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 0, 0);
|
2014-03-08 07:49:33 -08:00
|
|
|
}
|
|
|
|
else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
|
2018-08-08 06:37:29 -07:00
|
|
|
tmp_sd.ee = _wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0);
|
2014-03-08 07:49:33 -08:00
|
|
|
else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
|
2018-08-08 06:37:29 -07:00
|
|
|
tmp_sd.ee = _wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0);
|
2014-03-08 07:49:33 -08:00
|
|
|
else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
|
|
|
|
tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
|
2014-08-26 04:11:02 -07:00
|
|
|
else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW))
|
|
|
|
tmp_sd.ee = ecore_evas_software_ddraw_new(NULL, 0, 0, 1, 1);
|
2014-03-08 07:49:33 -08:00
|
|
|
else if (!strcmp(enginelist[i], ELM_SOFTWARE_SDL))
|
|
|
|
tmp_sd.ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
|
|
|
|
else if (!strcmp(enginelist[i], ELM_OPENGL_SDL))
|
|
|
|
tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
|
|
|
|
else if (!strcmp(enginelist[i], ELM_OPENGL_COCOA))
|
|
|
|
tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
|
|
|
|
else if (!strcmp(enginelist[i], ELM_EWS))
|
|
|
|
tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
|
|
|
|
else if (!strcmp(enginelist[i], ELM_SOFTWARE_FB))
|
|
|
|
tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
|
|
|
|
else if (!strcmp(enginelist[i], ELM_BUFFER))
|
|
|
|
tmp_sd.ee = ecore_evas_buffer_new(1, 1);
|
2014-03-28 03:42:27 -07:00
|
|
|
else if (!strcmp(enginelist[i], ELM_DRM))
|
|
|
|
tmp_sd.ee = ecore_evas_drm_new(NULL, 0, 0, 0, 1, 1);
|
2019-01-08 06:41:30 -08:00
|
|
|
else if (!strcmp(enginelist[i], ELM_GL_DRM))
|
|
|
|
tmp_sd.ee = ecore_evas_gl_drm_new(NULL, 0, 0, 0, 1, 1);
|
2014-03-08 07:49:33 -08:00
|
|
|
else if (!strncmp(enginelist[i], "shot:", 5))
|
|
|
|
{
|
|
|
|
tmp_sd.ee = ecore_evas_buffer_new(1, 1);
|
|
|
|
ecore_evas_manual_render_set(tmp_sd.ee, EINA_TRUE);
|
|
|
|
tmp_sd.shot.info = eina_stringshare_add(ENGINE_GET() + 5);
|
|
|
|
}
|
|
|
|
engine = enginelist[i];
|
|
|
|
if (tmp_sd.ee) break;
|
2012-05-02 18:19:05 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2012-05-02 09:58:56 -07:00
|
|
|
|
2016-06-22 19:06:22 -07:00
|
|
|
eina_stringshare_del(accel);
|
2012-05-03 15:42:15 -07:00
|
|
|
if (!tmp_sd.ee)
|
|
|
|
{
|
|
|
|
ERR("Cannot create window.");
|
2015-05-20 08:31:04 -07:00
|
|
|
return NULL;
|
2012-05-03 15:42:15 -07:00
|
|
|
}
|
2012-07-17 11:46:18 -07:00
|
|
|
|
2016-06-22 19:06:22 -07:00
|
|
|
if (!sd->accel_pref)
|
|
|
|
eina_stringshare_replace(&sd->accel_pref, elm_config_accel_preference_get());
|
|
|
|
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_parent_set(obj, ecore_evas_get(tmp_sd.ee));
|
2014-09-25 09:39:32 -07:00
|
|
|
|
2016-10-26 18:32:45 -07:00
|
|
|
/* FIXME: Major hack: calling the constructor in the middle of finalize. */
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_constructor(efl_super(obj, MY_CLASS));
|
2016-06-16 22:12:02 -07:00
|
|
|
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2013-03-20 01:37:40 -07:00
|
|
|
if (getenv("ELM_FIRST_FRAME"))
|
|
|
|
evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST,
|
2013-10-13 22:40:35 -07:00
|
|
|
_elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));
|
2013-03-20 01:37:40 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
/* copying possibly altered fields back */
|
|
|
|
#define SD_CPY(_field) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
sd->_field = tmp_sd._field; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
SD_CPY(ee);
|
|
|
|
SD_CPY(img_obj);
|
|
|
|
SD_CPY(shot.info);
|
|
|
|
#undef SD_CPY
|
|
|
|
|
2015-01-09 21:33:55 -08:00
|
|
|
if ((type != ELM_WIN_FAKE) && (trap) && (trap->add))
|
2012-07-18 21:35:50 -07:00
|
|
|
sd->trap_data = trap->add(obj);
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
/* complementary actions, which depend on final smart data
|
|
|
|
* pointer */
|
|
|
|
if (type == ELM_WIN_INLINED_IMAGE)
|
|
|
|
_win_inlined_image_set(sd);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2014-03-09 05:17:28 -07:00
|
|
|
else if ((engine) &&
|
|
|
|
((!strcmp(engine, ELM_SOFTWARE_X11)) ||
|
|
|
|
(!strcmp(engine, ELM_OPENGL_X11))))
|
2012-11-19 08:51:44 -08:00
|
|
|
{
|
|
|
|
sd->x.client_message_handler = ecore_event_handler_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, obj);
|
2012-11-19 08:51:44 -08:00
|
|
|
sd->x.property_handler = ecore_event_handler_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(ECORE_X_EVENT_WINDOW_PROPERTY, _elm_win_property_change, obj);
|
2012-11-19 08:51:44 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
#endif
|
2014-03-09 05:17:28 -07:00
|
|
|
else if ((engine) && (!strncmp(engine, "shot:", 5)))
|
2012-05-03 15:42:15 -07:00
|
|
|
_shot_init(sd);
|
|
|
|
|
|
|
|
sd->kbdmode = ELM_WIN_KEYBOARD_UNKNOWN;
|
2017-12-11 17:02:23 -08:00
|
|
|
sd->legacy.indmode = ELM_WIN_INDICATOR_UNKNOWN;
|
|
|
|
sd->indimode = EFL_UI_WIN_INDICATOR_OFF;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2014-03-27 06:15:52 -07:00
|
|
|
_internal_elm_win_xwindow_get(sd);
|
2017-01-12 01:01:15 -08:00
|
|
|
if (sd->x.xwin) ecore_x_io_error_handler_set(_elm_x_io_err, NULL);
|
2010-09-24 09:41:25 -07:00
|
|
|
#endif
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2015-10-01 07:25:23 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
2014-08-10 15:59:45 -07:00
|
|
|
_elm_win_wlwindow_get(sd);
|
2017-08-23 11:24:11 -07:00
|
|
|
if (sd->wl.win)
|
2017-04-07 13:06:41 -07:00
|
|
|
{
|
|
|
|
Ecore_Wl2_Window_Type wtype;
|
|
|
|
sd->wl.configure_handler =
|
|
|
|
ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE, _elm_win_wl_configure, obj);
|
|
|
|
switch (sd->type)
|
|
|
|
{
|
|
|
|
case ELM_WIN_BASIC:
|
|
|
|
case ELM_WIN_DIALOG_BASIC:
|
2017-08-04 13:08:42 -07:00
|
|
|
case ELM_WIN_NAVIFRAME_BASIC:
|
2017-04-07 13:06:41 -07:00
|
|
|
case ELM_WIN_SPLASH:
|
|
|
|
case ELM_WIN_TOOLBAR:
|
|
|
|
case ELM_WIN_UTILITY:
|
|
|
|
case ELM_WIN_DOCK:
|
|
|
|
case ELM_WIN_DESKTOP:
|
|
|
|
wtype = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
|
|
|
|
break;
|
|
|
|
case ELM_WIN_TOOLTIP:
|
|
|
|
case ELM_WIN_COMBO:
|
|
|
|
case ELM_WIN_MENU:
|
|
|
|
case ELM_WIN_POPUP_MENU:
|
|
|
|
wtype = ECORE_WL2_WINDOW_TYPE_MENU;
|
|
|
|
break;
|
|
|
|
case ELM_WIN_DND:
|
|
|
|
wtype = ECORE_WL2_WINDOW_TYPE_DND;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
wtype = ECORE_WL2_WINDOW_TYPE_NONE;
|
|
|
|
}
|
|
|
|
ecore_wl2_window_type_set(sd->wl.win, wtype);
|
|
|
|
}
|
2017-07-07 13:26:50 -07:00
|
|
|
else if (sd->type == ELM_WIN_FAKE)
|
|
|
|
{
|
|
|
|
const char *env = getenv("WAYLAND_DISPLAY");
|
|
|
|
if (env)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Display *d = ecore_wl2_display_connect(env);
|
|
|
|
sd->wl.win = ecore_wl2_window_new(d, NULL, 0, 0, 1, 1);
|
|
|
|
ecore_wl2_display_disconnect(d);
|
|
|
|
}
|
|
|
|
}
|
2012-06-06 06:55:15 -07:00
|
|
|
#endif
|
|
|
|
|
2015-10-08 03:01:38 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
_elm_win_cocoawindow_get(sd);
|
|
|
|
#endif
|
2015-10-15 14:13:42 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
2017-06-14 23:58:05 -07:00
|
|
|
sd->win32.key_down_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
|
|
|
|
_elm_win_key_down, obj);
|
2015-10-15 14:13:42 -07:00
|
|
|
_internal_elm_win_win32window_get(sd);
|
|
|
|
#endif
|
2015-10-08 03:01:38 -07:00
|
|
|
|
2012-11-30 03:00:01 -08:00
|
|
|
if ((_elm_config->bgpixmap)
|
2012-11-30 02:26:18 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2018-04-02 00:46:14 -07:00
|
|
|
&& (((sd->x.xwin) && (!ecore_x_screen_is_composited(0))) ||
|
|
|
|
(!sd->x.xwin))
|
2012-11-30 03:00:01 -08:00
|
|
|
#endif
|
2018-04-02 00:46:14 -07:00
|
|
|
)
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
|
2011-04-01 04:20:18 -07:00
|
|
|
// bg pixmap done by x - has other issues like can be redrawn by x before it
|
|
|
|
// is filled/ready by app
|
2012-07-18 21:35:50 -07:00
|
|
|
// TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
sd->type = type;
|
|
|
|
sd->parent = parent;
|
2014-04-09 03:04:55 -07:00
|
|
|
sd->modal_count = 0;
|
2015-05-19 05:32:10 -07:00
|
|
|
sd->withdrawn = ecore_evas_withdrawn_get(sd->ee);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
if (sd->parent)
|
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(sd->parent, EVAS_CALLBACK_DEL, _elm_win_on_parent_del, obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
sd->evas = ecore_evas_get(sd->ee);
|
|
|
|
|
|
|
|
evas_object_color_set(obj, 0, 0, 0, 0);
|
|
|
|
evas_object_pass_events_set(obj, EINA_TRUE);
|
|
|
|
|
2011-08-02 03:34:30 -07:00
|
|
|
if (type == ELM_WIN_INLINED_IMAGE)
|
2017-08-17 07:48:06 -07:00
|
|
|
efl_ui_win_inlined_parent_set(obj, parent);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
/* use own version of ecore_evas_object_associate() that does TRAP() */
|
2013-04-24 04:41:37 -07:00
|
|
|
ecore_evas_data_set(sd->ee, "elm_win", obj);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2015-01-09 21:33:55 -08:00
|
|
|
if (type != ELM_WIN_FAKE)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
2016-11-30 23:35:58 -08:00
|
|
|
_elm_win_obj_callback_changed_size_hints, NULL);
|
2015-01-09 21:33:55 -08:00
|
|
|
evas_object_intercept_raise_callback_add
|
|
|
|
(obj, _elm_win_obj_intercept_raise, obj);
|
|
|
|
evas_object_intercept_lower_callback_add
|
|
|
|
(obj, _elm_win_obj_intercept_lower, obj);
|
|
|
|
evas_object_intercept_stack_above_callback_add
|
|
|
|
(obj, _elm_win_obj_intercept_stack_above, obj);
|
|
|
|
evas_object_intercept_stack_below_callback_add
|
|
|
|
(obj, _elm_win_obj_intercept_stack_below, obj);
|
|
|
|
evas_object_intercept_layer_set_callback_add
|
|
|
|
(obj, _elm_win_obj_intercept_layer_set, obj);
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, name_class_set, name, _elm_appname);
|
2015-04-17 15:10:11 -07:00
|
|
|
TRAP(sd, title_set, sd->title);
|
2012-05-03 15:42:15 -07:00
|
|
|
ecore_evas_callback_delete_request_set(sd->ee, _elm_win_delete_request);
|
|
|
|
ecore_evas_callback_state_change_set(sd->ee, _elm_win_state_change);
|
2015-01-09 22:36:27 -08:00
|
|
|
ecore_evas_callback_focus_in_set(sd->ee, _elm_win_focus_in);
|
|
|
|
ecore_evas_callback_focus_out_set(sd->ee, _elm_win_focus_out);
|
2015-09-07 10:05:08 -07:00
|
|
|
ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
|
|
|
|
ecore_evas_callback_move_set(sd->ee, _elm_win_move);
|
2015-12-10 12:53:31 -08:00
|
|
|
ecore_evas_callback_pre_render_set(sd->ee, _elm_win_pre_render);
|
2015-01-09 21:33:55 -08:00
|
|
|
if (type != ELM_WIN_FAKE)
|
2016-10-28 06:06:48 -07:00
|
|
|
{
|
|
|
|
ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
|
|
|
|
ecore_evas_callback_mouse_out_set(sd->ee, _elm_win_mouse_out);
|
|
|
|
}
|
|
|
|
|
2013-04-24 04:41:37 -07:00
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _elm_win_cb_hide, NULL);
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _elm_win_cb_show, NULL);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
|
|
|
evas_image_cache_set(sd->evas, (_elm_config->image_cache * 1024));
|
|
|
|
evas_font_cache_set(sd->evas, (_elm_config->font_cache * 1024));
|
|
|
|
|
2012-08-05 21:09:02 -07:00
|
|
|
EINA_LIST_FOREACH(_elm_config->font_dirs, l, fontpath)
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_font_path_append(sd->evas, fontpath);
|
|
|
|
|
2010-10-22 14:41:27 -07:00
|
|
|
if (!_elm_config->font_hinting)
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_NONE);
|
2009-02-03 02:27:52 -08:00
|
|
|
else if (_elm_config->font_hinting == 1)
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_AUTO);
|
2009-02-03 02:27:52 -08:00
|
|
|
else if (_elm_config->font_hinting == 2)
|
2012-05-03 15:42:15 -07:00
|
|
|
evas_font_hinting_set(sd->evas, EVAS_FONT_HINTING_BYTECODE);
|
2008-09-29 23:58:56 -07:00
|
|
|
|
2015-08-25 04:41:18 -07:00
|
|
|
sd->wm_rot.wm_supported = ecore_evas_wm_rotation_supported_get(sd->ee);
|
|
|
|
sd->wm_rot.preferred_rot = -1; // it means that elm_win doesn't use preferred rotation.
|
|
|
|
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2010-09-24 09:41:25 -07:00
|
|
|
|
2018-02-23 11:17:54 -08:00
|
|
|
if (type != ELM_WIN_FAKE)
|
2015-11-05 03:37:11 -08:00
|
|
|
{
|
2018-02-23 11:17:54 -08:00
|
|
|
//Prohibiting auto-rendering, until elm_win is shown.
|
2018-04-17 12:01:39 -07:00
|
|
|
if (_elm_win_auto_norender_withdrawn(obj))
|
2015-11-05 03:37:11 -08:00
|
|
|
{
|
2018-02-23 11:17:54 -08:00
|
|
|
if (elm_win_withdrawn_get(obj))
|
2015-11-05 03:37:11 -08:00
|
|
|
{
|
2018-02-23 11:17:54 -08:00
|
|
|
if (!evas_object_data_get(obj, "__win_auto_norender"))
|
|
|
|
{
|
|
|
|
elm_win_norender_push(obj);
|
|
|
|
evas_object_data_set(obj, "__win_auto_norender", obj);
|
|
|
|
}
|
2015-11-05 03:37:11 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-20 05:38:30 -07:00
|
|
|
#ifdef ELM_DEBUG
|
2012-05-03 15:42:15 -07:00
|
|
|
Evas_Modifier_Mask mask = evas_key_modifier_mask_get(sd->evas, "Control");
|
|
|
|
evas_object_event_callback_add
|
2013-04-24 04:41:37 -07:00
|
|
|
(obj, EVAS_CALLBACK_KEY_DOWN, _debug_key_down, NULL);
|
2011-04-14 04:43:43 -07:00
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (evas_object_key_grab(obj, "F12", mask, 0, EINA_TRUE))
|
|
|
|
INF("Ctrl+F12 key combination exclusive for dot tree generation\n");
|
|
|
|
else
|
|
|
|
ERR("failed to grab F12 key to elm widgets (dot) tree generation");
|
2010-10-20 05:38:30 -07:00
|
|
|
#endif
|
2011-04-21 17:42:32 -07:00
|
|
|
|
2015-09-07 10:05:08 -07:00
|
|
|
if (type != ELM_WIN_FAKE)
|
2012-07-05 02:23:38 -07:00
|
|
|
{
|
2015-09-07 10:05:08 -07:00
|
|
|
if ((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_ON) ||
|
|
|
|
((_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_AUTO) &&
|
2016-10-25 07:50:43 -07:00
|
|
|
((engine) &&
|
2019-01-08 06:41:30 -08:00
|
|
|
((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))
|
|
|
|
|| (!strcmp(engine, ELM_GL_DRM))))))
|
2015-09-07 10:05:08 -07:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
|
|
|
|
|
|
|
|
sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
|
2017-11-17 00:24:39 -08:00
|
|
|
elm_widget_theme_object_set(obj, o, "pointer", "base", "default");
|
2015-09-07 10:05:08 -07:00
|
|
|
edje_object_size_min_calc(o, &mw, &mh);
|
|
|
|
evas_object_resize(o, mw, mh);
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
edje_object_part_geometry_get(o, "elm.swallow.hotspot",
|
|
|
|
&hx, &hy, NULL, NULL);
|
|
|
|
else
|
|
|
|
edje_object_part_geometry_get(o, "efl.hotspot",
|
|
|
|
&hx, &hy, NULL, NULL);
|
|
|
|
|
2015-09-07 10:05:08 -07:00
|
|
|
sd->pointer.hot_x = hx;
|
|
|
|
sd->pointer.hot_y = hy;
|
2016-10-25 07:50:43 -07:00
|
|
|
evas_object_show(o);
|
|
|
|
ecore_evas_object_cursor_set(tmp_sd.ee, o, EVAS_LAYER_MAX, hx, hy);
|
2015-09-07 10:05:08 -07:00
|
|
|
}
|
|
|
|
else if (_elm_config->softcursor_mode == ELM_SOFTCURSOR_MODE_OFF)
|
|
|
|
{
|
|
|
|
// do nothing
|
|
|
|
}
|
2012-07-05 02:23:38 -07:00
|
|
|
}
|
2013-01-17 14:11:15 -08:00
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
_elm_win_legacy_init(sd);
|
2016-10-27 00:55:16 -07:00
|
|
|
_elm_win_need_frame_adjust(sd, engine);
|
|
|
|
_elm_win_apply_alpha(obj, sd);
|
|
|
|
|
2017-07-21 13:17:55 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if ((type != ELM_WIN_FAKE) && (type != ELM_WIN_INLINED_IMAGE))
|
|
|
|
{
|
|
|
|
if ((engine) &&
|
|
|
|
((!strcmp(engine, ELM_WAYLAND_SHM) ||
|
|
|
|
(!strcmp(engine, ELM_WAYLAND_EGL)))))
|
|
|
|
{
|
|
|
|
Evas *pevas;
|
|
|
|
|
|
|
|
if (!strcmp(engine, ELM_WAYLAND_SHM))
|
|
|
|
sd->pointer.ee = ecore_evas_wayland_shm_new(NULL, 0, 0, 0, 0, 0, 0);
|
|
|
|
else if (!strcmp(engine, ELM_WAYLAND_EGL))
|
|
|
|
sd->pointer.ee = ecore_evas_wayland_egl_new(NULL, 0, 0, 0, 0, 0, 0);
|
2018-02-12 12:47:40 -08:00
|
|
|
ecore_evas_alpha_set(sd->pointer.ee, EINA_TRUE);
|
2017-07-21 13:17:55 -07:00
|
|
|
|
|
|
|
pevas = ecore_evas_get(sd->pointer.ee);
|
|
|
|
|
|
|
|
sd->pointer.obj = edje_object_add(pevas);
|
|
|
|
|
|
|
|
sd->pointer.win = ecore_evas_wayland2_window_get(sd->pointer.ee);
|
|
|
|
ecore_wl2_window_type_set(sd->pointer.win,
|
|
|
|
ECORE_WL2_WINDOW_TYPE_NONE);
|
2018-04-12 11:33:53 -07:00
|
|
|
_elm_win_wl_cursor_set(sd->obj, NULL);
|
|
|
|
ecore_evas_show(sd->pointer.ee);
|
2017-07-21 13:17:55 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-01-30 08:03:57 -08:00
|
|
|
/* do not append to list; all windows render as black rects */
|
|
|
|
if (type != ELM_WIN_FAKE)
|
|
|
|
{
|
|
|
|
const char *element = "base";
|
|
|
|
const char *style;
|
|
|
|
|
|
|
|
_elm_win_list = eina_list_append(_elm_win_list, obj);
|
|
|
|
_elm_win_count++;
|
|
|
|
|
|
|
|
if ((engine) &&
|
2019-01-08 06:41:30 -08:00
|
|
|
((!strcmp(engine, ELM_SOFTWARE_FB)) || (!strcmp(engine, ELM_DRM))
|
|
|
|
|| (!strcmp(engine, ELM_GL_DRM))))
|
2017-01-30 08:03:57 -08:00
|
|
|
{
|
|
|
|
TRAP(sd, fullscreen_set, 1);
|
|
|
|
}
|
|
|
|
style = elm_widget_style_get(obj);
|
|
|
|
if (!style) style = "default";
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case EFL_UI_WIN_DIALOG_BASIC: element = "dialog"; break;
|
|
|
|
case EFL_UI_WIN_NAVIFRAME_BASIC: element = "naviframe"; break;
|
|
|
|
default: break;
|
|
|
|
}
|
2018-11-29 11:09:09 -08:00
|
|
|
|
|
|
|
if (!_elm_config->win_no_border)
|
|
|
|
_elm_win_frame_add(sd, element, style);
|
2017-01-30 08:03:57 -08:00
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->indimode != EFL_UI_WIN_INDICATOR_OFF)
|
|
|
|
_indicator_add(sd);
|
|
|
|
|
2017-01-30 08:03:57 -08:00
|
|
|
if (_elm_config->focus_highlight_enable)
|
|
|
|
elm_win_focus_highlight_enabled_set(obj, EINA_TRUE);
|
|
|
|
if (_elm_config->focus_highlight_animate)
|
|
|
|
elm_win_focus_highlight_animate_set(obj, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
2018-04-03 04:27:30 -07:00
|
|
|
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_WINDOW);
|
2015-10-08 03:23:15 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_created_signal_emit(obj);
|
2014-04-20 20:46:11 -07:00
|
|
|
|
2016-06-23 05:39:33 -07:00
|
|
|
// attach config API
|
2018-02-26 21:10:12 -08:00
|
|
|
efl_composite_attach(obj, efl_provider_find(efl_main_loop_get(), EFL_CONFIG_GLOBAL_CLASS));
|
2016-06-23 05:39:33 -07:00
|
|
|
|
2017-09-26 15:21:12 -07:00
|
|
|
efl_event_callback_array_add(sd->evas, _elm_evas_tracking(), sd);
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_array_add(obj, _elm_win_evas_feed_fake_callbacks(), sd->evas);
|
2017-09-26 15:21:12 -07:00
|
|
|
efl_event_callback_array_add(obj, _elm_win_tracking(), sd);
|
2016-11-17 00:46:14 -08:00
|
|
|
evas_object_show(sd->legacy.edje);
|
2015-04-30 05:58:26 -07:00
|
|
|
|
2015-09-07 10:05:08 -07:00
|
|
|
if (type == ELM_WIN_FAKE)
|
|
|
|
{
|
|
|
|
_elm_win_resize_job(obj);
|
|
|
|
_elm_win_move(sd->ee);
|
|
|
|
}
|
2017-12-19 03:37:25 -08:00
|
|
|
else
|
|
|
|
{
|
2018-03-12 12:21:15 -07:00
|
|
|
sd->finalize_future = eina_future_then_easy(efl_loop_job(efl_loop_get(obj)),
|
|
|
|
.success = _win_finalize_job_cb, .data = sd);
|
2017-12-19 03:37:25 -08:00
|
|
|
}
|
2017-05-16 05:47:52 -07:00
|
|
|
|
|
|
|
// All normal windows are "standard" windows with EO API
|
|
|
|
if (!sd->legacy.ctor)
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case EFL_UI_WIN_UNKNOWN:
|
|
|
|
case EFL_UI_WIN_BASIC:
|
|
|
|
case EFL_UI_WIN_DIALOG_BASIC:
|
|
|
|
_elm_win_standard_init(obj);
|
|
|
|
break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-04 00:03:52 -08:00
|
|
|
// Load the config values into gesutre manager.
|
|
|
|
_gesture_manager_config_load(obj);
|
|
|
|
|
2015-05-20 08:31:04 -07:00
|
|
|
return obj;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-07-05 02:23:38 -07:00
|
|
|
|
2015-04-17 15:10:11 -07:00
|
|
|
EOLIAN static Eo *
|
2017-05-16 05:47:52 -07:00
|
|
|
_efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *sd)
|
2015-04-17 15:10:11 -07:00
|
|
|
{
|
2017-09-25 15:48:53 -07:00
|
|
|
Eina_Bool resume = !_elm_win_count;
|
|
|
|
|
2017-05-16 05:47:52 -07:00
|
|
|
obj = _elm_win_finalize_internal(obj, sd, sd->name, sd->type);
|
|
|
|
if (!obj) return NULL;
|
2017-09-25 15:48:53 -07:00
|
|
|
obj = efl_finalize(efl_super(obj, MY_CLASS));
|
2018-02-27 04:19:17 -08:00
|
|
|
if (obj && resume) efl_event_callback_call(efl_loop_get(obj), EFL_APP_EVENT_RESUME, NULL);
|
2019-02-27 10:17:09 -08:00
|
|
|
if (obj && (!elm_widget_is_legacy(obj)))
|
|
|
|
{
|
|
|
|
/* FIXME: if parts other than background are supported then this should change */
|
|
|
|
if (efl_file_get(efl_part(obj, "background")) || efl_file_mmap_get(efl_part(obj, "background")))
|
|
|
|
efl_file_load(efl_part(obj, "background"));
|
|
|
|
}
|
2017-09-25 15:48:53 -07:00
|
|
|
return obj;
|
2017-05-16 05:47:52 -07:00
|
|
|
}
|
|
|
|
|
2017-11-07 23:17:29 -08:00
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_win_efl_canvas_object_legacy_ctor(Eo *obj, Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
efl_canvas_object_legacy_ctor(efl_super(obj, MY_CLASS));
|
|
|
|
sd->legacy.ctor = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2017-06-08 14:52:37 -07:00
|
|
|
EOLIAN static Efl_Ui_Focus_Manager*
|
2018-05-16 10:30:28 -07:00
|
|
|
_efl_ui_win_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
|
2017-06-08 14:52:37 -07:00
|
|
|
{
|
|
|
|
Efl_Ui_Focus_Manager *manager;
|
|
|
|
|
2017-07-05 03:48:52 -07:00
|
|
|
manager = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj,
|
2017-06-08 14:52:37 -07:00
|
|
|
efl_ui_focus_manager_root_set(efl_added, root)
|
|
|
|
);
|
|
|
|
|
|
|
|
return manager;
|
|
|
|
}
|
|
|
|
|
2017-07-07 13:26:50 -07:00
|
|
|
EOLIAN static void
|
2017-08-31 01:57:40 -07:00
|
|
|
_efl_ui_win_efl_object_destructor(Eo *obj, Efl_Ui_Win_Data *pd EINA_UNUSED)
|
2017-07-07 13:26:50 -07:00
|
|
|
{
|
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if (pd->type == ELM_WIN_FAKE)
|
2017-07-19 01:12:35 -07:00
|
|
|
{
|
|
|
|
if (pd->wl.win)
|
|
|
|
ecore_wl2_window_free(pd->wl.win);
|
|
|
|
}
|
2017-07-07 13:26:50 -07:00
|
|
|
#endif
|
2018-03-12 12:21:15 -07:00
|
|
|
if (pd->finalize_future)
|
|
|
|
eina_future_cancel(pd->finalize_future);
|
2018-05-16 10:30:33 -07:00
|
|
|
|
2017-07-07 13:26:50 -07:00
|
|
|
efl_destructor(efl_super(obj, MY_CLASS));
|
2018-05-16 10:30:33 -07:00
|
|
|
|
|
|
|
efl_unref(pd->provider);
|
2017-07-07 13:26:50 -07:00
|
|
|
}
|
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
EOLIAN static Eo *
|
2016-11-04 09:44:37 -07:00
|
|
|
_efl_ui_win_efl_object_constructor(Eo *obj, Efl_Ui_Win_Data *pd)
|
2015-05-19 05:34:07 -07:00
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
/* UGLY HACK: Do (almost) nothing here:
|
|
|
|
* We are calling the constructor chain from the finalizer. It's
|
2015-05-19 05:34:07 -07:00
|
|
|
* really bad and hacky. Needs fixing. */
|
2017-08-31 01:57:40 -07:00
|
|
|
|
|
|
|
pd->obj = obj;
|
2018-05-16 10:30:33 -07:00
|
|
|
pd->provider = efl_add_ref(EFL_UI_FOCUS_PARENT_PROVIDER_STANDARD_CLASS, NULL);
|
2017-08-31 01:57:40 -07:00
|
|
|
pd->profile.available = eina_array_new(4);
|
2016-11-04 09:44:37 -07:00
|
|
|
|
2017-11-27 05:24:01 -08:00
|
|
|
// For bindings: if no parent, allow simple unref
|
|
|
|
if (!efl_parent_get(obj))
|
|
|
|
efl_allow_parent_unref_set(obj, EINA_TRUE);
|
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2016-06-07 17:26:39 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_win_efl_text_text_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *title)
|
|
|
|
{
|
|
|
|
if (!title) return;
|
|
|
|
eina_stringshare_replace(&(sd->title), title);
|
|
|
|
if (sd->ee)
|
|
|
|
TRAP(sd, title_set, sd->title);
|
|
|
|
if (sd->frame_obj)
|
2018-04-26 03:27:43 -07:00
|
|
|
{
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_text_escaped_set(sd->frame_obj, "elm.text.title", sd->title);
|
|
|
|
else
|
|
|
|
edje_object_part_text_escaped_set(sd->frame_obj, "efl.text.title", sd->title);
|
|
|
|
}
|
2016-06-07 17:26:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char*
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_text_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-06-07 17:26:39 -07:00
|
|
|
{
|
|
|
|
return sd->title;
|
|
|
|
}
|
|
|
|
|
2016-06-07 01:43:45 -07:00
|
|
|
EOLIAN static void
|
2017-11-16 02:00:48 -08:00
|
|
|
_efl_ui_win_win_type_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Type type)
|
2015-04-17 15:10:11 -07:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
if (efl_finalized_get(obj))
|
2015-04-17 15:10:11 -07:00
|
|
|
{
|
|
|
|
ERR("This function is only allowed during construction.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sd->type = type;
|
|
|
|
}
|
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
EOLIAN static Efl_Ui_Win_Type
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_win_type_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2014-03-21 23:17:00 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->type;
|
2014-03-21 23:17:00 -07:00
|
|
|
}
|
|
|
|
|
2015-04-17 15:10:11 -07:00
|
|
|
EOLIAN static void
|
2017-11-16 02:00:48 -08:00
|
|
|
_efl_ui_win_win_name_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *name)
|
2015-04-17 15:10:11 -07:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
if (efl_finalized_get(obj))
|
2015-04-17 15:10:11 -07:00
|
|
|
{
|
|
|
|
ERR("This function is only allowed during construction.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sd->name = eina_stringshare_add(name);
|
|
|
|
}
|
|
|
|
|
2016-06-09 21:00:51 -07:00
|
|
|
EOLIAN static const char *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_win_name_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-06-09 21:00:51 -07:00
|
|
|
{
|
|
|
|
return sd->name;
|
|
|
|
}
|
|
|
|
|
2016-06-22 19:06:22 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_win_accel_preference_set(Eo *obj, Efl_Ui_Win_Data *pd, const char *accel)
|
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
if (efl_finalized_get(obj))
|
2016-06-22 19:06:22 -07:00
|
|
|
{
|
|
|
|
ERR("This function is only allowed during construction.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
eina_stringshare_replace(&pd->accel_pref, accel);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_accel_preference_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
|
2016-06-22 19:06:22 -07:00
|
|
|
{
|
|
|
|
return pd->accel_pref;
|
|
|
|
}
|
|
|
|
|
2014-07-20 19:39:32 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_noblank_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, Eina_Bool noblank)
|
2014-07-20 19:39:32 -07:00
|
|
|
{
|
|
|
|
noblank = !!noblank;
|
|
|
|
if (pd->noblank == noblank) return;
|
|
|
|
pd->noblank = noblank;
|
|
|
|
_win_noblank_eval();
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_noblank_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
|
2014-07-20 19:39:32 -07:00
|
|
|
{
|
|
|
|
return pd->noblank;
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2017-11-16 02:00:48 -08:00
|
|
|
_efl_ui_win_win_role_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *role)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
if (!role) return;
|
|
|
|
eina_stringshare_replace(&(sd->role), role);
|
2012-02-29 04:06:12 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2012-02-29 04:06:12 -08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static const char*
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_win_role_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->role;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_icon_object_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *icon)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2018-05-25 00:42:52 -07:00
|
|
|
if (icon && (!efl_isa(icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS) &&
|
|
|
|
!efl_isa(icon, EFL_UI_IMAGE_CLASS)))
|
2017-08-31 02:32:02 -07:00
|
|
|
{
|
|
|
|
ERR("Icon object type is not supported!");
|
|
|
|
efl_del(icon);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->icon)
|
2017-08-31 02:32:02 -07:00
|
|
|
{
|
|
|
|
efl_event_callback_del(sd->icon, EFL_EVENT_DEL, _elm_win_on_icon_del, obj);
|
|
|
|
efl_del(sd->icon);
|
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->icon = icon;
|
|
|
|
if (sd->icon)
|
2016-04-07 11:04:21 -07:00
|
|
|
{
|
2017-08-31 02:32:02 -07:00
|
|
|
efl_event_callback_add(sd->icon, EFL_EVENT_DEL, _elm_win_on_icon_del, obj);
|
2016-04-07 11:04:21 -07:00
|
|
|
if (sd->frame_obj)
|
2016-11-16 01:09:37 -08:00
|
|
|
{
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);
|
|
|
|
else
|
|
|
|
edje_object_part_swallow(sd->frame_obj, "efl.icon", sd->icon);
|
|
|
|
|
2016-11-16 01:09:37 -08:00
|
|
|
evas_object_is_frame_object_set(sd->icon, EINA_TRUE);
|
|
|
|
}
|
2016-04-07 11:04:21 -07:00
|
|
|
}
|
2012-02-29 04:06:12 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2012-02-29 04:06:12 -08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static const Evas_Object*
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_icon_object_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2008-10-06 18:23:49 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->icon;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2019-01-31 08:54:58 -08:00
|
|
|
EOLIAN static const Eina_Value *
|
|
|
|
_efl_ui_win_exit_on_close_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
return &sd->exit_on_close;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_win_exit_on_close_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const Eina_Value *exit_code)
|
|
|
|
{
|
|
|
|
const Eina_Value_Type *type = eina_value_type_get(exit_code);
|
|
|
|
|
|
|
|
if (type)
|
|
|
|
eina_value_copy(exit_code, &sd->exit_on_close);
|
|
|
|
else
|
|
|
|
eina_value_flush(&sd->exit_on_close);
|
|
|
|
}
|
|
|
|
|
2017-11-09 23:50:01 -08:00
|
|
|
/* Only for C API */
|
|
|
|
EAPI void
|
|
|
|
elm_win_autodel_set(Eo *obj, Eina_Bool autodel)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-11-09 23:50:01 -08:00
|
|
|
ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->autodel = autodel;
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
|
|
|
|
2017-11-09 23:50:01 -08:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_autodel_get(const Eo *obj)
|
2008-10-06 18:23:49 -07:00
|
|
|
{
|
2017-11-09 23:50:01 -08:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->autodel;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2015-07-01 07:40:57 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_autohide_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool autohide)
|
2015-07-01 07:40:57 -07:00
|
|
|
{
|
|
|
|
sd->autohide = autohide;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_autohide_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2015-07-01 07:40:57 -07:00
|
|
|
{
|
|
|
|
return sd->autohide;
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_activate(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, activate);
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
|
|
|
|
2016-05-04 00:19:32 -07:00
|
|
|
EOLIAN static void
|
2019-02-14 05:57:22 -08:00
|
|
|
_efl_ui_win_efl_gfx_stack_raise_to_top(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd)
|
2016-05-04 00:19:32 -07:00
|
|
|
{
|
2017-08-31 00:45:08 -07:00
|
|
|
TRAP(pd, raise);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_raise(Eo *obj)
|
|
|
|
{
|
2019-02-14 05:57:22 -08:00
|
|
|
efl_gfx_stack_raise_to_top(obj);
|
2016-05-04 00:19:32 -07:00
|
|
|
}
|
|
|
|
|
2017-08-31 00:58:02 -07:00
|
|
|
EOLIAN static void
|
2019-02-14 05:57:22 -08:00
|
|
|
_efl_ui_win_efl_gfx_stack_lower_to_bottom(Eo *obj, Efl_Ui_Win_Data *pd EINA_UNUSED)
|
2017-08-31 00:58:02 -07:00
|
|
|
{
|
|
|
|
// Do nothing: in X we could request to stack lower but that has been abused
|
|
|
|
// and transformed into a kind of "iconify". As a consequence, lower is
|
|
|
|
// not allowed in EO land.
|
|
|
|
if (!elm_widget_is_legacy(obj)) return;
|
|
|
|
|
|
|
|
// Legacy support...
|
|
|
|
elm_win_lower(obj);
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_center(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool h, Eina_Bool v)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-08-13 07:08:01 -07:00
|
|
|
int win_w, win_h, screen_x, screen_y, screen_w, screen_h, nx, ny;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-05-12 03:19:29 -07:00
|
|
|
if (sd->deferred_resize_job) _elm_win_resize_job(sd->obj);
|
|
|
|
if (sd->frame_obj) edje_object_message_signal_process(sd->frame_obj);
|
|
|
|
evas_smart_objects_calculate(evas_object_evas_get(obj));
|
2017-07-04 02:18:07 -07:00
|
|
|
_elm_win_resize_objects_eval(obj, EINA_FALSE);
|
2015-02-05 18:32:55 -08:00
|
|
|
if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj, h, v)))
|
2012-07-18 21:35:50 -07:00
|
|
|
return;
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
if (!efl_gfx_entity_visible_get(obj))
|
2017-11-06 20:52:31 -08:00
|
|
|
{
|
|
|
|
// Chose to use env var so this will also translate more easily
|
|
|
|
// to wayland. yes - we can get x atoms to figure out if wm is
|
|
|
|
// enlightenment, but this works just as well. for wl we'd need
|
|
|
|
// an alternate wl specific way... this below works better IMHO
|
|
|
|
const char *s = getenv("DESKTOP");
|
|
|
|
|
|
|
|
if ((s) && (!strcasecmp(s, "Enlightenment")))
|
|
|
|
{
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
static Ecore_X_Atom state = 0;
|
|
|
|
static Ecore_X_Atom centered = 0;
|
|
|
|
|
|
|
|
if (!centered) centered = ecore_x_atom_get
|
|
|
|
("__E_ATOM_WINDOW_STATE_CENTERED");
|
|
|
|
if (!state) state = ecore_x_atom_get
|
|
|
|
("__E_ATOM_WINDOW_STATE");
|
|
|
|
ecore_x_window_prop_card32_set(sd->x.xwin, state, ¢ered, 1);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
// XXX: what to do with wayland?
|
2017-11-06 23:39:26 -08:00
|
|
|
// XXX: what to do with win32?
|
|
|
|
// XXX: what to do with osx/coca?
|
|
|
|
// etc.
|
2017-11-06 20:52:31 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// not e - fall back to manually placing on what we think the screen
|
|
|
|
// is/will be... to do this move window to where pointer is first
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
int x = 0, y = 0;
|
|
|
|
|
|
|
|
if (sd->req_wh)
|
|
|
|
{
|
|
|
|
win_w = sd->req_w;
|
|
|
|
win_h = sd->req_h;
|
|
|
|
}
|
|
|
|
else evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
|
|
|
|
ecore_x_pointer_root_xy_get(&x, &y);
|
|
|
|
ecore_evas_move(sd->ee, x - (win_w / 2), y - (win_h / 2));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
// XXX: what to do with wayland?
|
2017-11-06 23:39:26 -08:00
|
|
|
// XXX: what to do with win32?
|
|
|
|
// XXX: what to do with osx/coca?
|
|
|
|
// etc.
|
2017-11-06 20:52:31 -08:00
|
|
|
}
|
|
|
|
|
2016-08-13 07:08:01 -07:00
|
|
|
ecore_evas_screen_geometry_get(sd->ee,
|
|
|
|
&screen_x, &screen_y,
|
|
|
|
&screen_w, &screen_h);
|
2011-12-04 12:44:41 -08:00
|
|
|
if ((!screen_w) || (!screen_h)) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-05-12 03:19:29 -07:00
|
|
|
if (sd->req_wh)
|
|
|
|
{
|
|
|
|
win_w = sd->req_w;
|
|
|
|
win_h = sd->req_h;
|
|
|
|
}
|
|
|
|
else evas_object_geometry_get(obj, NULL, NULL, &win_w, &win_h);
|
|
|
|
if (sd->req_xy)
|
|
|
|
{
|
|
|
|
nx = sd->req_x;
|
|
|
|
ny = sd->req_y;
|
|
|
|
}
|
|
|
|
else evas_object_geometry_get(obj, &nx, &ny, NULL, NULL);
|
|
|
|
|
2011-12-04 12:44:41 -08:00
|
|
|
if ((!win_w) || (!win_h)) return;
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2011-12-03 14:51:12 -08:00
|
|
|
if (h) nx = win_w >= screen_w ? 0 : (screen_w / 2) - (win_w / 2);
|
|
|
|
if (v) ny = win_h >= screen_h ? 0 : (screen_h / 2) - (win_h / 2);
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-05-12 03:19:29 -07:00
|
|
|
sd->req_xy = EINA_TRUE;
|
|
|
|
sd->req_x = screen_x + nx;
|
|
|
|
sd->req_y = screen_y + ny;
|
2016-08-13 07:08:01 -07:00
|
|
|
evas_object_move(obj, screen_x + nx, screen_y + ny);
|
2011-12-03 14:51:12 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-10-27 23:26:59 -07:00
|
|
|
_efl_ui_win_borderless_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool borderless)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
sd->csd.need_borderless = borderless ? 1 : 0;
|
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2014-01-07 16:05:08 -08:00
|
|
|
|
2016-11-23 18:28:05 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (!sd->x.xwin || !sd->csd.need)
|
|
|
|
#endif
|
|
|
|
TRAP(sd, borderless_set, borderless);
|
|
|
|
|
2017-07-04 02:18:07 -07:00
|
|
|
_elm_win_resize_objects_eval(obj, EINA_FALSE);
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_borderless_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2008-10-06 18:23:49 -07:00
|
|
|
{
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
if (!sd->csd.need)
|
|
|
|
return ecore_evas_borderless_get(sd->ee);
|
|
|
|
return sd->csd.need_borderless;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_alpha_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-12-10 21:43:53 -08:00
|
|
|
sd->application_alpha = enabled;
|
|
|
|
_elm_win_apply_alpha(obj, sd);
|
2016-11-24 00:45:14 -08:00
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2008-10-06 18:23:49 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_alpha_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-15 07:48:30 -07:00
|
|
|
if (sd->img_obj)
|
2011-10-14 00:30:52 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return evas_object_image_alpha_get(sd->img_obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return ecore_evas_alpha_get(sd->ee);
|
2011-10-14 00:30:52 -07:00
|
|
|
}
|
2009-10-12 02:09:55 -07:00
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
return EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_fullscreen_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool fullscreen)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-08-10 15:59:45 -07:00
|
|
|
const char *engine_name = ecore_evas_engine_name_get(sd->ee);
|
2012-05-03 15:42:15 -07:00
|
|
|
// YYY: handle if sd->img_obj
|
2014-08-10 15:59:45 -07:00
|
|
|
if (engine_name &&
|
|
|
|
((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
|
2019-01-08 06:41:30 -08:00
|
|
|
(!strcmp(engine_name, ELM_DRM)) ||
|
|
|
|
(!strcmp(engine_name, ELM_GL_DRM))))
|
2009-03-14 11:03:19 -07:00
|
|
|
{
|
2011-04-01 04:20:18 -07:00
|
|
|
// these engines... can ONLY be fullscreen
|
|
|
|
return;
|
2010-11-01 14:10:07 -07:00
|
|
|
}
|
2015-03-18 07:53:56 -07:00
|
|
|
else if (sd->type == ELM_WIN_FAKE)
|
|
|
|
sd->fullscreen = !!fullscreen;
|
2010-11-01 14:10:07 -07:00
|
|
|
else
|
|
|
|
{
|
2013-01-10 03:53:39 -08:00
|
|
|
// sd->fullscreen = fullscreen;
|
2013-05-08 14:45:02 -07:00
|
|
|
TRAP(sd, fullscreen_set, fullscreen);
|
|
|
|
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2009-03-14 11:03:19 -07:00
|
|
|
}
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_fullscreen_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-08-10 15:59:45 -07:00
|
|
|
const char *engine_name = ecore_evas_engine_name_get(sd->ee);
|
2014-01-07 16:05:08 -08:00
|
|
|
|
|
|
|
if (engine_name &&
|
|
|
|
((!strcmp(engine_name, ELM_SOFTWARE_FB)) ||
|
2019-01-08 06:41:30 -08:00
|
|
|
(!strcmp(engine_name, ELM_DRM)) ||
|
|
|
|
(!strcmp(engine_name, ELM_GL_DRM))))
|
2009-10-12 02:09:55 -07:00
|
|
|
{
|
2011-04-01 04:20:18 -07:00
|
|
|
// these engines... can ONLY be fullscreen
|
2014-03-27 06:15:52 -07:00
|
|
|
return EINA_TRUE;
|
2010-11-01 14:10:07 -07:00
|
|
|
}
|
2015-03-18 07:51:29 -07:00
|
|
|
return sd->fullscreen;
|
2012-12-27 05:38:33 -08:00
|
|
|
}
|
|
|
|
|
2016-11-28 00:24:18 -08:00
|
|
|
static inline Eo *
|
|
|
|
_main_menu_swallow_get(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
2017-07-17 22:35:40 -07:00
|
|
|
Eina_Bool legacy_menu_swallow = EINA_TRUE;
|
|
|
|
const char *data;
|
|
|
|
int version;
|
|
|
|
|
|
|
|
data = edje_object_data_get(sd->legacy.edje, "version");
|
|
|
|
version = data ? atoi(data) : 0;
|
|
|
|
if (version >= 119) legacy_menu_swallow = EINA_FALSE;
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
if (sd->cocoa.win) legacy_menu_swallow = EINA_TRUE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (legacy_menu_swallow)
|
2016-11-28 00:24:18 -08:00
|
|
|
{
|
|
|
|
DBG("Detected legacy theme, using legacy swallows.");
|
|
|
|
return sd->legacy.edje;
|
|
|
|
}
|
2016-11-28 01:26:39 -08:00
|
|
|
return sd->frame_obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_main_menu_resize_cb(void *data EINA_UNUSED, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
// After resize, the framespace size has changed, so update the win geometry
|
2017-07-04 02:18:07 -07:00
|
|
|
_elm_win_resize_objects_eval(ev->object, EINA_FALSE);
|
2019-02-21 10:01:56 -08:00
|
|
|
efl_event_callback_del(ev->object, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _main_menu_resize_cb, NULL);
|
2016-11-28 00:24:18 -08:00
|
|
|
}
|
|
|
|
|
2013-01-17 14:11:33 -08:00
|
|
|
static void
|
2013-01-30 19:30:53 -08:00
|
|
|
_dbus_menu_set(Eina_Bool dbus_connect, void *data)
|
2013-01-17 14:11:33 -08:00
|
|
|
{
|
2013-01-22 10:51:16 -08:00
|
|
|
ELM_WIN_DATA_GET_OR_RETURN(data, sd);
|
2016-11-28 00:24:18 -08:00
|
|
|
Eo *swallow = _main_menu_swallow_get(sd);
|
2013-01-17 14:11:33 -08:00
|
|
|
|
2013-01-30 19:30:53 -08:00
|
|
|
if (dbus_connect)
|
2013-01-17 14:11:33 -08:00
|
|
|
{
|
2013-01-22 10:51:16 -08:00
|
|
|
DBG("Setting menu to D-Bus");
|
2016-11-28 00:24:18 -08:00
|
|
|
edje_object_part_unswallow(swallow, sd->main_menu);
|
|
|
|
sd->csd.need_menu = EINA_FALSE;
|
2013-01-22 10:51:16 -08:00
|
|
|
_elm_menu_menu_bar_hide(sd->main_menu);
|
2017-07-04 02:18:07 -07:00
|
|
|
_elm_win_resize_objects_eval(sd->obj, EINA_FALSE);
|
2017-07-17 22:35:40 -07:00
|
|
|
if (swallow != sd->frame_obj)
|
|
|
|
{
|
|
|
|
// Note: Based on EFL 1.18 the signal was "elm,action,hide"
|
|
|
|
// and not "elm,action,hide_menu" as expected.
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(data))
|
|
|
|
edje_object_signal_emit(swallow, "elm,action,hide", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(swallow, "efl,action,hide", "efl");
|
2017-07-17 22:35:40 -07:00
|
|
|
edje_object_message_signal_recursive_process(swallow);
|
|
|
|
}
|
2013-01-22 10:51:16 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG("Setting menu to local mode");
|
2019-02-21 10:01:56 -08:00
|
|
|
efl_event_callback_add(sd->obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _main_menu_resize_cb, NULL);
|
2018-04-26 03:27:43 -07:00
|
|
|
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_swallow(swallow, "elm.swallow.menu", sd->main_menu);
|
|
|
|
else
|
|
|
|
edje_object_part_swallow(swallow, "efl.menu", sd->main_menu);
|
|
|
|
|
2016-11-30 23:26:52 -08:00
|
|
|
evas_object_show(sd->main_menu);
|
|
|
|
if (swallow == sd->frame_obj)
|
|
|
|
{
|
|
|
|
efl_canvas_object_is_frame_object_set(sd->main_menu, EINA_TRUE);
|
|
|
|
sd->csd.need_menu = EINA_TRUE;
|
|
|
|
}
|
2017-07-17 22:35:40 -07:00
|
|
|
else
|
|
|
|
{
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(data))
|
|
|
|
edje_object_signal_emit(swallow, "elm,action,show_menu", "elm");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(swallow, "efl,action,show_menu", "efl");
|
2017-07-17 22:35:40 -07:00
|
|
|
edje_object_message_signal_recursive_process(swallow);
|
|
|
|
}
|
2013-01-17 14:11:33 -08:00
|
|
|
}
|
2016-11-28 00:24:18 -08:00
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2017-07-04 02:18:07 -07:00
|
|
|
//sd->deferred_resize_job = EINA_TRUE;
|
2013-01-17 14:11:33 -08:00
|
|
|
}
|
|
|
|
|
2019-01-31 08:54:54 -08:00
|
|
|
EOLIAN static const Eina_Value *
|
2019-02-09 09:45:27 -08:00
|
|
|
_efl_ui_win_exit_on_all_windows_closed_get(void)
|
2019-01-31 08:54:54 -08:00
|
|
|
{
|
|
|
|
return &exit_on_all_windows_closed;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-02-09 09:45:27 -08:00
|
|
|
_efl_ui_win_exit_on_all_windows_closed_set(const Eina_Value *exit_code)
|
2019-01-31 08:54:54 -08:00
|
|
|
{
|
|
|
|
const Eina_Value_Type *type = eina_value_type_get(exit_code);
|
|
|
|
|
|
|
|
if (type)
|
|
|
|
eina_value_copy(exit_code, &exit_on_all_windows_closed);
|
|
|
|
else
|
|
|
|
eina_value_flush(&exit_on_all_windows_closed);
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_maximized_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool maximized)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
2012-05-03 15:42:15 -07:00
|
|
|
// YYY: handle if sd->img_obj
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, maximized_set, maximized);
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2009-03-12 22:50:38 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_maximized_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2009-10-12 02:09:55 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->maximized;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2019-02-28 02:21:43 -08:00
|
|
|
_efl_ui_win_minimized_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool minimized)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2019-02-28 02:21:43 -08:00
|
|
|
// sd->minimized = minimized;
|
|
|
|
TRAP(sd, iconified_set, minimized);
|
2014-03-27 06:15:52 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
2009-10-12 02:09:55 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2019-02-28 02:21:43 -08:00
|
|
|
_efl_ui_win_minimized_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2019-02-28 02:21:43 -08:00
|
|
|
return sd->minimized;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2017-08-31 01:57:40 -07:00
|
|
|
_efl_ui_win_wm_available_profiles_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const Eina_Array *profiles)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-12-04 22:50:27 -08:00
|
|
|
Eina_Bool found = EINA_FALSE;
|
|
|
|
|
|
|
|
_elm_win_available_profiles_del(sd);
|
2017-08-31 01:57:40 -07:00
|
|
|
if (profiles && eina_array_count(profiles))
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
Eina_Iterator *it;
|
|
|
|
const char *prof;
|
2012-12-04 22:50:27 -08:00
|
|
|
|
2017-08-31 01:57:40 -07:00
|
|
|
it = eina_array_iterator_new(profiles);
|
|
|
|
EINA_ITERATOR_FOREACH(it, prof)
|
|
|
|
{
|
|
|
|
Eina_Stringshare *str = eina_stringshare_add(prof);
|
|
|
|
if (!str) continue;
|
2012-12-04 22:50:27 -08:00
|
|
|
|
2017-08-31 01:57:40 -07:00
|
|
|
eina_array_push(sd->profile.available, str);
|
|
|
|
/* check to see if a given array has a current profile of elm_win */
|
|
|
|
if (str == sd->profile.name)
|
|
|
|
found = EINA_TRUE;
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
2017-08-31 01:57:40 -07:00
|
|
|
eina_iterator_free(it);
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ecore_evas_window_profile_supported_get(sd->ee))
|
|
|
|
{
|
|
|
|
ecore_evas_window_available_profiles_set(sd->ee,
|
2017-08-31 01:57:40 -07:00
|
|
|
(const char **) sd->profile.available->data,
|
|
|
|
eina_array_count(sd->profile.available));
|
2012-12-04 22:50:27 -08:00
|
|
|
|
|
|
|
/* current profile of elm_win is wrong, change profile */
|
2017-08-31 01:57:40 -07:00
|
|
|
if (!found && eina_array_count(sd->profile.available))
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
|
|
|
eina_stringshare_replace(&(sd->profile.name),
|
2017-08-31 01:57:40 -07:00
|
|
|
eina_array_data_get(sd->profile.available, 0));
|
2012-12-04 22:50:27 -08:00
|
|
|
ecore_evas_window_profile_set(sd->ee, sd->profile.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
if (eina_array_count(sd->profile.available))
|
2012-12-04 22:50:27 -08:00
|
|
|
_elm_win_profile_update(sd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-31 01:57:40 -07:00
|
|
|
EOLIAN static const Eina_Array *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_wm_available_profiles_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-12-04 22:50:27 -08:00
|
|
|
{
|
|
|
|
if (ecore_evas_window_profile_supported_get(sd->ee))
|
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
char **profiles = NULL; // all const
|
|
|
|
unsigned int count, i;
|
|
|
|
Eina_Bool ok;
|
|
|
|
|
|
|
|
ok = ecore_evas_window_available_profiles_get(sd->ee, &profiles, &count);
|
|
|
|
if (!ok) return NULL;
|
|
|
|
|
|
|
|
if (count == eina_array_count(sd->profile.available))
|
|
|
|
{
|
|
|
|
for (i = 0; ok && (i < count); i++)
|
|
|
|
{
|
|
|
|
if (!eina_streq(profiles[i], eina_array_data_get(sd->profile.available, i)))
|
|
|
|
ok = EINA_FALSE;
|
|
|
|
}
|
|
|
|
if (ok) return sd->profile.available;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Oops! What is going on here? Can this happen?
|
|
|
|
INF("Available profile list has changed in ecore evas!");
|
|
|
|
_elm_win_available_profiles_del(sd);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
Eina_Stringshare *str = eina_stringshare_add(profiles[i]);
|
|
|
|
if (str) eina_array_push(sd->profile.available, str);
|
|
|
|
}
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
2017-08-31 01:57:40 -07:00
|
|
|
|
|
|
|
return sd->profile.available;
|
2012-12-04 22:50:27 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_urgent_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Urgent_Mode urgent)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-06-01 04:47:30 -07:00
|
|
|
Eina_Bool urgent_tmp = !!urgent;
|
|
|
|
|
|
|
|
if (sd->urgent == urgent_tmp) return;
|
2016-12-20 08:27:45 -08:00
|
|
|
|
2016-06-01 04:47:30 -07:00
|
|
|
sd->urgent = urgent_tmp;
|
|
|
|
TRAP(sd, urgent_set, urgent_tmp);
|
2012-02-28 03:20:35 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2012-02-28 03:20:35 -08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
EOLIAN static Efl_Ui_Win_Urgent_Mode
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_urgent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
if (sd->urgent) return EFL_UI_WIN_URGENT_URGENT;
|
|
|
|
return EFL_UI_WIN_URGENT_NONE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_modal_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Modal_Mode modal)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-06-01 04:47:30 -07:00
|
|
|
Eina_Bool modal_tmp = !!modal;
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2014-04-09 03:04:55 -07:00
|
|
|
if (sd->modal_count) return;
|
|
|
|
|
2016-06-01 04:47:30 -07:00
|
|
|
if ((modal_tmp) && (!sd->modal) && (evas_object_visible_get(obj)))
|
2016-11-22 03:29:58 -08:00
|
|
|
_elm_win_modality_increment(sd);
|
2016-06-01 04:47:30 -07:00
|
|
|
else if ((!modal_tmp) && (sd->modal) && (evas_object_visible_get(obj)))
|
2016-11-22 03:29:58 -08:00
|
|
|
_elm_win_modality_decrement(sd);
|
2014-04-09 03:04:55 -07:00
|
|
|
|
2016-06-01 04:47:30 -07:00
|
|
|
sd->modal = modal_tmp;
|
|
|
|
TRAP(sd, modal_set, modal_tmp);
|
2012-02-28 03:20:35 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2012-02-28 03:20:35 -08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
EOLIAN static Efl_Ui_Win_Modal_Mode
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_modal_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-05-03 15:42:15 -07:00
|
|
|
{
|
2016-06-07 07:41:48 -07:00
|
|
|
if (sd->modal) return EFL_UI_WIN_MODAL_MODAL;
|
|
|
|
return EFL_UI_WIN_MODAL_NONE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-06-07 23:24:08 -07:00
|
|
|
static void
|
|
|
|
_win_aspect_set(Efl_Ui_Win_Data *sd, double aspect)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->aspect = aspect;
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, aspect_set, aspect);
|
2012-02-28 03:20:35 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2012-02-28 03:20:35 -08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-06-07 23:24:08 -07:00
|
|
|
static double
|
|
|
|
_win_aspect_get(Efl_Ui_Win_Data *sd)
|
2012-06-12 03:15:19 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->aspect;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-06-07 23:24:08 -07:00
|
|
|
EOLIAN static void
|
2019-02-21 09:19:45 -08:00
|
|
|
_efl_ui_win_efl_gfx_hint_hint_aspect_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
|
|
|
|
Efl_Gfx_Hint_Aspect mode, Eina_Size2D sz)
|
2016-06-07 23:24:08 -07:00
|
|
|
{
|
2017-09-18 00:44:42 -07:00
|
|
|
if (sz.h) _win_aspect_set(pd, (double) sz.w / (double) sz.h);
|
2016-06-07 23:24:08 -07:00
|
|
|
else _win_aspect_set(pd, 0.0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_aspect_set(efl_super(obj, MY_CLASS), mode, sz);
|
2017-08-04 13:17:53 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if (pd->wl.win)
|
2017-09-18 00:44:42 -07:00
|
|
|
ecore_wl2_window_aspect_set(pd->wl.win, sz.w, sz.h, mode);
|
2017-08-04 13:17:53 -07:00
|
|
|
#endif
|
2016-06-07 23:24:08 -07:00
|
|
|
}
|
|
|
|
|
2017-10-19 10:26:51 -07:00
|
|
|
EOLIAN static void
|
2019-02-21 09:19:45 -08:00
|
|
|
_efl_ui_win_efl_gfx_hint_hint_weight_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED,
|
2017-10-19 10:26:51 -07:00
|
|
|
double w, double h)
|
|
|
|
{
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(efl_super(obj, MY_CLASS), w, h);
|
2017-10-19 10:26:51 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WL2
|
|
|
|
if (pd->wl.win)
|
|
|
|
ecore_wl2_window_weight_set(pd->wl.win, w, h);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2019-01-23 06:39:39 -08:00
|
|
|
_efl_ui_win_hint_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-09-18 00:38:47 -07:00
|
|
|
sd->size_base_w = sz.w;
|
|
|
|
sd->size_base_h = sz.h;
|
|
|
|
TRAP(sd, size_base_set, sz.w, sz.h);
|
2012-06-12 03:15:19 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2017-09-18 00:38:47 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2019-01-23 06:39:39 -08:00
|
|
|
_efl_ui_win_hint_base_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-09-18 00:38:47 -07:00
|
|
|
return EINA_SIZE2D(sd->size_base_w, sd->size_base_h);
|
2012-06-12 03:15:19 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2019-01-23 06:39:39 -08:00
|
|
|
_efl_ui_win_hint_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-09-18 00:38:47 -07:00
|
|
|
sd->size_step_w = sz.w;
|
|
|
|
sd->size_step_h = sz.h;
|
|
|
|
TRAP(sd, size_step_set, sz.w, sz.h);
|
2012-06-12 03:15:19 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-11-29 20:55:54 -08:00
|
|
|
EOLIAN static void
|
2019-02-21 09:19:45 -08:00
|
|
|
_efl_ui_win_efl_gfx_hint_hint_size_max_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Size2D sz)
|
2016-11-29 20:55:54 -08:00
|
|
|
{
|
|
|
|
if (sd->tmp_updating_hints)
|
|
|
|
{
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_max_set(efl_super(obj, MY_CLASS), sz);
|
2016-11-29 20:55:54 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-09-17 22:07:56 -07:00
|
|
|
if (sz.w < 1) sz.w = -1;
|
|
|
|
if (sz.h < 1) sz.h = -1;
|
|
|
|
sd->max_w = sz.w;
|
|
|
|
sd->max_h = sz.h;
|
2017-07-04 02:18:07 -07:00
|
|
|
_elm_win_resize_objects_eval(obj, EINA_FALSE);
|
2016-11-29 20:55:54 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-18 00:38:47 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2019-01-23 06:39:39 -08:00
|
|
|
_efl_ui_win_hint_step_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-09-18 00:38:47 -07:00
|
|
|
return EINA_SIZE2D(sd->size_step_w, sd->size_step_h);
|
2012-06-12 03:15:19 -07:00
|
|
|
}
|
|
|
|
|
2012-08-21 01:48:47 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_norender_push(Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2012-10-10 17:35:00 -07:00
|
|
|
|
2012-08-21 01:48:47 -07:00
|
|
|
sd->norender++;
|
|
|
|
if (sd->norender == 1) ecore_evas_manual_render_set(sd->ee, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_norender_pop(Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2012-08-21 01:48:47 -07:00
|
|
|
|
|
|
|
if (sd->norender <= 0) return;
|
|
|
|
sd->norender--;
|
|
|
|
if (sd->norender == 0) ecore_evas_manual_render_set(sd->ee, EINA_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
2015-06-08 10:44:29 -07:00
|
|
|
elm_win_norender_get(const Evas_Object *obj)
|
2012-08-21 01:48:47 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return -1;
|
|
|
|
|
2012-08-21 01:48:47 -07:00
|
|
|
return sd->norender;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_render(Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
|
|
|
|
2012-08-21 01:48:47 -07:00
|
|
|
ecore_evas_manual_render(sd->ee);
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
_efl_ui_win_wm_available_rotations_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd,
|
|
|
|
Eina_Bool allow_0, Eina_Bool allow_90,
|
|
|
|
Eina_Bool allow_180, Eina_Bool allow_270)
|
2014-02-10 05:09:45 -08:00
|
|
|
{
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
unsigned cnt = 0;
|
|
|
|
int rots[4];
|
2014-02-10 05:09:45 -08:00
|
|
|
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
if (allow_0) rots[cnt++] = 0;
|
|
|
|
if (allow_90) rots[cnt++] = 90;
|
|
|
|
if (allow_180) rots[cnt++] = 180;
|
|
|
|
if (allow_270) rots[cnt++] = 270;
|
|
|
|
sd->wm_rot.use = EINA_TRUE;
|
2014-02-10 05:09:45 -08:00
|
|
|
|
|
|
|
ELM_SAFE_FREE(sd->wm_rot.rots, free);
|
|
|
|
sd->wm_rot.count = 0;
|
|
|
|
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
if (cnt)
|
2014-02-10 05:09:45 -08:00
|
|
|
{
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
sd->wm_rot.rots = malloc(sizeof(int) * cnt);
|
2014-02-10 05:09:45 -08:00
|
|
|
if (!sd->wm_rot.rots) return;
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
memcpy(sd->wm_rot.rots, rots, cnt * sizeof(int));
|
|
|
|
sd->wm_rot.count = cnt;
|
2014-02-10 05:09:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
ecore_evas_wm_rotation_available_rotations_set(sd->ee,
|
|
|
|
sd->wm_rot.rots,
|
|
|
|
sd->wm_rot.count);
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_wm_available_rotations_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd,
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
Eina_Bool *allow_0, Eina_Bool *allow_90,
|
|
|
|
Eina_Bool *allow_180, Eina_Bool *allow_270)
|
2014-02-10 05:09:45 -08:00
|
|
|
{
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
if (!sd->wm_rot.use) goto end;
|
2014-02-10 05:09:45 -08:00
|
|
|
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
if (allow_0) *allow_0 = EINA_FALSE;
|
|
|
|
if (allow_90) *allow_90 = EINA_FALSE;
|
|
|
|
if (allow_180) *allow_180 = EINA_FALSE;
|
|
|
|
if (allow_270) *allow_270 = EINA_FALSE;
|
|
|
|
|
|
|
|
for (unsigned k = 0; k < sd->wm_rot.count; k++)
|
2014-02-10 05:09:45 -08:00
|
|
|
{
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
switch (sd->wm_rot.rots[k])
|
2014-02-10 05:09:45 -08:00
|
|
|
{
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
case 0: if (allow_0) *allow_0 = EINA_TRUE; break;
|
|
|
|
case 90: if (allow_90) *allow_90 = EINA_TRUE; break;
|
|
|
|
case 180: if (allow_180) *allow_180 = EINA_TRUE; break;
|
|
|
|
case 270: if (allow_270) *allow_270 = EINA_TRUE; break;
|
|
|
|
default: ERR("Unsupported rotation %d", sd->wm_rot.rots[k]); break;
|
2014-02-10 05:09:45 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
end:
|
|
|
|
return !!sd->wm_rot.use;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_wm_rotation_available_rotations_set(Elm_Win *obj, const int *rotations, unsigned int count)
|
|
|
|
{
|
|
|
|
Eina_Bool allow[4] = { 0, };
|
|
|
|
int found = 0;
|
|
|
|
|
|
|
|
if (!rotations || !count) goto end;
|
|
|
|
for (unsigned k = 0; (k < count) && (found < 4); k++)
|
|
|
|
{
|
|
|
|
int rot = (((rotations[k] % 360) + 360) % 360) / 90;
|
|
|
|
if (!allow[rot])
|
|
|
|
{
|
|
|
|
allow[rot] = EINA_TRUE;
|
|
|
|
found++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
end:
|
|
|
|
efl_ui_win_wm_available_rotations_set(obj, allow[0], allow[1], allow[2], allow[3]);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_wm_rotation_available_rotations_get(const Elm_Win *obj, int **rotations, unsigned int *count)
|
|
|
|
{
|
|
|
|
int rots[4] = { 0, };
|
|
|
|
Eina_Bool allow[4] = { 0, };
|
|
|
|
unsigned cnt = 0;
|
|
|
|
|
|
|
|
if (!efl_ui_win_wm_available_rotations_get(obj, &allow[0], &allow[1], &allow[2], &allow[3]))
|
|
|
|
goto none;
|
|
|
|
|
|
|
|
for (int k = 0; k < 4; k++)
|
|
|
|
if (allow[k])
|
|
|
|
rots[cnt++] = k * 90;
|
|
|
|
|
|
|
|
if (!cnt) goto none;
|
|
|
|
|
|
|
|
if (rotations)
|
|
|
|
{
|
|
|
|
*rotations = malloc(sizeof(int) * cnt);
|
|
|
|
if (!*rotations) goto none;
|
|
|
|
memcpy(*rotations, rots, cnt * sizeof(int));
|
|
|
|
}
|
|
|
|
if (count) *count = cnt;
|
2014-03-27 06:15:52 -07:00
|
|
|
return EINA_TRUE;
|
win: Make wm_available_rotations simpler for EO
The problem with the API is that it uses an array of ints, which is not
well defined in EO. We could set an array of pointers to int, but that
would be super awkward to use.
I believe the original API has been slightly over-engineered as it was
passing an array of available rotations when in reality only 4 rotations
could be supported (0, 90, 180, 270). It seems to me that the day
arbitrary rotation needs to be allowed, another API would be required
(maybe with a range, or a single bool flag to allow anything).
I have not modified the internal code, which still uses an array (as
ecore evas uses that).
Mote: ec464939d9b8e4daa removed wm_rotation_supported_get(), as well as
the preferred rotation from EO, but they could easily be added back if
needed.
Note 2: I couldn't test as desktop E doesn't support WM rotations.
Ref T5322
2017-11-20 00:28:20 -08:00
|
|
|
|
|
|
|
none:
|
|
|
|
if (rotations) *rotations = NULL;
|
|
|
|
if (count) *count = 0;
|
|
|
|
return EINA_FALSE;
|
2014-02-10 05:09:45 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_sticky_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool sticky)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-01-10 03:53:39 -08:00
|
|
|
// sd->sticky = sticky;
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, sticky_set, sticky);
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_xwin_update(sd);
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2009-04-03 14:52:01 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_sticky_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2008-11-18 02:11:57 -08:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->sticky;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_keyboard_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Elm_Win_Keyboard_Mode mode)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
if (mode == sd->kbdmode) return;
|
2010-04-12 01:27:10 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2014-03-27 06:15:52 -07:00
|
|
|
_internal_elm_win_xwindow_get(sd);
|
2010-04-12 01:27:10 -07:00
|
|
|
#endif
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->kbdmode = mode;
|
2009-07-06 23:46:51 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2012-06-06 01:25:12 -07:00
|
|
|
if (sd->x.xwin)
|
2008-11-18 02:11:57 -08:00
|
|
|
ecore_x_e_virtual_keyboard_state_set
|
2012-06-06 01:25:12 -07:00
|
|
|
(sd->x.xwin, (Ecore_X_Virtual_Keyboard_State)sd->kbdmode);
|
2009-07-06 23:46:51 -07:00
|
|
|
#endif
|
2008-11-18 02:11:57 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Elm_Win_Keyboard_Mode
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_keyboard_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2008-11-18 02:11:57 -08:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->kbdmode;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2018-04-26 04:24:09 -07:00
|
|
|
_efl_ui_win_indicator_mode_set(Eo *obj, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Indicator_Mode mode)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-12-11 17:02:23 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
|
|
|
if (sd->indimode == mode) return;
|
|
|
|
sd->indimode = mode;
|
2012-03-07 06:27:36 -08:00
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->indimode == EFL_UI_WIN_INDICATOR_OFF)
|
|
|
|
{
|
|
|
|
_indicator_del(sd);
|
|
|
|
return;
|
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
if (!sd->indicator) _indicator_add(sd);
|
|
|
|
|
2018-04-26 04:24:09 -07:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
{
|
|
|
|
if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_OPAQUE)
|
|
|
|
edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,bg_opaque", "elm");
|
|
|
|
else if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_TRANSPARENT)
|
|
|
|
edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,bg_transparent", "elm");
|
|
|
|
else if (sd->indimode == EFL_UI_WIN_INDICATOR_HIDDEN)
|
|
|
|
edje_object_signal_emit(sd->frame_obj, "elm,action,indicator,hidden", "elm");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_OPAQUE)
|
|
|
|
edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,bg_opaque", "efl");
|
|
|
|
else if (sd->indimode == EFL_UI_WIN_INDICATOR_BG_TRANSPARENT)
|
|
|
|
edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,bg_transparent", "efl");
|
|
|
|
else if (sd->indimode == EFL_UI_WIN_INDICATOR_HIDDEN)
|
|
|
|
edje_object_signal_emit(sd->frame_obj, "efl,action,indicator,hidden", "efl");
|
|
|
|
}
|
2017-12-11 17:02:23 -08:00
|
|
|
|
|
|
|
edje_object_message_signal_process(sd->frame_obj);
|
|
|
|
evas_object_smart_calculate(sd->frame_obj);
|
2018-04-17 11:55:35 -07:00
|
|
|
_elm_win_frame_obj_update(sd, 0);
|
2016-05-19 01:49:40 -07:00
|
|
|
}
|
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
EOLIAN static Efl_Ui_Win_Indicator_Mode
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_indicator_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
|
2016-05-19 01:49:40 -07:00
|
|
|
{
|
2017-12-11 17:02:23 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
|
|
|
return sd->indimode;
|
2016-05-19 01:49:40 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_ui_focus_object_focus_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2011-12-03 14:51:12 -08:00
|
|
|
{
|
2017-08-30 23:15:58 -07:00
|
|
|
// Bypass widget implementation here.
|
2014-03-27 06:15:52 -07:00
|
|
|
return ecore_evas_focus_get(sd->ee);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_screen_constrain_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool constrain)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->constrain = !!constrain;
|
2011-12-03 14:51:12 -08:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_screen_constrain_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2011-12-03 14:51:12 -08:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->constrain;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2017-09-18 05:08:28 -07:00
|
|
|
EOLIAN static Eina_Size2D
|
2019-02-21 09:19:33 -08:00
|
|
|
_efl_ui_win_efl_screen_screen_size_in_pixels_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-05-31 23:47:31 -07:00
|
|
|
{
|
2017-09-18 05:08:28 -07:00
|
|
|
Eina_Size2D sz;
|
|
|
|
ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &sz.w, &sz.h);
|
|
|
|
return sz;
|
2016-05-31 23:47:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_screen_screen_dpi_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *xdpi, int *ydpi)
|
2012-07-05 05:59:06 -07:00
|
|
|
{
|
|
|
|
ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
|
|
|
|
}
|
|
|
|
|
2016-05-31 23:47:31 -07:00
|
|
|
EOLIAN static int
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_screen_screen_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-05-31 23:47:31 -07:00
|
|
|
{
|
|
|
|
//TODO: query to wm about device's rotation
|
|
|
|
(void)sd;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2016-06-07 07:41:48 -07:00
|
|
|
_efl_ui_win_prop_focus_skip_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool skip)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->skip_focus = skip;
|
2012-07-18 21:35:50 -07:00
|
|
|
TRAP(sd, focus_skip_set, skip);
|
2011-02-17 02:56:32 -08:00
|
|
|
}
|
|
|
|
|
2015-05-13 04:57:36 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2017-05-15 19:16:28 -07:00
|
|
|
_efl_ui_win_keygrab_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key,
|
|
|
|
Efl_Input_Modifier modifiers EINA_UNUSED,
|
|
|
|
Efl_Input_Modifier not_modifiers EINA_UNUSED,
|
|
|
|
int priority EINA_UNUSED, Efl_Ui_Win_Keygrab_Mode grab_mode)
|
2015-05-13 04:57:36 -07:00
|
|
|
{
|
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
2015-06-11 19:16:25 -07:00
|
|
|
Ecore_X_Win_Keygrab_Mode x_grab_mode;
|
|
|
|
switch (grab_mode)
|
|
|
|
{
|
|
|
|
case ELM_WIN_KEYGRAB_SHARED:
|
|
|
|
x_grab_mode = ECORE_X_WIN_KEYGRAB_SHARED;
|
|
|
|
break;
|
|
|
|
case ELM_WIN_KEYGRAB_TOPMOST:
|
|
|
|
x_grab_mode = ECORE_X_WIN_KEYGRAB_TOPMOST;
|
|
|
|
break;
|
|
|
|
case ELM_WIN_KEYGRAB_EXCLUSIVE:
|
|
|
|
x_grab_mode = ECORE_X_WIN_KEYGRAB_EXCLUSIVE;
|
|
|
|
break;
|
|
|
|
case ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE:
|
|
|
|
x_grab_mode = ECORE_X_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
ret = ecore_x_window_keygrab_set(sd->x.xwin, key, 0, 0, 0, x_grab_mode);
|
2015-05-13 04:57:36 -07:00
|
|
|
}
|
2016-05-15 06:41:12 -07:00
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)key;
|
|
|
|
(void)grab_mode;
|
2015-05-13 04:57:36 -07:00
|
|
|
#endif
|
2015-06-11 19:16:25 -07:00
|
|
|
return ret;
|
2015-05-13 04:57:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2017-05-15 19:16:28 -07:00
|
|
|
_efl_ui_win_keygrab_unset(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *key,
|
|
|
|
Efl_Input_Modifier modifiers EINA_UNUSED,
|
|
|
|
Efl_Input_Modifier not_modifiers EINA_UNUSED)
|
2015-05-13 04:57:36 -07:00
|
|
|
{
|
|
|
|
Eina_Bool ret = EINA_FALSE;
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
ret = ecore_x_window_keygrab_unset(sd->x.xwin, key, 0, 0);
|
2016-05-15 06:41:12 -07:00
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)key;
|
2015-05-13 04:57:36 -07:00
|
|
|
#endif
|
2015-06-11 19:16:25 -07:00
|
|
|
return ret;
|
2015-05-13 04:57:36 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2019-02-27 11:00:39 -08:00
|
|
|
_efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
enabled = !!enabled;
|
2012-05-03 15:42:15 -07:00
|
|
|
if (sd->focus_highlight.enabled == enabled)
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
return;
|
|
|
|
|
2012-05-03 15:42:15 -07:00
|
|
|
sd->focus_highlight.enabled = enabled;
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
|
2015-03-04 00:47:54 -08:00
|
|
|
if ((sd->focus_highlight.enabled) || (sd->focus_highlight.auto_enabled))
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_init(sd);
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
else
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_shutdown(sd);
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2019-02-27 11:00:39 -08:00
|
|
|
_efl_ui_win_focus_highlight_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->focus_highlight.enabled;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
Begins highlight on focused object.
There's still work to do here, particularly in the theme, but it has
something nice and fun to see the code working.
The idea behind this:
Window tracks focused object and sends the highlight object(s) to it. These
are simple edje objects, one on top, one below the focused widget for nice
effects. Widgets can choose to ignore the highlight and this will be sent to
the parent object, if it doesn't ignore it as well.
About the bottom object, it doesn't work now. For the most part, focused
widget will always be a member of some smart object, so stacking won't work
and the desired effect is nowhere to be seen. This will be worked out later.
To be done now:
- Let the theme for a widget define its own highlight, disabling if needed
the standard one for those objects.
- Needed base in code to allow animations when switching focus. All in theme.
- Properly test all widgets and fix some things that will most likely work
in weird ways, given the nature of Evas/Edje and how Elementary makes use
of them.
- Forgot the rest, stay tuned, test, report, give ideas, plant a tree.
Work started by glima, continued with some refactors by me when he
decided he needed vacations.
SVN revision: 52524
2010-09-20 15:18:58 -07:00
|
|
|
|
2018-11-19 20:56:37 -08:00
|
|
|
static Efl_Ui_Theme_Apply_Result
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd)
|
2014-12-15 08:45:59 -08:00
|
|
|
{
|
2018-11-19 20:56:37 -08:00
|
|
|
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
|
2019-02-27 11:00:14 -08:00
|
|
|
Eina_Bool prev_alpha;
|
2014-12-15 08:57:24 -08:00
|
|
|
const char *s;
|
2014-12-15 08:45:59 -08:00
|
|
|
|
2017-11-17 00:24:39 -08:00
|
|
|
int_ret = elm_widget_theme_object_set(obj, sd->legacy.edje, "win", "base",
|
2017-11-14 02:59:42 -08:00
|
|
|
elm_widget_style_get(obj));
|
2018-11-19 20:56:37 -08:00
|
|
|
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
|
2014-12-15 08:45:59 -08:00
|
|
|
|
2017-06-13 03:41:15 -07:00
|
|
|
edje_object_mirrored_set(sd->legacy.edje, efl_ui_mirrored_get(obj));
|
2016-11-17 00:46:14 -08:00
|
|
|
edje_object_scale_set(sd->legacy.edje,
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_scale_get(obj) * elm_config_scale_get());
|
2014-12-15 08:45:59 -08:00
|
|
|
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_THEME_CHANGED, NULL);
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
|
2016-11-22 02:52:25 -08:00
|
|
|
prev_alpha = sd->theme_alpha;
|
2016-11-17 00:46:14 -08:00
|
|
|
s = edje_object_data_get(sd->legacy.edje, "alpha");
|
2016-11-22 02:52:25 -08:00
|
|
|
sd->theme_alpha = (eina_streq(s, "1") || eina_streq(s, "true"));
|
|
|
|
if (sd->theme_alpha != prev_alpha)
|
|
|
|
_elm_win_apply_alpha(obj, sd);
|
2014-12-15 08:57:24 -08:00
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
return int_ret;
|
2014-12-15 08:45:59 -08:00
|
|
|
}
|
|
|
|
|
2018-11-19 20:56:37 -08:00
|
|
|
EOLIAN static Efl_Ui_Theme_Apply_Result
|
2018-01-07 20:55:35 -08:00
|
|
|
_efl_ui_win_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd)
|
2013-10-03 07:57:08 -07:00
|
|
|
{
|
2018-11-19 20:56:37 -08:00
|
|
|
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
|
2017-10-23 22:03:46 -07:00
|
|
|
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
|
2018-11-19 20:56:37 -08:00
|
|
|
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
|
2013-10-11 05:52:15 -07:00
|
|
|
|
2013-10-03 07:57:08 -07:00
|
|
|
sd->focus_highlight.theme_changed = EINA_TRUE;
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
|
|
|
|
int_ret = _elm_win_theme_internal(obj, sd) & int_ret;
|
2018-11-19 20:56:37 -08:00
|
|
|
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
|
2013-10-03 07:57:08 -07:00
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
2013-10-11 05:52:15 -07:00
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
return int_ret;
|
2013-10-03 07:57:08 -07:00
|
|
|
}
|
|
|
|
|
2017-08-30 23:42:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2019-02-27 11:00:39 -08:00
|
|
|
_efl_ui_win_focus_highlight_style_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *style)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-08-30 23:42:52 -07:00
|
|
|
if (!eina_stringshare_replace(&sd->focus_highlight.style, style))
|
|
|
|
return EINA_TRUE;
|
|
|
|
|
2013-08-04 01:09:44 -07:00
|
|
|
sd->focus_highlight.theme_changed = EINA_TRUE;
|
2012-05-03 15:42:15 -07:00
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
2017-08-30 23:42:52 -07:00
|
|
|
return EINA_TRUE;
|
2010-10-04 10:34:35 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static const char*
|
2019-02-27 11:00:39 -08:00
|
|
|
_efl_ui_win_focus_highlight_style_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2010-10-04 10:34:35 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->focus_highlight.style;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-05-03 15:42:15 -07:00
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2019-02-27 11:00:39 -08:00
|
|
|
_efl_ui_win_focus_highlight_animate_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool animate)
|
2013-08-11 02:58:28 -07:00
|
|
|
{
|
|
|
|
animate = !!animate;
|
|
|
|
if (sd->focus_highlight.animate == animate)
|
|
|
|
return;
|
|
|
|
|
|
|
|
sd->focus_highlight.animate = animate;
|
2013-08-15 06:42:59 -07:00
|
|
|
sd->focus_highlight.theme_changed = EINA_TRUE;
|
|
|
|
_elm_win_focus_highlight_reconfigure_job_start(sd);
|
2013-08-11 02:58:28 -07:00
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2019-02-27 11:00:39 -08:00
|
|
|
_efl_ui_win_focus_highlight_animate_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2013-08-11 02:58:28 -07:00
|
|
|
{
|
2014-03-27 06:15:52 -07:00
|
|
|
return sd->focus_highlight.animate;
|
2013-08-11 02:58:28 -07:00
|
|
|
}
|
|
|
|
|
2016-12-08 00:49:23 -08:00
|
|
|
EOLIAN static const char *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_stack_id_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-12-08 00:49:23 -08:00
|
|
|
{
|
|
|
|
return sd->stack_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_win_stack_master_id_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *id)
|
|
|
|
{
|
|
|
|
if (sd->shown) return;
|
|
|
|
eina_stringshare_replace(&(sd->stack_master_id), id);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2016-12-21 22:11:02 -08:00
|
|
|
if (sd->x.xwin) _elm_win_xwin_update(sd);
|
2017-08-04 13:08:42 -07:00
|
|
|
else
|
2016-12-08 00:49:23 -08:00
|
|
|
#endif
|
2017-08-04 13:08:42 -07:00
|
|
|
{
|
|
|
|
int num = ecore_evas_aux_hint_id_get(sd->ee, "stack_master_id");
|
|
|
|
if (num >= 0)
|
|
|
|
ecore_evas_aux_hint_val_set(sd->ee, num, id);
|
|
|
|
else
|
|
|
|
ecore_evas_aux_hint_add(sd->ee, "stack_master_id", id);
|
|
|
|
}
|
2016-12-08 00:49:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char *
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_stack_master_id_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-12-08 00:49:23 -08:00
|
|
|
{
|
|
|
|
return sd->stack_master_id;
|
|
|
|
}
|
|
|
|
|
2016-12-18 22:39:36 -08:00
|
|
|
EOLIAN static void
|
2016-12-19 23:07:50 -08:00
|
|
|
_efl_ui_win_stack_base_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool base)
|
2016-12-18 22:39:36 -08:00
|
|
|
{
|
2017-08-04 13:08:42 -07:00
|
|
|
int num;
|
2016-12-18 22:39:36 -08:00
|
|
|
if (sd->shown) return;
|
|
|
|
sd->stack_base = !!base;
|
2017-08-04 13:08:42 -07:00
|
|
|
num = ecore_evas_aux_hint_id_get(sd->ee, "stack_base");
|
|
|
|
if (num >= 0)
|
|
|
|
ecore_evas_aux_hint_val_set(sd->ee, num, sd->stack_base ? "1" : "0");
|
|
|
|
else
|
|
|
|
ecore_evas_aux_hint_add(sd->ee, "stack_base", sd->stack_base ? "1" : "0");
|
2016-12-18 22:39:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_stack_base_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
2016-12-18 22:39:36 -08:00
|
|
|
{
|
|
|
|
return sd->stack_base;
|
|
|
|
}
|
|
|
|
|
2016-12-21 22:11:02 -08:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
// list transient from bottom to top by recursive walking
|
|
|
|
static void
|
|
|
|
_x_transients_for_list(Ecore_X_Window base, Ecore_X_Window transient,
|
|
|
|
Ecore_X_Window **wins, int *num)
|
|
|
|
{
|
|
|
|
Ecore_X_Window t, *children, *w;
|
|
|
|
int n, i;
|
|
|
|
|
|
|
|
children = ecore_x_window_children_get(base, &n);
|
|
|
|
if (children)
|
|
|
|
{
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
{
|
|
|
|
if (children[i] != transient)
|
|
|
|
{
|
|
|
|
t = ecore_x_icccm_transient_for_get(children[i]);
|
|
|
|
if (t == transient)
|
|
|
|
{
|
|
|
|
(*num)++;
|
|
|
|
w = realloc(*wins, *num * sizeof(Ecore_X_Window));
|
|
|
|
if (w)
|
|
|
|
{
|
|
|
|
*wins = w;
|
|
|
|
(*wins)[*num - 1] = children[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_x_transients_for_list(children[i], transient, wins, num);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(children);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-12-08 00:49:23 -08:00
|
|
|
EOLIAN static void
|
2016-12-21 22:11:02 -08:00
|
|
|
_efl_ui_win_stack_pop_to(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
if (!sd->stack_master_id) return;
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
Ecore_X_Window *wins = NULL;
|
|
|
|
int i, num = 0;
|
|
|
|
Eina_Bool del = EINA_FALSE;
|
|
|
|
|
|
|
|
ecore_x_grab();
|
|
|
|
_x_transients_for_list
|
|
|
|
(ecore_x_window_root_get(sd->x.xwin),
|
|
|
|
ecore_x_icccm_transient_for_get(sd->x.xwin),
|
|
|
|
&wins, &num);
|
|
|
|
if (wins)
|
|
|
|
{
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
if (del) ecore_x_window_delete_request_send(wins[i]);
|
|
|
|
if (wins[i] == sd->x.xwin) del = EINA_TRUE;
|
|
|
|
}
|
|
|
|
free(wins);
|
|
|
|
}
|
|
|
|
ecore_x_ungrab();
|
|
|
|
}
|
2017-08-04 13:08:42 -07:00
|
|
|
else
|
2016-12-21 22:11:02 -08:00
|
|
|
#endif
|
2017-08-04 13:08:42 -07:00
|
|
|
{
|
|
|
|
int num = ecore_evas_aux_hint_id_get(sd->ee, "stack_pop_to");
|
|
|
|
if (num >= 0) ecore_evas_aux_hint_val_set(sd->ee, num, "1");
|
|
|
|
else ecore_evas_aux_hint_add(sd->ee, "stack_pop_to", "1");
|
|
|
|
}
|
2016-12-08 00:49:23 -08:00
|
|
|
// win32/osx ?
|
|
|
|
}
|
|
|
|
|
2012-07-18 21:35:50 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_trap_set(const Elm_Win_Trap *t)
|
|
|
|
{
|
|
|
|
DBG("old %p, new %p", trap, t);
|
|
|
|
|
|
|
|
if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
|
|
|
|
{
|
2013-12-25 20:03:55 -08:00
|
|
|
CRI("trying to set a trap version %lu while %lu was expected!",
|
2012-07-18 21:35:50 -07:00
|
|
|
t->version, ELM_WIN_TRAP_VERSION);
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
trap = t;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2012-09-14 06:06:57 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_floating_mode_set(Evas_Object *obj, Eina_Bool floating)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2012-09-14 06:06:57 -07:00
|
|
|
|
2013-12-25 21:23:29 -08:00
|
|
|
floating = !!floating;
|
2012-09-14 06:06:57 -07:00
|
|
|
if (floating == sd->floating) return;
|
|
|
|
sd->floating = floating;
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2014-03-27 06:15:52 -07:00
|
|
|
_internal_elm_win_xwindow_get(sd);
|
2012-09-14 06:06:57 -07:00
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
if (sd->floating)
|
|
|
|
ecore_x_e_illume_window_state_set
|
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_FLOATING);
|
|
|
|
else
|
|
|
|
ecore_x_e_illume_window_state_set
|
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_WINDOW_STATE_NORMAL);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_floating_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2012-09-14 06:06:57 -07:00
|
|
|
|
|
|
|
return sd->floating;
|
|
|
|
}
|
|
|
|
|
2014-05-11 09:04:25 -07:00
|
|
|
void
|
|
|
|
_elm_win_focus_highlight_in_theme_update(Evas_Object *obj, Eina_Bool in_theme)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
sd->focus_highlight.cur.in_theme = !!in_theme;
|
|
|
|
}
|
|
|
|
|
2014-02-18 06:40:48 -08:00
|
|
|
void
|
|
|
|
_elm_win_focus_highlight_start(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
|
2015-08-04 23:57:11 -07:00
|
|
|
if (!(sd->focus_highlight.enabled) && !(sd->focus_highlight.auto_enabled)) return;
|
2014-02-18 06:40:48 -08:00
|
|
|
sd->focus_highlight.cur.visible = EINA_TRUE;
|
|
|
|
sd->focus_highlight.geometry_changed = EINA_TRUE;
|
2014-03-07 03:34:37 -08:00
|
|
|
_elm_win_focus_highlight_reconfigure_job(obj);
|
2014-02-18 06:40:48 -08:00
|
|
|
}
|
|
|
|
|
2015-03-04 00:47:54 -08:00
|
|
|
void
|
|
|
|
_elm_win_focus_auto_show(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
Eina_Bool pfocus = (sd->focus_highlight.enabled) || (sd->focus_highlight.auto_enabled);
|
|
|
|
sd->focus_highlight.auto_enabled = _elm_config->win_auto_focus_enable;
|
|
|
|
sd->focus_highlight.auto_animate = _elm_config->win_auto_focus_animate;
|
|
|
|
if (pfocus != ((sd->focus_highlight.enabled) || (sd->focus_highlight.auto_enabled)))
|
|
|
|
{
|
|
|
|
if ((sd->focus_highlight.enabled) || (sd->focus_highlight.auto_enabled))
|
|
|
|
_elm_win_focus_highlight_init(sd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_elm_win_focus_auto_hide(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
ELM_WIN_DATA_GET(obj, sd);
|
|
|
|
Eina_Bool pfocus = (sd->focus_highlight.enabled) || (sd->focus_highlight.auto_enabled);
|
|
|
|
sd->focus_highlight.auto_enabled = EINA_FALSE;
|
|
|
|
sd->focus_highlight.auto_animate = EINA_FALSE;
|
|
|
|
if (pfocus != ((sd->focus_highlight.enabled) || (sd->focus_highlight.auto_enabled)))
|
|
|
|
{
|
|
|
|
if (!((sd->focus_highlight.enabled) || (sd->focus_highlight.auto_enabled)))
|
|
|
|
_elm_win_focus_highlight_shutdown(sd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_on_atspi_bus_connected(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
2015-06-29 07:30:34 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(_elm_win_list, l, win)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Reemit accessibility events when AT-SPI2 connection is begin
|
|
|
|
* established. This assures that Assistive Technology clients will
|
2015-10-28 10:06:29 -07:00
|
|
|
* receive all org.a11y.window events and could keep track of active
|
2015-06-29 07:30:34 -07:00
|
|
|
* windows whithin system.
|
|
|
|
*/
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_created_signal_emit(win);
|
2015-06-29 07:30:34 -07:00
|
|
|
if (elm_win_focus_get(win))
|
2015-09-03 05:07:23 -07:00
|
|
|
{
|
2017-09-26 16:07:20 -07:00
|
|
|
Evas_Object *target;
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_activated_signal_emit(win);
|
2015-10-28 09:02:01 -07:00
|
|
|
/** Reemit focused event to inform atspi clients about currently
|
|
|
|
* focused object **/
|
2017-09-26 16:07:20 -07:00
|
|
|
{
|
|
|
|
Efl_Ui_Focus_Manager *m;
|
|
|
|
|
|
|
|
m = win;
|
|
|
|
|
|
|
|
while (efl_ui_focus_manager_redirect_get(m))
|
|
|
|
m = efl_ui_focus_manager_redirect_get(m);
|
|
|
|
|
|
|
|
target = efl_ui_focus_manager_focus_get(m);
|
|
|
|
}
|
2015-10-28 09:02:01 -07:00
|
|
|
if (target)
|
2017-10-18 18:13:54 -07:00
|
|
|
efl_access_state_changed_signal_emit(target, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE);
|
2015-09-03 05:07:23 -07:00
|
|
|
}
|
2015-06-29 07:30:34 -07:00
|
|
|
else
|
2017-09-11 23:48:10 -07:00
|
|
|
efl_access_window_deactivated_signal_emit(win);
|
2015-06-29 07:30:34 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:15:52 -07:00
|
|
|
EOLIAN static void
|
2018-01-23 22:50:58 -08:00
|
|
|
_efl_ui_win_class_constructor(Efl_Class *klass EINA_UNUSED)
|
2014-03-27 06:15:52 -07:00
|
|
|
{
|
2015-06-29 07:30:34 -07:00
|
|
|
if (_elm_config->atspi_mode)
|
|
|
|
{
|
|
|
|
Eo *bridge = _elm_atspi_bridge_get();
|
|
|
|
if (bridge)
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(bridge, ELM_ATSPI_BRIDGE_EVENT_CONNECTED, _on_atspi_bus_connected, NULL);
|
2015-06-29 07:30:34 -07:00
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2017-10-12 18:54:54 -07:00
|
|
|
EOLIAN static void
|
2017-07-20 23:24:08 -07:00
|
|
|
_efl_ui_win_efl_object_debug_name_override(Eo *obj, Efl_Ui_Win_Data *pd, Eina_Strbuf *sb)
|
2017-07-14 00:55:10 -07:00
|
|
|
{
|
2017-10-12 18:54:54 -07:00
|
|
|
efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
|
2017-07-20 23:24:08 -07:00
|
|
|
eina_strbuf_append_printf(sb, ":'%s':'%s'", pd->name, pd->title);
|
2017-07-14 00:55:10 -07:00
|
|
|
}
|
|
|
|
|
2017-11-15 18:55:06 -08:00
|
|
|
EOLIAN static const Efl_Access_Action_Data*
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
|
2014-07-25 01:33:19 -07:00
|
|
|
{
|
2017-11-15 18:55:06 -08:00
|
|
|
static Efl_Access_Action_Data atspi_actions[] = {
|
2014-07-25 01:33:19 -07:00
|
|
|
{ "move,previous", "move", "previous", _key_action_move},
|
|
|
|
{ "move,next", "move", "next", _key_action_move},
|
|
|
|
{ "move,left", "move", "left", _key_action_move},
|
|
|
|
{ "move,right", "move", "right", _key_action_move},
|
|
|
|
{ "move,up", "move", "up", _key_action_move},
|
|
|
|
{ "move,down", "move", "down", _key_action_move},
|
|
|
|
{ NULL, NULL, NULL, NULL }
|
|
|
|
};
|
|
|
|
return &atspi_actions[0];
|
|
|
|
}
|
|
|
|
|
2017-10-18 18:13:54 -07:00
|
|
|
EOLIAN static Efl_Access_State_Set
|
2018-04-03 04:27:30 -07:00
|
|
|
_efl_ui_win_efl_access_object_state_set_get(const Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
|
2015-05-13 06:37:47 -07:00
|
|
|
{
|
2017-10-18 18:13:54 -07:00
|
|
|
Efl_Access_State_Set ret;
|
2018-04-03 04:27:30 -07:00
|
|
|
ret = efl_access_object_state_set_get(efl_super(obj, MY_CLASS));
|
2015-05-13 06:37:47 -07:00
|
|
|
|
|
|
|
if (elm_win_focus_get(obj))
|
2017-10-18 18:13:54 -07:00
|
|
|
STATE_TYPE_SET(ret, EFL_ACCESS_STATE_ACTIVE);
|
2015-05-13 06:37:47 -07:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-11-09 17:58:41 -08:00
|
|
|
EOLIAN static const char*
|
2018-04-03 04:27:30 -07:00
|
|
|
_efl_ui_win_efl_access_object_i18n_name_get(const Eo *obj, Efl_Ui_Win_Data *sd EINA_UNUSED)
|
2015-07-02 04:53:02 -07:00
|
|
|
{
|
2016-11-09 17:58:41 -08:00
|
|
|
const char *ret;
|
2018-04-03 04:27:30 -07:00
|
|
|
ret = efl_access_object_i18n_name_get(efl_super(obj, EFL_UI_WIN_CLASS));
|
2015-12-17 00:36:02 -08:00
|
|
|
if (ret) return ret;
|
|
|
|
const char *name = elm_win_title_get(obj);
|
2016-11-09 17:58:41 -08:00
|
|
|
return name;
|
2015-07-02 04:53:02 -07:00
|
|
|
}
|
|
|
|
|
2017-09-13 19:59:44 -07:00
|
|
|
EOLIAN static Eina_Rect
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_access_component_extents_get(const Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED, Eina_Bool screen_coords)
|
2017-04-06 21:17:58 -07:00
|
|
|
{
|
2017-09-13 19:59:44 -07:00
|
|
|
Eina_Rect r;
|
2017-04-06 21:17:58 -07:00
|
|
|
int ee_x, ee_y;
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
r = efl_gfx_entity_geometry_get(obj);
|
2017-09-13 01:32:35 -07:00
|
|
|
r.x = r.y = 0;
|
2017-04-06 21:17:58 -07:00
|
|
|
if (screen_coords)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
|
2017-09-13 01:32:35 -07:00
|
|
|
if (ee)
|
|
|
|
{
|
|
|
|
ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
|
|
|
|
r.x += ee_x;
|
|
|
|
r.y += ee_y;
|
|
|
|
}
|
2017-04-06 21:17:58 -07:00
|
|
|
}
|
2017-09-13 01:32:35 -07:00
|
|
|
return r;
|
2017-04-06 21:17:58 -07:00
|
|
|
}
|
|
|
|
|
2016-05-29 23:34:31 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_input_state_modifier_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
|
2017-05-16 01:41:09 -07:00
|
|
|
Efl_Input_Modifier mod, const Efl_Input_Device *seat)
|
2016-05-29 23:34:31 -07:00
|
|
|
{
|
|
|
|
const Evas_Modifier *m = evas_key_modifier_get(pd->evas);
|
2017-05-16 00:48:58 -07:00
|
|
|
const char *name = _efl_input_modifier_to_string(mod);
|
2017-05-16 01:41:09 -07:00
|
|
|
return evas_seat_key_modifier_is_set(m, name, seat);
|
2016-05-29 23:34:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_efl_input_state_lock_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
|
2017-05-16 01:41:09 -07:00
|
|
|
Efl_Input_Lock lock, const Efl_Input_Device *seat)
|
2016-05-29 23:34:31 -07:00
|
|
|
{
|
|
|
|
const Evas_Lock *m = evas_key_lock_get(pd->evas);
|
2017-05-16 00:48:58 -07:00
|
|
|
const char *name = _efl_input_lock_to_string(lock);
|
2017-05-16 01:41:09 -07:00
|
|
|
return evas_seat_key_lock_is_set(m, name, seat);
|
2016-05-29 23:34:31 -07:00
|
|
|
}
|
|
|
|
|
2017-07-27 23:01:31 -07:00
|
|
|
EOLIAN static Efl_Object *
|
2018-01-04 11:41:49 -08:00
|
|
|
_efl_ui_win_efl_object_provider_find(const Eo *obj,
|
|
|
|
Efl_Ui_Win_Data *pd EINA_UNUSED,
|
2017-07-27 23:01:31 -07:00
|
|
|
const Efl_Object *klass)
|
|
|
|
{
|
|
|
|
if (klass == EFL_UI_WIN_CLASS)
|
2018-01-06 01:58:13 -08:00
|
|
|
return (Eo *)obj;
|
2017-10-12 12:25:49 -07:00
|
|
|
|
2018-02-14 18:14:52 -08:00
|
|
|
// attach all kinds of windows directly to ATSPI application root object
|
2019-02-09 09:45:27 -08:00
|
|
|
if (klass == EFL_ACCESS_OBJECT_MIXIN) return efl_access_object_access_root_get();
|
2018-02-14 18:14:52 -08:00
|
|
|
|
2017-10-12 12:25:49 -07:00
|
|
|
if (klass == EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE)
|
|
|
|
return pd->provider;
|
|
|
|
|
2017-07-27 23:01:31 -07:00
|
|
|
return efl_provider_find(efl_super(obj, MY_CLASS), klass);
|
|
|
|
}
|
|
|
|
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
// See evas_inline.x
|
|
|
|
#define _EVAS_COLOR_CLAMP(x, y) do { \
|
|
|
|
if (x > y) { x = y; bad = 1; } \
|
|
|
|
if (x < 0) { x = 0; bad = 1; } } while (0)
|
|
|
|
|
|
|
|
#define EVAS_COLOR_SANITIZE(r, g, b, a) \
|
|
|
|
({ int bad = 0; \
|
|
|
|
_EVAS_COLOR_CLAMP(a, 255); \
|
|
|
|
_EVAS_COLOR_CLAMP(r, a); \
|
|
|
|
_EVAS_COLOR_CLAMP(g, a); \
|
|
|
|
_EVAS_COLOR_CLAMP(b, a); \
|
|
|
|
bad; })
|
|
|
|
|
|
|
|
/* Efl.Part APIs */
|
|
|
|
|
2017-06-29 04:02:59 -07:00
|
|
|
#define WIN_PART_ERR(part) ERR("No such part in window: '%s'. Supported parts are: 'content' and 'background'.", part);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
static Eina_Bool
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_bg_set(Efl_Ui_Win_Data *sd, Eo *bg)
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
{
|
|
|
|
ELM_SAFE_DEL(sd->bg);
|
2016-11-17 00:46:14 -08:00
|
|
|
if (!bg) return EINA_TRUE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
if (!elm_widget_sub_object_add(sd->obj, bg))
|
|
|
|
return EINA_FALSE;
|
2018-04-26 03:27:43 -07:00
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
{
|
2018-11-29 11:09:09 -08:00
|
|
|
if (!_elm_config->win_no_border)
|
|
|
|
{
|
|
|
|
if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.background", bg))
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!edje_object_part_swallow(sd->legacy.edje, "elm.swallow.background", bg))
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
2018-04-26 03:27:43 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-11-29 11:09:09 -08:00
|
|
|
if (!_elm_config->win_no_border)
|
|
|
|
{
|
|
|
|
if (!edje_object_part_swallow(sd->frame_obj, "efl.background", bg))
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!edje_object_part_swallow(sd->legacy.edje, "efl.background", bg))
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
2018-04-26 03:27:43 -07:00
|
|
|
}
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(bg, 1);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_fill_set(bg, EINA_TRUE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bg, 1, 1);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
efl_wref_add(bg, &sd->bg);
|
2016-11-17 00:46:14 -08:00
|
|
|
return EINA_TRUE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
}
|
|
|
|
|
2016-11-22 00:34:17 -08:00
|
|
|
/* Legacy theme compatibility */
|
|
|
|
static Eina_Bool
|
|
|
|
_elm_win_bg_must_swallow(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
if (EINA_UNLIKELY(!sd->legacy.bg_must_swallow_init))
|
|
|
|
{
|
|
|
|
/* Overkill: check which theme version the standard elm_bg uses */
|
|
|
|
Elm_Widget_Smart_Data *wd;
|
|
|
|
const char *version;
|
|
|
|
Eo *bg;
|
|
|
|
int v;
|
|
|
|
|
|
|
|
sd->legacy.bg_must_swallow = 1;
|
|
|
|
sd->legacy.bg_must_swallow_init = 1;
|
|
|
|
|
2018-11-08 20:59:05 -08:00
|
|
|
if (sd->legacy.ctor)
|
|
|
|
bg = elm_bg_add(sd->obj);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Note: This code path is probably not necessary (custom legacy
|
|
|
|
// theme but efl_add'ed window -- all efl_add'ed widgets would
|
|
|
|
// use default theme)
|
efl_ui_bg: remove Efl.Ui.Bg interface and rename Efl.Ui.Bg_Widget class
Summary:
Efl.Ui.Bg interface does not have any new property or method.
Moreover, Efl.Ui.Bg interface is not used by widgets except
Efl.Ui.Bg_Widget and Efl.Ui.Widget_Part_Bg.
Consequently, Efl.Ui.Bg interface can be replaced by other interfaces.
Due to Efl.Ui.Bg interface, the bg widget class name becomes
Efl.UI.Bg_Widget which is not synchronized with other widget names.
Therefore, to keep consistency with other widgets, it would be better to
remove Efl.Ui.Bg interface and rename Efl.Ui.Bg_Widget to Efl.Ui.Bg.
Reviewers: woohyun, segfaultxavi, bu5hm4n, zmike
Reviewed By: segfaultxavi
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7304
2018-11-19 17:24:05 -08:00
|
|
|
bg = efl_add(EFL_UI_BG_CLASS, sd->obj);
|
2018-11-08 20:59:05 -08:00
|
|
|
}
|
2018-01-07 20:55:35 -08:00
|
|
|
wd = efl_data_scope_get(bg, EFL_UI_WIDGET_CLASS);
|
2016-11-22 00:34:17 -08:00
|
|
|
if (wd)
|
|
|
|
{
|
2016-12-07 02:27:05 -08:00
|
|
|
version = edje_object_data_get(wd->resize_obj, "version");
|
2016-11-22 00:34:17 -08:00
|
|
|
v = version ? atoi(version) : 0;
|
2016-12-07 02:27:05 -08:00
|
|
|
if (v >= FRAME_OBJ_THEME_MIN_VERSION)
|
|
|
|
sd->legacy.bg_must_swallow = 0;
|
2016-11-22 00:34:17 -08:00
|
|
|
}
|
|
|
|
evas_object_del(bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
return sd->legacy.bg_must_swallow;
|
|
|
|
}
|
|
|
|
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
void
|
|
|
|
_elm_win_standard_init(Eo *obj)
|
|
|
|
{
|
|
|
|
/* Support for elm_util_win_standard_add() and Efl.Ui.Win.Standard */
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_get(obj, MY_CLASS);
|
|
|
|
|
|
|
|
ELM_SAFE_DEL(sd->bg);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
|
2016-11-29 22:06:09 -08:00
|
|
|
sd->csd.need_bg_standard = 1;
|
2016-11-22 00:34:17 -08:00
|
|
|
if (!_elm_win_bg_must_swallow(sd))
|
|
|
|
{
|
|
|
|
sd->csd.need_bg_solid = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-01-16 21:12:34 -08:00
|
|
|
Eo *bg;
|
|
|
|
|
2016-11-22 00:34:17 -08:00
|
|
|
/* Legacy theme compatibility */
|
|
|
|
DBG("Detected legacy theme used for elm_bg. Swallowing object.");
|
|
|
|
sd->csd.need_bg_solid = EINA_FALSE;
|
2018-01-16 21:12:34 -08:00
|
|
|
if (sd->legacy.ctor)
|
|
|
|
bg = elm_bg_add(obj);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Note: This code path is probably not necessary (custom legacy
|
|
|
|
// theme but efl_add'ed window -- all efl_add'ed widgets would
|
|
|
|
// use default theme)
|
efl_ui_bg: remove Efl.Ui.Bg interface and rename Efl.Ui.Bg_Widget class
Summary:
Efl.Ui.Bg interface does not have any new property or method.
Moreover, Efl.Ui.Bg interface is not used by widgets except
Efl.Ui.Bg_Widget and Efl.Ui.Widget_Part_Bg.
Consequently, Efl.Ui.Bg interface can be replaced by other interfaces.
Due to Efl.Ui.Bg interface, the bg widget class name becomes
Efl.UI.Bg_Widget which is not synchronized with other widget names.
Therefore, to keep consistency with other widgets, it would be better to
remove Efl.Ui.Bg interface and rename Efl.Ui.Bg_Widget to Efl.Ui.Bg.
Reviewers: woohyun, segfaultxavi, bu5hm4n, zmike
Reviewed By: segfaultxavi
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7304
2018-11-19 17:24:05 -08:00
|
|
|
bg = efl_add(EFL_UI_BG_CLASS, obj);
|
2018-01-16 21:12:34 -08:00
|
|
|
}
|
|
|
|
_elm_win_bg_set(sd, bg);
|
2016-11-22 00:34:17 -08:00
|
|
|
}
|
|
|
|
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2016-11-17 00:46:14 -08:00
|
|
|
_efl_ui_win_content_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, Eo *content)
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
{
|
2016-11-17 00:46:14 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (eina_streq(part, "content"))
|
|
|
|
{
|
2016-11-17 00:46:14 -08:00
|
|
|
if (sd->content == content) return EINA_TRUE;
|
|
|
|
if (!elm_widget_sub_object_add(obj, content))
|
|
|
|
goto err;
|
|
|
|
/* FIXME: Switch to swallow inside the frame
|
|
|
|
if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.client", content))
|
|
|
|
goto err;
|
|
|
|
*/
|
|
|
|
evas_object_box_append(sd->legacy.box, content);
|
|
|
|
evas_object_show(content);
|
|
|
|
efl_wref_add(content, &sd->content);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if (eina_streq(part, "background"))
|
|
|
|
{
|
2016-11-29 22:06:09 -08:00
|
|
|
sd->csd.need_bg_standard = 0;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (sd->bg == content) return EINA_TRUE;
|
2016-11-17 00:46:14 -08:00
|
|
|
if (!_elm_win_bg_set(sd, content))
|
|
|
|
goto err;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
WIN_PART_ERR(part);
|
|
|
|
return EINA_FALSE;
|
2016-11-17 00:46:14 -08:00
|
|
|
|
|
|
|
err:
|
|
|
|
ERR("Failed to set object %p as %s for window %p", content, part, obj);
|
|
|
|
return EINA_FALSE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static Efl_Canvas_Object *
|
|
|
|
_efl_ui_win_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *part)
|
|
|
|
{
|
2016-11-17 00:46:14 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (eina_streq(part, "content"))
|
2016-11-17 00:46:14 -08:00
|
|
|
return sd->content;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
else if (eina_streq(part, "background"))
|
|
|
|
return sd->bg;
|
|
|
|
|
|
|
|
WIN_PART_ERR(part);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Efl_Canvas_Object *
|
|
|
|
_efl_ui_win_content_unset(Eo *obj, Efl_Ui_Win_Data *sd, const char *part)
|
|
|
|
{
|
2016-11-17 00:46:14 -08:00
|
|
|
Eo *content;
|
|
|
|
|
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
|
|
|
content = _efl_ui_win_content_get(obj, sd, part);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (!content) return NULL;
|
|
|
|
|
|
|
|
efl_ref(content);
|
|
|
|
_efl_ui_win_content_set(obj, sd, part, NULL);
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_efl_ui_win_part_color_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *part, int r, int g, int b, int a)
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
{
|
2016-11-17 00:46:14 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (eina_streq(part, "background"))
|
|
|
|
{
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
sd->csd.need_bg_solid = EINA_TRUE;
|
|
|
|
edje_object_color_class_set(sd->frame_obj, "elm/win/background", r, g, b, a, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
|
|
_elm_win_frame_style_update(sd, 0, 1);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
WIN_PART_ERR(part);
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_efl_ui_win_part_color_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *part, int *r, int *g, int *b, int *a)
|
|
|
|
{
|
2016-11-17 00:46:14 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (eina_streq(part, "background"))
|
|
|
|
{
|
|
|
|
edje_object_color_class_get(sd->frame_obj, "elm/win/background", r, g, b, a, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
WIN_PART_ERR(part);
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2019-02-27 10:17:09 -08:00
|
|
|
static Eina_Error
|
|
|
|
_efl_ui_win_part_file_load(Eo *obj, Efl_Ui_Win_Data *sd, Eo *part_obj, const char *part)
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
{
|
2019-02-27 10:17:09 -08:00
|
|
|
const char *file, *key;
|
|
|
|
|
|
|
|
if (efl_file_loaded_get(part_obj)) return 0;
|
|
|
|
file = efl_file_get(part_obj);
|
|
|
|
key = efl_file_key_get(part_obj);
|
2016-11-17 00:46:14 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (eina_streq(part, "background"))
|
|
|
|
{
|
|
|
|
Eina_Bool ok = EINA_TRUE;
|
|
|
|
Eo *bg = NULL;
|
|
|
|
|
|
|
|
if (file)
|
|
|
|
{
|
|
|
|
bg = efl_add(EFL_UI_IMAGE_CLASS, obj);
|
2018-04-19 04:26:59 -07:00
|
|
|
efl_gfx_image_scale_type_set(bg, EFL_GFX_IMAGE_SCALE_TYPE_FIT_OUTSIDE);
|
2019-02-27 10:17:09 -08:00
|
|
|
ok = efl_file_simple_load(bg, file, key);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
if (!ok) ELM_SAFE_DEL(bg);
|
win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).
The theme will need to handle various modes:
- full CSD
- solid CSD without shadows
- server-side decoration (borderless without shadows)
- borderless with shadows
This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.
This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.
Eventually, the win edje object should also not be used anymore.
By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-10 22:24:00 -08:00
|
|
|
_elm_win_bg_set(sd, bg);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_elm_win_standard_init(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
WIN_PART_ERR(part);
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2019-02-27 10:17:09 -08:00
|
|
|
static const char *
|
|
|
|
_efl_ui_win_part_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const Eo *part_obj, const char *part EINA_UNUSED)
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
{
|
2016-11-17 00:46:14 -08:00
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
2019-02-27 10:17:09 -08:00
|
|
|
return efl_file_get(efl_super(part_obj, EFL_UI_WIN_PART_CLASS));
|
|
|
|
#if 0
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
|
|
|
|
if (eina_streq(part, "background"))
|
|
|
|
{
|
|
|
|
const Eo *bg = _efl_ui_win_content_get(obj, sd, "background");
|
2019-02-27 10:17:09 -08:00
|
|
|
return efl_file_get(bg);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
WIN_PART_ERR(part);
|
2019-02-27 10:17:09 -08:00
|
|
|
return NULL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
_efl_ui_win_part_file_key_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const Eo *part_obj, const char *part EINA_UNUSED)
|
|
|
|
{
|
|
|
|
sd->legacy.forbidden = EINA_TRUE;
|
|
|
|
return efl_file_key_get(efl_super(part_obj, EFL_UI_WIN_PART_CLASS));
|
|
|
|
/* NOTE; if more than one part is ever supported here then this section is needed */
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
if (eina_streq(part, "background"))
|
|
|
|
{
|
|
|
|
const Eo *bg = _efl_ui_win_content_get(obj, sd, "background");
|
|
|
|
return efl_file_get(bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
WIN_PART_ERR(part);
|
|
|
|
return NULL;
|
|
|
|
#endif
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
}
|
|
|
|
|
2017-09-19 04:02:26 -07:00
|
|
|
/* Efl.Part begin */
|
|
|
|
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
static void
|
2017-12-19 23:34:01 -08:00
|
|
|
_efl_ui_win_part_efl_gfx_color_color_set(Eo *obj, void *_pd EINA_UNUSED, int r, int g, int b, int a)
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
{
|
2017-09-19 04:02:26 -07:00
|
|
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
|
|
|
|
|
|
|
|
if (EVAS_COLOR_SANITIZE(r, g, b, a))
|
|
|
|
ERR("Evas only handles premultiplied colors (0 <= R,G,B <= A <= 255)");
|
|
|
|
|
|
|
|
_efl_ui_win_part_color_set(pd->obj, sd, pd->part, r, g, b, a);
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
}
|
|
|
|
|
2017-09-19 04:02:26 -07:00
|
|
|
static void
|
2018-04-17 11:09:44 -07:00
|
|
|
_efl_ui_win_part_efl_gfx_color_color_get(const Eo *obj, void *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
|
2016-11-17 00:46:14 -08:00
|
|
|
{
|
2017-09-19 04:02:26 -07:00
|
|
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
|
|
|
|
_efl_ui_win_part_color_get(pd->obj, sd, pd->part, r, g, b, a);
|
2016-11-17 00:46:14 -08:00
|
|
|
}
|
|
|
|
|
2019-02-27 10:17:09 -08:00
|
|
|
EOLIAN static const char *
|
|
|
|
_efl_ui_win_part_efl_file_file_get(const Eo *obj, void *_pd EINA_UNUSED)
|
2016-11-17 00:46:14 -08:00
|
|
|
{
|
2017-09-19 04:02:26 -07:00
|
|
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
|
2019-02-27 10:17:09 -08:00
|
|
|
return _efl_ui_win_part_file_get(pd->obj, sd, obj, pd->part);
|
2016-11-17 00:46:14 -08:00
|
|
|
}
|
|
|
|
|
2019-02-27 10:17:09 -08:00
|
|
|
EOLIAN static const char *
|
|
|
|
_efl_ui_win_part_efl_file_key_get(const Eo *obj, void *_pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
|
|
|
|
return _efl_ui_win_part_file_key_get(pd->obj, sd, obj, pd->part);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Error
|
|
|
|
_efl_ui_win_part_efl_file_load(Eo *obj, void *_pd EINA_UNUSED)
|
2016-11-17 00:46:14 -08:00
|
|
|
{
|
2017-09-19 04:02:26 -07:00
|
|
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
|
2019-02-27 10:17:09 -08:00
|
|
|
return _efl_ui_win_part_file_load(pd->obj, sd, obj, pd->part);
|
2016-11-17 00:46:14 -08:00
|
|
|
}
|
|
|
|
|
2019-02-27 10:17:09 -08:00
|
|
|
|
2017-09-19 04:02:26 -07:00
|
|
|
ELM_PART_OVERRIDE(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
|
2017-11-28 20:43:21 -08:00
|
|
|
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_win, "content")
|
2017-10-16 04:58:46 -07:00
|
|
|
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data)
|
edje/elm: Rename _internal_ to _part_ (EO)
In Edje and Elementary, we have part objects, which are what is returned
by the interface efl_part(). Those objects can't be of an opaque type as
this doesn't work nicely with strongly typed languages such as C++ or
C#. In JS, Lua, C the types are weak and mostly runtime-based so it
doesn't matter much.
As a consequence, the documentation and the types need to look nice in
this EO API. Thus, we remove the abusive term "internal" and explicitly
call all those classes "part" something.
Eventually we want the types to be declared in the EO file so bindings
(C#, C++, ...) can generate the proper access methods, returning the
best possible types.
Note that right now a few of those part types are used in the legacy API
but don't actually need to be exposed externally.
This is kind of a mega commit that does all the renaming at once, but
it's really just a big sed operation. The power of good IDEs :)
Ref T5315
Ref T5306
2017-09-12 21:29:25 -07:00
|
|
|
#include "efl_ui_win_part.eo.c"
|
win: Add background part to the win border
Use Efl.Part for window to manipulate the background.
Two part names are used in EDC:
- elm.rect.background
- elm.swallow.background
For apps the part name is only "background".
To set a solid color background (alpha is ok):
efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
To set an image:
efl_file_set(efl_part(win, "background"), "image.jpg", NULL);
To set an object:
efl_content_set(efl_part(win, "background"), subobj);
The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.
@feature
2016-11-09 23:10:28 -08:00
|
|
|
|
|
|
|
/* Efl.Part end */
|
|
|
|
|
2016-11-21 03:51:15 -08:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_win_move_resize_start(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_Win_Move_Resize_Mode mode)
|
|
|
|
{
|
2017-04-21 13:14:57 -07:00
|
|
|
// 1. move_resize can only be started after mouse down event
|
|
|
|
if (evas_event_down_count_get(sd->evas) <= 0)
|
|
|
|
{
|
|
|
|
ERR("move_resize_start can only be called when a pointer is pressed.");
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
2016-11-22 23:38:58 -08:00
|
|
|
return _win_move_resize_start(sd, mode);
|
2016-11-21 03:51:15 -08:00
|
|
|
}
|
|
|
|
|
2017-05-17 13:02:53 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_win_get(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
|
|
|
|
return ecore_evas_data_get(ecore_evas_ecore_evas_get(evas_object_evas_get(obj)), "elm_win");
|
|
|
|
}
|
|
|
|
|
2016-05-03 03:14:03 -07:00
|
|
|
/* windowing specific calls - shall we do this differently? */
|
|
|
|
|
|
|
|
EAPI Ecore_X_Window
|
|
|
|
elm_win_xwindow_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return 0;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->x.xwin) return sd->x.xwin;
|
|
|
|
if (sd->parent) return elm_win_xwindow_get(sd->parent);
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Ecore_Wl2_Window *
|
|
|
|
elm_win_wl_window_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
2016-05-03 03:14:03 -07:00
|
|
|
|
2017-06-13 22:23:46 -07:00
|
|
|
if (!sd) return NULL;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
|
|
|
if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
|
|
|
|
return _elm_ee_wlwin_get(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
#if HAVE_ELEMENTARY_WL2
|
2017-02-07 07:50:09 -08:00
|
|
|
if (sd->wl.win) return sd->wl.win;
|
|
|
|
if (sd->parent) return elm_win_wl_window_get(sd->parent);
|
2016-05-03 03:14:03 -07:00
|
|
|
#endif
|
|
|
|
|
2017-02-07 07:50:09 -08:00
|
|
|
return NULL;
|
2016-05-03 03:14:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Ecore_Cocoa_Window *
|
|
|
|
elm_win_cocoa_window_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return NULL;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
2018-07-23 12:48:28 -07:00
|
|
|
#if HAVE_ELEMENTARY_COCOA
|
|
|
|
if (sd->cocoa.win) return sd->cocoa.win;
|
|
|
|
if (sd->ee) return _elm_ee_cocoa_win_get(sd->ee);
|
|
|
|
if (sd->parent) return elm_win_cocoa_window_get(sd->parent);
|
|
|
|
#endif
|
|
|
|
|
2016-05-03 03:14:03 -07:00
|
|
|
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
|
|
|
|
return _elm_ee_cocoa_win_get(ee);
|
2018-07-23 12:48:28 -07:00
|
|
|
|
|
|
|
return NULL;
|
2016-05-03 03:14:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Ecore_Win32_Window *
|
|
|
|
elm_win_win32_window_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
const char *engine_name;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
2017-06-13 22:23:46 -07:00
|
|
|
if (!sd) return NULL;
|
|
|
|
engine_name = ecore_evas_engine_name_get(sd->ee);
|
2016-05-03 03:14:03 -07:00
|
|
|
if (!(engine_name &&
|
|
|
|
((!strcmp(engine_name, ELM_SOFTWARE_WIN32)) ||
|
|
|
|
(!strcmp(engine_name, ELM_SOFTWARE_DDRAW)))))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
|
|
|
|
return _elm_ee_win32win_get(ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
Ecore_Win32_Window *ret = NULL;
|
|
|
|
|
|
|
|
#if HAVE_ELEMENTARY_WIN32
|
|
|
|
if (sd->win32.win) ret = sd->win32.win;
|
|
|
|
if (sd->parent) ret = elm_win_win32_window_get(sd->parent);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void *
|
|
|
|
elm_win_trap_data_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return NULL;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
|
|
|
return sd->trap_data;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_override_set(Evas_Object *obj, Eina_Bool override)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
|
|
|
TRAP(sd, override_set, override);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_override_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
|
|
|
return ecore_evas_override_get(sd->ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_lower(Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-03 03:14:03 -07:00
|
|
|
|
|
|
|
TRAP(sd, lower);
|
|
|
|
}
|
|
|
|
|
2016-05-16 00:06:58 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_quickpanel_set(Evas_Object *obj, Eina_Bool quickpanel)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
ecore_x_e_illume_quickpanel_set(sd->x.xwin, quickpanel);
|
|
|
|
if (quickpanel)
|
|
|
|
{
|
|
|
|
Ecore_X_Window_State states[2];
|
|
|
|
|
|
|
|
states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
|
|
|
|
states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
|
|
|
|
ecore_x_netwm_window_state_set(sd->x.xwin, states, 2);
|
|
|
|
ecore_x_icccm_hints_set(sd->x.xwin, 0, 0, 0, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)quickpanel;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_quickpanel_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
return ecore_x_e_illume_quickpanel_get(sd->x.xwin);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_quickpanel_priority_major_set(Evas_Object *obj, int priority)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
ecore_x_e_illume_quickpanel_priority_major_set(sd->x.xwin, priority);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)priority;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return -1;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
return ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_quickpanel_priority_minor_set(Evas_Object *obj, int priority)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
ecore_x_e_illume_quickpanel_priority_minor_set(sd->x.xwin, priority);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)priority;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return -1;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
return ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_quickpanel_zone_set(Evas_Object *obj, int zone)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
ecore_x_e_illume_quickpanel_zone_set(sd->x.xwin, zone);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)zone;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
elm_win_quickpanel_zone_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return 0;
|
2016-05-16 00:06:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
return ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-05-23 04:14:54 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_indicator_mode_set(Evas_Object *obj, Elm_Win_Indicator_Mode mode)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->legacy.forbidden)
|
|
|
|
{
|
|
|
|
CRI("Use of this API is forbidden after calling an EO API on this "
|
|
|
|
"window. Fix your code!");
|
|
|
|
return;
|
|
|
|
}
|
2016-05-23 04:14:54 -07:00
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
if (mode == sd->legacy.indmode) return;
|
2016-05-23 04:14:54 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
#endif
|
2017-12-11 17:02:23 -08:00
|
|
|
sd->legacy.indmode = mode;
|
2016-05-23 04:14:54 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->legacy.indmode == ELM_WIN_INDICATOR_SHOW)
|
2016-05-23 04:14:54 -07:00
|
|
|
ecore_x_e_illume_indicator_state_set
|
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_ON);
|
2017-12-11 17:02:23 -08:00
|
|
|
else if (sd->legacy.indmode == ELM_WIN_INDICATOR_HIDE)
|
2016-05-23 04:14:54 -07:00
|
|
|
ecore_x_e_illume_indicator_state_set
|
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_INDICATOR_STATE_OFF);
|
|
|
|
}
|
|
|
|
#endif
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-06-07 07:41:48 -07:00
|
|
|
(obj, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, NULL);
|
2016-05-23 04:14:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Win_Indicator_Mode
|
|
|
|
elm_win_indicator_mode_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return ELM_WIN_INDICATOR_UNKNOWN;
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->legacy.forbidden)
|
|
|
|
{
|
|
|
|
CRI("Use of this API is forbidden after calling an EO API on this "
|
|
|
|
"window. Fix your code!");
|
|
|
|
return ELM_WIN_INDICATOR_UNKNOWN;
|
|
|
|
}
|
2016-05-23 04:14:54 -07:00
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
return sd->legacy.indmode;
|
2016-05-23 04:14:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_indicator_opacity_set(Evas_Object *obj, Elm_Win_Indicator_Opacity_Mode mode)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->legacy.forbidden)
|
|
|
|
{
|
|
|
|
CRI("Use of this API is forbidden after calling an EO API on this "
|
|
|
|
"window. Fix your code!");
|
|
|
|
return;
|
|
|
|
}
|
2016-05-23 04:14:54 -07:00
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
if (mode == sd->legacy.ind_o_mode) return;
|
|
|
|
sd->legacy.ind_o_mode = mode;
|
2016-05-23 04:14:54 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->legacy.ind_o_mode == ELM_WIN_INDICATOR_OPAQUE)
|
2016-05-23 04:14:54 -07:00
|
|
|
ecore_x_e_illume_indicator_opacity_set
|
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_INDICATOR_OPAQUE);
|
2017-12-11 17:02:23 -08:00
|
|
|
else if (sd->legacy.ind_o_mode == ELM_WIN_INDICATOR_TRANSLUCENT)
|
2016-05-23 04:14:54 -07:00
|
|
|
ecore_x_e_illume_indicator_opacity_set
|
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT);
|
2017-12-11 17:02:23 -08:00
|
|
|
else if (sd->legacy.ind_o_mode == ELM_WIN_INDICATOR_TRANSPARENT)
|
2016-05-23 04:14:54 -07:00
|
|
|
ecore_x_e_illume_indicator_opacity_set
|
|
|
|
(sd->x.xwin, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
|
|
|
|
}
|
|
|
|
#endif
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-06-07 07:41:48 -07:00
|
|
|
(obj, EFL_UI_WIN_EVENT_INDICATOR_PROP_CHANGED, NULL);
|
2016-05-23 04:14:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Win_Indicator_Opacity_Mode
|
|
|
|
elm_win_indicator_opacity_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
|
2017-12-11 17:02:23 -08:00
|
|
|
if (sd->legacy.forbidden)
|
|
|
|
{
|
|
|
|
CRI("Use of this API is forbidden after calling an EO API on this "
|
|
|
|
"window. Fix your code!");
|
|
|
|
return ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
|
|
|
|
}
|
2016-05-23 04:14:54 -07:00
|
|
|
|
2017-12-11 17:02:23 -08:00
|
|
|
return sd->legacy.ind_o_mode;
|
2016-05-23 04:14:54 -07:00
|
|
|
}
|
|
|
|
|
2016-05-26 00:02:58 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-26 00:02:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
ecore_x_e_virtual_keyboard_set(sd->x.xwin, is_keyboard);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)is_keyboard;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_keyboard_win_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-05-26 00:02:58 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin) return ecore_x_e_virtual_keyboard_get(sd->x.xwin);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
#endif
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-05-26 01:18:02 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
|
2016-05-20 11:04:21 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-20 11:04:21 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2016-05-26 01:18:02 -07:00
|
|
|
_internal_elm_win_xwindow_get(sd);
|
2016-05-20 11:04:21 -07:00
|
|
|
if (sd->x.xwin)
|
2016-05-26 01:18:02 -07:00
|
|
|
ecore_x_e_illume_conformant_set(sd->x.xwin, conformant);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)conformant;
|
2016-05-20 11:04:21 -07:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-05-26 01:18:02 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_conformant_get(const Evas_Object *obj)
|
2016-05-20 11:04:21 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-05-20 11:04:21 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2016-05-26 01:18:02 -07:00
|
|
|
_internal_elm_win_xwindow_get(sd);
|
2016-05-20 11:04:21 -07:00
|
|
|
if (sd->x.xwin)
|
2016-05-26 01:18:02 -07:00
|
|
|
return ecore_x_e_illume_conformant_get(sd->x.xwin);
|
|
|
|
#else
|
|
|
|
(void)sd;
|
2016-05-20 11:04:21 -07:00
|
|
|
#endif
|
2016-05-26 01:18:02 -07:00
|
|
|
|
|
|
|
return EINA_FALSE;
|
2016-05-20 11:04:21 -07:00
|
|
|
}
|
|
|
|
|
2016-05-26 22:55:50 -07:00
|
|
|
EAPI void
|
2016-05-27 12:57:04 -07:00
|
|
|
elm_win_wm_rotation_manual_rotation_done_set(Evas_Object *obj, Eina_Bool set)
|
2016-05-26 22:55:50 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-26 22:55:50 -07:00
|
|
|
|
|
|
|
if (!sd->wm_rot.use) return;
|
|
|
|
ecore_evas_wm_rotation_manual_rotation_done_set(sd->ee, set);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2016-05-27 12:57:04 -07:00
|
|
|
elm_win_wm_rotation_manual_rotation_done_get(const Evas_Object *obj)
|
2016-05-26 22:55:50 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-05-26 22:55:50 -07:00
|
|
|
|
|
|
|
if (!sd->wm_rot.use) return EINA_FALSE;
|
|
|
|
return ecore_evas_wm_rotation_manual_rotation_done_get(sd->ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
2016-05-27 12:57:04 -07:00
|
|
|
elm_win_wm_rotation_manual_rotation_done(Evas_Object *obj)
|
2016-05-26 22:55:50 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-26 22:55:50 -07:00
|
|
|
|
|
|
|
if (!sd->wm_rot.use) return;
|
|
|
|
ecore_evas_wm_rotation_manual_rotation_done(sd->ee);
|
|
|
|
}
|
|
|
|
|
2016-05-27 01:13:08 -07:00
|
|
|
/*
|
|
|
|
* This API does not resize the internal window (ex: X window).
|
|
|
|
* But this resizes evas_output, elm window, and its contents.
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
elm_win_rotation_with_resize_set(Evas_Object *obj, int rotation)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-27 01:13:08 -07:00
|
|
|
|
|
|
|
_win_rotate(obj, sd, rotation, EINA_TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
2016-05-27 12:57:04 -07:00
|
|
|
elm_win_wm_rotation_preferred_rotation_get(const Evas_Object *obj)
|
2016-05-27 01:13:08 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return -1;
|
2016-05-27 01:13:08 -07:00
|
|
|
|
|
|
|
return sd->wm_rot.preferred_rot;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_wm_rotation_supported_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-05-27 01:13:08 -07:00
|
|
|
|
|
|
|
return sd->wm_rot.wm_supported;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_wm_rotation_preferred_rotation_set(Evas_Object *obj, int rotation)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
int rot;
|
|
|
|
|
|
|
|
if (!sd) return;
|
|
|
|
if (!sd->wm_rot.use)
|
|
|
|
sd->wm_rot.use = EINA_TRUE;
|
|
|
|
|
|
|
|
// '-1' means that elm_win doesn't use preferred rotation.
|
|
|
|
if (rotation == -1)
|
|
|
|
rot = -1;
|
|
|
|
else
|
|
|
|
rot = _win_rotation_degree_check(rotation);
|
|
|
|
|
|
|
|
if (sd->wm_rot.preferred_rot == rot) return;
|
|
|
|
sd->wm_rot.preferred_rot = rot;
|
|
|
|
|
|
|
|
ecore_evas_wm_rotation_preferred_rotation_set(sd->ee, rot);
|
2016-05-27 01:13:08 -07:00
|
|
|
}
|
|
|
|
|
2016-05-31 21:28:01 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_screen_size_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-31 21:28:01 -07:00
|
|
|
|
|
|
|
ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_screen_position_get(const Evas_Object *obj, int *x, int *y)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-31 21:28:01 -07:00
|
|
|
|
|
|
|
if (x) *x = sd->screen.x;
|
|
|
|
if (y) *y = sd->screen.y;
|
|
|
|
}
|
|
|
|
|
2016-05-31 23:47:31 -07:00
|
|
|
EAPI void
|
2016-06-02 23:50:58 -07:00
|
|
|
elm_win_screen_dpi_get(const Evas_Object *obj, int *xdpi, int *ydpi)
|
2016-05-31 23:47:31 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-05-31 23:47:31 -07:00
|
|
|
|
|
|
|
ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
|
|
|
|
}
|
|
|
|
|
2016-06-01 02:31:00 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_icon_name_set(Evas_Object *obj, const char *icon_name)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-01 02:31:00 -07:00
|
|
|
|
|
|
|
if (!icon_name) return;
|
|
|
|
eina_stringshare_replace(&(sd->icon_name), icon_name);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char*
|
|
|
|
elm_win_icon_name_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return NULL;
|
2016-06-01 02:31:00 -07:00
|
|
|
|
|
|
|
return sd->icon_name;
|
|
|
|
}
|
|
|
|
|
2016-06-01 04:47:30 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_withdrawn_set(Evas_Object *obj, Eina_Bool withdrawn)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
|
|
|
// sd->withdrawn = withdrawn;
|
|
|
|
TRAP(sd, withdrawn_set, withdrawn);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_withdrawn_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
|
|
|
return sd->withdrawn;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_urgent_set(Evas_Object *obj, Eina_Bool urgent)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
|
|
|
if (sd->urgent == urgent)
|
|
|
|
return;
|
|
|
|
sd->urgent = urgent;
|
|
|
|
TRAP(sd, urgent_set, urgent);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_urgent_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
|
|
|
return sd->urgent;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_demand_attention_set(Evas_Object *obj, Eina_Bool demand_attention)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
|
|
|
sd->demand_attention = demand_attention;
|
|
|
|
TRAP(sd, demand_attention_set, demand_attention);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_demand_attention_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
|
|
|
return sd->demand_attention;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_modal_set(Evas_Object *obj, Eina_Bool modal)
|
|
|
|
{
|
2016-11-22 00:59:33 -08:00
|
|
|
Efl_Ui_Win_Modal_Mode modality;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
2016-11-22 00:59:33 -08:00
|
|
|
modality = modal ? EFL_UI_WIN_MODAL_MODAL : EFL_UI_WIN_MODAL_NONE;
|
|
|
|
efl_ui_win_modal_set(obj, modality);
|
2016-06-01 04:47:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_modal_get(const Evas_Object *obj)
|
|
|
|
{
|
2016-11-22 00:59:33 -08:00
|
|
|
Efl_Ui_Win_Modal_Mode modality;
|
2016-06-01 04:47:30 -07:00
|
|
|
|
2016-11-22 00:59:33 -08:00
|
|
|
modality = efl_ui_win_modal_get(obj);
|
|
|
|
return (modality != EFL_UI_WIN_MODAL_NONE);
|
2016-06-01 04:47:30 -07:00
|
|
|
}
|
|
|
|
|
2016-06-01 05:25:47 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-01 05:25:47 -07:00
|
|
|
|
2018-07-11 12:50:09 -07:00
|
|
|
shaped = !!shaped;
|
|
|
|
|
2016-06-01 05:25:47 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
2018-07-11 12:50:09 -07:00
|
|
|
if (sd->x.shaped == shaped) return;
|
|
|
|
sd->x.shaped = shaped;
|
|
|
|
TRAP(sd, shaped_set, shaped);
|
2016-06-01 05:25:47 -07:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_shaped_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return EINA_FALSE;
|
2016-06-01 05:25:47 -07:00
|
|
|
|
|
|
|
return ecore_evas_shaped_get(sd->ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_title_set(Evas_Object *obj, const char *title)
|
|
|
|
{
|
2016-06-07 17:26:39 -07:00
|
|
|
efl_text_set(obj, title);
|
2016-06-01 05:25:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char*
|
|
|
|
elm_win_title_get(const Evas_Object *obj)
|
|
|
|
{
|
2016-06-07 17:26:39 -07:00
|
|
|
return efl_text_get(obj);
|
2016-06-01 05:25:47 -07:00
|
|
|
}
|
|
|
|
|
2016-06-02 01:18:17 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_size_base_set(Evas_Object *obj, int w, int h)
|
|
|
|
{
|
2019-01-23 06:39:39 -08:00
|
|
|
efl_ui_win_hint_base_set(obj, EINA_SIZE2D(w, h));
|
2016-06-02 01:18:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_size_base_get(const Evas_Object *obj, int *w, int *h)
|
|
|
|
{
|
2017-09-18 00:38:47 -07:00
|
|
|
Eina_Size2D sz;
|
2019-01-23 06:39:39 -08:00
|
|
|
sz = efl_ui_win_hint_base_get(obj);
|
2017-09-18 00:38:47 -07:00
|
|
|
if (w) *w = sz.w;
|
|
|
|
if (h) *h = sz.h;
|
2016-06-02 01:18:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_size_step_set(Evas_Object *obj, int w, int h)
|
|
|
|
{
|
2019-01-23 06:39:39 -08:00
|
|
|
efl_ui_win_hint_step_set(obj, EINA_SIZE2D(w, h));
|
2016-06-02 01:18:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_size_step_get(const Evas_Object *obj, int *w, int *h)
|
|
|
|
{
|
2017-09-18 00:38:47 -07:00
|
|
|
Eina_Size2D sz;
|
2019-01-23 06:39:39 -08:00
|
|
|
sz = efl_ui_win_hint_step_get(obj);
|
2017-09-18 00:38:47 -07:00
|
|
|
if (w) *w = sz.w;
|
|
|
|
if (h) *h = sz.h;
|
2016-06-02 01:18:17 -07:00
|
|
|
}
|
|
|
|
|
2016-06-02 01:40:41 -07:00
|
|
|
EAPI void
|
2017-06-13 22:23:46 -07:00
|
|
|
elm_win_illume_command_send(Evas_Object *obj, Elm_Illume_Command command, void *params EINA_UNUSED)
|
2016-06-02 01:40:41 -07:00
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-02 01:40:41 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin)
|
|
|
|
{
|
|
|
|
switch (command)
|
|
|
|
{
|
|
|
|
case ELM_ILLUME_COMMAND_FOCUS_BACK:
|
|
|
|
ecore_x_e_illume_focus_back_send(sd->x.xwin);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_ILLUME_COMMAND_FOCUS_FORWARD:
|
|
|
|
ecore_x_e_illume_focus_forward_send(sd->x.xwin);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_ILLUME_COMMAND_FOCUS_HOME:
|
|
|
|
ecore_x_e_illume_focus_home_send(sd->x.xwin);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ELM_ILLUME_COMMAND_CLOSE:
|
|
|
|
ecore_x_e_illume_close_send(sd->x.xwin);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
(void)sd;
|
|
|
|
(void)command;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_profile_set(Evas_Object *obj, const char *profile)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-02 01:40:41 -07:00
|
|
|
|
|
|
|
/* check to see if a given profile is present in an available profiles */
|
2017-08-31 01:57:40 -07:00
|
|
|
if (profile && eina_array_count(sd->profile.available))
|
2016-06-02 01:40:41 -07:00
|
|
|
{
|
2017-08-31 01:57:40 -07:00
|
|
|
if (!_profile_exists(sd, profile))
|
|
|
|
return;
|
2016-06-02 01:40:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ecore_evas_window_profile_supported_get(sd->ee))
|
|
|
|
{
|
|
|
|
if (!profile) _elm_win_profile_del(sd);
|
|
|
|
ecore_evas_window_profile_set(sd->ee, profile);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (_internal_elm_win_profile_set(sd, profile))
|
|
|
|
_elm_win_profile_update(sd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI const char*
|
|
|
|
elm_win_profile_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return NULL;
|
2016-06-02 01:40:41 -07:00
|
|
|
|
|
|
|
return sd->profile.name;
|
|
|
|
}
|
|
|
|
|
2016-06-02 02:07:07 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_layer_set(Evas_Object *obj, int layer)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
2016-06-02 02:07:07 -07:00
|
|
|
|
|
|
|
TRAP(sd, layer_set, layer);
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_elm_win_xwin_update(sd);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
elm_win_layer_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return 0;
|
2016-06-02 02:07:07 -07:00
|
|
|
|
|
|
|
return ecore_evas_layer_get(sd->ee);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object*
|
|
|
|
elm_win_inlined_image_object_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return NULL;
|
2016-06-02 02:07:07 -07:00
|
|
|
|
|
|
|
return sd->img_obj;
|
|
|
|
}
|
|
|
|
|
2016-06-02 23:36:13 -07:00
|
|
|
static Ecore_Window
|
2016-06-07 07:41:48 -07:00
|
|
|
_elm_win_window_id_get(Efl_Ui_Win_Data *sd)
|
2016-06-02 23:36:13 -07:00
|
|
|
{
|
|
|
|
#if HAVE_ELEMENTARY_WL2
|
2017-07-07 13:26:50 -07:00
|
|
|
if (sd->wl.win)
|
2018-07-06 07:16:21 -07:00
|
|
|
return (Ecore_Window)sd->wl.win;
|
2017-07-07 13:26:50 -07:00
|
|
|
if (sd->parent)
|
|
|
|
{
|
|
|
|
Ecore_Wl2_Window *parent;
|
2016-06-02 23:36:13 -07:00
|
|
|
|
2017-07-07 13:26:50 -07:00
|
|
|
parent = elm_win_wl_window_get(sd->parent);
|
|
|
|
if (parent)
|
2018-07-06 07:16:21 -07:00
|
|
|
return (Ecore_Window)parent;
|
2016-06-02 23:36:13 -07:00
|
|
|
}
|
|
|
|
#endif
|
2017-07-07 13:26:50 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
_internal_elm_win_xwindow_get(sd);
|
|
|
|
if (sd->x.xwin) return (Ecore_Window)sd->x.xwin;
|
|
|
|
if (sd->parent)
|
2016-06-02 23:36:13 -07:00
|
|
|
{
|
2017-07-07 13:26:50 -07:00
|
|
|
Ecore_Window xwin = elm_win_xwindow_get(sd->parent);
|
|
|
|
if (xwin) return xwin;
|
2016-06-02 23:36:13 -07:00
|
|
|
}
|
2017-07-07 13:26:50 -07:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ELEMENTARY_COCOA
|
|
|
|
if (sd->cocoa.win) return (Ecore_Window)(sd->cocoa.win);
|
|
|
|
if (sd->parent)
|
2016-06-02 23:36:13 -07:00
|
|
|
{
|
2017-07-07 13:26:50 -07:00
|
|
|
Ecore_Cocoa_Window *pwin;
|
|
|
|
pwin = elm_win_cocoa_window_get(sd->parent);
|
|
|
|
if (pwin) return (Ecore_Window)pwin;
|
|
|
|
}
|
|
|
|
#endif
|
2016-06-02 23:36:13 -07:00
|
|
|
#ifdef HAVE_ELEMENTARY_WIN32
|
|
|
|
_internal_elm_win_win32window_get(sd);
|
|
|
|
if (sd->win32.win) return (Ecore_Window)sd->win32.win;
|
2017-07-07 13:26:50 -07:00
|
|
|
if (sd->parent)
|
|
|
|
{
|
|
|
|
Ecore_Window wwin = (Ecore_Window)elm_win_win32_window_get(sd->parent);
|
|
|
|
if (wwin) return wwin;
|
|
|
|
}
|
2016-06-02 23:36:13 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Ecore_Window
|
|
|
|
elm_win_window_id_get(const Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd;
|
2016-06-02 23:36:13 -07:00
|
|
|
if (!obj) return 0;
|
|
|
|
|
|
|
|
if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
|
2018-03-20 10:15:21 -07:00
|
|
|
if (!ee) return 0;
|
2016-06-02 23:36:13 -07:00
|
|
|
return ecore_evas_window_get(ee);
|
|
|
|
}
|
|
|
|
|
2017-06-13 22:23:46 -07:00
|
|
|
sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return 0;
|
2016-08-04 03:37:56 -07:00
|
|
|
return _elm_win_window_id_get(sd);
|
2016-06-02 23:36:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_win_main_menu_get(Evas_Object *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return NULL;
|
2016-06-02 23:36:13 -07:00
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
Eina_Bool use_dbus = EINA_FALSE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (sd->main_menu) goto end;
|
|
|
|
|
|
|
|
sd->main_menu = elm_menu_add(obj);
|
|
|
|
_elm_menu_menu_bar_set(sd->main_menu, EINA_TRUE);
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (!_elm_config->disable_external_menu && sd->x.xwin) use_dbus = EINA_TRUE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_ELEMENTARY_X
|
|
|
|
if (use_dbus && _elm_dbus_menu_register(sd->main_menu))
|
|
|
|
{
|
|
|
|
_elm_dbus_menu_app_menu_register(sd->x.xwin, sd->main_menu,
|
|
|
|
_dbus_menu_set, obj);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
_dbus_menu_set(EINA_FALSE, obj);
|
|
|
|
|
|
|
|
end:
|
|
|
|
return sd->main_menu;
|
|
|
|
}
|
|
|
|
|
2016-06-07 23:24:08 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_aspect_set(Eo *obj, double aspect)
|
|
|
|
{
|
2017-09-18 00:44:42 -07:00
|
|
|
Eina_Size2D sz = { 0, 0 };
|
|
|
|
|
2016-06-07 23:24:08 -07:00
|
|
|
if (aspect > DBL_EPSILON)
|
2017-09-18 00:44:42 -07:00
|
|
|
sz = EINA_SIZE2D(1000 * aspect, 1000);
|
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_aspect_set(obj, EFL_GFX_HINT_ASPECT_NONE, sz);
|
2016-06-07 23:24:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI double
|
|
|
|
elm_win_aspect_get(const Eo *obj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return 0.0;
|
2016-06-07 23:24:08 -07:00
|
|
|
return _win_aspect_get(sd);
|
|
|
|
}
|
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
/* legacy APIs */
|
|
|
|
|
2017-08-17 08:29:02 -07:00
|
|
|
static void
|
|
|
|
_fake_canvas_set(Evas_Object *obj, Ecore_Evas *oee)
|
|
|
|
{
|
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
|
|
|
if (!sd) return;
|
|
|
|
|
|
|
|
sd->ee = oee;
|
|
|
|
_elm_win_need_frame_adjust(sd, ecore_evas_engine_name_get(oee));
|
|
|
|
}
|
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*
|
|
|
|
* Recalculate the size of window considering its resize objects' weight and
|
|
|
|
* min size. If any of its resize objects' weight equals to 0.0, window
|
|
|
|
* layout's weight will be set to 0.0.
|
|
|
|
*
|
|
|
|
* @param o box object
|
|
|
|
* @param p box's private data
|
|
|
|
* @param data window object
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
_window_layout_stack(Evas_Object *o, Evas_Object_Box_Data *p, void *data)
|
|
|
|
{
|
|
|
|
const Eina_List *l;
|
|
|
|
Evas_Object *child;
|
|
|
|
Evas_Object_Box_Option *opt;
|
2017-06-30 01:26:16 -07:00
|
|
|
Evas_Coord x, y, w, h, menuw = 0;
|
2016-11-17 00:46:14 -08:00
|
|
|
double wx, wy;
|
|
|
|
Evas_Coord minw = -1, minh = -1;
|
|
|
|
double weight_x = EVAS_HINT_EXPAND;
|
|
|
|
double weight_y = EVAS_HINT_EXPAND;
|
|
|
|
|
2017-06-30 01:26:16 -07:00
|
|
|
ELM_WIN_DATA_GET(data, sd);
|
2018-04-05 01:47:26 -07:00
|
|
|
if (sd->main_menu && efl_gfx_entity_visible_get(sd->main_menu))
|
2017-09-18 00:22:01 -07:00
|
|
|
evas_object_size_hint_combined_min_get(sd->main_menu, &menuw, NULL);
|
2017-06-30 01:26:16 -07:00
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
EINA_LIST_FOREACH(p->children, l, opt)
|
|
|
|
{
|
|
|
|
child = opt->obj;
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_get(child, &wx, &wy);
|
2017-07-04 02:18:07 -07:00
|
|
|
if (EINA_DBL_EQ(wx, 0.0)) weight_x = 0;
|
|
|
|
if (EINA_DBL_EQ(wy, 0.0)) weight_y = 0;
|
2016-11-17 00:46:14 -08:00
|
|
|
|
2017-09-18 00:22:01 -07:00
|
|
|
evas_object_size_hint_combined_min_get(child, &w, &h);
|
2016-11-17 00:46:14 -08:00
|
|
|
if (w > minw) minw = w;
|
|
|
|
if (h > minh) minh = h;
|
|
|
|
}
|
|
|
|
|
2017-06-30 01:26:16 -07:00
|
|
|
if (minw < menuw) minw = menuw;
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_restricted_min_set(o, EINA_SIZE2D(minw, minh));
|
2016-11-17 00:46:14 -08:00
|
|
|
evas_object_geometry_get(o, &x, &y, &w, &h);
|
|
|
|
if (w < minw) w = minw;
|
|
|
|
if (h < minh) h = minh;
|
|
|
|
evas_object_resize(o, w, h);
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(p->children, l, opt)
|
|
|
|
{
|
|
|
|
child = opt->obj;
|
2018-11-21 07:53:11 -08:00
|
|
|
evas_object_geometry_set(child, x, y, w, h);
|
2016-11-17 00:46:14 -08:00
|
|
|
}
|
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(sd->legacy.edje, weight_x, weight_y);
|
2017-07-04 02:18:07 -07:00
|
|
|
//evas_object_smart_changed(sd->legacy.edje);
|
2016-11-17 00:46:14 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_elm_win_legacy_init(Efl_Ui_Win_Data *sd)
|
|
|
|
{
|
|
|
|
sd->legacy.edje = edje_object_add(sd->evas);
|
|
|
|
_elm_win_theme_internal(sd->obj, sd);
|
|
|
|
|
|
|
|
sd->legacy.box = evas_object_box_add(sd->evas);
|
|
|
|
evas_object_box_layout_set(sd->legacy.box, _window_layout_stack, sd->obj, NULL);
|
2018-04-26 03:27:43 -07:00
|
|
|
|
|
|
|
if (elm_widget_is_legacy(sd->obj))
|
|
|
|
edje_object_part_swallow(sd->legacy.edje, "elm.swallow.contents", sd->legacy.box);
|
|
|
|
else
|
|
|
|
edje_object_part_swallow(sd->legacy.edje, "efl.contents", sd->legacy.box);
|
|
|
|
|
2018-11-21 07:53:11 -08:00
|
|
|
evas_object_geometry_set(sd->legacy.edje, 0, 0, 1, 1);
|
2016-11-17 00:46:14 -08:00
|
|
|
if (sd->type != ELM_WIN_FAKE)
|
|
|
|
{
|
|
|
|
edje_object_update_hints_set(sd->legacy.edje, EINA_TRUE);
|
|
|
|
evas_object_event_callback_add(sd->legacy.edje, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
|
|
|
_elm_win_on_resize_obj_changed_size_hints, sd->obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_resize_object_add(Eo *obj, Evas_Object *subobj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
2016-11-17 00:46:14 -08:00
|
|
|
Eina_Bool ret;
|
|
|
|
|
2017-06-13 22:23:46 -07:00
|
|
|
if (!sd) return;
|
2016-11-17 00:46:14 -08:00
|
|
|
if (sd->legacy.forbidden)
|
|
|
|
{
|
|
|
|
CRI("Use of this API is forbidden after calling an EO API on this "
|
|
|
|
"window. Fix your code!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-11-30 21:41:06 -08:00
|
|
|
// Little hack for E
|
|
|
|
if (evas_obj_box_count(sd->legacy.box) > 0)
|
|
|
|
sd->single_edje_content = 0;
|
2017-12-05 19:15:39 -08:00
|
|
|
else if (efl_isa(subobj, EFL_CANVAS_LAYOUT_CLASS))
|
2016-11-30 21:41:06 -08:00
|
|
|
sd->single_edje_content = 1;
|
|
|
|
|
2016-11-17 00:46:14 -08:00
|
|
|
ret = elm_widget_sub_object_add(obj, subobj);
|
|
|
|
ret &= (evas_object_box_append(sd->legacy.box, subobj) != NULL);
|
|
|
|
|
|
|
|
if (!ret)
|
|
|
|
ERR("could not add sub object %p to window %p", subobj, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_resize_object_del(Eo *obj, Evas_Object *subobj)
|
|
|
|
{
|
2017-06-13 22:23:46 -07:00
|
|
|
Efl_Ui_Win_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
|
2016-11-17 00:46:14 -08:00
|
|
|
Eina_Bool ret;
|
|
|
|
|
2017-06-13 22:23:46 -07:00
|
|
|
if (!sd) return;
|
2016-11-17 00:46:14 -08:00
|
|
|
if (sd->legacy.forbidden)
|
|
|
|
{
|
|
|
|
CRI("Use of this API is forbidden after calling an EO API on this "
|
|
|
|
"window. Fix your code!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = elm_widget_sub_object_del(obj, subobj);
|
|
|
|
ret &= evas_object_box_remove(sd->legacy.box, subobj);
|
|
|
|
|
|
|
|
if (!ret)
|
|
|
|
ERR("could not remove sub object %p from window %p", subobj, obj);
|
|
|
|
}
|
|
|
|
|
2017-07-16 22:24:30 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_keygrab_set(Elm_Win *obj, const char *key,
|
2017-07-17 00:36:19 -07:00
|
|
|
Evas_Modifier_Mask modifiers EINA_UNUSED,
|
|
|
|
Evas_Modifier_Mask not_modifiers EINA_UNUSED,
|
2017-07-16 22:24:30 -07:00
|
|
|
int priority, Elm_Win_Keygrab_Mode grab_mode)
|
|
|
|
{
|
2017-07-17 00:36:19 -07:00
|
|
|
// Note: Not converting modifiers as they are not used in the implementation
|
2017-07-16 22:24:30 -07:00
|
|
|
return efl_ui_win_keygrab_set(obj, key,
|
2017-07-17 00:36:19 -07:00
|
|
|
EFL_INPUT_MODIFIER_NONE,
|
|
|
|
EFL_INPUT_MODIFIER_NONE,
|
2017-07-16 22:24:30 -07:00
|
|
|
priority, grab_mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
2017-07-17 00:36:19 -07:00
|
|
|
elm_win_keygrab_unset(Elm_Win *obj, const char *key,
|
|
|
|
Evas_Modifier_Mask modifiers EINA_UNUSED,
|
|
|
|
Evas_Modifier_Mask not_modifiers EINA_UNUSED)
|
2017-07-16 22:24:30 -07:00
|
|
|
{
|
2017-07-17 00:36:19 -07:00
|
|
|
// Note: Not converting modifiers as they are not used in the implementation
|
2017-07-16 22:24:30 -07:00
|
|
|
return efl_ui_win_keygrab_unset(obj, key,
|
2017-07-17 00:36:19 -07:00
|
|
|
EFL_INPUT_MODIFIER_NONE,
|
|
|
|
EFL_INPUT_MODIFIER_NONE);
|
2017-07-16 22:24:30 -07:00
|
|
|
}
|
2017-05-18 01:37:26 -07:00
|
|
|
|
2017-08-17 08:29:02 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_socket_listen(Efl_Ui_Win *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
|
|
|
|
{
|
|
|
|
return efl_ui_win_socket_listen(obj, svcname, svcnum, svcsys);
|
|
|
|
}
|
|
|
|
|
2017-08-30 23:15:58 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_focus_get(const Efl_Ui_Win *obj)
|
|
|
|
{
|
2018-08-20 00:19:02 -07:00
|
|
|
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(obj, MY_CLASS), EINA_FALSE);
|
2017-11-29 00:39:42 -08:00
|
|
|
return efl_ui_focus_object_focus_get(obj);
|
2017-08-30 23:15:58 -07:00
|
|
|
}
|
|
|
|
|
2017-08-31 01:57:40 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_win_available_profiles_get(const Elm_Win *obj, char ***profiles, unsigned int *count)
|
|
|
|
{
|
|
|
|
const Eina_Array *ar;
|
|
|
|
|
|
|
|
if (!efl_isa(obj, MY_CLASS)) return EINA_FALSE;
|
|
|
|
ar = efl_ui_win_wm_available_profiles_get(obj);
|
|
|
|
if (!ar)
|
|
|
|
{
|
|
|
|
if (profiles) *profiles = NULL;
|
|
|
|
if (count) *count = 0;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (profiles) *profiles = (char **) ar->data;
|
|
|
|
if (count) *count = ar->count;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_available_profiles_set(Elm_Win *obj, const char **profiles, unsigned int count)
|
|
|
|
{
|
|
|
|
if (!efl_isa(obj, MY_CLASS)) return;
|
2017-09-27 20:17:44 -07:00
|
|
|
if ((count > 0) && (profiles))
|
2017-08-31 01:57:40 -07:00
|
|
|
{
|
|
|
|
Eina_Array *ar;
|
|
|
|
unsigned int i;
|
|
|
|
|
2017-09-27 20:17:44 -07:00
|
|
|
ar = eina_array_new(count);
|
|
|
|
if (ar)
|
|
|
|
{
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
eina_array_push(ar, profiles[i]);
|
|
|
|
efl_ui_win_wm_available_profiles_set(obj, ar);
|
|
|
|
eina_array_free(ar);
|
|
|
|
}
|
2017-08-31 01:57:40 -07:00
|
|
|
}
|
2017-09-27 20:17:44 -07:00
|
|
|
else efl_ui_win_wm_available_profiles_set(obj, NULL);
|
2017-08-31 01:57:40 -07:00
|
|
|
}
|
|
|
|
|
2016-08-11 15:44:08 -07:00
|
|
|
// deprecated
|
2017-08-17 08:29:02 -07:00
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_fake_canvas_set(Evas_Object *obj EINA_UNUSED, Ecore_Evas *oee EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ERR("Calling deprecrated function '%s'", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
2016-08-11 15:44:08 -07:00
|
|
|
EAPI void
|
|
|
|
elm_win_name_set(Evas_Object *obj, const char *name)
|
|
|
|
{
|
|
|
|
ERR("Calling deprecrated function '%s'", __FUNCTION__);
|
|
|
|
efl_ui_win_name_set(obj, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_type_set(Evas_Object *obj, Elm_Win_Type type)
|
|
|
|
{
|
|
|
|
ERR("Calling deprecrated function '%s'", __FUNCTION__);
|
|
|
|
efl_ui_win_type_set(obj, type);
|
|
|
|
}
|
|
|
|
|
2016-12-08 02:14:32 -08:00
|
|
|
EAPI void
|
|
|
|
elm_win_teamwork_uri_preload(Efl_Ui_Win *obj EINA_UNUSED, const char *uri EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ERR("Calling deprecrated function '%s'", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_teamwork_uri_show(Efl_Ui_Win *obj EINA_UNUSED, const char *uri EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ERR("Calling deprecrated function '%s'", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_teamwork_uri_hide(Efl_Ui_Win *obj EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ERR("Calling deprecrated function '%s'", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
elm_win_teamwork_uri_open(Efl_Ui_Win *obj EINA_UNUSED, const char *uri EINA_UNUSED)
|
|
|
|
{
|
|
|
|
ERR("Calling deprecrated function '%s'", __FUNCTION__);
|
|
|
|
}
|
|
|
|
|
2017-05-18 01:52:17 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
2017-08-16 23:08:00 -07:00
|
|
|
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data)
|
|
|
|
|
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
2017-05-18 01:37:26 -07:00
|
|
|
#define EFL_UI_WIN_EXTRA_OPS \
|
2017-05-18 01:52:17 -07:00
|
|
|
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \
|
2017-11-07 23:17:29 -08:00
|
|
|
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win), \
|
|
|
|
EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_ui_win_efl_canvas_object_legacy_ctor)
|
2017-05-18 01:37:26 -07:00
|
|
|
|
2016-06-07 07:41:48 -07:00
|
|
|
#include "efl_ui_win.eo.c"
|
2018-01-23 22:50:58 -08:00
|
|
|
|
|
|
|
static void
|
|
|
|
_efl_ui_win_legacy_class_constructor(Efl_Class *klass)
|
|
|
|
{
|
|
|
|
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eo *
|
2018-01-24 18:43:31 -08:00
|
|
|
_efl_ui_win_legacy_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
|
2018-01-23 22:50:58 -08:00
|
|
|
{
|
2018-01-24 18:43:31 -08:00
|
|
|
obj = efl_finalize(efl_super(obj, EFL_UI_WIN_LEGACY_CLASS));
|
2018-01-23 22:50:58 -08:00
|
|
|
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_win_add(Evas_Object *parent, const char *name, Efl_Ui_Win_Type type)
|
|
|
|
{
|
|
|
|
const Efl_Class *klass = EFL_UI_WIN_LEGACY_CLASS;
|
|
|
|
|
|
|
|
switch ((int) type)
|
|
|
|
{
|
2018-05-31 05:39:34 -07:00
|
|
|
case ELM_WIN_INLINED_IMAGE: klass = EFL_UI_WIN_INLINED_LEGACY_CLASS; break;
|
|
|
|
case ELM_WIN_SOCKET_IMAGE: klass = EFL_UI_WIN_SOCKET_LEGACY_CLASS; break;
|
2018-01-23 22:50:58 -08:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
|
2018-03-19 15:39:14 -07:00
|
|
|
return elm_legacy_add(klass, parent,
|
2018-01-23 22:50:58 -08:00
|
|
|
efl_ui_win_name_set(efl_added, name),
|
|
|
|
efl_ui_win_type_set(efl_added, type));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_win_fake_add(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
return elm_legacy_add(EFL_UI_WIN_LEGACY_CLASS, NULL,
|
|
|
|
_fake_canvas_set(efl_added, ee),
|
|
|
|
efl_ui_win_name_set(efl_added, NULL),
|
|
|
|
efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_win_util_standard_add(const char *name, const char *title)
|
|
|
|
{
|
|
|
|
Evas_Object *win;
|
|
|
|
|
|
|
|
win = elm_legacy_add(EFL_UI_WIN_LEGACY_CLASS, NULL,
|
|
|
|
efl_text_set(efl_added, title),
|
|
|
|
efl_ui_win_name_set(efl_added, name),
|
|
|
|
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
|
|
|
|
if (!win) return NULL;
|
|
|
|
|
|
|
|
_elm_win_standard_init(win);
|
|
|
|
return win;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title)
|
|
|
|
{
|
|
|
|
Evas_Object *win;
|
|
|
|
|
|
|
|
win = elm_legacy_add(EFL_UI_WIN_LEGACY_CLASS, parent,
|
|
|
|
efl_text_set(efl_added, title),
|
|
|
|
efl_ui_win_name_set(efl_added, name),
|
|
|
|
efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
|
|
|
|
if (!win) return NULL;
|
|
|
|
|
|
|
|
_elm_win_standard_init(win);
|
|
|
|
return win;
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "efl_ui_win_legacy.eo.c"
|