Example #1
0
File: imlib.c Project: Caellian/feh
void init_imlib_fonts(void)
{
	/* Set up the font stuff */
	imlib_add_path_to_font_path(".");
	imlib_add_path_to_font_path(FONTS_DIR);

	return;
}
Example #2
0
void init_imlib_fonts(void)
{
	/* Set up the font stuff */
	imlib_add_path_to_font_path(".");
	imlib_add_path_to_font_path(PREFIX "/share/feh/fonts");

	return;
}
Example #3
0
static void
EFonts_Init(void)
{
#if !TEST_TTFONT
    char                s[4096];

    Esnprintf(s, sizeof(s), "%s/ttfonts", Mode.theme.path);
    imlib_add_path_to_font_path(s);
    Esnprintf(s, sizeof(s), "%s/fonts", EDirRoot());
    imlib_add_path_to_font_path(s);
#endif
}
Example #4
0
void
R_init_imlib2(struct R_app *app)
{
    imlib_context_set_display(app->display);
    imlib_context_set_visual(app->visual);
    imlib_context_set_colormap(app->colormap);
    imlib_context_set_blend(0);
    imlib_context_set_mask(0);
    imlib_set_cache_size(IMLIB2_CACHE_SIZE);
    imlib_set_font_cache_size(IMLIB2_FONT_CACHE_SIZE);
    imlib_add_path_to_font_path(RESURRECTION_FONT_SEARCH_PATH "ttf");

    return;
}
Example #5
0
File: tag.c Project: decasm/sxiv
void set_font() {
	Imlib_Font font;

	/* set the font cache to 512Kb - again to avoid re-loading */
	imlib_set_font_cache_size(512 * 1024);
	/* add the ./ttfonts dir to our font path - you'll want a notepad.ttf */
	/* in that dir for the text to display */
	imlib_add_path_to_font_path("/usr/share/fonts/TTF");
	/* draw text - centered with the current mouse x, y */
	font = imlib_load_font("times/10");
	if (font) {
		/* set the current font */
		imlib_context_set_font(font);
		imlib_context_set_anti_alias(1);
	}
	else {
		fprintf(stderr, "Font not found: %s\n", "times/8");
	}
}
Example #6
0
int
app_init_imlib2(struct R_app *app)
{
    if (app == NULL) {

	return -1;
    }

    imlib_context_set_display(app->display);
    imlib_context_set_visual(app->visual);
    imlib_context_set_colormap(app->colormap);
    imlib_context_set_drawable(app->window->win);
    imlib_context_set_blend(0);
    imlib_context_set_mask(0);
    imlib_set_font_cache_size(1024 * 1024);
#if 0
    imlib_add_path_to_font_path(RESURRECTION_FONT_SEARCH_PATH "ttf/");
#endif
    imlib_set_cache_size(4096 * 1024);

    return 0;
}
Example #7
0
void init_font_path() {
	char buf[buflen];
	char *home;

	home = getenv("HOME");

	if (home) {
		strcpy(buf, home);
		strcat(buf, "/.xsysguard/fonts");
		imlib_add_path_to_font_path(buf);
		strcpy(buf, home);
		strcat(buf, "/.xsysguard");
		imlib_add_path_to_font_path(buf);
		strcpy(buf, home);
		strcat(buf, "/.fonts");
		imlib_add_path_to_font_path(buf);
	}

	imlib_add_path_to_font_path("/usr/share/fonts/truetype");
	imlib_add_path_to_font_path("/usr/X/lib/X11/fonts/TrueType");
	imlib_add_path_to_font_path("/usr/X11R6/lib/X11/fonts/truetype");
	imlib_add_path_to_font_path("/usr/X11R6/lib/X11/fonts/TrueType");
}
Example #8
0
int
main(int argc, char **argv)
{
   int                 w, h, tw, th;
   Imlib_Image         im_bg = NULL;
   XEvent              ev;
   KeySym              keysym;
   static char         kbuf[20];
   Imlib_Font          font;
   Imlib_Color_Range   range;
   const char         *display_name = getenv("DISPLAY");

   /**
    * First tests to determine which rendering task to perform
    */
   if (display_name == NULL)
       display_name = ":0";
   disp = XOpenDisplay(display_name);
   if (disp == NULL)
     {
       fprintf(stderr, "Can't open display %s\n", display_name);
       return 1;
     }
   vis = DefaultVisual(disp, DefaultScreen(disp));
   depth = DefaultDepth(disp, DefaultScreen(disp));
   cm = DefaultColormap(disp, DefaultScreen(disp));
   win =
       XCreateSimpleWindow(disp, DefaultRootWindow(disp), 0, 0, 100, 100, 0, 0,
                           0);
   XSelectInput(disp, win,
                ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
                PointerMotionMask | ExposureMask | KeyPressMask);
   XMapWindow(disp, win);

   /**
    * Start rendering
    */
   imlib_set_font_cache_size(512 * 1024);
   imlib_add_path_to_font_path(PACKAGE_DATA_DIR"/data/fonts");
   imlib_context_set_display(disp);
   imlib_context_set_visual(vis);
   imlib_context_set_colormap(cm);
   imlib_context_set_drawable(win);
   imlib_context_set_blend(0);
   imlib_context_set_color_modifier(NULL);
   imlib_context_set_blend(0);

   im_bg = imlib_create_image(600, 400);
   imlib_context_set_image(im_bg);
   w = imlib_image_get_width();
   h = imlib_image_get_height();
   imlib_context_set_color(128, 128, 255, 255);
   imlib_image_fill_rectangle(0, 0, w, h);
   XResizeWindow(disp, win, w, h);
   XSync(disp, False);

   while (1)
     {
        do
          {
             XNextEvent(disp, &ev);
             switch (ev.type)
               {
                 case ButtonRelease:
                    exit(0);
                    break;
                 case KeyPress:
                    XLookupString(&ev.xkey, (char *)kbuf, sizeof(kbuf), &keysym,
                                  NULL);
                    switch (*kbuf)
                      {
                        case 'q':
                           exit(0);
                        default:
                           break;
                      }
                    break;
                 default:
                    break;

               }
          }
        while (XPending(disp));

        imlib_context_set_image(im_bg);
        imlib_context_set_color(128, 128, 255, 255);
        imlib_image_fill_rectangle(0, 0, w, h);
        imlib_context_set_color(0, 0, 0, 255);
        imlib_image_draw_rectangle(20, 20, 560, 140);
        imlib_image_draw_rectangle(20, 220, 560, 140);
        font = imlib_load_font("notepad/15");
        if (font)
          {
             char                text[4096];

             imlib_context_set_font(font);
             imlib_context_set_color(0, 0, 0, 255);
             sprintf(text, "RGBA range, 2 points, from red to magenta");
             imlib_get_text_size(text, &tw, &th);
             imlib_text_draw(300 - tw / 2, 180 - th / 2, text);
             sprintf(text, "HSVA range, 2 points, from red to magenta");
             imlib_get_text_size(text, &tw, &th);
             imlib_text_draw(300 - tw / 2, 380 - th / 2, text);
             imlib_free_font();
          }

        /* Draw rectangle w/ RGBA gradient */
        range = imlib_create_color_range();
        imlib_context_set_color_range(range);
        imlib_context_set_color(255, 0, 0, 255);
        imlib_add_color_to_color_range(0);
        imlib_context_set_color(255, 0, 255, 255);
        imlib_add_color_to_color_range(20);
        imlib_image_fill_color_range_rectangle(21, 21, 558, 138, -90.0);
        imlib_free_color_range();

        /* Draw rectangle w/ HSVA gradient */
        range = imlib_create_color_range();
        imlib_context_set_color_range(range);
        imlib_context_set_color_hsva(0, 1, 1, 255);
        imlib_add_color_to_color_range(0);
        imlib_context_set_color_hsva(300, 1, 1, 255);
        imlib_add_color_to_color_range(20);
        imlib_image_fill_hsva_color_range_rectangle(21, 221, 558, 138, -90.0);
        imlib_free_color_range();

        imlib_render_image_on_drawable(0, 0);
     }
   return 0;
}
Example #9
0
int Configure(void **ctxp, int argc, char *argv[])
{
    int c;
    ContextInfo *ci;
    char *font = "LucidaSansDemiBold/16";
    char *fp = getenv("FONTPATH");
    char *color = 0;
    FILE *f;

    *ctxp = av_mallocz(sizeof(ContextInfo));
    ci = (ContextInfo *) *ctxp;

    optind = 0;

    if (fp)
        imlib_add_path_to_font_path(fp);

    while ((c = getopt(argc, argv, "c:f:F:t:x:y:")) > 0) {
        switch (c) {
        case 'c':
            color = optarg;
            break;
        case 'F':
            font = optarg;
            break;
        case 't':
            ci->text = av_strdup(optarg);
            break;
        case 'f':
            ci->file = av_strdup(optarg);
            break;
        case 'x':
            ci->x = atoi(optarg);
            break;
        case 'y':
            ci->y = atoi(optarg);
            break;
        case '?':
            fprintf(stderr, "Unrecognized argument '%s'\n", argv[optind]);
            return -1;
        }
    }

    ci->fn = imlib_load_font(font);
    if (!ci->fn) {
        fprintf(stderr, "Failed to load font '%s'\n", font);
        return -1;
    }
    imlib_context_set_font(ci->fn);
    imlib_context_set_direction(IMLIB_TEXT_TO_RIGHT);

    if (color) {
        char buff[256];
        int done = 0;

        f = fopen("/usr/lib/X11/rgb.txt", "r");
        if (!f) {
            fprintf(stderr, "Failed to find rgb.txt\n");
            return -1;
        }
        while (fgets(buff, sizeof(buff), f)) {
            int r, g, b;
            char colname[80];

            if (sscanf(buff, "%d %d %d %64s", &r, &g, &b, colname) == 4 &&
                    strcasecmp(colname, color) == 0) {
                ci->r = r;
                ci->g = g;
                ci->b = b;
                /* fprintf(stderr, "%s -> %d,%d,%d\n", colname, r, g, b); */
                done = 1;
                break;
            }
        }
        fclose(f);
        if (!done) {
            fprintf(stderr, "Unable to find color '%s' in rgb.txt\n", color);
            return -1;
        }
    }
    imlib_context_set_color(ci->r, ci->g, ci->b, 255);
    return 0;
}
Example #10
0
static void feh_parse_option_array(int argc, char **argv, int finalrun)
{
	int discard;
	static char stropts[] =
		"a:A:b:B:cC:dD:e:E:f:Fg:GhH:iIj:J:kK:lL:mM:nNo:O:pPqrR:sS:tT:uUvVwW:xXy:YzZ"
		".@:^:~:):|:+:<:>:";

	/* (*name, has_arg, *flag, val) See: struct option in getopts.h */
	static struct option lopts[] = {
		{"menu-bg"       , 1, 0, ')'},
		{"debug"         , 0, 0, '+'},
		{"scale-down"    , 0, 0, '.'},
		{"max-dimension" , 1, 0, '<'},
		{"min-dimension" , 1, 0, '>'},
		{"title-font"    , 1, 0, '@'},
		{"action"        , 1, 0, 'A'},
		{"image-bg"      , 1, 0, 'B'},
		{"fontpath"      , 1, 0, 'C'},
		{"slideshow-delay",1, 0, 'D'},
		{"thumb-height"  , 1, 0, 'E'},
		{"full-screen"   , 0, 0, 'F'}, /* deprecated */
		{"fullscreen"    , 0, 0, 'F'},
		{"draw-actions"  , 0, 0, 'G'},
		{"limit-height"  , 1, 0, 'H'},
		{"fullindex"     , 0, 0, 'I'},
		{"thumb-redraw"  , 1, 0, 'J'},
		{"caption-path"  , 1, 0, 'K'},
		{"customlist"    , 1, 0, 'L'},
		{"menu-font"     , 1, 0, 'M'},
		{"no-menus"      , 0, 0, 'N'},
		{"output-only"   , 1, 0, 'O'},
		{"cache-thumbnails", 0, 0, 'P'},
		{"reload"        , 1, 0, 'R'},
		{"sort"          , 1, 0, 'S'},
		{"theme"         , 1, 0, 'T'},
		{"loadable"      , 0, 0, 'U'},
		{"verbose"       , 0, 0, 'V'},
		{"limit-width"   , 1, 0, 'W'},
		{"ignore-aspect" , 0, 0, 'X'},
		{"hide-pointer"  , 0, 0, 'Y'},
		{"auto-zoom"     , 0, 0, 'Z'},
		{"title"         , 1, 0, '^'},
		{"alpha"         , 1, 0, 'a'},
		{"bg"            , 1, 0, 'b'},
		{"collage"       , 0, 0, 'c'},
		{"draw-filename" , 0, 0, 'd'},
		{"font"          , 1, 0, 'e'},
		{"filelist"      , 1, 0, 'f'},
		{"geometry"      , 1, 0, 'g'},
		{"help"          , 0, 0, 'h'},
		{"index"         , 0, 0, 'i'},
		{"output-dir"    , 1, 0, 'j'},
		{"keep-http"     , 0, 0, 'k'},
		{"list"          , 0, 0, 'l'},
		{"montage"       , 0, 0, 'm'},
		{"reverse"       , 0, 0, 'n'},
		{"output"        , 1, 0, 'o'},
		{"preload"       , 0, 0, 'p'},
		{"quiet"         , 0, 0, 'q'},
		{"recursive"     , 0, 0, 'r'},
		{"stretch"       , 0, 0, 's'},
		{"thumbnails"    , 0, 0, 't'},
		{"unloadable"    , 0, 0, 'u'},
		{"version"       , 0, 0, 'v'},
		{"multiwindow"   , 0, 0, 'w'},
		{"borderless"    , 0, 0, 'x'},
		{"thumb-width"   , 1, 0, 'y'},
		{"randomize"     , 0, 0, 'z'},
		{"start-at"      , 1, 0, '|'},
		{"thumb-title"   , 1, 0, '~'},
		{"bg-tile"       , 0, 0, 200},
		{"bg-center"     , 0, 0, 201},
		{"bg-scale"      , 0, 0, 202},
		{"zoom"          , 1, 0, 205},
		{"no-screen-clip", 0, 0, 206},
		{"index-info"    , 1, 0, 207},
		{"magick-timeout", 1, 0, 208},
		{"action1"       , 1, 0, 209},
		{"action2"       , 1, 0, 210},
		{"action3"       , 1, 0, 211},
		{"action4"       , 1, 0, 212},
		{"action5"       , 1, 0, 213},
		{"action6"       , 1, 0, 214},
		{"action7"       , 1, 0, 215},
		{"action8"       , 1, 0, 216},
		{"action9"       , 1, 0, 217},
		{"bg-fill"       , 0, 0, 218},
		{"bg-max"        , 0, 0, 219},
		{"no-jump-on-resort", 0, 0, 220},
#ifdef HAVE_LIBEXIF
		{"draw-exif"     , 0, 0, 223},
#endif
		{"cycle-once"    , 0, 0, 224},
		{"no-xinerama"   , 0, 0, 225},
		{"draw-tinted"   , 0, 0, 229},
		{"info"          , 1, 0, 234},
		{"force-aliasing", 0, 0, 235},
		{"no-fehbg"      , 0, 0, 236},
		{"keep-zoom-vp"  , 0, 0, 237},
		{"scroll-step"   , 1, 0, 238},
		{"xinerama-index", 1, 0, 239},

		{0, 0, 0, 0}
	};
	int optch = 0, cmdx = 0;

	while ((optch = getopt_long(argc, argv, stropts, lopts, &cmdx)) != EOF) {
		D(("Got option, getopt calls it %d, or %c\n", optch, optch));
		switch (optch) {
		case 0:
			break;
		case ')':
			free(opt.menu_bg);
			opt.menu_bg = estrdup(optarg);
			weprintf("The --menu-bg option is deprecated and will be removed by 2012");
			break;
		case '+':
			opt.debug = 1;
			break;
		case '<':
			XParseGeometry(optarg, &discard, &discard, &opt.max_width, &opt.max_height);
			if (opt.max_width == 0)
				opt.max_width = UINT_MAX;
			if (opt.max_height == 0)
				opt.max_height = UINT_MAX;
			break;
		case '>':
			XParseGeometry(optarg, &discard, &discard, &opt.min_width, &opt.min_height);
			break;
		case '.':
			opt.scale_down = 1;
			break;
		case '@':
			opt.title_font = estrdup(optarg);
			break;
		case 'A':
			opt.actions[0] = estrdup(optarg);
			break;
		case 'B':
			if (!strcmp(optarg, "checks"))
				opt.image_bg = IMAGE_BG_CHECKS;
			else if (!strcmp(optarg, "white"))
				opt.image_bg = IMAGE_BG_WHITE;
			else if (!strcmp(optarg, "black"))
				opt.image_bg = IMAGE_BG_BLACK;
			else
				weprintf("Unknown argument to --image-bg: %s", optarg);
			break;
		case 'C':
			D(("adding fontpath %s\n", optarg));
			imlib_add_path_to_font_path(optarg);
			break;
		case 'D':
			opt.slideshow_delay = atof(optarg);
			if (opt.slideshow_delay < 0.0) {
				opt.slideshow_delay *= (-1);
				opt.paused = 1;
			}
			break;
		case 'E':
			opt.thumb_h = atoi(optarg);
			break;
		case 'F':
			opt.full_screen = 1;
			break;
		case 'G':
			opt.draw_actions = 1;
			break;
		case 'H':
			opt.limit_h = atoi(optarg);
			break;
		case 'I':
			opt.index = 1;
			opt.index_info = estrdup("%n\n%S\n%wx%h");
			break;
		case 'J':
			opt.thumb_redraw = atoi(optarg);
			break;
		case 'K':
			opt.caption_path = estrdup(optarg);
			break;
		case 'L':
			opt.customlist = estrdup(optarg);
			opt.display = 0;
			break;
		case 'M':
			free(opt.menu_font);
			opt.menu_font = estrdup(optarg);
			break;
		case 'N':
			opt.no_menus = 1;
			break;
		case 'O':
			opt.output = 1;
			opt.output_file = estrdup(optarg);
			opt.display = 0;
			break;
		case 'P':
			opt.cache_thumbnails = 1;
			break;
		case 'R':
			opt.reload = atof(optarg);
			break;
		case 'S':
			if (!strcasecmp(optarg, "name"))
				opt.sort = SORT_NAME;
			else if (!strcasecmp(optarg, "filename"))
				opt.sort = SORT_FILENAME;
			else if (!strcasecmp(optarg, "mtime"))
				opt.sort = SORT_MTIME;
			else if (!strcasecmp(optarg, "width"))
				opt.sort = SORT_WIDTH;
			else if (!strcasecmp(optarg, "height"))
				opt.sort = SORT_HEIGHT;
			else if (!strcasecmp(optarg, "pixels"))
				opt.sort = SORT_PIXELS;
			else if (!strcasecmp(optarg, "size"))
				opt.sort = SORT_SIZE;
			else if (!strcasecmp(optarg, "format"))
				opt.sort = SORT_FORMAT;
			else {
				weprintf("Unrecognised sort mode \"%s\". Defaulting to "
						"sort by filename", optarg);
				opt.sort = SORT_FILENAME;
			}
			if (opt.randomize) {
				weprintf("commandline contains --randomize and --sort. "
						"--randomize has been unset");
				opt.randomize = 0;
			}
			break;
		case 'T':
			theme = estrdup(optarg);
			break;
		case 'U':
			opt.loadables = 1;
			opt.display = 0;
			break;
		case 'V':
			opt.verbose = 1;
			break;
		case 'W':
			opt.limit_w = atoi(optarg);
			break;
		case 'X':
			opt.aspect = 0;
			break;
		case 'Y':
			opt.hide_pointer = 1;
			break;
		case 'Z':
			opt.zoom_mode = ZOOM_MODE_MAX;
			break;
		case '^':
			opt.title = estrdup(optarg);
			break;
		case 'a':
			opt.alpha = 1;
			opt.alpha_level = 255 - atoi(optarg);
			break;
		case 'b':
			opt.bg = 1;
			opt.bg_file = estrdup(optarg);
			break;
		case 'c':
			opt.collage = 1;
			break;
		case 'd':
			opt.draw_filename = 1;
			break;
		case 'e':
			opt.font = estrdup(optarg);
			break;
		case 'f':
			if (!strcmp(optarg, "-"))
				opt.filelistfile = estrdup("/dev/stdin");
			else
				opt.filelistfile = estrdup(optarg);
			break;
		case 'g':
			opt.geom_flags = XParseGeometry(optarg, &opt.geom_x,
					&opt.geom_y, &opt.geom_w, &opt.geom_h);
			break;
		case 'h':
			show_usage();
			break;
		case 'i':
			opt.index = 1;
			opt.index_info = estrdup("%n");
			break;
		case 'j':
			opt.output_dir = estrdup(optarg);
			break;
		case 'k':
			opt.keep_http = 1;
			break;
		case 'l':
			opt.list = 1;
			opt.display = 0;
			break;
		case 'm':
			opt.index = 1;
			break;
		case 'n':
			opt.reverse = 1;
			break;
		case 'o':
			opt.output = 1;
			opt.output_file = estrdup(optarg);
			break;
		case 'p':
			opt.preload = 1;
			break;
		case 'q':
			opt.quiet = 1;
			break;
		case 'r':
			opt.recursive = 1;
			break;
		case 's':
			opt.stretch = 1;
			break;
		case 't':
			opt.thumbs = 1;
			opt.index_info = estrdup("%n");
			break;
		case 'u':
			opt.unloadables = 1;
			opt.display = 0;
			break;
		case 'v':
			show_version();
			break;
		case 'w':
			opt.multiwindow = 1;
			break;
		case 'x':
			opt.borderless = 1;
			break;
		case 'y':
			opt.thumb_w = atoi(optarg);
			break;
		case 'z':
			opt.randomize = 1;
			if (opt.sort != SORT_NONE) {
				weprintf("commandline contains --sort and --randomize. "
						"--sort has been unset");
				opt.sort = SORT_NONE;
			}
			break;
		case '|':
			opt.start_list_at = estrdup(optarg);
			break;
		case '~':
			opt.thumb_title = estrdup(optarg);
			break;
		case 200:
			opt.bgmode = BG_MODE_TILE;
			break;
		case 201:
			opt.bgmode = BG_MODE_CENTER;
			break;
		case 202:
			opt.bgmode = BG_MODE_SCALE;
			break;
		case 205:
			if (!strcmp("fill", optarg))
				opt.zoom_mode = ZOOM_MODE_FILL;
			else if (!strcmp("max", optarg))
				opt.zoom_mode = ZOOM_MODE_MAX;
			else
				opt.default_zoom = atoi(optarg);
			break;
		case 206:
			opt.screen_clip = 0;
			break;
		case 207:
			opt.index_info = estrdup(optarg);
			break;
		case 208:
			opt.magick_timeout = atoi(optarg);
			break;
		case 209:
			opt.actions[1] = estrdup(optarg);
			break;
		case 210:
			opt.actions[2] = estrdup(optarg);
			break;
		case 211:
			opt.actions[3] = estrdup(optarg);
			break;
		case 212:
			opt.actions[4] = estrdup(optarg);
			break;
		case 213:
			opt.actions[5] = estrdup(optarg);
			break;
		case 214:
			opt.actions[6] = estrdup(optarg);
			break;
		case 215:
			opt.actions[7] = estrdup(optarg);
			break;
		case 216:
			opt.actions[8] = estrdup(optarg);
			break;
		case 217:
			opt.actions[9] = estrdup(optarg);
			break;
		case 218:
			opt.bgmode = BG_MODE_FILL;
			break;
		case 219:
			opt.bgmode = BG_MODE_MAX;
			break;
		case 220:
			opt.jump_on_resort = 0;
			break;
#ifdef HAVE_LIBEXIF
		case 223:
			opt.draw_exif = 1;
			break;
#endif
		case 224:
			opt.cycle_once = 1;
			break;
		case 225:
			opt.xinerama = 0;
			break;
		case 229:
			opt.text_bg = TEXT_BG_TINTED;
			break;
		case 234:
			opt.info_cmd = estrdup(optarg);
			if (opt.info_cmd[0] == ';')
				opt.info_cmd++;
			else
				opt.draw_info = 1;
			break;
		case 235:
			opt.force_aliasing = 1;
			break;
		case 236:
			opt.no_fehbg = 1;
			break;
		case 237:
			opt.keep_zoom_vp = 1;
			break;
		case 238:
			opt.scroll_step = atoi(optarg);
			break;
		case 239:
			opt.xinerama_index = atoi(optarg);
			break;
		default:
			break;
		}
	}

	/* Now the leftovers, which must be files */
	if (optind < argc) {
		while (optind < argc) {
			if (opt.reload)
				original_file_items = gib_list_add_front(original_file_items, estrdup(argv[optind]));
			/* If recursive is NOT set, but the only argument is a directory
			   name, we grab all the files in there, but not subdirs */
			add_file_to_filelist_recursively(argv[optind++], FILELIST_FIRST);
		}
	}
	else if (finalrun && !opt.filelistfile && !opt.bgmode)
		add_file_to_filelist_recursively(".", FILELIST_FIRST);

	/* So that we can safely be called again */
	optind = 0;
	return;
}
Example #11
0
void set_font_path(char *path) {
	imlib_add_path_to_font_path(path);
}
Example #12
0
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);
}