forked from enlightenment/enlightenment
shorns' font fixme work.. so we can all work on it :)
SVN revision: 14076
This commit is contained in:
parent
f7c295028e
commit
03633f3f52
|
@ -43,8 +43,8 @@ e_signals.h \
|
||||||
e_xinerama.h \
|
e_xinerama.h \
|
||||||
e_table.h \
|
e_table.h \
|
||||||
e_layout.h \
|
e_layout.h \
|
||||||
e_test.h
|
e_test.h \
|
||||||
|
e_font.h
|
||||||
|
|
||||||
enlightenment_SOURCES = \
|
enlightenment_SOURCES = \
|
||||||
e_main.c \
|
e_main.c \
|
||||||
|
@ -81,6 +81,7 @@ e_xinerama.c \
|
||||||
e_table.c \
|
e_table.c \
|
||||||
e_layout.c \
|
e_layout.c \
|
||||||
e_test.c \
|
e_test.c \
|
||||||
|
e_font.c \
|
||||||
$(ENLIGHTENMENTHEADERS)
|
$(ENLIGHTENMENTHEADERS)
|
||||||
|
|
||||||
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@
|
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@
|
||||||
|
|
|
@ -26,6 +26,8 @@ static Ecore_Job *_e_config_save_job = NULL;
|
||||||
static E_Config_DD *_e_config_edd = NULL;
|
static E_Config_DD *_e_config_edd = NULL;
|
||||||
static E_Config_DD *_e_config_module_edd = NULL;
|
static E_Config_DD *_e_config_module_edd = NULL;
|
||||||
static E_Config_DD *_e_config_binding_edd = NULL;
|
static E_Config_DD *_e_config_binding_edd = NULL;
|
||||||
|
static E_Config_DD *_e_config_font_fallback_edd = NULL;
|
||||||
|
static E_Config_DD *_e_config_font_default_edd = NULL;
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
int
|
int
|
||||||
|
@ -49,6 +51,24 @@ e_config_init(void)
|
||||||
E_CONFIG_VAL(D, T, modifiers, INT);
|
E_CONFIG_VAL(D, T, modifiers, INT);
|
||||||
E_CONFIG_VAL(D, T, action, INT);
|
E_CONFIG_VAL(D, T, action, INT);
|
||||||
|
|
||||||
|
_e_config_font_default_edd = E_CONFIG_DD_NEW("E_Font_Default",
|
||||||
|
E_Font_Default);
|
||||||
|
#undef T
|
||||||
|
#undef D
|
||||||
|
#define T E_Font_Default
|
||||||
|
#define D _e_config_font_default_edd
|
||||||
|
E_CONFIG_VAL(D, T, text_class, STR);
|
||||||
|
E_CONFIG_VAL(D, T, font, STR);
|
||||||
|
E_CONFIG_VAL(D, T, size, INT);
|
||||||
|
|
||||||
|
_e_config_font_fallback_edd = E_CONFIG_DD_NEW("E_Font_Fallback",
|
||||||
|
E_Font_Fallback);
|
||||||
|
#undef T
|
||||||
|
#undef D
|
||||||
|
#define T E_Font_Fallback
|
||||||
|
#define D _e_config_font_fallback_edd
|
||||||
|
E_CONFIG_VAL(D, T, name, STR);
|
||||||
|
|
||||||
_e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config);
|
_e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config);
|
||||||
#undef T
|
#undef T
|
||||||
#undef D
|
#undef D
|
||||||
|
@ -68,6 +88,8 @@ e_config_init(void)
|
||||||
E_CONFIG_VAL(D, T, zone_desks_y_count, INT);
|
E_CONFIG_VAL(D, T, zone_desks_y_count, INT);
|
||||||
E_CONFIG_LIST(D, T, modules, _e_config_module_edd);
|
E_CONFIG_LIST(D, T, modules, _e_config_module_edd);
|
||||||
E_CONFIG_LIST(D, T, bindings, _e_config_binding_edd);
|
E_CONFIG_LIST(D, T, bindings, _e_config_binding_edd);
|
||||||
|
E_CONFIG_LIST(D, T, font_fallbacks, _e_config_font_fallback_edd);
|
||||||
|
E_CONFIG_LIST(D, T, font_defaults, _e_config_font_default_edd);
|
||||||
|
|
||||||
e_config = e_config_domain_load("e", _e_config_edd);
|
e_config = e_config_domain_load("e", _e_config_edd);
|
||||||
if (!e_config)
|
if (!e_config)
|
||||||
|
@ -143,6 +165,30 @@ e_config_init(void)
|
||||||
eb->action = E_BINDING_ACTION_MENU;
|
eb->action = E_BINDING_ACTION_MENU;
|
||||||
e_config->bindings = evas_list_append(e_config->bindings, eb);
|
e_config->bindings = evas_list_append(e_config->bindings, eb);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
E_Font_Fallback* eff;
|
||||||
|
|
||||||
|
eff = E_NEW(E_Font_Fallback, 1);
|
||||||
|
eff->name = strdup("Kochi-Gothic");
|
||||||
|
e_config->font_fallbacks = evas_list_append(e_config->font_fallbacks,
|
||||||
|
eff);
|
||||||
|
|
||||||
|
eff = E_NEW(E_Font_Fallback, 1);
|
||||||
|
eff->name = strdup("Baekmuk-Dotum");
|
||||||
|
e_config->font_fallbacks = evas_list_append(e_config->font_fallbacks,
|
||||||
|
eff);
|
||||||
|
|
||||||
|
}
|
||||||
|
{
|
||||||
|
E_Font_Default* efd;
|
||||||
|
|
||||||
|
efd = E_NEW(E_Font_Fallback, 1);
|
||||||
|
efd->text_class = strdup("title_bar");
|
||||||
|
efd->font = strdup("Vera");
|
||||||
|
efd->size = 10;
|
||||||
|
e_config->font_defaults = evas_list_append(e_config->font_defaults, efd);
|
||||||
|
|
||||||
|
}
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,12 +226,34 @@ e_config_shutdown(void)
|
||||||
e_config->bindings = evas_list_remove_list(e_config->bindings, e_config->bindings);
|
e_config->bindings = evas_list_remove_list(e_config->bindings, e_config->bindings);
|
||||||
E_FREE(eb);
|
E_FREE(eb);
|
||||||
}
|
}
|
||||||
|
while (e_config->font_fallbacks)
|
||||||
|
{
|
||||||
|
E_Font_Fallback *eff;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
while (e_config->font_defaults)
|
||||||
|
{
|
||||||
|
E_Font_Default *efd;
|
||||||
|
|
||||||
|
efd = e_config->font_defaults->data;
|
||||||
|
e_config->font_defaults = evas_list_remove_list(e_config->font_defaults, e_config->font_defaults);
|
||||||
|
E_FREE(efd->text_class);
|
||||||
|
E_FREE(efd->font);
|
||||||
|
E_FREE(efd);
|
||||||
|
}
|
||||||
|
|
||||||
E_FREE(e_config->desktop_default_background);
|
E_FREE(e_config->desktop_default_background);
|
||||||
E_FREE(e_config);
|
E_FREE(e_config);
|
||||||
}
|
}
|
||||||
E_CONFIG_DD_FREE(_e_config_edd);
|
E_CONFIG_DD_FREE(_e_config_edd);
|
||||||
E_CONFIG_DD_FREE(_e_config_module_edd);
|
E_CONFIG_DD_FREE(_e_config_module_edd);
|
||||||
E_CONFIG_DD_FREE(_e_config_binding_edd);
|
E_CONFIG_DD_FREE(_e_config_binding_edd);
|
||||||
|
E_CONFIG_DD_FREE(_e_config_font_default_edd);
|
||||||
|
E_CONFIG_DD_FREE(_e_config_font_fallback_edd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,8 @@ struct _E_Config
|
||||||
int use_virtual_roots;
|
int use_virtual_roots;
|
||||||
Evas_List *modules;
|
Evas_List *modules;
|
||||||
Evas_List *bindings;
|
Evas_List *bindings;
|
||||||
|
Evas_List *font_fallbacks;
|
||||||
|
Evas_List *font_defaults;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _E_Config_Module
|
struct _E_Config_Module
|
||||||
|
|
|
@ -33,3 +33,4 @@
|
||||||
#include "e_xinerama.h"
|
#include "e_xinerama.h"
|
||||||
#include "e_table.h"
|
#include "e_table.h"
|
||||||
#include "e_layout.h"
|
#include "e_layout.h"
|
||||||
|
#include "e_font.h"
|
||||||
|
|
247
src/bin/e_ipc.c
247
src/bin/e_ipc.c
|
@ -213,6 +213,253 @@ _e_ipc_cb_client_data(void *data, int type, void *event)
|
||||||
bg, strlen(bg) + 1);
|
bg, strlen(bg) + 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case E_IPC_OP_FONT_AVAILABLE_LIST:
|
||||||
|
{
|
||||||
|
Evas_List *fonts_available, *l;
|
||||||
|
int bytes;
|
||||||
|
char *font_name, *data, *p;
|
||||||
|
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
ecore_ipc_client_send(e->client,
|
||||||
|
E_IPC_DOMAIN_REPLY,
|
||||||
|
E_IPC_OP_FONT_AVAILABLE_LIST_REPLY,
|
||||||
|
0/*ref*/, 0/*ref_to*/, 0/*response*/,
|
||||||
|
data, bytes);
|
||||||
|
|
||||||
|
e_font_available_list_free(fonts_available);
|
||||||
|
free(data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case E_IPC_OP_FONT_APPLY:
|
||||||
|
{
|
||||||
|
e_font_apply();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case E_IPC_OP_FONT_FALLBACK_CLEAR:
|
||||||
|
{
|
||||||
|
e_font_fallback_clear();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
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);
|
||||||
|
e_font_fallback_append(font_name);
|
||||||
|
free(font_name);
|
||||||
|
|
||||||
|
e_config_save_queue();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
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);
|
||||||
|
e_font_fallback_prepend(font_name);
|
||||||
|
free(font_name);
|
||||||
|
|
||||||
|
e_config_save_queue();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case E_IPC_OP_FONT_FALLBACK_LIST:
|
||||||
|
{
|
||||||
|
Evas_List *fallbacks, *l;
|
||||||
|
int bytes;
|
||||||
|
E_Font_Fallback *eff;
|
||||||
|
char *data, *p;
|
||||||
|
|
||||||
|
bytes = 0;
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
ecore_ipc_client_send(e->client,
|
||||||
|
E_IPC_DOMAIN_REPLY,
|
||||||
|
E_IPC_OP_FONT_FALLBACK_LIST_REPLY,
|
||||||
|
0/*ref*/, 0/*ref_to*/, 0/*response*/,
|
||||||
|
data, bytes);
|
||||||
|
free(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
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);
|
||||||
|
e_font_fallback_remove(font_name);
|
||||||
|
free(font_name);
|
||||||
|
|
||||||
|
e_config_save_queue();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case E_IPC_OP_FONT_DEFAULT_SET:
|
||||||
|
{
|
||||||
|
char * p;
|
||||||
|
char * font_name;
|
||||||
|
char * text_class;
|
||||||
|
int font_size;
|
||||||
|
|
||||||
|
|
||||||
|
p = e->data;
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
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);
|
||||||
|
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
|
||||||
|
ecore_ipc_client_send(e->client,
|
||||||
|
E_IPC_DOMAIN_REPLY,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_GET_REPLY,
|
||||||
|
0/*ref*/, 0/*ref_to*/, 0/*response*/,
|
||||||
|
data, bytes);
|
||||||
|
free(data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
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);
|
||||||
|
e_font_default_remove(text_class);
|
||||||
|
free(text_class);
|
||||||
|
|
||||||
|
e_config_save_queue();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case E_IPC_OP_FONT_DEFAULT_LIST:
|
||||||
|
{
|
||||||
|
Evas_List *defaults, *l;
|
||||||
|
int bytes;
|
||||||
|
E_Font_Default *efd;
|
||||||
|
char *data, *p;
|
||||||
|
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
ecore_ipc_client_send(e->client,
|
||||||
|
E_IPC_DOMAIN_REPLY,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_LIST_REPLY,
|
||||||
|
0/*ref*/, 0/*ref_to*/, 0/*response*/,
|
||||||
|
data, bytes);
|
||||||
|
free(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
case E_IPC_OP_RESTART:
|
case E_IPC_OP_RESTART:
|
||||||
{
|
{
|
||||||
restart = 1;
|
restart = 1;
|
||||||
|
|
|
@ -23,6 +23,21 @@ typedef enum _E_Ipc_Op {
|
||||||
E_IPC_OP_BG_SET,
|
E_IPC_OP_BG_SET,
|
||||||
E_IPC_OP_BG_GET,
|
E_IPC_OP_BG_GET,
|
||||||
E_IPC_OP_BG_GET_REPLY,
|
E_IPC_OP_BG_GET_REPLY,
|
||||||
|
E_IPC_OP_FONT_AVAILABLE_LIST,
|
||||||
|
E_IPC_OP_FONT_AVAILABLE_LIST_REPLY,
|
||||||
|
E_IPC_OP_FONT_APPLY,
|
||||||
|
E_IPC_OP_FONT_FALLBACK_CLEAR,
|
||||||
|
E_IPC_OP_FONT_FALLBACK_APPEND,
|
||||||
|
E_IPC_OP_FONT_FALLBACK_PREPEND,
|
||||||
|
E_IPC_OP_FONT_FALLBACK_LIST,
|
||||||
|
E_IPC_OP_FONT_FALLBACK_LIST_REPLY,
|
||||||
|
E_IPC_OP_FONT_FALLBACK_REMOVE,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_SET,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_GET,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_GET_REPLY,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_REMOVE,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_LIST,
|
||||||
|
E_IPC_OP_FONT_DEFAULT_LIST_REPLY,
|
||||||
E_IPC_OP_RESTART,
|
E_IPC_OP_RESTART,
|
||||||
E_IPC_OP_LAST
|
E_IPC_OP_LAST
|
||||||
} E_Ipc_Op;
|
} E_Ipc_Op;
|
||||||
|
|
|
@ -224,6 +224,9 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
_e_main_shutdown_push(ecore_evas_shutdown);
|
_e_main_shutdown_push(ecore_evas_shutdown);
|
||||||
|
|
||||||
|
|
||||||
|
/*** Finished loading subsystems, Loading WM Specifics ***/
|
||||||
|
|
||||||
/* setup directories we will be using for configurations sotrage etc. */
|
/* setup directories we will be using for configurations sotrage etc. */
|
||||||
if (!_e_main_dirs_init())
|
if (!_e_main_dirs_init())
|
||||||
{
|
{
|
||||||
|
@ -250,9 +253,15 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
/* setup edje to animate @ e_config->framerate frames per sec. */
|
/* setup edje to animate @ e_config->framerate frames per sec. */
|
||||||
edje_frametime_set(1.0 / e_config->framerate);
|
edje_frametime_set(1.0 / e_config->framerate);
|
||||||
/* FIXME: this is just appending Kochi if Vera doesnt have it. We need
|
|
||||||
* a full config support subsystem for this */
|
/* init font system */
|
||||||
edje_fontset_append_set("Kochi-Gothic,Baekmuk-Dotum");
|
if (!e_font_init())
|
||||||
|
{
|
||||||
|
e_error_message_show("Enlightenment cannot set up its font system.");
|
||||||
|
_e_main_shutdown(-1);
|
||||||
|
}
|
||||||
|
_e_main_shutdown_push(e_font_shutdown);
|
||||||
|
e_font_apply();
|
||||||
e_canvas_recache();
|
e_canvas_recache();
|
||||||
|
|
||||||
/* setup init status window/screen */
|
/* setup init status window/screen */
|
||||||
|
@ -379,7 +388,7 @@ main(int argc, char **argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: make save to delete within a callback */
|
/* FIXME: make safe to delete within a callback */
|
||||||
E_Before_Idler *
|
E_Before_Idler *
|
||||||
e_main_idler_before_add(int (*func) (void *data), void *data, int once)
|
e_main_idler_before_add(int (*func) (void *data), void *data, int once)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,10 +36,12 @@ static int reply_expect = 0;
|
||||||
#define SIMPLE_REQ 0
|
#define SIMPLE_REQ 0
|
||||||
#define SIMPLE_STR_REQ 1
|
#define SIMPLE_STR_REQ 1
|
||||||
#define FULL_FUNC 2
|
#define FULL_FUNC 2
|
||||||
|
#define MULTI_STR_REQ 3
|
||||||
|
|
||||||
#define OREQ(opt, desc, ipc, rep) {opt, desc, 0, rep, SIMPLE_REQ, ipc, NULL}
|
#define OREQ(opt, desc, ipc, rep) {opt, desc, 0, rep, SIMPLE_REQ, ipc, NULL}
|
||||||
#define OSTR(opt, desc, ipc, rep) {opt, desc, 1, rep, SIMPLE_STR_REQ, ipc, NULL}
|
#define OSTR(opt, desc, ipc, rep) {opt, desc, 1, rep, SIMPLE_STR_REQ, ipc, NULL}
|
||||||
#define OFNC(opt, desc, param, fn, rep) {opt, desc, param, rep, SIMPLE_FUNC, 0, fn}
|
#define OFNC(opt, desc, param, fn, rep) {opt, desc, param, rep, SIMPLE_FUNC, 0, fn}
|
||||||
|
#define OMUL(opt, desc, ipc, rep, argc) {opt, desc, argc, rep, MULTI_STR_REQ, ipc, NULL}
|
||||||
|
|
||||||
E_IPC_Opt_Handler handlers[] =
|
E_IPC_Opt_Handler handlers[] =
|
||||||
{
|
{
|
||||||
|
@ -49,6 +51,17 @@ E_IPC_Opt_Handler handlers[] =
|
||||||
OSTR("-module-disable", "Disable module OPT1 if not disabled", E_IPC_OP_MODULE_DISABLE, 0),
|
OSTR("-module-disable", "Disable module OPT1 if not disabled", E_IPC_OP_MODULE_DISABLE, 0),
|
||||||
OREQ("-module-list", "List all loaded modules and their states", E_IPC_OP_MODULE_LIST, 1),
|
OREQ("-module-list", "List all loaded modules and their states", E_IPC_OP_MODULE_LIST, 1),
|
||||||
OSTR("-bg-set", "Set the background edje file to be OPT1", E_IPC_OP_BG_SET, 0),
|
OSTR("-bg-set", "Set the background edje file to be OPT1", E_IPC_OP_BG_SET, 0),
|
||||||
|
OSTR("-font-fallback-remove", "Remove OPT1 from the fontset", E_IPC_OP_FONT_FALLBACK_REMOVE, 0),
|
||||||
|
OSTR("-font-fallback-prepend", "Prepend OPT1 to the fontset", E_IPC_OP_FONT_FALLBACK_PREPEND, 0),
|
||||||
|
OSTR("-font-fallback-append", "Append OPT1 to the fontset", E_IPC_OP_FONT_FALLBACK_APPEND, 0),
|
||||||
|
OREQ("-font-apply", "Apply changes made to the font system", E_IPC_OP_FONT_APPLY, 0),
|
||||||
|
OREQ("-font-fallback-list", "List the fallback fonts in order", E_IPC_OP_FONT_FALLBACK_LIST, 1),
|
||||||
|
OREQ("-font-available-list", "List available fonts", E_IPC_OP_FONT_AVAILABLE_LIST, 1),
|
||||||
|
OREQ("-font-fallback-clear", "Clear font fallback list", E_IPC_OP_FONT_FALLBACK_CLEAR, 0),
|
||||||
|
OSTR("-font-default-get", "List the default font associated with OPT1", E_IPC_OP_FONT_DEFAULT_GET, 1),
|
||||||
|
OSTR("-font-default-remove", "Remove the default text class OPT1", E_IPC_OP_FONT_DEFAULT_REMOVE, 0),
|
||||||
|
OREQ("-font-default-list", "List all configured text classes", E_IPC_OP_FONT_DEFAULT_LIST, 1),
|
||||||
|
OMUL("-font-default-set", "Set textclass (OPT1) font (OPT2) and size (OPT3)", E_IPC_OP_FONT_DEFAULT_SET, 0, 3),
|
||||||
OREQ("-restart", "Restart E17", E_IPC_OP_RESTART, 0)
|
OREQ("-restart", "Restart E17", E_IPC_OP_RESTART, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -196,8 +209,10 @@ _e_ipc_cb_server_add(void *data, int type, void *event)
|
||||||
ecore_app_args_get(&argc, &argv);
|
ecore_app_args_get(&argc, &argv);
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
char *v;
|
char *v, *p;
|
||||||
int j;
|
int j;
|
||||||
|
int k;
|
||||||
|
int data_size;
|
||||||
|
|
||||||
for (j = 0; j < (int)(sizeof(handlers) / sizeof(E_IPC_Opt_Handler)); j++)
|
for (j = 0; j < (int)(sizeof(handlers) / sizeof(E_IPC_Opt_Handler)); j++)
|
||||||
{
|
{
|
||||||
|
@ -231,6 +246,29 @@ _e_ipc_cb_server_add(void *data, int type, void *event)
|
||||||
0/*ref*/, 0/*ref_to*/, 0/*response*/,
|
0/*ref*/, 0/*ref_to*/, 0/*response*/,
|
||||||
v, strlen(v));
|
v, strlen(v));
|
||||||
break;
|
break;
|
||||||
|
case MULTI_STR_REQ:
|
||||||
|
/* pack up the data "<str>0<str>0" */
|
||||||
|
data_size = 0;
|
||||||
|
for(k = 0; k < handler->num_params; k++) {
|
||||||
|
data_size += strlen(argv[ i + 1 + k ]);
|
||||||
|
data_size++; /* NULL Pad */
|
||||||
|
}
|
||||||
|
v = malloc(data_size);
|
||||||
|
p = v;
|
||||||
|
for(k = 0; k < handler->num_params; k++) {
|
||||||
|
strcpy(p, argv[ i + 1 + k]);
|
||||||
|
p += strlen(argv[ i + 1 + k]);
|
||||||
|
*p = 0;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
ecore_ipc_server_send(_e_ipc_server,
|
||||||
|
E_IPC_DOMAIN_REQUEST,
|
||||||
|
handler->simple_request_id,
|
||||||
|
0/*ref*/, 0/*ref_to*/, 0/*response*/,
|
||||||
|
v, data_size);
|
||||||
|
free(v);
|
||||||
|
|
||||||
|
break;
|
||||||
case FULL_FUNC:
|
case FULL_FUNC:
|
||||||
handler->func(argv + i + 1);
|
handler->func(argv + i + 1);
|
||||||
break;
|
break;
|
||||||
|
@ -300,6 +338,107 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
|
||||||
else
|
else
|
||||||
printf("REPLY: MODULE NONE\n");
|
printf("REPLY: MODULE NONE\n");
|
||||||
break;
|
break;
|
||||||
|
case E_IPC_OP_FONT_FALLBACK_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: FALLBACK NAME=\"%s\"\n", name);
|
||||||
|
}
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("REPLY: FALLBACK NONE\n");
|
||||||
|
break;
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("REPLY: AVAILABLE NONE\n");
|
||||||
|
break;
|
||||||
|
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++;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("REPLY: DEFAULT NONE\n");
|
||||||
|
break;
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printf("REPLY: DEFAULT NONE\n");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue