25 #ifndef CGU_TEXT_PRINTMANAGER_H
26 #define CGU_TEXT_PRINTMANAGER_H
36 #include <pango/pango-layout.h>
37 #include <glib-object.h>
49 #if defined(DOXYGEN_PARSING) || defined(CGU_USE_GTK)
51 #ifndef DOXYGEN_PARSING
54 class TPMPangoLayoutIterFree {
56 void operator()(PangoLayoutIter* obj_p) {
58 pango_layout_iter_free(obj_p);
63 typedef SharedHandle<PangoLayoutIter*, TPMPangoLayoutIterFree> TPMPangoLayoutIterSharedHandle;
65 #endif // DOXYGEN_PARSING
125 enum Mode {print_mode, view_mode, file_mode} mode;
131 TPMPangoLayoutIterSharedHandle current_line_iter_h;
132 std::unique_ptr<std::string> text_u;
133 std::string file_name;
134 std::vector<int> pages;
136 std::string font_family;
139 bool cancelled_when_drawing;
146 static std::string default_font_family;
147 static int default_font_size;
149 void paginate(GtkPrintContext*);
151 void begin_print_impl(GtkPrintOperation*, GtkPrintContext*);
152 void draw_page_impl(GtkPrintOperation*, GtkPrintContext*,
int);
153 GObject* create_custom_widget_impl(GtkPrintOperation*);
154 static void strip(std::string&);
159 #ifndef DOXYGEN_PARSING
212 const std::string& font_family =
"",
233 static void page_setup(GtkWindow* parent = 0);
257 #ifdef CGU_USE_AUTO_PTR
258 bool set_text(std::auto_ptr<std::string>& text);
260 bool set_text(std::unique_ptr<std::string>& text);
346 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
351 #endif // CGU_USE_GTK
355 #endif // TEXT_PRINTMANAGER_H