MTK Touch panel 2010/10/14.

Slides:



Advertisements
Similar presentations
Module 1: BLOCK 1 / MAIN MENU
Advertisements

1 Application Software Course Simulink By: Mahdi Akbari 2010.
Chapter 13 Graphics.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML Programming the World Wide Web Fourth edition.
1 WORKING WITH 2007 WORD Part 1 Developed October 2007 with lots of help from.
Getting Started with Microsoft Office 2007
Chapter 16 Graphical User Interfaces
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2003 Pearson Education, Inc. Slide 1.
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
UNITED NATIONS Shipment Details Report – January 2006.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 5: Repetition and Loop Statements Problem Solving & Program.
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 11: Structure and Union Types Problem Solving & Program Design.
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
Tutorial 3 – Creating a Multiple-Page Report
Tutorial 9 – Creating On-Screen Forms Using Advanced Table Techniques
Microsoft Access 2007 Advanced Level. © Cheltenham Courseware Pty. Ltd. Slide No 2 Forms Customisation.
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 10 second questions
Mike Scott University of Texas at Austin
Word Lesson 6 Working with Graphics
Microsoft®.
View-Based Application Development Lecture 1 1. Flows of Lecture 1 Before Lab Introduction to the Game to be developed in this workshop Comparison between.
Variables Conditionals Boolean Expressions Conditional Statements How a program produces different results based on varying circumstances if, else if,
ABC Technology Project
User Friendly Price Book Maintenance A Family of Enhancements For iSeries 400 DMAS from Copyright I/O International, 2006, 2007, 2008, 2010 Skip Intro.
School of Geography FACULTY OF ENVIRONMENT Working with Tables 1.
1 Lesson 10 Working with Tables Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Lesson 7: Using Tables Courseware #: 3240
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 24.1 Test-Driving the Ticket Information Application.
First Steps using AutoDESK Inventor
Lesson 2 Navigating LabVIEW
INTRODUCTION Lesson 1 – Microsoft Word Word Basics
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Office 2003 Integration Integrating Office 2003 Applications and the World Wide Web.
Lesson 8: Working with Illustrations Courseware #: 3240
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
© Paradigm Publishing, Inc Excel 2013 Level 1 Unit 2Enhancing the Display of Worksheets Chapter 8 Adding Visual Interest to Workbooks.
CAR Training Module PRODUCT REGISTRATION and MANAGEMENT Module 2 - Register a New Document - Without Alternate Formats (Run as a PowerPoint show)
1 Welcome to SAPS Webmail. 2 Things we will learn about: 1. Login to mail.
Unicel DxH 800 & Unicel DxH SLidemaker Stainer Overview
 Copyright I/O International, 2013 Visit us at: A Feature Within from Item Class User Friendly Maintenance  Copyright.
Lesson 12 Getting Started with Word Essentials
4 Oracle Data Integrator First Project – Simple Transformations: One source, one target 3-1.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
 Copyright I/O International, 2013 Visit us at: A Feature Within from Customer Payment Terms User Friendly Maintenance.
Collin College Credit Exam
Skills for Success with Microsoft® Office 2010
1 of 31 Images from Africa. 2 of 31 My little Haitian friend Antoine (1985)
1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)
Macromedia Dreamweaver MX 2004 – Design Professional Dreamweaver GETTING STARTED WITH.
25 seconds left…...
Subtraction: Adding UP
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® PowerPoint 2010 © 2011 The McGraw-Hill Companies,
Benchmark Series Microsoft Excel 2010 Level 1
Chapter 10: The Traditional Approach to Design
Systems Analysis and Design in a Changing World, Fifth Edition
Lesson 15 Working with Tables
PSSA Preparation.
Chapter 11 Creating Framed Layouts Principles of Web Design, 4 th Edition.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® PowerPoint 2010 © 2011 The McGraw-Hill Companies,
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 30 - Dynamic HTML: Structured Graphics ActiveX Control Outline 30.1Introduction 30.2Shape Primitives.
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
What’s new in WebSpace Changes and improvements with Xythos 7.2 Effective June 24,
Presentation transcript:

