printing.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
  2. * Copyright (C) 2007-2009 Holger Berndt <hb@claws-mail.org>
  3. * and the Claws Mail team
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. #ifndef __PRINTING_H__
  20. #define __PRINTING_H__
  21. #include <gtk/gtk.h>
  22. #ifdef HAVE_CONFIG_H
  23. # include "config.h"
  24. #endif
  25. #if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
  26. typedef struct _PrintData PrintData;
  27. typedef struct _PrintRenderer {
  28. PangoContext *(*get_pango_context)(gpointer renderer_data);
  29. gpointer (*get_data_to_print)(gpointer renderer_data, gint sel_start, gint sel_end);
  30. void (*cb_begin_print)(GtkPrintOperation *op, GtkPrintContext *context,
  31. gpointer user_data);
  32. void (*cb_draw_page)(GtkPrintOperation* op, GtkPrintContext*, gint page_nr,
  33. gpointer user_data);
  34. } PrintRenderer;
  35. void printing_print(GtkTextView*, GtkWindow*, gint, gint);
  36. void printing_print_full(GtkWindow *parent, PrintRenderer *renderer, gpointer renderer_data,
  37. gint sel_start, gint sel_end);
  38. void printing_page_setup(GtkWindow*);
  39. gpointer printing_get_renderer_data(PrintData *print_data);
  40. gdouble printing_get_zoom(PrintData *print_data);
  41. void printing_set_n_pages(PrintData *print_data, gint n_pages);
  42. GtkPrintSettings *printing_get_settings(void);
  43. GtkPageSetup *printing_get_page_setup(void);
  44. void printing_store_settings(GtkPrintSettings *new_settings);
  45. #endif /* GTK+ >= 2.10.0 */
  46. #endif /* __PRINTING_H__ */