/* * narrative_render_cairo.h * * Copyright © 2013-2019 Thomas White * * This file is part of Colloquium. * * Colloquium is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef NARRATIVE_RENDER_CAIRO_H #define NARRATIVE_RENDER_CAIRO_H #ifdef HAVE_CONFIG_H #include #endif #include "narrative.h" #include "imagestore.h" struct edit_pos { int para; /* Paragraph number (corresponding to narrative items) */ int pos; /* Byte position within paragraph (yes, really) */ int trail; /* 1 = end of character, 0 = before */ }; extern int narrative_wrap_range(Narrative *n, Stylesheet *stylesheet, PangoLanguage *lang, PangoContext *pc, double w, ImageStore *is, int min, int max, struct edit_pos sel_start, struct edit_pos sel_end); extern double narrative_get_height(Narrative *n); extern double narrative_item_get_height(Narrative *n, int i); extern int narrative_render_item_cairo(Narrative*n, cairo_t *cr, int i); extern int narrative_render_cairo(Narrative *n, cairo_t *cr, Stylesheet *stylesheet); extern int index_with_removal(int *chars_removed, int n_chars_removed, int idx); extern int index_before_removal(int *chars_removed, int n_chars_removed, int idx); #endif /* NARRATIVE_RENDER_CAIRO_H */