📄 lcdsetting.c
字号:
//#include "Calculator.h"
//#include "CalculatorResDef.h"
#include "GlobalConstants.h"
#include "SettingDefs.h"
#include "wgui_inline_edit.h"
#include "GlobalDefs.h"
#include "MainMenuDef.h"
#include "custom_mmi_default_value.h"
#include "SettingProfile.h"
#include "NVRAMType.h"
#include "CommonScreens.h"
#include "lcdsetting.h"
#include "PhoneSetup.h"
#include "NVRAMProt.h"
#include "lcdsetting.h"
#include "PhnsetGPIO.h"
#include "SettingResDef.h"
S32 lcd_x=0;
S32 LCD_SCR_MOVE_X=0;
PU8 lcd_bg_image;
#define MAX_LCD_CEL_COLORS 7
#define MAX_LCD_ROW_COLORS 7
static S32 LCDColorIndex;
//gdi_color bg_color = gdi_act_color_from_rgb(255,30, 150, 30);
extern wgui_inline_item wgui_inline_items[MAX_INLINE_ITEMS];
extern void HighlightPhnsetBackLiteHFTime(S32 index);
extern void HighlightPhnsetBackLiteLevel(S32 index);
static const color g_lcd_color_list[MAX_LCD_CEL_COLORS][MAX_LCD_ROW_COLORS] =
{
{
{127,0,0},{111,0,0},{95,0,0},{79,0,0},{63,0,0},{47,0,0},{31,0,0},
},
{
{127,0,127},{111,0,127},{95,0,127},{79,0,127},{63,0,127},{47,0,127},{31,0,127},
},
{
{0x7F,0x40,0x7F},{0x6F,0x40,0x7F},{0x5F,0x40,0x7F},{0x4F,0x40,0x7F},{0x3F,0x40,0x7F},{0x2F,0x40,0x7F},{0x1F,0x40,0x7F},
},
{
{0x7F,0x7F,0x7F},{0x6F,0x7F,0x7F},{0x5F,0x7F,0x7F},{0x4F,0x7F,0x7F},{0x3F,0x7F,0x7F},{0x2F,0x7F,0x7F},{0x1F,0x7F,0x7F},
},
{
{0x7F,0x7F,0x40},{0x6F,0x7F,0x40},{0x5F,0x7F,0x40},{0x4F,0x7F,0x40},{0x3F,0x7F,0x40},{0x2F,0x7F,0x40},{0x1F,0x7F,0x40},
},
{
{0x7F,0x7F,0x00},{0x6F,0x7F,0x00},{0x5F,0x7F,0x00},{0x4F,0x7F,0x00},{0x3F,0x7F,0x00},{0x2F,0x7F,0x00},{0x1F,0x7F,0x00},
},
{
{0x7F,0x40,0x40},{0x6F,0x40,0x40},{0x5F,0x40,0x40},{0x4F,0x40,0x40},{0x3F,0x40,0x40},{0x2F,0x40,0x40},{0x1F,0x40,0x40},
},
};
void EntryLCDSetScr (void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
U16 nNumofItem; /* Stores no of children in the submenu */
U16 nDispAttribute; /* Stores display attribue */
U8 *guiBuffer; /* Buffer holding history data */
U8 *ItemType[MAX_SUB_MENUS];
EntryNewScreen(SCR_LCD_SETTING, NULL, EntryLCDSetScr, NULL);
/* Get current screen to gui buffer for history purposes */
guiBuffer=GetCurrGuiBuffer(SCR_LCD_SETTING);
/* Retrieve no of child of menu item to be displayed */
nNumofItem = GetNumOfChild_Ext(MENU_LCD_SETTING);
nDispAttribute = GetDispAttributeOfItem(MENU_LCD_SETTING);
/* Retrieve string ids in sequence of given menu item to be displayed */
GetSequenceStringIds_Ext(MENU_LCD_SETTING, nStrItemList);
/* Set current parent id */
SetParentHandler(MENU_LCD_SETTING);
RegisterHighlightHandler(ExecuteCurrHiliteHandler);
ConstructHintsList(MENU_LCD_SETTING, ItemType);
/* Display Category Screen */
ShowCategory52Screen(
STR_LCD_SETTING,
MAIN_MENU_TITLE_SETTINGS_ICON,
STR_GLOBAL_OK,
IMG_GLOBAL_OK,
STR_GLOBAL_BACK,
IMG_GLOBAL_BACK,
nNumofItem,
nStrItemList,
(PU16) gIndexIconsImageList,
ItemType,
0,
0,
guiBuffer);
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
}
void HighlightLCDSet (void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* 1 Change left soft key icon and label */
ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
/* 2 Change right soft key icon and label */
ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
/* 3 Register function for left soft key */
SetLeftSoftkeyFunction(EntryLCDSetScr, KEY_EVENT_UP);
SetKeyHandler(EntryLCDSetScr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
/* 4 Register function for right soft key */
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}
void HighlightLCDSingle (void )
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
SetLeftSoftkeyFunction(EntryLCDSingleSet, KEY_EVENT_UP);
SetKeyHandler(EntryLCDSingleSet, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
}
void EntryLCDSingleSet (void)
{
U8 *guiBuffer, /**BLHFTime = NULL, *BLLevel = NULL,*/ *LCDR=NULL, *LCDG=NULL , *LCDB=NULL;
S32 lower_limit[3];
S32 upper_limit[3];
S32 *current_value[3];
void (*cb_func[3]) (S32 value);
U8 *str_list[3];
EntryNewScreen(SCR_LCD_SINGLESET, ExitLCDSingleSet, EntryLCDSingleSet, NULL);
/* Get current screen to gui buffer for history purposes */
guiBuffer = GetCurrGuiBuffer(SCR_LCD_SINGLESET);
LCDR=(U8*) GetString(STR_R);
LCDG=(U8*) GetString(STR_G);
LCDB=(U8*) GetString(STR_B);
/* Set current parent id */
SetParentHandler(MENU_LCD_SINGLE_SETTING);
lower_limit[0] =200;
upper_limit[0] =255;
current_value[0] = &(g_phnset_gpio_cntx_p->lcd_setting_r);
cb_func[0] = HighlightPhnsetBackLiteLevel;
str_list[0] = LCDR;
lower_limit[1] = 200;
upper_limit[1] = 255;
current_value[1] = (S32 *)&(g_phnset_gpio_cntx_p->lcd_setting_g);
cb_func[1] = HighlightPhnsetBackLiteHFTime;
str_list[1] = LCDG;
lower_limit[2] = 200;
upper_limit[2] = 250;
current_value[2] = (S32 *)&(g_phnset_gpio_cntx_p->lcd_setting_b);
cb_func[2] = HighlightPhnsetBackLiteHFTime;
str_list[2] = LCDB;
ShowCategory88Screen(
STR_LCD_SETTING1,
MAIN_MENU_TITLE_SETTINGS_ICON,
STR_GLOBAL_OK,
0,
STR_GLOBAL_BACK,
0,
0,
// 2,
3,
str_list,
lower_limit,
upper_limit,
current_value,
cb_func,
guiBuffer);
/* Register function with right softkey */
SetKeyHandler(LCDSingleSetEndHdlr, KEY_END, KEY_EVENT_DOWN);
SetLeftSoftkeyFunction(LCDSingleSetLSKHdlr, KEY_EVENT_UP);
SetRightSoftkeyFunction(LCDSingleSetRSKHdlr, KEY_EVENT_UP);
}
void ExitLCDSingleSet (void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S16 error;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ReadValue(NVRAM_LCD_SINGLE_SETR, &(g_phnset_gpio_cntx_p->lcd_setting_r), DS_BYTE, &error);
ReadValue(NVRAM_LCD_SINGLE_SETG, &(g_phnset_gpio_cntx_p->lcd_setting_g), DS_BYTE, &error);
ReadValue(NVRAM_LCD_SINGLE_SETB, &(g_phnset_gpio_cntx_p->lcd_setting_b), DS_BYTE, &error);
// ReadValue(NVRAM_BYTE_BL_SETTING_LEVEL, &(g_phnset_gpio_cntx_p->bl_setting_level), DS_BYTE, &error);
// SetGPIOLevelReq(GPIO_DEV_LED_MAINLCD, LED_LIGHT_LEVEL5);
//ReadValue(NVRAM_BYTE_BL_SETTING_HFTIME, &(g_phnset_gpio_cntx_p->bl_setting_hftime), DS_BYTE, &error);
}
void LCDSingleSetEndHdlr (void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S16 error;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ReadValue(NVRAM_LCD_SINGLE_SETR, &(g_phnset_gpio_cntx_p->lcd_setting_r), DS_BYTE, &error);
ReadValue(NVRAM_LCD_SINGLE_SETG, &(g_phnset_gpio_cntx_p->lcd_setting_g), DS_BYTE, &error);
ReadValue(NVRAM_LCD_SINGLE_SETB, &(g_phnset_gpio_cntx_p->lcd_setting_b), DS_BYTE, &error);
//ReadValue(NVRAM_BYTE_BL_SETTING_LEVEL, &(g_phnset_gpio_cntx_p->bl_setting_level), DS_BYTE, &error);
// SetGPIOLevelReq(GPIO_DEV_LED_MAINLCD, LED_LIGHT_LEVEL5);
// ReadValue(NVRAM_BYTE_BL_SETTING_HFTIME, &(g_phnset_gpio_cntx_p->bl_setting_hftime), DS_BYTE, &error);
DisplayIdleScreen();
}
void LCDSingleSetLSKHdlr (void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S16 error;
U8 data;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ReadValue(NVRAM_LCD_SINGLE_SETR, &data, DS_BYTE, &error);
if (data != g_phnset_gpio_cntx_p->lcd_setting_r)
{
WriteValue(NVRAM_LCD_SINGLE_SETR, &(g_phnset_gpio_cntx_p->lcd_setting_r), DS_BYTE, &error);
}
ReadValue(NVRAM_LCD_SINGLE_SETG, &data, DS_BYTE, &error);
if (data != g_phnset_gpio_cntx_p->lcd_setting_g)
{
WriteValue(NVRAM_LCD_SINGLE_SETG, &(g_phnset_gpio_cntx_p->lcd_setting_g), DS_BYTE, &error);
}
ReadValue(NVRAM_LCD_SINGLE_SETB, &data, DS_BYTE, &error);
if (data != g_phnset_gpio_cntx_p->lcd_setting_b)
{
WriteValue(NVRAM_LCD_SINGLE_SETB, &(g_phnset_gpio_cntx_p->lcd_setting_b), DS_BYTE, &error);
}
DisplayPopup(
(U8*) GetString(STR_GLOBAL_DONE),
IMG_GLOBAL_ACTIVATED,
1,
UI_POPUP_NOTIFYDURATION_TIME,
(U8) SUCCESS_TONE);
DeleteScreenIfPresent(SCR_LCD_SINGLESET);
}
void LCDSingleSetRSKHdlr (void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S16 error;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ReadValue(NVRAM_LCD_SINGLE_SETR, &g_phnset_gpio_cntx_p->lcd_setting_r, DS_BYTE, &error);
ReadValue(NVRAM_LCD_SINGLE_SETG, &g_phnset_gpio_cntx_p->lcd_setting_g, DS_BYTE, &error);
ReadValue(NVRAM_LCD_SINGLE_SETB, &g_phnset_gpio_cntx_p->lcd_setting_b, DS_BYTE, &error);
GoBackHistory();
}
void EntryLCDSet (void)
{
S16 item_offset = 0;
U8 *guiBuffer = NULL;
int i;
EntryNewScreen(SCR_LCD_USERSET,/* ExitLCDSet,*/ NULL, EntryLCDSet,NULL);
entry_full_screen();
clear_screen();
guiBuffer = GetCurrGuiBuffer(SCR_LCD_USERSET);
show_title_status_icon(); //状态栏
ChangeTitleString((U8*) get_string(STR_LCD_SETTING2));//标题
ChangeTitleIcon(GetRootTitleIcon(MENU_LCD_USER_SETTING));//父目录
draw_title();
// lcd_bg_image=(PU8)GetImage(IMG_LCD_BG);
// gui_show_image(0, 0, lcd_bg_image);
//显示背景图片
show_LCD_screen(
TOUCH_LCD_SCREEN_X,
TOUCH_LCD_SCREEN_Y,
TOUCH_LCD_SCREEN_WIDTH,
TOUCH_LCD_SCREEN_HEIGHT);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -