void ecore_con_local_win32_client_del(Ecore_Con_Client *obj) { Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Ecore_Con_Server_Data *svr = eo_data_scope_get(cl->host_server, ECORE_CON_SERVER_CLASS); if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT) return; if (((svr->type & ECORE_CON_TYPE) != ECORE_CON_LOCAL_USER) && ((svr->type & ECORE_CON_TYPE) != ECORE_CON_LOCAL_SYSTEM)) return; svr->read_stop = 1; while (!svr->read_stopped) Sleep(100); if (svr->event_peek) CloseHandle(svr->event_peek); svr->event_peek = NULL; if (svr->event_read) CloseHandle(svr->event_read); svr->event_read = NULL; free(svr->path); svr->path = NULL; if (svr->pipe) CloseHandle(svr->pipe); svr->pipe = NULL; }
static Eina_Bool _ecore_con_local_win32_server_peek_client_handler(void *data, Ecore_Win32_Handler *wh) { Ecore_Con_Client *obj = data; Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Ecore_Con_Server_Data *host_svr = eo_data_scope_get(cl->host_server, ECORE_CON_SERVER_CLASS); #if 0 char *msg; #endif if (!ResetEvent(host_svr->event_peek)) return ECORE_CALLBACK_RENEW; #if 0 msg = evil_last_error_get(); if (msg) { ecore_con_event_server_error(host_svr, msg); free(msg); } #endif _ecore_con_server_kill(cl->host_server); return ECORE_CALLBACK_CANCEL; ecore_main_win32_handler_del(wh); return ECORE_CALLBACK_DONE; }
static Eina_Bool _ecore_con_local_win32_server_read_client_handler(void *data, Ecore_Win32_Handler *wh) { Ecore_Con_Client *obj = data; Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); void *buf; DWORD n; Eina_Bool broken_pipe = EINA_FALSE; Ecore_Con_Server_Data *host_svr = eo_data_scope_get(cl->host_server, ECORE_CON_SERVER_CLASS); if (!ResetEvent(host_svr->event_read)) return ECORE_CALLBACK_RENEW; buf = malloc(host_svr->nbr_bytes); if (!buf) return ECORE_CALLBACK_RENEW; if (ReadFile(host_svr->pipe, buf, host_svr->nbr_bytes, &n, NULL)) { if (!cl->delete_me) ecore_con_event_client_data(obj, buf, host_svr->nbr_bytes, EINA_FALSE); host_svr->want_write = 1; } else { if (GetLastError() == ERROR_BROKEN_PIPE) broken_pipe = EINA_TRUE; } if (broken_pipe) { #if 0 char *msg; msg = evil_last_error_get(); if (msg) { ecore_con_event_client_error(cl, msg); free(msg); } #endif _ecore_con_client_kill(obj); return ECORE_CALLBACK_CANCEL; } if (host_svr->want_write) ecore_con_local_win32_client_flush(obj); ecore_main_win32_handler_del(wh); return ECORE_CALLBACK_DONE; }
Eina_Bool ecore_con_local_win32_client_flush(Ecore_Con_Client *obj) { Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Ecore_Con_Type type; size_t num; BOOL res; DWORD written; Ecore_Con_Server_Data *svr = eo_data_scope_get(cl->host_server, ECORE_CON_SERVER_CLASS); type = svr->type & ECORE_CON_TYPE; /* This check should never be true */ if (type == ECORE_CON_LOCAL_ABSTRACT) return EINA_TRUE; if ((type != ECORE_CON_LOCAL_USER) && (type != ECORE_CON_LOCAL_SYSTEM)) return EINA_FALSE; num = eina_binbuf_length_get(cl->buf) - cl->buf_offset; if (num <= 0) return EINA_TRUE; res = WriteFile(svr->pipe, eina_binbuf_string_get(cl->buf) + cl->buf_offset, num, &written, NULL); if (!res) { char *msg; msg = evil_last_error_get(); if (msg) { ecore_con_event_client_error(obj, msg); free(msg); } _ecore_con_client_kill(obj); } cl->buf_offset += written; if (cl->buf_offset >= eina_binbuf_length_get(cl->buf)) { cl->buf_offset = 0; eina_binbuf_free(cl->buf); cl->buf = NULL; svr->want_write = 0; } else if (written < (DWORD)num) svr->want_write = 1; return EINA_TRUE; }
// Clearly duplicated and should be in a common place... static Eina_Bool _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col) { if (pd->pat) return EINA_FALSE; Ector_Renderer_Generic_Gradient_Radial_Data *gld; // FIXME: don't ignore clipping ! gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN); if (!pd->pat || !gld) return EINA_FALSE; eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, ector_renderer_draw(op, clips, mul_col)); USE(obj, cairo_arc, EINA_FALSE); USE(obj, cairo_fill, EINA_FALSE); cairo_arc(pd->parent->cairo, gld->radial.x, gld->radial.y, gld->radius, 0, 2 * M_PI); eo_do(obj, ector_renderer_cairo_base_fill()); cairo_fill(pd->parent->cairo); return EINA_TRUE; }
void ecore_con_local_win32_server_del(Ecore_Con_Server *obj) { Ecore_Con_Server_Data *svr = eo_data_scope_get(obj, ECORE_CON_SERVER_CLASS); if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT) return; if (((svr->type & ECORE_CON_TYPE) != ECORE_CON_LOCAL_USER) && ((svr->type & ECORE_CON_TYPE) != ECORE_CON_LOCAL_SYSTEM)) return; svr->read_stop = 1; /* FIXME: we should try to stop these thread in one way or another */ /* should we use ecore_thread ? */ /* while (!svr->read_stopped) */ /* Sleep(100); */ if (svr->event_peek) CloseHandle(svr->event_peek); svr->event_peek = NULL; if (svr->event_read) CloseHandle(svr->event_read); svr->event_read = NULL; free(svr->path); svr->path = NULL; if (svr->pipe) CloseHandle(svr->pipe); svr->pipe = NULL; }
static unsigned int __stdcall _ecore_con_local_win32_listening(void *data) { Ecore_Con_Server *obj = data; Ecore_Con_Server_Data *svr = eo_data_scope_get(obj, ECORE_CON_SERVER_CLASS); BOOL res; while (1) { res = ConnectNamedPipe(svr->pipe, NULL); if (!res) { ERR("Opening the connection to the client failed"); CloseHandle(svr->pipe); svr->pipe = NULL; } break; } DBG("Client connected"); printf(" ### %s\n", __FUNCTION__); _endthreadex(0); return 0; }
static void _add(Efm_Monitor *mon, const char *file) { const char *path; const char *filename; Efm_File *ef; Efm_Monitor_Data *pd; Eina_Bool result; Eina_Bool dir; path = eina_stringshare_add(file); ef = eo_add(EFM_FILE_CLASS, mon, result = efm_file_obj_generate(path)); if (!ef) return; if (!result) { ERR("Creation of %s failed, this is ... strange", file); eo_del(ef); return; } pd = eo_data_scope_get(mon, EFM_MONITOR_CLASS); if (pd->config.only_folder && eo_do_ret(ef, dir, efm_file_obj_is_type(EFM_FILE_TYPE_DIRECTORY))) return; if (!pd->config.hidden_files && eo_do_ret(ef, filename, efm_file_obj_filename_get())[0] == '.') return; eina_hash_add(pd->file_icons, path, ef); eo_do(mon, eo_event_callback_call(EFM_MONITOR_EVENT_FILE_ADD, ef); MARK_POPULATED); }
void evas_fonts_zero_pressure(Evas *eo_evas) { Fndat *fd; Evas_Public_Data *evas = eo_data_scope_get(eo_evas, EVAS_CLASS); while (fonts_zero && eina_list_count(fonts_zero) > 4) /* 4 is arbitrary */ { fd = eina_list_data_get(fonts_zero); if (fd->ref != 0) break; fonts_zero = eina_list_remove_list(fonts_zero, fonts_zero); if (fd->fdesc) evas_font_desc_unref(fd->fdesc); if (fd->source) eina_stringshare_del(fd->source); evas->engine.func->font_free(evas->engine.data.output, fd->font); #ifdef HAVE_FONTCONFIG if (fd->set) FcFontSetDestroy(fd->set); if (fd->p_nm) FcPatternDestroy(fd->p_nm); #endif free(fd); if (eina_list_count(fonts_zero) < 5) break; } }
static Eina_Bool _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_prepare(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd) { Ector_Renderer_Generic_Gradient_Radial_Data *grd; Ector_Renderer_Generic_Gradient_Data *gd; unsigned int i; eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, ector_renderer_prepare()); if (pd->pat) return EINA_FALSE; grd = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN); gd = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN); if (!grd || !gd) return EINA_FALSE; USE(obj, cairo_pattern_create_radial, EINA_FALSE); USE(obj, cairo_pattern_add_color_stop_rgba, EINA_FALSE); pd->pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0, grd->radial.x, grd->radial.y, grd->radius); int r,g,b,a; for (i = 0; i < gd->colors_count; i++) { r = gd->colors[i].r; g = gd->colors[i].g; b = gd->colors[i].b; a = gd->colors[i].a; ector_color_argb_unpremul(a, &r, &g, &b); cairo_pattern_add_color_stop_rgba(pd->pat, gd->colors[i].offset, r/255.0, g/255.0, b/255.0, a/255.0); } USE(obj, cairo_pattern_set_extend, EINA_FALSE); cairo_pattern_set_extend(pd->pat, _ector_cairo_extent_get(gd->s)); if (!pd->parent) { Eo *parent; eo_do(obj, parent = eo_parent_get()); if (!parent) return EINA_FALSE; pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj); } return EINA_FALSE; }
static void * _ecore_idler_del(Ecore_Idler *obj) { Ecore_Idler_Data *idler = eo_data_scope_get(obj, MY_CLASS); if (!idler) return NULL; EINA_SAFETY_ON_TRUE_RETURN_VAL(idler->delete_me, NULL); idler->delete_me = 1; idlers_delete_me = 1; return idler->data; }
EAPI Ecore_Exe * ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data) { Ecore_Exe *ret = eo_add(MY_CLASS, NULL, ecore_obj_exe_command_set(exe_cmd, flags)); if (ret) { Ecore_Exe_Data *pd = eo_data_scope_get(ret, MY_CLASS); pd->data = (void *) data; } return ret; }
static void _del(Efm_Monitor *mon, const char *file) { Efm_Monitor_Data *pd; Efm_File *f; const char *files; files = eina_stringshare_add(file); pd = eo_data_scope_get(mon, EFM_MONITOR_CLASS); f = eina_hash_find(pd->file_icons, files); eo_do(mon, eo_event_callback_call(EFM_MONITOR_EVENT_FILE_DEL, f)); eina_hash_del(pd->file_icons, files, NULL); }
void evas_model_save_file_ply(const Evas_Canvas3D_Mesh *mesh, const char *file, Evas_Canvas3D_Mesh_Frame *f) { float *src_pos, *src_nor, *src_tex, *src_col; int i; Evas_Canvas3D_Mesh_Data *pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS); FILE *_ply_file = fopen(file, "w+"); if (!_ply_file) { ERR("File open '%s' for save failed", file); return; } fprintf(_ply_file,"ply\nformat ascii 1.0\ncomment Created by EFL evas_canvas3d_mesh_saver_ply.c" \ "version 1 (sub 0) - www.enlightenment.org, source file: ''\n"); fprintf(_ply_file,"element vertex %d\n", pd->vertex_count); fprintf(_ply_file,"property float x\nproperty float y\nproperty float z\n" \ "property float nx\nproperty float ny\nproperty float nz\n" \ "property float s\nproperty float t\n" \ "property uchar red\nproperty uchar green\nproperty uchar blue\n"); fprintf(_ply_file,"element face %d\nproperty list uchar uint vertex_indices\nend_header\n", pd->vertex_count / 3); src_pos = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION])->data; src_nor = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL])->data; src_tex = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD])->data; src_col = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR])->data; for (i = 0; i < pd->vertex_count; i++) { fprintf(_ply_file,"%f %f %f %f %f %f %f %f %.0f %.0f %.0f\n", src_pos[0], src_pos[1], src_pos[2], src_nor[0], src_nor[1], src_nor[2], src_tex[0], src_tex[1], round(src_col[0] * 255), round(src_col[1] * 255), round(src_col[2] * 255)); src_pos += 3; src_nor += 3; src_tex += 2; src_col += 4; } for (i = 0; i < pd->vertex_count;) { fprintf(_ply_file,"3 %d %d %d\n", i, i + 1, i + 2); i += 3; } fclose(_ply_file); }
/* thread to read data sent by the client to the server */ static unsigned int __stdcall _ecore_con_local_win32_server_read_client_thread(void *data) { Ecore_Con_Client *obj = data; Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Ecore_Con_Server_Data *host_svr = eo_data_scope_get(cl->host_server, ECORE_CON_SERVER_CLASS); DWORD nbr_bytes = 0; host_svr->read_stopped = EINA_FALSE; while (!host_svr->read_stop) { if (PeekNamedPipe(host_svr->pipe, NULL, 0, NULL, &nbr_bytes, NULL)) { if (nbr_bytes <= 0) continue; host_svr->nbr_bytes = nbr_bytes; if (!SetEvent(host_svr->event_read)) continue; } else { if (GetLastError() == ERROR_BROKEN_PIPE) { if (!SetEvent(host_svr->event_peek)) continue; break; } } } printf(" ### %s\n", __FUNCTION__); host_svr->read_stopped = EINA_TRUE; _endthreadex(0); return 0; }
EOLIAN static void _evas_out_view_set(Eo *eo_e, Evas_Out_Data *eo_dat, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { Eo *eo_parent = NULL; Evas_Public_Data *e; eo_do(eo_e, eo_parent = eo_parent_get()); e = eo_data_scope_get(eo_parent, EVAS_CANVAS_CLASS); evas_canvas_async_block(e); eo_dat->x = x; eo_dat->y = y; eo_dat->w = w; eo_dat->h = h; // XXX: tell engine about any output size etc. changes // XXX: tell evas to add damage if viewport loc/size changed }
Eina_Bool _cb_deled(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info) { Simple_Public_Data *pd = eo_data_scope_get(obj, MY_CLASS); const Eo_Callback_Array_Item *callback_array = event_info; (void) data; (void) desc; if (callback_array->desc != EV_A_CHANGED) return EINA_TRUE; pd->cb_count--; printf("Removed EV_A_CHANGED callback from %p. Count: %d\n", obj, pd->cb_count); return EO_CALLBACK_CONTINUE; }
EOLIAN static void _evas_out_eo_base_destructor(Eo *eo_obj, Evas_Out_Data *eo_dat) { Eo *eo_parent = NULL; Evas_Public_Data *e; eo_do(eo_obj, eo_parent = eo_parent_get()); e = eo_data_scope_get(eo_parent, EVAS_CLASS); if (!e) return ; // XXX: need to free output and context one they get allocated one day // e->engine.func->context_free(eo_dat->output, eo_dat->context); // e->engine.func->output_free(eo_dat->output); e->engine.func->info_free(eo_parent, eo_dat->info); e->outputs = eina_list_remove(e->outputs, eo_obj); eo_do_super(eo_obj, MY_CLASS, eo_destructor()); }
EOLIAN static void _evas_out_eo_base_constructor(Eo *eo_obj, Evas_Out_Data *eo_dat) { Eo *eo_parent = NULL; Evas_Public_Data *e; eo_do(eo_obj, eo_parent = eo_parent_get()); e = eo_data_scope_get(eo_parent, EVAS_CLASS); eo_do_super(eo_obj, MY_CLASS, eo_constructor()); if (!e) return; e->outputs = eina_list_append(e->outputs, eo_obj); if (e->engine.func->info) eo_dat->info = e->engine.func->info(eo_parent); // XXX: context and output are currently held in the core engine and are // allocated by engine specific internal code. this all needs a new engine // api to make it work }
void _elm_code_widget_tooltip_text_set(Evas_Object *widget, const char *text) { Elm_Code_Widget_Data *pd; pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); if (!text) { elm_object_tooltip_hide(widget); return; } elm_object_tooltip_show(widget); if (pd->tooltip) // will have been created by the callback below... elm_object_text_set(pd->tooltip, text); }
int main(int argc, char *argv[]) { (void) argc; (void) argv; eo_init(); Eo *obj = eo_add(INHERIT_CLASS, NULL); eo_do(obj, simple_a_set(1), inherit_prot_print()); Simple_Public_Data *pd = eo_data_scope_get(obj, SIMPLE_CLASS); printf("Pub: %d\n", pd->public_x2); eo_unref(obj); eo_shutdown(); return 0; }
void evas_fonts_zero_free(Evas *eo_evas) { Fndat *fd; Evas_Public_Data *evas = eo_data_scope_get(eo_evas, EVAS_CLASS); EINA_LIST_FREE(fonts_zero, fd) { if (fd->fdesc) evas_font_desc_unref(fd->fdesc); if (fd->source) eina_stringshare_del(fd->source); evas->engine.func->font_free(evas->engine.data.output, fd->font); #ifdef HAVE_FONTCONFIG if (fd->set) FcFontSetDestroy(fd->set); if (fd->p_nm) FcPatternDestroy(fd->p_nm); #endif free(fd); } }
void evas_font_free(Evas *eo_evas, void *font) { Eina_List *l; Fndat *fd; Evas_Public_Data *evas = eo_data_scope_get(eo_evas, EVAS_CLASS); EINA_LIST_FOREACH(fonts_cache, l, fd) { if (fd->font == font) { fd->ref--; if (fd->ref == 0) { fonts_cache = eina_list_remove_list(fonts_cache, l); fonts_zero = eina_list_append(fonts_zero, fd); } break; } } while (fonts_zero && eina_list_count(fonts_zero) > 42) /* 42 is arbitrary */ { fd = eina_list_data_get(fonts_zero); if (fd->ref != 0) break; fonts_zero = eina_list_remove_list(fonts_zero, fonts_zero); if (fd->fdesc) evas_font_desc_unref(fd->fdesc); if (fd->source) eina_stringshare_del(fd->source); evas->engine.func->font_free(evas->engine.data.output, fd->font); #ifdef HAVE_FONTCONFIG if (fd->set) FcFontSetDestroy(fd->set); if (fd->p_nm) FcPatternDestroy(fd->p_nm); #endif free(fd); if (eina_list_count(fonts_zero) < 43) break; } }
static Evas_Font_Set * _evas_load_fontconfig(Evas_Font_Set *font, Evas *eo_evas, FcFontSet *set, int size, Font_Rend_Flags wanted_rend) { Evas_Public_Data *evas = eo_data_scope_get(eo_evas, EVAS_CLASS); int i; /* Do loading for all in family */ for (i = 0; i < set->nfont; i++) { FcValue filename; FcPatternGet(set->fonts[i], FC_FILE, 0, &filename); if (font) evas->engine.func->font_add(evas->engine.data.output, font, (char *)filename.u.s, size, wanted_rend); else font = evas->engine.func->font_load(evas->engine.data.output, (char *)filename.u.s, size, wanted_rend); } return font; }
#include "../elementary_ext_priv.h" typedef struct { int size; Eina_Hash *mime_type; } Elm_File_MimeType_Cache_Data; EOLIAN static Elm_File_MimeType_Cache* _elm_file_mimetype_cache_cache_generate(Eo *obj EINA_UNUSED, void *npd EINA_UNUSED, int size) { Eo *result; Elm_File_MimeType_Cache_Data *pd; result = eo_add(ELM_FILE_MIMETYPE_CACHE_CLASS, NULL); pd = eo_data_scope_get(result, ELM_FILE_MIMETYPE_CACHE_CLASS); pd->size = size; pd->mime_type = eina_hash_string_small_new(NULL); return result; } static const char* _elm_file_mimetype_cache_mimetype_get(Eo *obj EINA_UNUSED, Elm_File_MimeType_Cache_Data *pd, const char *name) { const char *result; result = eina_hash_find(pd->mime_type, name); if (!result)
Eina_Bool ecore_con_local_connect(Ecore_Con_Server *obj, Eina_Bool (*cb_done)(void *data, Ecore_Fd_Handler *fd_handler)) { #warning "I am pretty sure cb_done should be used." Ecore_Con_Server_Data *svr = eo_data_scope_get(obj, ECORE_CON_SERVER_CLASS); char buf[256]; Ecore_Win32_Handler *handler_read; Ecore_Win32_Handler *handler_peek; if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT) { WRN("Your system does not support abstract sockets!"); return EINA_FALSE; } if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER) snprintf(buf, sizeof(buf), "\\\\.\\pipe\\%s", svr->name); else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM) { const char *computername; computername = getenv("COMPUTERNAME"); snprintf(buf, sizeof(buf), "\\\\%s\\pipe\\%s", computername, svr->name); } while (1) { svr->pipe = CreateFile(buf, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (svr->pipe != INVALID_HANDLE_VALUE) break; /* if pipe not busy, we exit */ if (GetLastError() != ERROR_PIPE_BUSY) { DBG("Connection to a server failed"); return EINA_FALSE; } /* pipe busy, so we wait for it */ if (!WaitNamedPipe(buf, NMPWAIT_WAIT_FOREVER)) { DBG("Can not wait for a server"); goto close_pipe; } } svr->path = strdup(buf); if (!svr->path) { ERR("Allocation failed"); goto close_pipe; } svr->event_read = CreateEvent(NULL, TRUE, FALSE, NULL); if (!svr->event_read) { ERR("Can not create event read"); goto free_path; } handler_read = ecore_main_win32_handler_add(svr->event_read, _ecore_con_local_win32_client_read_server_handler, obj); if (!handler_read) { ERR("Can not create handler read"); goto close_event_read; } svr->event_peek = CreateEvent(NULL, TRUE, FALSE, NULL); if (!svr->event_peek) { ERR("Can not create event peek"); goto del_handler_read; } handler_peek = ecore_main_win32_handler_add(svr->event_peek, _ecore_con_local_win32_client_peek_server_handler, obj); if (!handler_peek) { ERR("Can not create handler peek"); goto close_event_peek; } svr->thread_read = (HANDLE)_beginthreadex(NULL, 0, _ecore_con_local_win32_client_read_server_thread, obj, CREATE_SUSPENDED, NULL); if (!svr->thread_read) { ERR("Can not launch thread"); goto del_handler_peek; } if (!svr->delete_me) ecore_con_event_server_add(obj); ResumeThread(svr->thread_read); return EINA_TRUE; del_handler_peek: ecore_main_win32_handler_del(handler_peek); close_event_peek: CloseHandle(svr->event_peek); del_handler_read: ecore_main_win32_handler_del(handler_read); close_event_read: CloseHandle(svr->event_read); free_path: free(svr->path); svr->path = NULL; close_pipe: CloseHandle(svr->pipe); return EINA_FALSE; }
elm_object_tooltip_hide(widget); return; } elm_object_tooltip_show(widget); if (pd->tooltip) // will have been created by the callback below... elm_object_text_set(pd->tooltip, text); } static Evas_Object * _elm_code_widget_tooltip_cb(void *data EINA_UNUSED, Evas_Object *obj, Evas_Object *tooltip) { Elm_Code_Widget_Data *pd; Evas_Object *label; pd = eo_data_scope_get(obj, ELM_CODE_WIDGET_CLASS); label = elm_label_add(tooltip); pd->tooltip = label; return label; } void _elm_code_widget_tooltip_add(Evas_Object *widget) { elm_object_tooltip_content_cb_set(widget, _elm_code_widget_tooltip_cb, NULL, NULL); }
MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = eo_add(EVAS_OBJ_RECTANGLE_CLASS, e); eo_unref(eo_obj); return eo_obj; } static void _constructor(Eo *eo_obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) { Eo *parent; eo_do_super(eo_obj, MY_CLASS, eo_constructor()); Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); evas_object_rectangle_init(eo_obj); eo_do(eo_obj, eo_parent_get(&parent)); evas_object_inject(eo_obj, obj, evas_object_evas_get(parent)); } /* all nice and private */ static void evas_object_rectangle_init(Evas_Object *eo_obj) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); /* set up methods (compulsory) */ obj->func = &object_func; obj->private_data = eo_data_ref(eo_obj, MY_CLASS); obj->type = o_type;
{ if (--_ecore_con_local_init_count != 0) return _ecore_con_local_init_count; return _ecore_con_local_init_count; } int ecore_con_local_connect(Ecore_Con_Server *obj, Eina_Bool (*cb_done)(void *data, Ecore_Fd_Handler *fd_handler), void *data EINA_UNUSED) { #ifndef HAVE_LOCAL_SOCKETS return 0; #else Ecore_Con_Server_Data *svr = eo_data_scope_get(obj, ECORE_CON_SERVER_CLASS); char buf[4096]; struct sockaddr_un socket_unix; int curstate = 0; const char *homedir; int socket_unix_len; buf[0] = '\0'; if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER) { #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) if (getuid() == geteuid()) #endif homedir = _ecore_con_local_path_get(); #if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
return NULL; MAGIC_CHECK_END(); Evas_Object *eo_obj = eo_add(MY_CLASS, e); eo_unref(eo_obj); return eo_obj; } static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) { Evas_Out_Public_Data *eo_dat = _pd; Eo *eo_parent; Evas_Public_Data *e; eo_do(eo_obj, eo_parent_get(&eo_parent)); e = eo_data_scope_get(eo_parent, EVAS_CLASS); eo_do_super(eo_obj, MY_CLASS, eo_constructor()); if (!e) return; e->outputs = eina_list_append(e->outputs, eo_obj); if (e->engine.func->info) eo_dat->info = e->engine.func->info(eo_parent); // XXX: context and output are currently held in the core engine and are // allocated by engine specific internal code. this all needs a new engine // api to make it work } EAPI void evas_output_del(Evas_Out *evo) { eo_unref(evo);