mrp_pal.c
5.96 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
#ifdef __MMI_DSM_NEW__
#include "MMI_include.h"
#include "mrp_include.h"
//status icons
#if (MTK_VERSION >= 0x09b0952)
#include "gui_status_icon.h"
extern gui_status_icon_bar_icon_struct wgui_status_icon_bar_icons[];
extern gui_status_icon_bar_struct wgui_status_icon_bar_bars[];
#else
#include "wgui_status_icons.h"
extern MMI_status_icon MMI_status_icons[];
extern MMI_status_icon_bar MMI_status_icon_bars[];
#define TEST_STATUS_ICON_DISPLAY_ON(flags) (flags & (STATUS_ICON_ANIMATE|STATUS_ICON_REVERSE_ANIMATE|STATUS_ICON_FORWARD_ANIMATE|STATUS_ICON_BLINK|STATUS_ICON_DISABLED|STATUS_ICON_DISPLAY))
#endif
#ifdef __MMI_UCM__
#include "ucmgprot.h"
#endif
#include "Wgui_categories_util.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
MR_BOOL mr_pal_is_in_call(void)
{
#if (MTK_VERSION>=0x09B0952)
if(srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_ALL, NULL))
return MR_TRUE;
else
return MR_FALSE;
#else
return isInCall();
#endif
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//memory
void* mr_pal_mem_malloc(uint32 size )
{
return OslMalloc(size);
}
void mr_pal_mem_free(void* ptr)
{
OslMfree(ptr);
}
void mr_pal_mem_scrmem_free(void *mem_ptr)
{
// return;//huangsunbo 20111121 MTK 6252 52C 8M内存扩展内存问题,可以暂时用这个方法修改。
#ifdef __ARM9_MMU__
mmi_frm_scrmem_free(mem_ptr);
#else
mmi_frm_scrmem_free(mem_ptr);
#endif
}
void *mr_pal_mem_scrmem_alloc(U32 mem_size)
{
// return NULL;//huangsunbo 20111121 MTK 6252 52C 8M内存扩展内存问题,可以暂时用这个方法修改。
#ifdef __ARM9_MMU__
return mmi_frm_scrmem_alloc_framebuffer(mem_size);
#else
return mmi_frm_scrmem_alloc(mem_size);
#endif
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//status icon
void mr_pal_status_icon_hide_status_icon(int16 icon_id)
{
HideStatusIcon(icon_id);
}
void mr_pal_status_icon_show_status_icon(int16 icon_id)
{
ShowStatusIcon(icon_id);
}
void mr_pal_status_icon_blink_status_icon(int16 icon_id)
{
BlinkStatusIcon(icon_id);
}
void mr_pal_status_icon_update_status_icons(void)
{
UpdateStatusIcons();
}
void mr_pal_register_status_icon_pen_event_hdlr(int16 icon_id, void (* f)(void))
{
#ifdef __MMI_TOUCH_SCREEN__
#if (MTK_VERSION>=0x09B0952)
wgui_status_icon_bar_register_pen_event_handler(icon_id, WGUI_STATUS_ICON_BAR_PEN_SELECT_ICON, f);
#elif (MTK_VERSION >= 0x06b)
wgui_register_status_icon_pen_event_hdlr(icon_id, WGUI_STATUS_ICON_BAR_PEN_SELECT_ICON, f);
#else
mmi_wgui_register_status_icon_pen_event_hdlr(icon_id, WGUI_STATUS_ICON_BAR_PEN_SELECT_ICON, f);
#endif
#endif
}
MR_BOOL mr_pal_status_icon_whether_icon_display(int16 icon_id)
{
#if(MTK_VERSION >= 0x09B0952)
return gui_status_icon_bar_whether_icon_display(&wgui_status_icon_bar_icons[icon_id]);
#else
if(TEST_STATUS_ICON_DISPLAY_ON(get_status_icon_flag(icon_id)))
return MR_TRUE;
return MR_FALSE;
#endif
}
void mr_pal_status_icon_get_position(int16 icon_id, int32 * x, int32 * y, int32 * w, int32 * h)
{
#if(MTK_VERSION >= 0x09B0952)
*x = wgui_status_icon_bar_icons[icon_id].x;
*y = wgui_status_icon_bar_icons[icon_id].y;
*w = wgui_status_icon_bar_icons[icon_id].width;
*h = wgui_status_icon_bar_icons[icon_id].height;
#else
*x = MMI_status_icons[icon_id].x;
*y = MMI_status_icons[icon_id].y;
*w = MMI_status_icons[icon_id].width;
*h = MMI_status_icons[icon_id].height;
#endif
//mr_trace("mr_pal_status_icon_get_position: %d, %d, %d, %d, %d, %d", icon_id, mr_pal_status_icon_whether_icon_display(icon_id), *x, *y, *w, *h);
}
void mr_pal_status_icon_bar_get_position(int32 * x, int32 * y, int32 * w, int32 * h)
{
#if (MTK_VERSION >= 0x09b0952)
*x = wgui_status_icon_bar_bars[WGUI_STATUS_ICON_BAR_H_BAR].x;
*y = wgui_status_icon_bar_bars[WGUI_STATUS_ICON_BAR_H_BAR].y;
*w = wgui_status_icon_bar_bars[WGUI_STATUS_ICON_BAR_H_BAR].width;
*h = wgui_status_icon_bar_bars[WGUI_STATUS_ICON_BAR_H_BAR].height;
#else
*x = MMI_status_icon_bars[0].x1;
*y = MMI_status_icon_bars[0].y1;
*w = MMI_status_icon_bars[0].x2 - MMI_status_icon_bars[0].x1;
*h = MMI_status_icon_bars[0].y2 - MMI_status_icon_bars[0].y1;
#endif
}
void mr_pal_pen_register_handler(mmi_pen_hdlr pen_tbl[])
{
#ifdef __MMI_TOUCH_SCREEN__
mmi_pen_register_down_handler(pen_tbl[MR_PEN_EVENT_DOWN]);
#ifndef __MR_CFG_FEATURE_SLIM__
mmi_pen_register_move_handler(pen_tbl[MR_PEN_EVENT_MOVE]);
mmi_pen_register_up_handler(pen_tbl[MR_PEN_EVENT_UP]);
mmi_pen_register_long_tap_handler(pen_tbl[MR_PEN_EVENT_LONG_TAP]);
mmi_pen_register_repeat_handler(pen_tbl[MR_PEN_EVENT_REPEAT]);
mmi_pen_register_abort_handler(pen_tbl[MR_PEN_EVENT_ABORT]);
mmi_pen_register_double_click_handler(pen_tbl[MR_PEN_EVENT_DOUBLE_CLICK]);
#endif
#endif
}
void mr_pal_pen_get_handler(mmi_pen_hdlr pen_tbl[])
{
#ifdef __MMI_TOUCH_SCREEN__
pen_tbl[MR_PEN_EVENT_DOWN] = mmi_pen_get_pen_handler(MMI_PEN_EVENT_DOWN);
#ifndef __MR_CFG_FEATURE_SLIM__
pen_tbl[MR_PEN_EVENT_MOVE] = mmi_pen_get_pen_handler(MMI_PEN_EVENT_MOVE);
pen_tbl[MR_PEN_EVENT_UP] = mmi_pen_get_pen_handler(MMI_PEN_EVENT_UP);
pen_tbl[MR_PEN_EVENT_LONG_TAP] = mmi_pen_get_pen_handler(MMI_PEN_EVENT_LONG_TAP);
pen_tbl[MR_PEN_EVENT_REPEAT] = mmi_pen_get_pen_handler(MMI_PEN_EVENT_REPEAT);
pen_tbl[MR_PEN_EVENT_ABORT] = mmi_pen_get_pen_handler(MMI_PEN_EVENT_ABORT);
pen_tbl[MR_PEN_EVENT_DOUBLE_CLICK] = mmi_pen_get_pen_handler(MMI_PEN_EVENT_DOUBLE_CLICK);
#endif
#endif
}
int32 mr_pal_status_icon_get_gprs_status_icon(int16** status_icons)
{
#if 0
static const int16 gprs_status_icons [] = {
STATUS_ICON_GPRS_ATT_NO_PDP_INDICATOR,
STATUS_ICON_GPRS_SERVICE,
STATUS_ICON_EDGEC,
STATUS_ICON_EDGE,
#ifdef __MMI_DUAL_SIM_MASTER__
STATUS_ICON_SLAVE_EDGE,
STATUS_ICON_SLAVE_GPRS_SERVICE,
STATUS_ICON_SLAVE_EDGEC,
STATUS_ICON_SLAVE_GPRS_ATT_NO_PDP_INDICATOR
#endif
};
if(status_icons) *status_icons = (int16*)gprs_status_icons;
return sizeof(gprs_status_icons)/sizeof(gprs_status_icons[0]);
#else
return 0;
#endif
}
#endif