int *invert;
Image *img;
char *embed;
+ int imagesplit;
} Slide;
/* Purely graphic info */
static void ffload(Slide *s);
static void ffprepare(Image *img);
static void ffscale(Image *img);
-static void ffdraw(Image *img);
+static void ffdraw(Image *img, int half);
static void getfontsize(Slide *s, unsigned int *width, unsigned int *height);
static void cleanup(int slidesonly);
}
void
-ffdraw(Image *img)
+ffdraw(Image *img, int half)
{
int xoffset = (xw.w - img->ximg->width) / 2;
int yoffset = (xw.h - img->ximg->height) / 2;
static size_t size = 0;
size_t blen, maxlines;
char buf[BUFSIZ], *p;
- int inverted = 0;
+ int inverted;
Slide *s;
/* read each line from fp and add it to the item list */
if (buf[0] == '#')
continue;
+ blen = strlen(buf);
inverted = 0;
if (buf[0] == '$') {
- buf[0] = ' ';
inverted = 1;
+ blen -= 1;
+ memmove(buf, buf + 1, blen);
+ buf[blen] = '\0';
}
/* grow lines array */
s->invert[s->linecount] = inverted;
- blen = strlen(buf);
if (!(s->lines[s->linecount] = strdup(buf)))
die("sent: Unable to strdup:");
if (s->lines[s->linecount][blen-1] == '\n')
/* mark as image slide if first line of a slide starts with @ */
if (s->linecount == 0 && s->lines[0][0] == '@')
s->embed = &s->lines[0][1];
+ else if (blen > 2 && buf[0] == '@' && buf[1] == '@') {
+ s->embed = &s->lines[0][2];
+ s->imagesplit = 1;
+ }
if (s->lines[s->linecount][0] == '\\')
memmove(s->lines[s->linecount], &s->lines[s->linecount][1], blen);
} else {
if (!(im->state & SCALED))
ffprepare(im);
- ffdraw(im);
+ ffdraw(im, 0);
}
}