gui_clock.h
10.2 KB
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
/*******************************************************************************
* Modification Notice:
* --------------------------
* This software is modified by MediaTek Inc. and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*******************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* gui_clock.h
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* clock related funtions
*
* Author:
* -------
* -------
*
*------------------------------------------------------------------------------
* $Log$
*
* 10 21 2013 lu.xiao
* removed!
* .
*
* 03 28 2011 helena.li
* removed!
* .
*
* 02 08 2011 ray.wu
* removed!
* .
*
* 02 08 2011 mason.chang
* removed!
* Rename/move file(s)
*
* 01 07 2011 helena.li
* removed!
* .
*
* 12 14 2010 helena.li
* removed!
* .
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
*
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================
*******************************************************************************/
/*
* This file contains internal UI component API, and is intended to be used by category screen module only.
* It's not recommended to be included in application code directly.
* For application developers, please include category screen header files instead (e.g., wgui_categories.h).
*/
#include "MMI_features.h"
#include "MMIDataType.h"
#include "gdi_const.h"
#include "gdi_datatype.h"
#include "gui_data_types.h"
#include "gui_theme_struct.h"
#include "App_datetime.h"
#include "gui_typedef.h"
#ifndef __GUI_CLOCK_H__
#define __GUI_CLOCK_H__
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#ifdef __MMI_ANALOG_CLOCK__
#define GUI_CLOCK_SUB_ANALOG_CLOCK_HOURS_HAND_LENGTH (SUB_LCD_DEVICE_WIDTH/4)
#define GUI_CLOCK_SUB_ANALOG_CLOCK_MINUTES_HAND_LENGTH (SUB_ANALOG_CLOCK_HOURS_HAND_LENGTH+4)
#define GUI_CLOCK_SUB_ANALOG_CLOCK_SECONDS_HAND_LENGTH (SUB_ANALOG_CLOCK_HOURS_HAND_LENGTH+6)
#define GUI_CLOCK_SUB_ANALOG_CLOCK_DIAL_WIDTH SUB_LCD_DEVICE_WIDTH
#define GUI_CLOCK_SUB_ANALOG_CLOCK_DIAL_HEIGHT SUB_LCD_DEVICE_HEIGHT
#define GUI_CLOCK_AXIS_RADIUS 2
#endif
/* <group dom_clock_macro>
* if digital clock use image, gap of every image is 1 pixel */
#ifndef __COSMOS_MMI__
#define GUI_CLOCK_DIGITAL_CLOCK_IMAGE_GAP 1
#else
#define GUI_CLOCK_DIGITAL_CLOCK_IMAGE_GAP 0
#endif
/* <group dom_clock_macro>
* total five images, 00:00 */
#define GUI_CLOCK_DIGITAL_CLOCK_NUMBER_COUNT 4
#ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
/* <group dom_clock_variables>
* analog's left top in sub lcd*/
extern S32 g_gui_clock_sub_lcd_analog_clock_dial_x;
extern S32 g_gui_clock_sub_lcd_analog_clock_dial_y;
/* <group dom_clock_variables>
* analog's center coordinate in sub lcd*/
extern S32 g_gui_clock_sub_lcd_analog_clock_center_x;
/* <group dom_clock_variables> */
extern S32 g_gui_clock_sub_lcd_analog_clock_center_y;
#endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
/* <group dom_clock_struct> */
typedef struct
{
S32 x,y;
S32 width,height;
void (*hide_callback) (S32 x1, S32 y1, S32 x2, S32 y2);/*hide function*/
GDI_HANDLE target_layer; /*target layer to display*/
GDI_HANDLE abm_layer; /* alpha blending layer of clock */
GDI_HANDLE target_lcd; /*target lcd to display*/
applib_time_struct diff; /*record the difference between set-time and phone-time*/
S32 time_compare; /*difference between set-time and cur-time*/
UI_font_type date_text_font; /*font of date text*/
UI_font_type time_text_font; /*font of time text*/
color date_text_color; /*color of date text*/
color date_text_border_color;/*border color of date text*/
color time_text_color; /*color of time text*/
color time_text_border_color;/*border color of time text*/
#ifdef __MMI_ANALOG_CLOCK__
color analog_hand_hour_color; /*color of hour hand*/
color analog_hand_min_color; /*color of minute hand*/
color analog_axis_color; /*color of axis (not used)*/
#endif
S32 gap_between_two_lines; /*gap between date text and time text*/
S32 gap_between_time_date_one_line; /*gap between time and date in one line*/
MMI_BOOL border_enable;
MMI_BOOL on_idle;
MMI_BOOL enable_update;
MMI_BOOL active; /*clock is active or not*/
/*close callback function, when clock is closed by other app, it will call this function */
void (*close_callback) (void);
/* post display callback function, it will be called when clock finish display */
void (*post_display_callback) (S32 x1, S32 y1, S32 x2, S32 y2);
gui_clock_type_enum type; /*clock type*/
gui_clock_digital_align_enum align_type; /* align type */
} gui_clock_struct;
extern UI_clock_theme *current_clock_theme;
extern void gui_clock_create(gui_clock_struct *c, S32 x, S32 y, S32 width, S32 height, gui_clock_type_enum clock_type);
extern void gui_clock_close(gui_clock_struct *c);
extern void gui_clock_show(gui_clock_struct *c);
extern MMI_BOOL gui_clock_update(gui_clock_struct *c);
extern void gui_clock_move(gui_clock_struct *c, S32 x, S32 y);
extern void gui_clock_resize(gui_clock_struct *c, S32 width, S32 height);
extern void gui_clock_set_time(gui_clock_struct *c, applib_time_struct newtime);
extern void gui_clock_get_time(gui_clock_struct *c, applib_time_struct *time);
extern void gui_clock_set_hide_function(gui_clock_struct *c, void (*f) (S32 x1, S32 y1, S32 x2, S32 y2));
extern void gui_clock_set_close_callback (gui_clock_struct *c, FuncPtr f);
extern void gui_clock_set_post_display_callback(
gui_clock_struct *c,
void (*f) (S32 x1, S32 y1, S32 x2, S32 y2));
extern void gui_clock_set_theme(gui_clock_struct *c, UI_clock_theme *t);
extern void gui_clock_set_current_theme(gui_clock_struct *c);
#ifdef __MMI_ANALOG_CLOCK__
extern void gui_clock_set_analog_clock_hour_hand_color(gui_clock_struct *c, color new_color);
extern void gui_clock_set_analog_clock_min_hand_color(gui_clock_struct *c, color new_color);
#endif
extern void gui_clock_set_date_text_font(gui_clock_struct *c, UI_font_type new_font);
extern void gui_clock_set_date_text_color(gui_clock_struct *c, color new_color);
extern void gui_clock_set_date_text_border_color(gui_clock_struct *c, color new_color);
extern void gui_clock_set_time_text_font(gui_clock_struct *c, UI_font_type new_font);
extern void gui_clock_set_time_text_color(gui_clock_struct *c, color new_color);
extern void gui_clock_set_time_text_border_color (gui_clock_struct *c, color new_color);
extern void gui_clock_enable_update(gui_clock_struct *c, MMI_BOOL enable_update);
extern void gui_clock_set_gap_between_two_lines(gui_clock_struct *c, S32 new_gap);
extern void gui_clock_measure_time_text(gui_clock_struct *c, S32 *w, S32 *h, UI_font_type font);
extern void gui_clock_measure_date_text(gui_clock_struct *c, S32 *w, S32 *h, UI_font_type font);
extern void gui_clock_set_text_border_enable(gui_clock_struct *c, MMI_BOOL enable);
extern void gui_clock_set_on_idle(gui_clock_struct *c, MMI_BOOL on_idle);
extern void gui_clock_set_target_layer(gui_clock_struct *c, GDI_HANDLE target_layer);
extern void gui_clock_set_abm_layer(gui_clock_struct *c, GDI_HANDLE abm_layer);
extern void gdi_draw_antialiasing_line(S32 x1, S32 y1, S32 x2, S32 y2, gdi_color line_color);
extern void gui_clock_set_digital_align_type(gui_clock_struct *c, gui_clock_digital_align_enum type);
extern void gui_clock_measure_digital_clock(gui_clock_struct *c, S32 *w, S32 *h);
extern void gui_clock_measure_digital_small_clock(gui_clock_struct *c, S32 *w, S32 *h);
#endif /* __GUI_CLOCK_H__ */