#define PROP_USAGE \
"0x<win_id> | -id win_id | -pid pid | -name \"win_name\" [property_name [property_value]]\n" \
"Example:\n" \
- "\tenlightenment_info -prop : Get all properties for a window specified via a touch\n" \
- "\tenlightenment_info -prop Hidden : Get the \"Hidden\" property for a window specified via a touch\n" \
- "\tenlightenment_info -prop 0xb88ffaa0 Layer : Get the \"Layer\" property for specified window\n" \
- "\tenlightenment_info -prop 0xb88ffaa0 Hidden 1 : Set the \"Hidden\" property for specified window\n" \
- "\tenlightenment_info -prop -pid 2502 Hidden 0 : Set the \"Hidden\" property for all windows belonged to a process\n" \
- "\tenlightenment_info -prop -name err : Get all properties for windows whose names contain an \"err\" substring\n" \
- "\tenlightenment_info -prop -name \"\" : Get all properties for all windows\n"
+ "\tenlightenment_info -prop : Get all properties for a window specified via a touch\n" \
+ "\tenlightenment_info -prop Hidden : Get the \"Hidden\" property for a window specified via a touch\n" \
+ "\tenlightenment_info -prop 0xb88ffaa0 Layer : Get the \"Layer\" property for specified window\n" \
+ "\tenlightenment_info -prop 0xb88ffaa0 Hidden TRUE : Set the \"Hidden\" property for specified window\n" \
+ "\tenlightenment_info -prop -pid 2502 Hidden FALSE : Set the \"Hidden\" property for all windows belonged to a process\n" \
+ "\tenlightenment_info -prop -name err : Get all properties for windows whose names contain an \"err\" substring\n" \
+ "\tenlightenment_info -prop -name \"\" : Get all properties for all windows\n" \
+ "\tenlightenment_info -prop -name \"\" Hidden TRUE : Set the \"Hidden\" property for all windows\n"
/* property value can consist of several lines separated by '\n', which we got to print nicely */
static void
{
char *begin, *end; /* current line */
- /* process a simple case */
+ /* process a single line property value */
if (!strchr(prop_value, '\n'))
{
printf("%27s : %s\n", prop_name, prop_value);
const char *name = NULL, *text = NULL;
Eldbus_Message_Iter *array, *ec;
Eina_Bool res;
+ int first_delimiter = 1;
res = eldbus_message_error_get(msg, &name, &text);
EINA_SAFETY_ON_TRUE_GOTO(res, finish);
res = eldbus_message_arguments_get(msg, "a(ss)", &array);
EINA_SAFETY_ON_FALSE_GOTO(res, finish);
- printf("--------------------------------------[ window prop ]-----------------------------------------------------\n");
while (eldbus_message_iter_get_and_next(array, 'r', &ec))
{
const char *title = NULL;
continue;
}
- if (title && !strncmp(title, "[WINDOW PROP]", sizeof("[WINDOW PROP]")))
- printf("---------------------------------------------------------------------------------------------------------\n");
+ if (title && !strncmp(title, "delimiter", sizeof("delimiter")))
+ {
+ if (first_delimiter)
+ first_delimiter = 0;
+ else
+ printf("---------------------------------------------------------------------------------------------------------\n");
+ }
else
_parse_property(title, value);
}
- printf("----------------------------------------------------------------------------------------------------------\n");
return;
Eldbus_Message_Iter* struct_of_ec;
int idx;
- __WINDOW_PROP_ARG_APPEND("[WINDOW PROP]", "[WINDOW PROP]");
-
/* accordingly to -prop option rules (if user's provided some property name) */
if (strlen(property_name))
{
return eldbus_message_error_new(msg, FAIL_TO_SET_PROPERTY,
"get_window_prop: this property isn't setable");
}
- else
+ else /* if wanna get property */
{
if (win_properties[idx].get_prop)
{
"get_window_prop: this property isn't getable");
}
}
- else
+ else /* if user wanna get all properties */
{
+ /* to improve readability, if user wanna get properties for several windows, some
+ * delimiter being used */
+ __WINDOW_PROP_ARG_APPEND("delimiter", "");
+
for (idx = 0; idx < win_property_size; ++idx)
{
if (win_properties[idx].get_prop)
#undef __WINDOW_PROP_ARG_APPEND
}
+/* create the reply message and look for window(s) an user wanna get/set property(ies) for */
static Eldbus_Message *
_msg_window_prop_append(const Eldbus_Message *msg, uint32_t mode, const char *value,
const char *property_name, const char *property_value)
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
+ /* here we're dealing with evas objects which are e_client */
+
if (mode == WINDOW_ID_MODE)
{
Ecore_Window win = e_client_util_win_get(ec);