1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
|
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef UG_MODULE_API
#define UG_MODULE_API __attribute__ ((visibility("default")))
#endif
#include <Evas.h>
#include <app.h>
#include "attach-panel-document.h"
#include "doc-list.h"
#include "doc-data.h"
#include "doc-ui-util.h"
#include "doc-util.h"
#include "doc-db-update.h"
#include "doc-main-view.h"
#define DOC_BG_COLOR_DEFAULT 0
#define DOC_BG_COLOR_A 255
static int _doc_create_main_view(doc_ugdata * ugd)
{
DOC_CHECK_VAL(ugd, -1);
DOC_CHECK_VAL(ugd->naviframe, -1);
doc_main_view_create(ugd);
return 0;
}
static Evas_Object *_doc_create_bg(Evas_Object * parent)
{
doc_dbg("");
DOC_CHECK_NULL(parent);
Evas_Object *bg = NULL;
/* Show special color of background */
bg = evas_object_rectangle_add(evas_object_evas_get(parent));
evas_object_color_set(bg, DOC_BG_COLOR_DEFAULT, DOC_BG_COLOR_DEFAULT,
DOC_BG_COLOR_DEFAULT, DOC_BG_COLOR_A);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bg);
return bg;
}
static void _doc_win_rot_changed_cb(void *data, Evas_Object * obj,
void *event)
{
DOC_CHECK(data);
DOC_CHECK(obj);
doc_ugdata *ugd = (doc_ugdata *) data;
/* changed_ang value is 0 90 180 270 */
int changed_ang = elm_win_rotation_get(obj);
/* Send event to UG */
enum ug_event evt = UG_EVENT_NONE;
switch (changed_ang) {
case APP_DEVICE_ORIENTATION_0:
evt = DOC_ROTATE_PORTRAIT;
break;
case APP_DEVICE_ORIENTATION_90:
evt = DOC_ROTATE_LANDSCAPE_UPSIDEDOWN;
break;
case APP_DEVICE_ORIENTATION_180:
evt = DOC_ROTATE_PORTRAIT_UPSIDEDOWN;
break;
case APP_DEVICE_ORIENTATION_270:
evt = DOC_ROTATE_LANDSCAPE;
break;
}
doc_dbg("New angle: %d, old angle: %d", evt, ugd->rotate_mode);
if (evt == ugd->rotate_mode)
return;
else
ugd->rotate_mode = evt;
/* Update rotate mode and view */
int len = eina_list_count(ugd->rotate_cbs);
doc_rotate_view_cb rotate_cb = eina_list_nth(ugd->rotate_cbs, len - 1); //[ToDo] Really needed ??
if (rotate_cb) {
doc_dbg("To rotate view");
rotate_cb(ugd);
} else {
doc_dbgE("None callbacks exists[%d]!", len);
}
}
static int _doc_view_initialize(doc_ugdata * ugd)
{
doc_dbg("");
DOC_CHECK_VAL(ugd, -1);
/* Base Layout */
ugd->ly_main = doc_ui_create_main_ly(ugd->win);
DOC_CHECK_VAL(ugd->ly_main, -1);
/* Background */
ugd->bg = _doc_create_bg(ugd->ly_main);
DOC_CHECK_VAL(ugd->bg, -1);
/* Navigation Bar */
ugd->naviframe = doc_ui_create_naviframe(ugd, ugd->ly_main);
DOC_CHECK_VAL(ugd->naviframe, -1);
/* List view and its layout */
if (_doc_create_main_view(ugd) != 0) {
doc_dbgE("Creating list view and layout failed!");
return -1;
}
return 0;
}
static int _doc_create_view(doc_ugdata * ugd)
{
doc_dbg("");
DOC_CHECK_VAL(ugd, -1);
/* Add new theme */
ugd->th = elm_theme_new();
DOC_CHECK_VAL(ugd->th, -1);
elm_theme_ref_set(ugd->th, NULL);
elm_theme_extension_add(ugd->th, DOC_EDJ_FILE); //[ToDo] Really needed ??
if (_doc_view_initialize(ugd) != 0) {
doc_dbgE("Initialize view failed!");
return -1;
} else {
doc_dbgE("view is intialized !!!!!!!!!!!!!");
}
/* Register MMC changed callback */
if (doc_reg_db_update_noti(ugd) != 0) {
doc_dbgE("reg_db_update_noti failed!");
return -1;
} else {
doc_dbgE("reg_db is updated storage state change");
}
return 0;
}
void doc_free_sel_info(doc_ugdata * ugd)
{
doc_dbg("Deleting selected media data");
DOC_CHECK(ugd);
Eina_List *l = NULL;
doc_sel_item_s *sit = NULL;
EINA_LIST_FOREACH(ugd->selected_elist, l, sit) {
doc_data_util_free_sel_item(sit);
}
ugd->selected_elist = NULL;
doc_dbg("Deleting selected media data done");
}
void doc_free_medias(doc_ugdata * ugd)
{
doc_dbg("Deleting media data");
DOC_CHECK(ugd);
DOC_CHECK(ugd->thumbs_d);
if (ugd->thumbs_d->medias_elist) {
doc_dbg("Deleting media list");
doc_data_util_free_mtype_items(&ugd->thumbs_d->medias_elist);
}
doc_dbg("Deleting media data done");
}
static int _doc_close_view(doc_ugdata * ugd)
{
DOC_CHECK_VAL(ugd, -1);
/************* Remove Callbacks **************/
DOC_IF_DEL_TIMER(ugd->del_timer)
/* Remove win rotation callback */
evas_object_smart_callback_del(ugd->win, "wm,rotation,changed",
_doc_win_rot_changed_cb);
doc_dereg_db_update_noti();
/************* Destroy UI objects **************/
/* Destroy UG called by me */
if (ugd->ug_called_by_me) {
doc_dbg("Destroy ug_called_by_me");
ug_destroy(ugd->ug_called_by_me);
ugd->ug_called_by_me = NULL;
}
DOC_IF_DEL_OBJ(ugd->popup)
DOC_IF_DEL_OBJ(ugd->ly_main)
if (ugd->th) {
elm_theme_extension_del(ugd->th, DOC_EDJ_FILE);
elm_theme_free(ugd->th);
ugd->th = NULL;
}
#ifdef _USE_HIDE_INDICATOR
_doc_ui_reset_indicator(ugd);
#endif
/************* Free data **************/
if (ugd->service) {
app_control_destroy(ugd->service);
ugd->service = NULL;
}
DOC_FREEIF(ugd->ug_path);
/*Finalize db update callback */
doc_db_update_finalize(ugd);
/* Disconnet with libmedia-info */
doc_data_finalize(ugd);
doc_free_sel_info(ugd);
doc_free_medias(ugd);
return 0;
}
static int _doc_parse_param_file(doc_ugdata * ugd, app_control_h service)
{
DOC_CHECK_VAL(ugd, -1);
DOC_CHECK_VAL(service, -1);
char *file_type = NULL;
char *mime = NULL;
app_control_get_mime(service, &mime);
if (mime) {
if (!g_strcmp0(mime, DOC_MIME_IMAGE_ALL))
ugd->file_type_mode = DOC_FILE_T_IMAGE;
else if (!g_strcmp0(mime, DOC_MIME_VIDEO_ALL))
ugd->file_type_mode = DOC_FILE_T_VIDEO;
else
ugd->file_type_mode = DOC_FILE_T_ALL;
free(mime);
return 0;
}
/* file-type */
app_control_get_extra_data(service, DOC_BUNDLE_FILE_TYPE, &file_type);
if (file_type == NULL) {
doc_dbgW("file_type is empty!");
goto DOC_DEFAULT_FILE_TYPE;
}
doc_dbg("file_type: %s", file_type);
if (!strcasecmp(file_type, DOC_FILE_TYPE_IMAGE)) {
ugd->file_type_mode = DOC_FILE_T_IMAGE;
DOC_FREE(file_type);
return 0;
} else if (!strcasecmp(file_type, DOC_FILE_TYPE_VIDEO)) {
ugd->file_type_mode = DOC_FILE_T_VIDEO;
DOC_FREE(file_type);
return 0;
}
if(file_type) {
free(file_type);
file_type = NULL;
}
DOC_DEFAULT_FILE_TYPE:
doc_dbg("file type is default, set default type(ALL).");
ugd->file_type_mode = DOC_FILE_T_ALL;
return 0;
}
/* analysis parameters */
static int _doc_parse_param(doc_ugdata * ugd, app_control_h service)
{
DOC_CHECK_VAL(ugd, -1);
DOC_CHECK_VAL(service, -1);
char *launch_type = NULL;
char *select_mode = NULL;
char *operation = NULL;
app_control_get_operation(service, &operation);
doc_sdbg("operation [%s]", operation);
#ifdef FEATURE_SIZE_CHECK
char *total_size = NULL;
int ret =
app_control_get_extra_data(service, APP_CONTROL_DATA_TOTAL_SIZE,
&(total_size));
if (ret != APP_CONTROL_ERROR_NONE) {
if (total_size)
ugd->limitsize = atol(total_size);
else
ugd->limitsize = -1;
} else {
ugd->limitsize = -1;
}
if(total_size) {
free(total_size);
total_size = NULL;
}
#endif
app_control_get_extra_data(service, APP_CONTROL_DATA_SELECTION_MODE,
&select_mode);
if (select_mode) {
if (!strcasecmp(select_mode, DOC_BUNDLE_SELECTION_MODE_SINGLE)) {
launch_type = strdup(DOC_LAUNCH_SELECT_ONE);
} else
if (!strcasecmp(select_mode, DOC_BUNDLE_SELECTION_MODE_MULTI))
launch_type = strdup(DOC_LAUNCH_SELECT_MULTIPLE);
DOC_FREE(select_mode);
}
if (launch_type == NULL) {
app_control_get_extra_data(service, DOC_BUNDLE_LAUNCH_TYPE,
&launch_type);
}
if (launch_type == NULL) {
if (operation &&
!strcasecmp(operation, APP_CONTROL_OPERATION_PICK)) {
launch_type = strdup(DOC_LAUNCH_SELECT_ONE);
doc_dbg("Set launch-type to default");
} else {
DOC_FREEIF(operation);
doc_dbg("launch-type = NULL, galery ug exit");
return -1;
}
}
if (launch_type) {
doc_dbg("launch-type [%s]", launch_type);
if (!strcasecmp(launch_type, DOC_LAUNCH_SELECT_ONE)) {
ugd->file_select_mode = DOC_FILE_SELECT_T_ONE;
} else if (!strcasecmp(launch_type, DOC_LAUNCH_SELECT_MULTIPLE)) {
ugd->file_select_mode = DOC_FILE_SELECT_T_MULTIPLE;
ugd->b_multifile = true;
}
_doc_parse_param_file(ugd, service);
} else {
//using default value
doc_dbg("Set launch-type to default");
ugd->b_multifile = false;
}
ugd->max_count = -1;
char *max_cnt = NULL;
app_control_get_extra_data(service, APP_CONTROL_DATA_TOTAL_COUNT,
&max_cnt);
if (max_cnt) {
ugd->max_count = doc_atoi(max_cnt);
DOC_FREE(max_cnt);
}
doc_sdbg("max count: %d", ugd->max_count);
if (!ugd->overlap_mode) {
char *indicator = NULL;
app_control_get_extra_data(service, "indicator-state", &indicator);
if (indicator) {
doc_dbg("indicator: %s", indicator);
if (!strcasecmp(indicator, "hide"))
ugd->b_hide_indicator = true;
DOC_FREE(indicator);
}
}
DOC_FREEIF(operation);
DOC_FREEIF(launch_type);
return 0;
}
static int _doc_get_rotate_value(doc_ugdata * ugd)
{
DOC_CHECK_VAL(ugd, -1);
DOC_CHECK_VAL(ugd->win, -1);
/* changed_ang value is 0 90 180 270 */
int changed_ang = elm_win_rotation_get(ugd->win);
/* Send event to UG */
switch (changed_ang) {
case APP_DEVICE_ORIENTATION_0:
ugd->rotate_mode = DOC_ROTATE_PORTRAIT;
break;
case APP_DEVICE_ORIENTATION_90:
ugd->rotate_mode = DOC_ROTATE_LANDSCAPE_UPSIDEDOWN;
break;
case APP_DEVICE_ORIENTATION_180:
ugd->rotate_mode = DOC_ROTATE_PORTRAIT_UPSIDEDOWN;
break;
case APP_DEVICE_ORIENTATION_270:
ugd->rotate_mode = DOC_ROTATE_LANDSCAPE;
break;
}
return ugd->rotate_mode;
}
/**
* @brief
*
* @param ug
* @param mode
* @param data
* @param priv
*
* @return
*/
static void *_doc_create(ui_gadget_h ug, enum ug_mode mode,
app_control_h service, void *priv)
{
doc_dbg("Enter...");
doc_ugdata *ugd = NULL;
DOC_CHECK_NULL(priv);
DOC_CHECK_NULL(service);
DOC_CHECK_NULL(ug);
doc_dbgW("attach-panel-document begins...");
ugd = (doc_ugdata *) priv;
ugd->ug = ug;
ugd->attach_panel_display_mode = ATTACH_PANEL_NONE;
/* Get window */
ugd->win = (Evas_Object *) ug_get_window();
DOC_CHECK_NULL(ugd->win);
/* Get conformant */
ugd->conform = ug_get_conformant();
DOC_CHECK_NULL(ugd->conform);
/* Get caller layout */
ugd->ly_parent = (Evas_Object *) ug_get_parent_layout(ug);
DOC_CHECK_NULL(ugd->ly_parent);
/* Bind text domain for internalization */
bindtextdomain("attach-panel-document", "/usr/ug/res/locale");
/* Reset inited flag, it would be set as TRUE if list view created */
doc_ui_get_indicator_state(ugd);
#ifdef _USE_HIDE_INDICATOR
doc_ui_hide_indicator(ugd);
#endif
/* Add window rotation callback to rotate view as fast as possible */
evas_object_smart_callback_add(ugd->win, "wm,rotation,changed",
_doc_win_rot_changed_cb, (void *) ugd);
_doc_get_rotate_value(ugd);
app_control_clone(&(ugd->service), service);
/* Connect DB first */
if (doc_data_init(ugd) != 0)
doc_dbgE("doc_data_init failed!");
/*Register db udpate callback */
doc_db_update_reg_cb(ugd);
/* Parse parameters passed from parent */
if (_doc_parse_param(ugd, service) != 0) {
doc_dbgE("Failed to parse parameters!");
ug_send_result_full(ugd->ug, ugd->service,
APP_CONTROL_RESULT_FAILED);
return NULL;
}
char *contact_id = NULL;
app_control_get_extra_data(service, "__CALLER_PANEL__", &contact_id);
if (contact_id && !strcmp(contact_id, "attach-panel")) {
if (ugd)
ugd->is_attach_panel = true;
} else if (ugd) {
ugd->is_attach_panel = false;
}
if(contact_id) {
free(contact_id);
contact_id = NULL;
}
if (ugd->overlap_mode)
ugd->b_hide_indicator = true;
else if (ugd->b_hide_indicator)
doc_ui_hide_indicator(ugd);
else
doc_dbg("Normal mode");
if (ugd->file_select_mode != DOC_FILE_SELECT_T_NONE) {
/* create attach-panel-document UG */
if (_doc_create_view(ugd) != 0) {
doc_dbgE("Failed to create Document view!");
return NULL;
}
} else {
doc_dbgE("Wrong file_select_mode[%d]", ugd->file_select_mode);
}
return ugd->ly_main;
}
/**
* @brief
*
* @param ug
* @param data
* @param priv
*/
static void _doc_start(ui_gadget_h ug, app_control_h service, void *priv)
{
doc_dbg("attach-panel-document start");
}
/**
* @brief
*
* @param ug
* @param data
* @param priv
*/
static void _doc_pause(ui_gadget_h ug, app_control_h service, void *priv)
{
doc_dbg("attach-panel-document paused");
}
/**
* @brief
*
* @param ug
* @param data
* @param priv
*/
static void _doc_resume(ui_gadget_h ug, app_control_h service, void *priv)
{
doc_dbg("attach-panel-document resumed");
DOC_CHECK(priv);
doc_ugdata *ugd = (doc_ugdata *) priv;
/*update */
if (ugd->ug_called_by_me == NULL &&
ugd->file_select_mode != DOC_FILE_SELECT_T_SLIDESHOW) {
doc_update_view(ugd, DOC_UPDATE_NONE);
}
}
/**
* @brief
*
* @param ug
* @param data
* @param priv
*/
static void _doc_destroy(ui_gadget_h ug, app_control_h service, void *priv)
{
doc_dbgW("!! Destroying attach-panel-document !!");
DOC_CHECK(ug);
DOC_CHECK(priv);
_doc_close_view((doc_ugdata *) priv);
doc_dbgW("!! Destroyed attach-panel-document !!");
}
/**
* @brief
*
* @param ug
* @param msg
* @param data
* @param priv
*/
static void _doc_message(ui_gadget_h ug, app_control_h msg,
app_control_h service, void *priv)
{
doc_dbg("");
DOC_CHECK(priv);
doc_ugdata *ugd = (doc_ugdata *) priv;
char *display_mode = NULL;
char *pd_selected = DOC_STR_PD_SELECTED;
char *text = NULL;
Evas_Object *btn = NULL;
int win_x = 0;
int win_y = 0;
int win_w = 0;
int win_h = 0;
elm_win_screen_size_get(ugd->win, &win_x, &win_y, &win_w, &win_h);
if (ugd->is_attach_panel) {
doc_dbg("called by attach panel ");
app_control_get_extra_data(msg, APP_CONTROL_DATA_SELECTION_MODE,
&display_mode);
if (display_mode) {
if (!strcmp(display_mode, "single")) {
doc_dbg("single_selection ");
ugd->attach_panel_display_mode = ATTACH_PANEL_HALF_MODE;
ugd->file_select_mode = DOC_FILE_SELECT_T_ONE;
ugd->b_multifile = false;
doc_list_change_selection_mode(ugd);
ugd->thumbs_d->b_editmode = false;
elm_genlist_realized_items_update(ugd->thumbs_d->genlist);
elm_naviframe_item_title_enabled_set(ugd->nf_it,
EINA_FALSE,
EINA_FALSE);
doc_update_genlist(ugd);
} else if (display_mode && !strcmp(display_mode, "multiple")) {
doc_dbg("multiple_selection");
ugd->attach_panel_display_mode = ATTACH_PANEL_FULL_MODE;
ugd->file_select_mode = DOC_FILE_SELECT_T_MULTIPLE;
ugd->b_multifile = true;
doc_list_change_selection_mode(ugd);
ugd->thumbs_d->b_editmode = true;
elm_genlist_realized_items_update(ugd->thumbs_d->genlist);
ugd->thumbs_d->tot_selected =
eina_list_count(ugd->selected_elist);
/*Update Title */
elm_naviframe_item_title_enabled_set(ugd->nf_it, EINA_TRUE,
EINA_FALSE);
text =
g_strdup_printf(pd_selected,
ugd->thumbs_d->tot_selected);
elm_object_item_text_set(ugd->nf_it, text);
free(text);
text = NULL;
/*Disable DONE Button if count is zero */
if (!ugd->thumbs_d->tot_selected) {
btn =
elm_object_item_part_content_get(ugd->nf_it,
DOC_NAVIFRAME_TITLE_RIGHT_BTN);
if (btn == NULL)
doc_dbgE("Failed to get part information");
elm_object_disabled_set(btn, EINA_TRUE);
}
} else {
doc_dbg("invalid mode: %s", display_mode);
}
free(display_mode);
display_mode = NULL;
}
}
}
/**
* @brief
*
* @param ug
* @param event
* @param data
* @param priv
*/
static void _doc_event(ui_gadget_h ug, enum ug_event event,
app_control_h service, void *priv)
{
DOC_CHECK(priv);
doc_ugdata *ugd = (doc_ugdata *) priv;
switch (event) {
case UG_EVENT_LOW_MEMORY:
doc_dbg("UG_EVENT_LOW_MEMORY");
break;
case UG_EVENT_LOW_BATTERY:
doc_dbg("UG_EVENT_LOW_BATTERY");
break;
case UG_EVENT_LANG_CHANGE:
doc_dbg("UG_EVENT_LANG_CHANGE");
doc_list_lang_update(ugd);
break;
case UG_EVENT_ROTATE_PORTRAIT:
doc_dbg("UG_EVENT_ROTATE_PORTRAIT");
goto UG_ROTATE_EVENT;
break;
case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
doc_dbg("UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN");
goto UG_ROTATE_EVENT;
break;
case UG_EVENT_ROTATE_LANDSCAPE:
doc_dbg("UG_EVENT_ROTATE_LANDSCAPE");
goto UG_ROTATE_EVENT;
break;
case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
doc_dbg("UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN");
goto UG_ROTATE_EVENT;
break;
default:
break;
}
return;
UG_ROTATE_EVENT:
/* Update rotate mode and view */
doc_dbg("rotate_mode: %d", ugd->rotate_mode);
int win_x = 0;
int win_y = 0;
int win_w = 0;
int win_h = 0;
elm_win_screen_size_get(ugd->win, &win_x, &win_y, &win_w, &win_h);
}
/**
* @brief
*
* @param ops
*f
* @return
*/
UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
{
doc_dbgW("UG_MODULE_INIT");
doc_ugdata *ugd = NULL;
DOC_CHECK_VAL(ops, -1);
ugd = calloc(1, sizeof(doc_ugdata));
DOC_CHECK_VAL(ugd, -1);
ops->create = _doc_create;
ops->start = _doc_start;
ops->pause = _doc_pause;
ops->resume = _doc_resume;
ops->destroy = _doc_destroy;
ops->message = _doc_message;
ops->event = _doc_event;
ops->priv = ugd;
ops->opt = UG_OPT_INDICATOR_ENABLE;
return 0;
}
/**
* @brief
*
* @param ops
*
* @return
*/
UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
{
DOC_CHECK(ops);
DOC_FREEIF(ops->priv);
doc_dbgW("UG_MODULE_EXIT");
}
|