shorne's cleanups


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 18 years ago
parent dd4a98045a
commit 374d09d00b
  1. 105
      src/bin/e_font.c
  2. 8
      src/bin/e_font.h
  3. 356
      src/bin/e_ipc.c
  4. 191
      src/bin/e_remote_main.c

@ -8,17 +8,12 @@
* - use e_path to search for available fonts
*/
static Evas_List *_e_font_defaults = NULL; /* MRU <E_Font_Default> */
static Evas_List *_e_font_fallbacks = NULL; /* <E_Font_Fallback> */
static Evas_List *_e_font_font_dir_available_get (Evas_List * available_fonts, const char *font_dir);
int
e_font_init(void)
{
/* just get the pointers into the config */
_e_font_defaults = e_config->font_defaults;
_e_font_fallbacks = e_config->font_fallbacks;
/* all init stuff is in e_config */
return 1;
}
@ -38,7 +33,7 @@ e_font_apply(void)
E_Font_Default *efd;
/* setup edje fallback list */
next = _e_font_fallbacks;
next = e_config->font_fallbacks;
if (next)
{
eff = evas_list_data(next);
@ -62,12 +57,10 @@ e_font_apply(void)
edje_fontset_append_set(buf);
/* setup edje text classes */
next = _e_font_defaults;
while (next)
for(next = e_config->font_defaults; next; next = evas_list_next(next))
{
efd = evas_list_data(next);
edje_text_class_set(efd->text_class, efd->font, efd->size);
next = evas_list_next(next);
}
}
@ -86,32 +79,30 @@ e_font_available_list(void)
void
e_font_available_list_free(Evas_List * available)
{
char *font_name;
Evas_List *l;
E_Font_Available *efa;
for (l = available; l; l = l->next)
while(available)
{
font_name = evas_list_data(l);
available = evas_list_remove(available, l);
free(font_name);
efa = available->data;
available = evas_list_remove_list(available, available);
E_FREE(efa->name);
E_FREE(efa);
}
}
void
e_font_fallback_clear(void)
{
Evas_List *next;
E_Font_Fallback *eff;
next = _e_font_fallbacks;
while (next)
{
E_Font_Fallback *eff;
eff = evas_list_data(next);
_e_font_fallbacks = evas_list_remove_list(_e_font_fallbacks, next);
while(e_config->font_fallbacks)
{
eff = e_config->font_fallbacks->data;
e_config->font_fallbacks = evas_list_remove_list(
e_config->font_fallbacks,
e_config->font_fallbacks);
E_FREE(eff->name);
E_FREE(eff);
next = evas_list_next(next);
}
}
@ -124,7 +115,7 @@ e_font_fallback_append(const char *font)
eff = E_NEW(E_Font_Fallback, 1);
eff->name = strdup(font);
_e_font_fallbacks = evas_list_append(_e_font_fallbacks, eff);
e_config->font_fallbacks = evas_list_append(e_config->font_fallbacks, eff);
}
void
@ -136,35 +127,34 @@ e_font_fallback_prepend(const char *font)
eff = E_NEW(E_Font_Fallback, 1);
eff->name = strdup(font);
_e_font_fallbacks = evas_list_prepend(_e_font_fallbacks, eff);
e_config->font_fallbacks = evas_list_prepend(e_config->font_fallbacks, eff);
}
void
e_font_fallback_remove(const char *font)
{
Evas_List *next;
next = _e_font_fallbacks;
while (next)
for(next = e_config->font_fallbacks; next; next = evas_list_next(next))
{
E_Font_Fallback *eff;
eff = evas_list_data(next);
if (!strcmp(eff->name, font))
{
_e_font_fallbacks = evas_list_remove_list(_e_font_fallbacks, next);
e_config->font_fallbacks = evas_list_remove_list(
e_config->font_fallbacks, next);
E_FREE(eff->name);
E_FREE(eff);
break;
}
next = evas_list_next(next);
}
}
Evas_List *
e_font_fallback_list(void)
{
return _e_font_fallbacks;
return e_config->font_fallbacks;
}
void
@ -174,8 +164,7 @@ e_font_default_set(const char *text_class, const char *font, int size)
Evas_List *next;
/* search for the text class */
next = _e_font_defaults;
while (next)
for(next = e_config->font_defaults; next; next = evas_list_next(next))
{
efd = evas_list_data(next);
if (!strcmp(efd->text_class, text_class))
@ -184,11 +173,12 @@ e_font_default_set(const char *text_class, const char *font, int size)
efd->font = strdup(font);
efd->size = size;
/* move to the front of the list */
_e_font_defaults = evas_list_remove_list(_e_font_defaults, next);
_e_font_defaults = evas_list_prepend(_e_font_defaults, efd);
e_config->font_defaults = evas_list_remove_list(
e_config->font_defaults, next);
e_config->font_defaults = evas_list_prepend(
e_config->font_defaults, efd);
return;
}
next = evas_list_next(next);
}
/* the text class doesnt exist */
@ -197,7 +187,7 @@ e_font_default_set(const char *text_class, const char *font, int size)
efd->font = strdup(font);
efd->size = size;
_e_font_defaults = evas_list_prepend(_e_font_defaults, efd);
e_config->font_defaults = evas_list_prepend(e_config->font_defaults, efd);
}
/*
@ -210,18 +200,18 @@ e_font_default_get(const char *text_class)
Evas_List *next;
/* search for the text class */
next = _e_font_defaults;
while (next)
for(next = e_config->font_defaults; next; next = evas_list_next(next))
{
efd = evas_list_data(next);
if (!strcmp(efd->text_class, text_class))
{
/* move to the front of the list */
_e_font_defaults = evas_list_remove_list(_e_font_defaults, next);
_e_font_defaults = evas_list_prepend(_e_font_defaults, efd);
e_config->font_defaults = evas_list_remove_list(
e_config->font_defaults, next);
e_config->font_defaults = evas_list_prepend(
e_config->font_defaults, efd);
return efd;
}
next = evas_list_next(next);
}
return NULL;
}
@ -233,26 +223,25 @@ e_font_default_remove(const char *text_class)
Evas_List *next;
/* search for the text class */
next = _e_font_defaults;
while (next)
for(next = e_config->font_defaults; next; next = evas_list_next(next))
{
efd = evas_list_data(next);
if (!strcmp(efd->text_class, text_class))
{
_e_font_defaults = evas_list_remove_list(_e_font_defaults, next);
e_config->font_defaults = evas_list_remove_list(
e_config->font_defaults, next);
E_FREE(efd->text_class);
E_FREE(efd->font);
E_FREE(efd);
return;
}
next = evas_list_next(next);
}
}
Evas_List *
e_font_default_list(void)
{
return _e_font_defaults;
return e_config->font_defaults;
}
static Evas_List *
@ -271,19 +260,25 @@ _e_font_font_dir_available_get(Evas_List * available_fonts, const char *font_dir
/* read font alias lines */
while (fscanf(f, "%4090s %[^\n]\n", fname, fdef) == 2)
{
E_Font_Available *efa;
/* skip comments */
if ((fdef[0] == '!') || (fdef[0] == '#'))
continue;
/* skip duplicates */
next = available_fonts;
while (next)
for (next = available_fonts; next; next = evas_list_next(next))
{
if (!strcmp((char *)evas_list_data(next), fname))
continue;
next = evas_list_next(next);
efa = (E_Font_Available *)evas_list_data(next);
if (!strcmp(efa->name, fname))
continue;
}
available_fonts = evas_list_append(available_fonts, strdup(fname));
efa = malloc(sizeof(E_Font_Available));
efa->name = strdup(fname);
available_fonts = evas_list_append(available_fonts, efa);
}
fclose (f);
}

@ -5,6 +5,7 @@
typedef struct _E_Font_Default E_Font_Default;
typedef struct _E_Font_Fallback E_Font_Fallback;
typedef struct _E_Font_Fallback E_Font_Available;
#else
#ifndef E_FONT_H
@ -14,7 +15,7 @@ struct _E_Font_Default
{
char * text_class;
char * font;
int size;
int size;
};
struct _E_Font_Fallback
@ -22,6 +23,11 @@ struct _E_Font_Fallback
char * name;
};
struct _E_Font_Available
{
char * name;
};
EAPI int e_font_init(void);
EAPI int e_font_shutdown(void);
EAPI void e_font_apply(void);

@ -5,6 +5,15 @@ 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 char *_e_ipc_path_str_get(char **paths, int *bytes);
static char *_e_ipc_simple_str_dec(char *data, int bytes);
static char **_e_ipc_multi_str_dec(char *data, int bytes, int str_count);
/* encode functions, Should these be global? */
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_module_list_enc);
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_available_list_enc);
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_fallback_list_enc);
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_default_list_enc);
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_font_default_enc);
/* local subsystem globals */
static Ecore_Ipc_Server *_e_ipc_server = NULL;
@ -76,9 +85,8 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
{
char *name;
name = malloc(e->size + 1);
name[e->size] = 0;
memcpy(name, e->data, e->size);
name = _e_ipc_simple_str_dec(e->data, e->size);
if (!e_module_find(name))
{
e_module_new(name);
@ -92,9 +100,8 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
char *name;
E_Module *m;
name = malloc(e->size + 1);
name[e->size] = 0;
memcpy(name, e->data, e->size);
name = _e_ipc_simple_str_dec(e->data, e->size);
if ((m = e_module_find(name)))
{
if (e_module_enabled_get(m))
@ -109,9 +116,8 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
char *name;
E_Module *m;
name = malloc(e->size + 1);
name[e->size] = 0;
memcpy(name, e->data, e->size);
name = _e_ipc_simple_str_dec(e->data, e->size);
if ((m = e_module_find(name)))
{
if (!e_module_enabled_get(m))
@ -121,13 +127,12 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
}
break;
case E_IPC_OP_MODULE_DISABLE:
{
{
char *name;
E_Module *m;
name = malloc(e->size + 1);
name[e->size] = 0;
memcpy(name, e->data, e->size);
name = _e_ipc_simple_str_dec(e->data, e->size);
if ((m = e_module_find(name)))
{
if (e_module_enabled_get(m))
@ -138,30 +143,15 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
break;
case E_IPC_OP_MODULE_LIST:
{
Evas_List *modules, *l;
/* encode module list (str,8-bit) */
Evas_List *modules;
char * data;
int bytes;
E_Module *m;
char *data, *p;
bytes = 0;
modules = e_module_list();
for (l = modules; l; l = l->next)
{
m = l->data;
bytes += strlen(m->name) + 1 + 1;
}
data = malloc(bytes);
p = data;
for (l = modules; l; l = l->next)
{
m = l->data;
strcpy(p, m->name);
p += strlen(m->name);
*p = 0;
p++;
*p = e_module_enabled_get(m);
p++;
}
modules = e_module_list();
data = _e_ipc_module_list_enc(modules, &bytes);
/* send reply data */
ecore_ipc_client_send(e->client,
E_IPC_DOMAIN_REPLY,
E_IPC_OP_MODULE_LIST_REPLY,
@ -194,10 +184,9 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
{
char *file;
Evas_List *managers, *l;
file = _e_ipc_simple_str_dec(e->data, e->size);
file = malloc(e->size + 1);
file[e->size] = 0;
memcpy(file, e->data, e->size);
E_FREE(e_config->desktop_default_background);
e_config->desktop_default_background = file;
@ -236,29 +225,13 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
break;
case E_IPC_OP_FONT_AVAILABLE_LIST:
{
Evas_List *fonts_available, *l;
/* encode font available list (str) */
Evas_List *fonts_available;
int bytes;
char *font_name, *data, *p;
char *data;
bytes = 0;
fonts_available = e_font_available_list();
printf("ipc font av: %d\n", fonts_available);
for (l = fonts_available; l; l = l->next)
{
font_name = evas_list_data(l);
bytes += strlen(font_name) + 1;
}
data = malloc(bytes);
p = data;
for (l = fonts_available; l; l = l->next)
{
font_name = evas_list_data(l);
strcpy(p, font_name);
p += strlen(font_name);
*p = 0;
p++;
}
fonts_available = e_font_available_list();
data = _e_ipc_font_available_list_enc(fonts_available, &bytes);
ecore_ipc_client_send(e->client,
E_IPC_DOMAIN_REPLY,
E_IPC_OP_FONT_AVAILABLE_LIST_REPLY,
@ -282,9 +255,8 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
case E_IPC_OP_FONT_FALLBACK_APPEND:
{
char * font_name;
font_name = malloc(e->size + 1);
font_name[e->size] = 0;
memcpy(font_name, e->data, e->size);
font_name = _e_ipc_simple_str_dec(e->data, e->size);
e_font_fallback_append(font_name);
free(font_name);
@ -294,9 +266,8 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
case E_IPC_OP_FONT_FALLBACK_PREPEND:
{
char * font_name;
font_name = malloc(e->size + 1);
font_name[e->size] = 0;
memcpy(font_name, e->data, e->size);
font_name = _e_ipc_simple_str_dec(e->data, e->size);
e_font_fallback_prepend(font_name);
free(font_name);
@ -305,28 +276,15 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
break;
case E_IPC_OP_FONT_FALLBACK_LIST:
{
Evas_List *fallbacks, *l;
/* encode font fallback list (str) */
Evas_List *fallbacks;
int bytes;
E_Font_Fallback *eff;
char *data, *p;
bytes = 0;
char *data;
fallbacks = e_font_fallback_list();
for (l = fallbacks; l; l = l->next)
{
eff = evas_list_data(l);
bytes += strlen(eff->name) + 1;
}
data = malloc(bytes);
p = data;
for (l = fallbacks; l; l = l->next)
{
eff = evas_list_data(l);
strcpy(p, eff->name);
p += strlen(eff->name);
*p = 0;
p++;
}
data = _e_ipc_font_fallback_list_enc(fallbacks, &bytes);
ecore_ipc_client_send(e->client,
E_IPC_DOMAIN_REPLY,
E_IPC_OP_FONT_FALLBACK_LIST_REPLY,
@ -339,9 +297,8 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
case E_IPC_OP_FONT_FALLBACK_REMOVE:
{
char * font_name;
font_name = malloc(e->size + 1);
font_name[e->size] = 0;
memcpy(font_name, e->data, e->size);
font_name = _e_ipc_simple_str_dec(e->data, e->size);
e_font_fallback_remove(font_name);
free(font_name);
@ -350,75 +307,30 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
break;
case E_IPC_OP_FONT_DEFAULT_SET:
{
char * p;
char * font_name;
char * text_class;
int font_size;
char ** argv;
int i, argc;
p = e->data;
argc = 3;
argv = _e_ipc_multi_str_dec(e->data, e->size, argc);
e_font_default_set(argv[0], argv[1], atoi(argv[2]));
free(argv);
/* Make sure our data is packed for us <str>0<str>0 */
if( p[e->size - 1] != 0) {
break;
}
text_class = strdup(p);
p += strlen(text_class) + 1;
font_name = strdup(p);
p += strlen(font_name) + 1;
font_size = atoi(p);
e_font_default_set(text_class, font_name, font_size);
free(font_name);
free(text_class);
e_config_save_queue();
}
break;
case E_IPC_OP_FONT_DEFAULT_GET:
{
int bytes;
/* encode font default struct (str,str,32-bits)(E_Font_Default) */
E_Font_Default *efd;
char *data, *p, *text_class;
text_class = malloc(e->size + 1);
text_class[e->size] = 0;
memcpy(text_class, e->data, e->size);
efd = e_font_default_get (text_class);
char *data, *text_class;
int bytes;
text_class = _e_ipc_simple_str_dec(e->data, e->size);
efd = e_font_default_get (text_class);
free(text_class);
bytes = 0;
if (efd) {
bytes += strlen(efd->text_class) + 1;
bytes += strlen(efd->font) + 1;
bytes++; /* efd->size */
}
data = malloc(bytes);
p = data;
if (efd) {
strcpy(p, efd->text_class);
p += strlen(efd->text_class);
*p = 0;
p++;
strcpy(p, efd->font);
p += strlen(efd->font);
*p = 0;
p++;
/* FIXME: should this be packed like this (int to char) ? */
*p = (char) efd->size;
p++;
}
data = _e_ipc_font_default_enc(efd, &bytes);
ecore_ipc_client_send(e->client,
E_IPC_DOMAIN_REPLY,
E_IPC_OP_FONT_DEFAULT_GET_REPLY,
@ -430,9 +342,8 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
case E_IPC_OP_FONT_DEFAULT_REMOVE:
{
char * text_class;
text_class = malloc(e->size + 1);
text_class[e->size] = 0;
memcpy(text_class, e->data, e->size);
text_class = _e_ipc_simple_str_dec(e->data, e->size);
e_font_default_remove(text_class);
free(text_class);
@ -441,37 +352,13 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
break;
case E_IPC_OP_FONT_DEFAULT_LIST:
{
Evas_List *defaults, *l;
/* encode font default struct list (str,str,32-bits)(E_Font_Default) */
Evas_List *defaults;
int bytes;
E_Font_Default *efd;
char *data, *p;
char *data;
bytes = 0;
defaults = e_font_default_list();
for (l = defaults; l; l = l->next)
{
efd = l->data;
bytes += strlen(efd->text_class) + 1;
bytes += strlen(efd->font) + 1;
bytes++; /* efd->size */
}
data = malloc(bytes);
p = data;
for (l =defaults; l; l = l->next)
{
efd = l->data;
strcpy(p, efd->text_class);
p += strlen(efd->text_class);
*p = 0;
p++;
strcpy(p, efd->font);
p += strlen(efd->font);
*p = 0;
p++;
/* FIXME: should this be packed like this (int to char) ? */
*p = (char) efd->size;
p++;
}
data = _e_ipc_font_default_list_enc(defaults, &bytes);
ecore_ipc_client_send(e->client,
E_IPC_DOMAIN_REPLY,
E_IPC_OP_FONT_DEFAULT_LIST_REPLY,
@ -557,4 +444,115 @@ _e_ipc_path_str_get(char **paths, int *bytes)
return data;
}
/**
* Decode a simple string that was passed by an IPC client
*
* The returned string must be freed
*/
static char *
_e_ipc_simple_str_dec(char *data, int bytes)
{
char *str;
str = malloc(bytes + 1);
str[bytes] = 0;
memcpy(str, data, bytes);
return str;
}
/**
* Decode a list of strings and return an array, you need to pass
* the string count that you are expecting back.
*
* Strings are encoded <str>0<str>0...
*
* free up the array that you get back
*/
static char **
_e_ipc_multi_str_dec(char *data, int bytes, int str_count)
{
char ** str_array;
int i;
/* Make sure our data is packed for us <str>0<str>0 */
if( data[bytes - 1] != 0) {
return NULL;
}
str_array = malloc(sizeof(char *)*str_count);
for(i = 0; i < str_count; i++)
{
str_array[i] = data;
data += strlen(str_array[i]) + 1;
}
return str_array;
}
/* list/struct encoding functions */
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_module_list_enc)
{
ECORE_IPC_ENC_EVAS_LIST_HEAD_START(E_Module);
ECORE_IPC_CNTS(name);
ECORE_IPC_CNT8();
ECORE_IPC_ENC_EVAS_LIST_HEAD_FINISH();
int l1;
ECORE_IPC_SLEN(l1, name);
ECORE_IPC_PUTS(name, l1);
ECORE_IPC_PUT8(enabled);
ECORE_IPC_ENC_EVAS_LIST_FOOT();
}
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_available_list_enc)
{
ECORE_IPC_ENC_EVAS_LIST_HEAD_START(E_Font_Available);
ECORE_IPC_CNTS(name);
ECORE_IPC_ENC_EVAS_LIST_HEAD_FINISH();
int l1;
ECORE_IPC_SLEN(l1, name);
ECORE_IPC_PUTS(name, l1);
ECORE_IPC_ENC_EVAS_LIST_FOOT();
}
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_fallback_list_enc)
{
ECORE_IPC_ENC_EVAS_LIST_HEAD_START(E_Font_Fallback);
ECORE_IPC_CNTS(name);
ECORE_IPC_ENC_EVAS_LIST_HEAD_FINISH();
int l1;
ECORE_IPC_SLEN(l1, name);
ECORE_IPC_PUTS(name, l1);
ECORE_IPC_ENC_EVAS_LIST_FOOT();
}
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_default_list_enc)
{
ECORE_IPC_ENC_EVAS_LIST_HEAD_START(E_Font_Default);
ECORE_IPC_CNTS(text_class);
ECORE_IPC_CNTS(font);
ECORE_IPC_CNT32();
ECORE_IPC_ENC_EVAS_LIST_HEAD_FINISH();
int l1, l2;
ECORE_IPC_SLEN(l1, text_class);
ECORE_IPC_SLEN(l2, font);
ECORE_IPC_PUTS(text_class, l1);
ECORE_IPC_PUTS(font, l2);
ECORE_IPC_PUT32(size);
ECORE_IPC_ENC_EVAS_LIST_FOOT();
}
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_font_default_enc)
{
int l1, l2;
ECORE_IPC_ENC_STRUCT_HEAD(E_Font_Default,
ECORE_IPC_SLEN(l1, text_class) +
ECORE_IPC_SLEN(l2, font) +
4);
ECORE_IPC_PUTS(text_class, l1);
ECORE_IPC_PUTS(font, l2);
ECORE_IPC_PUT32(size);
ECORE_IPC_ENC_STRUCT_FOOT();
}

@ -27,6 +27,12 @@ static int _e_ipc_cb_server_data(void *data, int type, void *event);
static void _e_help(void);
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_module_list_dec);
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_font_available_list_dec);
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_font_fallback_list_dec);
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_font_default_list_dec);
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_font_default_dec);
/* local subsystem globals */
static Ecore_Ipc_Server *_e_ipc_server = NULL;
static const char *display_name = NULL;
@ -316,33 +322,23 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
case E_IPC_OP_MODULE_LIST_REPLY:
if (e->data)
{
char *p;
Evas_List *modules;
E_Module *m;
p = e->data;
while (p < (char *)(e->data + e->size))
modules = _e_ipc_module_list_dec(e->data, e->size);
while(modules)
{
char *name;
char enabled;
name = p;
p += strlen(name);
if (p < (char *)(e->data + e->size))
{
p++;
if (p < (char *)(e->data + e->size))
{
enabled = *p;
p++;
printf("REPLY: MODULE NAME=\"%s\" ENABLED=%i\n",
name, (int)enabled);
}
}
m = modules->data;
printf("REPLY: MODULE NAME=\"%s\" ENABLED=%i\n",
m->name, m->enabled);
modules = evas_list_remove_list(modules, modules);
E_FREE(m);
}
}
else
printf("REPLY: MODULE NONE\n");
break;
case E_IPC_OP_MODULE_DIRS_LIST_REPLY:
case E_IPC_OP_MODULE_DIRS_LIST_REPLY:
if (e->data)
{
char *p;
@ -366,7 +362,7 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
break;
case E_IPC_OP_BG_DIRS_LIST_REPLY:
if (e->data)
{
{
char *p;
p = e->data;
@ -383,21 +379,17 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
case E_IPC_OP_FONT_FALLBACK_LIST_REPLY:
if (e->data)
{
char *p;
Evas_List *fallbacks;
E_Font_Fallback *eff;
p = e->data;
while (p < (char *)(e->data + e->size))
{
char *name;
name = p;
p += strlen(name);
if (p < (char *)(e->data + e->size))
{
printf("REPLY: FALLBACK NAME=\"%s\"\n", name);
}
p++;
}
fallbacks = _e_ipc_font_fallback_list_dec(e->data, e->size);
while(fallbacks)
{
eff = fallbacks->data;
printf("REPLY: FALLBACK NAME=\"%s\"\n", eff->name);
fallbacks = evas_list_remove_list(fallbacks, fallbacks);
E_FREE(eff);
}
}
else
printf("REPLY: FALLBACK NONE\n");
@ -405,20 +397,17 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
case E_IPC_OP_FONT_AVAILABLE_LIST_REPLY:
if (e->data)
{
char *p;
p = e->data;
while (p < (char *)(e->data + e->size))
{
char *name;
name = p;
p += strlen(name);
if (p < (char *)(e->data + e->size))
{
printf("REPLY: AVAILABLE NAME=\"%s\"\n", name);
}
p++;
}
Evas_List *available;
E_Font_Available *fa;
available = _e_ipc_font_available_list_dec(e->data, e->size);
while(available)
{
fa = available->data;
printf("REPLY: AVAILABLE NAME=\"%s\"\n", fa->name);
available = evas_list_remove_list(available, available);
E_FREE(fa);
}
}
else
printf("REPLY: AVAILABLE NONE\n");
@ -426,27 +415,10 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
case E_IPC_OP_FONT_DEFAULT_GET_REPLY:
if (e->data)
{
char *text_class, *name;
char *p;
char size;
p = e->data;
text_class = p;
p += strlen(text_class) + 1;
if (p < (char *)(e->data + e->size))
{
name = p;
p += strlen(name) + 1;
if (p < (char *)(e->data + e->size))
{
size = *p;
printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\" SIZE=%i\n",
text_class, name, (int)size);
p++;
}
}
E_Font_Default efd;
_e_ipc_font_default_dec(e->data, e->size, &efd);
printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\" SIZE=%d\n",
efd.text_class, efd.font, efd.size);
}
else
printf("REPLY: DEFAULT NONE\n");
@ -454,29 +426,18 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
case E_IPC_OP_FONT_DEFAULT_LIST_REPLY:
if (e->data)
{
char *text_class, *name;
char *p;
char size;
p = e->data;
while (p < (char *)(e->data + e->size))
{
text_class = p;
p += strlen(text_class) + 1;
if (p < (char *)(e->data + e->size))
{
name = p;
p += strlen(name) + 1;
if (p < (char *)(e->data + e->size))
{
size = *p;
printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\" SIZE=%i\n",
text_class, name, (int)size);
p++;
}
Evas_List *defaults;
E_Font_Default *efd;
defaults = _e_ipc_font_default_list_dec(e->data, e->size);
while(defaults)
{
efd = defaults->data;
printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\" SIZE=%d\n",
efd->text_class, efd->font, efd->size);
defaults = evas_list_remove_list(defaults, defaults);
E_FREE(efd);
}
}
}
else
printf("REPLY: DEFAULT NONE\n");
@ -532,3 +493,49 @@ _e_help(void)
printf(" - %s\n", handler->desc);
}
}
/* list/struct encoding functions */
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_module_list_dec)
{
ECORE_IPC_DEC_EVAS_LIST_HEAD(E_Module);
ECORE_IPC_GETS(name);
ECORE_IPC_GET8(enabled);
ECORE_IPC_DEC_EVAS_LIST_FOOT();
}
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_font_available_list_dec)
{
ECORE_IPC_DEC_EVAS_LIST_HEAD(E_Font_Available);
ECORE_IPC_GETS(name);
ECORE_IPC_DEC_EVAS_LIST_FOOT();
}
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_font_fallback_list_dec)
{
ECORE_IPC_DEC_EVAS_LIST_HEAD(E_Font_Fallback);
ECORE_IPC_GETS(name);
ECORE_IPC_DEC_EVAS_LIST_FOOT();
}
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_font_default_list_dec)
{
ECORE_IPC_DEC_EVAS_LIST_HEAD(E_Font_Default);
ECORE_IPC_GETS(text_class);
ECORE_IPC_GETS(font);
ECORE_IPC_GET32(size);
ECORE_IPC_DEC_EVAS_LIST_FOOT();
}
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_font_default_dec)
{
ECORE_IPC_DEC_STRUCT_HEAD_MIN(E_Font_Default,
1 +
1 +
4);
ECORE_IPC_CHEKS();
ECORE_IPC_GETS(text_class);
ECORE_IPC_GETS(font);
ECORE_IPC_GET32(size);
ECORE_IPC_DEC_STRUCT_FOOT();
}

Loading…
Cancel
Save