forked from enlightenment/enlightenment
remove old wayland compositor and old shell files
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
cef6ebd2db
commit
217d5a95bc
2909
src/bin/e_comp_wl.c
2909
src/bin/e_comp_wl.c
File diff suppressed because it is too large
Load Diff
|
@ -1,640 +0,0 @@
|
||||||
#ifdef E_TYPEDEFS
|
|
||||||
|
|
||||||
#else
|
|
||||||
# ifndef E_COMP_WL_H
|
|
||||||
# define E_COMP_WL_H
|
|
||||||
|
|
||||||
# define WL_HIDE_DEPRECATED
|
|
||||||
# include <pixman.h>
|
|
||||||
|
|
||||||
/* NB: Turn off shadow warnings for Wayland includes */
|
|
||||||
# pragma GCC diagnostic ignored "-Wshadow"
|
|
||||||
# include <wayland-server.h>
|
|
||||||
# pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
# include <xkbcommon/xkbcommon.h>
|
|
||||||
|
|
||||||
/* headers for terminal support */
|
|
||||||
# include <termios.h>
|
|
||||||
# include <linux/vt.h>
|
|
||||||
|
|
||||||
# ifdef __linux__
|
|
||||||
# include <linux/input.h>
|
|
||||||
# else
|
|
||||||
# define BTN_LEFT 0x110
|
|
||||||
# define BTN_RIGHT 0x111
|
|
||||||
# define BTN_MIDDLE 0x112
|
|
||||||
# define BTN_SIDE 0x113
|
|
||||||
# define BTN_EXTRA 0x114
|
|
||||||
# define BTN_FORWARD 0x115
|
|
||||||
# define BTN_BACK 0x116
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef HAVE_WAYLAND_EGL
|
|
||||||
# include <EGL/egl.h>
|
|
||||||
# include <EGL/eglext.h>
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# define container_of(ptr, type, member) ({ \
|
|
||||||
const __typeof__(((type *)0)->member) *__mptr = (ptr); \
|
|
||||||
(type *)((char *)__mptr - offsetof(type,member));})
|
|
||||||
|
|
||||||
typedef enum _E_Wayland_Shell_Surface_Type E_Wayland_Shell_Surface_Type;
|
|
||||||
|
|
||||||
typedef struct _E_Wayland_Region E_Wayland_Region;
|
|
||||||
typedef struct _E_Wayland_Surface E_Wayland_Surface;
|
|
||||||
typedef struct _E_Wayland_Surface_Frame_Callback E_Wayland_Surface_Frame_Callback;
|
|
||||||
typedef struct _E_Wayland_Shell_Surface E_Wayland_Shell_Surface;
|
|
||||||
typedef struct _E_Wayland_Shell_Interface E_Wayland_Shell_Interface;
|
|
||||||
typedef struct _E_Wayland_Shell_Grab E_Wayland_Shell_Grab;
|
|
||||||
typedef struct _E_Wayland_Keyboard_Info E_Wayland_Keyboard_Info;
|
|
||||||
typedef struct _E_Wayland_Input E_Wayland_Input;
|
|
||||||
typedef struct _E_Wayland_Compositor E_Wayland_Compositor;
|
|
||||||
typedef struct _E_Wayland_Output E_Wayland_Output;
|
|
||||||
typedef struct _E_Wayland_Output_Mode E_Wayland_Output_Mode;
|
|
||||||
typedef struct _E_Wayland_Terminal E_Wayland_Terminal;
|
|
||||||
typedef struct _E_Wayland_Plane E_Wayland_Plane;
|
|
||||||
typedef struct _E_Wayland_Buffer E_Wayland_Buffer;
|
|
||||||
typedef struct _E_Wayland_Buffer_Reference E_Wayland_Buffer_Reference;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NB: All of these structs and interfaces were recently removed from
|
|
||||||
* wayland so for now, reimplement them here
|
|
||||||
*/
|
|
||||||
struct wl_seat;
|
|
||||||
struct wl_pointer;
|
|
||||||
struct wl_keyboard;
|
|
||||||
struct wl_touch;
|
|
||||||
|
|
||||||
struct wl_pointer_grab;
|
|
||||||
struct wl_pointer_grab_interface
|
|
||||||
{
|
|
||||||
void (*focus)(struct wl_pointer_grab *grab, struct wl_resource *surface, wl_fixed_t x, wl_fixed_t y);
|
|
||||||
void (*motion)(struct wl_pointer_grab *grab, unsigned int timestamp, wl_fixed_t x, wl_fixed_t y);
|
|
||||||
void (*button)(struct wl_pointer_grab *grab, unsigned int timestamp, unsigned int button, unsigned int state);
|
|
||||||
};
|
|
||||||
struct wl_pointer_grab
|
|
||||||
{
|
|
||||||
const struct wl_pointer_grab_interface *interface;
|
|
||||||
struct wl_pointer *pointer;
|
|
||||||
struct wl_resource *focus;
|
|
||||||
wl_fixed_t x, y;
|
|
||||||
unsigned int edges;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_keyboard_grab;
|
|
||||||
struct wl_keyboard_grab_interface
|
|
||||||
{
|
|
||||||
void (*key)(struct wl_keyboard_grab *grab, unsigned int timestamp, unsigned int key, unsigned int state);
|
|
||||||
void (*modifiers)(struct wl_keyboard_grab *grab, unsigned int serial, unsigned int mods_depressed, unsigned int mods_latched, unsigned int mods_locked, unsigned int group);
|
|
||||||
};
|
|
||||||
struct wl_keyboard_grab
|
|
||||||
{
|
|
||||||
const struct wl_keyboard_grab_interface *interface;
|
|
||||||
struct wl_keyboard *keyboard;
|
|
||||||
struct wl_resource *focus;
|
|
||||||
unsigned int key;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_touch_grab;
|
|
||||||
struct wl_touch_grab_interface
|
|
||||||
{
|
|
||||||
void (*down)(struct wl_touch_grab *grab, unsigned int timestamp, int touch_id, wl_fixed_t sx, wl_fixed_t sy);
|
|
||||||
void (*up)(struct wl_touch_grab *grab, unsigned int timestamp, int touch_id);
|
|
||||||
void (*motion)(struct wl_touch_grab *grab, unsigned int timestamp, int touch_id, wl_fixed_t sx, wl_fixed_t sy);
|
|
||||||
};
|
|
||||||
struct wl_touch_grab
|
|
||||||
{
|
|
||||||
const struct wl_touch_grab_interface *interface;
|
|
||||||
struct wl_touch *touch;
|
|
||||||
struct wl_resource *focus;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_pointer
|
|
||||||
{
|
|
||||||
struct wl_seat *seat;
|
|
||||||
|
|
||||||
struct wl_list resource_list;
|
|
||||||
struct wl_list focus_resource_list;
|
|
||||||
struct wl_resource *focus;
|
|
||||||
unsigned int focus_serial;
|
|
||||||
struct wl_signal focus_signal;
|
|
||||||
|
|
||||||
struct wl_pointer_grab *grab;
|
|
||||||
struct wl_pointer_grab default_grab;
|
|
||||||
wl_fixed_t grab_x, grab_y;
|
|
||||||
unsigned int grab_button;
|
|
||||||
unsigned int grab_serial;
|
|
||||||
unsigned int grab_time;
|
|
||||||
|
|
||||||
wl_fixed_t x, y;
|
|
||||||
struct wl_resource *current;
|
|
||||||
struct wl_listener current_listener;
|
|
||||||
wl_fixed_t current_x, current_y;
|
|
||||||
|
|
||||||
unsigned int button_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_keyboard
|
|
||||||
{
|
|
||||||
struct wl_seat *seat;
|
|
||||||
|
|
||||||
struct wl_list resource_list;
|
|
||||||
struct wl_list focus_resource_list;
|
|
||||||
struct wl_resource *focus;
|
|
||||||
unsigned int focus_serial;
|
|
||||||
struct wl_signal focus_signal;
|
|
||||||
|
|
||||||
struct wl_keyboard_grab *grab;
|
|
||||||
struct wl_keyboard_grab default_grab;
|
|
||||||
unsigned int grab_key;
|
|
||||||
unsigned int grab_serial;
|
|
||||||
unsigned int grab_time;
|
|
||||||
|
|
||||||
struct wl_array keys;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
unsigned int mods_depressed;
|
|
||||||
unsigned int mods_latched;
|
|
||||||
unsigned int mods_locked;
|
|
||||||
unsigned int group;
|
|
||||||
} modifiers;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_touch
|
|
||||||
{
|
|
||||||
struct wl_seat *seat;
|
|
||||||
|
|
||||||
struct wl_list resource_list;
|
|
||||||
struct wl_list focus_resource_list;
|
|
||||||
struct wl_resource *focus;
|
|
||||||
unsigned int focus_serial;
|
|
||||||
struct wl_signal focus_signal;
|
|
||||||
|
|
||||||
struct wl_touch_grab *grab;
|
|
||||||
struct wl_touch_grab default_grab;
|
|
||||||
wl_fixed_t grab_x, grab_y;
|
|
||||||
unsigned int grab_serial;
|
|
||||||
unsigned int grab_time;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_data_offer
|
|
||||||
{
|
|
||||||
struct wl_resource *resource;
|
|
||||||
struct wl_data_source *source;
|
|
||||||
struct wl_listener source_destroy_listener;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_data_source
|
|
||||||
{
|
|
||||||
struct wl_resource *resource;
|
|
||||||
struct wl_array mime_types;
|
|
||||||
struct wl_signal destroy_signal;
|
|
||||||
|
|
||||||
void (*accept)(struct wl_data_source *source,
|
|
||||||
uint32_t serial, const char *mime_type);
|
|
||||||
void (*send)(struct wl_data_source *source,
|
|
||||||
const char *mime_type, int32_t fd);
|
|
||||||
void (*cancel)(struct wl_data_source *source);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct wl_seat
|
|
||||||
{
|
|
||||||
struct wl_list base_resource_list;
|
|
||||||
struct wl_signal destroy_signal;
|
|
||||||
|
|
||||||
struct wl_pointer *pointer;
|
|
||||||
struct wl_keyboard *keyboard;
|
|
||||||
struct wl_touch *touch;
|
|
||||||
|
|
||||||
unsigned int selection_serial;
|
|
||||||
struct wl_data_source *selection_data_source;
|
|
||||||
struct wl_listener selection_data_source_listener;
|
|
||||||
struct wl_signal selection_signal;
|
|
||||||
|
|
||||||
struct wl_list drag_resource_list;
|
|
||||||
struct wl_client *drag_client;
|
|
||||||
struct wl_data_source *drag_data_source;
|
|
||||||
struct wl_listener drag_data_source_listener;
|
|
||||||
struct wl_resource *drag_focus;
|
|
||||||
struct wl_resource *drag_focus_resource;
|
|
||||||
struct wl_listener drag_focus_listener;
|
|
||||||
struct wl_pointer_grab drag_grab;
|
|
||||||
struct wl_resource *drag_surface;
|
|
||||||
struct wl_listener drag_icon_listener;
|
|
||||||
struct wl_signal drag_icon_signal;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum _E_Wayland_Shell_Surface_Type
|
|
||||||
{
|
|
||||||
E_WAYLAND_SHELL_SURFACE_TYPE_NONE,
|
|
||||||
E_WAYLAND_SHELL_SURFACE_TYPE_TOPLEVEL,
|
|
||||||
E_WAYLAND_SHELL_SURFACE_TYPE_TRANSIENT,
|
|
||||||
E_WAYLAND_SHELL_SURFACE_TYPE_FULLSCREEN,
|
|
||||||
E_WAYLAND_SHELL_SURFACE_TYPE_MAXIMIZED,
|
|
||||||
E_WAYLAND_SHELL_SURFACE_TYPE_POPUP
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Region
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_resource *resource;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
pixman_region32_t region;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Surface_Frame_Callback
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_resource *resource;
|
|
||||||
struct wl_list link;
|
|
||||||
} wl;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Buffer
|
|
||||||
{
|
|
||||||
EINA_INLIST;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_resource *resource;
|
|
||||||
struct wl_signal destroy_signal;
|
|
||||||
struct wl_listener destroy_listener;
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct wl_shm_buffer *shm_buffer;
|
|
||||||
void *legacy_buffer;
|
|
||||||
};
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
int w, h;
|
|
||||||
unsigned int busy_count;
|
|
||||||
E_Wayland_Surface *ews;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Buffer_Reference
|
|
||||||
{
|
|
||||||
E_Wayland_Buffer *buffer;
|
|
||||||
struct wl_listener destroy_listener;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Surface
|
|
||||||
{
|
|
||||||
EINA_INLIST;
|
|
||||||
Ecore_Window id;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_client *client;
|
|
||||||
struct wl_resource *surface;
|
|
||||||
struct wl_signal destroy_signal;
|
|
||||||
struct wl_list link, frames;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
E_Wayland_Buffer *buffer;
|
|
||||||
struct wl_listener buffer_destroy;
|
|
||||||
struct wl_list frames;
|
|
||||||
Evas_Coord x, y;
|
|
||||||
Eina_Bool new_buffer : 1;
|
|
||||||
pixman_region32_t damage, opaque, input;
|
|
||||||
} pending;
|
|
||||||
|
|
||||||
E_Wayland_Buffer_Reference buffer_reference;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Evas_Coord x, y;
|
|
||||||
Evas_Coord w, h;
|
|
||||||
Eina_Bool changed : 1;
|
|
||||||
} geometry;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
pixman_region32_t opaque, input;
|
|
||||||
pixman_region32_t damage, clip;
|
|
||||||
} region;
|
|
||||||
|
|
||||||
E_Client *ec;
|
|
||||||
E_Pixmap *pixmap;
|
|
||||||
Eina_Inlist *buffers;
|
|
||||||
|
|
||||||
E_Wayland_Shell_Surface *shell_surface;
|
|
||||||
Eina_Bool mapped : 1;
|
|
||||||
Eina_Bool updates : 1; //surface has render updates
|
|
||||||
|
|
||||||
E_Wayland_Input *input;
|
|
||||||
|
|
||||||
void (*map) (E_Wayland_Surface *ews, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
|
|
||||||
void (*unmap) (E_Wayland_Surface *ews);
|
|
||||||
void (*configure) (E_Wayland_Surface *ews, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Shell_Surface
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_resource *resource;
|
|
||||||
struct wl_listener surface_destroy;
|
|
||||||
struct wl_signal destroy_signal;
|
|
||||||
struct wl_list link;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Evas_Coord x, y;
|
|
||||||
Evas_Coord w, h;
|
|
||||||
Eina_Bool valid : 1;
|
|
||||||
} saved;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_pointer_grab grab;
|
|
||||||
struct wl_seat *seat;
|
|
||||||
struct wl_listener parent_destroy;
|
|
||||||
int x, y;
|
|
||||||
Eina_Bool up : 1;
|
|
||||||
unsigned int serial;
|
|
||||||
} popup;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Evas_Coord x, y;
|
|
||||||
unsigned int flags;
|
|
||||||
} transient;
|
|
||||||
|
|
||||||
E_Wayland_Surface *surface, *parent;
|
|
||||||
E_Wayland_Shell_Surface_Type type, next_type;
|
|
||||||
|
|
||||||
Eina_Stringshare *title, *clas;
|
|
||||||
|
|
||||||
Eina_Bool active : 1;
|
|
||||||
|
|
||||||
void *shell;
|
|
||||||
void *ping_timer;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Shell_Interface
|
|
||||||
{
|
|
||||||
void *shell;
|
|
||||||
|
|
||||||
E_Wayland_Shell_Surface *(*shell_surface_create) (void *shell, E_Wayland_Surface *ews, const void *client);
|
|
||||||
void (*toplevel_set) (E_Wayland_Shell_Surface *ewss);
|
|
||||||
void (*transient_set) (E_Wayland_Shell_Surface *ewss, E_Wayland_Surface *ews, int x, int y, unsigned int flags);
|
|
||||||
void (*fullscreen_set) (E_Wayland_Shell_Surface *ewss, unsigned int method, unsigned int framerate, void *output);
|
|
||||||
void (*popup_set) (E_Wayland_Shell_Surface *ewss, E_Wayland_Surface *ews, void *seat, unsigned int serial, int x, int y, unsigned int flags);
|
|
||||||
void (*maximized_set) (E_Wayland_Shell_Surface *ewss, unsigned int edges);
|
|
||||||
int (*move) (E_Wayland_Shell_Surface *ewss, void *seat);
|
|
||||||
int (*resize) (E_Wayland_Shell_Surface *ewss, void *seat, unsigned int edges);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Shell_Grab
|
|
||||||
{
|
|
||||||
struct wl_pointer_grab grab;
|
|
||||||
Evas_Coord x, y, w, h;
|
|
||||||
unsigned int edges;
|
|
||||||
|
|
||||||
E_Wayland_Shell_Surface *shell_surface;
|
|
||||||
struct wl_listener shell_surface_destroy;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Keyboard_Info
|
|
||||||
{
|
|
||||||
struct xkb_keymap *keymap;
|
|
||||||
int fd;
|
|
||||||
size_t size;
|
|
||||||
char *area;
|
|
||||||
xkb_mod_index_t mod_shift, mod_caps, mod_ctrl, mod_alt, mod_super;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Input
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_seat seat;
|
|
||||||
struct wl_pointer pointer;
|
|
||||||
struct wl_keyboard keyboard;
|
|
||||||
struct wl_resource *keyboard_resource;
|
|
||||||
struct wl_list link;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
E_Wayland_Keyboard_Info *info;
|
|
||||||
struct xkb_state *state;
|
|
||||||
} xkb;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
E_Wayland_Surface *surface;
|
|
||||||
struct wl_listener surface_destroy;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Evas_Coord x, y;
|
|
||||||
} hot;
|
|
||||||
} pointer;
|
|
||||||
|
|
||||||
Eina_Bool has_pointer : 1;
|
|
||||||
Eina_Bool has_keyboard : 1;
|
|
||||||
Eina_Bool has_touch : 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Compositor
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_display *display;
|
|
||||||
struct wl_event_loop *loop;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_signal destroy;
|
|
||||||
struct wl_signal activate;
|
|
||||||
struct wl_signal kill;
|
|
||||||
struct wl_signal seat;
|
|
||||||
} signals;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct xkb_rule_names names;
|
|
||||||
struct xkb_context *context;
|
|
||||||
} xkb;
|
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND_EGL
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
EGLDisplay display;
|
|
||||||
EGLContext context;
|
|
||||||
EGLConfig config;
|
|
||||||
PFNEGLBINDWAYLANDDISPLAYWL bind_display;
|
|
||||||
PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display;
|
|
||||||
Eina_Bool bound : 1;
|
|
||||||
} egl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
E_Wayland_Shell_Interface shell_interface;
|
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND_ONLY
|
|
||||||
Eina_Bool focus : 1;
|
|
||||||
|
|
||||||
unsigned int output_pool;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Ecore_Event_Handler *kbd_handler;
|
|
||||||
Ecore_Fd_Handler *fd_handler;
|
|
||||||
Ecore_Idler *idler;
|
|
||||||
|
|
||||||
E_Wayland_Input *input;
|
|
||||||
|
|
||||||
Eina_Inlist *surfaces;
|
|
||||||
Eina_List *seats;
|
|
||||||
|
|
||||||
void (*ping_cb) (E_Wayland_Surface *ews, unsigned int serial);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Output
|
|
||||||
{
|
|
||||||
unsigned int id;
|
|
||||||
|
|
||||||
void *render_state;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_list link;
|
|
||||||
struct wl_list resources;
|
|
||||||
struct wl_global *global;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
E_Wayland_Compositor *compositor;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Evas_Coord x, y, w, h;
|
|
||||||
Evas_Coord mm_w, mm_h;
|
|
||||||
} geometry;
|
|
||||||
|
|
||||||
pixman_region32_t region, prev_damage;
|
|
||||||
|
|
||||||
Eina_Bool repaint_needed : 1;
|
|
||||||
Eina_Bool repaint_scheduled : 1;
|
|
||||||
|
|
||||||
Eina_Bool dirty : 1;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_signal sig;
|
|
||||||
unsigned int timestamp;
|
|
||||||
} frame;
|
|
||||||
|
|
||||||
char *make, *model;
|
|
||||||
unsigned int subpixel, transform;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
E_Wayland_Output_Mode *current;
|
|
||||||
E_Wayland_Output_Mode *origin;
|
|
||||||
struct wl_list list;
|
|
||||||
} mode;
|
|
||||||
|
|
||||||
void (*repaint) (E_Wayland_Output *output, pixman_region32_t *damage);
|
|
||||||
void (*destroy) (E_Wayland_Output *output);
|
|
||||||
int (*switch_mode) (E_Wayland_Output *output, E_Wayland_Output_Mode *mode);
|
|
||||||
|
|
||||||
/* TODO: add backlight support */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Output_Mode
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_list link;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
unsigned int flags;
|
|
||||||
Evas_Coord w, h;
|
|
||||||
unsigned int refresh;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Terminal
|
|
||||||
{
|
|
||||||
E_Wayland_Compositor *compositor;
|
|
||||||
|
|
||||||
int fd, kbd_mode;
|
|
||||||
|
|
||||||
struct termios attributes;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_event_source *input;
|
|
||||||
struct wl_event_source *vt;
|
|
||||||
} wl;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void (*func) (E_Wayland_Compositor *compositor, int event);
|
|
||||||
int current, starting;
|
|
||||||
Eina_Bool exists : 1;
|
|
||||||
} vt;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Plane
|
|
||||||
{
|
|
||||||
pixman_region32_t damage, clip;
|
|
||||||
Evas_Coord x, y;
|
|
||||||
struct wl_list link;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* external variables */
|
|
||||||
extern EAPI E_Wayland_Compositor *_e_wl_comp;
|
|
||||||
|
|
||||||
EAPI Eina_Bool e_comp_wl_init(void);
|
|
||||||
EINTERN void e_comp_wl_shutdown(void);
|
|
||||||
|
|
||||||
#ifdef HAVE_WAYLAND_ONLY
|
|
||||||
EAPI int e_comp_wl_input_read(int fd EINA_UNUSED, unsigned int mask EINA_UNUSED, void *data);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EAPI void wl_seat_init(struct wl_seat *seat);
|
|
||||||
EAPI void wl_seat_release(struct wl_seat *seat);
|
|
||||||
|
|
||||||
EAPI void wl_seat_set_pointer(struct wl_seat *seat, struct wl_pointer *pointer);
|
|
||||||
EAPI void wl_seat_set_keyboard(struct wl_seat *seat, struct wl_keyboard *keyboard);
|
|
||||||
EAPI void wl_seat_set_touch(struct wl_seat *seat, struct wl_touch *touch);
|
|
||||||
|
|
||||||
EAPI void wl_pointer_init(struct wl_pointer *pointer);
|
|
||||||
EAPI void wl_pointer_set_focus(struct wl_pointer *pointer, struct wl_resource *surface, wl_fixed_t sx, wl_fixed_t sy);
|
|
||||||
EAPI void wl_pointer_start_grab(struct wl_pointer *pointer, struct wl_pointer_grab *grab);
|
|
||||||
EAPI void wl_pointer_end_grab(struct wl_pointer *pointer);
|
|
||||||
|
|
||||||
EAPI void wl_keyboard_init(struct wl_keyboard *keyboard);
|
|
||||||
EAPI void wl_keyboard_set_focus(struct wl_keyboard *keyboard, struct wl_resource *surface);
|
|
||||||
EAPI void wl_keyboard_start_grab(struct wl_keyboard *device, struct wl_keyboard_grab *grab);
|
|
||||||
EAPI void wl_keyboard_end_grab(struct wl_keyboard *keyboard);
|
|
||||||
|
|
||||||
EAPI void wl_touch_init(struct wl_touch *touch);
|
|
||||||
EAPI void wl_touch_start_grab(struct wl_touch *device, struct wl_touch_grab *grab);
|
|
||||||
EAPI void wl_touch_end_grab(struct wl_touch *touch);
|
|
||||||
|
|
||||||
EAPI void wl_data_device_set_keyboard_focus(struct wl_seat *seat);
|
|
||||||
EAPI int wl_data_device_manager_init(struct wl_display *display);
|
|
||||||
EAPI struct wl_resource *wl_data_source_send_offer(struct wl_data_source *source, struct wl_resource *target);
|
|
||||||
EAPI void wl_seat_set_selection(struct wl_seat *seat, struct wl_data_source *source, uint32_t serial);
|
|
||||||
|
|
||||||
EAPI unsigned int e_comp_wl_time_get(void);
|
|
||||||
EAPI void e_comp_wl_input_modifiers_update(unsigned int serial);
|
|
||||||
|
|
||||||
EAPI void e_comp_wl_mouse_button(struct wl_resource *resource, uint32_t serial, uint32_t timestamp, uint32_t button, uint32_t state_w);
|
|
||||||
EAPI Eina_Bool e_comp_wl_cb_keymap_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED);
|
|
||||||
|
|
||||||
static inline uint64_t
|
|
||||||
e_comp_wl_id_get(uint32_t client, uint32_t surface)
|
|
||||||
{
|
|
||||||
return ((uint64_t)surface << 32) + (uint64_t)client;
|
|
||||||
}
|
|
||||||
|
|
||||||
# endif
|
|
||||||
#endif
|
|
|
@ -1,438 +0,0 @@
|
||||||
#include "e.h"
|
|
||||||
//#include "e_comp_wl.h"
|
|
||||||
#include "e_surface.h"
|
|
||||||
|
|
||||||
/* local structures */
|
|
||||||
typedef struct _E_Smart_Data E_Smart_Data;
|
|
||||||
struct _E_Smart_Data
|
|
||||||
{
|
|
||||||
/* canvas */
|
|
||||||
Evas *evas;
|
|
||||||
|
|
||||||
/* object geometry */
|
|
||||||
Evas_Coord x, y, w, h;
|
|
||||||
|
|
||||||
/* input geometry */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
Evas_Coord x, y, w, h;
|
|
||||||
} input;
|
|
||||||
|
|
||||||
/* main image object where we draw pixels to */
|
|
||||||
Evas_Object *o_img;
|
|
||||||
|
|
||||||
/* input rectangle */
|
|
||||||
Evas_Object *o_input;
|
|
||||||
|
|
||||||
double mouse_down_time;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* smart function prototypes */
|
|
||||||
static void _e_smart_add(Evas_Object *obj);
|
|
||||||
static void _e_smart_del(Evas_Object *obj);
|
|
||||||
static void _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
|
|
||||||
static void _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
|
|
||||||
static void _e_smart_show(Evas_Object *obj);
|
|
||||||
static void _e_smart_hide(Evas_Object *obj);
|
|
||||||
static void _e_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
|
|
||||||
static void _e_smart_clip_unset(Evas_Object *obj);
|
|
||||||
|
|
||||||
/* local function prototypes */
|
|
||||||
static void _e_surface_cb_focus_in(void *data, Evas *evas EINA_UNUSED, void *event EINA_UNUSED);
|
|
||||||
static void _e_surface_cb_focus_out(void *data, Evas *evas EINA_UNUSED, void *event EINA_UNUSED);
|
|
||||||
static void _e_surface_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
|
||||||
static void _e_surface_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
|
||||||
static void _e_surface_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
|
||||||
static void _e_surface_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
|
||||||
static void _e_surface_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event);
|
|
||||||
static void _e_surface_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj, void *event);
|
|
||||||
static void _e_surface_cb_key_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
|
||||||
static void _e_surface_cb_key_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event);
|
|
||||||
|
|
||||||
EAPI Evas_Object *
|
|
||||||
e_surface_add(Evas *evas)
|
|
||||||
{
|
|
||||||
/* Evas_Object *obj = NULL; */
|
|
||||||
/* E_Smart_Data *sd = NULL; */
|
|
||||||
|
|
||||||
static Evas_Smart *smart = NULL;
|
|
||||||
static const Evas_Smart_Class sc =
|
|
||||||
{
|
|
||||||
"smart_surface", EVAS_SMART_CLASS_VERSION,
|
|
||||||
_e_smart_add, _e_smart_del, _e_smart_move, _e_smart_resize,
|
|
||||||
_e_smart_show, _e_smart_hide, NULL,
|
|
||||||
_e_smart_clip_set, _e_smart_clip_unset,
|
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
/* create the smart class */
|
|
||||||
if (!smart)
|
|
||||||
if (!(smart = evas_smart_class_new(&sc)))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* create new smart object */
|
|
||||||
/* obj = evas_object_smart_add(evas, smart); */
|
|
||||||
|
|
||||||
/* get the smart data and set reference to the surface */
|
|
||||||
/* if ((sd = evas_object_smart_data_get(obj))) */
|
|
||||||
/* sd->ews = ews; */
|
|
||||||
|
|
||||||
/* return newly created smart object */
|
|
||||||
return evas_object_smart_add(evas, smart);
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
e_surface_input_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
sd->input.x = x;
|
|
||||||
sd->input.y = y;
|
|
||||||
sd->input.w = w;
|
|
||||||
sd->input.h = h;
|
|
||||||
|
|
||||||
if ((w >= 0) && (h >= 0))
|
|
||||||
{
|
|
||||||
if (sd->o_img) evas_object_pass_events_set(sd->o_img, EINA_TRUE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (sd->o_img) evas_object_pass_events_set(sd->o_img, EINA_FALSE);
|
|
||||||
|
|
||||||
/* update input rectangle geometry */
|
|
||||||
if (sd->o_input)
|
|
||||||
{
|
|
||||||
evas_object_move(sd->o_input, x, y);
|
|
||||||
evas_object_resize(sd->o_input, w, h);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
e_surface_damage_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
/* update the image damaged area */
|
|
||||||
if (sd->o_img)
|
|
||||||
evas_object_image_data_update_add(sd->o_img, x, y, w, h);
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
e_surface_image_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h, void *pixels)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
/* update the image damaged area */
|
|
||||||
if (sd->o_img)
|
|
||||||
{
|
|
||||||
evas_object_image_size_set(sd->o_img, w, h);
|
|
||||||
evas_object_image_data_copy_set(sd->o_img, pixels);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EAPI void
|
|
||||||
e_surface_border_input_set(Evas_Object *obj, E_Client *ec)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
//e_client_input_object_set(bd, sd->o_input);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* smart functions */
|
|
||||||
static void
|
|
||||||
_e_smart_add(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to allocate space for the smart data structure */
|
|
||||||
if (!(sd = E_NEW(E_Smart_Data, 1))) return;
|
|
||||||
|
|
||||||
/* get a reference to the canvas */
|
|
||||||
sd->evas = evas_object_evas_get(obj);
|
|
||||||
evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN,
|
|
||||||
_e_surface_cb_focus_in, obj);
|
|
||||||
evas_event_callback_add(sd->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT,
|
|
||||||
_e_surface_cb_focus_out, obj);
|
|
||||||
|
|
||||||
/* create the base input rectangle */
|
|
||||||
sd->o_input = evas_object_rectangle_add(sd->evas);
|
|
||||||
evas_object_color_set(sd->o_input, 0, 0, 0, 0);
|
|
||||||
evas_object_propagate_events_set(sd->o_input, EINA_FALSE);
|
|
||||||
evas_object_repeat_events_set(sd->o_input, EINA_FALSE);
|
|
||||||
|
|
||||||
/* we have to set focus to the input object first, or else Evas will
|
|
||||||
* never report any key events (up/down) to us */
|
|
||||||
evas_object_focus_set(sd->o_input, EINA_TRUE);
|
|
||||||
|
|
||||||
/* add the event callbacks we need to listen for */
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_MOUSE_IN,
|
|
||||||
_e_surface_cb_mouse_in, obj);
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_MOUSE_OUT,
|
|
||||||
_e_surface_cb_mouse_out, obj);
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_MOUSE_MOVE,
|
|
||||||
_e_surface_cb_mouse_move, obj);
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_MOUSE_DOWN,
|
|
||||||
_e_surface_cb_mouse_down, obj);
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_MOUSE_UP,
|
|
||||||
_e_surface_cb_mouse_up, obj);
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_MOUSE_WHEEL,
|
|
||||||
_e_surface_cb_mouse_wheel, obj);
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_KEY_DOWN,
|
|
||||||
_e_surface_cb_key_down, obj);
|
|
||||||
evas_object_event_callback_add(sd->o_input, EVAS_CALLBACK_KEY_UP,
|
|
||||||
_e_surface_cb_key_up, obj);
|
|
||||||
evas_object_smart_member_add(sd->o_input, obj);
|
|
||||||
|
|
||||||
/* create the image object */
|
|
||||||
sd->o_img = evas_object_image_filled_add(sd->evas);
|
|
||||||
evas_object_image_content_hint_set(sd->o_img, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
|
|
||||||
evas_object_image_scale_hint_set(sd->o_img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
|
|
||||||
evas_object_image_smooth_scale_set(sd->o_img, EINA_FALSE);
|
|
||||||
evas_object_image_alpha_set(sd->o_img, EINA_TRUE);
|
|
||||||
evas_object_pass_events_set(sd->o_img, EINA_FALSE);
|
|
||||||
evas_object_propagate_events_set(sd->o_img, EINA_FALSE);
|
|
||||||
evas_object_smart_member_add(sd->o_img, obj);
|
|
||||||
|
|
||||||
/* set the objects smart data */
|
|
||||||
evas_object_smart_data_set(obj, sd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_smart_del(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
/* delete the image object */
|
|
||||||
if (sd->o_img) evas_object_del(sd->o_img);
|
|
||||||
|
|
||||||
/* delete the input rectangle */
|
|
||||||
if (sd->o_input)
|
|
||||||
{
|
|
||||||
/* delete the callbacks */
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_MOUSE_IN,
|
|
||||||
_e_surface_cb_mouse_in);
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_MOUSE_OUT,
|
|
||||||
_e_surface_cb_mouse_out);
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_MOUSE_MOVE,
|
|
||||||
_e_surface_cb_mouse_move);
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_MOUSE_DOWN,
|
|
||||||
_e_surface_cb_mouse_down);
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_MOUSE_UP,
|
|
||||||
_e_surface_cb_mouse_up);
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_MOUSE_WHEEL,
|
|
||||||
_e_surface_cb_mouse_wheel);
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_KEY_DOWN,
|
|
||||||
_e_surface_cb_key_down);
|
|
||||||
evas_object_event_callback_del(sd->o_input, EVAS_CALLBACK_KEY_UP,
|
|
||||||
_e_surface_cb_key_up);
|
|
||||||
|
|
||||||
evas_object_del(sd->o_input);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* delete the event callbacks */
|
|
||||||
evas_event_callback_del(sd->evas, EVAS_CALLBACK_CANVAS_FOCUS_IN,
|
|
||||||
_e_surface_cb_focus_in);
|
|
||||||
evas_event_callback_del(sd->evas, EVAS_CALLBACK_CANVAS_FOCUS_OUT,
|
|
||||||
_e_surface_cb_focus_out);
|
|
||||||
|
|
||||||
/* free the allocated smart data structure */
|
|
||||||
E_FREE(sd);
|
|
||||||
|
|
||||||
/* set the objects smart data */
|
|
||||||
evas_object_smart_data_set(obj, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
if ((sd->x == x) && (sd->y == y)) return;
|
|
||||||
|
|
||||||
sd->x = x;
|
|
||||||
sd->y = y;
|
|
||||||
|
|
||||||
/* move the input rectangle */
|
|
||||||
if (sd->o_input)
|
|
||||||
evas_object_move(sd->o_input, sd->input.x, sd->input.y);
|
|
||||||
|
|
||||||
/* move the image object */
|
|
||||||
if (sd->o_img) evas_object_move(sd->o_img, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
if ((sd->w == w) && (sd->h == h)) return;
|
|
||||||
|
|
||||||
sd->w = w;
|
|
||||||
sd->h = h;
|
|
||||||
|
|
||||||
/* resize the input rectangle */
|
|
||||||
if (sd->o_input)
|
|
||||||
evas_object_resize(sd->o_input, sd->input.w, sd->input.h);
|
|
||||||
|
|
||||||
/* resize the image object */
|
|
||||||
if (sd->o_img) evas_object_resize(sd->o_img, w, h);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_smart_show(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
/* show the input rectangle */
|
|
||||||
if (sd->o_input) evas_object_show(sd->o_input);
|
|
||||||
|
|
||||||
/* show the image object */
|
|
||||||
if (sd->o_img) evas_object_show(sd->o_img);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_smart_hide(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
/* hide the input rectangle */
|
|
||||||
if (sd->o_input) evas_object_hide(sd->o_input);
|
|
||||||
|
|
||||||
/* hide the image object */
|
|
||||||
if (sd->o_img) evas_object_hide(sd->o_img);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_smart_clip_set(Evas_Object *obj, Evas_Object *clip)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
/* TODO: Hmmm, set clip on the input rectangle ?? */
|
|
||||||
|
|
||||||
/* set the clip on the image object */
|
|
||||||
if (sd->o_img) evas_object_clip_set(sd->o_img, clip);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_smart_clip_unset(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
|
||||||
|
|
||||||
/* TODO: Hmmm, unset clip on the input rectangle ?? */
|
|
||||||
|
|
||||||
/* unset the image object clip */
|
|
||||||
if (sd->o_img) evas_object_clip_unset(sd->o_img);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* local functions */
|
|
||||||
static void
|
|
||||||
_e_surface_cb_focus_in(void *data, Evas *evas EINA_UNUSED, void *event EINA_UNUSED)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "focus_in", NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_focus_out(void *data, Evas *evas EINA_UNUSED, void *event EINA_UNUSED)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "focus_out", NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "mouse_in", event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_mouse_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "mouse_out", event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "mouse_move", event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(data))) return;
|
|
||||||
|
|
||||||
/* grab the loop time for this mouse down event
|
|
||||||
*
|
|
||||||
* NB: we use this for comparison in the mouse_up callback due to
|
|
||||||
* some e_border grab shenanigans. Basically, this lets us ignore the
|
|
||||||
* spurious mouse_up that we get from e_border grabs */
|
|
||||||
sd->mouse_down_time = ecore_loop_time_get();
|
|
||||||
evas_object_smart_callback_call(data, "mouse_down", event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
E_Smart_Data *sd = NULL;
|
|
||||||
double timestamp;
|
|
||||||
|
|
||||||
/* try to get the objects smart data */
|
|
||||||
if (!(sd = evas_object_smart_data_get(data))) return;
|
|
||||||
|
|
||||||
timestamp = ecore_loop_time_get();
|
|
||||||
if (fabs(timestamp - sd->mouse_down_time) <= 0.010) return;
|
|
||||||
|
|
||||||
evas_object_smart_callback_call(data, "mouse_up", event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "mouse_wheel", event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_key_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "key_down", event);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_e_surface_cb_key_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
|
||||||
{
|
|
||||||
evas_object_smart_callback_call(data, "key_up", event);
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
#ifdef E_TYPEDEFS
|
|
||||||
#else
|
|
||||||
# ifndef E_SURFACE_H
|
|
||||||
# define E_SURFACE_H
|
|
||||||
|
|
||||||
EAPI Evas_Object *e_surface_add(Evas *evas);
|
|
||||||
EAPI void e_surface_input_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
|
|
||||||
EAPI void e_surface_damage_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
|
|
||||||
EAPI void e_surface_image_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h, void *pixels);
|
|
||||||
EAPI void e_surface_border_input_set(Evas_Object *obj, E_Client *ec);
|
|
||||||
|
|
||||||
# endif
|
|
||||||
#endif
|
|
|
@ -1,90 +0,0 @@
|
||||||
<protocol name="desktop">
|
|
||||||
|
|
||||||
<interface name="e_desktop_shell" version="2">
|
|
||||||
<request name="set_background">
|
|
||||||
<arg name="output" type="object" interface="wl_output"/>
|
|
||||||
<arg name="surface" type="object" interface="wl_surface"/>
|
|
||||||
</request>
|
|
||||||
|
|
||||||
<request name="set_panel">
|
|
||||||
<arg name="output" type="object" interface="wl_output"/>
|
|
||||||
<arg name="surface" type="object" interface="wl_surface"/>
|
|
||||||
</request>
|
|
||||||
|
|
||||||
<request name="set_lock_surface">
|
|
||||||
<arg name="surface" type="object" interface="wl_surface"/>
|
|
||||||
</request>
|
|
||||||
|
|
||||||
<request name="unlock"/>
|
|
||||||
|
|
||||||
<request name="set_grab_surface">
|
|
||||||
<arg name="surface" type="object" interface="wl_surface"/>
|
|
||||||
</request>
|
|
||||||
|
|
||||||
<request name="desktop_ready" since="2">
|
|
||||||
<description summary="desktop is ready to be shown">
|
|
||||||
Tell the server, that enough desktop elements have been drawn
|
|
||||||
to make the desktop look ready for use. During start-up, the
|
|
||||||
server can wait for this request with a black screen before
|
|
||||||
starting to fade in the desktop, for instance. If the client
|
|
||||||
parts of a desktop take a long time to initialize, we avoid
|
|
||||||
showing temporary garbage.
|
|
||||||
</description>
|
|
||||||
</request>
|
|
||||||
|
|
||||||
<!-- We'll fold most of wl_shell into this interface and then
|
|
||||||
they'll share the configure event. -->
|
|
||||||
<event name="configure">
|
|
||||||
<arg name="edges" type="uint"/>
|
|
||||||
<arg name="surface" type="object" interface="wl_surface"/>
|
|
||||||
<arg name="width" type="int"/>
|
|
||||||
<arg name="height" type="int"/>
|
|
||||||
</event>
|
|
||||||
|
|
||||||
<!-- Tell the shell we want it to create and set the lock surface,
|
|
||||||
which is a GUI asking the user to unlock the screen. The lock
|
|
||||||
surface is announced with 'set_lock_surface'. Whether or not
|
|
||||||
the shell actually implements locking, it MUST send 'unlock'
|
|
||||||
request to let the normal desktop resume. -->
|
|
||||||
<event name="prepare_lock_surface"/>
|
|
||||||
<event name="grab_cursor">
|
|
||||||
<arg name="cursor" type="uint"/>
|
|
||||||
</event>
|
|
||||||
|
|
||||||
<enum name="cursor">
|
|
||||||
<entry name="none" value="0"/>
|
|
||||||
|
|
||||||
<entry name="resize_top" value="1"/>
|
|
||||||
<entry name="resize_bottom" value="2"/>
|
|
||||||
|
|
||||||
<entry name="arrow" value="3"/>
|
|
||||||
|
|
||||||
<entry name="resize_left" value="4"/>
|
|
||||||
<entry name="resize_top_left" value="5"/>
|
|
||||||
<entry name="resize_bottom_left" value="6"/>
|
|
||||||
|
|
||||||
<entry name="move" value="7"/>
|
|
||||||
|
|
||||||
<entry name="resize_right" value="8"/>
|
|
||||||
<entry name="resize_top_right" value="9"/>
|
|
||||||
<entry name="resize_bottom_right" value="10"/>
|
|
||||||
|
|
||||||
<entry name="busy" value="11"/>
|
|
||||||
</enum>
|
|
||||||
|
|
||||||
</interface>
|
|
||||||
|
|
||||||
<!-- Only one client can bind this interface at a time. -->
|
|
||||||
<interface name="screensaver" version="1">
|
|
||||||
|
|
||||||
<!-- Set the surface type as a screensaver for a particular output.
|
|
||||||
A screensaver surface is normally hidden, and only visible after
|
|
||||||
an idle timeout. -->
|
|
||||||
<request name="set_surface">
|
|
||||||
<arg name="surface" type="object" interface="wl_surface"/>
|
|
||||||
<arg name="output" type="object" interface="wl_output"/>
|
|
||||||
</request>
|
|
||||||
|
|
||||||
</interface>
|
|
||||||
|
|
||||||
</protocol>
|
|
|
@ -1,61 +0,0 @@
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "wayland-util.h"
|
|
||||||
|
|
||||||
extern const struct wl_interface wl_output_interface;
|
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_output_interface;
|
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_surface_interface;
|
|
||||||
extern const struct wl_interface wl_output_interface;
|
|
||||||
|
|
||||||
static const struct wl_interface *types[] = {
|
|
||||||
NULL,
|
|
||||||
&wl_output_interface,
|
|
||||||
&wl_surface_interface,
|
|
||||||
&wl_output_interface,
|
|
||||||
&wl_surface_interface,
|
|
||||||
&wl_surface_interface,
|
|
||||||
&wl_surface_interface,
|
|
||||||
NULL,
|
|
||||||
&wl_surface_interface,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
&wl_surface_interface,
|
|
||||||
&wl_output_interface,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct wl_message e_desktop_shell_requests[] = {
|
|
||||||
{ "set_background", "oo", types + 1 },
|
|
||||||
{ "set_panel", "oo", types + 3 },
|
|
||||||
{ "set_lock_surface", "o", types + 5 },
|
|
||||||
{ "unlock", "", types + 0 },
|
|
||||||
{ "set_grab_surface", "o", types + 6 },
|
|
||||||
{ "desktop_ready", "2", types + 0 },
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct wl_message e_desktop_shell_events[] = {
|
|
||||||
{ "configure", "2uoii", types + 7 },
|
|
||||||
{ "prepare_lock_surface", "2", types + 0 },
|
|
||||||
{ "grab_cursor", "2u", types + 0 },
|
|
||||||
};
|
|
||||||
|
|
||||||
WL_EXPORT const struct wl_interface e_desktop_shell_interface = {
|
|
||||||
"e_desktop_shell", 2,
|
|
||||||
6, e_desktop_shell_requests,
|
|
||||||
3, e_desktop_shell_events,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct wl_message screensaver_requests[] = {
|
|
||||||
{ "set_surface", "oo", types + 11 },
|
|
||||||
};
|
|
||||||
|
|
||||||
WL_EXPORT const struct wl_interface screensaver_interface = {
|
|
||||||
"screensaver", 1,
|
|
||||||
1, screensaver_requests,
|
|
||||||
0, NULL,
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,131 +0,0 @@
|
||||||
#ifndef DESKTOP_SERVER_PROTOCOL_H
|
|
||||||
#define DESKTOP_SERVER_PROTOCOL_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include "wayland-util.h"
|
|
||||||
|
|
||||||
struct wl_client;
|
|
||||||
struct wl_resource;
|
|
||||||
|
|
||||||
/* struct e_desktop_shell; */
|
|
||||||
/* struct screensaver; */
|
|
||||||
|
|
||||||
extern const struct wl_interface e_desktop_shell_interface;
|
|
||||||
extern const struct wl_interface screensaver_interface;
|
|
||||||
|
|
||||||
#ifndef E_DESKTOP_SHELL_CURSOR_ENUM
|
|
||||||
#define E_DESKTOP_SHELL_CURSOR_ENUM
|
|
||||||
enum e_desktop_shell_cursor {
|
|
||||||
E_DESKTOP_SHELL_CURSOR_NONE = 0,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_TOP = 1,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM = 2,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_ARROW = 3,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_LEFT = 4,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_TOP_LEFT = 5,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_LEFT = 6,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_MOVE = 7,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_RIGHT = 8,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_TOP_RIGHT = 9,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_RIGHT = 10,
|
|
||||||
E_DESKTOP_SHELL_CURSOR_BUSY = 11,
|
|
||||||
};
|
|
||||||
#endif /* E_DESKTOP_SHELL_CURSOR_ENUM */
|
|
||||||
|
|
||||||
struct e_desktop_shell_interface {
|
|
||||||
/**
|
|
||||||
* set_background - (none)
|
|
||||||
* @output: (none)
|
|
||||||
* @surface: (none)
|
|
||||||
*/
|
|
||||||
void (*set_background)(struct wl_client *client,
|
|
||||||
struct wl_resource *resource,
|
|
||||||
struct wl_resource *output,
|
|
||||||
struct wl_resource *surface);
|
|
||||||
/**
|
|
||||||
* set_panel - (none)
|
|
||||||
* @output: (none)
|
|
||||||
* @surface: (none)
|
|
||||||
*/
|
|
||||||
void (*set_panel)(struct wl_client *client,
|
|
||||||
struct wl_resource *resource,
|
|
||||||
struct wl_resource *output,
|
|
||||||
struct wl_resource *surface);
|
|
||||||
/**
|
|
||||||
* set_lock_surface - (none)
|
|
||||||
* @surface: (none)
|
|
||||||
*/
|
|
||||||
void (*set_lock_surface)(struct wl_client *client,
|
|
||||||
struct wl_resource *resource,
|
|
||||||
struct wl_resource *surface);
|
|
||||||
/**
|
|
||||||
* unlock - (none)
|
|
||||||
*/
|
|
||||||
void (*unlock)(struct wl_client *client,
|
|
||||||
struct wl_resource *resource);
|
|
||||||
/**
|
|
||||||
* set_grab_surface - (none)
|
|
||||||
* @surface: (none)
|
|
||||||
*/
|
|
||||||
void (*set_grab_surface)(struct wl_client *client,
|
|
||||||
struct wl_resource *resource,
|
|
||||||
struct wl_resource *surface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* desktop_ready - desktop is ready to be shown
|
|
||||||
*
|
|
||||||
* Tell the server, that enough desktop elements have been drawn
|
|
||||||
* to make the desktop look ready for use. During start-up, the
|
|
||||||
* server can wait for this request with a black screen before
|
|
||||||
* starting to fade in the desktop, for instance. If the client
|
|
||||||
* parts of a desktop take a long time to initialize, we avoid
|
|
||||||
* showing temporary garbage.
|
|
||||||
* @since: 2
|
|
||||||
*/
|
|
||||||
void (*desktop_ready)(struct wl_client *client,
|
|
||||||
struct wl_resource *resource);
|
|
||||||
};
|
|
||||||
|
|
||||||
#define E_DESKTOP_SHELL_CONFIGURE 0
|
|
||||||
#define E_DESKTOP_SHELL_PREPARE_LOCK_SURFACE 1
|
|
||||||
#define E_DESKTOP_SHELL_GRAB_CURSOR 2
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
e_desktop_shell_send_configure(struct wl_resource *resource_, uint32_t edges, struct wl_resource *surface, int32_t width, int32_t height)
|
|
||||||
{
|
|
||||||
wl_resource_post_event(resource_, E_DESKTOP_SHELL_CONFIGURE, edges, surface, width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
e_desktop_shell_send_prepare_lock_surface(struct wl_resource *resource_)
|
|
||||||
{
|
|
||||||
wl_resource_post_event(resource_, E_DESKTOP_SHELL_PREPARE_LOCK_SURFACE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
e_desktop_shell_send_grab_cursor(struct wl_resource *resource_, uint32_t cursor)
|
|
||||||
{
|
|
||||||
wl_resource_post_event(resource_, E_DESKTOP_SHELL_GRAB_CURSOR, cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct screensaver_interface {
|
|
||||||
/**
|
|
||||||
* set_surface - (none)
|
|
||||||
* @surface: (none)
|
|
||||||
* @output: (none)
|
|
||||||
*/
|
|
||||||
void (*set_surface)(struct wl_client *client,
|
|
||||||
struct wl_resource *resource,
|
|
||||||
struct wl_resource *surface,
|
|
||||||
struct wl_resource *output);
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,39 +0,0 @@
|
||||||
#ifndef E_MOD_MAIN_H
|
|
||||||
# define E_MOD_MAIN_H
|
|
||||||
|
|
||||||
# define SLOGFNS 1
|
|
||||||
|
|
||||||
# ifdef SLOGFNS
|
|
||||||
# include <stdio.h>
|
|
||||||
# define SLOGFN(fl, ln, fn) printf("-E-SHELL: %25s: %5i - %s\n", fl, ln, fn);
|
|
||||||
# else
|
|
||||||
# define SLOGFN(fl, ln, fn)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
typedef struct _E_Wayland_Desktop_Shell E_Wayland_Desktop_Shell;
|
|
||||||
typedef struct _E_Wayland_Ping_Timer E_Wayland_Ping_Timer;
|
|
||||||
|
|
||||||
struct _E_Wayland_Desktop_Shell
|
|
||||||
{
|
|
||||||
E_Wayland_Compositor *compositor;
|
|
||||||
E_Wayland_Surface *grab_surface;
|
|
||||||
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct wl_resource *resource;
|
|
||||||
struct wl_listener destroy_listener;
|
|
||||||
} wl;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _E_Wayland_Ping_Timer
|
|
||||||
{
|
|
||||||
struct wl_event_source *source;
|
|
||||||
unsigned int serial;
|
|
||||||
};
|
|
||||||
|
|
||||||
EAPI extern E_Module_Api e_modapi;
|
|
||||||
|
|
||||||
EAPI void *e_modapi_init(E_Module *m);
|
|
||||||
EAPI int e_modapi_shutdown(E_Module *m);
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue