wgui_categories_imps.c

来自「The font library converting tool MCT mai」· C语言 代码 · 共 1,967 行 · 第 1/5 页

C
1,967
字号
#define CAT425_TEXT1_COLOR_B						72

#define CAT425_TEXT2_COLOR_R						48
#define CAT425_TEXT2_COLOR_G						88
#define CAT425_TEXT2_COLOR_B						120

#define CAT425_TEXT1_HIGHLIGHT_COLOR_R				255
#define CAT425_TEXT1_HIGHLIGHT_COLOR_G				255
#define CAT425_TEXT1_HIGHLIGHT_COLOR_B				255

#define CAT425_TEXT2_HIGHLIGHT_COLOR_R				255
#define CAT425_TEXT2_HIGHLIGHT_COLOR_G				255
#define CAT425_TEXT2_HIGHLIGHT_COLOR_B				106

#define CAT425_TEXT2_BRACKET_COLOR_R			56
#define CAT425_TEXT2_BRACKET_COLOR_G			112
#define CAT425_TEXT2_BRACKET_COLOR_B			200

#define CAT425_LINE_COLOR_R						142
#define CAT425_LINE_COLOR_G						142
#define CAT425_LINE_COLOR_B						142


#endif /* __MMI_MAINLCD_240X320__ */

/* 
 * Category 430
 */

#define CAT430_NAME1_COLOR_R						107
#define CAT430_NAME1_COLOR_G						93
#define CAT430_NAME1_COLOR_B						247

#define CAT430_NAME2_COLOR_R						231
#define CAT430_NAME2_COLOR_G						77
#define CAT430_NAME2_COLOR_B						198

#define CAT430_NAME_FONT_ENUM						MEDIUM_FONT
#define CAT430_NAME_FONT							(&MMI_medium_font)

#define CAT430_SENT_COLOR_MARKER					GUI_INPUT_COLOR_BLACK

/* Marker length in sending box, we use two color code */
#define CAT430_MARKER_COUNT						2

#ifdef __MMI_MAINLCD_240X320__
#define CAT430_VERTICAL_GAP						4
#define CAT430_HORIZONTAL_GAP						3
#define CAT430_SENDING_BOX_V_GAP					2
#define CAT430_SENDING_BOX_H_GAP					0
#else
#define CAT430_VERTICAL_GAP						2
#define CAT430_HORIZONTAL_GAP						2
#define CAT430_SENDING_BOX_V_GAP					2
#define CAT430_SENDING_BOX_H_GAP					0
#endif

#if !defined(__MMI_MAINLCD_128X128__)
/* Show name outside logbox */
#undef CAT430_NAME_IN_LOG
#else
/* Show name inside logbox */
#define CAT430_NAME_IN_LOG
#endif

/* 
 * Category 435
 */

#define CAT435_POPUP_X								(MMI_content_x)
#define CAT435_POPUP_WIDTH							(MMI_CONTENT_WIDTH_WITH_H_TAB)

#ifdef __MMI_MAINLCD_128X160__

#define CAT435_POPUP_OVERLAP_TAB_BAR			1

#define CAT435_POPUP_Y								(MMI_CONTENT_Y_WITH_H_TAB - 6)
#define CAT435_POPUP_HEIGHT						(MMI_CONTENT_HEIGHT_WITH_H_TAB + 6)
#undef CAT435_SHOW_LOG_BOX_WITH_POPUP	
#undef CAT435_POPUP_WITH_BORDER_TITLE
/* Title height in popup */
#define CAT435_POPUP_TITLE_HEIGHT				18
/* Bottom gap between editor and multitap */
#define CAT435_POPUP_BOTTOM_GAP					0/* HACK. 0 for ZI input method */
/* Horizontal gap */
#define CAT435_POPUP_H_GAP							0 /* HACK. 0 for ZI input method */

#elif defined(__MMI_MAINLCD_176X220__)

#undef CAT435_POPUP_OVERLAP_TAB_BAR		

#ifdef __MMI_TOUCH_SCREEN__
/* Virtual keyboard takes more space */
#define CAT435_POPUP_Y								(MMI_CONTENT_Y_WITH_H_TAB - 4)
#define CAT435_POPUP_HEIGHT						(MMI_CONTENT_HEIGHT_WITH_H_TAB + 4)
#undef CAT435_SHOW_LOG_BOX_WITH_POPUP
#else
#define CAT435_POPUP_Y								(MMI_CONTENT_Y_WITH_H_TAB + (MMI_CONTENT_HEIGHT_WITH_H_TAB /5))
#define CAT435_POPUP_HEIGHT						(MMI_CONTENT_HEIGHT_WITH_H_TAB - (MMI_CONTENT_HEIGHT_WITH_H_TAB /5))
#define CAT435_SHOW_LOG_BOX_WITH_POPUP
#endif /* __MMI_TOUCH_SCREEN__ */

#define CAT435_POPUP_WITH_BORDER_TITLE
/* Title height in popup */
#define CAT435_POPUP_TITLE_HEIGHT				19
/* Bottom gap between editor and multitap */
#define CAT435_POPUP_BOTTOM_GAP					0 /* HACK. 0 for ZI input method */
/* Horizontal gap */
#define CAT435_POPUP_H_GAP							0 /* HACK. 0 for ZI input method */

#else
/* For 240x320. 128x128 is also compiled but not linked */

#ifdef __MMI_TOUCH_SCREEN__
/* Virtual keyboard takes more space */
#define CAT435_POPUP_Y								(MMI_CONTENT_Y_WITH_H_TAB)
#define CAT435_POPUP_HEIGHT						(MMI_CONTENT_HEIGHT_WITH_H_TAB)
#undef CAT435_SHOW_LOG_BOX_WITH_POPUP
#else
#define CAT435_POPUP_Y								(MMI_CONTENT_Y_WITH_H_TAB + (MMI_CONTENT_HEIGHT_WITH_H_TAB /5))
#define CAT435_POPUP_HEIGHT						(MMI_CONTENT_HEIGHT_WITH_H_TAB - (MMI_CONTENT_HEIGHT_WITH_H_TAB /5))
#define CAT435_SHOW_LOG_BOX_WITH_POPUP
#endif /* __MMI_TOUCH_SCREEN__ */

#define CAT435_POPUP_WITH_BORDER_TITLE
/* Title height in popup */
#define CAT435_POPUP_TITLE_HEIGHT				30
/* Bottom gap between editor and multitap */
#define CAT435_POPUP_BOTTOM_GAP					0 /* HACK. 0 for ZI input method */
/* Horizontal gap */
#define CAT435_POPUP_H_GAP							0 /* HACK. 0 for ZI input method */

#endif

#define CAT435_BACKGROUND_WHITE_VALUE			(80)

/***************************************************************************** 
* Typedef 
*****************************************************************************/

/* 
 * Category 420 
 */
typedef struct
{
	/* Data */
	UI_string_type 	name;
	U16					mood_caption;
	UI_string_type 	mood_string;
	UI_image_type 		mood_icon;
	U16					status_caption;
	UI_string_type 	status_string;
	UI_image_type 		status_icon;
	S16					image_ori_width, image_ori_height;
	/* Image cache */
	U32					display_image : 1;
	U32					image_is_cached : 1;
	gdi_handle			cache_layer;
	/* Layout */
	S16					content_width;
	S16					editor_header_height;
	
	S16					name_x, name_y, name_width;
	S16					line_x1, line_x2, line_y;
	
	S16					mood_caption_x, mood_caption_y;
	S16					mood_image_x, mood_image_y;
#ifdef CAT420_DISP_INFO_TEXT
	S16					mood_text_x, mood_text_y;
#endif
	
	S16					status_caption_x, status_caption_y;
	S16					status_image_x, status_image_y;
#ifdef CAT420_DISP_INFO_TEXT
	S16					status_text_x, status_text_y;
#endif

	S16					image_area_x, image_area_y;
	S16					image_area_width, image_area_height;
	
	S16					image_x_offset, image_y_offset;
	S16					image_resized_width, image_resized_height; /* 0 if no resize */
	
} mmi_gui_cat420_context_struct;

/* 
 * Category 425
 */
typedef struct 
{
	dword					backup_menu_flags;
	UI_filled_area		*backup_menu_filler; 

	S16					icon_border_x1, icon_border_y1, icon_border_x2, icon_border_y2;
	S16					bracket_x, bracket_y;

	S16					num_tab;
	S32					content_x, content_y, content_width, content_height;

	/* For RefreshCategory425Screen */
	GetAsyncItemFuncPtr get_item_func;
	GetAsyncHintFuncPtr get_hint_func;
} mmi_gui_cat425_context_struct;


/* 
 * Category 430
 */
typedef struct 
{
	/* Another input box */
	multi_line_input_box 	log_box1;
	U8								*allocated_color_buffer; /* Add color marker */
	/* Data */
	U8								*name1, *name2;
	U8 							*log_buffer1;
	U8 							*log_buffer2;
	U8 							*sending_buffer;
	S16							log_buffer_size1;
	S16							log_buffer_size2;
	S16							max_sending_buffer_size;
	S16							sent_count;
	S16							allocated_color_buffer_size; 
	MMI_BOOL						show_sending_buffer;
#ifdef __MMI_TOUCH_SCREEN__
	U8								pen_object; /* 0: none, 1: log_box1, 2: log_box2 */
#endif 
	/* Layout */	
#ifndef CAT430_NAME_IN_LOG
	S16							name1_x, name1_y;
	S16							name2_x, name2_y;
#else
	S16							log_box_header_height;
#endif
	S16							log_box1_x, log_box1_y;
	S16							log_box1_width, log_box1_height;
	S16							log_box2_x, log_box2_y;
	S16							log_box2_width, log_box2_height;
	S16							log_box2_footer_height;
	S16							sending_box_x, sending_box_y; /* relative coordinates */
	S16							sending_box_width;
} mmi_gui_cat430_context_struct;

typedef struct
{
	S32 dummy;
} mmi_gui_cat430_history_header_struct;

/* 
 * Category 435
 */
typedef struct 
{
	/* Backup original MMI context */
	UI_filled_area				*backup_multitap_filler;
	color							backup_information_bar_color;
	S32							backup_MMI_editor_width, backup_MMI_editor_height;
	/* Log editor box */
	multi_line_input_box 	log_box;
	UI_filled_area				log_box_scrollbar_sbutton_filler;
	/* Category parameters */
	U16							right_softkey;
	U16							right_softkey_icon;
	U16							left_softkey;
	U16							left_softkey_icon;
	U16							editor_right_softkey;
	U16							editor_right_softkey_icon;
	U16							editor_left_softkey;
	U16							editor_left_softkey_icon;	
	UI_string_type				popup_title;
	/* Softkey handlers */
	void 							(*editor_LSK_func)(void);
	void 							(*editor_RSK_func)(void);
	void 							(*LSK_func)(void);
	void 							(*RSK_func)(void);
	/* Whether the popup editor is displayed */
	BOOL							show_popup;
	/* Data used to setup the popup editor */
	BOOL							editor_created; /* For debug only */
	S16							input_type;
	U8								*buffer;
	S8								icon_height;
	S32							buffer_size;
	multi_line_input_box_icon_hdlr icon_callback;
} mmi_gui_cat435_context_struct;

typedef struct
{
	U8								show_popup;
	U8								dummy[3]; /* Align to four bytes */
} mmi_gui_cat435_history_header_struct;

/***************************************************************************** 
* Local Variable
*****************************************************************************/

/* 
 * Category 420 
 */
static mmi_gui_cat420_context_struct *g_mmi_gui_cat420_context_p;

#define CAT420_CTX 			(g_mmi_gui_cat420_context_p)

static const U8 g_mmi_gui_cat420_line_style[] = {1, 1, 1, 0, 1, 0};

static UI_filled_area g_mmi_gui_cat420_text_filler=
{	UI_FILLED_AREA_TYPE_COLOR | UI_FILLED_AREA_BORDER,
	NULL,
	NULL,
	{	200,248,232,100	},
	{	0,0,0,0				},
	{	80,136,80,0			},
	{	0,0,0,0				},
	0
};

/* 
 * Category 425
 */
static mmi_gui_cat425_context_struct *g_mmi_gui_cat425_context_p;

#define CAT425_CTX			(g_mmi_gui_cat425_context_p)

#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif

static const U8 g_mmi_gui_cat425_line_bitvalues[] = {1, 1, 0};

/* 
 * Category 430
 */

static mmi_gui_cat430_context_struct *g_mmi_gui_cat430_context_p;

#define CAT430_CTX 			(g_mmi_gui_cat430_context_p)


static const UI_filled_area g_mmi_gui_cat430_logbox_filler =
{
	UI_FILLED_AREA_TYPE_COLOR  | UI_FILLED_AREA_BORDER,
	NULL,
	NULL,
	{	255, 255, 255, 100	},
	{	0,0,0,0					},
	{	33, 28, 140, 100		},
	{	0,0,0,0					},
	0
};


static const UI_filled_area g_mmi_gui_cat430_sending_filler =
{
	UI_FILLED_AREA_TYPE_COLOR,
	NULL,
	NULL,
	{	225, 220, 225, 100	},
	{	0, 0, 0, 0				},
	{	0, 0, 0, 100			},
	{	0,0,0,0					},
	0
};

/* 
 * Category 435
 */
static mmi_gui_cat435_context_struct *g_mmi_gui_cat435_context_p;

#define CAT435_CTX			(g_mmi_gui_cat435_context_p)
 
static const UI_filled_area g_mmi_gui_cat435_editor_filler =
{
#ifdef __MMI_TOUCH_SCREEN__
	UI_FILLED_AREA_TYPE_COLOR, /* No border due to virtual keyboard */
#else
	UI_FILLED_AREA_TYPE_COLOR  | UI_FILLED_AREA_BORDER,
#endif
	NULL,
	NULL,
	{	255, 254, 209, 100	},
	{	0,0,0,0					},
	{	184, 184, 184, 100	},
	{	0,0,0,0					},
	0
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?