EGL - Embedded Graphic Library - Ver 1.00 December 31. 2012 Advanced Digital Chips Inc. 1
History 2012-12-31 Created adstarsdk Reference Manual cadvanced Digital Chips Inc. All right reserved. No part of this document may be reproduced in any form without written permission from Advanced Digital Chips Inc. Advanced Digital Chips Inc. reserves the right to change in its products or product specification to improve function or design at any time, without notice. Office 22F, Bldg A, KeumkangPenterium IT Tower, 810, Gwanyang_dong,Dongan-Gu, Anyang-si, Gyeonggi-do, 431-060, Korea Tel : +82-31-463-7500 Fax : +82-31-463-7588 URL : http://www.adc.co.kr 2
Table of Contents EGL Library...10 Window...13 egl_create_window function... 14 egl_window_show function... 15 egl_window_isshow function... 16 egl_window_invalidate function... 17 egl_window_invalidate_rect function... 18 egl_window_redraw_rect function... 19 egl_window_set_bg function... 20 egl_window_get_bg function... 21 egl_window_add_object function... 22 egl_window_set_callback function... 23 egl_window_get_active function... 24 egl_user_touch_input function... 25 egl_draw function... 26 Window.... 27 Button...29 egl_create_button function... 30 egl_button_callback function... 31 Button.... 32 Image button...33 egl_create_image_button function... 34 egl_image_button_callback function... 35 Image Button.... 36 Toggle image button...37 3
egl_create_toggle_image function... 38 egl_toggle_image_callback function... 39 egl_toggle_image_set_on function... 40 Toggle Image Button.... 41 Label...42 egl_create_label function... 43 egl_label_set_text function... 44 egl_label_set_redraw_bg function... 45 egl_label_set_color function... 46 Label... 47 Check button / Radio button...48 egl_create_checkbutton function... 49 egl_checkbutton_callback function... 50 egl_checkbutton_set_check function... 51 egl_checkbutton_get_check function... 52 egl_checkbutton_set_style function... 53 Check / Radio button.... 54 Progress Bar...56 egl_create_progressbar function... 57 egl_progressbar_set_barcolor function... 59 egl_progressbar_set_bgcolor function... 60 egl_progressbar_set_textcolor function... 61 egl_progressbar_set_text function... 62 egl_progressbar_set_pos function... 63 egl_progressbar_get_pos function... 64 Progress Bar.... 65 4
Scroll Bar...66 egl_create_scrollbar function... 68 egl_scrollbar_callback function... 70 egl_scroll_set_position function... 71 egl_scroll_get_position function... 72 egl_scroll_set_totalcount function... 73 egl_scroll_get_totalcount function... 74 egl_scroll_set_viewcount function... 75 egl_scroll_get_viewcount function... 76 egl_scroll_set_upcount function... 77 egl_scroll_get_upcount function... 78 egl_scroll_set_bgcolor function... 79 egl_scroll_set_size function... 80 Scroll Bar.... 81 Slider...82 egl_create_slider function... 84 egl_slider_callback function... 86 egl_slider_set_pos function... 87 egl_slider_get_pos function... 88 egl_slider_set_range function... 89 egl_slider_get_range function... 90 egl_slider_stepit function... 91 egl_slider_set_tick_frequency function... 92 egl_slider_set_tick_style function... 93 egl_slider_set_thumb_size function... 94 egl_slider_get_thumb_size function... 95 egl_slider_set_barcolor function... 96 5
egl_slider_set_tickcolor function... 97 egl_slider_set_transparent function... 98 Slider.... 99 List Box... 100 egl_create_listbox function... 102 egl_listbox_callback function... 103 egl_listbox_additem function... 104 egl_listbox_delitem function... 105 egl_listbox_delitem_text function... 107 egl_listbox_alldelitem function... 109 egl_listbox_ get_all_itemlist function... 110 egl_listbox_ get_sel_item function... 111 egl_listbox_ get_ multiple_sel_itemlist function... 112 egl_listbox_ set_bgcolor function... 113 egl_listbox_ set_selbgcolor function... 114 egl_listbox_ set_textcolor function... 115 egl_listbox_ set_seltextcolor function... 116 egl_listbox_ set_scrollwidth function... 117 List box.... 118 Circle Gauge... 121 egl_create_circle_gauge function... 122 egl_circle_gauge_set_value function... 124 egl_circle_gauge_get_value function... 125 Circle Gauge.... 126 Bar Gauge... 128 egl_create_bar_gauge function... 129 egl_bar_gauge_set_value function... 131 6
egl_bar_gauge_get_value function... 132 Bar Gauge.... 133 Animation... 135 egl_create_animation function... 136 Animation.... 138 Custom Object... 139 egl_create_custom_object function... 140 Custom.... 142 Messagebox... 144 egl_show_messagebox function... 145 MessageBox.... 147 EGL Font... 149 egl_get_font function... 150 egl_set_font function... 151 egl_font_set_bkmode function... 152 egl_font_get_bk_color function... 153 egl_font_set_bk_color function... 154 egl_font_get_color function... 155 egl_font_set_color function... 156 create_bitfont function... 157 release_bitfont function... 158 create_bmpfont function... 159 bmfont_release function... 160 draw_text function... 161 draw_text_pivot function... 162 draw_text_len function... 163 7
draw_text_in_box function... 164 text_width function... 166 EGL Primitives... 167 draw_line function... 169 draw_hline function... 170 draw_vline function... 171 draw_thickline function... 172 draw_rect function... 173 draw_rectfill function... 174 draw_rectfill_gradient function... 175 draw_rectfill_h_gradient function... 176 draw_rectfill_v_gradient function... 177 draw_roundrect function... 178 draw_roundrectfill function... 179 draw_arc function... 180 draw_pie function... 181 draw_piefill function... 182 draw_ellipse function... 183 draw_ellipsefill function... 184 draw_circle function... 185 draw_circlefill function... 186 draw_bezier function... 187 draw_polyline function... 189 draw_polygon function... 190 draw_polygonfill function... 191 EGL etc.... 192 egl_init function... 193 8
egl_show_object function... 194 egl_object_set_redraw function... 195 9
EGL Library 1) 소개 EGL(Embedded Graphic Library) 은 graphic application 개발시간을단축하고다양한 object를편리하게사용할수있도록제작되었다. EGL은다양한 object를간편하게사용할수있도록함수를제공하며, event에대한처리와 object 관리를 library내에서하도록되어있다. Event에대한추가동작은각 object별사용자 callback 함수를두어, 개발자가원하는동작의 callback 함수를작성하여사용할수있다. 2) 구성 EGL 은다음의 object 들로구성되어있다. 10
3) Program 기본구조 < Source Code > #include adstar.h static void btn_callback(egl_handle h, int event) // button callback function. /* 사용자 call back 함수 */ extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; EGL_HANDLE btn; egl_init( hwin = egl_create_window( Main Window // create window btn = egl_create_button(100,100,200,50, Button 1 // create button obj egl_btn_callback(btn, btn_callback egl_window_add_object(hwin, btn // button obj add. egl_window_show(hwin // window show 11
while(1) if( process_touch( &touchdown, &touch_pt ) ) // touch 입력. egl_user_touch_input( touchdown, &touch_pt // touch 처리, msg 처리. egl_draw( 12
Window Function Description egl_create_window Window 를생성한다. egl_window_show 해당 window 를화면에출력할지를결정한다. egl_window_isshow 해당 window 가현재보여지고있는지를확인한다. egl_window_invalidate 현재 window 안의 object 를다시 draw 한다. egl_window_invalidate_rect 현재 window 의지정한영역의 object 를다시 draw 한다. egl_window_redraw_rect 현재 window 의지정한영역을다시 draw 한다. egl_window_set_bg Window 의배경이미지를설정한다. egl_window_get_bg Window 의배경이미지를가져온다. egl_window_add_object Window 에 object 를추가한다. egl_window_set_callback Window 이벤트가발생했을때호출될 callback 함수를등록한다. egl_window_get_active 현재보이는 window 의 handle 값을반환한다. egl_user_touch_input Msg_handler 로 touch message 를전달한다. egl_draw 현재 windows 의 object 를 draw 한다. 13
egl_create_window function EGL_HANDLE egl_create_window( const char* title Window 를생성한다. Window 의크기는사용하는해상도와같다. const char* title Window 의 title. 생성된 Window 의 handle. EGL_HANDLE hwin; hwin = egl_create_window( Main Window 14
egl_window_show function BOOL egl_window_show( EGL_HANDLE hwin, BOOL bshow 해당 window 를화면에출력할지를결정한다. EGL_HANDLE hwin BOOL bshow 출력여부결정. 출력을결정할 window handle. TRUE or FALSE EGL_HANDLE hwin; hwin = egl_create_window( Main Window egl_window_show(hwin, TRUE 15
egl_window_isshow function BOOL egl_window_isshow( EGL_HANDLE hwin 해당 window 가현재보여지고있는지를확인한다. EGL_HANDLE hwin 출력을상태를확인할 window handle. TRUE or FALSE EGL_HANDLE hwin; hwin = egl_create_window( Main Window if(egl_window_isshow(hwin)) 16
egl_window_invalidate function void egl_window_invalidate( void 현재 window 안의 object 를다시 draw 한다. 없음. 없음. EGL_HANDLE hwin; hwin = egl_create_window( Main Window egl_window_invalidate( 17
egl_window_invalidate_rect function void egl_window_invalidate_rect( EGL_RECT* prect 현재 window 의지정한영역의 object 를다시 draw 한다. EGL_RECT* prect 지정영역 value. typedef Struct _tag_rect int x; int y; int w; int h; EGL_RECT 없음. EGL_HANDLE hwin; EGL_RECT prect; hwin = egl_create_window( Main Window prect.x = 100; prect.y = 200; prect.w = 150; prect.h = 150; egl_window_invalidate_rect(&prect 18
egl_window_redraw_rect function Void egl_window_redraw_rect( EGL_RECT* prect 현재 window 의지정한영역을다시 draw 한다. EGL_RECT* prect 지정영역 value. typedef Struct _tag_rect int x; int y; int w; int h; EGL_RECT 없음. EGL_HANDLE hwin; EGL_RECT prect; hwin = egl_create_window( Main Window prect.x = 100; prect.y = 200; prect.w = 150; prect.h = 150; egl_window_redraw_rect(&prect 19
egl_window_set_bg function BOOL egl_window_set_bg( EGL_HANDLE hwin; SURFACE* Img; Window 의배경이미지를설정한다. EGL_HANDLE hwin SURFACE* Img 배경이미지를설정할 Window handle. 배경이미지 SURFACE TRUE or FALSE EGL_HANDLE hwin; SURFACE* surface = loadbmp( windowbg.bmp hwin = egl_create_window( Main Window egl_window_set_bg(hwin, surface 20
egl_window_get_bg function SURFACE* egl_window_get_bg( EGL_HANDLE hwin; Window 의배경이미지를가져온다. EGL_HANDLE hwin 배경이미지를가져올 Window handle. 해당 window 의 image. EGL_HANDLE hwin; SURFACE* getimage; hwin = egl_create_window( Main Window getimage = egl_window_get_bg(hwin 21
egl_window_add_object function BOOL egl_window_add_object( EGL_HANDLE hwin, EGL_HANDLE hobj Window 에 object 를추가한다. EGL_HANDLE hwin EGL_HANDLE hobj Object 를추가할 window handle. Window 에추가할 object handle. TRUE or FALSE EGL_HANDLE hwin; EGL_HANDLE btn; hwin = egl_create_window( Main Window btn = egl_create_button(100, 100, 100, 50, Button egl_window_add_object(hwin, btn 22
egl_window_set_callback function void egl_window_set_callback( EGL_HANDLE hwin, EVENT_CALLBACK cb Window 이벤트가발생했을때호출되는 callback 함수를등록한다. EGL_HANDLE hwin Callback 함수가등록되는 Window handle. EVENT_CALLBACK cb Event 발생시호출되는 callback 함수. 없음. Void window_callback(egl_handle h, int event) int main() EGL_HANDLE hwin; hwin = egl_create_window( Main Window egl_window_callback(hwin, window_callback 23
egl_window_get_active function EGL_HANDLE egl_window_get_active( void 현재출력되고있는 window 의 handle 값을반환한다. 없음. 현재출력되고있는 window handle. EGL_HANDLE hwin; EGL_HANDLE active_win; hwin = egl_create_window( Main Window active_win = egl_window_get_active( 24
egl_user_touch_input function void egl_user_touch_input( BOOL bpressed, EGL_POINT* pt Msg_handler 로 touch message 를전달한다. BOOL bpressed Touch 가눌린상태. EGL_POINT* pt Touch 된좌표. typedef struct _tagpoint int x; int y; EGL_POINT; 없음. EGL_POINT touch_pt; BOOL touchdown = FALSE; if(process_touch(&touchdown, &touch_pt)) egl_user_touch_input(touchdown, &touch_pt 25
egl_draw function void egl_draw( void 현재 windows 의 object 를 draw 한다. 없음. 없음. if(process_touch(&touchdown, &touch_pt)) egl_user_touch_input(touchdown, &touch_pt egl_draw( 26
Window. #include adstar.h static void btn1_callback(egl_handle h, int event) if( event == BTN_CLICKED ) debugprintf( btn1 clicked\r\n egl_window_show( hwin2, TRUE static void btn2_callback(egl_handle h, int event) if( event == BTN_CLICKED ) debugprintf( btn2 clicked\r\n egl_window_show( hwin1, TRUE extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin1; EGL_HANDLE hwin2; EGL_HANDLE btn1; EGL_HANDLE btn2; SURFACE* bg = loadbmp( bg.bmp egl_init( hwin1 = egl_create_window( First Window egl_windows_set_bg(hwin1, bg hwin2 = egl_create_window( Second Window btn1 = egl_create_button(100, 100, 200, 50, Second Window 27
egl_btn_callback(btn1, btn1_callback btn2 = egl_create_button(100, 200, 200, 50, First Window egl_btn_callback(btn2, btn2_callback egl_window_add_object(hwin1, btn1 egl_window_add_object(hwin2, btn2 egl_window_show(hwin1 egl_draw( while(1) if( process_touch(&touchdown, &touch_pt ) ) egl_user_touch_input(touchdown, &touch_pt egl_draw( 28
Button Function Description egl_create_button Button 을생성한다. egl_button_callback Button 이벤트가발생했을때호출될 callback 함수를등록한다. Define BUTTON_EVENT typedef enum BTN_CLICKED = 0, BTN_PRESSED, BTN_MAX, BUTTON_EVENT 29
egl_create_button function EGL_HANDLE egl_create_button( int x, int y, int w, int h, const char* text Button 을생성한다. int x 생성될 Button의 x좌표. int y 생성될 Button의 y좌표. int w 생성될 Button의가로크기. int h 생성될 Button의세로크기. const char* text Button에출력될 text. 생성된 Button 의 handle. EGL_HANDLE btn[2]; btn[0] = egl_create_button(100, 100, 100, 50, Button1 btn[1] = egl_create_button(300, 100, 100, 50, Button2 30
egl_button_callback function BOOL egl_button_callback( EGL_HANDLE hobj, EVENT_CALLBACK cb Button 이벤트가발생했을때호출될 callback 함수를등록한다. EGL_HANDLE hobj Callback 함수가등록되는 Button handle. EVENT_CALLBACK cb Event 가발생시호출되는 callback 함수. TRUE or FALSE void btn_callback(egl_handle h, int event) If(event == BTN_CLICKED) int main() EGL_HANDLE btn; btn = egl_create_button(100, 100, 100, 50, Button1 egl_button_callback(btn,btn_callback 31
Button. void btn_callback(egl_handle h, int event) if(event == BTN_CLICKED) debugprintf( buttton clicked. extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; EGL_HANDLE btn; egl_init( btn = egl_create_button(100, 100, 100, 50, Button Ex egl_button_callback(btn,btn_callback egl_window_add_object(hwin, btn egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 32
Image button Function Description egl_create_image_button Image button 을생성한다. egl_image_button_callback Image button 이벤트가발생했을때호출될 callback 함수를등록한다 33
egl_create_image_button function EGL_HANDLE egl_create_image_button( SURFACE* img, SURFACE* pressed_img, int x, int y, int w, int h Image button 을생성한다. SURFACE* img Image button의표시될 image. SURFACE* pressed_img 눌렸을때표시될 image. int x Image button의 x좌표. int y Image button의 y좌표. int w Image button의가로크기. int h Image button의세로크기. 생성된 Image button handle. EGL_HADLE imagebtn; SURFACE* img = loadbmp( btnimg.bmp ; SURFACE* pressed_img = loadbmp( pressedimg.bmp imagebtn = egl_create_image_button(img, pressed_img, 100, 100, 150, 50 34
egl_image_button_callback function BOOL egl_image_button_callback( EGL_HANDLE hobj, EVENT_CALLBACK cb Image button 이벤트가발생했을때호출될 callback 함수를등록한다 EGL_HADLE hobj Callback 함수가등록되는 Image button handle. EVENT_CALLBACK cb Event 가발생시호출되는 callback 함수. TRUE or FALSE void imgbtn_callback(egl_handle h, int event) int main() EGL_HADLE imagebtn; SURFACE* img = loadbmp( btnimg.bmp ; SURFACE* pressed_img = loadbmp( pressedimg.bmp imagebtn = egl_create_image_button(img, pressed_img, 100, 100, 150, 50 egl_image_button_callback(imgbtn, imgbtn_callback 35
Image Button. void imgbtn_callback(egl_handle h, int event) if(event == BTN_CLICKED) debugprintf( image buttton clicked. extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; EGL_HANDLE imgbtn; SURFACE* img = loadbmp( btnimg.bmp ; SURFACE* pressed_img = loadbmp( pressedimg.bmp egl_init( imgbtn = egl_create_image_button(img, pressed_img, 100, 100, 150, 50 egl_button_callback(imgbtn, imgbtn_callback egl_window_add_object(hwin, imgbtn egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 36
Toggle image button Function Description egl_create_toggle_image Toggle image button 을생성한다. egl_toggle_image_callback Toggle image button 이벤트가발생했을때호출될 callback 함수를등록한다. egl_toggle_image_set_on Toggle image button 의상태를설정한다. Define TOGGLE_IMAGE_EVENT typedef enum TOGGLE_IMAGE_ON = 0, TOGGLE_IMAGE_OFF, TOGGLE_IMAGE_EVENT; 37
egl_create_toggle_image function EGL_HANDLE egl_create_toggle_image( SURFACE* surf_off, SURFACE* surf_on, int x, int y, int w, int h Toggle image button 을생성한다. SURFACE* surf_off Toggle imgae 중 off시에출력할 image. ( default상태 : 0ff ) SURFACE* surf_on Toggle image 중 on시에출력할 image. int x Toggle image의 x 좌표. int y Toggle image의 y 좌표. int w Toggle image의가로크기. int h Toggle image의세로크기. 생성된 toggle image handle. EGL_HADLE toggleimg; SURFACE* surf_off = loadpng( off.png ; SURFACE* surf_on = loadpng( on.png toggleimg = egl_create_toggle_image(surf_off, surf_on, 100, 100, 150, 50 38
egl_toggle_image_callback function BOOL egl_toggle_image_callback( EGL_HANDLE hobj, EVENT_CALLBACK cb Toggle image button 이벤트가발생했을때호출될 callback 함수를등록한다 EGL_HANDLE hobj Callback 함수가등록되는 toggle image handle. EVENT_CALLBACK cb Event 가발생시호출되는 callback 함수. TRUE or FALSE void toggleimg_callback(egl_handle h, int event) if(event == TOGGLE_IMAGE_ON) else int main() EGL_HADLE toggleimage; toggleimage = egl_create_toggle_image(surf_off, surf_on, 100, 100, 150, 50 egl_toggle_image_callback(toggleimage, toggleimg_callback 39
egl_toggle_image_set_on function BOOL egl_toggle_image_set_on( EGL_HANDLE hobj, BOOL b Toggle image button 의상태를설정한다. EGL_HANDLE hobj 상태를설정할 toggle image handle. BOOL b 설정값. TRUE => On FALSE => Off TRUE or FALSE EGL_HADLE toggleimg; SURFACE* surf_off = loadpng( off.png ; SURFACE* surf_on = loadpng( on.png toggleimg = egl_create_toggle_image(surf_off, surf_on, 100, 100, 150, 50 egl_toggle_image_set_on(toggleimg, TRUE 40
Toggle Image Button. void toggleimg_callback(egl_handle h, int event) if(event == TOGGLE_IMAGE_ON) debugprintf( toggle image on \r\n else debugprintf( toggle image off \r\n extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; EGL_HANDLE toggleimg; SURFACE* surf_off = loadpng( off.png ; SURFACE* surf_on = loadpng( on.png egl_init( toggleimg = egl_create_toggle_image(surf_off, surf_on, 100, 100, 150, 50 egl_toggle_image_callback(toggleimg, toggleimg_callback egl_toggle_image_set_on(toggleimg, TRUE egl_window_add_object(hwin, toggleimg egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 41
Label Function Description egl_create_label Label object 를생성한다. egl_label_set_text Label text 를설정한다. egl_label_set_redraw_bg Label 배경을 draw 할지를결정한다. egl_label_set_color Label text color 를설정한다. 42
egl_create_label function EGL_HANDLE egl_create_label( int x, int y, int w, int h, const char* text Label object 를생성한다. int x label의 x 좌표. int y label의 y 좌표. int w label의가로크기. int h label의세로크기. const char* text label의 text. 생성된 label handle. EGL_HADLE label; label = egl_create_label( 100, 100, 150, 50, label test 43
egl_label_set_text function BOOL egl_label_set_text( EGL_HANDLE h, char* text Label 의 text 를변경한다. EGL_HANDLE h char text Text 를변경할 label handle. 변경할 text. TRUE or FALSE EGL_HADLE label; label = egl_create_label( 100, 100, 150, 50, label test egl_label_set_text( label, change text 44
egl_label_set_redraw_bg function void egl_label_set_redraw_bg( EGL_HANDLE h, BOOL b Label 배경을 draw 할지를결정한다. label 을단독 object 로사용할경우 TRUE 로설정해야한다. EGL_HANDLE hobj 상태를설정할 label handle. BOOL b 설정값. TRUE or FALSE 없음. EGL_HADLE label; label = egl_create_label( 100, 100, 150, 50, label test egl_label_set_redraw_bg(label, TRUE 45
egl_label_set_color function void egl_label_set_color( EGL_HANDLE h, EGL_COLOR clr Label text color 를설정한다. EGL_HANDLE h EGL_COLOR clr Color를변경할 label handle. Color value. MAKE_COLORREF(r, g, b) 매크로함수를사용하면 color 지정을쉽게할수있다. 없음. EGL_HADLE label; label = egl_create_label( 100, 100, 150, 50, label test egl_label_set_color( label, MAKE_COLORREF( 0, 255, 0 ) 46
Label. extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; EGL_HANDLE label; egl_init( label = egl_create_label(50, 50, 100, 30, label egl_label_set_redraw_bg(label, TRUE egl_label_set_color(label, MAKE_COLORREF(0, 0, 255 egl_window_add_object(hwin, label egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 47
Check button / Radio button Function Description egl_create_checkbutton Check / Radio button 을생성한다. egl_checkbutton_callback Check / Radio button 이벤트가발생했을때호출될 callback 함수를등록한다. egl_checkbutton_set_check Check / Radio button 을 check / uncheck 상태를설정한다. egl_checkbutton_get_check Check / Radio button 의현재 check 상태값을가져온다. egl_checkbutton_set_style Check / Radio button 의 style 을변경한다. Define CHECK_EVENT typedef enum CHECK_CHECKED = 0, CHECK_UNCHECKED,, CHECK_EVENT; 48
egl_create_checkbutton function EGL_HANDLE egl_create_checkbuttonk( int x, int y, int w, int h, const char* text, CHECK_STYLE style Check / Radio button 을생성한다. int x 생성될 Check / Radio button의 x좌표. int y 생성될 Check / Radio button의 y좌표. int w 생성될 Check / Radio button의가로크기. int h 생성될 Check / Radio button의세로크기. const char* text Check / Radio button에출력될 text. CHECK_STLE style Check / Radio button의 style. Check button ->CHECK_STYLE_CHECKBUTTON. Radio button ->CHECK_STYLE_RADIOBUTTON. 생성된 Check / Radio button 의 handle. EGL_HANDLE check; EGL_HANDLE radio; check = egl_create_checkbutton(100,100, 100, 32, Check, CHECK_STYLE_CHECKBUTTON radio = egl_create_checkbutton(250, 100, 100, 32, Radio, CHECK_STYLE_RADIOBUTTON 49
egl_checkbutton_callback function BOOL egl_button_callback( EGL_HANDLE hobj, EVENT_CALLBACK cb Check / Radio button 이벤트가발생했을때호출될 callback 함수를등록한다. EGL_HANDLE hobj Callback 함수가등록되는 Check / Radio button handle. EVENT_CALLBACK cb Event 발생시호출되는 callback 함수. TRUE or FALSE Void check_callback(egl_handle h, int event) if(event == CHECK_CHECKED) else if(event == CHECK_UNCHECKED) int main() EGL_HANDLE check; check = egl_create_checkbutton(100, 100, 100, 32, Check, STYLE_CHECKBUTTON egl_checkbutton_callback(check, check_callback 50
egl_checkbutton_set_check function void egl_checkbutton_set_check( EGL_HANDLE hobj, BOOL b Check / Radio button 을 check / uncheck 상태를설정한다. EGL_HANDLE hobj BOOL b Check 상태를설정할 Check / Radio button handle. TRUE = Check. FALSE = Uncheck. 없음. EGL_HANDLE check; EGL_HANDLE radio; check = egl_create_checkbutton(100, 100, 100, 32, Check, STYLE_CHECKBUTTON radio = egl_create_checkbutton(200, 100, 100, 32, Radio, STYLE_RADIOBUTTON egl_checkbutton_set_check(check, TRUE egl_checkbutton_set_check(radio, FASLE 51
egl_checkbutton_get_check function BOOL egl_checkbutton_get_check( EGL_HANDLE hobj, Check / Radio button 의현재 check 상태값을가져온다. EGL_HANDLE hobj Check 상태를가지고올 Check / Radio button handle. Check 상태를반환. TRUE = check. FALSE = uncheck. EGL_HANDLE check; EGL_HANDLE radio; BOOL check_status = 0; BOOL radio_status = 0; check = egl_create_checkbutton(100, 100, 100, 32, Check, STYLE_CHECKBUTTON radio = egl_create_checkbutton(200, 100, 100, 32, Radio, STYLE_RADIOBUTTON check_status = egl_checkbutton_get_check(check radio_status = egl_checkbutton_get_check(radio 52
egl_checkbutton_set_style function void egl_checkbutton_set_style( EGL_HANDLE hobj, CHECK_STYLE style Check / Radio button 의 style 을변경한다. EGL_HANDLE hobj CHECK_STYLE style Style을변경할 Check / Radio button handle. Check / Radio button의 style. Check button ->CHECK_STYLE_CHECKBUTTON. Radio button ->CHECK_STYLE_RADIOBUTTON. 없음 EGL_HANDLE check; EGL_HANDLE radio; check = egl_create_checkbutton(100, 100, 100, 32, Check, CHECK_STYLE_CHECKBUTTON radio = egl_create_checkbutton(200, 100, 100, 32, Radio, CHECK_STYLE_RADIOBUTTON egl_checkbutton_set_style(check, CHECK_STYLE_RADIOBUTTON egl_checkbutton_set_style(radio, CHECK_STYLE_CHECKBUTTON 53
Check / Radio button. EGL_HANDLE check; EGL_HANDLE radio1; EGL_HANDLE radio2; void check_callback(egl_handle h, int event) if(event == CHECK_CHECKED) if(egl_checkbutton_get_check()) debugprintf( status : checked\r\n else debugprintf( status : unchecked\r\n void radio1_callback(egl_handle h, int event) if(event == CHECK_CHECKED) debugprintf( radio1 select\r\n egl_checkbutton_set_check(radio2, FALSE void radio2_callback(egl_handle h, int event) if(event == CHECK_CHECKED) debugprintf( radio2 select\r\n egl_checkbutton_set_check(radio1, FALSE 54
extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; egl_init( check = egl_create_checkbutton(100, 100, 100, 32, Check, CHECK_STYLE_CHECKBUTTON egl_checkbutton_callback(check, check_callback radio1 = egl_create_checkbutton(250, 100, 100, 32, Radio1, CHECK_STYLE_RADIOBUTTON egl_checkbutton_callback(radio1, radio1_callback radio2 = egl_create_checkbutton(250, 160, 100, 32, Radio2, CHECK_STYLE_RADIOBUTTON egl_checkbutton_callback(radio2, radio2_callback egl_window_add_object(hwin, check egl_window_add_object(hwin, radio1 egl_window_add_object(hwin, radio2 egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 55
Progress Bar Function Description egl_create_progressbar Progress bar 를생성한다. egl_progressbar_set_barcolor Progress bar 의 bar color 를설정한다. egl_progressbar_set_bgcolor Progress bar 의 back ground color 를설정한다. egl_progressbar_set_textcolor Progress bar 의 text color 를설정한다. egl_progressbar_set_text Progress bar 의 text 를설정한다. egl_progressbar_set_pos Progress bar 의 bar position 을설정한다. egl_progressbar_get_pos Progress bar 의현재 bar position value 를가져온다. 56
egl_create_progressbar function EGL_HANDLE egl_create_progressbar( int x, int y, int w, int h, const char* text, BOOL style BOOL bvertical Progress bar 를생성한다. int x 생성될 Progress bar의 x좌표. int y 생성될 Progress bar의 y좌표 int w 생성될 Progress bar의가로크기 int h 생성될 Progress bar의세로크기 const char* text Progress bar에출력될 text. BOOL style Progress bar의 style. Nomal = STYLE_PGBAR_NOMAL. Divide bar = STYLE_PGVAR_DIV. BOOL bvertical Progress의출력형태. TRUE = Vertical. FALSE = Horizontal. 생성된 Progress bar 의 handle. 57
EGL_HANDLE pgbar; pgbar = egl_create_progressbar(100, 100, 200, 40, Progress, STYLE_PGBAR_NOMAL,FALSE 58
egl_progressbar_set_barcolor function void egl_progressbar_set_barcolor( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b Progress bar 의 bar color 를설정한다. EGL_HANDLE hobj Bar color를설정할 Progress bar handle. unsigned char r RGB 중 Red 값. unsigned char g RGB 중 Green 값. unsigned char b RGB 중 Blue 값. 없음. EGL_HANDLE pgbar; pgbar = egl_create_progressbar(100,100,200,40, Progress, STYLE_PGBAR_NOMAL, FALSE egl_progressbar_set_barcolor(pgbar, 0, 0, 0xff 59
egl_progressbar_set_bgcolor function void egl_progressbar_set_bgcolor( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b Progress bar 의 back ground color 를설정한다. EGL_HANDLE hobj Back ground color를설정할 Progress bar handle. unsigned char r RGB 중 Red 값. unsigned char g RGB 중 Green 값. unsigned char b RGB 중 Blue 값. 없음. EGL_HANDLE pgbar; pgbar = egl_create_progressbar(100,100,200,40, Progress, STYLE_PGBAR_NOMAL, FALSE egl_progressbar_set_bgcolor(pgbar, 0, 0xff, 0 60
egl_progressbar_set_textcolor function void egl_progressbar_set_textcolor( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b Progress bar 의 text color 를설정한다. EGL_HANDLE hobj Text color를설정할 Progress bar handle. unsigned char r RGB 중 Red 값. unsigned char g RGB 중 Green 값. unsigned char b RGB 중 Blue 값. 없음. EGL_HANDLE pgbar; pgbar = egl_create_progressbar(100,100,200,40, Progress, STYLE_PGBAR_NOMAL, FALSE egl_progressbar_set_textcolor(pgbar, 0xff, 0, 0xff 61
egl_progressbar_set_text function void egl_progressbar_set_text( EGL_HANDLE hobj, const char* text Progress bar 의 text 를설정한다. EGL_HANDLE hobj const char* text Text 를설정할 Progress bar handle. 설정할 Text. 없음. EGL_HANDLE pgbar; pgbar = egl_create_progressbar(100,100,200,40, Progress, STYLE_PGBAR_NOMAL, FALSE egl_progressbar_set_text(pgbar, text1 62
egl_progressbar_set_pos function void egl_progressbar_set_pos( EGL_HANDLE hobj, int value Progress bar 의 bar position 을설정한다. EGL_HANDLE hobj Bar position 을변경할 Progress bar handle. int value Bar position 값 ( 0 ~ 100% ) 없음. EGL_HANDLE pgbar; pgbar = egl_create_progressbar(100,100,200,40, Progress, STYLE_PGBAR_NOMAL, FALSE egl_progressbar_set_pos(pgbar, 50 63
egl_progressbar_get_pos function int egl_progressbar_get_pos( EGL_HANDLE hobj Progress bar 의현재 bar position value 를가져온다. EGL_HANDLE hobj Bar position value 를가져올 Progress bar handle. Bar position value. ( 0 ~ 100%) EGL_HANDLE pgbar; int pgbar_pos; pgbar = egl_create_progressbar(100,100,200,40, Progress, STYLE_PGBAR_NOMAL, FALSE pgbar_pos = egl_progressbar_get_pos(pgbar 64
Progress Bar. EGL_HANDLE pgbar; int value = 0; void pgbar_callback(egl_handle h, int event) value++; if(value >100) value = 0; egl_progressbar_set_pos(pgbar, value extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; egl_init( pgbar = egl_create_progressbar(100, 100, 200, 40, progress, STYLE_PGBAR_NOMAL,FALSE egl_progress_callback(pgbar, pgbar_callback egl_window_add_object(hwin, pgbar egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 65
Scroll Bar Function Description egl_create_scrollbar Scroll bar 를생성한다. egl_scrollbar_callback Scroll bar 이벤트가발생했을때호출될 callback 함수를등록한다. egl_scroll_set_position Scroll bar 의 thumb position 을설정한다. egl_scroll_get_position Scroll bar 의 thumb position 을가져온다. egl_scroll_set_totalcount Scroll bar 의 total count 를설정한다. egl_scroll_get_totalcount Scroll bar 의 total count 를가져온다. egl_scroll_set_view_count Scroll bar 의 view count 를설정한다. egl_scroll_get_view_count Scroll bar 의 view count 를가져온다. egl_scroll_set_upcount Scroll bar 의 up count 를설정한다. egl_scroll_get_upcount Scroll bar 의 up count 를가져온다. egl_scroll_set_bgcolor Scroll bar 의 back ground color 를설정한다. egl_scroll_set_size Scrollbar 의크기를설정한다. 66
Define SCROLLBAR_EVENT typedef enum SCBAR_CLICKED = 0, SCROLLBAR_EVENT; 67
egl_create_scrollbar function EGL_HANDLE egl_create_scrollbar( int x, int y, int w, int h, int totalcount, int viewcount, BOOL bvertical Scroll bar 를생성한다. int x 생성될 Scroll bar의 x좌표. int y 생성될 Scroll bar의 y좌표. int w 생성될 Scroll bar의가로크기. int h 생성될 Scroll bar의세로크기. int totalcount Scroll bar가관리할항목의전체크기. int viewcount Scroll bar의 thumb가표시할항목의크기 BOOL bvertical Scroll bar의출력형태. TRUE = Vertical. FALSE = Horizontal. 생성된 Scroll bar handle. 68
EGL_HANDLE scroll; scroll = egl_create_scrollbar(100, 100, 30, 200, 30, 10, TRUE 69
egl_scrollbar_callback function BOOL egl_scrollbar_callback( EGL_HANDLE hobj, EVENT_CALLBACK cb Scroll bar 이벤트가발생했을때호출될 callback 함수를등록한다. ELG_HANDLE hobj Callback 함수를등록할 Scroll bar handle. EVENT_CALLBACK cb 호출될 callback 함수. TRUE or FALSE void scroll_callback(egl_handle h, int event) int main() EGL_HANDLE scroll; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_callback(check, scroll_callback 70
egl_scroll_set_position function void egl_scroll_set_position( EGL_HANDLE hobj, int totalcount, int viewcount, int upcount Scroll bar 의 thumb position 을설정한다. EGL_HANDLE hobj Thumb position을설정할 Scroll bar handle. int totalcount Scroll bar가관리할항목의전체크기. int viewcount Scroll bar의 thumb가표시할항목의크기. int upcount Scroll bar의 thumb 이전항목의크기. 없음. EGL_HANDLE scroll; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_set_position(scroll, 25, 5, 10 71
egl_scroll_get_position function void egl_scroll_get_position( EGL_HANDLE hobj, int* totalcount, int* viewcount, int* upcount Scroll bar 의 thumb position 을가져온다. EGL_HANDLE hobj Thumb position을가져올scroll bar handle. int* totalcount Total count를저장할포인터. int* viewcount View count를저장할포인터. int* upcount Up count를저장할포인터. 없음. EGL_HANDLE scroll; int totalcount = 0; int viewcount = 0; int upcount = 0; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_get_position(scroll, &totalcount, &viewcount, &upcount 72
egl_scroll_set_totalcount function void egl_scroll_set_totalcount( EGL_HANDLE hobj, int totalcount Scroll bar 의 total count 를설정한다. EGL_HANDLE hobj Total count 를설정할 Scroll bar handle. int totalcount Scroll bar 가관리할항목의전체크기. 없음. EGL_HANDLE scroll; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_set_totalcount(scroll, 45 73
egl_scroll_get_totalcount function int egl_scroll_get_totalcount( EGL_HANDLE hobj Scroll bar 의 total count 를가져온다. EGL_HANDLE hobj Total count 를가져올 Scroll bar handle. Total count value. EGL_HANDLE scroll; int totalcount = 0; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE totalcount = egl_scroll_get_totalcount(scroll 74
egl_scroll_set_viewcount function void egl_scroll_set_viewcount( EGL_HANDLE hobj, int viewcount Scroll bar 의 view count 를설정한다. EGL_HANDLE hobj View count 를설정할 Scroll bar handle. int viewcount Scroll bar 의 thumb 가표시할항목의크기. 없음. EGL_HANDLE scroll; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_set_viewcount(scroll, 5 75
egl_scroll_get_viewcount function int egl_scroll_get_viewcount( EGL_HANDLE hobj Scroll bar 의 view count 를가져온다. EGL_HANDLE hobj View count 를가져올 Scroll bar handle. View count value. EGL_HANDLE scroll; int viewcount = 0; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE viewcount = egl_scroll_get_viewcount(scroll 76
egl_scroll_set_upcount function void egl_scroll_set_upcount( EGL_HANDLE hobj, int upcount Scroll bar 의 up count 를설정한다. EGL_HANDLE hobj Up count 를설정할 Scroll bar handle. int upcount Scroll bar 의 thumb 이전항목의크기. 없음. EGL_HANDLE scroll; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_set_upcount(scroll, 10 77
egl_scroll_get_upcount function int egl_scroll_get_upcount( EGL_HANDLE hobj Scroll bar 의 up count 를가져온다. EGL_HANDLE hobj Up count 를가져올 Scroll bar handle. Up count value. EGL_HANDLE scroll; int upcount = 0; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE upcount = egl_scroll_get_upcount(scroll 78
egl_scroll_set_bgcolor function void egl_scroll_set_bgcolor( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b ) Scroll bar 의 back ground color 를설정한다. EGL_HANDLE hobj Back ground color를설정할 Scroll bar handle. unsigned char r RGB 중 Red 값. unsigned char g RGB 중 Green 값. unsigned char b RGB 중 Blue 값. 없음. EGL_HANDLE scroll; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_set_bgcolor(scroll, 0, 0, 0xff 79
egl_scroll_set_size function void egl_scroll_set_size( EGL_HANDLE hobj, int w, int h ) Scroll bar 의크기를설정한다. EGL_HANDLE hobj 크기를설정할 Scroll bar handle. int w 가로크기. int h 세로크기. 없음. EGL_HANDLE scroll; scroll = egl_create_scrollbar(100,100, 30, 200, 30, 10, TRUE egl_scroll_set_size(scroll, 40, 200 80
Scroll Bar. EGL_HANDLE scroll; void scroll_callback(egl_handle h, int event) int totalcount = 0; int viewcount = 0; int upcount = 0; if(event == SCBAR_CLICKED) egl_scroll_get_position(scroll, &totalcount, &viewcount, &upcount debugprintf( %d, %d, %d \r\n, totalcount, viewcount, upcount extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; egl_init( scroll = egl_create_scrollbar(100, 100, 30, 200, 30, 10, TRUE egl_scroll_set_totalcount(scroll, 40 egl_scroll_callback(scroll, scroll_callback egl_window_add_object(hwin, scroll egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 81
Slider Function Description egl_create_slider Slider 를생성한다. egl_slider_callback Slider 이벤트가발생했을때호출될 callback 함수를등록한다. egl_slider_set_pos Slider 의 thumb position 을설정한다. egl_slider_get_pos Slider 의 thumb position 값을가져온다. egl_slider_set_range Slider 의 range 를설정한다. egl_slider_get_range Slider 의 range 를가져온다. egl_slider_stepit Slider 를전후로한 step 이동한다. egl_slider_set_tick_frequency Slider 의 tick 빈도수를설정한다. egl_slider_set_tick_style Slider 의 tick style 을설정한다. egl_slider_set_thumb_size Slider 의 thumb size 를설정한다. egl_slider_get_thumb_size Slider 의 thumb size 를가져온다. egl_slider_set_barcolor Slider 의 bar color 를설정한다. egl_slider_set_tickcolor Slider 의 tick color 를설정한다. 82
Function Description egl_slider_set_transparent Slider 의배경을투명하게할지를결정한다. define SLIDER_EVENT typedef enum SLR_CLICKED = 0, SLIDER_EVENT; 83
egl_create_slider function EGL_HANDLE egl_create_slider( int x, int y, int w, int h, int range, TICKSTYLE style, BOOL bvertical Slider 를생성한다. int x 생성될 Slider의 x좌표. int y 생성될 Slider의 y좌표. int w 생성될 Slider의가로크기. int h 생성될 Slider의세로크기. int range 생성될 Slider의 Range. TICKSTYLE style 생성될 Slider의 Tick style TICK_NONE : 눈금표시없음. TICK_TOPLEFT : 눈금표시가위쪽또는좌측에표시. TICK_BOTTOMRIGHT : 눈금표시가아래쪽또는우측에표시. TICK_BOTH : 눈금표시가양쪽에표시. BOOL bvertical Slider의출력형태. TRUE = Vertical. FALSE = Horizontal. 생성된 Slider handle. 84
EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE 85
egl_slider_callback function BOOL egl_slider_callback( EGL_HANDLE hobj, EVENT_CALLBACK cb Slider 이벤트가발생했을때호출될 callback 함수를등록한다. EGL_HANDLE hobj Callback 함수를등록할 Slider handle. EVENT_CALLBACK cb 호출될 callback 함수. TRUE or FALSE Void slider_callback(egl_handle h, int event) int main() EGL_HANDLE slider; slider = egl_create_slider(100,100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_callback(check, slider_callback 86
egl_slider_set_pos function void egl_slider_set_pos( EGL_HANDLE hobj, int npos Slider 의 thumb position 을설정한다. EGL_HANDLE hobj int npos Position 을설정할 Slider handle. Position 위치. (npos 는정수로 0 ~ range) 없음. EGL_HANDLE slider; slider = egl_create_slider(100,100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_pos(slider, 2 87
egl_slider_get_pos function int egl_slider_get_pos( EGL_HANDLE hobj Slider 의 thumb position 값을가져온다. EGL_HANDLE hobj Position 을가져올 Slider handle. Position value. EGL_HANDLE slider; int slider_pos = 0; slider = egl_create_slider(100,100, 200, 40, 10, TICK_BOTH, FALSE slider_pos = egl_slider_get_pos(slider 88
egl_slider_set_range function void egl_slider_set_range( EGL_HANDLE hobj, int nminpos, int nmaxpos Slider 의 range 를설정한다. EGL_HANDLE hobj Range를설정할 Slider handle. int nminpos Min position 값. ( range = Max position Min position ). int nmaxpos Max position 값. ( range = Max position Min position). 없음. EGL_HANDLE slider; slider = egl_create_slider(100,100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_range(slider, 0, 15 89
egl_slider_get_range function void egl_slider_get_range( EGL_HANDLE hobj, int* IpMinPos, int* IpMaxPos Slider 의 range 를가져온다. EGL_HANDLE hobj Range 값을가져올 Slider handle. int* IpMinPos Min position 값을저장할포인터. int* IpMaxPos Max position 값을저장할포인터. 없음. EGL_HANDLE slider; int max_pos = 0; int min_pos = 0; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_get_range(slider, &min_pos, &max_pos 90
egl_slider_stepit function void egl_slider_stepit( EGL_HANDLE hobj, BOOL inc Slider 를전후로한 step 이동한다. EGL_HANDLE hobj Step 이동할 Slider handle. BOOL inc Step의증가 / 감소를결정. TRUE = 증가. FALSE = 감소. 없음. EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_stepit(slider, TRUE //egl_slider_stepit(slider, FALSE 91
egl_slider_set_tick_frequency function void egl_slider_set_tick_frequency( EGL_HANDLE hobj, int freq Slider 의 tick 빈도수를설정한다. EGL_HANDLE hobj int freq Tick 출력빈도수. Tick 빈도수를설정할 Slider handle. 없음. EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_tick_frequency(slider, 2 92
egl_slider_set_tick_style function void egl_slider_set_tick_frequency( EGL_HANDLE hobj, TICKSTYLE style Slider 의 tick style 을설정한다. EGL_HADNE hobj TICKSTYLE style Tick style을설정할 Slider handle. TICK style. TICK_NONE : 눈금표시없음. TICK_TOPLEFT : 눈금표시가위쪽또는좌측에표시. TICK_BOTTOMRIGHT : 눈금표시가아래쪽또는우측에표시. TICK_BOTH : 눈금표시가양쪽에표시. 없음. EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_tick_style(slider, TICK_BOTTOMRIGHT 93
egl_slider_set_thumb_size function void egl_slider_set_thumb_size( EGL_HANDLE hobj, int width, int height Slider 의 thumb size 를설정한다. EGL_HANDLE hobj Thumb size를설정할 Slider handle. int width Thumb의가로크기. int height Thumb의세로크기. 없음. EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_thumb_size(slider, 10, 30 94
egl_slider_get_thumb_size function void egl_slider_get_thumb_size( EGL_HANDLE hobj, int* w, int* h ) Slider 의 thumb size 를가져온다. EGL_HANDLE hobj Thumb size를가져올 Slider handle. int* w Thumb 가로크기를저장할포인터. int* h Thumb 세로크기를저장할포인터. 없음. EGL_HANDLE slider; int w = 0; int h = 0; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_get_thumb_size(slider, &w, &h 95
egl_slider_set_barcolor function void egl_slider_set_barcolor( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b Slider 의 bar color 를설정한다. EGL_HANDLE hobj Bar color를설정할 Slider handle. unsigned char r RGB 중 Red 값. unsigned char g RGB 중 Green 값. unsigned char b RGB 중 Blue 값. 없음. EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_barcolor(slider, 0, 0xff, 0 96
egl_slider_set_tickcolor function void egl_slider_set_tickcolor( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b Slider 의 tick color 를설정한다. EGL_HANDLE hobj Tick color를설정할 Slider handle. unsigned char r RGB 중 Red 값. unsigned char g RGB 중 Green 값. unsigned char b RGB 중 Blue 값. 없음. EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_tickcolor(slider, 0xff, 0, 0 97
egl_slider_set_transparent function void egl_slider_set_transparent( EGL_HANDLE hobj, BOOL bflag Slider 의배경을투명하게할지를결정한다. EGL_HANDLE hobj 배경을투명하게설정할 Slider handle. BOOL bflag TRUE => 배경투명. FALSE => 배경불투명. 없음. EGL_HANDLE slider; slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_slider_set_transparent(slider, TRUE 98
Slider. EGL_HANDLE slider; void slider_callback(egl_handle h, int event) if(event == SLR_CLICKED) debugprintf( position = %d\r\n,egl_slider_get_pos() extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; egl_init( slider = egl_create_slider(100, 100, 200, 40, 10, TICK_BOTH, FALSE egl_sliderl_callback(slider, slider_callback egl_window_add_object(hwin, slider egl_window_show(hwin egl_draw( while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt egl_draw( 99
List Box Function Description egl_create_listbox List box 를생성한다. egl_listbox_callback List box 이벤트가발생했을때호출될 callback 함수를등록한다. egl_listbox_additem List box 에 Item 을추가한다. egl_listbox_delitem List box 의마지막 Item 을제거한다. egl_listbox_delitem_text List box 에서 text 에해당되는 Item 을제거한다. egl_listbox_alldelitem List box 의모든 Item 을제거한다. egl_listbox_get_all_itemlist List box 의모든 Item 들의 text 목록을반환한다. egl_listbox_get_sel_item List box 가 Single Mode 일때선택된 Item 의 text 를반환한다. egl_listbox_get_multiple_sel_itemlist List box 가 Multiple Mode 일때선택된 Item 들의 text 목록을반 환한다. egl_listbox_set_bgcolor List box 의배경색을지정한다. egl_listbox_set_selbgcolor List box 에서선택된 Item 의배경색을지정한다. 100
Function Description egl_listbox_set_textcolor List box 의글자색을지정한다. egl_listbox_set_seltextcolor List box 에서선택된 item 의글자색을지정한다. egl_listbox_set_scrollwidth List box 의 scrollbar 의가로크기를설정한다. Define LIST_EVENT typedef enum LIST_CHANGED = 0, LIST_EVENT; 101
egl_create_listbox function EGL_HANDLE egl_create_listbox( int x, int y, int w, int h, bool bmultiple List box 를생성한다. int x 생성될 List box의 x좌표. int y 생성될 List box의 y좌표. int w 생성될 List box의가로크기. int h 생성될 List box의세로크기. Bool bmultiple 생성될 List box에서복수 item 선택여부를설정한다. 생성된 List box 의 pointer EGL_HANDLE listbox[2]; listbox [0] = egl_create_button (100, 100, 200, 200, TRUE listbox [1] = egl_create_button (400, 100, 200, 200, FALSE 102
egl_listbox_callback function void egl_listbox_evnet_callback ( EGL_HANDLE hobj, EVENT_CALLBACK cb List box 이벤트가발생했을때호출될 callback 함수를등록한다. EGL_HANDLE hobj EVENT_CALLBACK cb 이벤트가발생되는 List box 의 handle 이벤트가발생했을때호출될 callback 함수 없음. static void listbox_callback(egl_handle h, int event) if(event == LIST_CHANGED) debugprintf( LIST_CHANGED void main(void) EGL_HANDLE listbox; egl_listbox_event_callback(listbox, listbox_callback 103
egl_listbox_additem function void egl_listbox_additem ( EGL_HANDLE hobj, const char* text List box 에 Item 을추가한다. EGL_HANDLE hobj const char* text Item 을추가할 List box 의 handle 추가할 Item 의 text 없음. EGL_HANDLE listbox; egl_listbox_additem(listbox, ListboxItem 1 104
egl_listbox_delitem function void egl_listbox_delitem ( EGL_HANDLE hobj List box 의마지막 Item 을제거한다. EGL_HANDLE hobj Item 을제거할 List box 의 handle 없음. EGL_HANDLE listbox; egl_listbox_delitem(listbox 105
egl_listbox_delitem_textfunction BOOL egl_listbox_delitem_text ( EGL_HANDLE hobj, const char* text List box 에서 text 에해당되는 Item 을제거한다. EGL_HANDLE hobj const char* text Item 을제거할 List box 의 handle List box 에서제거할 Item 의 text Item 제거의성공여부를반환 EGL_HANDLE listbox; if(egl_listbox_delitem_text(listbox, ListboxItem 1 ) == TRUE) debugprintf( egl_listbox_delitem_text complete\n 106
egl_listbox_delitem_text function void egl_listbox_delitem_text ( EGL_HANDLE hobj, const char* text List box 에서 text 에해당되는 Item 을제거한다. EGL_HANDLE hobj const char* text Item 을제거할 List box 의 handle 제거할 item 의 text. 없음. EGL_HANDLE listbox; egl_listbox_delitem_text(listbox, item1 107
egl_listbox_delitem_textfunction BOOL egl_listbox_delitem_text ( EGL_HANDLE hobj, const char* text List box 에서 text 에해당되는 Item 을제거한다. EGL_HANDLE hobj const char* text Item 을제거할 List box 의 handle List box 에서제거할 Item 의 text Item 제거의성공여부를반환 EGL_HANDLE listbox; if(egl_listbox_delitem_text(listbox, ListboxItem 1 ) == TRUE) debugprintf( egl_listbox_delitem_text complete\n 108
egl_listbox_alldelitem function void egl_listbox_alldelitem ( EGL_HANDLE hobj, List box 의모든 Item 을제거한다. EGL_HANDLE hobj Item 을제거할 List box 의 handle 없음 EGL_HANDLE listbox; egl_listbox_alldelitem(listbox 109
egl_listbox_ get_all_itemlist function const char** egl_listbox_get_all_itemlist ( EGL_HANDLE hobj, int* itemcnt List box 의모든 Item 들의 text 목록을반환한다. EGL_HANDLE hobj int* itemcnt Item 의 text 목록을반환받을 List box 의 handle List box 의 Item 개수를반환받을변수의 pointer 모든 Item 의 text list pointer 주의 : 반드시 return 받은 list pointer 의메모리를해제하여야한다. EGL_HANDLE listbox; int ItemCnt; const char** ItemTextList; ItemTextList = egl_listbox_all_itemlist(listbox, &ItemCnt free(itemtextlist 110
egl_listbox_ get_sel_item function const char* egl_listbox_get_sel_item ( EGL_HANDLE hobj, int* index List box 가 Single Mode 일때선택된 Item 의 Text 를반환한다 EGL_HANDLE hobj Int* index 선택된 Item 의 text 를반환받을 List box 의 handle 선택된 Item 의순번을반환받을변수의 pointer 선택된 Item 의 text pointer EGL_HANDLE listbox; int selectitemindex; const char* selectitemtext; selectitemtext = egl_listbox_get_sel_item(listbox, &selectitem 111
egl_listbox_ get_ multiple_sel_itemlist function const char** egl_listbox_get_multiple_sel_itemlist ( EGL_HANDLE hobj, int* selcnt List box 가 Multiple Mode 일때선택된 Item 의 text 들의목록을반환한다. EGL_HANDLE hobj int* selcnt 선택된 Item 들의 text 를반환받을 List box 의 handle 선택된 Item 의개수를반환받을변수의 pointer 선택된 Item 들의 text list pointer 주의 : 반드시 return 받은 list pointer 의메모리를해제하여야한다. EGL_HANDLE listbox; int selectitemcnt; const char** selectitemtextlist; selectitemtextlist = egl_listbox_get_sel_itemlist (listbox, & selectitemcnt free(selectitemtextlist 112
egl_listbox_ set_bgcolor function void egl_listbox_ set_bgcolor ( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b List box 의배경색을지정한다. EGL_HANDLE hobj unsigned char r unsigned char g unsigned char b 배경색을지정할 List box의 handle 지정될배경색의 RGB값중 Red값지정될배경색의 RGB값중 Green값지정될배경색의 RGB값중 Blue값 없음 EGL_HANDLE listbox; egl_listbox_set_bgcolor(listbox, 0x0, 0x0, 0xFF // Blue 113
egl_listbox_ set_selbgcolor function void egl_listbox_ set_selbgcolor ( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b List box 에서선택된 Item 의배경색을지정한다. EGL_HANDLE hobj unsigned char r unsigned char g unsigned char b 선택된 Item의배경색을지정할 List box의 handle 지정될배경색의 RGB값중 Red값지정될배경색의 RGB값중 Green값지정될배경색의 RGB값중 Blue값 없음 EGL_HANDLE listbox; egl_listbox_set_selbgcolor(listbox, 0xFF, 0x0, 0x0 // Red 114
egl_listbox_ set_textcolor function void egl_listbox_ set_textcolor ( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b List box 의글자색을지정한다. EGL_HANDLE hobj unsigned char r unsigned char g unsigned char b 글자색을지정할 List box의 handle 지정될글자색의 RGB값중 Red값지정될글자색의 RGB값중 Green값지정될글자색의 RGB값중 Blue값 없음 EGL_HANDLE listbox; egl_listbox_set_textcolor(listbox, 0x0, 0x0, 0x0 // Black 115
egl_listbox_ set_seltextcolor function void egl_listbox_ set_seltextcolor ( EGL_HANDLE hobj, unsigned char r, unsigned char g, unsigned char b List box 에서선택된 Item 의글자색을지정한다. EGL_HANDLE hobj unsigned char r unsigned char g unsigned char b 선택된 Item의글자색을지정할 List box의 handle 지정될글자색의 RGB값중 Red값지정될글자색의 RGB값중 Green값지정될글자색의 RGB값중 Blue값 없음 EGL_HANDLE listbox; egl_listbox_set_seltextcolor(listbox, 0xFF, 0xFF, 0xFF // White 116
egl_listbox_ set_scrollwidth function void egl_listbox_ set_scrollwidth ( EGL_HANDLE hobj, int width List box 의 scrollbar 의가로크기를설정한다. EGL_HANDLE hobj int width Scrollbar 의가로크기. Scrollbar 의가로크기를설정할 List box 의 handle 없음 EGL_HANDLE listbox; egl_listbox_set_scrollwidth(listbox, 40 117
List box. #include "adstar.h" extern BOOL process_touch(bool* touchdown,egl_point* ppoint static void listbox_cb1(egl_handle h, int event) int itemcnt, index; const char **itemlist; const char *selitem; int i; if(event == LIST_CHANGED) debugprintf("list_changed\r\n" // Get all item list itemlist = egl_listbox_get_all_itemlist(h, &itemcnt debugprintf("all Item %d\r\n", itemcnt for(i = 0; i < itemcnt; i++) debugprintf("item : [%s]\r\n", itemlist[i] // Get selected item list selitem = egl_listbox_get_sel_item(h, &index debugprintf("selected Item [%d] : [%s]\r\n", index, selitem free(itemlist static void listbox_cb2(egl_handle h, int event) int selcnt; const char **selitemlist; int i; if(event == LIST_CHANGED) debugprintf("list_changed\r\n" selitemlist = egl_listbox_get_multiple_sel_itemlist(h, &selcnt debugprintf("selected Items %d \r\n", selcnt for(i = 0; i < selcnt; i++) debugprintf("selected Item : [%s]\r\n", selitemlist[i] 118
free(selitemlist void user_main() float addpos=1.0f; EGL_POINT touch_pt; BOOL touchdown=false; EGL_HANDLE hwin; EGL_HANDLE listbox[2]; egl_init( hwin = egl_create_window("main Window" listbox[0] = egl_create_listbox(100, 100, 200, 200, FALSE listbox[1] = egl_create_listbox(400, 100, 200, 200, TRUE egl_listbox_callback(listbox[0], listbox_cb1 egl_listbox_callback(listbox[1], listbox_cb2 int i; char str_text[16]; for(i=0;i<100;i++) sprintf(str_text,"listboxitem %d",i egl_listbox_additem(listbox[0],str_text egl_listbox_additem(listbox[1],str_text // Delete last item egl_listbox_delitem(listbox[0] // Delete "ListBoxItem 3" item egl_listbox_delitem_text(listbox[1], "ListBoxItem 3" // Set background color egl_listbox_set_bgcolor(listbox[1], 0xff, 0xff, 0xff // Set selected background color egl_listbox_set_selbgcolor(listbox[1], 0x66, 0x0, 0x0 // Set text color egl_listbox_set_textcolor(listbox[1], 0, 0, 0x66 119
// Set selected text color egl_listbox_set_seltextcolor(listbox[1], 0xff, 0xff, 0xff egl_window_add_object(hwin, listbox[0] egl_window_add_object(hwin, listbox[1] egl_window_show(hwin, TRUE egl_draw( while(1) BOOL bevent = TRUE; if(process_touch(&touchdown, &touch_pt)) egl_user_touch_input(touchdown, &touch_pt else bevent = FALSE; egl_draw( 120
Circle Gauge Function Description egl_create_circle_gauge Circle gauge 를생성한다. egl_circle_gauge_set_value Circle gauge 값을설정한다. egl_circle_gauge_get_value Circle gauge 값을가져온다. 121
egl_create_circle_gauge function EGL_HANDLE egl_create_circle_gauge( SURFACE* bg, int x, int y, EGL_CIRCLE_GAUGE_INFO* pinfo Circle gauge 를생성한다. SURFACE* bg Circle gauge image. int x Circle gauge x좌표. int y Circle gauge y좌표. EGL_CIRCLE_GAUGE_INFO* pinfo Circle gauge 정보. typedef struct _tagcircle_gauge_info int needle_x; // gauge needle x좌표. int needle_y; // gauge needle y좌표. int needle_length; // gauge needle 길이. int needle_thick; // gauge needle 두께. int min_value; // gauge의최소값. int max_value; // gauge의최대값. int min_angle; // gauge의최소각. int max_angle; // gauge의최대각. EGL_CIRCLE_GAUGE_INFO; 생성된 circle gauge handle 122
SURFACE* gauge_bg; EGL_HANDLE c_gauge; EGL_CIRCLE_GAUGE_INFO CGInfo; CGInfo.needle_x = 113; CGInfo.needle_y = 101; CGInfo.min_angle = -42; CGInfo.max_angle = 222; CGInfo.min_valie = 0; CGInfo.max_value = 120; CGInfo.needle_length = 80; CGInfo.needle_thick = 3; gauge_bg = loadbmp( gauge.bmp c_gauge = egl_create_circle_gauge(gauge_bg, 286, 37, &CGInfo 123
egl_circle_gauge_set_value function BOOL egl_circle_gauge_set_value( EGL_HANDLE h, int value Circle gauge 값을설정한다. EGL_HANDLE h int vaule 설정 gauge 값. Gauge 값을설정할 circle gauge handle. TRUE or FALSE c_gauge = egl_create_circle_gauge(gauge_bg, 286,37,&CGInfo egl_circle_gauge_set_value(c_gauge, 80 124
egl_circle_gauge_get_value function int egl_circle_gauge_get_value( EGL_HANDLE h Circle gauge 값을가져온다. EGL_HANDLE h Gauge 값을가져올 circle gauge handle. Gauge 값. c_gauge = egl_create_circle_gauge(gauge_bg, 286,37,&CGInfo int gauge_value = egl_circle_gauge_get_value(c_gauge 125
Circle Gauge. extern BOOL process_touch(bool* touchdown, EGL_POINT* ppoint int main() EGL_POINT touch_pt; BOOL touchdown = FALSE; EGL_HANDLE hwin; SURFACE* gauge_bg; EGL_HANDLE c_gauge; EGL_CIRCLE_GAUGE_INFO CGInfo; egl_init( CGInfo.needle_x = 113; CGInfo.needle_y = 101; CGInfo.min_angle = -42; CGInfo.max_angle = 222; CGInfo.min_valie = 0; CGInfo.max_value = 120; CGInfo.needle_length = 80; CGInfo.needle_thick = 3; gauge_bg = loadbmp( gauge.bmp c_gauge = egl_create_circle_gauge(gauge_bg, 286, 37, &CGInfo egl_window_add_object(hwin, c_gauge egl_window_show(hwin egl_draw( int gauge_value = 0; int gauge_flag = 0; while(1) if( process_touch( &touchdown, &touch_pt ) ) egl_user_touch_input( touchdown, &touch_pt if(gauge_flag) gauge_value++; 126
if(gauge_value > 120) gauge_value = 120; gauage_flag = 0; else gauge_value--; if(gauge_value < 0) gauge_value = 0; gauge_flag = 1; egl_circle_gauge_set_valut(c_gauge, gauge_value egl_draw( 127
Bar Gauge Function Description egl_create_bar_gauge bar gauge 를생성한다. egl_bar_gauge_set_value bar gauge 값을설정한다. egl_bar_gauge_get_value bar gauge 값을가져온다. 128