25 #ifndef CGU_TEXT_PRINTMANAGER_H
26 #define CGU_TEXT_PRINTMANAGER_H
33 #include <pango/pango-layout.h>
34 #include <glib-object.h>
47 #ifndef DOXYGEN_PARSING
50 class TPMPangoLayoutIterFree {
52 void operator()(PangoLayoutIter* obj_p) {
54 pango_layout_iter_free(obj_p);
59 typedef SharedHandle<PangoLayoutIter*, TPMPangoLayoutIterFree> TPMPangoLayoutIterSharedHandle;
61 #endif // DOXYGEN_PARSING
118 enum Mode {print_mode, view_mode, file_mode} mode;
124 TPMPangoLayoutIterSharedHandle current_line_iter_h;
125 std::unique_ptr<std::string> text_u;
126 std::string file_name;
127 std::vector<int> pages;
129 std::string font_family;
132 bool cancelled_when_drawing;
139 static std::string default_font_family;
140 static int default_font_size;
142 void paginate(GtkPrintContext*);
144 void begin_print_impl(GtkPrintOperation*, GtkPrintContext*);
145 void draw_page_impl(GtkPrintOperation*, GtkPrintContext*,
int);
146 GObject* create_custom_widget_impl(GtkPrintOperation*);
147 static void strip(std::string&);
152 #ifndef DOXYGEN_PARSING
205 const std::string& font_family =
"",
226 static void page_setup(GtkWindow* parent = 0);
250 #ifdef CGU_USE_AUTO_PTR
251 bool set_text(std::auto_ptr<std::string>& text);
253 bool set_text(std::unique_ptr<std::string>& text);
339 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
346 #endif // TEXT_PRINTMANAGER_H