2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "mcfgraphics-efl.h"
20 #include "mcfimageproxy.h"
21 #include "mcffontproxy.h"
23 #include "mcfwindows.h"
24 #include "mcfresourcecache.h"
25 #include "mcfwindows-efl.h"
27 #include "mcfcontext.h"
28 #include <Ecore_Evas.h>
30 #include <Elementary.h>
33 #ifdef TEST_NEWBACKEND
34 std::vector<ImageCache> g_ImageCache;
35 std::vector<TextCache> g_TextCache;
36 mcfint hash_string(const mcfchar* str) {
38 mcfint len = strlen(str);
39 for(mcfint loop = 0;loop < len && str[loop];loop++) {
40 ret = ((loop + 1) * str[loop]);
51 extern void mouse_press (void *data, Evas *e, Evas_Object *obj, void *event_info);
52 extern void mouse_release (void *data, Evas *e, Evas_Object *obj, void *event_info);
53 extern void mouse_move (void *data, Evas *e, Evas_Object *obj, void *event_info);
58 CMCFGraphicsImplEfl::CMCFGraphicsImplEfl()
61 /* Initializes all window resources */
67 CMCFGraphicsImplEfl::~CMCFGraphicsImplEfl()
72 Evas_Object* extract_partimage_from_fullimage(Evas_Object* fullimage,
74 int cell_x,int cell_y,
75 int cell_cx, int cell_cy)
81 Evas_Object *image_ob;
83 evas_object_image_size_get(fullimage, &w, &h);
85 data = (unsigned int*)evas_object_image_data_get(fullimage,0);
90 t_data=(unsigned int*)malloc(sizeof(unsigned int)*cell_cx*cell_cy);
96 for (i=img_y; i<img_y+cell_cy; i++) {
97 for (j=img_x; j<img_x+cell_cx; j++) {
98 t_data[(i-img_y)*cell_cx+(j-img_x)] = data[i*w+j];
102 image_ob = evas_object_image_add(evas_object_evas_get(fullimage));
103 if (image_ob == NULL) {
108 evas_object_image_size_set(image_ob,cell_cx,cell_cy);
109 evas_object_image_data_set(image_ob,t_data);
110 evas_object_image_fill_set(image_ob,0,0,cell_cx,cell_cy);
111 evas_object_resize(image_ob,cell_cx,cell_cy);
113 evas_object_show(image_ob);
114 //Changed for Memory Leak
120 CMCFGraphicsImplEfl::draw_image(mcfwindow window, const mcfdrawctx drawCtx, mcfchar* imgPath,
121 mcfint destX, mcfint destY, mcfint destWidth, mcfint destHeight,
122 mcfint srcX, mcfint srcY, mcfint srcWidth, mcfint srcHeight, mcfboolean extractImg)
126 mcf_assert_return(imgPath);
128 CMCFResourceCache *cache = CMCFResourceCache::get_instance();
129 CMCFWindows *windows = CMCFWindows::get_instance();
130 CMCFUtils *utils = CMCFUtils::get_instance();
131 McfWindowContext *winctx = NULL;
132 McfWindowContext *targetctx = NULL;
134 winctx = windows->get_window_context(window, FALSE);
135 targetctx = windows->get_window_context(drawCtx, FALSE);
138 if (winctx && targetctx && imgPath && utils && cache && windows) {
139 if (strlen(imgPath) > 0) {
140 #ifdef TEST_NEWBACKEND
141 mcfboolean bFound = FALSE;
142 mcfboolean bOrgSizeMinusOne = (srcWidth == -1 && srcHeight == -1);
143 mcfint hashval = hash_string(imgPath);
144 for(mcfint loop = 0;loop < g_ImageCache.size() && !bFound;loop++) {
145 if(g_ImageCache[loop].used &&
146 window == g_ImageCache[loop].window &&
147 hashval == g_ImageCache[loop].imgPathHash &&
148 destX == g_ImageCache[loop].destX &&
149 destY == g_ImageCache[loop].destY &&
150 destWidth == g_ImageCache[loop].destWidth &&
151 destHeight == g_ImageCache[loop].destHeight &&
152 srcX == g_ImageCache[loop].srcX &&
153 srcY == g_ImageCache[loop].srcY &&
154 srcWidth == g_ImageCache[loop].srcWidth &&
155 srcHeight == g_ImageCache[loop].srcHeight &&
156 extractImg == g_ImageCache[loop].extractImg) {
157 if(strcmp(imgPath, g_ImageCache[loop].imgPath) == 0) {
159 evas_object_show(g_ImageCache[loop].image);
160 evas_object_raise(g_ImageCache[loop].image);
161 if(g_ImageCache[loop].clipper) {
162 evas_object_show(g_ImageCache[loop].clipper);
163 evas_object_raise(g_ImageCache[loop].clipper);
170 EFLObject *obj = new EFLObject;
171 EFLObject *clipobj = NULL;
173 Evas_Object *winobj = (Evas_Object*)window;
175 Evas *evas = evas_object_evas_get(winobj);
176 Evas_Object *imgobj = evas_object_image_add(evas);
178 obj->bExtracted = FALSE;
183 evas_object_image_file_set(imgobj, imgPath, NULL);
184 evas_object_image_size_get(imgobj, &imgWidth, &imgHeight);
185 const McfNinePatchInfo *nine_patch_info = utils->get_nine_patch_info(imgPath);
186 if(nine_patch_info) {
187 evas_object_image_border_set(imgobj,
188 nine_patch_info->left, nine_patch_info->right,
189 nine_patch_info->top, nine_patch_info->bottom);
191 const McfLayout *layout = cache->get_cur_layout(window);
193 if(layout->displayType == MCFDISPLAY_PORTRAIT) {
194 imgWidth = utils->get_scale_x(imgWidth);
195 imgHeight = utils->get_scale_y(imgHeight);
197 imgWidth = utils->get_scale_y(imgWidth);
198 imgHeight = utils->get_scale_x(imgHeight);
201 if(srcWidth == -1 && srcHeight == -1) {
203 srcHeight = imgHeight;
205 if((srcWidth > 0 && srcHeight > 0) && (imgWidth != destWidth || imgHeight != destHeight) && extractImg) {
206 #ifdef EXTRACT_PARTIMAGE
207 Evas_Object *newobj = extract_partimage_from_fullimage(imgobj, srcX, srcY, 0, 0, srcWidth, srcHeight);
208 obj->bExtracted = TRUE;
209 evas_object_del(imgobj);
211 evas_object_move(imgobj, destX, destY);
212 if (destWidth > 0 && destHeight > 0) {
213 evas_object_image_fill_set(imgobj, 0, 0, destWidth,destHeight);
214 evas_object_resize(imgobj, destWidth, destHeight);
217 evas_object_move(imgobj, destX - srcX, destY - srcY);
218 evas_object_image_fill_set(imgobj, 0, 0, imgWidth, imgHeight);
220 evas_object_resize(imgobj, imgWidth, imgHeight);
222 evas_object_resize(imgobj, destWidth, destHeight);
225 Evas_Object *clipper = evas_object_rectangle_add(evas);
226 evas_object_color_set(clipper, 255, 255, 255, 255);
227 evas_object_move(clipper, destX, destY);
228 evas_object_resize(clipper, destWidth, destHeight);
229 evas_object_clip_set(imgobj, clipper);
230 evas_object_show(clipper);
232 clipobj = new EFLObject;
233 clipobj->obj = clipper;
234 clipobj->type = EFLOBJECT_CLIPOBJECT;
235 clipobj->position.x = destX;
236 clipobj->position.y = destY;
237 clipobj->position.width = destWidth;
238 clipobj->position.height = destHeight;
239 clipobj->etcInfo = imgPath;
240 clipobj->bExtracted = FALSE;
241 clipobj->data = NULL;
243 if(winctx->isVirtual) {
244 McfWindowContext *basectx = windows->get_window_context(windows->get_base_window());
246 clipobj->position.x -= (winctx->x - basectx->x);
247 clipobj->position.y -= (winctx->y - basectx->y);
252 evas_object_move(imgobj, destX, destY);
253 if (destWidth > 0 && destHeight > 0) {
254 evas_object_image_fill_set(imgobj, 0, 0, destWidth,destHeight);
255 evas_object_resize(imgobj, destWidth, destHeight);
258 evas_object_raise(imgobj);
259 evas_object_show(imgobj);
262 obj->type = EFLOBJECT_IMAGE;
263 obj->position.x = destX;
264 obj->position.y = destY;
265 obj->position.width = destWidth;
266 obj->position.height = destHeight;
267 obj->etcInfo = imgPath;
270 if(winctx->isVirtual) {
271 McfWindowContext *basectx = windows->get_window_context(windows->get_base_window());
273 obj->position.x -= (winctx->x - basectx->x);
274 obj->position.y -= (winctx->y - basectx->y);
278 targetctx->etcInfoPtr = eina_list_append((Eina_List*)(targetctx->etcInfoPtr), obj);
280 targetctx->etcInfoPtr = eina_list_append((Eina_List*)(targetctx->etcInfoPtr), clipobj);
283 /* FIXME : this is for placing the background image at the lowest depth */
284 mcfint window_layer = 29000;
285 if(!windows->is_base_window(reinterpret_cast<mcfwindow>(drawCtx))) {
286 window_layer = 29010;
289 if(winctx->width == destWidth && winctx->height == destHeight) {
290 evas_object_layer_set(imgobj, window_layer + 0);
292 evas_object_layer_set(imgobj, window_layer + 1);
296 #ifdef TEST_NEWBACKEND
299 cache.window = window;
300 strncpy(cache.imgPath, imgPath, sizeof(cache.imgPath));
301 cache.imgPathHash = hashval;
304 cache.destWidth = destWidth;
305 cache.destHeight = destHeight;
308 if(bOrgSizeMinusOne) {
310 cache.srcHeight = -1;
312 cache.srcWidth = srcWidth;
313 cache.srcHeight = srcHeight;
315 cache.extractImg= extractImg;
316 cache.image = obj->obj;
318 cache.clipper = clipobj->obj;
320 cache.clipper = NULL;
323 mcfboolean bInserted = FALSE;
324 for(mcfint loop = 0;loop < g_ImageCache.size() && !bInserted;loop++) {
325 if(!g_ImageCache[loop].used) {
326 g_ImageCache[loop] = cache;
330 g_ImageCache.push_back(cache);
339 CMCFGraphicsImplEfl::load_image(const mcfchar *imgPath)
346 CMCFGraphicsImplEfl::unload_image(mcfimage imgData)
352 * Initializes the drawing context for double-buffering.
353 * This func should be called before using a drawing primitive at first.
356 CMCFGraphicsImplEfl::begin_paint(const mcfwindow window, const mcfboolean forcedraw /* = FALSE */)
359 mcfdrawctx drawctx = reinterpret_cast<mcfdrawctx>(window);
365 * Notices that drawing tasks have done.
368 CMCFGraphicsImplEfl::end_paint(const mcfwindow window, mcfdrawctx drawCtx)
374 CMCFGraphicsImplEfl::create_font(const McfFontInfo& info)
380 CMCFGraphicsImplEfl::destroy_font(mcffont font)
386 const char *szString;
387 const float actual_width;
389 HARDCODED_WIDTH hardcoded_width[] = {
390 {"\xe3\x85\x82" , 0.59 }, // q
391 {"\xe3\x85\x83" , 0.59 }, // Q
392 {"\xe3\x85\x88" , 0.59 }, // w
393 {"\xe3\x85\x89" , 0.59 }, // W
394 {"\xe3\x84\xb7" , 0.59 }, // e
395 {"\xe3\x84\xb8" , 0.59 }, // E
396 {"\xe3\x84\xb1" , 0.59 }, // r
397 {"\xe3\x84\xb2" , 0.59 }, // R
398 {"\xe3\x85\x85" , 0.59 }, // t
399 {"\xe3\x85\x86" , 0.59 }, // T
400 {"\xe3\x85\x9b" , 0.72 }, // y
401 {"\xe3\x85\x95" , 0.40 }, // u
402 {"\xe3\x85\x91" , 0.40 }, // i
403 {"\xe3\x85\x90" , 0.50 }, // o
404 {"\xe3\x85\x92" , 0.55 }, // O
405 {"\xe3\x85\x94" , 0.59 }, // p
406 {"\xe3\x85\x96" , 0.59 }, // P
407 {"\xe3\x85\x81" , 0.59 }, // a
408 {"\xe3\x84\xb4" , 0.59 }, // s
409 {"\xe3\x85\x87" , 0.59 }, // d
410 {"\xe3\x84\xb9" , 0.59 }, // f
411 {"\xe3\x85\x8e" , 0.59 }, // g
412 {"\xe3\x85\x97" , 0.72 }, // h
413 {"\xe3\x85\x93" , 0.40 }, // j
414 {"\xe3\x85\x8f" , 0.40 }, // k
415 {"\xe3\x85\xa3" , 0.30 }, // l
416 {"\xe3\x85\x8b" , 0.59 }, // z
417 {"\xe3\x85\x8c" , 0.59 }, // x
418 {"\xe3\x85\x8a" , 0.59 }, // c
419 {"\xe3\x85\x8d" , 0.59 }, // v
420 {"\xe3\x85\xa0" , 0.72 }, // b
421 {"\xe3\x85\x9c" , 0.72 }, // n
422 {"\xe3\x85\xa1" , 0.75 }, // m
424 {"\xe3\x85\xa3" , 0.30 }, // ��
425 {"\xe3\x86\x8d" , 0.30 }, // .
426 {"\xe3\x85\xa1" , 0.75 }, // ��
427 {"\xe3\x84\xb1\xe3\x85\x8b" , 1.18 }, // ����
428 {"\xe3\x84\xb4\xe3\x84\xb9" , 1.18 }, // ����
429 {"\xe3\x84\xb7\xe3\x85\x8c" , 1.18 }, // ����
430 {"\xe3\x85\x82\xe3\x85\x8d" , 1.18 }, // ����
431 {"\xe3\x85\x85\xe3\x85\x8e" , 1.18 }, // ����
432 {"\xe3\x85\x88\xe3\x85\x8a" , 1.18 }, // ����
433 {"\xe3\x85\x87\xe3\x85\x81" , 1.18 }, // ����
434 {"\xe3\x85\x87\xe3\x85\x81" , 1.18 }, // ����
435 {"\xe3\x84\xb1\xe3\x84\xb4" , 1.38 }, // ����
436 {"\xe1\x84\x88" , 0.59 }, // ��
437 {"\xe1\x84\x8d" , 0.59 }, // ��
438 {"\xe1\x84\x84" , 0.59 }, // ��
439 {"\xe1\x84\x81" , 0.59 }, // ��
440 {"\xe1\x84\x8a" , 0.59 }, // ��
442 {"\xe2\x86\x90" , 0.50 }, // Arrows
443 {"\xe2\x86\x91" , 0.40 }, //
444 {"\xe2\x86\x92" , 0.55 }, //
445 {"\xe2\x86\x93" , 0.40 }, //
447 {"\xe3\x85\xa0" , 0.1 }, // ��
448 {"\341\205\262" , 0.9 }, // ��
451 int find_hardcoded_width(const char *szString, int fontsize) {
452 for(unsigned int loop = 0;loop < sizeof(hardcoded_width) / sizeof(HARDCODED_WIDTH);loop++) {
453 if(strcmp(szString, hardcoded_width[loop].szString) == 0) {
454 return hardcoded_width[loop].actual_width * fontsize;
461 * Draws the given text on cairo-surface
464 CMCFGraphicsImplEfl::draw_text(mcfwindow window, const mcfdrawctx drawCtx, const McfFontInfo& fontinfo, const McfColor& color,
465 const mcfchar *str, mcfint posx, mcfint posy, mcfint width, mcfint height,
466 MCFLabelAlignment align, mcfbyte paddingx, mcfbyte paddingy)
470 CMCFWindows *windows = CMCFWindows::get_instance();
471 McfWindowContext *winctx = NULL;
472 McfWindowContext *targetctx = NULL;
475 winctx = windows->get_window_context(window, FALSE);
476 targetctx = windows->get_window_context(drawCtx, FALSE);
479 if (winctx && targetctx && str && windows) {
480 if (strlen(str) > 0) {
481 #ifdef TEST_NEWBACKEND
482 mcfboolean bFound = FALSE;
483 mcfint hashval = hash_string(str);
484 mcfint org_posx = posx;
485 mcfint org_posy = posy;
486 for(mcfint loop = 0;loop < g_TextCache.size() && !bFound;loop++) {
487 if(g_TextCache[loop].used &&
488 window == g_TextCache[loop].window &&
489 strncmp(fontinfo.fontname, g_TextCache[loop].fontinfo.fontname, MAX_FONT_NAME_LEN) == 0 &&
490 fontinfo.fontsize == g_TextCache[loop].fontinfo.fontsize &&
491 fontinfo.isBold == g_TextCache[loop].fontinfo.isBold &&
492 fontinfo.isItalic == g_TextCache[loop].fontinfo.isItalic &&
493 memcmp(&color, &(g_TextCache[loop].color), sizeof(McfColor)) == 0 &&
494 hashval == g_TextCache[loop].strHash &&
495 posx == g_TextCache[loop].posx&&
496 posy == g_TextCache[loop].posy &&
497 width == g_TextCache[loop].width &&
498 height == g_TextCache[loop].height &&
499 align == g_TextCache[loop].align &&
500 paddingx == g_TextCache[loop].paddingx &&
501 paddingy == g_TextCache[loop].paddingy) {
502 if(strcmp(str, g_TextCache[loop].str) == 0) {
504 evas_object_show(g_TextCache[loop].text);
505 evas_object_raise(g_TextCache[loop].text);
511 EFLObject *obj = new EFLObject;
513 Evas_Object *winobj = (Evas_Object*)window;
514 Evas *evas = evas_object_evas_get(winobj);
515 Evas_Object *txtobj = evas_object_textblock_add(evas);
518 mcfchar strStyle[128];
519 sprintf(strStyle, "DEFAULT='font=%s font_size=%d align=%s color=#%02X%02X%02X%02X wrap=word left_margin=%d right_margin=%d'",
520 fontinfo.fontname, fontinfo.fontsize,
521 (((int)align % 3) == 1 ) ? "center" : ((((int)align % 3) == 2 ) ? "right" : "left"),
522 color.r, color.g, color.b, color.a, paddingx, paddingx);
524 Evas_Textblock_Style *st;
525 st = evas_textblock_style_new();
526 evas_textblock_style_set(st, strStyle);
527 evas_object_textblock_style_set(txtobj, st);
528 evas_object_textblock_text_markup_set(txtobj, str);
529 evas_object_resize(txtobj, width, height);
531 obj->bExtracted = FALSE;
532 obj->type = EFLOBJECT_TEXTBLOCK;
534 obj->position.x = posx;
535 obj->position.y = posy;
536 obj->position.width = width;
537 obj->position.height = height;
538 obj->etcInfo = (char*)str;
541 if(winctx->isVirtual) {
542 McfWindowContext *basectx = windows->get_window_context(windows->get_base_window());
544 obj->position.x -= (winctx->x - basectx->x);
545 obj->position.y -= (winctx->y - basectx->y);
549 mcfint calwidth, calheight;
550 evas_object_textblock_size_native_get(txtobj, &calwidth, &calheight);
551 /* FIXME : The following 2 lines are workaround for problem that EFL does not return correct font size */
552 mcfint hardcoded_width = find_hardcoded_width(str, fontinfo.fontsize);
553 if(hardcoded_width != 0) calwidth = hardcoded_width;
555 if(calwidth > width) {
556 sprintf(strStyle, "DEFAULT='font=%s font_size=%d align=%s color=#%02X%02X%02X%02X wrap=word left_margin=%d right_margin=%d'",
557 fontinfo.fontname, (int)(0.9 * fontinfo.fontsize * ((float)width / (float)calwidth)),
558 (((int)align % 3) == 1 ) ? "center" : ((((int)align % 3) == 2 ) ? "right" : "left"),
559 color.r, color.g, color.b, color.a, paddingx, paddingx);
560 evas_textblock_style_set(st, strStyle);
561 evas_object_textblock_style_set(txtobj, st);
562 evas_object_textblock_text_markup_set(txtobj, str);
563 evas_object_resize(txtobj, width, height);
564 evas_object_textblock_size_native_get(txtobj, &calwidth, &calheight);
567 if (align == LABEL_ALIGN_LEFT_MIDDLE ||
568 align == LABEL_ALIGN_CENTER_MIDDLE ||
569 align == LABEL_ALIGN_RIGHT_MIDDLE) {
570 posy = posy + ((height - calheight) / 2) + paddingy;
571 } else if (align == LABEL_ALIGN_LEFT_BOTTOM ||
572 align == LABEL_ALIGN_CENTER_BOTTOM ||
573 align == LABEL_ALIGN_RIGHT_BOTTOM) {
574 posy = posy + (height - calheight) - paddingy;
579 evas_object_move(txtobj, posx, posy);
580 evas_object_raise(txtobj);
581 evas_object_show(txtobj);
583 targetctx->etcInfoPtr = eina_list_append((Eina_List*)(targetctx->etcInfoPtr), obj);
585 mcfint window_layer = 29000;
586 if(!windows->is_base_window(reinterpret_cast<mcfwindow>(drawCtx))) {
587 window_layer = 29010;
589 evas_object_layer_set(txtobj, window_layer + 1);
592 #ifdef TEST_NEWBACKEND
595 cache.window = window;
596 cache.fontinfo = fontinfo;
598 strncpy(cache.fontinfo.fontname, fontinfo.fontname, MAX_FONT_NAME_LEN);
599 cache.fontinfo.fontsize = fontinfo.fontsize;
600 cache.fontinfo.isBold = fontinfo.isBold;
601 cache.fontinfo.isItalic = fontinfo.isItalic;
602 memcpy(&(cache.color), &(color), sizeof(McfColor));
603 strncpy(cache.str, str, sizeof(cache.str));
604 cache.strHash = hashval;
605 cache.posx = org_posx;
606 cache.posy = org_posy;
608 cache.height = height;
610 cache.paddingx = paddingx;
611 cache.paddingy = paddingy;
613 cache.text = obj->obj;
615 mcfboolean bInserted = FALSE;
616 for(mcfint loop = 0;loop < g_TextCache.size() && !bInserted;loop++) {
617 if(!g_TextCache[loop].used) {
618 g_TextCache[loop] = cache;
622 g_TextCache.push_back(cache);
631 * Draws a rectangle on cairo-surface
634 CMCFGraphicsImplEfl::draw_rectangle(mcfwindow window, const mcfdrawctx drawCtx, mcfdouble posx, mcfdouble posy,
635 mcfdouble width, mcfdouble height, const mcfdouble lineWidth,
636 const McfColor& lineColor, mcfboolean fill, const McfColor& fillColor,
637 mcfdouble radius, mcffloat alpha)
641 CMCFResourceCache *cache = CMCFResourceCache::get_instance();
642 CMCFWindows *windows = CMCFWindows::get_instance();
643 CMCFUtils *utils = CMCFUtils::get_instance();
644 McfWindowContext *winctx = NULL;
645 McfWindowContext *targetctx = NULL;
648 winctx = windows->get_window_context(window, FALSE);
649 targetctx = windows->get_window_context(drawCtx, FALSE);
652 if (winctx && utils && cache && windows) {
653 EFLObject *obj = new EFLObject;
655 Evas_Object *winobj = (Evas_Object*)window;
656 Evas *evas = evas_object_evas_get(winobj);
657 Evas_Object *rectobj = evas_object_rectangle_add(evas);
659 evas_object_size_hint_weight_set(rectobj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
660 elm_win_resize_object_add(winobj, rectobj);
661 evas_object_color_set(rectobj, fillColor.r, fillColor.g, fillColor.b, fillColor.a);
663 evas_object_move(rectobj, posx, posy);
664 evas_object_resize(rectobj, width, height);
666 evas_object_show(rectobj);
669 obj->type = EFLOBJECT_RECTANGLE;
670 obj->position.x = posx;
671 obj->position.y = posy;
672 obj->position.width = width;
673 obj->position.height = height;
677 if(winctx->isVirtual) {
678 McfWindowContext *basectx = windows->get_window_context(windows->get_base_window());
680 obj->position.x -= (winctx->x - basectx->x);
681 obj->position.y -= (winctx->y - basectx->y);
685 targetctx->etcInfoPtr = eina_list_append((Eina_List*)(targetctx->etcInfoPtr), obj);
687 mcfint window_layer = 29000;
688 if(!windows->is_base_window(reinterpret_cast<mcfwindow>(drawCtx))) {
689 window_layer = 29010;
691 evas_object_layer_set(rectobj, window_layer + 1);
697 CMCFGraphicsImplEfl::get_image_size(mcfchar* imgPath)
700 McfSize ret = { 0, 0 };
702 CMCFWindows *windows = CMCFWindows::get_instance();
704 Evas_Object *winobj = (Evas_Object*)(windows->get_base_window());
705 Evas *evas = evas_object_evas_get(winobj);
706 Evas_Object *imgobj = evas_object_image_add(evas);
710 evas_object_image_file_set(imgobj, imgPath, NULL);
711 evas_object_image_size_get(imgobj, &w, &h);
712 evas_object_del(imgobj);
713 ret.width = w;ret.height = h;