E_Comp (wayland): Update comp module code for recent wayland changes.

SVN revision: 68285
This commit is contained in:
Christopher Michael 2012-02-22 19:26:10 +00:00
parent 0e5f759b51
commit 6daa7d8d98
3 changed files with 33 additions and 15 deletions

View File

@ -98,7 +98,7 @@ struct _Wayland_Shell_Surface
struct struct
{ {
struct wl_grab grab; struct wl_pointer_grab grab;
uint32_t timestamp; uint32_t timestamp;
int32_t x, y; int32_t x, y;
} popup; } popup;

View File

@ -190,18 +190,18 @@ e_mod_comp_wl_comp_repick(struct wl_input_device *device, uint32_t timestamp)
if (!ws) return; if (!ws) return;
if (&ws->surface != device->current) if (&ws->surface != device->current)
{ {
const struct wl_grab_interface *interface; const struct wl_pointer_grab_interface *interface;
interface = device->grab->interface; interface = device->pointer_grab->interface;
interface->focus(device->grab, timestamp, &ws->surface, interface->focus(device->pointer_grab, timestamp, &ws->surface,
device->current_x, device->current_y); device->current_x, device->current_y);
device->current = &ws->surface; device->current = &ws->surface;
} }
if ((focus = (Wayland_Surface *)device->grab->focus)) if ((focus = (Wayland_Surface *)device->pointer_grab->focus))
{ {
device->grab->x = device->x - focus->x; device->pointer_grab->x = device->x - focus->x;
device->grab->y = device->y - focus->y; device->pointer_grab->y = device->y - focus->y;
} }
} }
@ -433,7 +433,7 @@ _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e
Wayland_Input *input; Wayland_Input *input;
Ecore_Event_Mouse_Move *ev; Ecore_Event_Mouse_Move *ev;
struct wl_input_device *device; struct wl_input_device *device;
const struct wl_grab_interface *interface; const struct wl_pointer_grab_interface *interface;
uint32_t timestamp; uint32_t timestamp;
// LOGFN(__FILE__, __LINE__, __FUNCTION__); // LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -449,8 +449,9 @@ _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e
timestamp = e_mod_comp_wl_time_get(); timestamp = e_mod_comp_wl_time_get();
e_mod_comp_wl_comp_repick(device, timestamp); e_mod_comp_wl_comp_repick(device, timestamp);
interface = device->grab->interface; interface = device->pointer_grab->interface;
interface->motion(device->grab, timestamp, device->grab->x, device->grab->y); interface->motion(device->pointer_grab, timestamp,
device->pointer_grab->x, device->pointer_grab->y);
return ECORE_CALLBACK_PASS_ON; return ECORE_CALLBACK_PASS_ON;
} }
@ -496,7 +497,8 @@ _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e
device->button_count++; device->button_count++;
/* TODO: Run binding ?? */ /* TODO: Run binding ?? */
device->grab->interface->button(device->grab, timestamp, btn, 1); device->pointer_grab->interface->button(device->pointer_grab,
timestamp, btn, 1);
return ECORE_CALLBACK_PASS_ON; return ECORE_CALLBACK_PASS_ON;
} }
@ -535,7 +537,8 @@ _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *eve
/* TODO: Run binding ?? */ /* TODO: Run binding ?? */
timestamp = e_mod_comp_wl_time_get(); timestamp = e_mod_comp_wl_time_get();
device->grab->interface->button(device->grab, timestamp, btn, 0); device->pointer_grab->interface->button(device->pointer_grab,
timestamp, btn, 0);
return ECORE_CALLBACK_PASS_ON; return ECORE_CALLBACK_PASS_ON;
} }

View File

@ -23,8 +23,9 @@ static void _e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED_
static void _e_mod_comp_wl_shell_surface_resize(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp, uint32_t edges); static void _e_mod_comp_wl_shell_surface_resize(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp, uint32_t edges);
static void _e_mod_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource); static void _e_mod_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource);
static void _e_mod_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__); static void _e_mod_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__);
static void _e_mod_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource); static void _e_mod_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource, uint32_t method __UNUSED__, uint32_t framerate __UNUSED__, struct wl_resource *output_resource __UNUSED__);
static void _e_mod_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource __UNUSED__, uint32_t timestamp __UNUSED__, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__); static void _e_mod_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource __UNUSED__, uint32_t timestamp __UNUSED__, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__);
static void _e_mod_comp_wl_shell_surface_set_maximized(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__);
static void _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp); static void _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp);
static Wayland_Shell_Surface *_e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws); static Wayland_Shell_Surface *_e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws);
@ -42,7 +43,8 @@ static const struct wl_shell_surface_interface _wl_shell_surface_interface =
_e_mod_comp_wl_shell_surface_set_toplevel, _e_mod_comp_wl_shell_surface_set_toplevel,
_e_mod_comp_wl_shell_surface_set_transient, _e_mod_comp_wl_shell_surface_set_transient,
_e_mod_comp_wl_shell_surface_set_fullscreen, _e_mod_comp_wl_shell_surface_set_fullscreen,
_e_mod_comp_wl_shell_surface_set_popup _e_mod_comp_wl_shell_surface_set_popup,
_e_mod_comp_wl_shell_surface_set_maximized
}; };
/* private variables */ /* private variables */
@ -336,7 +338,7 @@ _e_mod_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__,
} }
static void static void
_e_mod_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource) _e_mod_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__, struct wl_resource *resource, uint32_t method __UNUSED__, uint32_t framerate __UNUSED__, struct wl_resource *output_resource __UNUSED__)
{ {
Wayland_Shell_Surface *wss; Wayland_Shell_Surface *wss;
Wayland_Surface *ws; Wayland_Surface *ws;
@ -373,6 +375,19 @@ _e_mod_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, stru
wss->popup.y = y; wss->popup.y = y;
} }
static void
_e_mod_comp_wl_shell_surface_set_maximized(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__)
{
Wayland_Shell_Surface *wss;
Wayland_Surface *ws;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
wss = resource->data;
ws = wss->surface;
/* FIXME: Implement */
}
static void static void
_e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp) _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp)
{ {