}
EINTERN void
+e_client_layout_set(E_Client *ec, uint32_t num_cols, uint32_t num_rows, uint32_t column_id, uint32_t row_id, uint32_t col_span, uint32_t row_span)
+{
+ E_OBJECT_CHECK(ec);
+ E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
+
+ /*
+ num_cols: total number of columns
+ num_rows: total number of rows
+ column_id: column index to be placed
+ row_id: row index to be placed
+ col_span: the number of column span to be occupied
+ row_span: the number of row span to be occupied
+ */
+
+ E_Desk *desk;
+ unsigned int unit_w, unit_h;
+ int x, y;
+ unsigned int w, h;
+
+ desk = e_comp_desk_find_by_ec(ec);
+ EINA_SAFETY_ON_NULL_RETURN(desk);
+
+ unit_w = desk->geom.w / num_cols;
+ unit_h = desk->geom.h / num_rows;
+
+ x = unit_w * column_id;
+ y = unit_h * row_id;
+ w = unit_w * col_span;
+ h = unit_h * row_span;
+
+ // TODO: We may need to adjust the last size if the unit size is not divided exactly
+
+ ELOGF("TZPOL", "LAYOUT SET... total_layout(%d,%d) -> unit_size(%dx%d). request(%d,%d,%d,%d) -> geo(%d,%d,%dx%d)",
+ ec, num_cols, num_rows, unit_w, unit_h, column_id, row_id, col_span, row_span, x, y, w, h);
+
+ // Apply shadow size (left, right, top, bottom)
+ x -= ec->manage_resize.shadow.l;
+ y -= ec->manage_resize.shadow.t;
+ w = w + ec->manage_resize.shadow.l + ec->manage_resize.shadow.r;
+ h = h + ec->manage_resize.shadow.t + ec->manage_resize.shadow.b;
+
+ ELOGF("TZPOL", "Consider Shadow size(l:%d,r:%d,t:%d,b:%d). new (%d,%d,%dx%d)",
+ ec, ec->manage_resize.shadow.l, ec->manage_resize.shadow.r, ec->manage_resize.shadow.t, ec->manage_resize.shadow.b, x, y, w, h);
+
+ e_client_layout_apply(ec, EINA_TRUE);
+ e_client_frame_geometry_set(ec, x, y, w, h);
+
+ if (!ec->visible)
+ e_client_shell_configure_send(ec, 0, w, h);
+}
+
+EINTERN void
e_client_fullscreen(E_Client *ec, E_Fullscreen policy)
{
E_OBJECT_CHECK(ec);
EINTERN unsigned int e_clients_count(void);
EINTERN void e_client_activate(E_Client *ec);
EINTERN Eina_List *e_client_lost_windows_get(E_Zone *zone);
+EINTERN void e_client_layout_set(E_Client *ec, uint32_t num_cols, uint32_t num_rows, uint32_t column_id, uint32_t row_id, uint32_t col_span, uint32_t row_span);
EINTERN void e_client_fullscreen(E_Client *ec, E_Fullscreen policy);
EINTERN void e_client_unfullscreen(E_Client *ec);
EINTERN void e_client_stick(E_Client *ec);
_tzpol_iface_cb_set_layout(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *surf, uint32_t num_cols, uint32_t num_rows, uint32_t column, uint32_t row, uint32_t col_span, uint32_t row_span)
{
E_Client *ec;
- E_Desk *desk;
- int unit_w, unit_h;
- int x, y, w, h;
ec = e_client_from_surface_resource(surf);
if (!ec) return;
- desk = e_comp_desk_find_by_ec(ec);
- EINA_SAFETY_ON_NULL_RETURN(desk);
-
- unit_w = desk->geom.w / num_cols;
- unit_h = desk->geom.h / num_rows;
-
- x = unit_w * column;
- y = unit_h * row;
- w = unit_w * col_span;
- h = unit_h * row_span;
-
- // TODO: We may need to adjust the last size if the unit size is not devided exactly
-
- ELOGF("TZPOL", "TIZEN_POLICY_SET_LAYOUT... total_layout(%d,%d) -> unit_size(%dx%d). request(%d,%d,%d,%d) -> geo(%d,%d,%dx%d)",
- ec, num_cols, num_rows, unit_w, unit_h, column, row, col_span, row_span, x, y, w, h);
-
- // Apply shadow size (left, right, top, bottom)
- x -= ec->manage_resize.shadow.l;
- y -= ec->manage_resize.shadow.t;
- w = w + ec->manage_resize.shadow.l + ec->manage_resize.shadow.r;
- h = h + ec->manage_resize.shadow.t + ec->manage_resize.shadow.b;
-
- ELOGF("TZPOL", "Consider Shadow size(l:%d,r:%d,t:%d,b:%d). new (%d,%d,%dx%d)",
- ec, ec->manage_resize.shadow.l, ec->manage_resize.shadow.r, ec->manage_resize.shadow.t, ec->manage_resize.shadow.b, x, y, w, h);
-
- e_client_layout_apply(ec, EINA_TRUE);
- e_client_frame_geometry_set(ec, x, y, w, h);
+ ELOGF("TZPOL", "TIZEN_POLICY_SET_LAYOUT... total_layout(%d,%d), index(%d,%d), span(%d,%d)",
+ ec, num_cols, num_rows, column, row, col_span, row_span);
- if (!ec->visible)
- e_client_shell_configure_send(ec, 0, w, h);
+ e_client_layout_set(ec, num_cols, num_rows, column, row, col_span, row_span);
}
static void