MTK Touch panel 2010/10/14

Agenda Introduction Driver Touch Panel Introduction Features Files Frameworke Driver Touch Panel Introduction Touch Panel Calibration Process Touch panel event Flow diagram Exercise: tocuh panel event Draw Manager Draw flow diagram Event flow diagram Controls map Control sets Coordinate Sets Exercise: Add new screen Editor and handwriting

Features Enable touch panel in project(CUSTOM_PROJECT.mak) TOUCH_PANEL_SUPPORT = TRUE HAND_WRITING = MMI_HANWANG # MMI_HANWANG, MMI_PENPOWER Enable touch panel in MMI(MMI_features.h,do not modify) #ifdef TOUCH_PANEL_SUPPORT #define __MMI_TOUCH_SCREEN__ #endif #ifdef __MMI_TOUCH_SCREEN__ #define __MMI_TOUCH_DIAL_SCREEN__ #define __MMI_DRAW_MANAGER__ #define __MMI_WGUI_CSK_ENABLE__

Files System Driver Custom Driver MMI framework MMI GUI Touch_panel.c (drv\src) Touch_panel.h (interface\hwdrv) Touch_panel_buff.h (interface\hwdrv) Touch_panel_main.c (drv\src) Custom Driver Touch_panel_custom.c (custom\drv\misc_drv\BOARD_VER) Touch_panel_custom.h (custom\drv\misc_drv\BOARD_VER) Touch_panel_spi.c (custom\drv\misc_drv\BOARD_VER) Touch_panel_spi.h (custom\drv\misc_drv\BOARD_VER) MMI framework TouchScreen.c (plutommi\mmi\framework\eventhandling\eventssrc) TouchScreenGprot.h (plutommi\mmi\framework\eventhandling\eventsinc) MMI GUI Wgui_draw_manager.c (plutommi\mmi\gui\gui_src) Wgui_draw_manager.h (plutommi\mmi\gui\gui_inc) Wgui_touch_screen.c (plutommi\mmi\gui\gui_src) Wgui_touch_screen.h (plutommi\mmi\gui\gui_inc) CustCoordinates.c (plutommi\customer\custresource) EditorPen.c (plutommi\mmi\editorpen\editorpensrc)

Framework System : MMI : MMI Application Category screens Protocol / Keypad / Interrupt event manager Touch panel event manager WGUI Draw Manager GUI

Driver: 4-Wire Resistive Touch Panel(1/3)

Driver: 4-Wire Resistive Touch Panel(2/3)

Driver: 4-Wire Resistive Touch Panel(3/3) Single-Ended Mode Differential Mode How to get a touch point coordinate? 1.Turn on Y+,Y- drivers. 2.Read X+ ADC. 3. Use calibration data to transformed ADC value into coordinate. 4.Turn on X+, X- and repeat step 1 and step 2.

Driver: 2-points Calibration(1/2)

Driver: 2-points Calibration(2/2)

Driver: MTK Calibration(1/2) 2 points calibration with extra one point determination Calibration Flow Calibration Point Position Avoid boundary points Use relative ADC difference to verify calibration points ADC difference is in proportion to coordinate difference The main reason is LCD size and transform speed For example: 256*256 LCD with 12 bits ADC converter The distance between two adjacent pixels could reach 16 units (ADC coordinate)

Driver: MTK Calibration(2/2) Factory Mode

