1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
92
  
93
  
94
  
95
  
/* -*- C -*- */ 
require gtk210; 
class GTK2.PrintContext; 
//! 
inherit G.Object; 
 
%{ 
#ifdef HAVE_CAIRO 
#include <cairo.h> 
 
struct program *cairo_program; 
#endif 
%} 
 
require cairo; 
object get_cairo_context() 
//! Obtains the cairo context that is associated with this PrintContext. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  if (!cairo_program) { 
    push_static_text("Cairo.Context"); 
    APPLY_MASTER("resolv",1); 
    cairo_program=program_from_svalue(Pike_sp-1); 
    Pike_sp--; /* Do not free cairo_program */ 
 
    if (!cairo_program) 
      Pike_error("Unable to find cairo module.\n"); 
  } 
  { 
    cairo_t *ctx; 
    struct object *o; 
 
    ctx=gtk_print_context_get_cairo_context(GTK_PRINT_CONTEXT(THIS->obj)); 
    o=fast_clone_object(cairo_program); 
    ((struct cairo_mod_context *)o->storage)->ctx=ctx; 
    ref_push_object(o); 
  } 
} 
 
/* 
void set_cairo_context(Cairo.Context cr, float dpi_x, float dpi_y) 
//! Sets a new Cairo.Context on this PrintContext. 
{ 
  pgtk2_verify_inited(); 
  if (!cairo_program) { 
    push_text("Cairo.Context"); 
    APPLY_MASTER("resolv",1); 
    cairo_program=program_from_svalue(Pike_sp-1); 
    Pike_sp--; // Do not free cairo_program 
 
    if (!cairo_program) 
      Pike_error("Unable to find cairo module.\n"); 
  } 
  { 
    struct object *o1; 
    FLOAT_TYPE x,y; 
    struct cairo_mod_context *cc; 
 
    get_all_args("set_cairo_context",args,"%o%f%f",&o,&x,&y); 
    if (!(cc = get_storage(o1, cairo_program))) 
      Pike_error("Object is not derived from Cairo.Context"); 
    gtk_print_context_set_cairo_context(GTK_PRINT_CONTEXT(THIS->obj), 
                        cc->ctx,x,y); 
  } 
  RETURN_THIS(); 
} 
*/ 
endrequire; 
 
+GTK2.PageSetup get_page_setup(); 
//! Obtains the GTK2.PageSetup that determines the page dimensions. 
 
float get_width(); 
//! Obtains the width, in pixels. 
 
float get_height(); 
//! Obtains the height, in pixels. 
 
float get_dpi_x(); 
//! Obtains the horizontal resolution, in dots per inch. 
 
float get_dpi_y(); 
//! Obtains the vertical resolution, in dots per inch. 
 
require pango; 
+Pango.Context create_pango_context(); 
//! Creates a new Pango.Context that can be used with this PrintContext. 
 
+Pango.Layout create_pango_layout(); 
//! Creates a new Pango.Layout that is suitable for use with this PrintContext. 
endrequire; 
 
endrequire;