formatting

SVN revision: 72976
This commit is contained in:
Mike Blumenkrantz 2012-06-28 07:03:44 +00:00
parent 9ef96e2b07
commit e666e4f19e
13 changed files with 579 additions and 554 deletions

View File

@ -95,7 +95,7 @@ struct _E_Comp_Win
double last_draw_time; // last time window was damaged
int pending_count; // pending event count
unsigned int opacity; // opacity set with _NET_WM_WINDOW_OPACITY
char *title, *name, *clas, *role; // fetched for override-redirect windowa
@ -111,7 +111,7 @@ struct _E_Comp_Win
Eina_Bool delete_me : 1; // delete me!
Eina_Bool visible : 1; // is visible
Eina_Bool input_only : 1; // is input_only
Eina_Bool override : 1; // is override-redirect
Eina_Bool argb : 1; // is argb
Eina_Bool shaped : 1; // is shaped
@ -120,7 +120,7 @@ struct _E_Comp_Win
Eina_Bool shape_changed : 1; // shape changed
Eina_Bool native : 1; // native
Eina_Bool drawme : 1; // drawme flag fo syncing rendering
Eina_Bool invalid : 1; // invalid depth used - just use as marker
Eina_Bool nocomp : 1; // nocomp applied
Eina_Bool needpix : 1; // need new pixmap
@ -128,7 +128,7 @@ struct _E_Comp_Win
Eina_Bool real_hid : 1; // last hide was a real window unmap
Eina_Bool inhash : 1; // is in the windows hash
Eina_Bool show_ready : 1; // is this window ready for its first show
Eina_Bool show_anim : 1; // ran show animation
Eina_Bool show_anim : 1; // ran show animation
};
static Eina_List *handlers = NULL;
@ -148,21 +148,21 @@ static Eina_Hash *damages = NULL;
static void _e_mod_comp_win_ready_timeout_setup(E_Comp_Win *cw);
static void _e_mod_comp_render_queue(E_Comp *c);
static void _e_mod_comp_win_damage(E_Comp_Win *cw,
int x,
int y,
int w,
int h,
Eina_Bool dmg);
int x,
int y,
int w,
int h,
Eina_Bool dmg);
static void _e_mod_comp_win_render_queue(E_Comp_Win *cw);
static void _e_mod_comp_win_del(E_Comp_Win *cw);
static void _e_mod_comp_win_real_hide(E_Comp_Win *cw);
static void _e_mod_comp_win_hide(E_Comp_Win *cw);
static void _e_mod_comp_win_configure(E_Comp_Win *cw,
int x,
int y,
int w,
int h,
int border);
int x,
int y,
int w,
int h,
int border);
static void
_e_mod_comp_child_show(E_Comp_Win *cw)
@ -178,7 +178,7 @@ _e_mod_comp_child_show(E_Comp_Win *cw)
E_Comp_Win *tcw;
tcw = eina_hash_find(borders, e_util_winid_str_get(tmp->client.win));
if (!tcw) continue ;
if (!tcw) continue;
evas_object_show(tcw->shobj);
}
@ -199,7 +199,7 @@ _e_mod_comp_child_hide(E_Comp_Win *cw)
E_Comp_Win *tcw;
tcw = eina_hash_find(borders, e_util_winid_str_get(tmp->client.win));
if (!tcw) continue ;
if (!tcw) continue;
evas_object_hide(tcw->shobj);
}
@ -244,10 +244,10 @@ _e_mod_comp_fullscreen_check(E_Comp *c)
}
static inline Eina_Bool
_e_mod_comp_shaped_check(int w,
int h,
_e_mod_comp_shaped_check(int w,
int h,
const Ecore_X_Rectangle *rects,
int num)
int num)
{
if ((!rects) || (num < 1)) return EINA_FALSE;
if (num > 1) return EINA_TRUE;
@ -258,17 +258,17 @@ _e_mod_comp_shaped_check(int w,
}
static inline Eina_Bool
_e_mod_comp_win_shaped_check(const E_Comp_Win *cw,
_e_mod_comp_win_shaped_check(const E_Comp_Win *cw,
const Ecore_X_Rectangle *rects,
int num)
int num)
{
return _e_mod_comp_shaped_check(cw->w, cw->h, rects, num);
}
static void
_e_mod_comp_win_shape_rectangles_apply(E_Comp_Win *cw,
_e_mod_comp_win_shape_rectangles_apply(E_Comp_Win *cw,
const Ecore_X_Rectangle *rects,
int num)
int num)
{
Eina_List *l;
Evas_Object *o;
@ -409,17 +409,17 @@ _e_mod_comp_cb_win_show_ready_timeout(void *data)
cw->show_ready = 1;
if (cw->visible)
{
if (!cw->update)
{
if (cw->update_timeout)
{
ecore_timer_del(cw->update_timeout);
cw->update_timeout = NULL;
}
cw->update = 1;
cw->c->updates = eina_list_append(cw->c->updates, cw);
}
_e_mod_comp_win_render_queue(cw);
if (!cw->update)
{
if (cw->update_timeout)
{
ecore_timer_del(cw->update_timeout);
cw->update_timeout = NULL;
}
cw->update = 1;
cw->c->updates = eina_list_append(cw->c->updates, cw);
}
_e_mod_comp_win_render_queue(cw);
}
cw->ready_timeout = NULL;
return ECORE_CALLBACK_CANCEL;
@ -443,7 +443,7 @@ _e_mod_comp_win_ready_timeout_setup(E_Comp_Win *cw)
else
{
cw->ready_timeout = ecore_timer_add
(_comp_mod->conf->first_draw_delay, _e_mod_comp_cb_win_show_ready_timeout, cw);
(_comp_mod->conf->first_draw_delay, _e_mod_comp_cb_win_show_ready_timeout, cw);
}
}
@ -485,11 +485,11 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
{
for (i = 0; i < cw->rects_num; i++)
{
E_RECTS_CLIP_TO_RECT(cw->rects[i].x,
cw->rects[i].y,
cw->rects[i].width,
cw->rects[i].height,
0, 0, (int) cw->w, (int) cw->h);
E_RECTS_CLIP_TO_RECT(cw->rects[i].x,
cw->rects[i].y,
cw->rects[i].width,
cw->rects[i].height,
0, 0, (int)cw->w, (int)cw->h);
}
}
if (!_e_mod_comp_win_shaped_check(cw, cw->rects, cw->rects_num))
@ -531,7 +531,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
ecore_x_pixmap_geometry_get(cw->pixmap, NULL, NULL, &(cw->pw), &(cw->ph));
_e_mod_comp_win_ready_timeout_setup(cw);
if ((cw->pw > 0) && (cw->ph > 0))
evas_object_resize(cw->obj, cw->pw, cw->ph);
evas_object_resize(cw->obj, cw->pw, cw->ph);
}
else
{
@ -712,15 +712,15 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
else
{
// why do we neeed these 2? this smells wrong
pix = ecore_x_image_data_get(cw->xim, NULL, NULL, NULL);
DBG("UPDATE [0x%x] %i %i %ix%i -- pix = %p\n", cw->win, x, y, w, h, pix);
evas_object_image_data_set(cw->obj, pix);
evas_object_image_data_update_add(cw->obj, x, y, w, h);
EINA_LIST_FOREACH(cw->obj_mirror, l, o)
{
evas_object_image_data_set(o, pix);
evas_object_image_data_update_add(o, x, y, w, h);
}
pix = ecore_x_image_data_get(cw->xim, NULL, NULL, NULL);
DBG("UPDATE [0x%x] %i %i %ix%i -- pix = %p\n", cw->win, x, y, w, h, pix);
evas_object_image_data_set(cw->obj, pix);
evas_object_image_data_update_add(cw->obj, x, y, w, h);
EINA_LIST_FOREACH(cw->obj_mirror, l, o)
{
evas_object_image_data_set(o, pix);
evas_object_image_data_update_add(o, x, y, w, h);
}
}
}
}
@ -745,34 +745,34 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
}
// FIXME: below cw update check screws with show
if (/*(!cw->update) &&*/ (cw->visible) && (cw->dmg_updates >= 1) &&
(cw->show_ready) && (!cw->bd || cw->bd->visible))
(cw->show_ready) && (!cw->bd || cw->bd->visible))
{
if (!evas_object_visible_get(cw->shobj))
{
if (!cw->hidden_override)
{
if (!cw->hidden_override)
{
_e_mod_comp_child_show(cw);
_e_mod_comp_win_render_queue(cw);
}
_e_mod_comp_win_render_queue(cw);
}
if (!cw->show_anim)
{
edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e");
if (!cw->animating)
{
cw->c->animating++;
}
if (!cw->show_anim)
{
edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e");
if (!cw->animating)
{
cw->c->animating++;
}
cw->animating = 1;
cw->pending_count++;
e_manager_comp_event_src_visibility_send
(cw->c->man, (E_Manager_Comp_Source *)cw,
_e_mod_comp_cb_pending_after, cw->c);
cw->animating = 1;
cw->show_anim = EINA_TRUE;
}
}
cw->pending_count++;
e_manager_comp_event_src_visibility_send
(cw->c->man, (E_Manager_Comp_Source *)cw,
_e_mod_comp_cb_pending_after, cw->c);
cw->show_anim = EINA_TRUE;
}
}
}
if ((cw->shobj) && (cw->obj))
{
@ -789,7 +789,7 @@ _e_mod_comp_win_update(E_Comp_Win *cw)
}
static void
_e_mod_comp_pre_swap(void *data,
_e_mod_comp_pre_swap(void *data,
Evas *e __UNUSED__)
{
E_Comp *c = data;
@ -909,7 +909,8 @@ _e_mod_comp_cb_update(E_Comp *c)
else fps = 0.0;
if (fps > 0.0) snprintf(buf, sizeof(buf), "FPS: %1.1f", fps);
else snprintf(buf, sizeof(buf), "N/A");
for (i = 121; i >= 1; i--) c->frametimes[i] = c->frametimes[i - 1];
for (i = 121; i >= 1; i--)
c->frametimes[i] = c->frametimes[i - 1];
c->frametimes[0] = t;
c->frameskip++;
if (c->frameskip >= _comp_mod->conf->fps_average_range)
@ -1156,7 +1157,7 @@ nocomp:
e_manager_comp_event_src_visibility_send
(cw->c->man, (E_Manager_Comp_Source *)cw,
_e_mod_comp_cb_pending_after, cw->c);
// no need for effect
// no need for effect
}
_e_mod_comp_win_render_queue(cw);
if (cw->counter)
@ -1370,7 +1371,7 @@ _e_mod_comp_done_defer(E_Comp_Win *cw)
}
static void
_e_mod_comp_show_done(void *data,
_e_mod_comp_show_done(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
@ -1380,7 +1381,7 @@ _e_mod_comp_show_done(void *data,
}
static void
_e_mod_comp_hide_done(void *data,
_e_mod_comp_hide_done(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
@ -1390,7 +1391,7 @@ _e_mod_comp_hide_done(void *data,
}
static void
_e_mod_comp_win_sync_setup(E_Comp_Win *cw,
_e_mod_comp_win_sync_setup(E_Comp_Win *cw,
Ecore_X_Window win)
{
if (!_comp_mod->conf->efl_sync) return;
@ -1445,13 +1446,13 @@ _e_mod_comp_win_shadow_setup(E_Comp_Win *cw)
// FIXME: i only added "shelf" as a name for popups that are shelves
// ... need more nmes like for pager popup, evertything, exebuf
// etc. etc.
list = _comp_mod->conf->match.popups;
name = cw->pop->name;
list = _comp_mod->conf->match.popups;
name = cw->pop->name;
}
else if (cw->menu)
{
// FIXME: e has no way to tell e menus apart... need naming
list = _comp_mod->conf->match.menus;
list = _comp_mod->conf->match.menus;
}
else
{
@ -1700,7 +1701,7 @@ _e_mod_comp_win_mirror_add(E_Comp_Win *cw)
}
static E_Comp_Win *
_e_mod_comp_win_add(E_Comp *c,
_e_mod_comp_win_add(E_Comp *c,
Ecore_X_Window win)
{
Ecore_X_Window_Attributes att;
@ -1715,8 +1716,8 @@ _e_mod_comp_win_add(E_Comp *c,
if (_comp_mod->conf->grab) ecore_x_grab();
if (cw->bd)
{
eina_hash_add(borders, e_util_winid_str_get(cw->bd->client.win), cw);
cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_mod_comp_object_del, cw);
eina_hash_add(borders, e_util_winid_str_get(cw->bd->client.win), cw);
cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_mod_comp_object_del, cw);
// setup on show
// _e_mod_comp_win_sync_setup(cw, cw->bd->client.win);
@ -1807,15 +1808,15 @@ _e_mod_comp_win_add(E_Comp *c,
{
int i;
for (i = 0; i < num; i++)
E_RECTS_CLIP_TO_RECT(rects[i].x, rects[i].y,
rects[i].width, rects[i].height,
0, 0, (int) att.w, (int) att.h);
for (i = 0; i < num; i++)
E_RECTS_CLIP_TO_RECT(rects[i].x, rects[i].y,
rects[i].width, rects[i].height,
0, 0, (int)att.w, (int)att.h);
if (_e_mod_comp_shaped_check(att.w, att.h, rects, num))
cw->shape_changed = 1;
cw->shape_changed = 1;
free(rects);
free(rects);
}
if (cw->bd) evas_object_data_set(cw->shobj, "border", cw->bd);
@ -1850,10 +1851,10 @@ _e_mod_comp_win_add(E_Comp *c,
(cw->up, E_UPDATE_POLICY_HALF_WIDTH_OR_MORE_ROUND_UP_TO_FULL_WIDTH);
if (((!cw->input_only) && (!cw->invalid)) && (cw->override))
{
cw->redirected = 1;
// we redirect all subwindows anyway
// ecore_x_composite_redirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
cw->dmg_updates = 0;
cw->redirected = 1;
// we redirect all subwindows anyway
// ecore_x_composite_redirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
cw->dmg_updates = 0;
}
DBG(" [0x%x] add\n", cw->win);
if (_comp_mod->conf->grab) ecore_x_ungrab();
@ -1928,9 +1929,9 @@ _e_mod_comp_win_del(E_Comp_Win *cw)
{
// we redirect all subwindows anyway
// ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
cw->redirected = 0;
cw->pw = 0;
cw->ph = 0;
cw->redirected = 0;
cw->pw = 0;
cw->ph = 0;
}
if (cw->update)
{
@ -2006,7 +2007,7 @@ _e_mod_comp_win_show(E_Comp_Win *cw)
if ((cw->input_only) || (cw->invalid)) return;
cw->show_anim = EINA_FALSE;
// setup on show
if (cw->bd)
_e_mod_comp_win_sync_setup(cw, cw->bd->client.win);
@ -2222,9 +2223,9 @@ _e_mod_comp_win_hide(E_Comp_Win *cw)
{
// we redirect all subwindows anyway
// ecore_x_composite_unredirect_window(cw->win, ECORE_X_COMPOSITE_UPDATE_MANUAL);
cw->redirected = 0;
cw->pw = 0;
cw->ph = 0;
cw->redirected = 0;
cw->pw = 0;
cw->ph = 0;
}
_e_mod_comp_win_render_queue(cw);
if (_comp_mod->conf->send_flush)
@ -2260,7 +2261,7 @@ _e_mod_comp_win_raise_above(E_Comp_Win *cw,
E_Comp_Win *tcw;
tcw = eina_hash_find(borders, e_util_winid_str_get(tmp->client.win));
if (!tcw) continue ;
if (!tcw) continue;
evas_object_stack_below(tcw->shobj, cw->shobj);
}
@ -2291,7 +2292,7 @@ _e_mod_comp_win_raise(E_Comp_Win *cw)
E_Comp_Win *tcw;
tcw = eina_hash_find(borders, e_util_winid_str_get(tmp->client.win));
if (!tcw) continue ;
if (!tcw) continue;
evas_object_stack_below(tcw->shobj, cw->shobj);
}
@ -2322,7 +2323,7 @@ _e_mod_comp_win_lower(E_Comp_Win *cw)
E_Comp_Win *tcw;
tcw = eina_hash_find(borders, e_util_winid_str_get(tmp->client.win));
if (!tcw) continue ;
if (!tcw) continue;
evas_object_stack_below(tcw->shobj, cw->shobj);
}
@ -2337,11 +2338,11 @@ _e_mod_comp_win_lower(E_Comp_Win *cw)
static void
_e_mod_comp_win_configure(E_Comp_Win *cw,
int x,
int y,
int w,
int h,
int border)
int x,
int y,
int w,
int h,
int border)
{
if (!cw->visible)
{
@ -2367,14 +2368,14 @@ _e_mod_comp_win_configure(E_Comp_Win *cw,
{
if (!((w == cw->w) && (h == cw->h)))
{
#if 1
#if 1
cw->w = w;
cw->h = h;
cw->needpix = 1;
// was cw->w / cw->h
evas_object_resize(cw->shobj, cw->pw, cw->ph);
_e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
#else
#else
if (cw->bd)
{
if ((cw->bd->shading) || (cw->bd->shaded))
@ -2385,17 +2386,17 @@ _e_mod_comp_win_configure(E_Comp_Win *cw,
_e_mod_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0);
}
else
cw->update = 0;
cw->update = 0;
}
else
{
cw->update = 0;
// if (cw->ready_timeout) ecore_timer_del(cw->ready_timeout);
// cw->ready_timeout = ecore_timer_add
// (_comp_mod->conf->first_draw_delay,
// (_comp_mod->conf->first_draw_delay,
// _e_mod_comp_cb_win_show_ready_timeout, cw);
}
#endif
#endif
}
if (cw->border != border)
{
@ -2438,11 +2439,11 @@ _e_mod_comp_win_configure(E_Comp_Win *cw,
static void
_e_mod_comp_win_damage(E_Comp_Win *cw,
int x,
int y,
int w,
int h,
Eina_Bool dmg)
int x,
int y,
int w,
int h,
Eina_Bool dmg)
{
if ((cw->input_only) || (cw->invalid)) return;
DBG(" [0x%x] dmg [%x] %4i %4i %4ix%4i\n", cw->win, cw->damage, x, y, w, h);
@ -2494,7 +2495,7 @@ _e_mod_comp_win_reshape(E_Comp_Win *cw)
static Eina_Bool
_e_mod_comp_create(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Create *ev = event;
E_Comp_Win *cw;
@ -2511,7 +2512,7 @@ _e_mod_comp_create(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_destroy(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Destroy *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->win);
@ -2524,32 +2525,32 @@ _e_mod_comp_destroy(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_show(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Show *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->win);
if (!cw) return ECORE_CALLBACK_PASS_ON;
/*
Vincent Torri via lists.sourceforge.net
2:31 PM (8 minutes ago)
to enlightenment-devel.
would it be possible to add a note in the code, about the reason of
that change ?
Vincent Torri via lists.sourceforge.net
Vincent
2:31 PM (8 minutes ago)
On Thu, Jun 21, 2012 at 3:29 PM, Enlightenment SVN
<no-reply@enlightenment.org> wrote:
> Log:
> gtk developers with IQs over 180 enjoy hiding and showing their windows constantly,
> especially when resizing. this broke e's comp since we are not nearly that clever
> and try to defer hide animations in most cases. undoing the defer whenever
> this happens allows us to keep up with their towering genius.
> fixes ticket #765 and probably some others.
> affected apps: claws-mail, firefox
*/
to enlightenment-devel.
would it be possible to add a note in the code, about the reason of
that change ?
Vincent
On Thu, Jun 21, 2012 at 3:29 PM, Enlightenment SVN
<no-reply@enlightenment.org> wrote:
> Log:
> gtk developers with IQs over 180 enjoy hiding and showing their windows constantly,
> especially when resizing. this broke e's comp since we are not nearly that clever
> and try to defer hide animations in most cases. undoing the defer whenever
> this happens allows us to keep up with their towering genius.
> fixes ticket #765 and probably some others.
> affected apps: claws-mail, firefox
*/
cw->defer_hide = 0;
if (cw->visible) return ECORE_CALLBACK_PASS_ON;
_e_mod_comp_win_show(cw);
@ -2559,7 +2560,7 @@ On Thu, Jun 21, 2012 at 3:29 PM, Enlightenment SVN
static Eina_Bool
_e_mod_comp_hide(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Hide *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->win);
@ -2572,7 +2573,7 @@ _e_mod_comp_hide(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_reparent(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Reparent *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->win);
@ -2586,7 +2587,7 @@ _e_mod_comp_reparent(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_configure(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Configure *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->win);
@ -2620,7 +2621,7 @@ _e_mod_comp_configure(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_stack(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Stack *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->win);
@ -2661,13 +2662,13 @@ _e_mod_comp_property(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_message(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Client_Message *ev = event;
E_Comp_Win *cw = NULL;
int version, w = 0, h = 0;
Eina_Bool force = 0;
if (ev->message_type == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY)
{
cw = _e_mod_comp_win_find(ev->win);
@ -2698,17 +2699,17 @@ _e_mod_comp_message(void *data __UNUSED__,
if (cw->bd)
{
int clw, clh;
if ((cw->bd->shading) || (cw->bd->shaded)) force = 1;
clw = cw->hidden.w -
cw->bd->client_inset.l -
cw->bd->client_inset.r;
clh = cw->hidden.h -
cw->bd->client_inset.t -
cw->bd->client_inset.b;
DBG(" [0x%x] sync draw done @%4ix%4i, bd %4ix%4i\n", cw->win,
clw = cw->hidden.w -
cw->bd->client_inset.l -
cw->bd->client_inset.r;
clh = cw->hidden.h -
cw->bd->client_inset.t -
cw->bd->client_inset.b;
DBG(" [0x%x] sync draw done @%4ix%4i, bd %4ix%4i\n", cw->win,
w, h, cw->bd->client.w, cw->bd->client.h);
if ((w != clw) || (h != clh))
if ((w != clw) || (h != clh))
{
cw->misses++;
if (cw->misses > 1)
@ -2776,7 +2777,7 @@ _e_mod_comp_message(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_shape(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Shape *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->win);
@ -2789,7 +2790,7 @@ _e_mod_comp_shape(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_damage(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Damage *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_damage_find(ev->damage);
@ -2803,7 +2804,7 @@ _e_mod_comp_damage(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_damage_win(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_X_Event_Window_Damage *ev = event;
Eina_List *l;
@ -2841,7 +2842,7 @@ _e_mod_comp_randr(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_add(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Add *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2853,7 +2854,7 @@ _e_mod_comp_bd_add(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_del(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Remove *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2865,7 +2866,7 @@ _e_mod_comp_bd_del(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_show(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Show *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2878,7 +2879,7 @@ _e_mod_comp_bd_show(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_hide(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Hide *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2891,7 +2892,7 @@ _e_mod_comp_bd_hide(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_move(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Move *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2903,7 +2904,7 @@ _e_mod_comp_bd_move(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_resize(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Resize *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2915,7 +2916,7 @@ _e_mod_comp_bd_resize(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_iconify(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Iconify *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2927,7 +2928,7 @@ _e_mod_comp_bd_iconify(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_uniconify(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Uniconify *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2939,7 +2940,7 @@ _e_mod_comp_bd_uniconify(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_urgent_change(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Urgent_Change *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2954,7 +2955,7 @@ _e_mod_comp_bd_urgent_change(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_focus_in(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Focus_In *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2966,7 +2967,7 @@ _e_mod_comp_bd_focus_in(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_focus_out(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Focus_Out *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2978,7 +2979,7 @@ _e_mod_comp_bd_focus_out(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_bd_property(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
E_Event_Border_Property *ev = event;
E_Comp_Win *cw = _e_mod_comp_win_find(ev->border->win);
@ -2992,7 +2993,7 @@ _e_mod_comp_bd_property(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_key_down(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_Event_Key *ev = event;
@ -3017,10 +3018,10 @@ _e_mod_comp_key_down(void *data __UNUSED__,
static Eina_Bool
_e_mod_comp_signal_user(void *data __UNUSED__,
int type __UNUSED__,
void *event)
void *event)
{
Ecore_Event_Signal_User *ev = event;
if (ev->number == 1)
{
// e17 uses this to pop up config panel
@ -3034,7 +3035,7 @@ _e_mod_comp_signal_user(void *data __UNUSED__,
//////////////////////////////////////////////////////////////////////////
static Evas *
_e_mod_comp_evas_get_func(void *data,
_e_mod_comp_evas_get_func(void *data,
E_Manager *man __UNUSED__)
{
E_Comp *c = data;
@ -3042,7 +3043,7 @@ _e_mod_comp_evas_get_func(void *data,
}
static void
_e_mod_comp_update_func(void *data,
_e_mod_comp_update_func(void *data,
E_Manager *man __UNUSED__)
{
E_Comp *c = data;
@ -3050,15 +3051,15 @@ _e_mod_comp_update_func(void *data,
}
static E_Manager_Comp_Source *
_e_mod_comp_src_get_func(void *data __UNUSED__,
E_Manager *man __UNUSED__,
Ecore_X_Window win)
_e_mod_comp_src_get_func(void *data __UNUSED__,
E_Manager *man __UNUSED__,
Ecore_X_Window win)
{
return (E_Manager_Comp_Source *) _e_mod_comp_win_find(win);
return (E_Manager_Comp_Source *)_e_mod_comp_win_find(win);
}
static const Eina_List *
_e_mod_comp_src_list_get_func(void *data,
_e_mod_comp_src_list_get_func(void *data,
E_Manager *man __UNUSED__)
{
E_Comp *c = data;
@ -3085,9 +3086,9 @@ _e_mod_comp_src_image_get_func(void *data __UNUSED__,
E_Manager_Comp_Source *src)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return NULL;
return cw->obj;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return NULL;
return cw->obj;
}
static Evas_Object *
@ -3096,9 +3097,9 @@ _e_mod_comp_src_shadow_get_func(void *data __UNUSED__,
E_Manager_Comp_Source *src)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return NULL;
return cw->shobj;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return NULL;
return cw->shobj;
}
static Evas_Object *
@ -3107,9 +3108,9 @@ _e_mod_comp_src_image_mirror_add_func(void *data __UNUSED__,
E_Manager_Comp_Source *src)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return NULL;
return _e_mod_comp_win_mirror_add(cw);
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return NULL;
return _e_mod_comp_win_mirror_add(cw);
}
static Eina_Bool
@ -3118,34 +3119,34 @@ _e_mod_comp_src_visible_get_func(void *data __UNUSED__,
E_Manager_Comp_Source *src)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return 0;
return cw->visible;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return 0;
return cw->visible;
}
static void
_e_mod_comp_src_hidden_set_func(void *data __UNUSED__,
E_Manager *man __UNUSED__,
E_Manager_Comp_Source *src,
Eina_Bool hidden)
Eina_Bool hidden)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return;
if (cw->hidden_override == hidden) return;
cw->hidden_override = hidden;
if (cw->bd) e_border_comp_hidden_set(cw->bd, cw->hidden_override);
if (cw->visible)
{
if (cw->hidden_override)
_e_mod_comp_child_hide(cw);
else if (!cw->bd || cw->bd->visible)
_e_mod_comp_child_show(cw);
}
else
{
if (cw->hidden_override) _e_mod_comp_child_hide(cw);
}
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return;
if (cw->hidden_override == hidden) return;
cw->hidden_override = hidden;
if (cw->bd) e_border_comp_hidden_set(cw->bd, cw->hidden_override);
if (cw->visible)
{
if (cw->hidden_override)
_e_mod_comp_child_hide(cw);
else if (!cw->bd || cw->bd->visible)
_e_mod_comp_child_show(cw);
}
else
{
if (cw->hidden_override) _e_mod_comp_child_hide(cw);
}
}
static Eina_Bool
@ -3154,15 +3155,15 @@ _e_mod_comp_src_hidden_get_func(void *data __UNUSED__,
E_Manager_Comp_Source *src)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return 0;
return cw->hidden_override;
E_Comp_Win *cw = (E_Comp_Win *)src;
if (!cw->c) return 0;
return cw->hidden_override;
}
static E_Popup *
_e_mod_comp_src_popup_get_func(void *data __UNUSED__,
E_Manager *man __UNUSED__,
E_Manager_Comp_Source *src)
E_Manager *man __UNUSED__,
E_Manager_Comp_Source *src)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
@ -3172,8 +3173,8 @@ _e_mod_comp_src_popup_get_func(void *data __UNUSED__,
static E_Border *
_e_mod_comp_src_border_get_func(void *data __UNUSED__,
E_Manager *man __UNUSED__,
E_Manager_Comp_Source *src)
E_Manager *man __UNUSED__,
E_Manager_Comp_Source *src)
{
// E_Comp *c = data;
E_Comp_Win *cw = (E_Comp_Win *)src;
@ -3208,9 +3209,9 @@ _e_mod_comp_add(E_Manager *man)
if (res)
{
e_util_dialog_internal
(_("Compositor Error"),
_("Another compositor is already running<br>"
"on your screen."));
(_("Compositor Error"),
_("Another compositor is already running<br>"
"on your screen."));
free(c);
return NULL;
}
@ -3222,7 +3223,7 @@ _e_mod_comp_add(E_Manager *man)
return NULL;
}
ecore_x_screen_is_composited_set(man->num, c->cm_selection);
ecore_x_e_comp_sync_supported_set(man->root, _comp_mod->conf->efl_sync);
c->man = man;
@ -3523,7 +3524,8 @@ e_mod_comp_shutdown(void)
{
E_Comp *c;
EINA_LIST_FREE(compositors, c) _e_mod_comp_del(c);
EINA_LIST_FREE(compositors, c)
_e_mod_comp_del(c);
E_FREE_LIST(handlers, ecore_event_handler_del);
@ -3557,7 +3559,8 @@ e_mod_comp_fps_toggle(void)
_comp_mod->conf->fps_show = 1;
e_config_save_queue();
}
EINA_LIST_FOREACH(compositors, l, c) _e_mod_comp_cb_update(c);
EINA_LIST_FOREACH(compositors, l, c)
_e_mod_comp_cb_update(c);
}
}

View File

@ -136,7 +136,7 @@ e_mod_comp_cfdata_config_new(void)
mat = E_NEW(Match, 1);
cfg->match.menus = eina_list_append(cfg->match.menus, mat);
mat->shadow_style = eina_stringshare_add("menu");
return cfg;
}

View File

@ -33,7 +33,7 @@ e_mod_comp_update_free(E_Update *up)
}
void
e_mod_comp_update_policy_set(E_Update *up,
e_mod_comp_update_policy_set(E_Update *up,
E_Update_Policy pol)
{
up->pol = pol;
@ -41,8 +41,8 @@ e_mod_comp_update_policy_set(E_Update *up,
void
e_mod_comp_update_tile_size_set(E_Update *up,
int tsw,
int tsh)
int tsw,
int tsh)
{
if ((up->tsw == tsw) && (up->tsh == tsh)) return;
up->tsw = tsw;
@ -52,8 +52,8 @@ e_mod_comp_update_tile_size_set(E_Update *up,
void
e_mod_comp_update_resize(E_Update *up,
int w,
int h)
int w,
int h)
{
unsigned char *ptiles, *p, *pp;
int ptw, pth, x, y;
@ -78,8 +78,12 @@ e_mod_comp_update_resize(E_Update *up,
{
p = up->tiles + (y * up->tw);
pp = ptiles + (y * ptw);
if (ptw <= up->tw) for (x = 0; x < ptw; x++) *p++ = *pp++;
else for (x = 0; x < up->tw; x++) *p++ = *pp++;
if (ptw <= up->tw)
for (x = 0; x < ptw; x++)
*p++ = *pp++;
else
for (x = 0; x < up->tw; x++)
*p++ = *pp++;
}
}
else
@ -88,8 +92,12 @@ e_mod_comp_update_resize(E_Update *up,
{
p = up->tiles + (y * up->tw);
pp = ptiles + (y * ptw);
if (ptw <= up->tw) for (x = 0; x < ptw; x++) *p++ = *pp++;
else for (x = 0; x < up->tw; x++) *p++ = *pp++;
if (ptw <= up->tw)
for (x = 0; x < ptw; x++)
*p++ = *pp++;
else
for (x = 0; x < up->tw; x++)
*p++ = *pp++;
}
}
}
@ -98,10 +106,10 @@ e_mod_comp_update_resize(E_Update *up,
void
e_mod_comp_update_add(E_Update *up,
int x,
int y,
int w,
int h)
int x,
int y,
int w,
int h)
{
int tx, ty, txx, tyy, xx, yy;
unsigned char *t, *t2;

View File

@ -18,7 +18,7 @@ static Ecore_Fd_Handler *_wl_fd_handler = NULL;
/* extern variables */
struct wl_display *_wl_disp;
Eina_Bool
Eina_Bool
e_mod_comp_wl_init(void)
{
struct wl_event_loop *loop;
@ -81,8 +81,8 @@ e_mod_comp_wl_init(void)
loop = wl_display_get_event_loop(_wl_disp);
fd = wl_event_loop_get_fd(loop);
_wl_fd_handler =
ecore_main_fd_handler_add(fd, ECORE_FD_READ,
_wl_fd_handler =
ecore_main_fd_handler_add(fd, ECORE_FD_READ,
_e_mod_comp_wl_fd_handle, NULL, NULL, NULL);
wl_event_loop_dispatch(loop, 0);
@ -90,7 +90,7 @@ e_mod_comp_wl_init(void)
return EINA_TRUE;
}
void
void
e_mod_comp_wl_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -108,7 +108,7 @@ e_mod_comp_wl_shutdown(void)
_wl_disp = NULL;
}
uint32_t
uint32_t
e_mod_comp_wl_time_get(void)
{
struct timeval tv;
@ -117,7 +117,7 @@ e_mod_comp_wl_time_get(void)
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
Ecore_X_Pixmap
Ecore_X_Pixmap
e_mod_comp_wl_pixmap_get(Ecore_X_Window win)
{
Wayland_Compositor *comp;
@ -132,55 +132,55 @@ e_mod_comp_wl_pixmap_get(Ecore_X_Window win)
// list = &comp->surfaces;
wl_list_for_each(ws, &comp->surfaces, link)
{
if (!ws->buffer) continue;
if (((ws->win) && (ws->win->border))
&& (ws->win->border->win == win))
{
Ecore_X_Connection *conn;
Ecore_X_GC gc;
uint8_t *pix = 0;
int depth;
{
if (!ws->buffer) continue;
if (((ws->win) && (ws->win->border))
&& (ws->win->border->win == win))
{
Ecore_X_Connection *conn;
Ecore_X_GC gc;
uint8_t *pix = 0;
int depth;
if (ws->buffer)
{
if (wl_buffer_is_shm(ws->buffer))
pix = (uint8_t *)wl_shm_buffer_get_data(ws->buffer);
else
{
if (ws->texture) pix = (uint8_t *)ws->texture;
else if (ws->saved_texture)
pix = (uint8_t *)ws->saved_texture;
}
}
else if (ws->image)
{
if (ws->texture) pix = (uint8_t *)ws->texture;
else if (ws->saved_texture)
pix = (uint8_t *)ws->saved_texture;
}
if (ws->buffer)
{
if (wl_buffer_is_shm(ws->buffer))
pix = (uint8_t *)wl_shm_buffer_get_data(ws->buffer);
else
{
if (ws->texture) pix = (uint8_t *)ws->texture;
else if (ws->saved_texture)
pix = (uint8_t *)ws->saved_texture;
}
}
else if (ws->image)
{
if (ws->texture) pix = (uint8_t *)ws->texture;
else if (ws->saved_texture)
pix = (uint8_t *)ws->saved_texture;
}
if (!pix) return 0;
if (!pix) return 0;
depth = ecore_x_window_depth_get(win);
conn = ecore_x_connection_get();
depth = ecore_x_window_depth_get(win);
conn = ecore_x_connection_get();
pmap = xcb_generate_id(conn);
xcb_create_pixmap(conn, depth, pmap, win, ws->w, ws->h);
pmap = xcb_generate_id(conn);
xcb_create_pixmap(conn, depth, pmap, win, ws->w, ws->h);
gc = ecore_x_gc_new(pmap, 0, NULL);
xcb_put_image(conn, 2, pmap, gc, ws->w, ws->h,
0, 0, 0, depth,
(ws->w * ws->h * sizeof(int)), pix);
ecore_x_gc_free(gc);
}
}
gc = ecore_x_gc_new(pmap, 0, NULL);
xcb_put_image(conn, 2, pmap, gc, ws->w, ws->h,
0, 0, 0, depth,
(ws->w * ws->h * sizeof(int)), pix);
ecore_x_gc_free(gc);
}
}
return pmap;
}
/* local functions */
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_fd_handle(void *data __UNUSED__, Ecore_Fd_Handler *hdl __UNUSED__)
{
struct wl_event_loop *loop;
@ -189,3 +189,4 @@ _e_mod_comp_wl_fd_handle(void *data __UNUSED__, Ecore_Fd_Handler *hdl __UNUSED__
wl_event_loop_dispatch(loop, 0);
return ECORE_CALLBACK_RENEW;
}

View File

@ -7,7 +7,7 @@
# include "e_mod_comp_wl_comp.h"
#endif
void
void
e_mod_comp_wl_buffer_post_release(struct wl_buffer *buffer)
{
if (--buffer->busy_count > 0) return;
@ -15,7 +15,7 @@ e_mod_comp_wl_buffer_post_release(struct wl_buffer *buffer)
wl_resource_queue_event(&buffer->resource, WL_BUFFER_RELEASE);
}
void
void
e_mod_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface)
{
Wayland_Surface *ws;
@ -28,9 +28,9 @@ e_mod_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface
{
glGenTextures(1, &ws->texture);
glBindTexture(GL_TEXTURE_2D, ws->texture);
glTexParameteri(GL_TEXTURE_2D,
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// ws->shader = &ws->texture_shader;
}
@ -44,17 +44,18 @@ e_mod_comp_wl_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface
if (wl_buffer_is_shm(buffer))
ws->pitch = wl_shm_buffer_get_stride(buffer) / 4;
else
else
{
Wayland_Compositor *comp;
comp = e_mod_comp_wl_comp_get();
if (ws->image != EGL_NO_IMAGE_KHR)
comp->destroy_image(comp->egl.display, ws->image);
ws->image = comp->create_image(comp->egl.display, NULL,
ws->image = comp->create_image(comp->egl.display, NULL,
EGL_WAYLAND_BUFFER_WL, buffer, NULL);
comp->image_target_texture_2d(GL_TEXTURE_2D, ws->image);
ws->visual = WAYLAND_ARGB_VISUAL;
ws->pitch = ws->w;
}
}

View File

@ -11,47 +11,47 @@
#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
# 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
#define MODIFIER_CTRL (1 << 8)
#define MODIFIER_ALT (1 << 9)
#define MODIFIER_CTRL (1 << 8)
#define MODIFIER_ALT (1 << 9)
#define MODIFIER_SUPER (1 << 10)
/* local function prototypes */
static Eina_Bool _e_mod_comp_wl_comp_egl_init(void);
static void _e_mod_comp_wl_comp_egl_shutdown(void);
static void _e_mod_comp_wl_comp_destroy(void);
static void _e_mod_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id);
static void _e_mod_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id);
static void _e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id);
static void _e_mod_comp_wl_comp_region_destroy(struct wl_resource *resource);
static Eina_Bool _e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_comp_egl_init(void);
static void _e_mod_comp_wl_comp_egl_shutdown(void);
static void _e_mod_comp_wl_comp_destroy(void);
static void _e_mod_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id);
static void _e_mod_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id);
static void _e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id);
static void _e_mod_comp_wl_comp_region_destroy(struct wl_resource *resource);
static Eina_Bool _e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event);
static Eina_Bool _e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event);
static Wayland_Surface *_e_mod_comp_wl_comp_pick_surface(int32_t x __UNUSED__, int32_t y __UNUSED__, int32_t *sx, int32_t *sy);
static void _e_mod_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t state);
static void _e_mod_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t state);
/* wayland interfaces */
static const struct wl_compositor_interface _wl_comp_interface =
static const struct wl_compositor_interface _wl_comp_interface =
{
_e_mod_comp_wl_comp_surface_create,
_e_mod_comp_wl_comp_region_create
};
static const struct wl_surface_interface _wl_surface_interface =
static const struct wl_surface_interface _wl_surface_interface =
{
e_mod_comp_wl_surface_destroy,
e_mod_comp_wl_surface_attach,
@ -60,7 +60,7 @@ static const struct wl_surface_interface _wl_surface_interface =
e_mod_comp_wl_surface_set_opaque_region,
e_mod_comp_wl_surface_set_input_region
};
static const struct wl_region_interface _wl_region_interface =
static const struct wl_region_interface _wl_region_interface =
{
e_mod_comp_wl_region_destroy,
e_mod_comp_wl_region_add,
@ -71,7 +71,7 @@ static const struct wl_region_interface _wl_region_interface =
static Wayland_Compositor *_wl_comp;
static Eina_List *_wl_event_handlers = NULL;
Eina_Bool
Eina_Bool
e_mod_comp_wl_comp_init(void)
{
const char *extensions;
@ -95,7 +95,7 @@ e_mod_comp_wl_comp_init(void)
_wl_comp->destroy = _e_mod_comp_wl_comp_destroy;
if (!wl_display_add_global(_wl_disp, &wl_compositor_interface, _wl_comp,
if (!wl_display_add_global(_wl_disp, &wl_compositor_interface, _wl_comp,
_e_mod_comp_wl_comp_bind))
{
EINA_LOG_ERR("Failed to add compositor to wayland\n");
@ -110,9 +110,9 @@ e_mod_comp_wl_comp_init(void)
_wl_comp->create_image = (void *)eglGetProcAddress("eglCreateImageKHR");
_wl_comp->destroy_image = (void *)eglGetProcAddress("eglDestroyImageKHR");
_wl_comp->bind_display =
_wl_comp->bind_display =
(void *)eglGetProcAddress("eglBindWaylandDisplayWL");
_wl_comp->unbind_display =
_wl_comp->unbind_display =
(void *)eglGetProcAddress("eglUnbindWaylandDisplayWL");
extensions = (const char *)glGetString(GL_EXTENSIONS);
@ -123,58 +123,58 @@ e_mod_comp_wl_comp_init(void)
return EINA_FALSE;
}
extensions =
extensions =
(const char *)eglQueryString(_wl_comp->egl.display, EGL_EXTENSIONS);
if (strstr(extensions, "EGL_WL_bind_wayland_display"))
_wl_comp->has_bind = EINA_TRUE;
if (_wl_comp->has_bind)
if (_wl_comp->has_bind)
_wl_comp->bind_display(_wl_comp->egl.display, _wl_disp);
wl_data_device_manager_init(_wl_disp);
wl_list_init(&_wl_comp->surfaces);
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN,
_e_mod_comp_wl_cb_focus_in, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT,
_e_mod_comp_wl_cb_focus_out, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN,
_e_mod_comp_wl_cb_mouse_in, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT,
_e_mod_comp_wl_cb_mouse_out, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
_e_mod_comp_wl_cb_mouse_move, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
_e_mod_comp_wl_cb_mouse_down, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
_e_mod_comp_wl_cb_mouse_up, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
_e_mod_comp_wl_cb_key_down, NULL));
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
_wl_event_handlers =
eina_list_append(_wl_event_handlers,
ecore_event_handler_add(ECORE_EVENT_KEY_UP,
_e_mod_comp_wl_cb_key_up, NULL));
return EINA_TRUE;
}
void
void
e_mod_comp_wl_comp_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -190,13 +190,13 @@ e_mod_comp_wl_comp_get(void)
return _wl_comp;
}
void
void
e_mod_comp_wl_comp_repick(struct wl_input_device *device, uint32_t timestamp __UNUSED__)
{
Wayland_Surface *ws, *focus;
ws =
_e_mod_comp_wl_comp_pick_surface(device->x, device->y,
ws =
_e_mod_comp_wl_comp_pick_surface(device->x, device->y,
&device->current_x, &device->current_y);
if (!ws) return;
if (&ws->surface != device->current)
@ -204,7 +204,7 @@ e_mod_comp_wl_comp_repick(struct wl_input_device *device, uint32_t timestamp __U
const struct wl_pointer_grab_interface *interface;
interface = device->pointer_grab->interface;
interface->focus(device->pointer_grab, &ws->surface,
interface->focus(device->pointer_grab, &ws->surface,
device->current_x, device->current_y);
device->current = &ws->surface;
}
@ -217,22 +217,22 @@ e_mod_comp_wl_comp_repick(struct wl_input_device *device, uint32_t timestamp __U
}
/* local functions */
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_comp_egl_init(void)
{
EGLint major, minor, n;
const char *extensions;
EGLint config_attribs[] =
{
EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 1, EGL_DEPTH_SIZE, 0, EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE,
EGL_WINDOW_BIT, EGL_NONE
};
EGLint context_attribs[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE
};
EGLint config_attribs[] =
{
EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 1, EGL_DEPTH_SIZE, 0, EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE,
EGL_WINDOW_BIT, EGL_NONE
};
EGLint context_attribs[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE
};
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -264,24 +264,24 @@ _e_mod_comp_wl_comp_egl_init(void)
return EINA_FALSE;
}
if ((!eglChooseConfig(_wl_comp->egl.display, config_attribs,
&_wl_comp->egl.config, 1, &n) || (n == 0)))
if ((!eglChooseConfig(_wl_comp->egl.display, config_attribs,
&_wl_comp->egl.config, 1, &n) || (n == 0)))
{
EINA_LOG_ERR("Failed to choose EGL config\n");
eglTerminate(_wl_comp->egl.display);
return EINA_FALSE;
}
if (!(_wl_comp->egl.context =
eglCreateContext(_wl_comp->egl.display, _wl_comp->egl.config,
EGL_NO_CONTEXT, context_attribs)))
if (!(_wl_comp->egl.context =
eglCreateContext(_wl_comp->egl.display, _wl_comp->egl.config,
EGL_NO_CONTEXT, context_attribs)))
{
EINA_LOG_ERR("Failed to create EGL context\n");
eglTerminate(_wl_comp->egl.display);
return EINA_FALSE;
}
if (!eglMakeCurrent(_wl_comp->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
if (!eglMakeCurrent(_wl_comp->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
_wl_comp->egl.context))
{
EINA_LOG_ERR("Failed to make EGL context current\n");
@ -292,18 +292,18 @@ _e_mod_comp_wl_comp_egl_init(void)
return EINA_TRUE;
}
static void
static void
_e_mod_comp_wl_comp_egl_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
eglMakeCurrent(_wl_comp->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
eglMakeCurrent(_wl_comp->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
eglTerminate(_wl_comp->egl.display);
eglReleaseThread();
}
static void
static void
_e_mod_comp_wl_comp_destroy(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -317,16 +317,16 @@ _e_mod_comp_wl_comp_destroy(void)
free(_wl_comp);
}
static void
static void
_e_mod_comp_wl_comp_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
wl_client_add_object(client, &wl_compositor_interface,
wl_client_add_object(client, &wl_compositor_interface,
&_wl_comp_interface, id, data);
}
static void
static void
_e_mod_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id)
{
Wayland_Surface *ws;
@ -342,14 +342,14 @@ _e_mod_comp_wl_comp_surface_create(struct wl_client *client, struct wl_resource
ws->surface.resource.destroy = e_mod_comp_wl_surface_destroy_surface;
ws->surface.resource.object.id = id;
ws->surface.resource.object.interface = &wl_surface_interface;
ws->surface.resource.object.implementation =
(void (**)(void))&_wl_surface_interface;
ws->surface.resource.object.implementation =
(void (* *)(void)) & _wl_surface_interface;
ws->surface.resource.data = ws;
wl_client_add_resource(client, &ws->surface.resource);
}
static void
static void
_e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *resource, unsigned int id)
{
Wayland_Region *region;
@ -364,15 +364,15 @@ _e_mod_comp_wl_comp_region_create(struct wl_client *client, struct wl_resource *
region->resource.destroy = _e_mod_comp_wl_comp_region_destroy;
region->resource.object.id = id;
region->resource.object.interface = &wl_region_interface;
region->resource.object.implementation =
(void (**)(void))&_wl_region_interface;
region->resource.object.implementation =
(void (* *)(void)) & _wl_region_interface;
region->resource.data = region;
pixman_region32_init(&region->region);
wl_client_add_resource(client, &region->resource);
}
static void
static void
_e_mod_comp_wl_comp_region_destroy(struct wl_resource *resource)
{
Wayland_Region *region;
@ -382,7 +382,7 @@ _e_mod_comp_wl_comp_region_destroy(struct wl_resource *resource)
free(region);
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -397,22 +397,22 @@ _e_mod_comp_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *eve
input = e_mod_comp_wl_input_get();
wl_list_for_each(ws, &_wl_comp->surfaces, link)
{
if (((ws->win) && (ws->win->border))
&& (ws->win->border->win == ev->win))
{
timestamp = e_mod_comp_wl_time_get();
wl_input_device_set_keyboard_focus(&input->input_device,
&ws->surface);
wl_data_device_set_keyboard_focus(&input->input_device);
break;
}
}
{
if (((ws->win) && (ws->win->border))
&& (ws->win->border->win == ev->win))
{
timestamp = e_mod_comp_wl_time_get();
wl_input_device_set_keyboard_focus(&input->input_device,
&ws->surface);
wl_data_device_set_keyboard_focus(&input->input_device);
break;
}
}
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -430,7 +430,7 @@ _e_mod_comp_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *ev
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -451,7 +451,7 @@ _e_mod_comp_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *eve
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -470,7 +470,7 @@ _e_mod_comp_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *ev
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -493,13 +493,13 @@ _e_mod_comp_wl_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e
e_mod_comp_wl_comp_repick(device, timestamp);
interface = device->pointer_grab->interface;
interface->motion(device->pointer_grab, timestamp,
interface->motion(device->pointer_grab, timestamp,
device->pointer_grab->x, device->pointer_grab->y);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -518,9 +518,11 @@ _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e
case 1:
btn = ev->buttons + BTN_LEFT - 1;
break;
case 2:
btn = BTN_MIDDLE;
break;
case 3:
btn = BTN_RIGHT;
break;
@ -540,13 +542,13 @@ _e_mod_comp_wl_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *e
device->button_count++;
/* TODO: Run binding ?? */
device->pointer_grab->interface->button(device->pointer_grab,
device->pointer_grab->interface->button(device->pointer_grab,
timestamp, btn, 1);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -565,9 +567,11 @@ _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *eve
case 1:
btn = ev->buttons + BTN_LEFT - 1;
break;
case 2:
btn = BTN_MIDDLE;
break;
case 3:
btn = BTN_RIGHT;
break;
@ -580,13 +584,13 @@ _e_mod_comp_wl_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *eve
/* TODO: Run binding ?? */
timestamp = e_mod_comp_wl_time_get();
device->pointer_grab->interface->button(device->pointer_grab,
device->pointer_grab->interface->button(device->pointer_grab,
timestamp, btn, 0);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -618,13 +622,13 @@ _e_mod_comp_wl_cb_key_down(void *data __UNUSED__, int type __UNUSED__, void *eve
*k = key;
if (device->keyboard_focus_resource)
wl_resource_post_event(device->keyboard_focus_resource,
wl_resource_post_event(device->keyboard_focus_resource,
WL_INPUT_DEVICE_KEY, timestamp, key, 1);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
static Eina_Bool
_e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Wayland_Input *input;
@ -655,7 +659,7 @@ _e_mod_comp_wl_cb_key_up(void *data __UNUSED__, int type __UNUSED__, void *event
/* *k = ev->key; */
if (device->keyboard_focus_resource)
wl_resource_post_event(device->keyboard_focus_resource,
wl_resource_post_event(device->keyboard_focus_resource,
WL_INPUT_DEVICE_KEY, timestamp, key, 0);
return ECORE_CALLBACK_PASS_ON;
@ -668,17 +672,17 @@ _e_mod_comp_wl_comp_pick_surface(int32_t x __UNUSED__, int32_t y __UNUSED__, int
if (wl_list_empty(&_wl_comp->surfaces)) return NULL;
wl_list_for_each(ws, &_wl_comp->surfaces, link)
{
if (ws->surface.resource.client == NULL) continue;
if ((0 <= *sx) && (*sx < ws->w) &&
(0 <= *sy) && (*sy < ws->h))
return ws;
}
{
if (ws->surface.resource.client == NULL) continue;
if ((0 <= *sx) && (*sx < ws->w) &&
(0 <= *sy) && (*sy < ws->h))
return ws;
}
return NULL;
}
static void
static void
_e_mod_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t state)
{
uint32_t mod;
@ -689,21 +693,25 @@ _e_mod_comp_wl_comp_update_modifier(Wayland_Input *input, uint32_t key, uint32_t
case KEY_RIGHTCTRL:
mod = MODIFIER_CTRL;
break;
case KEY_LEFTALT:
case KEY_RIGHTALT:
mod = MODIFIER_ALT;
break;
case KEY_LEFTMETA:
case KEY_RIGHTMETA:
mod = MODIFIER_SUPER;
break;
default:
mod = 0;
break;
}
if (state)
if (state)
input->modifier_state |= mod;
else
else
input->modifier_state &= ~mod;
}

View File

@ -11,7 +11,7 @@ static void _e_mod_comp_wl_input_unbind(struct wl_resource *resource);
static void _e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t serial, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y);
/* wayland interfaces */
static const struct wl_input_device_interface _wl_input_interface =
static const struct wl_input_device_interface _wl_input_interface =
{
_e_mod_comp_wl_input_attach,
};
@ -19,7 +19,7 @@ static const struct wl_input_device_interface _wl_input_interface =
/* private variables */
static Wayland_Input *_wl_input;
Eina_Bool
Eina_Bool
e_mod_comp_wl_input_init(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -33,8 +33,8 @@ e_mod_comp_wl_input_init(void)
memset(_wl_input, 0, sizeof(*_wl_input));
wl_input_device_init(&_wl_input->input_device);
if (!wl_display_add_global(_wl_disp, &wl_input_device_interface, _wl_input,
_e_mod_comp_wl_input_bind))
if (!wl_display_add_global(_wl_disp, &wl_input_device_interface, _wl_input,
_e_mod_comp_wl_input_bind))
{
EINA_LOG_ERR("Failed to add input to wayland\n");
free(_wl_input);
@ -47,7 +47,7 @@ e_mod_comp_wl_input_init(void)
return EINA_TRUE;
}
void
void
e_mod_comp_wl_input_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -64,7 +64,7 @@ e_mod_comp_wl_input_get(void)
}
/* local functions */
static void
static void
_e_mod_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id)
{
struct wl_input_device *device;
@ -73,14 +73,14 @@ _e_mod_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version
LOGFN(__FILE__, __LINE__, __FUNCTION__);
device = data;
resource =
wl_client_add_object(client, &wl_input_device_interface,
resource =
wl_client_add_object(client, &wl_input_device_interface,
&_wl_input_interface, id, data);
wl_list_insert(&device->resource_list, &resource->link);
resource->destroy = _e_mod_comp_wl_input_unbind;
}
static void
static void
_e_mod_comp_wl_input_unbind(struct wl_resource *resource)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -89,7 +89,7 @@ _e_mod_comp_wl_input_unbind(struct wl_resource *resource)
free(resource);
}
static void
static void
_e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t serial, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y)
{
Wayland_Input *wi;
@ -103,3 +103,4 @@ _e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resour
wi->hotspot_x = x;
wi->hotspot_y = y;
}

View File

@ -13,7 +13,7 @@ static void _e_mod_comp_wl_output_bind(struct wl_client *client, void *data, uin
/* private variables */
static Wayland_Output *_wl_output;
Eina_Bool
Eina_Bool
e_mod_comp_wl_output_init(void)
{
Ecore_X_Window *roots;
@ -38,7 +38,7 @@ e_mod_comp_wl_output_init(void)
memset(_wl_output, 0, sizeof(*_wl_output));
_wl_output->mode.flags =
_wl_output->mode.flags =
(WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED);
_wl_output->mode.w = rw;
_wl_output->mode.h = rh;
@ -53,7 +53,7 @@ e_mod_comp_wl_output_init(void)
wl_list_init(&_wl_output->link);
wl_list_init(&_wl_output->frame_callbacks);
if (!wl_display_add_global(_wl_disp, &wl_output_interface, _wl_output,
if (!wl_display_add_global(_wl_disp, &wl_output_interface, _wl_output,
_e_mod_comp_wl_output_bind))
{
EINA_LOG_ERR("Failed to add output to wayland\n");
@ -64,7 +64,7 @@ e_mod_comp_wl_output_init(void)
return EINA_TRUE;
}
void
void
e_mod_comp_wl_output_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -82,7 +82,7 @@ e_mod_comp_wl_output_get(void)
}
/* local functions */
static void
static void
_e_mod_comp_wl_output_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id)
{
Wayland_Output *output;
@ -91,11 +91,12 @@ _e_mod_comp_wl_output_bind(struct wl_client *client, void *data, uint32_t versio
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(output = data)) return;
resource =
resource =
wl_client_add_object(client, &wl_output_interface, NULL, id, data);
wl_resource_post_event(resource, WL_OUTPUT_GEOMETRY, output->x, output->y,
output->w, output->h, output->subpixel,
wl_resource_post_event(resource, WL_OUTPUT_GEOMETRY, output->x, output->y,
output->w, output->h, output->subpixel,
output->make, output->model);
wl_resource_post_event(resource, WL_OUTPUT_MODE, output->mode.flags,
wl_resource_post_event(resource, WL_OUTPUT_MODE, output->mode.flags,
output->mode.w, output->mode.h, output->mode.refresh);
}

View File

@ -6,13 +6,13 @@
# include "e_mod_comp_wl_region.h"
#endif
void
void
e_mod_comp_wl_region_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource)
{
wl_resource_destroy(resource);
}
void
void
e_mod_comp_wl_region_add(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h)
{
Wayland_Region *region;
@ -21,7 +21,7 @@ e_mod_comp_wl_region_add(struct wl_client *client __UNUSED__, struct wl_resource
pixman_region32_union_rect(&region->region, &region->region, x, y, w, h);
}
void
void
e_mod_comp_wl_region_subtract(struct wl_client *client __UNUSED__, struct wl_resource *resource, int x, int y, int w, int h)
{
Wayland_Region *region;

View File

@ -10,36 +10,36 @@
#endif
/* local function prototypes */
static void _e_mod_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id);
static void _e_mod_comp_wl_shell_lock(Wayland_Shell *base);
static void _e_mod_comp_wl_shell_unlock(Wayland_Shell *base);
static void _e_mod_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t width, int32_t height);
static void _e_mod_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height);
static void _e_mod_comp_wl_shell_destroy(Wayland_Shell *base);
static void _e_mod_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp);
static void _e_mod_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id);
static void _e_mod_comp_wl_shell_lock(Wayland_Shell *base);
static void _e_mod_comp_wl_shell_unlock(Wayland_Shell *base);
static void _e_mod_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t width, int32_t height);
static void _e_mod_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height);
static void _e_mod_comp_wl_shell_destroy(Wayland_Shell *base);
static void _e_mod_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp);
static void _e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource);
static void _e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial);
static void _e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp);
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_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, 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_maximized(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__);
static void _e_mod_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title);
static void _e_mod_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *clas);
static void _e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource);
static void _e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial);
static void _e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp);
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_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, 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_maximized(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__);
static void _e_mod_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title);
static void _e_mod_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *clas);
static void _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__);
static void _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__);
static Wayland_Shell_Surface *_e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws);
static void _e_mod_comp_wl_shell_surface_destroy(struct wl_resource *resource);
static void _e_mod_comp_wl_shell_surface_destroy(struct wl_resource *resource);
/* wayland interfaces */
static const struct wl_shell_interface _wl_shell_interface =
static const struct wl_shell_interface _wl_shell_interface =
{
_e_mod_comp_wl_shell_shell_surface_get
};
static const struct wl_shell_surface_interface _wl_shell_surface_interface =
static const struct wl_shell_surface_interface _wl_shell_surface_interface =
{
_e_mod_comp_wl_shell_surface_pong,
_e_mod_comp_wl_shell_surface_move,
@ -56,7 +56,7 @@ static const struct wl_shell_surface_interface _wl_shell_surface_interface =
/* private variables */
struct wl_shell *_wl_shell;
Eina_Bool
Eina_Bool
e_mod_comp_wl_shell_init(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -75,8 +75,8 @@ e_mod_comp_wl_shell_init(void)
_wl_shell->shell.configure = _e_mod_comp_wl_shell_configure;
_wl_shell->shell.destroy = _e_mod_comp_wl_shell_destroy;
if (!wl_display_add_global(_wl_disp, &wl_shell_interface, _wl_shell,
_e_mod_comp_wl_shell_bind))
if (!wl_display_add_global(_wl_disp, &wl_shell_interface, _wl_shell,
_e_mod_comp_wl_shell_bind))
{
EINA_LOG_ERR("Could not create shell\n");
free(_wl_shell);
@ -86,7 +86,7 @@ e_mod_comp_wl_shell_init(void)
return EINA_TRUE;
}
void
void
e_mod_comp_wl_shell_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -102,7 +102,7 @@ e_mod_comp_wl_shell_get(void)
}
/* local functions */
static void
static void
_e_mod_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id)
{
struct wl_shell *shell;
@ -110,11 +110,11 @@ _e_mod_comp_wl_shell_bind(struct wl_client *client, void *data, uint32_t version
LOGFN(__FILE__, __LINE__, __FUNCTION__);
shell = data;
wl_client_add_object(client, &wl_shell_interface, &_wl_shell_interface,
wl_client_add_object(client, &wl_shell_interface, &_wl_shell_interface,
id, shell);
}
static void
static void
_e_mod_comp_wl_shell_lock(Wayland_Shell *base)
{
struct wl_shell *shell;
@ -124,7 +124,7 @@ _e_mod_comp_wl_shell_lock(Wayland_Shell *base)
shell = container_of(base, struct wl_shell, shell);
}
static void
static void
_e_mod_comp_wl_shell_unlock(Wayland_Shell *base)
{
struct wl_shell *shell;
@ -134,7 +134,7 @@ _e_mod_comp_wl_shell_unlock(Wayland_Shell *base)
shell = container_of(base, struct wl_shell, shell);
}
static void
static void
_e_mod_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t width, int32_t height)
{
Wayland_Compositor *comp;
@ -173,13 +173,14 @@ _e_mod_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t
surface->x = 10 + random() % 400;
surface->y = 10 + random() % 400;
break;
default:
wl_list_insert(list, &surface->link);
break;
}
if (do_configure)
e_mod_comp_wl_surface_configure(surface, surface->x, surface->y,
e_mod_comp_wl_surface_configure(surface, surface->x, surface->y,
surface->w, surface->h);
switch (type)
@ -193,7 +194,7 @@ _e_mod_comp_wl_shell_map(Wayland_Shell *base, Wayland_Surface *surface, int32_t
}
}
static void
static void
_e_mod_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, int32_t x, int32_t y, int32_t width, int32_t height)
{
struct wl_shell *shell;
@ -216,8 +217,10 @@ _e_mod_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, in
{
case SHELL_SURFACE_SCREENSAVER:
do_configure = !do_configure;
case SHELL_SURFACE_FULLSCREEN:
break;
default:
break;
}
@ -226,7 +229,7 @@ _e_mod_comp_wl_shell_configure(Wayland_Shell *base, Wayland_Surface *surface, in
e_mod_comp_wl_surface_configure(surface, x, y, width, height);
}
static void
static void
_e_mod_comp_wl_shell_destroy(Wayland_Shell *base)
{
struct wl_shell *shell;
@ -238,7 +241,7 @@ _e_mod_comp_wl_shell_destroy(Wayland_Shell *base)
free(shell);
}
static void
static void
_e_mod_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp)
{
struct wl_shell *shell;
@ -249,7 +252,7 @@ _e_mod_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uin
e_mod_comp_wl_surface_activate(surface, e_mod_comp_wl_input_get(), timestamp);
}
static void
static void
_e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource)
{
Wayland_Surface *ws;
@ -260,8 +263,8 @@ _e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resou
ws = surface_resource->data;
if (_e_mod_comp_wl_shell_get_shell_surface(ws))
{
wl_resource_post_error(surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
wl_resource_post_error(surface_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"get_shell_surface already requested");
return;
}
@ -275,15 +278,15 @@ _e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resou
wss->resource.destroy = _e_mod_comp_wl_shell_surface_destroy;
wss->resource.object.id = id;
wss->resource.object.interface = &wl_shell_surface_interface;
wss->resource.object.implementation =
(void (**)(void)) &_wl_shell_surface_interface;
wss->resource.object.implementation =
(void (* *)(void)) & _wl_shell_surface_interface;
wss->resource.data = wss;
wss->surface = ws;
wss->surface_destroy_listener.notify =
wss->surface_destroy_listener.notify =
_e_mod_comp_wl_shell_surface_destroy_handle;
wl_signal_add(&ws->surface.resource.destroy_signal,
&wss->surface_destroy_listener);
wl_signal_add(&ws->surface.resource.destroy_signal,
&wss->surface_destroy_listener);
wl_list_init(&wss->link);
@ -291,7 +294,7 @@ _e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resou
wl_client_add_resource(client, &wss->resource);
}
static void
static void
_e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial)
{
Wayland_Shell_Surface *wss;
@ -302,21 +305,19 @@ _e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl
/* TODO: handle ping timer */
}
static void
static void
_e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
}
static void
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)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
}
static void
static void
_e_mod_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource)
{
Wayland_Shell_Surface *wss;
@ -331,7 +332,7 @@ _e_mod_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, s
wss->type = SHELL_SURFACE_TOPLEVEL;
}
static void
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__)
{
Wayland_Shell_Surface *wss, *pss;
@ -354,7 +355,7 @@ _e_mod_comp_wl_shell_surface_set_transient(struct wl_client *client __UNUSED__,
wss->type = SHELL_SURFACE_TRANSIENT;
}
static void
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__)
{
Wayland_Shell_Surface *wss;
@ -375,7 +376,7 @@ _e_mod_comp_wl_shell_surface_set_fullscreen(struct wl_client *client __UNUSED__,
wss->type = SHELL_SURFACE_FULLSCREEN;
}
static void
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__)
{
Wayland_Shell_Surface *wss;
@ -392,7 +393,7 @@ _e_mod_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, stru
wss->popup.y = y;
}
static void
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;
@ -405,7 +406,7 @@ _e_mod_comp_wl_shell_surface_set_maximized(struct wl_client *client __UNUSED__,
/* FIXME: Implement */
}
static void
static void
_e_mod_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title)
{
Wayland_Shell_Surface *wss;
@ -417,7 +418,7 @@ _e_mod_comp_wl_shell_surface_set_title(struct wl_client *client, struct wl_resou
wss->title = strdup(title);
}
static void
static void
_e_mod_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *clas)
{
Wayland_Shell_Surface *wss;
@ -429,7 +430,7 @@ _e_mod_comp_wl_shell_surface_set_class(struct wl_client *client, struct wl_resou
wss->clas = strdup(clas);
}
static void
static void
_e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__)
{
Wayland_Shell_Surface *wss;
@ -448,16 +449,16 @@ _e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
listener =
wl_signal_get(&ws->surface.resource.destroy_signal,
listener =
wl_signal_get(&ws->surface.resource.destroy_signal,
_e_mod_comp_wl_shell_surface_destroy_handle);
if (listener)
return container_of(listener, Wayland_Shell_Surface,
return container_of(listener, Wayland_Shell_Surface,
surface_destroy_listener);
return NULL;
}
static void
static void
_e_mod_comp_wl_shell_surface_destroy(struct wl_resource *resource)
{
Wayland_Shell_Surface *wss;
@ -472,3 +473,4 @@ _e_mod_comp_wl_shell_surface_destroy(struct wl_resource *resource)
wl_list_remove(&wss->link);
free(wss);
}

View File

@ -51,7 +51,7 @@ e_mod_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h)
wl_list_init(&ws->frame_callbacks);
ws->buffer_destroy_listener.notify =
ws->buffer_destroy_listener.notify =
_e_mod_comp_wl_surface_buffer_destroy_handle;
/* ws->transform = NULL; */
@ -59,7 +59,7 @@ e_mod_comp_wl_surface_create(int32_t x, int32_t y, int32_t w, int32_t h)
return ws;
}
void
void
e_mod_comp_wl_surface_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -67,7 +67,7 @@ e_mod_comp_wl_surface_destroy(struct wl_client *client __UNUSED__, struct wl_res
wl_resource_destroy(resource);
}
void
void
e_mod_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t x, int32_t y)
{
Wayland_Surface *ws;
@ -91,19 +91,19 @@ e_mod_comp_wl_surface_attach(struct wl_client *client __UNUSED__, struct wl_reso
buffer->busy_count++;
ws->buffer = buffer;
wl_signal_add(&ws->buffer->resource.destroy_signal,
&ws->buffer_destroy_listener);
&ws->buffer_destroy_listener);
if (!ws->visual)
shell->shell.map(&shell->shell, ws, buffer->width, buffer->height);
else if ((x != 0) || (y != 0) ||
else if ((x != 0) || (y != 0) ||
(ws->w != buffer->width) || (ws->h != buffer->height))
shell->shell.configure(&shell->shell, ws, ws->x + x, ws->y + y,
shell->shell.configure(&shell->shell, ws, ws->x + x, ws->y + y,
buffer->width, buffer->height);
e_mod_comp_wl_buffer_attach(buffer, &ws->surface);
}
void
void
e_mod_comp_wl_surface_damage(struct wl_client *client __UNUSED__, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height)
{
Wayland_Surface *ws;
@ -114,7 +114,7 @@ e_mod_comp_wl_surface_damage(struct wl_client *client __UNUSED__, struct wl_reso
_e_mod_comp_wl_surface_damage_rectangle(ws, x, y, width, height);
}
void
void
e_mod_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback)
{
Wayland_Surface *ws;
@ -139,7 +139,7 @@ e_mod_comp_wl_surface_frame(struct wl_client *client, struct wl_resource *resour
wl_list_insert(ws->frame_callbacks.prev, &cb->link);
}
void
void
e_mod_comp_wl_surface_set_opaque_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource)
{
Wayland_Surface *ws;
@ -160,7 +160,7 @@ e_mod_comp_wl_surface_set_opaque_region(struct wl_client *client __UNUSED__, str
pixman_region32_init(&ws->opaque);
}
void
void
e_mod_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *region_resource)
{
Wayland_Surface *ws;
@ -184,7 +184,7 @@ e_mod_comp_wl_surface_set_input_region(struct wl_client *client __UNUSED__, stru
e_mod_comp_wl_comp_repick(&input->input_device, e_mod_comp_wl_time_get());
}
void
void
e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource)
{
Wayland_Surface *ws;
@ -210,7 +210,7 @@ e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource)
if (ws->buffer)
wl_list_remove(&ws->buffer_destroy_listener.link);
if (ws->image != EGL_NO_IMAGE_KHR)
if (ws->image != EGL_NO_IMAGE_KHR)
{
Wayland_Compositor *comp;
@ -226,7 +226,7 @@ e_mod_comp_wl_surface_destroy_surface(struct wl_resource *resource)
free(ws);
}
void
void
e_mod_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -248,7 +248,7 @@ e_mod_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32
Wayland_Output *output;
output = e_mod_comp_wl_output_get();
wl_list_insert_list(output->frame_callbacks.prev,
wl_list_insert_list(output->frame_callbacks.prev,
&ws->frame_callbacks);
wl_list_init(&ws->frame_callbacks);
}
@ -262,12 +262,12 @@ e_mod_comp_wl_surface_configure(Wayland_Surface *ws, int32_t x, int32_t y, int32
pixman_region32_init(&ws->opaque);
}
void
void
e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t timestamp __UNUSED__)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (ws->win)
if (ws->win)
{
e_win_show(ws->win);
ws->win->border->borderless = EINA_TRUE;
@ -278,7 +278,7 @@ e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t
wl_data_device_set_keyboard_focus(&wi->input_device);
}
void
void
e_mod_comp_wl_surface_damage_surface(Wayland_Surface *ws)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -287,7 +287,7 @@ e_mod_comp_wl_surface_damage_surface(Wayland_Surface *ws)
}
/* local functions */
static void
static void
_e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void *data __UNUSED__)
{
Wayland_Surface *ws;
@ -298,7 +298,7 @@ _e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void
ws->buffer = NULL;
}
static void
static void
_e_mod_comp_wl_surface_raise(Wayland_Surface *ws)
{
Wayland_Compositor *comp;
@ -315,16 +315,16 @@ _e_mod_comp_wl_surface_raise(Wayland_Surface *ws)
e_mod_comp_wl_surface_damage_surface(ws);
}
static void
static void
_e_mod_comp_wl_surface_damage_rectangle(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
pixman_region32_union_rect(&ws->damage, &ws->damage,
pixman_region32_union_rect(&ws->damage, &ws->damage,
ws->x + x, ws->y + y, width, height);
}
static void
static void
_e_mod_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource)
{
Wayland_Frame_Callback *cb;
@ -335,3 +335,4 @@ _e_mod_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource)
wl_list_remove(&cb->link);
free(cb);
}

View File

@ -69,16 +69,16 @@ struct _E_Config_Dialog_Data
/* Protos */
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd,
static void _free_data(E_Config_Dialog *cfd,
E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd,
Evas *evas,
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd,
Evas *evas,
E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd,
E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd,
E_Config_Dialog_Data *cfdata);
E_Config_Dialog *
e_int_config_comp_module(E_Container *con,
e_int_config_comp_module(E_Container *con,
const char *params __UNUSED__)
{
E_Config_Dialog *cfd;
@ -103,7 +103,7 @@ e_int_config_comp_module(E_Container *con,
}
static void
_match_dup(Match *m,
_match_dup(Match *m,
Match_Config *m2)
{
m2->match = *m;
@ -234,8 +234,8 @@ _free_data(E_Config_Dialog *cfd __UNUSED__,
}
static void
_shadow_changed(void *data,
Evas_Object *obj,
_shadow_changed(void *data,
Evas_Object *obj,
void *event_info __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
@ -304,8 +304,8 @@ _style_demo(void *data)
static void
_style_selector_del(void *data __UNUSED__,
Evas *e,
Evas_Object *o,
Evas *e,
Evas_Object *o,
void *event_info __UNUSED__)
{
Eina_List *style_shadows, *style_list;
@ -346,8 +346,8 @@ _style_selector_del(void *data __UNUSED__,
}
static Evas_Object *
_style_selector(Evas *evas,
int use_shadow,
_style_selector(Evas *evas,
int use_shadow,
const char **source)
{
Evas_Object *oi, *ob, *oo, *obd, *orec, *oly, *orec0;
@ -538,10 +538,10 @@ _match_label_get(Match_Config *m)
}
static void
_match_ilist_append(Evas_Object *il,
_match_ilist_append(Evas_Object *il,
Match_Config *m,
int pos,
int pre)
int pos,
int pre)
{
char *name = _match_label_get(m);
@ -558,7 +558,7 @@ _match_ilist_append(Evas_Object *il,
}
static void
_match_list_up(Eina_List **list,
_match_list_up(Eina_List **list,
Match_Config *m)
{
Eina_List *l, *lp;
@ -572,7 +572,7 @@ _match_list_up(Eina_List **list,
}
static void
_match_list_down(Eina_List **list,
_match_list_down(Eina_List **list,
Match_Config *m)
{
Eina_List *l, *lp;
@ -586,7 +586,7 @@ _match_list_down(Eina_List **list,
}
static void
_match_list_del(Eina_List **list,
_match_list_del(Eina_List **list,
Match_Config *m)
{
Eina_List *l, *lp;
@ -599,9 +599,9 @@ _match_list_del(Eina_List **list,
}
static void
_cb_dialog_resize(void *data,
_cb_dialog_resize(void *data,
Evas *e __UNUSED__,
Evas_Object *obj,
Evas_Object *obj,
void *event_info __UNUSED__)
{
Evas_Object *bg, *of;
@ -682,10 +682,10 @@ _edit_ok(void *d1,
}
static void
_create_edit_frame(E_Config_Dialog *cfd,
Evas *evas,
_create_edit_frame(E_Config_Dialog *cfd,
Evas *evas,
E_Config_Dialog_Data *cfdata,
Match_Config *m)
Match_Config *m)
{
Evas_Object *of, *oi, *lb, *en, *bt, *tb, *tab2, *o, *sf, *li;
E_Radio_Group *rg;
@ -1083,11 +1083,11 @@ _but_edit(void *d1,
}
static Evas_Object *
_create_match_editor(E_Config_Dialog *cfd,
Evas *evas,
_create_match_editor(E_Config_Dialog *cfd,
Evas *evas,
E_Config_Dialog_Data *cfdata __UNUSED__,
Eina_List **matches,
Evas_Object **il_ret)
Eina_List **matches,
Evas_Object **il_ret)
{
Evas_Object *tab, *il, *bt;
Match_Config *m;
@ -1123,8 +1123,8 @@ _create_match_editor(E_Config_Dialog *cfd,
}
static Evas_Object *
_create_styles_toolbook(E_Config_Dialog *cfd,
Evas *evas,
_create_styles_toolbook(E_Config_Dialog *cfd,
Evas *evas,
E_Config_Dialog_Data *cfdata)
{
Evas_Object *tb, *oi, *il;
@ -1156,8 +1156,8 @@ _create_styles_toolbook(E_Config_Dialog *cfd,
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd,
Evas *evas,
_basic_create_widgets(E_Config_Dialog *cfd,
Evas *evas,
E_Config_Dialog_Data *cfdata)
{
Evas_Object *ob, *ol, *ol2, *of, *otb, *oi, *orec0, *tab;
@ -1209,7 +1209,7 @@ _basic_create_widgets(E_Config_Dialog *cfd,
rg = e_widget_radio_group_new(&(cfdata->engine));
ob = e_widget_radio_add(evas, _("Software"), ENGINE_SW, rg);
e_widget_list_object_append(ol, ob, 1, 1, 0.5);
if (!getenv("ECORE_X_NO_XLIB"))
if (!getenv("ECORE_X_NO_XLIB"))
{
if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11))
{
@ -1220,8 +1220,8 @@ _basic_create_widgets(E_Config_Dialog *cfd,
e_widget_framelist_content_align_set(of, 0.5, 0.0);
ob = e_widget_check_add(evas, _("Texture from pixmap"), &(cfdata->texture_from_pixmap));
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Ctrl+Alt+Shift+Home resets compositor"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Ctrl+Alt+Shift+Home resets compositor"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Indirect OpenGL (EXPERIMENTAL)"), &(cfdata->indirect));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(ol, of, 1, 1, 0.5);
@ -1361,7 +1361,7 @@ _match_list_free(Eina_List *list)
static void
_match_dup2(Match_Config *m2,
Match *m)
Match *m)
{
*m = m2->match;
if (m->title) m->title = eina_stringshare_add(m->title);

View File

@ -58,7 +58,6 @@ e_modapi_init(E_Module *m)
e_mod_comp_cfdata_edd_init(&(mod->conf_edd),
&(mod->conf_match_edd));
mod->conf = e_config_domain_load("module.comp", mod->conf_edd);
/* add module supplied action */
@ -68,7 +67,7 @@ e_modapi_init(E_Module *m)
act->func.go = _e_mod_action_cb;
act->func.go_key = _e_mod_action_key_cb;
e_action_predef_name_set(_("Composite"), _("Toggle FPS Display"),
"composite", "", NULL, 0);
"composite", "", NULL, 0);
}
if (!mod->conf) _e_mod_config_new(m);
@ -83,10 +82,10 @@ e_modapi_init(E_Module *m)
Eina_List *l;
E_Module *m2;
EINA_LIST_FOREACH(e_module_list(), l, m2)
{
if (m2->enabled && (!strcmp(m2->name, "dropshadow")))
e_module_disable(m2);
}
{
if (m2->enabled && (!strcmp(m2->name, "dropshadow")))
e_module_disable(m2);
}
}
/* XXX: update old configs. add config versioning */