Driver: Custom const variables Members Description TOUCH_PANEL_ADC_X_START ADC of the left-upper x coordinate TOUCH_PANEL_ADC_X_EDN ADC of the right-lower x coordinate TOUCH_PANEL_ADC_Y_START ADC of the left-upper y coordinate TOUCH_PANEL_ADC_Y_EDN ADC of the right-lower y coordinate TOUCH_PANEL_COORD_X_START Minimum value of the x coordinate TOUCH_PANEL_COORD_X_EDN Maximum value of the x coordinate TOUCH_PANEL_COORD_Y_START Minimum value of the y coordinate TOUCH_PANEL_COORD_Y_EDN Maximum value of the y coordinate TOUCH_PANEL_START_BIT Start bit setting of touch panel module TOUCH_PANEL_X_PLUS X plus setting of touch panel module TOUCH_PANEL_Y_PLUS Y plus setting of touch panel module TOUCH_PANEL_ADC3 ADC3 setting of touch panel module TOUCH_PANEL_ADC4 ADC4 setting of touch panel module TOUCH_PANEL_12BIT_SAMPLE 12 bits sample setting of touch panel module TOUCH_PANEL_8BIT_SAMPLE 8 bits sample setting of touch panel module TOUCH_PANEL_DIFF_MODE Differential mode setting of touch panel module TOUCH_PANEL_SINGLE_MODE Single-ended mode setting of touch panel module TOUCH_PANEL_PWD_ENBLE Power down enable setting of touch panel module TOUCH_PANEL_IRQ_DISABLE Interrupt disable setting of touch panel module TOUCH_PANEL_PWD_DISABLE Power down disable setting of touch panel module TOUCH_PANEL_PWD_RESER Reset setting of touch panel module SPI_DIN_PIN GPIO used to be input SPI_CLK_PIN GPIO used to be clock SPI_DOUT_PIN GPIO used to be output SPI_CS_PIN GPIO used to be chip select SPI_BUSY_PIN GPIO used to be busy signal TOUCH_PANEL_EINT_DOWN_LEVEL Touch panel interrupt level

Touch panel event flow(Touch panel task)

Touch panel event flow(MMI task)

Exercise: touch panel event #include "MMI_features.h" #include "PixtelDataTypes.h" #include "wgui_categories.h" #include "gdi_include.h" #include "lcd_sw_rnd.h" #include "wgui_draw_manager.h" void my_pen_up_hdlr(mmi_pen_point_struct point); void my_pen_down_hdlr(mmi_pen_point_struct point); void my_pen_move_hdlr(mmi_pen_point_struct point); void my_pen_abort_hdlr(mmi_pen_point_struct point); void my_pen_repeat_hdlr(mmi_pen_point_struct point); void my_pen_long_tap_hdlr(mmi_pen_point_struct point); void start_handwriting(); void end_handwriting(); void touch_panel_event_test() { EntryNewScreen(64000,NULL,NULL,NULL); clear_screen(); mmi_pen_register_up_handler(my_pen_up_hdlr); mmi_pen_register_down_handler(my_pen_down_hdlr); mmi_pen_register_move_handler(my_pen_move_hdlr); mmi_pen_register_abort_handler(my_pen_abort_hdlr); mmi_pen_register_repeat_handler(my_pen_repeat_hdlr); mmi_pen_register_long_tap_handler(my_pen_long_tap_hdlr); SetKeyHandler((FuncPtr)start_handwriting, KEY_1, KEY_EVENT_UP); SetKeyHandler((FuncPtr)end_handwriting, KEY_2, KEY_EVENT_UP); pixtel_UI_BLT_double_buffer(0,0,UI_device_width,UI_device_height); RedrawCategoryFunction = my_test; }

