1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                    Copyright (C) 2010, AdaCore                    -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  </description> 
  26. --  <c_version>2.16.6</c_version> 
  27.  
  28. with Glib.Object; 
  29. with Gtk.Page_Setup; 
  30. with Pango.Context; 
  31. with Pango.Layout; 
  32. with Cairo; 
  33.  
  34. package Gtk.Print_Context is 
  35.  
  36.    type Gtk_Print_Context_Record is 
  37.      new Glib.Object.GObject_Record with private; 
  38.    type Gtk_Print_Context is access all Gtk_Print_Context_Record'Class; 
  39.  
  40.    function Get_Type return GType; 
  41.  
  42.    function Create_Pango_Context 
  43.      (Context : access Gtk_Print_Context_Record) 
  44.       return Pango.Context.Pango_Context; 
  45.    --  Creates a new Pango_Context that can be used with the Gtk_Print_Context. 
  46.  
  47.    function Create_Pango_Layout 
  48.      (Context : access Gtk_Print_Context_Record) 
  49.       return Pango.Layout.Pango_Layout; 
  50.    --  Creates a new Pango_Layout that is suitable for use 
  51.    --  with the Gtk_Print_Context. 
  52.  
  53.    function Get_Cairo_Context 
  54.      (Context : access Gtk_Print_Context_Record) 
  55.       return Cairo.Cairo_Context; 
  56.    --  Obtains the cairo context that is associated with the Gtk_Print_Context. 
  57.  
  58.    function Get_Dpi_X 
  59.      (Context : access Gtk_Print_Context_Record) 
  60.       return Gdouble; 
  61.    --  Obtains the horizontal resolution of the Gtk_Print_Context, 
  62.    --  in dots per inch. 
  63.  
  64.    function Get_Dpi_Y 
  65.      (Context : access Gtk_Print_Context_Record) 
  66.       return Gdouble; 
  67.    --  Obtains the vertical resolution of the Gtk_Print_Context, 
  68.    --  in dots per inch. 
  69.  
  70.    function Get_Height 
  71.      (Context : access Gtk_Print_Context_Record) 
  72.       return Gdouble; 
  73.    --  Obtains the height of the Gtk_Print_Context, in pixels. 
  74.  
  75.    function Get_Page_Setup 
  76.      (Context : access Gtk_Print_Context_Record) 
  77.       return Gtk.Page_Setup.Gtk_Page_Setup; 
  78.    --  Obtains the Gtk_Page_Setup that determines the page 
  79.    --  dimensions of the Gtk_Print_Context. 
  80.  
  81.    function Get_Width 
  82.      (Context : access Gtk_Print_Context_Record) 
  83.       return Gdouble; 
  84.    --  Obtains the width of the Gtk_Print_Context, in pixels. 
  85.  
  86.    procedure Set_Cairo_Context 
  87.      (Context : access Gtk_Print_Context_Record; 
  88.       Cr      : Cairo.Cairo_Context; 
  89.       Dpi_X   : Gdouble; 
  90.       Dpi_Y   : Gdouble); 
  91.    --  Context: a Gtk_Print_Context 
  92.    --  Cr: the cairo context 
  93.    --  Dpi_X: the horizontal resolution to use with Cr 
  94.    --  Dpi_Y: the vertical resolution to use with Cr 
  95.    -- 
  96.    --  Sets a new cairo context on a print context. 
  97.    -- 
  98.    --  This function is intended to be used when implementing 
  99.    --  an internal print preview, it is not needed for printing, 
  100.    --  since GTK+ itself creates a suitable cairo context in that 
  101.    --  case. 
  102.  
  103. private 
  104.  
  105.    type Gtk_Print_Context_Record is 
  106.      new Glib.Object.GObject_Record with null record; 
  107.  
  108.    pragma Import (C, Get_Type, "gtk_print_context_get_type"); 
  109.  
  110. end Gtk.Print_Context;