initial upload for tizen 2.0 beta
[apps/home/gallery.git] / ug / ug-gallery-efl / src / ge-tile.c
1 /*
2  *  ug-gallery-efl
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Sangjin Han <sjhan.han@samsung.com>,
7  *                      Jiansong Jin <jiansong.jin@samsung.com>,
8  *                      Jonghyuk Lee <jhyuk47.lee@samsung.com>,
9  *                      Chaolong Lin <chaolong.lin@samsung.com>,
10  *                      Yongjun Zhao <yj123.zhao@samsung.com>
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  *
24  */
25
26 #include "ge-debug.h"
27 #include "ge-tile.h"
28 #include "ge-button.h"
29 #include "gallery.h"
30 #ifdef _USE_ROTATE_BG_GE
31 #include "ge-rotate-bg.h"
32 #endif
33
34 /* Album color level and alpha value */
35 #define GE_TILE_TEXT_COLOR_CNT 6
36 #define GE_TILE_TEXT_COLOR_ALPHA 255
37
38 typedef struct _ge_tile_color {
39         int r;
40         int g;
41         int b;
42 } ge_tile_color;
43
44 static ge_tile_color bg_color[] = {
45         {50, 50, 50},
46         {78, 74, 64},
47         {49, 125, 174},
48         {165, 53, 53},
49         {71, 128, 11},
50         {56, 78, 116},
51         {25, 25, 25},
52 };
53
54 int __ge_tile_get_1st_icon_item_idx(int count, int *idx)
55 {
56         int _idx = 0;
57         if (count == GE_TILE_THUMB_2 ||
58             count == GE_ALBUM_COVER_THUMB_NUM_SEC)
59                 _idx = 1;
60         else if (count == GE_TILE_THUMB_3)
61                 _idx = 2;
62         else if (count > GE_ALBUM_COVER_THUMB_NUM_SEC){
63                 if (count == GE_TILE_THUMB_5)
64                         _idx = 2;
65                 else if (count == GE_TILE_THUMB_6)
66                         _idx = 1;
67                 else
68                         _idx = 0;
69         }
70         *idx = _idx;
71         return 0;
72 }
73
74 static Evas_Object *__ge_tile_add_3_icon_bg(Evas_Object *obj, int length,
75                                             double scale, bg_file_set_cb func,
76                                             void **data, const char *part)
77 {
78         GE_CHECK_NULL(obj);
79         GE_CHECK_NULL(func);
80         int i = 0;
81         int wid = 0;
82         int hei = 0;
83         Evas_Object *bg = NULL;
84
85 #ifdef _USE_ROTATE_BG_GE
86         if (!g_strcmp0(part, GT_TILE_3ICON1)) {
87                 wid = (int)(GE_TILE_2X_GRID_S * scale);
88                 hei = wid;
89                 i = 0;
90         } else if (!g_strcmp0(part, GT_TILE_3ICON2)) {
91                 wid = (int)(GE_TILE_GRID_S * scale);
92                 hei = (int)(GE_TILE_2X_GRID_S * scale);
93                 i = 1;
94         } else {
95                 return NULL;
96         }
97
98         bg = _ge_rotate_bg_add(obj);
99         GE_CHECK_NULL(bg);
100
101         evas_object_size_hint_min_set(bg, wid, hei);
102         evas_object_size_hint_max_set(bg, wid, hei);
103         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
104                                          EVAS_HINT_EXPAND);
105         evas_object_size_hint_align_set(bg, EVAS_HINT_FILL,
106                                         EVAS_HINT_FILL);
107
108         _ge_rotate_bg_add_image(bg, wid, hei);
109
110         func(bg, data[i]);
111
112         return bg;
113 #else
114         int tp_val = 0;
115         Evas_Object *tb = elm_table_add(obj);
116         GE_CHECK_NULL(tb);
117         elm_table_homogeneous_set(tb, EINA_FALSE);
118         elm_table_padding_set(tb, GE_TILE_PAD * scale, GE_TILE_PAD * scale);
119
120         for (i = 0; i < length - 1; i++) {
121                 bg = elm_bg_add(tb);
122                 GE_CHECK_NULL(bg);
123                 if (i == 0) {
124                         wid = (int)(GE_TILE_2X_GRID_S * scale);
125                         hei = wid;
126                 } else {
127                         wid = (int)(GE_TILE_GRID_S * scale);
128                         hei = (int)(GE_TILE_2X_GRID_S * scale);
129                 }
130
131                 elm_bg_load_size_set(bg, wid, hei);
132                 evas_object_size_hint_min_set(bg, wid, hei);
133                 elm_table_padding_set(tb, GE_TILE_PAD_2 * scale,
134                                       GE_TILE_PAD_2 * scale);
135
136                 func(bg, data[i]);
137
138                 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
139                                                  EVAS_HINT_EXPAND);
140                 evas_object_size_hint_align_set(bg, 0.0, 1.0);
141                 if (i != 0) {
142                         tp_val = EVAS_ASPECT_CONTROL_VERTICAL;
143                         evas_object_size_hint_aspect_set(bg, tp_val, 1, 1);
144                 }
145                 if (i == 0)
146                         elm_table_pack(tb, bg, 0, 0, 2, 2);
147                 else
148                         elm_table_pack(tb, bg, 2, 0, 1, 2);
149                 evas_object_show(bg);
150         }
151
152         return tb;
153 #endif
154 }
155
156 static Evas_Object *__ge_tile_add_4_icon_bg(Evas_Object *obj, int length,
157                                             double scale, bg_file_set_cb func,
158                                             void **data, const char *part)
159 {
160         GE_CHECK_NULL(obj);
161         GE_CHECK_NULL(func);
162         int i = 0;
163         int wid = 0;
164         int hei = 0;
165         Evas_Object *bg = NULL;
166
167 #ifdef _USE_ROTATE_BG_GE
168         if (!g_strcmp0(part, GT_TILE_4ICON1)) {
169                 wid = (int)(GE_TILE_2X_GRID_S * scale);
170                 hei = wid;
171                 i = 0;
172         } else if (!g_strcmp0(part, GT_TILE_4ICON3)) {
173                 wid = (int)(GE_TILE_GRID_S * scale);
174                 hei = wid;
175                 i = 2;
176         } else if (!g_strcmp0(part, GT_TILE_4ICON4)) {
177                 wid = (int)(GE_TILE_GRID_S * scale);
178                 hei = wid;
179                 i = 3;
180         } else {
181                 return NULL;
182         }
183
184         bg = _ge_rotate_bg_add(obj);
185         GE_CHECK_NULL(bg);
186
187         evas_object_size_hint_min_set(bg, wid, hei);
188         evas_object_size_hint_max_set(bg, wid, hei);
189         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
190                                          EVAS_HINT_EXPAND);
191         evas_object_size_hint_align_set(bg, EVAS_HINT_FILL,
192                                         EVAS_HINT_FILL);
193
194         _ge_rotate_bg_add_image(bg, wid, hei);
195
196         func(bg, data[i]);
197
198         return bg;
199 #else
200         Evas_Object *tb = elm_table_add(obj);
201         GE_CHECK_NULL(tb);
202         elm_table_homogeneous_set(tb, EINA_FALSE);
203         elm_table_padding_set(tb, GE_TILE_PAD_2 * scale,
204                               GE_TILE_PAD_2 * scale);
205         for (i = 0; i < length; i++) {
206                 if (i == 1)
207                         continue;
208
209                 bg = elm_bg_add(tb);
210                 GE_CHECK_NULL(bg);
211                 if (i == 0) {
212                         wid = (int)(GE_TILE_2X_GRID_S * scale);
213                         hei = wid;
214                 } else {
215                         wid = (int)(GE_TILE_GRID_S * scale);
216                         hei = wid;
217                 }
218
219                 elm_bg_load_size_set(bg, wid, hei);
220                 evas_object_size_hint_min_set(bg, wid, hei);
221
222                 func(bg, data[i]);
223
224                 evas_object_size_hint_aspect_set(bg,
225                                                  EVAS_ASPECT_CONTROL_VERTICAL,
226                                                  1, 1);
227                 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
228                                                  EVAS_HINT_EXPAND);
229                 evas_object_size_hint_align_set(bg, 0.0, 1.0);
230
231                 if (i == 0)
232                         elm_table_pack(tb, bg, 0, 0, 2, 2);
233                 else if (i == 2)
234                         elm_table_pack(tb, bg, 2, 0, 1, 1);
235                 else if (i == 3)
236                         elm_table_pack(tb, bg, 2, 1, 1, 1);
237                 evas_object_show(bg);
238         }
239
240         return tb;
241 #endif
242 }
243
244 static Evas_Object *__ge_tile_add_5_icon_bg(Evas_Object *obj, int length,
245                                             double scale, bg_file_set_cb func,
246                                             void **data, const char *part)
247 {
248         GE_CHECK_NULL(obj);
249         GE_CHECK_NULL(func);
250         int i = 0;
251         int wid = 0;
252         int hei = 0;
253         Evas_Object *bg = NULL;
254
255 #ifdef _USE_ROTATE_BG_GE
256         if (!g_strcmp0(part, GT_TILE_5ICON1)) {
257                 wid = (int)(GE_TILE_2X_GRID_S * scale);
258                 hei = (int)(GE_TILE_GRID_S * scale);
259                 i = 0;
260         } else if (!g_strcmp0(part, GT_TILE_5ICON2)) {
261                 wid = (int)(GE_TILE_2X_GRID_S * scale);
262                 hei = (int)(GE_TILE_GRID_S * scale);
263                 i = 1;
264         } else if (!g_strcmp0(part, GT_TILE_5ICON4)) {
265                 wid = (int)(GE_TILE_GRID_S * scale);
266                 hei = wid;
267                 i = 3;
268         } else if (!g_strcmp0(part, GT_TILE_5ICON5)) {
269                 wid = (int)(GE_TILE_GRID_S * scale);
270                 hei = wid;
271                 i = 4;
272         } else {
273                 return NULL;
274         }
275
276         bg = _ge_rotate_bg_add(obj);
277         GE_CHECK_NULL(bg);
278
279         evas_object_size_hint_min_set(bg, wid, hei);
280         evas_object_size_hint_max_set(bg, wid, hei);
281         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
282                                          EVAS_HINT_EXPAND);
283         evas_object_size_hint_align_set(bg, EVAS_HINT_FILL,
284                                         EVAS_HINT_FILL);
285
286         _ge_rotate_bg_add_image(bg, wid, hei);
287
288         func(bg, data[i]);
289
290         return bg;
291 #else
292         Evas_Object *tb = elm_table_add(obj);
293         GE_CHECK_NULL(tb);
294         elm_table_homogeneous_set(tb, EINA_FALSE);
295         elm_table_padding_set(tb, GE_TILE_PAD_2 * scale,
296                               GE_TILE_PAD_2 * scale);
297         for (i = 0; i < length; i++) {
298                 if (i == 2)
299                         continue;
300
301                 bg = elm_bg_add(tb);
302                 GE_CHECK_NULL(bg);
303                 if (i == 0 || i == 1) {
304                         wid = (int)(GE_TILE_2X_GRID_S * scale);
305                         hei = (int)(GE_TILE_GRID_S * scale);
306                 } else {
307                         wid = (int)(GE_TILE_GRID_S * scale);
308                         hei = wid;
309                 }
310
311                 elm_bg_load_size_set(bg, wid, hei);
312                 evas_object_size_hint_min_set(bg, wid, hei);
313
314                 func(bg, data[i]);
315
316                 evas_object_size_hint_aspect_set(bg,
317                                                  EVAS_ASPECT_CONTROL_VERTICAL,
318                                                  1, 1);
319                 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
320                                                  EVAS_HINT_EXPAND);
321                 evas_object_size_hint_align_set(bg, 0.5, 1.0);
322                 if (i == 0)
323                         elm_table_pack(tb, bg, 0, 0, 2, 1);
324                 else if (i == 1)
325                         elm_table_pack(tb, bg, 0, 1, 2, 1);
326                 else if (i == 3)
327                         elm_table_pack(tb, bg, 2, 0, 1, 1);
328                 else if (i == 4)
329                         elm_table_pack(tb, bg, 2, 1, 1, 1);
330                 evas_object_show(bg);
331         }
332
333         return tb;
334 #endif
335 }
336
337 static Evas_Object *__ge_tile_add_6_icon_bg(Evas_Object *obj, int length,
338                                             double scale, bg_file_set_cb func,
339                                             void **data, const char *part)
340 {
341         GE_CHECK_NULL(obj);
342         GE_CHECK_NULL(func);
343         int i = 0;
344         int wid = 0;
345         int hei = 0;
346         Evas_Object *bg = NULL;
347
348 #ifdef _USE_ROTATE_BG_GE
349         if (!g_strcmp0(part, GT_TILE_6ICON1)) {
350                 wid = (int)(GE_TILE_2X_GRID_S * scale);
351                 hei = (int)(GE_TILE_GRID_S * scale);
352                 i = 0;
353         } else if (!g_strcmp0(part, GT_TILE_6ICON3)) {
354                 wid = (int)(GE_TILE_GRID_S * scale);
355                 hei = wid;
356                 i = 2;
357         } else if (!g_strcmp0(part, GT_TILE_6ICON4)) {
358                 wid = (int)(GE_TILE_GRID_S * scale);
359                 hei = wid;
360                 i = 3;
361         } else if (!g_strcmp0(part, GT_TILE_6ICON5)) {
362                 wid = (int)(GE_TILE_GRID_S * scale);
363                 hei = wid;
364                 i = 4;
365         } else if (!g_strcmp0(part, GT_TILE_6ICON6)) {
366                 wid = (int)(GE_TILE_GRID_S * scale);
367                 hei = wid;
368                 i = 5;
369         } else {
370                 return NULL;
371         }
372
373         bg = _ge_rotate_bg_add(obj);
374         GE_CHECK_NULL(bg);
375
376         evas_object_size_hint_min_set(bg, wid, hei);
377         evas_object_size_hint_max_set(bg, wid, hei);
378         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
379                                          EVAS_HINT_EXPAND);
380         evas_object_size_hint_align_set(bg, EVAS_HINT_FILL,
381                                         EVAS_HINT_FILL);
382
383         _ge_rotate_bg_add_image(bg, wid, hei);
384
385         func(bg, data[i]);
386
387         return bg;
388 #else
389         Evas_Object *tb = elm_table_add(obj);
390         GE_CHECK_NULL(tb);
391         elm_table_homogeneous_set(tb, EINA_FALSE);
392         elm_table_padding_set(tb, GE_TILE_PAD_2 * scale,
393                               GE_TILE_PAD_2 * scale);
394         for (i = 0; i < length; i++) {
395                 if (i == 1)
396                         continue;
397
398                 bg = elm_bg_add(tb);
399                 GE_CHECK_NULL(bg);
400                 if (i == 0) {
401                         wid = (int)(GE_TILE_2X_GRID_S * scale);
402                         hei = (int)(GE_TILE_GRID_S * scale);
403                 } else {
404                         wid = (int)(GE_TILE_GRID_S * scale);
405                         hei = wid;
406                 }
407
408                 elm_bg_load_size_set(bg, wid, hei);
409                 evas_object_size_hint_min_set(bg, wid, hei);
410                 if (i == 0)
411                         evas_object_size_hint_max_set(bg, wid, hei);
412
413                 func(bg, data[i]);
414
415                 evas_object_size_hint_aspect_set(bg,
416                                                  EVAS_ASPECT_CONTROL_VERTICAL,
417                                                  1, 1);
418                 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
419                                                  EVAS_HINT_EXPAND);
420                 evas_object_size_hint_align_set(bg, 0.0, 1.0);
421                 if (i == 0)
422                         elm_table_pack(tb, bg, 0, 0, 2, 1);
423                 else if (i == 2)
424                         elm_table_pack(tb, bg, 2, 0, 1, 1);
425                 else if (i == 3)
426                         elm_table_pack(tb, bg, 0, 1, 1, 1);
427                 else if (i == 4)
428                         elm_table_pack(tb, bg, 1, 1, 1, 1);
429                 else if (i == 5)
430                         elm_table_pack(tb, bg, 2, 1, 1, 1);
431                 evas_object_show(bg);
432         }
433
434         return tb;
435 #endif
436 }
437
438 static Evas_Object *__ge_tile_add_7_icon_bg(Evas_Object *obj, int length,
439                                             double scale, bg_file_set_cb func,
440                                             void **data)
441 {
442         GE_CHECK_NULL(obj);
443         GE_CHECK_NULL(func);
444         int i = 0;
445         int wid = 0;
446         int hei = 0;
447         Evas_Object *bg = NULL;
448
449         Evas_Object *tb = elm_table_add(obj);
450         GE_CHECK_NULL(tb);
451         elm_table_homogeneous_set(tb, EINA_TRUE);
452         elm_table_padding_set(tb, GE_TILE_PAD * scale, GE_TILE_PAD * scale);
453
454         wid = (int)(GE_TILE_GRID_S * scale);
455         hei = wid;
456
457         for (i = 1; i < length; i++) {
458 #ifdef _USE_ROTATE_BG_GE
459                 bg = _ge_rotate_bg_add(tb);
460 #else
461                 bg = elm_bg_add(tb);
462 #endif
463                 GE_CHECK_NULL(bg);
464
465 #ifdef _USE_ROTATE_BG_GE
466                 _ge_rotate_bg_add_image(bg, wid, hei);
467 #else
468                 elm_bg_load_size_set(bg, wid, hei);
469 #endif
470
471                 func(bg, data[i]);
472
473                 evas_object_size_hint_aspect_set(bg,
474                                                  EVAS_ASPECT_CONTROL_VERTICAL,
475                                                  1, 1);
476                 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
477                                                  EVAS_HINT_EXPAND);
478                 evas_object_size_hint_align_set(bg, EVAS_HINT_FILL,
479                                                 EVAS_HINT_FILL);
480                 elm_table_pack(tb, bg, (int)((i - 1) % 3), (int)((i - 1) / 3),
481                                1, 1);
482                 evas_object_show(bg);
483         }
484
485         return tb;
486 }
487
488 Evas_Object *__ge_tile_add_1_icon_bg(Evas_Object *obj, int len, double scale,
489                                      bg_file_set_cb func, void **data)
490 {
491         GE_CHECK_NULL(obj);
492         GE_CHECK_NULL(func);
493         Evas_Object *bg = NULL;
494
495 #ifdef _USE_ROTATE_BG_GE
496         bg = _ge_rotate_bg_add(obj);
497 #else
498         bg = elm_bg_add(obj);
499 #endif
500         GE_CHECK_NULL(bg);
501
502         int wid = 0;
503         int hei = 0;
504
505         wid = (int)(GE_TILER_ICON_S * scale);
506         if (len == 1)
507                 hei = wid;
508         else
509                 hei = (int)(GE_TILE_2X_GRID_S * scale);
510
511 #ifdef _USE_ROTATE_BG_GE
512         _ge_rotate_bg_add_image(bg, wid, hei);
513 #else
514         elm_bg_load_size_set(bg, wid, hei);
515 #endif
516
517         func(bg, data[0]);
518
519         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
520         evas_object_size_hint_align_set(bg, 0.5, 0.5);
521         evas_object_show(bg);
522
523         return bg;
524 }
525
526 Evas_Object *__ge_tile_add_1st_icon_bg(Evas_Object *obj, int len, double scale,
527                                        bg_file_set_cb func, void **data)
528 {
529         GE_CHECK_NULL(obj);
530         GE_CHECK_NULL(func);
531         Evas_Object *bg = NULL;
532
533 #ifdef _USE_ROTATE_BG_GE
534         bg = _ge_rotate_bg_add(obj);
535 #else
536         bg = elm_bg_add(obj);
537 #endif
538         GE_CHECK_NULL(bg);
539
540         int wid = (int)(GE_TILE_GRID_S * scale);
541         int hei = wid;
542
543 #ifdef _USE_ROTATE_BG_GE
544         _ge_rotate_bg_add_image(bg, wid, hei);
545 #else
546         elm_bg_load_size_set(bg, wid, hei);
547 #endif
548
549         int idx = 0;
550         __ge_tile_get_1st_icon_item_idx(len, &idx);
551         func(bg, data[idx]);
552
553         evas_object_size_hint_min_set(bg, wid, hei);
554         evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
555         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
556         evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
557         evas_object_show(bg);
558         return bg;
559 }
560
561 Evas_Object *__ge_tile_add_icon(Evas_Object *obj, int len, double scale,
562                                 bg_file_set_cb func, void **data,
563                                 const char *part)
564 {
565         Evas_Object *icon = NULL;
566
567         switch(len) {
568         case GE_TILE_THUMB_1:
569                 return NULL;
570         case GE_TILE_THUMB_2:
571                 icon = __ge_tile_add_1_icon_bg(obj, len, scale, func, data);
572                 return icon;
573         case GE_TILE_THUMB_3:
574                 icon = __ge_tile_add_3_icon_bg(obj, len, scale, func, data, part);
575                 break;
576         case GE_ALBUM_COVER_THUMB_NUM_SEC:
577                 icon = __ge_tile_add_4_icon_bg(obj, len, scale, func, data, part);
578                 break;
579         case GE_TILE_THUMB_5:
580                 icon = __ge_tile_add_5_icon_bg(obj, len, scale, func, data, part);
581                 break;
582         case GE_TILE_THUMB_6:
583                 icon = __ge_tile_add_6_icon_bg(obj, len, scale, func, data, part);
584                 break;
585         default:
586                 icon = __ge_tile_add_7_icon_bg(obj, len, scale, func, data);
587                 break;
588         }
589
590         if (icon)
591                 evas_object_show(icon);
592         return icon;
593 }
594
595 Evas_Object *_ge_tile_show_part_icon(Evas_Object *obj, const char *part,
596                                      int length, double scale,
597                                      bg_file_set_cb func, void **data)
598 {
599         GE_CHECK_NULL(part);
600         GE_CHECK_NULL(strlen(part));
601         GE_CHECK_NULL(obj);
602         ge_dbg("part is %s", part);
603
604         if (!g_strcmp0(part, GT_TILE_ONLYICON)) {
605                 if (length != GE_TILE_THUMB_1)
606                         return NULL;
607
608                 Evas_Object *bg = NULL;
609                 bg = __ge_tile_add_1_icon_bg(obj, length, scale, func, data);
610                 return bg;
611         } else if (!g_strcmp0(part, GT_TILE_FIRSTICON)) {
612                 if (length <= GE_TILE_THUMB_1)
613                         return NULL;
614
615                 Evas_Object *bg = NULL;
616                 bg = __ge_tile_add_1st_icon_bg(obj, length, scale, func, data);
617                 return bg;
618         } else
619 #ifdef _USE_ROTATE_BG_GE
620         if ((!g_strcmp0(part, GT_TILE_3ICON1)) ||
621                    (!g_strcmp0(part, GT_TILE_3ICON2)) ||
622                    (!g_strcmp0(part, GT_TILE_4ICON3)) ||
623                    (!g_strcmp0(part, GT_TILE_4ICON4)) ||
624                    (!g_strcmp0(part, GT_TILE_5ICON1)) ||
625                    (!g_strcmp0(part, GT_TILE_5ICON2)) ||
626                    (!g_strcmp0(part, GT_TILE_6ICON4)) ||
627                    (!g_strcmp0(part, GT_TILE_6ICON5))) {
628                 if (length <= GE_TILE_THUMB_2 || length > GE_TILE_THUMB_6)
629                         return NULL;
630
631                 Evas_Object *tb = NULL;
632                 tb = __ge_tile_add_icon(obj, length, scale, func, data, part);
633                 return tb;
634         } else if (!g_strcmp0(part, GT_TILE_ICON)) {
635                 Evas_Object *tb = NULL;
636
637                 if (length == GE_TILE_THUMB_2)
638                         tb = __ge_tile_add_1_icon_bg(obj, length, scale, func,
639                                                      data);
640                 else if (length >= GE_ALBUM_COVER_THUMB_NUM)
641                         tb = __ge_tile_add_7_icon_bg(obj, length, scale, func,
642                                                      data);
643                 if (tb)
644                         evas_object_show(tb);
645                 return tb;
646         }
647 #else
648         if (!g_strcmp0(part, GT_TILE_ICON)) {
649                 if (length <= 0)
650                         return NULL;
651
652                 Evas_Object *tb = NULL;
653                 tb = __ge_tile_add_icon(obj, length, scale, func, data);
654                 return tb;
655         }
656 #endif
657         return NULL;
658 }
659
660 Evas_Object *_ge_tile_show_part_label(Evas_Object *obj, int index,
661                                       bool b_default)
662 {
663         GE_CHECK_NULL(obj);
664
665         Evas *evas = evas_object_evas_get(obj);
666         GE_CHECK_NULL(evas);
667         Evas_Object *bg = NULL;
668         bg = evas_object_rectangle_add(evas);
669         GE_CHECK_NULL(bg);
670
671         int j = 0;
672         if (b_default)
673                 j = GE_TILE_TEXT_COLOR_CNT;
674         else
675                 j = index % GE_TILE_TEXT_COLOR_CNT;
676         evas_object_color_set(bg, bg_color[j].r, bg_color[j].g, bg_color[j].b,
677                               GE_TILE_TEXT_COLOR_ALPHA);
678
679         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
680         evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
681         evas_object_show(bg);
682         return bg;
683 }
684