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
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

printing.c File Reference
#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>
Include dependency graph for printing.c:

Go to the source code of this file.


struct  DocInfo
struct  PrintWidgets


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)


PrintingPrefs printing_prefs
static GtkPrintSettings * settings = NULL
static GtkPageSetup * page_setup = NULL

Function Documentation

◆ add_page_header()

static void add_page_header ( DocInfo dinfo,
cairo_t *  cr,
gint  width,
gint  page_nr 

◆ begin_print()

◆ create_custom_widget()

◆ custom_widget_apply()

◆ draw_page()

◆ end_print()

static void end_print ( GtkPrintOperation *  operation,
GtkPrintContext *  context,
gpointer  user_data 

◆ format_range()

static gint format_range ( DocInfo dinfo,
gboolean  draw 

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().

◆ get_text_dimensions()

static void get_text_dimensions ( PangoLayout *  layout,
const gchar *  text,
gdouble *  width,
gdouble *  height 

Definition at line 103 of file printing.c.

References geany_debug(), and text.

Referenced by begin_print().

◆ on_page_header_toggled()

static void on_page_header_toggled ( GtkToggleButton *  togglebutton,
gpointer  user_data 

◆ paginate()

static gboolean paginate ( GtkPrintOperation *  operation,
GtkPrintContext *  context,
gpointer  user_data 

◆ print_external()

◆ printing_page_setup_gtk()

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().

◆ printing_print_doc()

void printing_print_doc ( GeanyDocument doc)

◆ printing_print_gtk()

static void printing_print_gtk ( GeanyDocument doc)

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().

◆ setup_pango_layout()

static PangoLayout * setup_pango_layout ( GtkPrintContext *  context,
PangoFontDescription *  desc 

Definition at line 89 of file printing.c.

References NULL.

Referenced by begin_print().

◆ setup_range()

◆ status_changed()

static void status_changed ( GtkPrintOperation *  op,
gpointer  data 

Definition at line 495 of file printing.c.

References _, filename, GEANY_STRING_UNTITLED, msgwin_status_add(), and NULL.

Referenced by printing_print_gtk().

Variable Documentation

◆ page_setup

GtkPageSetup* page_setup = NULL

Definition at line 83 of file printing.c.

Referenced by printing_page_setup_gtk(), and printing_print_gtk().

◆ printing_prefs

◆ settings

GtkPrintSettings* settings = NULL