1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*- 2 * gtksourceprintcompositor.h 3 * This file is part of GtkSourceView 4 * 5 * Copyright (C) 2003 Gustavo Giráldez 6 * Copyright (C) 2007-2008 Paolo Maggi, Paolo Borelli and Yevgen Muntyan 7 * 8 * GtkSourceView is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2.1 of the License, or (at your option) any later version. 12 * 13 * GtkSourceView is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 */ 22 23 #ifndef GTK_SOURCE_PRINT_COMPOSITOR_H 24 #define GTK_SOURCE_PRINT_COMPOSITOR_H 25 26 #if !defined (GTK_SOURCE_H_INSIDE) && !defined (GTK_SOURCE_COMPILATION) 27 # if defined (__GNUC__) 28 # warning "Only <gtksourceview/gtksource.h> can be included directly." 29 # elif defined (G_OS_WIN32) 30 # pragma message("Only <gtksourceview/gtksource.h> can be included directly.") 31 # endif 32 #endif 33 34 #include <gtk/gtk.h> 35 #include <gtksourceview/gtksourcetypes.h> 36 37 G_BEGIN_DECLS 38 39 #define GTK_SOURCE_TYPE_PRINT_COMPOSITOR (gtk_source_print_compositor_get_type ()) 40 #define GTK_SOURCE_PRINT_COMPOSITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_SOURCE_TYPE_PRINT_COMPOSITOR, GtkSourcePrintCompositor)) 41 #define GTK_SOURCE_PRINT_COMPOSITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_SOURCE_TYPE_PRINT_COMPOSITOR, GtkSourcePrintCompositorClass)) 42 #define GTK_SOURCE_IS_PRINT_COMPOSITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_SOURCE_TYPE_PRINT_COMPOSITOR)) 43 #define GTK_SOURCE_IS_PRINT_COMPOSITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_SOURCE_TYPE_PRINT_COMPOSITOR)) 44 #define GTK_SOURCE_PRINT_COMPOSITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_SOURCE_TYPE_PRINT_COMPOSITOR, GtkSourcePrintCompositorClass)) 45 46 typedef struct _GtkSourcePrintCompositorClass GtkSourcePrintCompositorClass; 47 typedef struct _GtkSourcePrintCompositorPrivate GtkSourcePrintCompositorPrivate; 48 49 struct _GtkSourcePrintCompositor 50 { 51 GObject parent_instance; 52 53 GtkSourcePrintCompositorPrivate *priv; 54 }; 55 56 struct _GtkSourcePrintCompositorClass 57 { 58 GObjectClass parent_class; 59 60 /* Padding for future expansion */ 61 void (*_gtk_source_reserved1) (void); 62 void (*_gtk_source_reserved2) (void); 63 }; 64 65 GTK_SOURCE_AVAILABLE_IN_ALL 66 GType gtk_source_print_compositor_get_type (void) G_GNUC_CONST; 67 68 69 GTK_SOURCE_AVAILABLE_IN_ALL 70 GtkSourcePrintCompositor *gtk_source_print_compositor_new (GtkSourceBuffer *buffer); 71 72 GTK_SOURCE_AVAILABLE_IN_ALL 73 GtkSourcePrintCompositor *gtk_source_print_compositor_new_from_view (GtkSourceView *view); 74 75 76 GTK_SOURCE_AVAILABLE_IN_ALL 77 GtkSourceBuffer *gtk_source_print_compositor_get_buffer (GtkSourcePrintCompositor *compositor); 78 79 GTK_SOURCE_AVAILABLE_IN_ALL 80 void gtk_source_print_compositor_set_tab_width (GtkSourcePrintCompositor *compositor, 81 guint width); 82 83 GTK_SOURCE_AVAILABLE_IN_ALL 84 guint gtk_source_print_compositor_get_tab_width (GtkSourcePrintCompositor *compositor); 85 86 GTK_SOURCE_AVAILABLE_IN_ALL 87 void gtk_source_print_compositor_set_wrap_mode (GtkSourcePrintCompositor *compositor, 88 GtkWrapMode wrap_mode); 89 90 GTK_SOURCE_AVAILABLE_IN_ALL 91 GtkWrapMode gtk_source_print_compositor_get_wrap_mode (GtkSourcePrintCompositor *compositor); 92 93 GTK_SOURCE_AVAILABLE_IN_ALL 94 void gtk_source_print_compositor_set_highlight_syntax 95 (GtkSourcePrintCompositor *compositor, 96 gboolean highlight); 97 98 GTK_SOURCE_AVAILABLE_IN_ALL 99 gboolean gtk_source_print_compositor_get_highlight_syntax 100 (GtkSourcePrintCompositor *compositor); 101 102 GTK_SOURCE_AVAILABLE_IN_ALL 103 void gtk_source_print_compositor_set_print_line_numbers 104 (GtkSourcePrintCompositor *compositor, 105 guint interval); 106 107 GTK_SOURCE_AVAILABLE_IN_ALL 108 guint gtk_source_print_compositor_get_print_line_numbers 109 (GtkSourcePrintCompositor *compositor); 110 111 GTK_SOURCE_AVAILABLE_IN_ALL 112 void gtk_source_print_compositor_set_body_font_name 113 (GtkSourcePrintCompositor *compositor, 114 const gchar *font_name); 115 116 GTK_SOURCE_AVAILABLE_IN_ALL 117 gchar *gtk_source_print_compositor_get_body_font_name 118 (GtkSourcePrintCompositor *compositor); 119 120 GTK_SOURCE_AVAILABLE_IN_ALL 121 void gtk_source_print_compositor_set_line_numbers_font_name 122 (GtkSourcePrintCompositor *compositor, 123 const gchar *font_name); 124 125 GTK_SOURCE_AVAILABLE_IN_ALL 126 gchar *gtk_source_print_compositor_get_line_numbers_font_name 127 (GtkSourcePrintCompositor *compositor); 128 129 GTK_SOURCE_AVAILABLE_IN_ALL 130 void gtk_source_print_compositor_set_header_font_name 131 (GtkSourcePrintCompositor *compositor, 132 const gchar *font_name); 133 134 GTK_SOURCE_AVAILABLE_IN_ALL 135 gchar *gtk_source_print_compositor_get_header_font_name 136 (GtkSourcePrintCompositor *compositor); 137 138 GTK_SOURCE_AVAILABLE_IN_ALL 139 void gtk_source_print_compositor_set_footer_font_name 140 (GtkSourcePrintCompositor *compositor, 141 const gchar *font_name); 142 143 GTK_SOURCE_AVAILABLE_IN_ALL 144 gchar *gtk_source_print_compositor_get_footer_font_name 145 (GtkSourcePrintCompositor *compositor); 146 147 GTK_SOURCE_AVAILABLE_IN_ALL 148 gdouble gtk_source_print_compositor_get_top_margin (GtkSourcePrintCompositor *compositor, 149 GtkUnit unit); 150 151 GTK_SOURCE_AVAILABLE_IN_ALL 152 void gtk_source_print_compositor_set_top_margin (GtkSourcePrintCompositor *compositor, 153 gdouble margin, 154 GtkUnit unit); 155 156 GTK_SOURCE_AVAILABLE_IN_ALL 157 gdouble gtk_source_print_compositor_get_bottom_margin (GtkSourcePrintCompositor *compositor, 158 GtkUnit unit); 159 160 GTK_SOURCE_AVAILABLE_IN_ALL 161 void gtk_source_print_compositor_set_bottom_margin (GtkSourcePrintCompositor *compositor, 162 gdouble margin, 163 GtkUnit unit); 164 165 GTK_SOURCE_AVAILABLE_IN_ALL 166 gdouble gtk_source_print_compositor_get_left_margin (GtkSourcePrintCompositor *compositor, 167 GtkUnit unit); 168 169 GTK_SOURCE_AVAILABLE_IN_ALL 170 void gtk_source_print_compositor_set_left_margin (GtkSourcePrintCompositor *compositor, 171 gdouble margin, 172 GtkUnit unit); 173 174 GTK_SOURCE_AVAILABLE_IN_ALL 175 gdouble gtk_source_print_compositor_get_right_margin (GtkSourcePrintCompositor *compositor, 176 GtkUnit unit); 177 178 GTK_SOURCE_AVAILABLE_IN_ALL 179 void gtk_source_print_compositor_set_right_margin (GtkSourcePrintCompositor *compositor, 180 gdouble margin, 181 GtkUnit unit); 182 183 GTK_SOURCE_AVAILABLE_IN_ALL 184 void gtk_source_print_compositor_set_print_header (GtkSourcePrintCompositor *compositor, 185 gboolean print); 186 187 GTK_SOURCE_AVAILABLE_IN_ALL 188 gboolean gtk_source_print_compositor_get_print_header (GtkSourcePrintCompositor *compositor); 189 190 GTK_SOURCE_AVAILABLE_IN_ALL 191 void gtk_source_print_compositor_set_print_footer (GtkSourcePrintCompositor *compositor, 192 gboolean print); 193 194 GTK_SOURCE_AVAILABLE_IN_ALL 195 gboolean gtk_source_print_compositor_get_print_footer (GtkSourcePrintCompositor *compositor); 196 197 GTK_SOURCE_AVAILABLE_IN_ALL 198 void gtk_source_print_compositor_set_header_format (GtkSourcePrintCompositor *compositor, 199 gboolean separator, 200 const gchar *left, 201 const gchar *center, 202 const gchar *right); 203 204 GTK_SOURCE_AVAILABLE_IN_ALL 205 void gtk_source_print_compositor_set_footer_format (GtkSourcePrintCompositor *compositor, 206 gboolean separator, 207 const gchar *left, 208 const gchar *center, 209 const gchar *right); 210 211 GTK_SOURCE_AVAILABLE_IN_ALL 212 gint gtk_source_print_compositor_get_n_pages (GtkSourcePrintCompositor *compositor); 213 214 GTK_SOURCE_AVAILABLE_IN_ALL 215 gboolean gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor, 216 GtkPrintContext *context); 217 218 GTK_SOURCE_AVAILABLE_IN_ALL 219 gdouble gtk_source_print_compositor_get_pagination_progress 220 (GtkSourcePrintCompositor *compositor); 221 222 GTK_SOURCE_AVAILABLE_IN_ALL 223 void gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor, 224 GtkPrintContext *context, 225 gint page_nr); 226 227 G_END_DECLS 228 229 #endif /* GTK_SOURCE_PRINT_COMPOSITOR_H */ 230