Rename Font_Request so I stop being stupidly confused

by it.



SVN revision: 73985
This commit is contained in:
Iván Briano 2012-07-17 14:23:19 +00:00
parent 0e2294db55
commit 558e2eb267
3 changed files with 56 additions and 56 deletions

View File

@ -187,20 +187,20 @@ typedef struct _Slave_Msg_Font_Loaded Slave_Msg_Font_Loaded;
typedef struct _Slave_Msg_Font_Glyphs_Load Slave_Msg_Font_Glyphs_Load; typedef struct _Slave_Msg_Font_Glyphs_Load Slave_Msg_Font_Glyphs_Load;
typedef struct _Slave_Msg_Font_Glyphs_Loaded Slave_Msg_Font_Glyphs_Loaded; typedef struct _Slave_Msg_Font_Glyphs_Loaded Slave_Msg_Font_Glyphs_Loaded;
typedef void *(*Font_Request_Msg_Create)(void *data, int *size); typedef void *(*Slave_Request_Msg_Create)(void *data, int *size);
typedef void (*Font_Request_Msg_Free)(void *msg, void *data); typedef void (*Slave_Request_Msg_Free)(void *msg, void *data);
typedef Msg_Base *(*Font_Request_Response)(void *data, void *resp, int *size); typedef Msg_Base *(*Slave_Request_Response)(void *data, void *resp, int *size);
typedef void (*Font_Request_Error)(void *data, Error_Type error); typedef void (*Slave_Request_Error)(void *data, Error_Type error);
struct _Font_Request_Funcs { struct _Slave_Request_Funcs {
Font_Request_Msg_Create msg_create; Slave_Request_Msg_Create msg_create;
Font_Request_Msg_Free msg_free; Slave_Request_Msg_Free msg_free;
Font_Request_Response response; Slave_Request_Response response;
Font_Request_Error error; Slave_Request_Error error;
}; };
typedef struct _Font_Request Font_Request; typedef struct _Slave_Request Slave_Request;
typedef struct _Font_Request_Funcs Font_Request_Funcs; typedef struct _Slave_Request_Funcs Slave_Request_Funcs;
typedef enum { typedef enum {
FONT_REND_REGULAR = 1, FONT_REND_REGULAR = 1,
@ -214,7 +214,7 @@ typedef enum {
CSERVE2_REQ_FONT_LOAD, CSERVE2_REQ_FONT_LOAD,
CSERVE2_REQ_FONT_GLYPHS_LOAD, CSERVE2_REQ_FONT_GLYPHS_LOAD,
CSERVE2_REQ_LAST CSERVE2_REQ_LAST
} Font_Request_Type; } Slave_Request_Type;
typedef struct _Glyph_Entry Glyph_Entry; typedef struct _Glyph_Entry Glyph_Entry;
@ -293,10 +293,10 @@ void cserve2_cache_stats_get(Client *client, unsigned int rid);
void cserve2_cache_font_debug(Client *client, unsigned int rid); void cserve2_cache_font_debug(Client *client, unsigned int rid);
Font_Request *cserve2_request_add(Font_Request_Type type, unsigned int rid, Client *client, Font_Request *dep, Font_Request_Funcs *funcs, void *data); Slave_Request *cserve2_request_add(Slave_Request_Type type, unsigned int rid, Client *client, Slave_Request *dep, Slave_Request_Funcs *funcs, void *data);
void cserve2_request_waiter_add(Font_Request *req, unsigned int rid, Client *client); void cserve2_request_waiter_add(Slave_Request *req, unsigned int rid, Client *client);
void cserve2_request_cancel(Font_Request *req, Client *client, Error_Type err); void cserve2_request_cancel(Slave_Request *req, Client *client, Error_Type err);
void cserve2_request_cancel_all(Font_Request *req, Error_Type err); void cserve2_request_cancel_all(Slave_Request *req, Error_Type err);
void cserve2_requests_init(void); void cserve2_requests_init(void);
void cserve2_requests_shutdown(void); void cserve2_requests_shutdown(void);

View File

@ -30,7 +30,7 @@ typedef enum {
struct _Entry { struct _Entry {
unsigned int id; unsigned int id;
Eina_List *references; Eina_List *references;
Font_Request *request; Slave_Request *request;
Entry_Type type; Entry_Type type;
#ifdef DEBUG_LOAD_TIME #ifdef DEBUG_LOAD_TIME
struct timeval load_start; struct timeval load_start;
@ -83,7 +83,7 @@ struct _Font_Source {
struct _Font_Entry { struct _Font_Entry {
Entry base; Entry base;
Font_Request *request; Slave_Request *request;
unsigned int rend_flags; unsigned int rend_flags;
unsigned int size; unsigned int size;
unsigned int dpi; unsigned int dpi;
@ -403,11 +403,11 @@ _request_failed(Entry *e, Error_Type type __UNUSED__)
} }
} }
static Font_Request_Funcs _open_funcs = { static Slave_Request_Funcs _open_funcs = {
.msg_create = (Font_Request_Msg_Create)_open_request_build, .msg_create = (Slave_Request_Msg_Create)_open_request_build,
.msg_free = _request_free, .msg_free = _request_free,
.response = (Font_Request_Response)_open_request_response, .response = (Slave_Request_Response)_open_request_response,
.error = (Font_Request_Error)_request_failed .error = (Slave_Request_Error)_request_failed
}; };
static void * static void *
@ -489,11 +489,11 @@ _load_request_response(Image_Data *e, Slave_Msg_Image_Loaded *resp, int *size)
return _image_loaded_msg_create(e, size); return _image_loaded_msg_create(e, size);
} }
static Font_Request_Funcs _load_funcs = { static Slave_Request_Funcs _load_funcs = {
.msg_create = (Font_Request_Msg_Create)_load_request_build, .msg_create = (Slave_Request_Msg_Create)_load_request_build,
.msg_free = _request_free, .msg_free = _request_free,
.response = (Font_Request_Response)_load_request_response, .response = (Slave_Request_Response)_load_request_response,
.error = (Font_Request_Error)_request_failed .error = (Slave_Request_Error)_request_failed
}; };
static unsigned int static unsigned int
@ -1109,11 +1109,11 @@ _font_load_request_failed(Font_Entry *fe, Error_Type error __UNUSED__)
_font_entry_reference_del(ref->client, fe); _font_entry_reference_del(ref->client, fe);
} }
static Font_Request_Funcs _font_load_funcs = { static Slave_Request_Funcs _font_load_funcs = {
.msg_create = (Font_Request_Msg_Create)_font_load_request_build, .msg_create = (Slave_Request_Msg_Create)_font_load_request_build,
.msg_free = (Font_Request_Msg_Free)_font_load_request_free, .msg_free = (Slave_Request_Msg_Free)_font_load_request_free,
.response = (Font_Request_Response)_font_load_request_response, .response = (Slave_Request_Response)_font_load_request_response,
.error = (Font_Request_Error)_font_load_request_failed .error = (Slave_Request_Error)_font_load_request_failed
}; };
static Eina_Bool static Eina_Bool
@ -1521,11 +1521,11 @@ _glyphs_load_request_failed(void *data __UNUSED__, Error_Type error __UNUSED__)
{ {
} }
static Font_Request_Funcs _glyphs_load_funcs = { static Slave_Request_Funcs _glyphs_load_funcs = {
.msg_create = (Font_Request_Msg_Create)_glyphs_load_request_build, .msg_create = (Slave_Request_Msg_Create)_glyphs_load_request_build,
.msg_free = (Font_Request_Msg_Free)_glyphs_load_request_free, .msg_free = (Slave_Request_Msg_Free)_glyphs_load_request_free,
.response = (Font_Request_Response)_glyphs_load_request_response, .response = (Slave_Request_Response)_glyphs_load_request_response,
.error = (Font_Request_Error)_glyphs_load_request_failed .error = (Slave_Request_Error)_glyphs_load_request_failed
}; };
static Eina_Bool static Eina_Bool
@ -1590,7 +1590,7 @@ _image_file_entry_stats_cb(const Eina_Hash *hash __UNUSED__, const void *key __U
msg->images.files_size += sizeof(File_Data) + msg->images.files_size += sizeof(File_Data) +
eina_list_count(fd->images) * sizeof(Eina_List *) + eina_list_count(fd->images) * sizeof(Eina_List *) +
eina_list_count(fd->base.references) * eina_list_count(fd->base.references) *
(sizeof(Font_Request *) + sizeof(Eina_List *)); (sizeof(Slave_Request *) + sizeof(Eina_List *));
#ifdef DEBUG_LOAD_TIME #ifdef DEBUG_LOAD_TIME
// accounting file entries load time // accounting file entries load time

View File

@ -33,7 +33,7 @@ typedef struct _Slave_Worker Slave_Worker;
*/ */
static struct _Request_Match static struct _Request_Match
{ {
Font_Request_Type rtype; Slave_Request_Type rtype;
Slave_Type stype; Slave_Type stype;
Slave_Command ctype; Slave_Command ctype;
} _request_match[] = } _request_match[] =
@ -61,16 +61,16 @@ static struct _Worker
{ SLAVE_FONT, 1, NULL, NULL, _create_font_slave }, { SLAVE_FONT, 1, NULL, NULL, _create_font_slave },
}; };
struct _Font_Request struct _Slave_Request
{ {
EINA_INLIST; EINA_INLIST;
Font_Request_Type type; Slave_Request_Type type;
void *data; void *data;
void *msg; void *msg;
Eina_List *waiters; Eina_List *waiters;
Eina_Bool processing; Eina_Bool processing;
Font_Request_Funcs *funcs; Slave_Request_Funcs *funcs;
Font_Request *dependency; Slave_Request *dependency;
Eina_List *dependents; /* list of requests that depend on this one finishing */ Eina_List *dependents; /* list of requests that depend on this one finishing */
Eina_Bool locked : 1; /* locked waiting for a dependency request to finish */ Eina_Bool locked : 1; /* locked waiting for a dependency request to finish */
}; };
@ -97,7 +97,7 @@ static Request_Queue *requests = NULL;
static void _cserve2_requests_process(void); static void _cserve2_requests_process(void);
static void static void
_request_waiter_add(Font_Request *req, Client *client, unsigned int rid) _request_waiter_add(Slave_Request *req, Client *client, unsigned int rid)
{ {
Waiter *w = malloc(sizeof(*w)); Waiter *w = malloc(sizeof(*w));
@ -109,10 +109,10 @@ _request_waiter_add(Font_Request *req, Client *client, unsigned int rid)
req->waiters = eina_list_append(req->waiters, w); req->waiters = eina_list_append(req->waiters, w);
} }
Font_Request * Slave_Request *
cserve2_request_add(Font_Request_Type type, unsigned int rid, Client *client, Font_Request *dep, Font_Request_Funcs *funcs, void *data) cserve2_request_add(Slave_Request_Type type, unsigned int rid, Client *client, Slave_Request *dep, Slave_Request_Funcs *funcs, void *data)
{ {
Font_Request *req, *r; Slave_Request *req, *r;
req = NULL; req = NULL;
@ -169,15 +169,15 @@ cserve2_request_add(Font_Request_Type type, unsigned int rid, Client *client, Fo
} }
void void
cserve2_request_waiter_add(Font_Request *req, unsigned int rid, Client *client) cserve2_request_waiter_add(Slave_Request *req, unsigned int rid, Client *client)
{ {
_request_waiter_add(req, client, rid); _request_waiter_add(req, client, rid);
} }
static void static void
_request_dependents_cancel(Font_Request *req, Error_Type err) _request_dependents_cancel(Slave_Request *req, Error_Type err)
{ {
Font_Request *dep; Slave_Request *dep;
EINA_LIST_FREE(req->dependents, dep) EINA_LIST_FREE(req->dependents, dep)
{ {
@ -190,7 +190,7 @@ _request_dependents_cancel(Font_Request *req, Error_Type err)
} }
void void
cserve2_request_cancel(Font_Request *req, Client *client, Error_Type err) cserve2_request_cancel(Slave_Request *req, Client *client, Error_Type err)
{ {
Eina_List *l, *l_next; Eina_List *l, *l_next;
Waiter *w; Waiter *w;
@ -232,7 +232,7 @@ cserve2_request_cancel(Font_Request *req, Client *client, Error_Type err)
} }
void void
cserve2_request_cancel_all(Font_Request *req, Error_Type err) cserve2_request_cancel_all(Slave_Request *req, Error_Type err)
{ {
Waiter *w; Waiter *w;
@ -279,7 +279,7 @@ cserve2_requests_shutdown(void)
} }
static void static void
_cserve2_request_failed(Font_Request *req, Error_Type type) _cserve2_request_failed(Slave_Request *req, Error_Type type)
{ {
Waiter *w; Waiter *w;
@ -304,7 +304,7 @@ static void
_slave_read_cb(Slave *s __UNUSED__, Slave_Command cmd, void *msg, void *data) _slave_read_cb(Slave *s __UNUSED__, Slave_Command cmd, void *msg, void *data)
{ {
Slave_Worker *sw = data; Slave_Worker *sw = data;
Font_Request *dep, *req = sw->data; Slave_Request *dep, *req = sw->data;
Eina_List **working, **idle; Eina_List **working, **idle;
Waiter *w; Waiter *w;
Msg_Base *resp = NULL; Msg_Base *resp = NULL;
@ -364,7 +364,7 @@ static void
_slave_dead_cb(Slave *s __UNUSED__, void *data) _slave_dead_cb(Slave *s __UNUSED__, void *data)
{ {
Slave_Worker *sw = data; Slave_Worker *sw = data;
Font_Request *req = sw->data; Slave_Request *req = sw->data;
Eina_List **working = &_workers[sw->type].working; Eina_List **working = &_workers[sw->type].working;
if (req) if (req)
@ -426,7 +426,7 @@ _slave_for_request_create(Slave_Type type)
} }
static Eina_Bool static Eina_Bool
_cserve2_request_dispatch(Slave_Worker *sw, Slave_Command ctype, Font_Request *req) _cserve2_request_dispatch(Slave_Worker *sw, Slave_Command ctype, Slave_Request *req)
{ {
int size; int size;
char *slave_msg = req->funcs->msg_create(req->data, &size); char *slave_msg = req->funcs->msg_create(req->data, &size);
@ -459,7 +459,7 @@ _cserve2_requests_process(void)
unsigned int max_workers; unsigned int max_workers;
Eina_List **idle, **working; Eina_List **idle, **working;
Eina_Inlist *itr; Eina_Inlist *itr;
Font_Request *req; Slave_Request *req;
for (j = 0; _request_match[j].rtype != CSERVE2_REQ_LAST; j++) for (j = 0; _request_match[j].rtype != CSERVE2_REQ_LAST; j++)
{ {