Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_config.c e_ipc.c e_ipc.h e_ipc_codec.c e_ipc_codec.h
e_remote_main.c
Log Message:
breaking out some ipc action!
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- e_config.c 12 May 2005 09:28:58 -0000 1.46
+++ e_config.c 13 May 2005 15:15:52 -0000 1.47
@@ -111,8 +111,8 @@
E_CONFIG_VAL(D, T, framerate, DOUBLE);
E_CONFIG_VAL(D, T, image_cache, INT);
E_CONFIG_VAL(D, T, font_cache, INT);
- E_CONFIG_VAL(D, T, zone_desks_x_count, INT); /**/
- E_CONFIG_VAL(D, T, zone_desks_y_count, INT); /**/
+ E_CONFIG_VAL(D, T, zone_desks_x_count, INT);
+ E_CONFIG_VAL(D, T, zone_desks_y_count, INT);
E_CONFIG_VAL(D, T, use_virtual_roots, INT); /* should not make this a
config option (for now) */
E_CONFIG_VAL(D, T, use_edge_flip, INT);
E_CONFIG_VAL(D, T, edge_flip_timeout, DOUBLE);
@@ -650,6 +650,9 @@
E_CONFIG_LIMIT(e_config->framerate, 1.0, 200.0);
E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024);
E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024);
+ E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64);
+ E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64);
+ E_CONFIG_LIMIT(e_config->use_edge_flip, 0, 1);
E_CONFIG_LIMIT(e_config->edge_flip_timeout, 0.0, 2.0);
/* apply lang config - exception because config is loaded after intl setup
*/
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- e_ipc.c 12 May 2005 14:46:28 -0000 1.23
+++ e_ipc.c 13 May 2005 15:15:52 -0000 1.24
@@ -4,6 +4,9 @@
static int _e_ipc_cb_client_add(void *data, int type, void *event);
static int _e_ipc_cb_client_del(void *data, int type, void *event);
static int _e_ipc_cb_client_data(void *data, int type, void *event);
+static void _e_ipc_reply_double_send(Ecore_Ipc_Client *client, double val, int
opcode);
+static void _e_ipc_reply_int_send(Ecore_Ipc_Client *client, int val, int
opcode);
+static void _e_ipc_reply_2int_send(Ecore_Ipc_Client *client, int val1, int
val2, int opcode);
static char *_e_ipc_path_str_get(char **paths, int *bytes);
static char *_e_ipc_str_list_get(Evas_List *strs, int *bytes);
static char *_e_ipc_simple_str_dec(char *data, int bytes);
@@ -597,61 +600,180 @@
}
break;
case E_IPC_OP_MENUS_SCROLL_SPEED_GET:
- {
- void *data;
- int bytes;
-
- if ((data = e_ipc_codec_double_enc(e_config->menus_scroll_speed,
- &bytes)))
- {
- ecore_ipc_client_send(e->client,
- E_IPC_DOMAIN_REPLY,
- E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY,
- 0/*ref*/, 0/*ref_to*/, 0/*response*/,
- data, bytes);
- free(data);
- }
- }
+ _e_ipc_reply_double_send(e->client,
+ e_config->menus_scroll_speed,
+ E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY);
break;
case E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_SET:
+ if (e_ipc_codec_double_dec(e->data, e->size,
+
&(e_config->menus_fast_mouse_move_threshhold)))
+ {
+ E_CONFIG_LIMIT(e_config->menus_fast_mouse_move_threshhold, 1.0,
2000.0);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_GET:
+ _e_ipc_reply_double_send(e->client,
+ e_config->menus_fast_mouse_move_threshhold,
+ E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_GET_REPLY);
break;
case E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_SET:
+ if (e_ipc_codec_double_dec(e->data, e->size,
+ &(e_config->menus_click_drag_timeout)))
+ {
+ E_CONFIG_LIMIT(e_config->menus_click_drag_timeout, 0.0, 10.0);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_GET:
+ _e_ipc_reply_double_send(e->client,
+ e_config->menus_click_drag_timeout,
+ E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_GET_REPLY);
break;
case E_IPC_OP_BORDER_SHADE_ANIMATE_SET:
+ if (e_ipc_codec_int_dec(e->data, e->size,
+ &(e_config->border_shade_animate)))
+ {
+ E_CONFIG_LIMIT(e_config->border_shade_animate, 0, 1);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_BORDER_SHADE_ANIMATE_GET:
+ _e_ipc_reply_int_send(e->client,
+ e_config->border_shade_animate,
+ E_IPC_OP_BORDER_SHADE_ANIMATE_GET_REPLY);
break;
case E_IPC_OP_BORDER_SHADE_TRANSITION_SET:
+ if (e_ipc_codec_int_dec(e->data, e->size,
+ &(e_config->border_shade_transition)))
+ {
+ E_CONFIG_LIMIT(e_config->border_shade_speed, 0, 3);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_BORDER_SHADE_TRANSITION_GET:
+ _e_ipc_reply_int_send(e->client,
+ e_config->border_shade_transition,
+ E_IPC_OP_BORDER_SHADE_TRANSITION_GET_REPLY);
break;
case E_IPC_OP_BORDER_SHADE_SPEED_SET:
+ if (e_ipc_codec_double_dec(e->data, e->size,
+ &(e_config->framerate)))
+ {
+ E_CONFIG_LIMIT(e_config->framerate, 1.0, 20000.0);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_BORDER_SHADE_SPEED_GET:
+ _e_ipc_reply_double_send(e->client,
+ e_config->border_shade_speed,
+ E_IPC_OP_BORDER_SHADE_SPEED_GET_REPLY);
break;
case E_IPC_OP_FRAMERATE_SET:
+ if (e_ipc_codec_double_dec(e->data, e->size,
+ &(e_config->framerate)))
+ {
+ E_CONFIG_LIMIT(e_config->image_cache, 1.0, 200.0);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_FRAMERATE_GET:
+ _e_ipc_reply_double_send(e->client,
+ e_config->framerate,
+ E_IPC_OP_FRAMERATE_GET_REPLY);
break;
case E_IPC_OP_IMAGE_CACHE_SET:
+ if (e_ipc_codec_int_dec(e->data, e->size,
+ &(e_config->image_cache)))
+ {
+ E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_IMAGE_CACHE_GET:
+ _e_ipc_reply_int_send(e->client,
+ e_config->image_cache,
+ E_IPC_OP_IMAGE_CACHE_GET_REPLY);
break;
case E_IPC_OP_FONT_CAHCE_SET:
+ if (e_ipc_codec_int_dec(e->data, e->size,
+ &(e_config->font_cache)))
+ {
+ E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_FONT_CACHE_GET:
+ _e_ipc_reply_int_send(e->client,
+ e_config->font_cache,
+ E_IPC_OP_FONT_CACHE_GET_REPLY);
break;
case E_IPC_OP_USE_EDGE_FLIP_SET:
+ if (e_ipc_codec_int_dec(e->data, e->size,
+ &(e_config->use_edge_flip)))
+ {
+ E_CONFIG_LIMIT(e_config->use_edge_flip, 0, 1);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_USE_EDGE_FLIP_GET:
+ _e_ipc_reply_int_send(e->client,
+ e_config->use_edge_flip,
+ E_IPC_OP_USE_EDGE_FLIP_GET_REPLY);
break;
case E_IPC_OP_EDGE_FLIP_TIMEOUT_SET:
+ if (e_ipc_codec_double_dec(e->data, e->size,
+ &(e_config->edge_flip_timeout)))
+ {
+ E_CONFIG_LIMIT(e_config->edge_flip_timeout, 0.0, 2.0);
+ e_config_save_queue();
+ }
break;
case E_IPC_OP_EDGE_FLIP_TIMEOUT_GET:
+ _e_ipc_reply_double_send(e->client,
+ e_config->edge_flip_timeout,
+ E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY);
+ break;
+ case E_IPC_OP_DESKS_SET:
+ if (e_ipc_codec_2int_dec(e->data, e->size,
+ &(e_config->zone_desks_x_count),
+ &(e_config->zone_desks_y_count)))
+ {
+ Evas_List *l;
+
+ E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64);
+ E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64);
+ for (l = e_manager_list(); l; l = l->next)
+ {
+ E_Manager *man;
+ Evas_List *l2;
+
+ man = l->data;
+ for (l2 = man->containers; l2; l2 = l2->next)
+ {
+ E_Container *con;
+ Evas_List *l3;
+
+ con = l2->data;
+ for (l3 = con->zones; l3; l3 = l3->next)
+ {
+ E_Zone *zone;
+
+ zone = l3->data;
+ e_zone_desk_count_set(zone,
+ e_config->zone_desks_x_count,
+ e_config->zone_desks_y_count);
+ }
+ }
+ }
+ e_config_save_queue();
+ }
+ break;
+ case E_IPC_OP_DESKS_GET:
+ _e_ipc_reply_2int_send(e->client,
+ e_config->zone_desks_x_count,
+ e_config->zone_desks_y_count,
+ E_IPC_OP_DESKS_GET_REPLY);
break;
default:
break;
@@ -665,6 +787,57 @@
return 1;
}
+static void
+_e_ipc_reply_double_send(Ecore_Ipc_Client *client, double val, int opcode)
+{
+ void *data;
+ int bytes;
+
+ if ((data = e_ipc_codec_double_enc(val, &bytes)))
+ {
+ ecore_ipc_client_send(client,
+ E_IPC_DOMAIN_REPLY,
+ opcode,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+ free(data);
+ }
+}
+
+static void
+_e_ipc_reply_int_send(Ecore_Ipc_Client *client, int val, int opcode)
+{
+ void *data;
+ int bytes;
+
+ if ((data = e_ipc_codec_int_enc(val, &bytes)))
+ {
+ ecore_ipc_client_send(client,
+ E_IPC_DOMAIN_REPLY,
+ opcode,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+ free(data);
+ }
+}
+
+static void
+_e_ipc_reply_2int_send(Ecore_Ipc_Client *client, int val1, int val2, int
opcode)
+{
+ void *data;
+ int bytes;
+
+ if ((data = e_ipc_codec_2int_enc(val1, val2, &bytes)))
+ {
+ ecore_ipc_client_send(client,
+ E_IPC_DOMAIN_REPLY,
+ opcode,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+ free(data);
+ }
+}
+
/*
* FIXME: This dosen't handle the case where one of the paths is of the
* form: ~moo/bar/baz need to figure out the correct path to the
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- e_ipc.h 12 May 2005 14:46:28 -0000 1.14
+++ e_ipc.h 13 May 2005 15:15:52 -0000 1.15
@@ -93,6 +93,9 @@
E_IPC_OP_EDGE_FLIP_TIMEOUT_SET,
E_IPC_OP_EDGE_FLIP_TIMEOUT_GET,
E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY,
+ E_IPC_OP_DESKS_SET,
+ E_IPC_OP_DESKS_GET,
+ E_IPC_OP_DESKS_GET_REPLY,
E_IPC_OP_LAST
} E_Ipc_Op;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_codec.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_ipc_codec.c 12 May 2005 14:46:28 -0000 1.1
+++ e_ipc_codec.c 13 May 2005 15:15:52 -0000 1.2
@@ -7,6 +7,7 @@
/* local subsystem globals */
static Eet_Data_Descriptor *_e_ipc_int_edd = NULL;
static Eet_Data_Descriptor *_e_ipc_double_edd = NULL;
+static Eet_Data_Descriptor *_e_ipc_2int_edd = NULL;
/* externally accessible functions */
int
@@ -18,6 +19,9 @@
_e_ipc_double_edd = E_CONFIG_DD_NEW("double", E_Ipc_Double);
E_CONFIG_VAL(_e_ipc_double_edd, E_Ipc_Double, val, DOUBLE);
+ _e_ipc_2int_edd = E_CONFIG_DD_NEW("2int", E_Ipc_2Int);
+ E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val1, INT);
+ E_CONFIG_VAL(_e_ipc_2int_edd, E_Ipc_2Int, val2, INT);
return 1;
}
@@ -26,6 +30,7 @@
{
E_CONFIG_DD_FREE(_e_ipc_int_edd);
E_CONFIG_DD_FREE(_e_ipc_double_edd);
+ E_CONFIG_DD_FREE(_e_ipc_2int_edd);
}
int
@@ -72,5 +77,29 @@
return eet_data_descriptor_encode(_e_ipc_double_edd, &dat, size_ret);
}
+int
+e_ipc_codec_2int_dec(char *data, int bytes, int *dest, int *dest2)
+{
+ E_Ipc_2Int *dat;
+
+ if (!data) return 0;
+ dat = eet_data_descriptor_decode(_e_ipc_2int_edd, data, bytes);
+ if (!dat) return 0;
+ if (dest) *dest = dat->val1;
+ if (dest2) *dest2 = dat->val2;
+ free(dat);
+ return 1;
+}
+
+void *
+e_ipc_codec_2int_enc(int val1, int val2, int *size_ret)
+{
+ E_Ipc_2Int dat;
+
+ dat.val1 = val1;
+ dat.val2 = val2;
+ return eet_data_descriptor_encode(_e_ipc_2int_edd, &dat, size_ret);
+}
+
/* local subsystem globals */
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_codec.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_ipc_codec.h 12 May 2005 14:46:28 -0000 1.1
+++ e_ipc_codec.h 13 May 2005 15:15:52 -0000 1.2
@@ -5,6 +5,7 @@
typedef struct _E_Ipc_Int E_Ipc_Int;
typedef struct _E_Ipc_Double E_Ipc_Double;
+typedef struct _E_Ipc_2Int E_Ipc_2Int;
#else
#ifndef E_IPC_CODEC_H
@@ -20,6 +21,12 @@
double val;
};
+struct _E_Ipc_2Int
+{
+ int val1, val2;
+};
+
+
EAPI int e_ipc_codec_init(void);
EAPI void e_ipc_codec_shutdown(void);
@@ -27,6 +34,8 @@
EAPI void *e_ipc_codec_int_enc(int val, int *size_ret);
EAPI int e_ipc_codec_double_dec(char *data, int bytes, double *dest);
EAPI void *e_ipc_codec_double_enc(double val, int *size_ret);
+EAPI int e_ipc_codec_2int_dec(char *data, int bytes, int *dest, int
*dest2x);
+EAPI void *e_ipc_codec_2int_enc(int val1, int val2, int *size_ret);
#endif
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_remote_main.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- e_remote_main.c 12 May 2005 13:56:30 -0000 1.21
+++ e_remote_main.c 13 May 2005 15:15:52 -0000 1.22
@@ -361,10 +361,12 @@
"Maybe try the '-display :0.0' option?\n");
exit(-1);
}
+ e_ipc_codec_init();
/* start our main loop */
ecore_main_loop_begin();
-
+
+ e_ipc_codec_shutdown();
_e_ipc_shutdown();
ecore_ipc_shutdown();
ecore_shutdown();
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs