/* main menu activity */ void recovery_usb(int parent_id,LIBAROMA_RECTP rect){ USBMENU var={0}; /* init window */ LIBAROMA_WINDOWP win = libaroma_ctl_fragment_new_window( recovery()->fragment, ID_USB_FRAGMENT ); if (win){ if (recovery_usb_init(win,&var)){ libaroma_ctl_fragment_set_active_window( recovery()->fragment, ID_USB_FRAGMENT, 1, 300, 0, recovery_usb_transition_cb, rect, NULL ); libaroma_ctl_bar_set_color( recovery()->appbar, RGB(555555), RGB(ffffff), 0 ); recovery_usb_reset_appbar(win,&var); recovery_statusbar_setcolor(RGB(555555)); recovery_usb_pool(win,&var); /* restore parent and delete usb fragment */ libaroma_ctl_fragment_set_active_window( recovery()->fragment, parent_id, 1, 300, 1, recovery_usb_transition_cb, NULL, rect ); libaroma_ctl_bar_set_color( recovery()->appbar, libaroma_colorget(NULL,recovery()->win)->primary, libaroma_colorget(NULL,recovery()->win)->primary_text, 0 ); recovery_statusbar_setcolor(libaroma_colorget(NULL,win)->primary); } else{ RLOG("recovery_usb: init window control failed"); libaroma_ctl_fragment_del_window(recovery()->fragment,ID_USB_FRAGMENT); } } else{ RLOG("recovery_usb: create main window failed"); } }
LIBAROMA_CANVASP recovery_load_icon(const char * icon_name, LIBAROMA_WINDOWP win){ return recovery_load_icon_ex( icon_name, libaroma_colorget(NULL,win)->accent ); }
/* * Function : _libaroma_window_updatebg * Return Value: byte * Descriptions: update window background */ byte _libaroma_window_updatebg(LIBAROMA_WINDOWP win){ if (win==NULL){ ALOGW("window_recalculate win is NULL"); return 0; } if (win->handler!=NULL){ if (win->handler->updatebg!=NULL){ return win->handler->updatebg(win); } } if (win->parent!=NULL){ return 0; } int w = win->w; int h = win->h; /* draw background */ if (win->bg!=NULL){ if ((win->bg->w==w)&&(win->bg->h==h)){ /* not need recreate background */ return 1; } libaroma_canvas_free(win->bg); } win->bg = libaroma_canvas(w,h); libaroma_canvas_setcolor( win->bg, libaroma_colorget(NULL,win)->window_bg, 0xff ); return 1; } /* End of _libaroma_window_updatebg */
/* * Function : _libaroma_ctl_pager_window_updatebg * Return Value: byte * Descriptions: window update background */ byte _libaroma_ctl_pager_window_updatebg(LIBAROMA_WINDOWP win){ LIBAROMA_CONTROLP ctl=(LIBAROMA_CONTROLP) win->client_data; _LIBAROMA_CTL_CHECK( _libaroma_ctl_pager_handler, _LIBAROMA_CTL_PAGERP, 0 ); if (me->win!=win){ return 0; } int w = win->w; int h = win->h; /* draw background */ if (win->bg!=NULL){ if ((win->bg->w==w)&&(win->bg->h==h)){ /* not need recreate background */ return 1; } libaroma_canvas_free(win->bg); } win->bg = libaroma_canvas(w,h); libaroma_canvas_setcolor( win->bg, libaroma_colorget(ctl,NULL)->window_bg, 0xff ); return 1; } /* End of _libaroma_ctl_pager_window_sync */
/* load icon and mask the color */ LIBAROMA_CANVASP recovery_load_icon_ex(const char * icon_name, word color){ char uri[256]; snprintf(uri,256,"res:///ico/%s.png",icon_name); LIBAROMA_CANVASP ico = libaroma_image_uri(uri); if (ico){ libaroma_canvas_fillcolor(ico, libaroma_colorget(NULL,libaroma_wm_get_active_window())->accent ); } return ico; }
void recovery_usb_transition_cb( LIBAROMA_CANVASP dst, LIBAROMA_CANVASP bottom, LIBAROMA_CANVASP top, float state, LIBAROMA_RECTP r1, LIBAROMA_RECTP r2 ){ if (r2){ r1=r2; LIBAROMA_CANVASP top2 = top; top = bottom; bottom=top2; state=1-state; } if (!r1){ return; } state=libaroma_motion_fluid(state); libaroma_canvas_fillcolor(dst, libaroma_colorget(NULL,libaroma_wm_get_active_window())->window_bg ); int y1 = r1->y * (1-state); int y3 = r1->y+r1->h; int y4 = ((dst->h - y3) * state) + y3; int y2 = y4 - y1; byte vopa=255-(220*state); libaroma_draw_ex( dst, bottom, 0, 0, 0, r1->y-y1, dst->w, y3, 0, vopa ); libaroma_draw_ex( dst, bottom, 0, y4, 0, y3, dst->w, dst->h-y4, 0, vopa ); float statef = state; if (statef>1){ statef=1; } libaroma_draw_ex( dst, top, 0, y1, 0, 0, dst->w, y2, 0, 255 * statef ); }
/* load icon and mask the color */ LIBAROMA_CANVASP recovery_load_icon_ex(const char * icon_name, word color){ char uri[256]; if (libaroma_stristr(icon_name,".svg",strlen(icon_name))!=NULL){ snprintf(uri,256,"file:///sdcard/svg/%s",icon_name); } else{ snprintf(uri,256,"res:///ico/%s.png",icon_name); } LIBAROMA_CANVASP ico = libaroma_image_uri(uri); if (ico){ libaroma_canvas_fillcolor(ico, libaroma_colorget(NULL,libaroma_wm_get_active_window())->accent ); } return ico; }
/* init controls */ byte recovery_usb_init(LIBAROMA_WINDOWP win, USBMENU * var){ /* create menu list */ var->menu = libaroma_ctl_list( win, ID_MENULIST, 0, 0, LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL, 0, 0, libaroma_colorget(NULL,win)->control_bg, LIBAROMA_CTL_SCROLL_WITH_SHADOW ); /* menu flags */ word menuflags = LIBAROMA_LISTITEM_MENU_INDENT_NOICON| LIBAROMA_LISTITEM_MENU_SMALL_ICON| LIBAROMA_LISTITEM_MENU_FREE_ICON| LIBAROMA_LISTITEM_WITH_SEPARATOR| LIBAROMA_LISTITEM_SEPARATOR_TEXTALIGN; /* menu item macro */ #define _ITEM(id,text,ico,extra) \ libaroma_listitem_menu(\ var->menu, id, text, extra, (ico!=NULL)?recovery_load_icon(ico,win):NULL, \ menuflags,-1) #define _TITLE(id,text) \ libaroma_listitem_caption_color(var->menu, id, text, \ libaroma_colorget(NULL,win)->accent, -1) #define _DIV(id) \ libaroma_listitem_divider(var->menu, id, \ LIBAROMA_LISTITEM_DIVIDER_SUBSCREEN,-1) /* ITEMS */ _TITLE(200,"SELECT USB MODE"); _ITEM(ID_MENU_MTP,"MTP","usb",NULL); _ITEM(ID_MENU_MASS,"Mass Storage","usb",NULL); _ITEM(ID_MENU_NONE,"None","delete",NULL); /* undef menu item macro */ #undef _DIV #undef _TITLE #undef _ITEM return 1; }
/* * Function : _libaroma_ctl_fragment_window_updatebg * Return Value: byte * Descriptions: window update background */ byte _libaroma_ctl_fragment_window_updatebg(LIBAROMA_WINDOWP win){ _VALIDATE_FRAGMENT(0); libaroma_mutex_lock(me->dmutex); int w = win->w; int h = win->h; if (win->bg!=NULL){ if ((win->bg->w==w)&&(win->bg->h==h)){ libaroma_mutex_unlock(me->dmutex); return 1; } libaroma_canvas_free(win->bg); } win->bg = libaroma_canvas(w,h); libaroma_canvas_setcolor( win->bg, libaroma_colorget(ctl,NULL)->window_bg, 0xff ); libaroma_mutex_unlock(me->dmutex); return 1; } /* End of _libaroma_ctl_fragment_window_sync */
/* Init UI */ byte recovery_init_ui(){ /* create window */ _recovery.win = libaroma_window( NULL, 0, 0, LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL ); if (!_recovery.win){ RLOG("Cannot init main window"); return 0; } /* appbar */ _recovery.appbar = libaroma_ctl_bar( _recovery.win, ID_APPBAR, 0, 0, LIBAROMA_SIZE_FULL, 56, "AROMA Recovery", libaroma_colorget(NULL,_recovery.win)->primary, libaroma_colorget(NULL,_recovery.win)->primary_text ); if (!_recovery.appbar){ return 0; } libaroma_ctl_bar_set_icon_mask(_recovery.appbar,1,0); libaroma_ctl_bar_set_textgap(_recovery.appbar,1,0); /* fragment */ _recovery.fragment = libaroma_ctl_fragment( _recovery.win, ID_FRAGMENT, 0, 56, LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL ); if (!_recovery.fragment){ return 0; } /* init sidebar */ _recovery.sidebar = libaroma_window_sidebar(_recovery.win,0); if (_recovery.sidebar){ /* sidebar onslide callback */ libaroma_window_sidebar_onslide( _recovery.sidebar, &recovery_sidebar_onslide ); word menuflags = LIBAROMA_LISTITEM_MENU_INDENT_NOICON| LIBAROMA_LISTITEM_MENU_SMALL_ICON| LIBAROMA_LISTITEM_MENU_FREE_ICON| LIBAROMA_LISTITEM_MENU_SMALL; /* menu item macro */ #define _ITEM(id,text,ico,extra) \ libaroma_listitem_menu(\ _recovery.sidemenu, id, text, extra, \ (ico!=NULL)?recovery_load_icon(ico,_recovery.win):NULL, \ menuflags,-1) #define _TITLE(id,text) \ libaroma_listitem_caption_color(_recovery.sidemenu, id, text, \ libaroma_colorget(NULL,_recovery.win)->accent, -1) #define _DIV(id) \ libaroma_listitem_divider(_recovery.sidemenu, id, \ LIBAROMA_LISTITEM_SEPARATOR_TEXTALIGN,-1) /* create menu list */ _recovery.sidemenu = libaroma_ctl_list( _recovery.sidebar, ID_SIDEMENU, 0, 0, LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL, 0, 0, libaroma_colorget(NULL,_recovery.win)->control_bg, 0 /*LIBAROMA_CTL_SCROLL_WITH_SHADOW*/ ); libaroma_ctl_scroll_set_min_scroll( _recovery.sidemenu, recovery_statusbar_sidebar_list_cb, libaroma_dp(24) ); /* sidebar image */ libaroma_listitem_image( _recovery.sidemenu, ID_SIDEMENU_IMAGE, libaroma_image_uri("res:///bg/sidebar.jpg"), 150, LIBAROMA_LISTITEM_IMAGE_FREE|LIBAROMA_LISTITEM_IMAGE_FILL| LIBAROMA_LISTITEM_IMAGE_PROPORTIONAL|LIBAROMA_CTL_LIST_ITEM_RECEIVE_TOUCH, -1); /* ITEMS */ _TITLE(210,"POWER MENU"); _ITEM(ID_SIDEMENU_SHUTDOWN,"Shutdown","power",NULL); _ITEM(ID_SIDEMENU_REBOOT_SYS,"Reboot System","android",NULL); _ITEM(ID_SIDEMENU_REBOOT_REC,"Reboot Recovery","direction",NULL); _ITEM(ID_SIDEMENU_REBOOT_BLD,"Reboot Bootloader","apps",NULL); _DIV(310); _TITLE(211,"SETTINGS"); _ITEM(ID_SIDEMENU_SETTINGS,"Settings","settings",NULL); _ITEM(ID_SIDEMENU_ABOUT,"About","info",NULL); _ITEM(ID_SIDEMENU_HELP,"Help","help",NULL); /* _DIV(311); int u; for (u=0;u<20;u++){ char extraText[100]; snprintf(extraText,100,"Dummy Sidebar %i",u); _ITEM(501+u,"Dummy Sidebar",NULL,extraText); } */ /* undef menu item macro */ #undef _DIV #undef _TITLE #undef _ITEM } else{ return 0; } return 1; }
void bar_test(){ LIBAROMA_WINDOWP win = libaroma_window( NULL, 0, 0, LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL); int _y = 0; LIBAROMA_CONTROLP bar = libaroma_ctl_bar( win, 1, 0, _y, LIBAROMA_SIZE_FULL, 56, "Libaroma Test", RGB(009385), RGB(ffffff) ); libaroma_ctl_bar_set_icon_mask(bar,1,1); _y+=56; LIBAROMA_CONTROLP tabs=libaroma_ctl_tabs( win, 2, 0, _y, LIBAROMA_SIZE_FULL, 48, RGB(009385), RGB(ffffff), 0, 0 ); _y+=48; LIBAROMA_CONTROLP pager=libaroma_ctl_pager( win, 3, 5, 0, _y, LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL ); /* set pager & tab text */ char * tab_texts[5]={ "FIRST TABS", "SECOND TABS", "THIRD TABS", "FOURTH TABS", "FIFTH TABS" }; libaroma_ctl_tabs_set_texts(tabs,tab_texts,5,0); libaroma_ctl_tabs_set_pager(tabs,pager); /* pager window */ LIBAROMA_WINDOWP win2 = libaroma_ctl_pager_get_window(pager); int pw = libaroma_px(pager->w); LIBAROMA_CONTROLP button_exit = libaroma_ctl_button( win2, 5, pw, 0, pw, 60, "Exit Libaroma", LIBAROMA_CTL_BUTTON_COLORED|LIBAROMA_CTL_BUTTON_RAISED, RGB(880000) ); LIBAROMA_CONTROLP button_style = libaroma_ctl_button( win2, 6, pw, 60, pw, 60, "Update App Bar", LIBAROMA_CTL_BUTTON_RAISED, 0 ); LIBAROMA_CONTROLP button_gapstyle = libaroma_ctl_button( win2, 7, pw, 120, pw, 60, "Change App Bar Text Gap", LIBAROMA_CTL_BUTTON_RAISED, 0 ); LIBAROMA_CONTROLP button_2 = libaroma_ctl_button( win2, 8, pw*2, 0, pw, 60, "Second Button", LIBAROMA_CTL_BUTTON_COLORED|LIBAROMA_CTL_BUTTON_RAISED, RGB(008800) ); LIBAROMA_CONTROLP buttonx_2 = libaroma_ctl_button( win2, 181, pw*2, 60, 72, 72, "X", LIBAROMA_CTL_BUTTON_COLORED|LIBAROMA_CTL_BUTTON_RAISED|LIBAROMA_CTL_BUTTON_CIRCLE, RGB(44688) ); LIBAROMA_CONTROLP buttonx_3 = libaroma_ctl_button( win2, 182, pw*2+72, 60, 72, 72, "A", LIBAROMA_CTL_BUTTON_COLORED|LIBAROMA_CTL_BUTTON_RAISED|LIBAROMA_CTL_BUTTON_CIRCLE, RGB(ffffff) ); LIBAROMA_CONTROLP progress2 = libaroma_ctl_progress( win2, 51, (pw*3.5)-24, 48, 48, 48, LIBAROMA_CTL_PROGRESS_INDETERMINATE|LIBAROMA_CTL_PROGRESS_CIRCULAR, 100, 0 ); /* list */ LIBAROMA_CONTROLP list = libaroma_ctl_list( win2, 77, /* win, id */ 0, 0, pw, LIBAROMA_SIZE_FULL, /* x,y,w,h */ 0, 0 /*8*/, /* horiz, vert padding */ RGB(ffffff), /* bgcolor */ LIBAROMA_CTL_SCROLL_WITH_SHADOW |LIBAROMA_CTL_SCROLL_WITH_HANDLE ); libaroma_listitem_image( list,1, libaroma_image_uri("file:///sdcard/wall2.jpg"), 120, LIBAROMA_LISTITEM_IMAGE_FREE|LIBAROMA_LISTITEM_WITH_SEPARATOR| LIBAROMA_LISTITEM_IMAGE_FILL|LIBAROMA_LISTITEM_IMAGE_PROPORTIONAL| LIBAROMA_CTL_LIST_ITEM_RECEIVE_TOUCH, -1); LIBAROMA_CANVASP list_icon = libaroma_image_uri("file:///sdcard/card.png"); LIBAROMA_CANVASP list_icon2 = libaroma_image_uri("file:///sdcard/gesture.png"); LIBAROMA_CANVASP list_icon3 = libaroma_image_uri("file:///sdcard/inbox.png"); /* fill color */ libaroma_canvas_fillcolor(list_icon,libaroma_colorget(NULL,NULL)->primary); libaroma_canvas_fillcolor(list_icon2,libaroma_colorget(NULL,NULL)->primary); libaroma_canvas_fillcolor(list_icon3,libaroma_colorget(NULL,NULL)->primary); char main_text[256]; char extra_text[256]; int itm=0; int kdv=0; for (itm=0;itm<50;itm++){ if (itm==10){ libaroma_listitem_image( list,1, libaroma_image_uri("file:///sdcard/wall1.jpg"), 150, LIBAROMA_LISTITEM_IMAGE_FREE|LIBAROMA_LISTITEM_WITH_SEPARATOR| LIBAROMA_LISTITEM_IMAGE_FILL|LIBAROMA_LISTITEM_IMAGE_PROPORTIONAL| LIBAROMA_CTL_LIST_ITEM_RECEIVE_TOUCH|LIBAROMA_LISTITEM_IMAGE_PARALAX, -1); } if (itm%6==4){ libaroma_listitem_divider( list, 1, (((kdv++)%2)==0)?LIBAROMA_LISTITEM_DIVIDER_SUBSCREEN: LIBAROMA_LISTITEM_SEPARATOR_TEXTALIGN, -1); } if (itm%15==0){ snprintf(main_text,256,"List Caption %i",itm); libaroma_listitem_caption( list, 200, main_text, -1); } snprintf(main_text,256,"Item id#%i",itm); word add_flags=0; if (itm%3==1){ add_flags=LIBAROMA_LISTITEM_CHECK_SWITCH; snprintf(extra_text,256, "Secondary text for list item %i is three line list item text",itm); } else if (itm%3==2){ snprintf(extra_text,256,"Secondary text %i",itm); } if (itm%5==0){ libaroma_listitem_check( list, itm+10, 0, main_text, (itm%3!=0)?extra_text:NULL, NULL, LIBAROMA_LISTITEM_WITH_SEPARATOR| LIBAROMA_LISTITEM_CHECK_LEFT_CONTROL| add_flags, -1 ); } else{ libaroma_listitem_check( list, itm+10, 0, main_text, (itm%3!=0)?extra_text:NULL, ((itm%3==1)?list_icon:(itm%3==2)?list_icon2:list_icon3), LIBAROMA_LISTITEM_CHECK_INDENT_NOICON| LIBAROMA_LISTITEM_WITH_SEPARATOR| LIBAROMA_LISTITEM_CHECK_SHARED_ICON| add_flags, -1 ); } } /* set bar tools */ LIBAROMA_CTL_BAR_TOOLSP bar_tools=libaroma_ctl_bar_tools(2); libaroma_ctl_bar_tools_set( bar_tools, 0, 1, "one", list_icon, LIBAROMA_CTL_BAR_TOOL_ICON_SHARED ); libaroma_ctl_bar_tools_set( bar_tools, 1, 3, "two", list_icon, LIBAROMA_CTL_BAR_TOOL_SWITCH|LIBAROMA_CTL_BAR_TOOL_ICON_SHARED ); libaroma_ctl_bar_set_tools( bar,bar_tools, 0); libaroma_ctl_bar_set_icon( bar,NULL,0,LIBAROMA_CTL_BAR_ICON_DRAWER, 1 ); LIBAROMA_WINDOWP sidebar=libaroma_window_sidebar(win,0); if (sidebar){ printf("SIDEBAR INITIALIZED\n"); /* list */ LIBAROMA_CONTROLP sblist = libaroma_ctl_list( sidebar, 88, /* win, id */ 0, 0, LIBAROMA_SIZE_FULL, LIBAROMA_SIZE_FULL, /* x,y,w,h */ 0, 0 /*8*/, /* horiz, vert padding */ RGB(ffffff), /* bgcolor */ LIBAROMA_CTL_SCROLL_WITH_SHADOW ); libaroma_listitem_image( sblist,1, libaroma_image_uri("file:///sdcard/wall2.jpg"), 150, LIBAROMA_LISTITEM_IMAGE_FREE|LIBAROMA_LISTITEM_WITH_SEPARATOR| LIBAROMA_LISTITEM_IMAGE_FILL|LIBAROMA_LISTITEM_IMAGE_PROPORTIONAL| LIBAROMA_CTL_LIST_ITEM_RECEIVE_TOUCH|LIBAROMA_LISTITEM_IMAGE_PARALAX, -1); int r; char xtext[256]; for (r=0;r<20;r++){ if (r%5==0){ snprintf(xtext,256,"SIDEBAR CAPTION %i",itm); libaroma_listitem_caption_color( sblist, 200, xtext, RGB(888888), -1); } if (r%3==0){ libaroma_listitem_divider( sblist, 1, (((kdv++)%2)==0)?LIBAROMA_LISTITEM_DIVIDER_SUBSCREEN: LIBAROMA_LISTITEM_SEPARATOR_TEXTALIGN, -1); } snprintf(xtext,256,"Sidebar Menu #%i",r); libaroma_listitem_menu( sblist, r+100, xtext, NULL, ((r%3==1)?list_icon:(r%3==2)?list_icon2:list_icon3), LIBAROMA_LISTITEM_CHECK_INDENT_NOICON| LIBAROMA_LISTITEM_CHECK_SHARED_ICON| LIBAROMA_LISTITEM_CHECK_SMALL_ICON| 0, -1 ); } } else{ printf("SIDEBAR FAILED\n"); } /* LIBAROMA_CONTROLP buttonsidebar = libaroma_ctl_button( sidebar, 88, 0, 0, LIBAROMA_SIZE_FULL, 60, "Side Button", LIBAROMA_CTL_BUTTON_COLORED, RGB(008800) ); */ // libaroma_window_layer_init(win); libaroma_window_anishow(win, LIBAROMA_WINDOW_SHOW_ANIMATION_PAGE_LEFT, 400); // libaroma_window_layer_init(win); byte gap_wide = 1; int change_id=0; byte onpool=1; do{ LIBAROMA_MSG msg; dword command=libaroma_window_pool(win,&msg); byte cmd = LIBAROMA_CMD(command); word id = LIBAROMA_CMD_ID(command); byte param = LIBAROMA_CMD_PARAM(command); if (msg.msg==LIBAROMA_MSG_KEY_SELECT){ if (msg.state==0){ printf("Screenshoot... and exit\n"); libaroma_png_save(libaroma_fb()->canvas,"/sdcard/libaroma_screenshoot.png"); onpool = 0; break; } } else if (cmd){ if (cmd==LIBAROMA_CMD_HOLD){ if (id==button_exit->id){ printf("Exit Button Pressed...\n"); onpool = 0; } } else if (cmd==1){ if (id==1){ if (param==1){ /* drawer icon touched */ printf("Open sidebar %i\n", libaroma_window_sidebar_show(sidebar, 1) ); } } else if (id==8){ dialog_demo(win); } else if (id==7){ libaroma_ctl_bar_set_textgap(bar,gap_wide,1); gap_wide=gap_wide?0:1; } else if (id==6){ if (change_id==0){ libaroma_ctl_bar_set_tools( bar,NULL, 0); libaroma_ctl_bar_set_subtitle( bar, "an embedded ui toolkit", 0 ); libaroma_ctl_bar_set_color( bar, RGB(9C27B0), RGB(ffffff), 1 ); libaroma_ctl_tabs_set_color( tabs,RGB(9C27B0), RGB(ffffff),1); } else if (change_id==1){ libaroma_ctl_bar_set_subtitle( bar, NULL, 0 ); libaroma_ctl_bar_set_title( bar, "Inbox", 1 ); } else if (change_id==2){ libaroma_ctl_bar_set_touchable_title(bar,1); libaroma_ctl_bar_set_subtitle( bar, "Title now touchable", 0 ); libaroma_ctl_bar_set_color( bar, RGB(009385), RGB(ffffff), 0 ); libaroma_ctl_tabs_set_color( tabs,RGB(009385), RGB(ffffff),1); libaroma_ctl_bar_set_icon( bar,list_icon,0,0,1 ); } else if (change_id==3){ libaroma_ctl_bar_set_tools( bar,bar_tools, 1); } else if (change_id==4){ libaroma_ctl_bar_set_subtitle( bar, NULL, 0 ); libaroma_ctl_bar_set_menuid(bar,50,1); } else if (change_id==5){ libaroma_ctl_bar_tools_set( bar_tools, 1, 3, "three", list_icon, LIBAROMA_CTL_BAR_TOOL_SWITCH|LIBAROMA_CTL_BAR_TOOL_ICON_SHARED ); libaroma_ctl_bar_set_icon( bar,NULL,0,LIBAROMA_CTL_BAR_ICON_DRAWER,1 ); } else if ((change_id==6)||(change_id==8)){ libaroma_ctl_bar_tools_set( bar_tools, 1, 3, "three", NULL, LIBAROMA_CTL_BAR_TOOL_SWITCH| LIBAROMA_CTL_BAR_TOOL_SWITCH_CHECKED ); libaroma_ctl_bar_set_icon( bar,NULL,0,LIBAROMA_CTL_BAR_ICON_ARROW,1 ); } else if (change_id==7){ libaroma_ctl_bar_set_touchable_title(bar,0); libaroma_ctl_bar_tools_set( bar_tools, 1, 3, "three", NULL, LIBAROMA_CTL_BAR_TOOL_SWITCH ); libaroma_ctl_bar_set_title( bar, "Libaroma Demo", 0 ); libaroma_ctl_bar_set_subtitle( bar, "an embedded ui toolkit...", 0 ); libaroma_ctl_bar_set_icon( bar,NULL,0,LIBAROMA_CTL_BAR_ICON_DRAWER,1 ); } else if (change_id==9){ libaroma_ctl_bar_tools_set( bar_tools, 1, 3, "three", list_icon, LIBAROMA_CTL_BAR_TOOL_SWITCH|LIBAROMA_CTL_BAR_TOOL_ICON_SHARED ); libaroma_ctl_bar_set_icon( bar,list_icon,0,0,1 ); libaroma_ctl_bar_set_color( bar, RGB(311B92), RGB(ffffff), 1 ); libaroma_ctl_tabs_set_color( tabs,RGB(311B92), RGB(ffffff),1); } else if (change_id==10){ libaroma_ctl_bar_set_subtitle( bar, NULL, 0 ); libaroma_ctl_bar_set_menuid(bar,0,0); libaroma_ctl_bar_set_tools( bar,NULL, 0); libaroma_ctl_bar_set_title( bar, "Libaroma Test", 0 ); libaroma_ctl_bar_set_icon( bar,NULL,0,0,1 ); change_id=-1; } change_id++; } } printf("Window Command = (CMD: %i, ID: %i, Param: %i)\n", LIBAROMA_CMD(command), LIBAROMA_CMD_ID(command), LIBAROMA_CMD_PARAM(command) ); } } while(onpool); libaroma_ctl_bar_tools_free(bar_tools); libaroma_canvas_free(list_icon); libaroma_canvas_free(list_icon2); libaroma_canvas_free(list_icon3); printf("Free Window\n"); libaroma_window_free(win); printf("FREED\n"); }