Beispiel #1
0
void draw_decors(int page, int epage) {
	if (toggle_decors) {
		char title[512] = {0};
		sprintf(title, "PDF Viewer - Page %d of %d", page, epage);
		render_decorations(window, gfx_ctx, title);
	}
}
Beispiel #2
0
static void redraw(void) {
	draw_fill(ctx, rgb(TTK_BACKGROUND_DEFAULT));
	render_decorations(win, ctx, file_name);
	draw_image();
	flip(ctx);
	yutani_flip(yctx, win);
}
Beispiel #3
0
void render_slide(slide *sl)
{
	/* Returns a specially allocated surface only if the "except"
		subimage != NULL; otherwise uses the slide's built-in render surface. */
	
	style *st = sl->st;
	displaylinevector *repr = sl->repr;
	displayline *out;
	DrawMode *dm;
	SDL_Surface *surface;

	if(export_html == 1)
		printf("Rendering %s\n", sl->content->line);	
	if(sl->image_file != NULL)
		return;
	
	if(sl->render != NULL)
		SDL_FreeSurface(sl->render);
	sl->render = alloc_surface(sl->des_w, sl->des_h);
	
	reallocate_surfaces(sl);
	surface = sl->render;
		
	render_background(sl, surface);
	
	// Render the text lines:	
	dm = new DrawMode;
	dm->ttmode = dm->boldmode = dm->italicmode = 0;
	dm->current_text_colour_index = st->textcolour;
	dm->lastshift = 0;
	for(int i = 0; i < repr->count(); i++)
	{
		out = repr->item(i);
		render_line(sl, out, dm, surface);
	}
	delete dm;
	
	draw_logos(sl, st, surface);

	// Draw embedded images:
	subimage *img;
	for(int i = 0; i < sl->visible_images->count(); i++)
	{
		img = sl->visible_images->item(i);
		if(img->surface == NULL)
			load_subimage(img);
		draw_subimage(surface, img);
	}
	if(sl->deck_size > 1)
		render_decorations(sl);

	scale(sl);
}
Beispiel #4
0
static void decors() {
	render_decorations(window, ctx, "Julia Fractals");
}
Beispiel #5
0
int main(int argc, char **argv) {
	fz_document *doc = NULL;
	int c;
	fz_context *ctx;

	fz_var(doc);

	yctx = yutani_init();

	char * _width  = getenv("WIDTH");
	char * _height = getenv("HEIGHT");
	width  = _width  ? atoi(_width)  : 512;
	height = _height ? atoi(_height) : 512;

	init_decorations();

	window = yutani_window_create(yctx, width + decor_width(), height + decor_height());
	yutani_window_move(yctx, window, 50, 50);

	yutani_window_advertise_icon(yctx, window, "PDF Viewer", "pdfviewer");

	gfx_ctx = init_graphics_yutani(window);
	draw_fill(gfx_ctx,rgb(0,0,0));
	render_decorations(window, gfx_ctx, "PDFViewer - Loading...");

	while ((c = fz_getopt(argc, argv, "wf")) != -1) {
		switch (c) {
			case 'f':
				fit = 1;
				break;
		}
	}

	ctx = fz_new_context(NULL, NULL, FZ_STORE_DEFAULT);
	if (!ctx) {
		fprintf(stderr, "Could not initialize fitz context.\n");
		exit(1);
	}

	fz_set_aa_level(ctx, alphabits);
	colorspace = fz_device_rgb;

	fz_try(ctx) {
		while (fz_optind < argc)
		{
			fz_try(ctx)
			{
				filename = argv[fz_optind++];
				files++;

				fz_try(ctx)
				{
					doc = fz_open_document(ctx, filename);
				}
				fz_catch(ctx)
				{
					fz_throw(ctx, "cannot open document: %s", filename);
				}

				if (fz_optind == argc || !isrange(argv[fz_optind]))
					drawrange(ctx, doc, "1-");
				if (fz_optind < argc && isrange(argv[fz_optind]))
					drawrange(ctx, doc, argv[fz_optind++]);

				fz_close_document(doc);
				doc = NULL;
			}
			fz_catch(ctx)
			{
				if (!ignore_errors)
					fz_rethrow(ctx);

				fz_close_document(doc);
				doc = NULL;
				fz_warn(ctx, "ignoring error in '%s'", filename);
			}
		}
	}
	fz_catch(ctx) {
		fz_close_document(doc);
		fprintf(stderr, "error: cannot draw '%s'\n", filename);
		errored = 1;
	}

	fz_free_context(ctx);

	return (errored != 0);
}
Beispiel #6
0
void ttk_redraw_borders(ttk_window_t * window) {
	render_decorations(window->core_window, window->core_context, window->title);
}
Beispiel #7
0
void redraw_borders() {
	render_decorations(wina, ctx, "Graphics Test");
}
Beispiel #8
0
void redraw_borders() {
	render_decorations(wina, ctx, "🔥 Plasma 🔥");
}
Beispiel #9
0
static void decors() {
	render_decorations(window, ctx, APPLICATION_TITLE);
}