const bool WinAdvSet::show(HWND hwnd_, Core& core_, const Str& gesture_name_) { if (hwnd == 0) { return 1; } MSG msg; EnableWindow(hwnd_, FALSE); init_setting(core_.get_action(gesture_name_)); while (!finish) { GetMessage(&msg, NULL, 0, 0); TranslateMessage(&msg); DispatchMessage(&msg); switch (result) { case 0: break; case 1: apply_setting(core_, gesture_name_); case 2: // FALL THROUGH default: DestroyWindow(hwnd); } } result = 0; finish = false; EnableWindow(hwnd_, TRUE); BringWindowToTop(hwnd_); return true; }
int main(int argc, char *argv[]) { init(); if(init_setting() != 0){ print_errmsg("ERROR: SETTING init fail. \n"); return 1; } if(gc_init() != 0){ print_errmsg("ERROR: G_CODE init fail. \n"); return 1; } if (cm_init() == false) { print_errmsg("ERROR: USB-DEV init fail. \n"); return 1; } if (cmd_init() == false) { print_errmsg("ERROR: G code init fail.\n"); cm_close(); return 1; } if (tp_init() == false) { print_errmsg("ERROR: Temperature library init fail. \n"); cmd_close(); cm_close(); return 1; } plan_init(); Config_ResetDefault(); st_init(); while(1) { LCD(10UL); getCommand(10UL); process_commands(50UL); stepper(1000L); manageHeater(10UL); } st_close(); plan_close(); tp_close(); cmd_close(); cm_close(); //debug //sfp_close(); return 0; }
static void init() { default_color = GColorBlack; default_bg_color = GColorWhite; /* default_color = GColorWhite; default_bg_color = GColorBlack; */ init_setting(); init_weather(); // Create main Window element and assign to pointer s_main_window = window_create(); // Set handlers to manage the elements inside the Window window_set_window_handlers(s_main_window, (WindowHandlers) { .load = main_window_load, .unload = main_window_unload });
int init_window() { GtkWidget * window; GtkWidget * scroll_window; GtkWidget * view; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); view = webkit_web_view_new(); scroll_window = gtk_scrolled_window_new(NULL, NULL); global_set("window", window); global_set("view", view); global_set("scrollwindow", scroll_window); init_setting(window, view); // gtk_container_add(GTK_CONTAINER(window), view); gtk_container_add(GTK_CONTAINER(window), scroll_window); gtk_container_add(GTK_CONTAINER(scroll_window), view); return 0; }
__declspec(dllexport) int ExtConfigure(void **ctxp, void* dummy, int argc, char *argv[]){ int typeNicovideoE = TRUE; if(0 < (unsigned)dummy && (unsigned)dummy < 0x0400){ argv = (char **)argc; argc = (int)dummy; typeNicovideoE = FALSE; } int i; //ログ FILE* log = fopen("[log]vhext.txt", "w+"); char linebuf[128]; char *ver="1.67.7.01b"; snprintf(linebuf,63,"%s\nBuild %s %s\n",ver,__DATE__,__TIME__); if(log == NULL){ puts(linebuf); puts("[framehook/init]failed to open logfile.\n"); fflush(log); return -1; }else{ fputs(linebuf,log); fputs("[framehook/init]initializing..\n",log); fflush(log); } //必要な設定があるかの確認 fprintf(log,"[framehook/init]called with argc = %d\n",argc); fflush(log); for(i=0;i<argc;i++){ fprintf(log,"[framehook/init]arg[%2d] = %s\n",i,argv[i]); fflush(log); } //セッティング取得。 SETTING setting; if(init_setting(log,&setting,argc,argv,ver,typeNicovideoE)){ fputs("[framehook/init]initialized settings.\n",log); fflush(log); }else{ fputs("[framehook/init]failed to initialize settings.\n",log); fflush(log); return -2; } log = changelog(log, &setting); //ライブラリなどの初期化 if(init(log)){ fputs("[framehook/init]initialized libs.\n",log); fflush(log); }else{ fputs("[framehook/init]failed to initialize libs.\n",log); fflush(log); return -3; } /*コンテキストの設定*/ *ctxp = malloc(sizeof(ContextInfo)); if(*ctxp == NULL){ fputs("[framehook/init]failed to malloc for context.\n",log); fflush(log); return -5; } ContextInfo* ci = (ContextInfo*)*ctxp; memset(ci, (int)NULL, sizeof(ContextInfo)); ci->log = log; fflush(log); if(initData(&ci->data,log,&setting)){ fputs("[framehook/init]initialized context.\n",log); fputs("[framehook/init]initialized.\n",log); fflush(log); return 0; }else{ fputs("[framehook/init]failed to initialize context.\n",log); fflush(log); return -4; } }
void draw_window(struct Window* window) { unsigned int x = window->Pos_x; unsigned int y = window->Pos_y; int icon_no = window->Cur_icon; int i, j; for(i = 0; i < WindowWidth; i++) { draw_point(i + x, y, 0); draw_point(i + x, WindowHeight - 1 + y, 0); for(j = 1; j < 20; j++) draw_point(i + x, j + y, 0x5ACB); for(j = 2; j <= 20; j++) draw_point(i + x, y + WindowHeight - j, 0x5ACB); } for(j = 0; j < WindowHeight; j++) { draw_point(x, j + y, 0); draw_point(WindowWidth - 1 + x, j + y, 0); } for(i = 3; i < 18; i++) { for(j = 3; j < 18; j++) { if(window_button_x[i-3][j-3] != 2016) draw_point(i + x, j + y, window_button_x[i-3][j-3]); } } int offset = 25; switch(icon_no) { case ICON_FINDER: draw_string(x + offset, y + 2, "FINDER", FONT_COLOR); InitFolder(window); break; case ICON_PHOTO: draw_string(x + offset, y + 2, "PHOTO", FONT_COLOR); init_photo(x, y); break; case ICON_TEXT: draw_string(x + offset, y + 2, "TEXT", FONT_COLOR); init_text(x, y); break; case ICON_GAME: draw_string(x + offset, y + 2, "GAME", FONT_COLOR); initGameWindow(x, y); break; case ICON_DRAW: draw_string(x + offset, y + 2, "DRAW", FONT_COLOR); init_draw(x, y); break; case ICON_SETTING: draw_string(x + offset, y + 2, "SETTING", FONT_COLOR); init_setting(x, y); break; case 8: draw_string(x + offset, y + 2, "FINDER", FONT_COLOR); InitFolder(window); break; case 9: draw_string(x + offset, y + 2, "FINDER", FONT_COLOR); InitFolder(window); break; } draw_string(x + 590, y + 380, "@meizhi", 0xFFFF); }