Exercise: touch panel event (contd) BOOL handwring = FALSE; void draw_point(U8* event_type,U16 y, mmi_pen_point_struct point) { U32 rand_color = rand()%255; gdi_draw_solid_rect(0, y, 176, y+20, DRV_RGB_TO_HW(255,255,255)); gdi_draw_solid_rect(0, 0, 10, 220, DRV_RGB_TO_HW(255,255,255)); pixtel_UI_set_text_color(UI_COLOR_RED); pixtel_UI_move_text_cursor(10,y); pixtel_UI_printf((UI_string_type)"%s {%d, %d}",event_type, point.x, point.y); gdi_draw_solid_rect(3, y + 5, 8, y + 10, DRV_RGB_TO_HW(0,255-rand_color,rand_color)); if (handwring) gdi_draw_rect(30, 150, 150, 200, DRV_RGB_TO_HW(0,255,0)); gdi_draw_rect(40, 30, 174, 170 , DRV_RGB_TO_HW(0,0,255)); } pixtel_UI_BLT_double_buffer(0,0,UI_device_width,UI_device_height); void my_pen_up_hdlr(mmi_pen_point_struct point){ draw_point("pen up", 5, point); void my_pen_down_hdlr(mmi_pen_point_struct point){ draw_point("pen down", 30, point); void my_pen_move_hdlr(mmi_pen_point_struct point){ draw_point("pen move", 55, point); void my_pen_abort_hdlr(mmi_pen_point_struct point){ draw_point("pen abort", 80, point); void my_pen_repeat_hdlr(mmi_pen_point_struct point){ draw_point("pen repeat", 105, point); void my_pen_long_tap_hdlr(mmi_pen_point_struct point){ draw_point("pen long tap", 130, point);

Exercise: touch panel event(contd) void my_pen_stroke_down_hdlr(mmi_pen_point_struct point) { draw_point("stroke down", 155, point); } void my_pen_stroke_move_hdlr(mmi_pen_point_struct point) draw_point("stroke move", 180, point); void my_pen_stroke_up_hdlr(mmi_pen_point_struct point) draw_point("stroke up", 205, point); mmi_pen_point_struct point_array[100]; void start_handwriting() mmi_pen_handwriting_area_struct stroke_area = {30, 150, 150, 200}; mmi_pen_handwriting_area_struct ext_stroke = {40, 30, 174, 170 }; mmi_pen_start_capture_strokes(100, point_array, 1, &stroke_area, &ext_stroke); mmi_pen_register_stroke_down_handler(my_pen_stroke_down_hdlr); mmi_pen_register_stroke_move_handler(NULL, NULL, my_pen_stroke_move_hdlr); mmi_pen_register_stroke_up_handler(my_pen_stroke_up_hdlr); handwring = TRUE; gdi_draw_rect(30, 150, 150, 200, DRV_RGB_TO_HW(0,255,0)); gdi_draw_rect(40, 30, 174, 170 , DRV_RGB_TO_HW(0,0,255)); pixtel_UI_BLT_double_buffer(0,0,UI_device_width,UI_device_height); void end_handwriting() mmi_pen_stop_capture_strokes(); handwring = FALSE; clear_screen();

Draw Manager: Introduction The direct benefits of draw manager are that it explicitly lists all UI components inside a category screen. UI Component: Each UI component on the screen is represented as an object. Each UI component has its size and position. Each keypad handler might be mapped to one UI component. One UI component might contains child UI components Each UI components has its pen handlers. Only UI components can interpret coordinates, WGUI does not know complete coordinate information. UI components are a set of basic functions to Create an object entity that has size and position. Provide methods to modify attributes/style of an object. Provide routines to redraw an object. The coordinates sets and control sets are maintained in resource files. The same category screen may have a different coordinates (size) for different applications. (even different control set) The redraw, history and exit functions for all the category screens will be replaced by common functions. dm_redraw_category_screen dm_get_history/dm_get_history_size dm_exit_category_screen

Draw Manager: Draw flow diagram Coordinate Set Screen Id Category Id Phonebook Screen Id 1 Draw Manager Category Screen X coordinate Settings Screen Id Category Id Screen Id 2 control …… Control Set Screen Id 3 Category Id Application Layer Category Layer UI Layer Resources Layer

Draw Manager: Event flow diagram Coordinate Set Screen Id Category Id PEN_DOWN PEN_UP PEN_MOVE PEN_LONGTAP PEN_REPEAT STROKE_MOVE STROKE_DOWN STROKE_UP coordinate Touch Event Manager WGUI Touch Event Manager Component | Event | Point WGUI control Control Set Category Id Driver Event Manager (touch_panel.c) Touch Event Manager (TouchScreen.c) WGUI Touch Event Manager (wgui_touch_screen.c) Draw manager resources (CustCoordinates.c) WGUI

Draw manager resource: Controls Map Description: Unique Category ID maps to control set Unique Screen ID maps to coordinate set Categories controls map Struct: typedef struct { U16 U16CategoryId; //Unique Category ID U8* U8ControlSet_p; //Control set in current category screen S16* s32DefaultCoordinateSet_p; //Corrdinate set in current category screen S16* s32RotatedCoordinateSet_p; //Unused }CategoryId_ControlSet_struct; Data: const CategoryId_ControlSet_struct g_categories_controls_map[]= {MMI_CATEGORY5_ID,(U8*)category5,(s16*)coordinate_set5,NULL}, ………… {MMI_CATEGORY_WCLOCK,(U8*)categoryWcScreen,(s16*)coordinate_WcScreen,NULL} }; Screenid coordinate sets map S32 s32ScreenId; //Unique Screen ID S16* s16CoordinateSet_p; //Corrdinate set in current screen }ScreenId_CoordinateSet_struct; const ScreenId_CoordinateSet_struct g_screenid_coordinate_sets_map[]= {SCR_SEARCH_NAME_ENTRY, (S16*)coordinate_set5}, {SCR_ID_PHOART_TEXT_SELECT,(S16*)coordinate_set57_top_infobox}

Draw manager resource: Control sets Description: Unique Category ID maps to control set, Number of controls are decided by category. Some common-used controls could be grouped as a “base control set”. Some applications control display by itself. These applications should also handle pen events. e.g. Camera, FM Radio, Struct: { no_of_controls, control_1, control_2, control_3, …….. control_n } example: const S32 category101 = {3, TITLE1, LIST1, BUTTON_BAR1}; const S32 category5 = {3, TITLE1, MULTILINE_INPUTBOX1, BUTTON_BAR1};

Draw manager resource: Control type Category component DM_CIRCULAR_MENU1, DM_LIST1, DM_ROTATE_MENU1, DM_INLINE_FIXED_LIST1, DM_DYNAMIC_LIST1, DM_ASYNCDYNAMIC_LIST1, DM_MATRIX_MENU1, DM_SINGLELINE_INPUTBOX1, DM_MULTILINE_INPUTBOX1, DM_EMS_INPUTBOX1, DM_DIALER_INPUT_BOX1, DM_TAB_CONTROL, DM_HORIZONTAL_TAB_BAR, DM_DATE_TIME_DISPLAY, DM_TITLE1, DM_STATUS_BAR1, DM_LSK, DM_RSK, DM_CSK, DM_BUTTON, DM_CALENDAR, DM_SLIDE_CONTROL, DM_NWAY_STOPWATCH, DM_TYPICAL_STOPWATCH, Category Primitive DM_STRING, DM_IMAGE, DM_LINE, DM_RECTANGLE, DM_BACK_FILL_AREA, Category control set DM_BASE_CONTROL_SET1, DM_BASE_CONTROL_SET2, DM_BUTTON_BAR1, Other type DM_BASE_LAYER_START DM_BASE_LAYER_END, DM_NEW_LAYER_START, DM_NEW_LAYER_END, DM_ALIGNED_AREA_START, DM_ALIGNED_AREA_END, DM_SCR_BG, DM_WALL_PAPER DM_POPUP_BACKGROUND, DM_CATEGORY_CONTROLLED_AREA,

Draw manager resource: Coordinate Sets Description: Unique category ID or unique screen ID maps to coordinate set, Position and size of controls are decided by category or screen. Define the coordinates of UI elements in corresponding control set. Struct: Coordinate Structure Details { {category_coordinates}, {control_1_coordinates}, …..… {control_n_coordinates} }; example: const S32 coordinate_set101[] = 0, 0, UI_DEVICE_WIDTH, UI_DEVICE_HEIGHT, 0, 0, UI_DEVICE_WIDTH, MMI_TITLE_HEIGHT, 0, 18, 128, 92, //List Coordinates 0, 110, 128, 18, 50 //Button Bar Coordinates

Exercise: Add new screen(Add resource)) Step 1: Add CATEGORY_ID (wgui_categories_defs.h): enum MMI_CATEGORY_ID_LIST { MMI_LIST_CATEGORY_ID=1, ………… MMI_CATEGORY_TOUCH_SCREEN_EXERCISE_ID }; Step 2: Add categories controls map(CustCoordinates.c): const CategoryId_ControlSet_struct g_categories_controls_map[]= {MMI_CATEGORY5_ID, (U8*)category5, (s16*)coordinate_set5}, {MMI_CATEGORY_TOUCH_SCREEN_EXERCISE_ID, (U8*)categoryTouchScreen, (s16*)coordinate_TouchScreen} Step 3: Add ControlSet(CustCoordinates.c): const U8 categoryTouchScreen[]= 5, DM_BASE_LAYER_START, DM_BASE_CONTROL_SET1, DM_SLIDE_CONTROL, DM_STRING, DM_CATEGORY_CONTROLLED_AREA Step 4: Add CoordinateSet(CustCoordinates.c): const s16 coordinate_TouchScreen[]= 0,0,MAIN_LCD_DEVICE_WIDTH,MAIN_LCD_DEVICE_HEIGHT, DM_NO_FLAGS, //Category Screen Coordinates MMI_CONTENT_X,MMI_CONTENT_Y + 10,MMI_CONTENT_WIDTH,MMI_CONTENT_Y + 30,DM_CENTRE_ALIGN_X, MMI_CONTENT_X,MMI_CONTENT_Y + 40,MMI_CONTENT_WIDTH,MMI_CONTENT_Y + 70,DM_CENTRE_ALIGN_X, MMI_CONTENT_X+ 38,MMI_CONTENT_Y + 70,100,50,DM_CENTRE_ALIGN_X

Exercise: Add new screen(event handler) #include "MMI_features.h" #include "PixtelDataTypes.h" #include "GlobalDefs.h" #include "HistoryGprot.h" #include "wgui_categories.h" #include "gdi_include.h" #include "lcd_sw_rnd.h" #include "wgui_draw_manager.h“ void ShowCategoryTouchScreen(); S32 slide_value = 30; UI_character_type slide_value_string[50] = L"current value: 30"; void TouchScreen(){ EntryNewScreen(64000,NULL,NULL,NULL); clear_screen(); ShowCategoryTouchScreen(); SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP); pixtel_UI_BLT_double_buffer(0,0,UI_device_width,UI_device_height); RedrawCategoryFunction = my_test; } void draw_control_area(dm_coordinates *coordinate){ pixtel_UI_fill_rectangle(coordinate->s16X,coordinate->s16Y, coordinate->s16X+coordinate->s16Width-1, coordinate->s16Y+coordinate->s16Height-1,UI_COLOR_GREEN); void slide_value_change_callback(){ pixtel_UI_sprintf(slide_value_string, "current value: %d", slide_value); RedrawCategoryFunction(); BOOL control_area_pendown(mmi_pen_point_struct point){ if (PEN_CHECK_BOUND(point.x, point.y, MMI_CONTENT_X+ 38,MMI_CONTENT_Y + 70,100,50) ) { pixtel_UI_sprintf(slide_value_string, "current point: {%d, %d}", point.x, point.y); return TRUE; return FALSE;

Exercise: Add new screen(show screen) void ShowCategoryTouchScreen() { dm_data_struct dm_data; pixtel_UI_lock_double_buffer(); MMI_menu_shortcut_number=-1; change_left_softkey(STR_GLOBAL_OK,IMG_GLOBAL_OK); change_right_softkey(STR_GLOBAL_BACK,IMG_GLOBAL_BACK); SetupCategoryKeyHandlers(); MMI_title_string=L"Touch screen"; MMI_title_icon=NULL; //Set slide control dm_add_image(get_image(WGUI_SLIDE_CONTROL_BG_IMAGE_ID),NULL); dm_add_slide_control(0,100,slide_value,slide_value_change_callback); MMI_slide_control_value[0]=&slide_value; MMI_slide_control_value[1]=&slide_value; wgui_slide_control_set_focus(&MMI_slide_control[0]); SetKeyHandler(wgui_slide_control_previous,KEY_LEFT_ARROW,KEY_EVENT_DOWN); SetKeyHandler(wgui_slide_control_next,KEY_RIGHT_ARROW,KEY_EVENT_DOWN); //Set string dm_add_string((UI_string_type)slide_value_string,&MMI_default_font,UI_COLOR_RED,UI_COLOR_GREEN,NULL); //Set category controlled area dm_register_category_controlled_callback(draw_control_area); mmi_wgui_register_category_screen_control_area_pen_handlers(control_area_pendown,MMI_PEN_EVENT_DOWN); dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND; pixtel_UI_unlock_double_buffer(); ExitCategoryFunction=ExitCategoryTouchScreen; dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size); dm_data.s32ScrId = (s32)GetActiveScreenId(); dm_data.s32CatId = MMI_CATEGORY_TOUCH_SCREEN_EXERCISE_ID; dm_setup_data(&dm_data); dm_redraw_category_screen(); }

Editor and handwriting Make file HAND_WRITING = MMI_HANWANG # MMI_HANWANG, MMI_PENPOWER ifeq ($(strip $(HAND_WRITING)),MMI_HANWANG) COMPOBJS += custom\inputmethod\$(strip $(MMI_VERSION))\lib\hw.a CUS_REL_SRC_COMP += hanwang CUS_REL_OBJ_LIST += custom\inputmethod\$(strip $(MMI_VERSION))\lib\hw.lib CUS_REL_OBJ_LIST += custom\inputmethod\$(strip $(MMI_VERSION))\lib\hws.lib CUS_REL_OBJ_LIST += custom\inputmethod\$(strip $(MMI_VERSION))\lib\hw.dll CUS_REL_OBJ_LIST += custom\inputmethod\$(strip $(MMI_VERSION))\lib\hw.a endif Add component HanWang\src\HanWangInterface.c Add Lib custom\InputMethod\XXXX_MMI\lib\hws.lib custom\InputMethod\XXXX_MMI\lib\MediaTek_Hwre.lib custom\InputMethod\XXXX_MMI\lib\ MediaTek_Hwre_demo.lib

Editor and handwriting(in Simulator ) Add Handwriting Interface File HanWang\src\HanWangInterface.c Add Handwriting Library File custom\InputMethod\XXXX_MMI\lib\hws.lib custom\InputMethod\XXXX_MMI\lib\MediaTek_Hwre.lib custom\InputMethod\XXXX_MMI\lib\ MediaTek_Hwre_demo.lib Add Preprocessor Preprocessor definitions __MMI_HANWANG__ __MMI_PENPOER__ Additional include directories ..\..\custom\InputMethod\XXXX_MMI\inc

Define /* Delay time for Pen LongTap */ #define MMI_PEN_LONGTAP_TIME (60) /* multiple of 10ms */ /* Delay time for Pen Repeat */ #define MMI_PEN_REPEAT_TIME (30) /* multiple of 10ms */ /* Sampling period of Event-Based pen events (~ 12 samples/sec) */ #define MMI_PEN_SAMPLING_PERIOD_1 (8) /* multiple of 10ms */ /* Sampling period of Stroke-Based pen events (50 samples/sec) */ #define MMI_PEN_SAMPLING_PERIOD_2 (2) /* multiple of 10ms */ #define MMI_PEN_POLLING_PERIOD (4 * 10) /* ms */ #define MMI_PEN_STROKE_MIN_OFFSET (25) #define MMI_PEN_DEBOUNCE_POLLING_DELAY (1000 / 5 - MMI_PEN_POLLING_PERIOD)

谢谢!