int drv_mps803_init(void) { static const char *color_names[2] = { "Black", "White" }; drv803_log = log_open("MPS-803"); init_charset(charset, "mps803"); palette = palette_create(2, color_names); if (palette == NULL) { return -1; } if (palette_load("mps803" FSDEV_EXT_SEP_STR "vpl", palette) < 0) { log_error(drv803_log, "Cannot load palette file `%s'.", "mps803" FSDEV_EXT_SEP_STR "vpl"); return -1; } return 0; }
void fe_init (void) { font_normal = my_font_load (prefs.font_normal); dialog_font_normal = my_font_load (prefs.dialog_font_normal); palette_load (); key_init (); pixmaps_init (); channelwin_pix = pixmap_load_from_file (prefs.background); dialogwin_pix = pixmap_load_from_file (prefs.background_dialog); inputgad_style = create_inputgad_style (); }
/* Load RGB palette. */ static palette_t *video_load_palette(const video_cbm_palette_t *p, const char *name) { palette_t *palette; palette = palette_create(p->num_entries, NULL); if (palette == NULL) { return NULL; } if (!video_disabled_mode && palette_load(name, palette) < 0) { /* log_message(vicii.log, "Cannot load palette file `%s'.", name); */ return NULL; } return palette; }
Elicit * elicit_new() { Elicit *el; char buf[PATH_MAX]; char *dir; el = calloc(sizeof(Elicit), 1); el->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 500, 500); if (!el->ee) { fprintf(stderr, "[Elicit] Error creating new ecore evas\n"); free(el); return NULL; } el->evas = ecore_evas_get(el->ee); ecore_evas_title_set(el->ee, "Elicit"); ecore_evas_name_class_set(el->ee, "Elicit", "Elicit"); ecore_evas_borderless_set(el->ee, 1); // XXX get correct screen number if (ecore_x_screen_is_composited(0)) ecore_evas_alpha_set(el->ee, 1); else ecore_evas_shaped_set(el->ee, 1); ecore_evas_data_set(el->ee, "Elicit", el); ecore_evas_callback_resize_set(el->ee, cb_ee_resize); ecore_evas_callback_mouse_in_set(el->ee, cb_ee_mouse_in); ecore_evas_callback_mouse_out_set(el->ee, cb_ee_mouse_out); ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, cb_x_configure, el); el->obj.main = edje_object_add(el->evas); /* setup paths */ dir = br_find_data_dir(DATADIR); snprintf(buf, sizeof(buf), "%s/%s/", dir, PACKAGE); if (!ecore_file_exists(buf)) { fprintf(stderr, "[Elicit] Warning: falling back to hardcoded data dir.\n"); snprintf(buf, sizeof(buf), "%s/%s/", DATADIR, PACKAGE); } el->path.datadir = strdup(buf); free(dir); if (getenv("HOME")) { snprintf(buf, sizeof(buf), "%s/.e/apps/elicit/", getenv("HOME")); if (!ecore_file_is_dir(buf)) ecore_file_mkpath(buf); el->path.confdir = strdup(buf); snprintf(buf, sizeof(buf), "%s/.e/apps/elicit/elicit.conf", getenv("HOME")); el->path.conffile = strdup(buf); snprintf(buf, sizeof(buf), "%s/.e/apps/elicit/elicit.gpl", getenv("HOME")); el->path.palette = strdup(buf); } /* color */ el->color = color_new(); color_callback_changed_add(el->color, cb_color_changed, el); /* palette */ el->palette = palette_new(); palette_load(el->palette, el->path.palette); return el; }