ecore_main_loop_quit();
}
+static void
+_e_info_client_cb_wininfo_print_shape(const Eldbus_Message *msg)
+{
+ const char *name = NULL, *text = NULL;
+ Eina_Bool res;
+ Eldbus_Message_Iter *array_of_shape, *array_of_shape_input;
+ Eldbus_Message_Iter *struct_of_shape;
+ int count = 0;
+ int shape_rects_num, shape_input_rects_num;
+
+ res = eldbus_message_error_get(msg, &name, &text);
+ EINA_SAFETY_ON_TRUE_GOTO(res, finish);
+
+ res = eldbus_message_arguments_get(msg, "ia(iiii)ia(iiii)",
+ &shape_rects_num, &array_of_shape,
+ &shape_input_rects_num, &array_of_shape_input);
+ EINA_SAFETY_ON_FALSE_GOTO(res, finish);
+
+ printf(" Number of shape rectangles: %d\n", shape_rects_num);
+ if (shape_rects_num)
+ {
+ while (eldbus_message_iter_get_and_next(array_of_shape, 'r', &struct_of_shape))
+ {
+ int x, y, w, h;
+ res = eldbus_message_iter_arguments_get(struct_of_shape,
+ "iiii",
+ &x, &y, &w, &h);
+ EINA_SAFETY_ON_FALSE_GOTO(res, finish);
+ count++;
+ printf(" %d) x(%d), y(%d), w(%d), h(%d)\n", count, x, y, w, h);
+
+ }
+ }
+
+ count = 0;
+ printf(" Number of shape input rectangles: %d\n", shape_input_rects_num);
+ if (shape_input_rects_num)
+ {
+ while (eldbus_message_iter_get_and_next(array_of_shape_input, 'r', &struct_of_shape))
+ {
+ int x, y, w, h;
+ res = eldbus_message_iter_arguments_get(struct_of_shape,
+ "iiii",
+ &x, &y, &w, &h);
+ EINA_SAFETY_ON_FALSE_GOTO(res, finish);
+ count++;
+ printf(" %d) x(%d), y(%d), w(%d), h(%d)\n", count, x, y, w, h);
+
+ }
+ }
+
+ ecore_main_loop_quit();
+
+ return;
+
+finish:
+ if ((name) || (text))
+ {
+ printf("errname:%s errmsg:%s\n", name, text);
+ }
+
+ ecore_main_loop_quit();
+}
+
static Eina_Bool
_e_info_client_display_wininfo(uint64_t win, int children, int tree, int stats,
- int wm, int size)
+ int wm, int size, int shape)
{
Eina_Bool res;
char *win_name;
free(win_name);
- if (!children && !tree && !wm && !size)
+ if (!children && !tree && !wm && !size && !shape)
stats = 1;
if ((children || tree))
EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE);
}
+ if (shape)
+ {
+ res = _e_info_client_eldbus_message_with_args("wininfo_shape",
+ _e_info_client_cb_wininfo_print_shape,
+ "t",
+ win);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE);
+ }
+
return EINA_TRUE;
}
"\t-int : print window id in decimal\n" \
"\t-size : print size hints\n" \
"\t-wm : print window manager hints\n" \
- "\t-all : -tree, -stats, -wm, -size\n" \
+ "\t-shape : print shape rectangles\n" \
+ "\t-all : -tree, -stats, -wm, -size, -shape\n" \
+ "Example:\n" \
+ "\tenlightenment_info -wininfo\n" \
+ "\tenlightenment_info -wininfo -id [win_id] -all\n" \
+ "\tenlightenment_info -wininfo -children -stats -size\n" \
+ "\tenlightenment_info -wininfo -name [win_name] -tree -wm\n" \
+ "\tenlightenment_info -wininfo -pid [win_pid] -size -shape -int\n" \
static void
_e_info_client_proc_wininfo(int argc, char **argv)
{
Eina_Bool res;
uint64_t win = 0;
- int i, children = 0, tree = 0, stats = 0, wm = 0, size = 0;
+ int i, children = 0, tree = 0, stats = 0, wm = 0, size = 0, shape = 0;
char *name = NULL, *pid = NULL;
Eina_List *win_list = NULL, *l;
size = 1;
continue;
}
+ if (eina_streq (argv[i], "-shape"))
+ {
+ shape = 1;
+ continue;
+ }
if (eina_streq (argv[i], "-all"))
{
tree = 1;
stats = 1;
wm = 1;
size = 1;
+ shape = 1;
continue;
}
if (win)
{
- res = _e_info_client_display_wininfo(win, children, tree, stats, wm, size);
+ res = _e_info_client_display_wininfo(win, children, tree, stats, wm, size, shape);
EINA_SAFETY_ON_FALSE_RETURN(res);
}
else
uint64_t win;
win = (uint64_t)((Ecore_Window)eina_list_data_get(l));
- res = _e_info_client_display_wininfo(win, children, tree, stats, wm, size);
+ res = _e_info_client_display_wininfo(win, children, tree, stats, wm, size, shape);
EINA_SAFETY_ON_FALSE_GOTO(res, finish);
}
}
EINA_LIST_FOREACH(ec->transients, l, child)
{
uint64_t win;
- unsigned int num_child = -1;
+ int num_child = -1;
int hwc = -1, pl_zpos;
if (recurse)
return reply;
}
+static Eldbus_Message *
+_e_info_server_cb_wininfo_shape(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply;
+ Eldbus_Message_Iter *iter, *array_of_shape, *struct_of_shape;
+ Eina_Bool res;
+ E_Client *ec;
+ uint64_t win;
+ int i;
+
+ res = eldbus_message_arguments_get(msg, "t", &win);
+ if (res != EINA_TRUE)
+ {
+ return eldbus_message_error_new(msg, GET_CALL_MSG_ARG_ERR,
+ "wininfo_shape: an attempt to get arguments from method call message failed");
+ }
+
+ ec = _e_info_server_ec_find_by_win(win);
+ if (!ec)
+ {
+ return eldbus_message_error_new(msg, WIN_NOT_EXIST, "wininfo_shape: specified window(s) doesn't exist");
+ }
+
+ reply = eldbus_message_method_return_new(msg);
+ iter = eldbus_message_iter_get(reply);
+
+ eldbus_message_iter_basic_append(iter, 'i', ec->shape_rects_num);
+ array_of_shape = eldbus_message_iter_container_new(iter, 'a', "(iiii)");
+ for(i = 0; i < ec->shape_rects_num; ++i)
+ {
+ eldbus_message_iter_arguments_append(iter, "(iiii)", &struct_of_shape);
+ eldbus_message_iter_arguments_append
+ (struct_of_shape, "iiii",
+ ec->shape_rects[i].x, ec->shape_rects[i].y,
+ ec->shape_rects[i].w, ec->shape_rects[i].h);
+ eldbus_message_iter_container_close(iter, struct_of_shape);
+ }
+ eldbus_message_iter_container_close(iter, array_of_shape);
+
+ eldbus_message_iter_basic_append(iter, 'i', ec->shape_input_rects_num);
+ array_of_shape = eldbus_message_iter_container_new(iter, 'a', "(iiii)");
+ for(i = 0; i < ec->shape_input_rects_num; ++i)
+ {
+ eldbus_message_iter_arguments_append(iter, "(iiii)", &struct_of_shape);
+ eldbus_message_iter_arguments_append
+ (struct_of_shape, "iiii",
+ ec->shape_input_rects[i].x, ec->shape_input_rects[i].y,
+ ec->shape_input_rects[i].w, ec->shape_input_rects[i].h);
+ eldbus_message_iter_container_close(iter, struct_of_shape);
+ }
+ eldbus_message_iter_container_close(iter, array_of_shape);
+
+ return reply;
+}
+
static const Eldbus_Method methods[] = {
{ "get_window_info", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_TOPVWINS")", "array of ec"}), _e_info_server_cb_window_info_get, 0 },
{ "compobjs", NULL, ELDBUS_ARGS({"a("SIGNATURE_COMPOBJS_CLIENT")", "array of comp objs"}), _e_info_server_cb_compobjs, 0 },
{ "wininfo", ELDBUS_ARGS({VALUE_TYPE_REQUEST_FOR_WININFO, "window"}), ELDBUS_ARGS({VALUE_TYPE_REPLY_WININFO, "window info"}), _e_info_server_cb_wininfo, 0 },
{ "wininfo_tree", ELDBUS_ARGS({VALUE_TYPE_REQUEST_FOR_WININFO_TREE, "wininfo_tree"}), ELDBUS_ARGS({VALUE_TYPE_REPLY_WININFO_TREE, "window tree info"}), _e_info_server_cb_wininfo_tree, 0 },
{ "wininfo_hints", ELDBUS_ARGS({"it", "mode, window"}), ELDBUS_ARGS({"as", "window hints"}), _e_info_server_cb_wininfo_hints, 0 },
+ { "wininfo_shape", ELDBUS_ARGS({"t", "window"}), ELDBUS_ARGS({"ia(iiii)ia(iiii)", "window shape"}), _e_info_server_cb_wininfo_shape, 0 },
{ NULL, NULL, NULL, NULL, 0 }
};