gui_image.h
8.97 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
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright 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_image.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* Public Header
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* 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!!
*============================================================================
****************************************************************************/
#ifndef __GUI_IMAGE_H__
#define __GUI_IMAGE_H__
/*****************************************************************************
* include
****************************************************************************/
#include "MMIDataType.h"
#include "gdi_const.h"
#include "gdi_datatype.h"
#include "gdi_include.h"
#include "Gui_Setting.h"
#include "gui_typedef.h"
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
* Define
****************************************************************************/
#define MMI_IMAGE_COMPONENT_BUF_SIZE ((MAIN_LCD_DEVICE_HEIGHT * MAIN_LCD_DEVICE_WIDTH * GDI_MAINLCD_BIT_PER_PIXEL)>>3)
#define GUI_IMAGE_ANIM_RESUME_DISABLE 0xffffffff
/*****************************************************************************
* Typedef
****************************************************************************/
typedef struct
{
gui_image_align_enum image_h_align_type;
gui_image_align_enum image_v_align_type;
/* position and dimension of image component */
S32 x, y;
S32 width, height;
/* logic position of the image */
S32 image_display_x, image_display_y;
/* the display dimension of the image, it will changed when some attribute
* be set, such as enable_stretch
*/
S32 image_display_width, image_display_height;
/* the dimension of image, it is read from image data */
S32 image_width, image_height;
/* some attribute of image component */
U32 flags;
/* the handle of image's target layer */
GDI_HANDLE target_layer;
/* the handle get from show anim APIs, which will be used when stop anim */
GDI_HANDLE image_handle;
/* buffer that record image data */
PU8 image_buffer;
U32 buffer_size;
/* memory pointer, the memory used for save anim's N frame's content */
PU8 anim_layer_ptr;
gdi_handle anim_layer_handle;
/* hide func of the image */
void (*hide_callback) (S32 x1, S32 y1, S32 x2, S32 y2);
/* the start frame of the anim */
U32 start_frame;
/* pause frame of the anim */
U32 pause_frame;
/* count of the anim */
S32 frame_count;
/* image is from file or resource or memory */
gdi_image_src_enum image_scr;
/* image type, for GDI */
U16 image_type;
/* whether this component is in using */
MMI_BOOL active;
/* whether to stretch image to fill image component */
MMI_BOOL enable_stretch;
/* the handle of paused anim */
GDI_HANDLE paused_handle;
/* whether to show an anim in non blocking */
MMI_BOOL is_non_blocking;
} gui_image_struct;
/*****************************************************************************
* Global Function
****************************************************************************/
extern GDI_RESULT gui_image_create_from_file(
gui_image_struct *image,
S32 x,
S32 y,
S32 width,
S32 height,
const PU8 file_name,
U32 flags,
gdi_handle target_layer);
extern GDI_RESULT gui_image_create_from_res(
gui_image_struct *image,
S32 x,
S32 y,
S32 width,
S32 height,
const PU8 image_res,
U32 flags,
gdi_handle target_layer);
extern GDI_RESULT gui_image_create_from_mem(
gui_image_struct *image,
S32 x,
S32 y,
S32 width,
S32 height,
U32 image_type,
const PU8 image_data,
U32 flags,
gdi_handle target_layer);
extern void gui_image_close(gui_image_struct *image);
extern void gui_image_move(gui_image_struct *image, S32 x, S32 y);
extern void gui_image_resize(gui_image_struct *image, S32 width, S32 height);
extern GDI_RESULT gui_image_show(gui_image_struct *image);
extern void gui_image_pause(gui_image_struct *image);
extern GDI_RESULT gui_image_resume(gui_image_struct *image);
extern GDI_RESULT gui_image_set_image_from_file(
gui_image_struct *image,
const PU8 file_name);
extern GDI_RESULT gui_image_set_image_from_res(
gui_image_struct *image,
const PU8 image_res);
extern GDI_RESULT gui_image_set_image_from_mem(
gui_image_struct *image,
U32 image_type,
const PU8 image_data);
extern void gui_image_register_hide_function(
gui_image_struct *image,
void (*f) (S32 x1, S32 y1, S32 x2, S32 y2));
extern void gui_image_set_layer(gui_image_struct *image, gdi_handle target_layer);
extern void gui_image_set_anim_start_frame(gui_image_struct *image, U32 start_frame);
extern void gui_image_set_stretch_enable(
gui_image_struct *image,
MMI_BOOL enable_stretch);
extern void gui_image_set_align(
gui_image_struct *image,
gui_image_align_enum image_h_align_type,
gui_image_align_enum image_v_align_type);
extern void gui_image_get_layer(gui_image_struct *image, gdi_handle *target_layer);
extern void gui_image_get_position(gui_image_struct *image, S32 *x, S32 *y);
extern void gui_image_get_dimension(
gui_image_struct *image,
S32 *width,
S32 *height,
S32 *display_width,
S32 *display_height);
extern void gui_image_get_anim_start_frame(gui_image_struct *image, U32 *start_frame);
extern GDI_RESULT gui_image_show_nb(
gui_image_struct *image,
void (*decode_done_callback)(GDI_RESULT result, GDI_HANDLE handle));
extern GDI_RESULT gui_image_stop_nb_show(gui_image_struct *image);
/* DOM-NOT_FOR_SDK-END */
#endif /* __GUI_IMAGE_H__ */