geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "printing.h"
#include "app.h"
#include "dialogs.h"
#include "document.h"
#include "geany.h"
#include "highlighting.h"
#include "msgwindow.h"
#include "sciwrappers.h"
#include "spawn.h"
#include "support.h"
#include "utils.h"
#include "ui_utils.h"
#include <math.h>
#include <time.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | DocInfo |
struct | PrintWidgets |
Functions | |
static PangoLayout * | setup_pango_layout (GtkPrintContext *context, PangoFontDescription *desc) |
static void | get_text_dimensions (PangoLayout *layout, const gchar *text, gdouble *width, gdouble *height) |
static void | add_page_header (DocInfo *dinfo, cairo_t *cr, gint width, gint page_nr) |
static void | custom_widget_apply (GtkPrintOperation *operation, GtkWidget *widget, gpointer user_data) |
static void | on_page_header_toggled (GtkToggleButton *togglebutton, gpointer user_data) |
static GtkWidget * | create_custom_widget (GtkPrintOperation *operation, gpointer user_data) |
static void | end_print (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) |
static void | setup_range (DocInfo *dinfo, GtkPrintContext *ctx) |
static void | begin_print (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) |
static gint | format_range (DocInfo *dinfo, gboolean draw) |
static gboolean | paginate (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) |
static void | draw_page (GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) |
static void | status_changed (GtkPrintOperation *op, gpointer data) |
static void | printing_print_gtk (GeanyDocument *doc) |
void | printing_page_setup_gtk (void) |
static void | print_external (GeanyDocument *doc) |
void | printing_print_doc (GeanyDocument *doc) |
Variables | |
PrintingPrefs | printing_prefs |
static GtkPrintSettings * | settings = NULL |
static GtkPageSetup * | page_setup = NULL |
|
static |
Definition at line 133 of file printing.c.
References _, DocInfo::doc, DOC_FILENAME, EMPTY, DocInfo::layout, DocInfo::line_height, PrintingPrefs::page_header_basename, PrintingPrefs::page_header_datefmt, DocInfo::pages, DocInfo::print_time, printing_prefs, and utils_get_date_time().
Referenced by draw_page().
|
static |
Definition at line 335 of file printing.c.
References DocInfo::doc, EDGE_NONE, GeanyDocument::editor, editor_create_widget(), GeanyInterfacePrefs::editor_font, GeanyDocument::file_type, get_text_dimensions(), highlighting_set_styles(), interface_prefs, DocInfo::layout, DocInfo::line_height, main_widgets, DocInfo::margin_width, NULL, DocInfo::pages, PrintingPrefs::print_line_numbers, DocInfo::print_time, printing_prefs, GeanyMainWidgets::progressbar, SC_PRINT_COLOURONWHITE, GeanyEditor::sci, DocInfo::sci, SCI_GETDOCPOINTER, DocInfo::sci_scale, sci_set_line_numbers(), SCI_SETDOCPOINTER, SCI_SETEDGEMODE, SCI_SETPRINTCOLOURMODE, SCI_SETVIEWEOL, SCI_SETVIEWWS, SCWS_INVISIBLE, setup_pango_layout(), and setup_range().
Referenced by printing_print_gtk().
|
static |
Definition at line 222 of file printing.c.
References _, PrintWidgets::check_print_basename, PrintWidgets::check_print_linenumbers, PrintWidgets::check_print_pageheader, PrintWidgets::check_print_pagenumbers, PrintWidgets::entry_print_dateformat, gtk_container_add(), gtk_widget_show_all(), NULL, on_page_header_toggled(), PrintingPrefs::page_header_basename, PrintingPrefs::page_header_datefmt, PrintingPrefs::print_line_numbers, PrintingPrefs::print_page_header, PrintingPrefs::print_page_numbers, printing_prefs, and ui_entry_add_clear_icon().
Referenced by printing_print_gtk().
|
static |
Definition at line 190 of file printing.c.
References PrintWidgets::check_print_basename, PrintWidgets::check_print_linenumbers, PrintWidgets::check_print_pageheader, PrintWidgets::check_print_pagenumbers, PrintWidgets::entry_print_dateformat, PrintingPrefs::page_header_basename, PrintingPrefs::page_header_datefmt, PrintingPrefs::print_line_numbers, PrintingPrefs::print_page_header, PrintingPrefs::print_page_numbers, and printing_prefs.
Referenced by printing_print_gtk().
|
static |
Definition at line 430 of file printing.c.
References _, add_page_header(), Sci_Rectangle::bottom, Sci_RangeToFormat::chrg, Sci_CharacterRange::cpMax, Sci_CharacterRange::cpMin, format_range(), DocInfo::fr, DocInfo::layout, Sci_Rectangle::left, line, DocInfo::line_height, main_widgets, DocInfo::margin_width, NULL, DocInfo::pages, PrintingPrefs::print_line_numbers, PrintingPrefs::print_page_header, PrintingPrefs::print_page_numbers, printing_prefs, GeanyMainWidgets::progressbar, Sci_RangeToFormat::rc, DocInfo::sci, sci_get_length(), DocInfo::sci_scale, text, and Sci_Rectangle::top.
Referenced by printing_print_gtk().
|
static |
Definition at line 288 of file printing.c.
References DocInfo::layout, main_widgets, NULL, DocInfo::pages, GeanyMainWidgets::progressbar, and DocInfo::sci.
Referenced by printing_print_gtk().
|
static |
Definition at line 396 of file printing.c.
References DocInfo::fr, Sci_RangeToFormat::hdc, pos, DocInfo::sci, SCI_FORMATRANGE, and DocInfo::sci_scale.
Referenced by draw_page(), and paginate().
|
static |
Definition at line 103 of file printing.c.
References geany_debug(), and text.
Referenced by begin_print().
|
static |
Definition at line 212 of file printing.c.
References PrintWidgets::check_print_basename, and PrintWidgets::entry_print_dateformat.
Referenced by create_custom_widget().
|
static |
Definition at line 409 of file printing.c.
References _, Sci_RangeToFormat::chrg, Sci_CharacterRange::cpMax, Sci_CharacterRange::cpMin, format_range(), DocInfo::fr, main_widgets, DocInfo::pages, and GeanyMainWidgets::progressbar.
Referenced by printing_print_gtk().
|
static |
Definition at line 580 of file printing.c.
References _, dialogs_show_msgbox(), dialogs_show_question(), EMPTY, error(), PrintingPrefs::external_print_cmd, GeanyDocument::file_name, msgwin_status_add(), NULL, printing_prefs, spawn_async(), and utils_str_replace_all().
Referenced by printing_print_doc().
void printing_page_setup_gtk | ( | void | ) |
Definition at line 562 of file printing.c.
References main_widgets, NULL, page_setup, settings, and GeanyMainWidgets::window.
Referenced by on_page_setup1_activate().
void printing_print_doc | ( | GeanyDocument * | doc | ) |
Definition at line 627 of file printing.c.
References DOC_VALID, print_external(), printing_prefs, printing_print_gtk(), and PrintingPrefs::use_gtk_printing.
Referenced by on_print1_activate().
|
static |
TODO check for monospace font, detect the widest character in the font and use it at font_width
Definition at line 505 of file printing.c.
References _, begin_print(), create_custom_widget(), custom_widget_apply(), dialogs_show_msgbox(), DocInfo::doc, draw_page(), end_print(), error(), GeanyDocument::file_name, main_widgets, NULL, page_setup, paginate(), settings, status_changed(), widgets, and GeanyMainWidgets::window.
Referenced by printing_print_doc().
|
static |
|
static |
Definition at line 302 of file printing.c.
References Sci_Rectangle::bottom, Sci_RangeToFormat::chrg, Sci_CharacterRange::cpMax, Sci_CharacterRange::cpMin, DocInfo::fr, Sci_RangeToFormat::hdc, Sci_RangeToFormat::hdcTarget, Sci_Rectangle::left, DocInfo::line_height, PrintingPrefs::print_page_header, PrintingPrefs::print_page_numbers, printing_prefs, Sci_RangeToFormat::rc, Sci_RangeToFormat::rcPage, Sci_Rectangle::right, DocInfo::sci, sci_get_length(), DocInfo::sci_scale, and Sci_Rectangle::top.
Referenced by begin_print().
|
static |
Definition at line 495 of file printing.c.
References _, filename, GEANY_STRING_UNTITLED, msgwin_status_add(), and NULL.
Referenced by printing_print_gtk().
|
static |
Definition at line 83 of file printing.c.
Referenced by printing_page_setup_gtk(), and printing_print_gtk().
PrintingPrefs printing_prefs |
Definition at line 50 of file printing.c.
Referenced by add_page_header(), begin_print(), create_custom_widget(), custom_widget_apply(), do_main_quit(), draw_page(), load_dialog_prefs(), on_file1_activate(), on_prefs_dialog_response(), prefs_init_dialog(), print_external(), printing_print_doc(), save_dialog_prefs(), and setup_range().
|
static |
Definition at line 82 of file printing.c.
Referenced by load_ui_prefs(), on_color_selection_change_palette_with_screen(), printing_page_setup_gtk(), and printing_print_gtk().