int tuxrts_init(char *object_name, char *map_name, int players) { FILE *fp; object_counter = 0; if(!init_players(players, 1)) { printf("No players created!\n"); DEBUGMSG(debug_game, "No players created!"); return 0; } fp = LoadObj("objects"); if(fp == NULL) { printf("File not found!\n"); DEBUGMSG(debug_game, "File not found!"); return 0; } printf("Object files in memory!\n"); if(objects_xml(fp)) { printf("Error parsing file!"); DEBUGMSG(debug_game, "Error loading the objects description file.\n"); return 0; } printf("Object file parsed.\n"); fp = LoadMap(map_name); if(fp == NULL) { DEBUGMSG(debug_game, "File not found!"); return 0; } printf("Map file in memory.\n"); if(map_xml(fp)) { printf("Error parsing file!"); DEBUGMSG(debug_game, "Error loading the map file.\n"); return 0; } printf("Map file parsed!\n"); if(create_gmaps(players)) { printf("Couldn't generate grpah mesh!\n"); return 0; } generate_map(); if(!panel_init()) { printf("Error loading GUI.\n"); return 0; } return 1; }
// Initialization of the panel and the DSP void initialize() { // Initialize panel and DSP panel = panel_init(); if (!panel) Error("ERROR: cannot access the panel.\n"); dsp = dsp_init(1, dspCode); if (!dsp) Error("ERROR: cannot access the DSP.\n"); panel_out_lcd_print(panel, 0, 0, "SampleTemplate12"); }
int __init panel_cpt_wvga_48_init(struct omap_dss_platform_data *disp_data) { const struct archos_display_config *disp_cfg; int ret = -ENODEV; disp_cfg = omap_get_config( ARCHOS_TAG_DISPLAY, struct archos_display_config ); if (disp_cfg == NULL) return ret; if ( hardware_rev >= disp_cfg->nrev ) { printk(KERN_DEBUG "archos_display_init: hardware_rev (%i) >= nrev (%i)\n", hardware_rev, disp_cfg->nrev); return ret; } display_gpio = disp_cfg->rev[hardware_rev]; /* * Backlight configuration, * TODO: retrieve GPT id and mux through omap_get_config() */ GPIO_INIT_OUTPUT(display_gpio.bkl_pwon); bkl_pwm = omap_dm_timer_request_specific(display_gpio.bkl_pwm.timer); if (bkl_pwm) { omap_dm_timer_set_source(bkl_pwm, OMAP_TIMER_SRC_SYS_CLK); omap_cfg_reg(display_gpio.bkl_pwm.mux_cfg); } else pr_err("panel_cpt_wvga_48_init: no backlight PWM\n"); /* * Vcom configuration, */ vcom_pwm = omap_dm_timer_request_specific(display_gpio.vcom_pwm.timer); if (vcom_pwm) { omap_dm_timer_set_source(vcom_pwm, OMAP_TIMER_SRC_SYS_CLK); omap_cfg_reg(display_gpio.vcom_pwm.mux_cfg); } else pr_err("panel_cpt_wvga_48_init: no vcom PWM\n"); panel_init(&cpt_wvga_48_panel); #if defined(CONFIG_FB_OMAP_BOOTLOADER_INIT) panel_set_backlight_level(NULL, 255); #endif disp_data->displays[disp_data->num_displays] = &cpt_wvga_48_panel; disp_data->num_displays++; return 0; }
static void skin_apply (const gchar * skin_override) { GError *mcerror = NULL; mc_skin_deinit (); mc_skin_init (skin_override, &mcerror); mc_fhl_free (&mc_filehighlight); mc_filehighlight = mc_fhl_new (TRUE); dlg_set_default_colors (); input_set_default_colors (); if (mc_global.mc_run_mode == MC_RUN_FULL) command_set_default_colors (); panel_deinit (); panel_init (); repaint_screen (); mc_error_message (&mcerror, NULL); }
void printcaps(mddi_client_caps *c) { if((c->length != 0x4a) || (c->type != 0x42)) { dprintf("bad caps header\n"); memset(c, 0, sizeof(*c)); return; } dprintf("mddi: bm: %d,%d win %d,%d rgb %x\n", c->bitmap_width, c->bitmap_height, c->display_window_width, c->display_window_height, c->rgb_cap); dprintf("mddi: vend %x prod %x\n", c->manufacturer_name, c->product_code); fb_width = c->bitmap_width; fb_height = c->bitmap_height; panel_init(c); }
int __init panel_wqvga_32_init(struct omap_dss_device *disp_data) { const struct archos_display_config *disp_cfg; int ret = -ENODEV; pr_debug("panel_wqvga_32_init\n"); disp_cfg = omap_get_config( ARCHOS_TAG_DISPLAY, struct archos_display_config ); if (disp_cfg == NULL) return ret; if ( hardware_rev >= disp_cfg->nrev ) { printk(KERN_DEBUG "archos_display_init: hardware_rev (%i) >= nrev (%i)\n", hardware_rev, disp_cfg->nrev); return ret; } display_gpio = disp_cfg->rev[hardware_rev]; /* init spi, bus line is used as mcspi */ omap_cfg_reg(display_gpio.spi.spi_clk.mux_cfg); omap_cfg_reg(display_gpio.spi.spi_cs.mux_cfg); omap_cfg_reg(display_gpio.spi.spi_data.mux_cfg); spi_register_board_info(lcd_spi_board_info, 1); panel_init(&byd_wqvga_32_panel); #if defined(CONFIG_FB_OMAP_BOOTLOADER_INIT) panel_set_backlight_level(NULL, 255); #endif if ( machine_is_archos_a32() && ( hardware_rev < 3 ) ) { byd_wqvga_32_panel.phy.dpi.data_lines = 24; byd_wqvga_32_panel.phy.dpi.dither = OMAP_DSS_DITHER_NONE; } *disp_data = byd_wqvga_32_panel; return 0; }
static int mddi_toshiba_fwvga_lcd_on(struct platform_device *pdev) { printk(KERN_INFO "MDDI: mddi_toshiba_fwvga_lcd_on\n"); //SW2-6-MM-JH-Panel_first_on-00+ if ( !panel_first_on ) { // LCM_RESET -> Low printk(KERN_INFO "Set GPIO %d: %d -> 0\n", GPIO_LCM_RESET, gpio_get_value(GPIO_LCM_RESET)); gpio_set_value(GPIO_LCM_RESET, 0); // GPIO_LCM_RESET = 35 printk(KERN_INFO "GPIO %d = %d\n", GPIO_LCM_RESET, gpio_get_value(GPIO_LCM_RESET)); } // PM8058_L15_V2P85 vreg_set_level(vreg_gp6, 2800); // VDD vreg_enable(vreg_gp6); // PM8058_L11_V1P8 vreg_set_level(vreg_lvsw1, 1800); // VDDIO vreg_enable(vreg_lvsw1); mdelay(1); if ( !panel_first_on ) { // LCM_RESET -> High printk(KERN_INFO "Set GPIO %d: %d -> 1\n", GPIO_LCM_RESET, gpio_get_value(GPIO_LCM_RESET)); gpio_set_value(GPIO_LCM_RESET, 1); printk(KERN_INFO "GPIO %d = %d\n", GPIO_LCM_RESET, gpio_get_value(GPIO_LCM_RESET)); mdelay(15); panel_init(NT35560_TOSHIBA_init_table); } panel_first_on = 0; //SW2-6-MM-JH-Panel_first_on-00- return 0; }
static void skin_apply (const gchar * skin_override) { GError *error = NULL; mc_skin_deinit (); mc_skin_init (skin_override, &error); mc_fhl_free (&mc_filehighlight); mc_filehighlight = mc_fhl_new (TRUE); dlg_set_default_colors (); input_set_default_colors (); if (mc_global.mc_run_mode == MC_RUN_FULL) command_set_default_colors (); panel_deinit (); panel_init (); repaint_screen (); if (error != NULL) { message (D_ERROR, _("Warning"), "%s", error->message); g_error_free (error); } }
/* 测试顶层窗口和子窗口 程序一共申请了四个窗口 w1 w2 w3 w4 其中 w1 和 w2 是顶层窗口 w3 和 w4 是 w2 的同一层次子窗口 w2 总在 w3 和 w4 的后面 w3 和 w4 的前后关系则可以改变 */ int main() { si_t video_access_mode = VIDEO_ACCESS_MODE_BUFFER; si_t app_type = APPLICATION_TYPE_NORMAL; struct window * w1; struct window * w2; struct window * w3; struct window * w4; struct window * w5; struct radiobutton * r, *s; /* 初始化用户应用程序 */ application_init(video_access_mode, app_type, "toplevel_child"); w1 = window_init("uncle-1"); /* 申请失败 */ if(w1 == NULL) { application_exit(); return -1; } window_set_bounds(w1, 300, 100, 448, 200); w2 = window_init("parent"); /* 申请失败 */ if(w2 == NULL) { application_exit(); return -1; } window_set_bounds(w2, 350, 150, 448, 200); w3 = window_init("child-1"); /* 申请失败 */ if(w3 == NULL) { application_exit(); return -1; } window_set_bounds(w3, 400, 200, 600, 600); w4 = window_init("child-2"); /* 申请失败 */ if(w4 == NULL) { application_exit(); return -1; } window_set_bounds(w4, 450, 250, 448, 200); w5 = window_init("uncle-2"); /* 申请失败 */ if(w5 == NULL) { application_exit(); return -1; } window_set_bounds(w5, 500, 300, 448, 200); { struct button *b = button_init("click me!"); button_set_bounds(b, 50, 50, 150, 50); b->callback = button_callback; object_attach_child(OBJECT_POINTER(w4), OBJECT_POINTER(b)); } /* * Window structure illustraion: * app * / | \ * (main)w1 w5 w2 * / \ * w3 w4 */ /* 添加顶层窗口 */ application_add_window(NULL, w1); /* 添加顶层窗口 */ application_add_window(NULL, w2); /* 添加非顶层窗口 */ application_add_window(w2, w3); /* 添加非顶层窗口 */ application_add_window(w2, w4); /* 添加顶层窗口 */ application_add_window(NULL, w5); /* 设置主窗口 */ application_set_main_window(w1); r = radiobutton_init("test_group", 0); s = radiobutton_init("test_group", 1); radiobutton_set_bounds(r, 20, 20, 13, 13); radiobutton_set_bounds(s, 20, 40, 13, 13); object_attach_child(OBJECT_POINTER(w4), OBJECT_POINTER(r)); object_attach_child(OBJECT_POINTER(w4), OBJECT_POINTER(s)); { struct panel *p = panel_init(0); struct button *pb = button_init("button in panel"); struct checkbox *pcb = checkbox_init(0); panel_set_bounds(p, 5, 5, 500, 500); button_set_bounds(pb, 5, 5, 200, 50); checkbox_set_bounds(pcb, 210, 5, -1, -1); object_attach_child(OBJECT_POINTER(w3), OBJECT_POINTER(p)); object_attach_child(OBJECT_POINTER(p), OBJECT_POINTER(pb)); object_attach_child(OBJECT_POINTER(p), OBJECT_POINTER(pcb)); } /* 运行 */ application_exec(); return 0; }
struct fbcon_config *mddi_init(void) { unsigned n; struct mddi_client_caps client_caps; dprintf(INFO, "mddi_init()\n"); rev_pkt_buf = memalign(32, MDDI_REV_PKT_BUF_SIZE); mlist_remote_write = memalign(32, sizeof(struct mddi_llentry)); n = mddi_init_regs(); dprintf(INFO, "mddi version: 0x%08x\n", n); //mddi_get_caps(&client_caps); //if(!(client_caps.length == 0x4a && client_caps.type == 0x42)) { mddi_set_caps(&client_caps); } fb_cfg.width = client_caps.bitmap_width; fb_cfg.stride = fb_cfg.width; fb_cfg.height = client_caps.bitmap_height; panel_init(&client_caps); panel_backlight(0); panel_poweron(); /* v > 8? v > 8 && < 0x19 ? */ writel(2, MDDI_TEST); dprintf(INFO, "panel is %d x %d\n", fb_cfg.width, fb_cfg.height); fb_cfg.base = memalign(4096, fb_cfg.width * fb_cfg.height * (fb_cfg.bpp / 8)); mlist = memalign(32, sizeof(mddi_llentry) * (fb_cfg.height / 8)); dprintf(INFO, "FB @ %p mlist @ %x\n", fb_cfg.base, (unsigned)mlist); for (n = 0; n < (fb_cfg.height / 8); n++) { unsigned y = n * 8; unsigned pixels = fb_cfg.width * 8; mddi_video_stream *vs = &(mlist[n].u.v); vs->length = sizeof(mddi_video_stream) - 2 + (pixels * 2); vs->type = TYPE_VIDEO_STREAM; vs->client_id = 0; vs->format = 0x5565; // FORMAT_16BPP; vs->pixattr = PIXATTR_BOTH_EYES | PIXATTR_TO_ALL; vs->left = 0; vs->right = fb_cfg.width - 1; vs->top = y; vs->bottom = y + 7; vs->start_x = 0; vs->start_y = y; vs->pixels = pixels; vs->crc = 0; vs->reserved = 0; mlist[n].header_count = sizeof(mddi_video_stream) - 2; mlist[n].data_count = pixels * 2; mlist[n].reserved = 0; mlist[n].data = fb_cfg.base + (y * fb_cfg.width * 2); mlist[n].next = &mlist[n + 1]; mlist[n].flags = 0; } mlist[n - 1].flags = 1; mlist[n - 1].next = 0; mddi_set_auto_hibernate(1); mddi_do_cmd(CMD_LINK_ACTIVE); panel_backlight(1); return &fb_cfg; }
void create_view(void) { // Window win, ewin; Evas *evas; Ecore_Evas * ee; int x, y, w, h, res; int maxcol; int engine; char *fontdir; int font_cache, image_cache; char buf[4096]; char *s; E_DB_INT_GET(shell->rcfile, "/main_win/win_x", x, res); ENGY_ASSERT(res); E_DB_INT_GET(shell->rcfile, "/main_win/win_y", y, res); ENGY_ASSERT(res); E_DB_INT_GET(shell->rcfile, "/main_win/win_w", w, res); ENGY_ASSERT(res); E_DB_INT_GET(shell->rcfile, "/main_win/win_h", h, res); ENGY_ASSERT(res); E_DB_STR_GET(shell->rcfile, "/aliases", (shell->aliases), res); ENGY_ASSERT(res); E_DB_INT_GET(shell->rcfile, "/maxcolors", maxcol, res); ENGY_ASSERT(res); E_DB_INT_GET(shell->rcfile, "/rendermethod", engine, res); ENGY_ASSERT(res); if (render_method != -1) engine = render_method; E_DB_INT_GET(shell->rcfile, "/maximagecache", image_cache, res); ENGY_ASSERT(res); E_DB_INT_GET(shell->rcfile, "/maxfontcache", font_cache, res); ENGY_ASSERT(res); E_DB_STR_GET(shell->rcfile, "/fontdir", s, res); ENGY_ASSERT(res); if (s[0] != '/') { snprintf(buf, 4000,"%s/%s", shell->home, s); imlib_add_path_to_font_path(buf); fontdir = DUP(buf); } else { imlib_add_path_to_font_path(s); fontdir = DUP(s); } FREE(s); /* win = ecore_window_new(0, x, y, w, h); ecore_window_set_events(win, XEV_CONFIGURE | XEV_KEY); evas = evas_new_all(ecore_display_get(), win, 0, 0, w, h, engine, maxcol, font_cache, image_cache, fontdir); ENGY_ASSERTS(evas, "evas_new"); FREE(fontdir); evas_set_output_viewport(evas, 0, 0, w, h); ewin = evas_get_window(evas); ecore_window_set_events(ewin, XEV_EXPOSE | XEV_BUTTON | XEV_MOUSE_MOVE); */ if (!ecore_x_init(NULL)) exit(-1); //LOG_AND_RETURN (ERR_EFL); if (!ecore_evas_init()) exit(-1); //LOG_AND_RETURN (ERR_EFL); ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 640, 480); if (!ee) exit(-1); //LOG_AND_RETURN (ERR_EFL); evas = ecore_evas_get(ee); evas_font_path_prepend(evas, fontdir); FREE(fontdir); ecore_evas_callback_delete_request_set(ee, engy_delete_request); ecore_evas_callback_pre_render_set(ee, engy_pre_rend); ecore_evas_callback_post_render_set(ee, engy_post_rend); ecore_evas_callback_resize_set(ee, engy_resize); ecore_evas_name_class_set(ee, "engy", "main"); ecore_evas_show(ee); _get_title_dcd(); shell->title = my_iconv(shell->title_dcd, TITLE); ecore_evas_title_set(ee, shell->title); shell->evas = evas; shell->win = ecore_evas_software_x11_window_get(ee); shell->ee = ee; shell->w = w; shell->h = h; // GLS // ecore_set_blank_pointer(win); // ecore_window_set_title(win, shell->title); // my_evas_init(); _shell_bg_create(); menu_init(); // GLS engy_cl_init(); cl_configure(w, h); log_init(); info_init(); info_sync(); panel_init(); pointer_init(); serv_init(); logo_init(); alias_init(); // evas_render(shell->evas); }