forked from enlightenment/enlightenment
someone is using an editor that has tabs. stop it.
ecrustified. SVN revision: 55702
This commit is contained in:
parent
75f95cebe2
commit
76b1e1805f
|
@ -14,7 +14,7 @@
|
|||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
void *alloca (size_t);
|
||||
void *alloca(size_t);
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -43,12 +43,19 @@ struct _E_Thumb
|
|||
|
||||
/* local subsystem functions */
|
||||
static int _e_ipc_init(void);
|
||||
static Eina_Bool _e_ipc_cb_server_add(void *data, int type, void *event);
|
||||
static Eina_Bool _e_ipc_cb_server_del(void *data, int type, void *event);
|
||||
static Eina_Bool _e_ipc_cb_server_data(void *data, int type, void *event);
|
||||
static Eina_Bool _e_ipc_cb_server_add(void *data,
|
||||
int type,
|
||||
void *event);
|
||||
static Eina_Bool _e_ipc_cb_server_del(void *data,
|
||||
int type,
|
||||
void *event);
|
||||
static Eina_Bool _e_ipc_cb_server_data(void *data,
|
||||
int type,
|
||||
void *event);
|
||||
static Eina_Bool _e_cb_timer(void *data);
|
||||
static void _e_thumb_generate(E_Thumb *eth);
|
||||
static char *_e_thumb_file_id(char *file, char *key);
|
||||
static char *_e_thumb_file_id(char *file,
|
||||
char *key);
|
||||
|
||||
/* local subsystem globals */
|
||||
static Ecore_Ipc_Server *_e_ipc_server = NULL;
|
||||
|
@ -58,7 +65,8 @@ static char _thumbdir[4096] = "";
|
|||
|
||||
/* externally accessible functions */
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
main(int argc,
|
||||
char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -141,20 +149,24 @@ _e_ipc_init(void)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_ipc_cb_server_add(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
_e_ipc_cb_server_add(void *data __UNUSED__,
|
||||
int type __UNUSED__,
|
||||
void *event)
|
||||
{
|
||||
Ecore_Ipc_Event_Server_Add *e;
|
||||
|
||||
e = event;
|
||||
ecore_ipc_server_send(e->server,
|
||||
5/*E_IPC_DOMAIN_THUMB*/,
|
||||
1/*hello*/,
|
||||
5 /*E_IPC_DOMAIN_THUMB*/,
|
||||
1 /*hello*/,
|
||||
0, 0, 0, NULL, 0); /* send hello */
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_ipc_cb_server_del(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||
_e_ipc_cb_server_del(void *data __UNUSED__,
|
||||
int type __UNUSED__,
|
||||
void *event __UNUSED__)
|
||||
{
|
||||
/* quit now */
|
||||
ecore_main_loop_quit();
|
||||
|
@ -162,7 +174,9 @@ _e_ipc_cb_server_del(void *data __UNUSED__, int type __UNUSED__, void *event __U
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_ipc_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
_e_ipc_cb_server_data(void *data __UNUSED__,
|
||||
int type __UNUSED__,
|
||||
void *event)
|
||||
{
|
||||
Ecore_Ipc_Event_Server_Data *e;
|
||||
E_Thumb *eth;
|
||||
|
@ -171,7 +185,7 @@ _e_ipc_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
char *key = NULL;
|
||||
|
||||
e = event;
|
||||
if (e->major != 5/*E_IPC_DOMAIN_THUMB*/) return ECORE_CALLBACK_PASS_ON;
|
||||
if (e->major != 5 /*E_IPC_DOMAIN_THUMB*/) return ECORE_CALLBACK_PASS_ON;
|
||||
switch (e->minor)
|
||||
{
|
||||
case 1:
|
||||
|
@ -198,6 +212,7 @@ _e_ipc_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/* end thumb */
|
||||
EINA_LIST_FOREACH(_thumblist, l, eth)
|
||||
|
@ -212,10 +227,12 @@ _e_ipc_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* quit now */
|
||||
ecore_main_loop_quit();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -319,8 +336,8 @@ _e_thumb_generate(E_Thumb *eth)
|
|||
evas_object_image_fill_set(im, 0, 0, ww, hh);
|
||||
edje = edje_object_add(evas_im);
|
||||
if ((eth->key) &&
|
||||
( (!strcmp(eth->key, "e/desktop/background")) ||
|
||||
(!strcmp(eth->key, "e/init/splash")) ))
|
||||
((!strcmp(eth->key, "e/desktop/background")) ||
|
||||
(!strcmp(eth->key, "e/init/splash"))))
|
||||
alpha = 0;
|
||||
if (edje_object_file_set(edje, eth->file, eth->key))
|
||||
{
|
||||
|
@ -421,8 +438,8 @@ _e_thumb_generate(E_Thumb *eth)
|
|||
n = 0;
|
||||
#define A(v) (((v) >> 24) & 0xff)
|
||||
#define R(v) (((v) >> 16) & 0xff)
|
||||
#define G(v) (((v) >> 8 ) & 0xff)
|
||||
#define B(v) (((v) ) & 0xff)
|
||||
#define G(v) (((v) >> 8) & 0xff)
|
||||
#define B(v) (((v)) & 0xff)
|
||||
#define HSV(p) \
|
||||
evas_color_rgb_to_hsv(R(p), G(p), B(p), &h, &s, &v); \
|
||||
hi = 20 * (h / 360.0); \
|
||||
|
@ -502,7 +519,8 @@ _e_thumb_generate(E_Thumb *eth)
|
|||
/* will free all */
|
||||
if (edje) evas_object_del(edje);
|
||||
if (ee_im) ecore_evas_free(ee_im);
|
||||
else if (im) evas_object_del(im);
|
||||
else if (im)
|
||||
evas_object_del(im);
|
||||
ecore_evas_free(ee);
|
||||
eet_clearcache();
|
||||
}
|
||||
|
@ -511,7 +529,8 @@ _e_thumb_generate(E_Thumb *eth)
|
|||
}
|
||||
|
||||
static char *
|
||||
_e_thumb_file_id(char *file, char *key)
|
||||
_e_thumb_file_id(char *file,
|
||||
char *key)
|
||||
{
|
||||
char s[64];
|
||||
const char *chmap = "0123456789abcdef";
|
||||
|
@ -537,8 +556,9 @@ _e_thumb_file_id(char *file, char *key)
|
|||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
s[(i * 2) + 0] = chmap[(id[i] >> 4) & 0xf];
|
||||
s[(i * 2) + 1] = chmap[(id[i] ) & 0xf];
|
||||
s[(i * 2) + 1] = chmap[(id[i]) & 0xf];
|
||||
}
|
||||
s[(i * 2)] = 0;
|
||||
return strdup(s);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue