void acfg_init_ex(byte themeonly){ acfg_var.winbg = ag_rgb(0xf0,0xf0,0xf0); acfg_var.winbg_g = ag_rgb(0xee,0xee,0xee); acfg_var.dialogbg = acfg_var.winbg; acfg_var.dialogbg_g = acfg_var.winbg_g; acfg_var.textbg = ag_rgb(0xff,0xff,0xff); acfg_var.textfg = ag_rgb(0x00,0x00,0x00); acfg_var.textfg_gray = ag_rgb(0x88,0x88,0x88); acfg_var.winfg_gray = acfg_var.textfg_gray; acfg_var.winfg = acfg_var.textfg; acfg_var.dialogfg = acfg_var.textfg; acfg_var.controlbg = ag_rgb(0xcc,0xcc,0xcc); acfg_var.controlbg_g = ag_rgb(0xaa,0xaa,0xaa); acfg_var.controlfg = ag_rgb(0x44,0x44,0x44); acfg_var.selectbg = ag_rgb(158,228,32); acfg_var.selectbg_g = ag_rgb(76,120,14); acfg_var.selectfg = ag_rgb(0xff,0xff,0xff); acfg_var.titlebg = ag_rgb(0x44,0x44,0x44); acfg_var.titlebg_g = ag_rgb(0x11,0x11,0x11); acfg_var.titlefg = ag_rgb(0xff,0xff,0xff); acfg_var.dlgtitlebg = acfg_var.titlebg; acfg_var.dlgtitlebg_g = acfg_var.titlebg_g; acfg_var.dlgtitlefg = acfg_var.titlefg; acfg_var.navbg = ag_rgb(0x66,0x66,0x66); acfg_var.navbg_g = ag_rgb(0x33,0x33,0x33); acfg_var.scrollbar = ag_rgb(0x66,0x66,0x66); acfg_var.border = ag_rgb(0x99,0x99,0x99); acfg_var.border_g = ag_rgb(0x66,0x66,0x66); acfg_var.progressglow = acfg_var.selectbg; acfg_var.winroundsz = 4; acfg_var.roundsz = 3; acfg_var.btnroundsz = 2; acfg_var.fadeframes = 5; memset(acfg_var.themename, 0x00, 64); acfg_var.input_filter = 0; acfg_var.sd_ext = 0; acfg_reset_text(); snprintf(acfg_var.rom_name,128,MIUI_NAME); snprintf(acfg_var.rom_version,128,MIUI_VERSION); snprintf(acfg_var.rom_author,128,MIUI_BUILD_A); snprintf(acfg_var.rom_device,128,"Not Defined"); snprintf(acfg_var.rom_date,128,MIUI_BUILD); snprintf(acfg_var.brightness_path, PATH_MAX, "/sys/class/leds/lcd-backlight/brightness"); memset(acfg_var.lun_file, 0x00, PATH_MAX); acfg_var.ckey_up = 0; acfg_var.ckey_down = 0; acfg_var.ckey_select = 0; acfg_var.ckey_back = 0; acfg_var.ckey_menu = 0; atheme_releaseall(); }
void acfg_init_ex(byte themeonly){ acfg_var.winbg = ag_rgb(0xf0,0xf0,0xf0); acfg_var.winbg_g = ag_rgb(0xee,0xee,0xee); acfg_var.dialogbg = acfg_var.winbg; acfg_var.dialogbg_g = acfg_var.winbg_g; acfg_var.textbg = ag_rgb(0xff,0xff,0xff); acfg_var.textfg = ag_rgb(0x00,0x00,0x00); acfg_var.textfg_gray = ag_rgb(0x88,0x88,0x88); acfg_var.winfg_gray = acfg_var.textfg_gray; acfg_var.winfg = acfg_var.textfg; acfg_var.dialogfg = acfg_var.textfg; acfg_var.controlbg = ag_rgb(0xcc,0xcc,0xcc); acfg_var.controlbg_g = ag_rgb(0xaa,0xaa,0xaa); acfg_var.controlfg = ag_rgb(0x44,0x44,0x44); acfg_var.selectbg = ag_rgb(158,228,32); acfg_var.selectbg_g = ag_rgb(76,120,14); acfg_var.selectfg = ag_rgb(0xff,0xff,0xff); acfg_var.titlebg = ag_rgb(0x44,0x44,0x44); acfg_var.titlebg_g = ag_rgb(0x11,0x11,0x11); acfg_var.titlefg = ag_rgb(0xff,0xff,0xff); acfg_var.dlgtitlebg = acfg_var.titlebg; acfg_var.dlgtitlebg_g = acfg_var.titlebg_g; acfg_var.dlgtitlefg = acfg_var.titlefg; acfg_var.navbg = ag_rgb(0x66,0x66,0x66); acfg_var.navbg_g = ag_rgb(0x33,0x33,0x33); acfg_var.scrollbar = ag_rgb(0x66,0x66,0x66); acfg_var.border = ag_rgb(0x99,0x99,0x99); acfg_var.border_g = ag_rgb(0x66,0x66,0x66); acfg_var.progressglow = acfg_var.selectbg; acfg_var.winroundsz = 4; acfg_var.roundsz = 3; acfg_var.btnroundsz = 2; acfg_var.fadeframes = 5; snprintf(acfg_var.themename,63,""); if (themeonly==0){ snprintf(acfg_var.text_ok,31,"OK"); snprintf(acfg_var.text_next,31,"Next >"); snprintf(acfg_var.text_back,31,"< Back"); snprintf(acfg_var.text_yes,31,"Yes"); snprintf(acfg_var.text_no,31,"No"); snprintf(acfg_var.text_about,31,"About"); snprintf(acfg_var.text_calibrating,31,"Calibrating Tools"); snprintf(acfg_var.text_quit,31,"Quit Installation"); snprintf(acfg_var.text_quit_msg,63,"Are you sure to quit the installer?"); snprintf(acfg_var.save_logs,31,"Save Logs"); snprintf(acfg_var.rom_name,63,AROMA_NAME); snprintf(acfg_var.rom_version,63,AROMA_VERSION); snprintf(acfg_var.rom_author,63,AROMA_BUILD_A); snprintf(acfg_var.rom_device,63,"Not Defined"); snprintf(acfg_var.rom_date,63,AROMA_BUILD); acfg_var.ckey_up = 0; acfg_var.ckey_down = 0; acfg_var.ckey_select = 0; acfg_var.ckey_back = 0; acfg_var.ckey_menu = 0; } atheme_releaseall(); }
byte aw_calibdraw(CANVAS * c, int id,int * xpos,int * ypos,int * xtch,int * ytch){ ag_draw(agc(),c,0,0); usleep(500000); int sz = agdp()*10; if (id!=-1){ int x = xpos[id]; int y = ypos[id]; int rx = x-(sz/2); int ry = y-(sz/2); ag_roundgrad( agc(),rx,ry,sz,sz, 0xffff, ag_rgb(200,200,200), sz/2); } if (id!=-1){ char txt[128]; snprintf(txt,127,"Step %i: Tap The Circle To Calibrate",id+1); char * txt2 = "Press Back Key or Other Keys To Cancel"; int tw = ag_txtwidth(txt,0); int tw2 = ag_txtwidth(txt2,0); int tx = (agw()/2) - (tw/2); int tx2= (agw()/2) - (tw2/2); int ty = (agh()/2) + (sz*2); int ty2= (ty +ag_fontheight(0)+agdp()); ag_text(agc(),tw,tx+1,ty+1,txt,0x0000,0); ag_text(agc(),tw,tx,ty,txt,0xffff,0); ag_text(agc(),tw2,tx2+1,ty2+1,txt2,0x0000,0); ag_text(agc(),tw2,tx2,ty2,txt2,0xffff,0); } else{ char * txt = "Tap The Screen to Test Calibrated Data"; char * txt2 = "Press Back or Other Keys To Continue"; int tw = ag_txtwidth(txt,0); int tw2 = ag_txtwidth(txt2,0); int tx = (agw()/2) - (tw/2); int tx2= (agw()/2) - (tw2/2); int ty = (agh()/2) + (sz*2); int ty2= (ty +ag_fontheight(0)+agdp()); ag_text(agc(),tw,tx+1,ty+1,txt,0x0000,0); ag_text(agc(),tw,tx,ty,txt,0xffff,0); ag_text(agc(),tw2,tx2+1,ty2+1,txt2,0x0000,0); ag_text(agc(),tw2,tx2,ty2,txt2,0xffff,0); } CANVAS bg; ag_canvas(&bg,agw(),agh()); ag_draw(&bg,agc(),0,0); ag_sync(); byte res=1; byte ond=1; byte onp=0; ui_clear_key_queue(); while (ond){ ATEV atev; ui_clear_key_queue(); int action=atouch_wait_ex(&atev,1); switch (action){ case ATEV_MOUSEDN:{ onp=1; if (id==-1){ ag_draw(agc(),&bg,0,0); int vz = agdp()*40; int vx = atev.x-(vz/2); int vy = atev.y-(vz/2); ag_roundgrad(agc(),vx,vy,vz,vz,0xffff,ag_rgb(180,180,180),(vz/2)); ag_sync(); } } break; case ATEV_MOUSEMV:{ if (onp){ if (id!=-1){ xtch[id]=atev.x; ytch[id]=atev.y; } else{ ag_draw(agc(),&bg,0,0); int vz = agdp()*40; int vx = atev.x-(vz/2); int vy = atev.y-(vz/2); ag_roundgrad(agc(),vx,vy,vz,vz,0xffff,ag_rgb(180,180,180),(vz/2)); ag_sync(); } } } break; case ATEV_MOUSEUP:{ if (id!=-1){ if (onp){ if ((xtch[id]>0)&&(ytch[id]>0)){ ond=0; } onp=0; } } } break; case ATEV_SELECT: case ATEV_BACK: case ATEV_MENU:{ if (atev.d==0){ ond=0; res=0; } } break; } } ag_ccanvas(&bg); return res; }
void acfg_init(){ acfg_var.winbg = ag_rgb(0xf0,0xf0,0xf0); acfg_var.winbg_g = ag_rgb(0xee,0xee,0xee); acfg_var.textbg = ag_rgb(0xff,0xff,0xff); acfg_var.textfg = ag_rgb(0x00,0x00,0x00); acfg_var.textfg_gray = ag_rgb(0x88,0x88,0x88); acfg_var.controlbg = ag_rgb(0xcc,0xcc,0xcc); acfg_var.controlbg_g = ag_rgb(0xaa,0xaa,0xaa); acfg_var.controlfg = ag_rgb(0x44,0x44,0x44); acfg_var.selectbg = ag_rgb(158,228,32); acfg_var.selectbg_g = ag_rgb(76,120,14); acfg_var.selectfg = ag_rgb(0xff,0xff,0xff); acfg_var.titlebg = ag_rgb(0x44,0x44,0x44); acfg_var.titlebg_g = ag_rgb(0x11,0x11,0x11); acfg_var.titlefg = ag_rgb(0xff,0xff,0xff); acfg_var.navbg = ag_rgb(0x66,0x66,0x66); acfg_var.navbg_g = ag_rgb(0x33,0x33,0x33); acfg_var.scrollbar = ag_rgb(0x66,0x66,0x66); acfg_var.border = ag_rgb(0x99,0x99,0x99); acfg_var.border_g = ag_rgb(0x66,0x66,0x66); acfg_var.winroundsz = 4; acfg_var.roundsz = 3; acfg_var.btnroundsz = 2; acfg_var.fadeframes = 15; snprintf(acfg_var.text_ok,31,"OK"); snprintf(acfg_var.text_next,31,"Next >"); snprintf(acfg_var.text_back,31,"< Back"); snprintf(acfg_var.rom_name,31,AROMA_NAME); snprintf(acfg_var.rom_version,31,AROMA_VERSION); snprintf(acfg_var.rom_author,31,AROMA_BUILD_A); snprintf(acfg_var.rom_device,31,"Not Defined"); acfg_var.ckey_up = 0; acfg_var.ckey_down = 0; acfg_var.ckey_select = 0; acfg_var.ckey_back = 0; acfg_var.ckey_menu = 0; }