1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                    Copyright (C) 2010-2013, 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. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  </description> 
  31. --  <c_version>2.16.6</c_version> 
  32.  
  33. with Glib.Object; 
  34. with Gtk.Page_Setup; 
  35. with Pango.Context; 
  36. with Pango.Layout; 
  37. with Cairo; 
  38.  
  39. package Gtk.Print_Context is 
  40.  
  41.    type Gtk_Print_Context_Record is 
  42.      new Glib.Object.GObject_Record with private; 
  43.    type Gtk_Print_Context is access all Gtk_Print_Context_Record'Class; 
  44.  
  45.    function Get_Type return GType; 
  46.  
  47.    function Create_Pango_Context 
  48.      (Context : access Gtk_Print_Context_Record) 
  49.       return Pango.Context.Pango_Context; 
  50.    --  Creates a new Pango_Context that can be used with the Gtk_Print_Context. 
  51.  
  52.    function Create_Pango_Layout 
  53.      (Context : access Gtk_Print_Context_Record) 
  54.       return Pango.Layout.Pango_Layout; 
  55.    --  Creates a new Pango_Layout that is suitable for use 
  56.    --  with the Gtk_Print_Context. 
  57.  
  58.    function Get_Cairo_Context 
  59.      (Context : access Gtk_Print_Context_Record) 
  60.       return Cairo.Cairo_Context; 
  61.    --  Obtains the cairo context that is associated with the Gtk_Print_Context. 
  62.  
  63.    function Get_Dpi_X 
  64.      (Context : access Gtk_Print_Context_Record) 
  65.       return Gdouble; 
  66.    --  Obtains the horizontal resolution of the Gtk_Print_Context, 
  67.    --  in dots per inch. 
  68.  
  69.    function Get_Dpi_Y 
  70.      (Context : access Gtk_Print_Context_Record) 
  71.       return Gdouble; 
  72.    --  Obtains the vertical resolution of the Gtk_Print_Context, 
  73.    --  in dots per inch. 
  74.  
  75.    function Get_Height 
  76.      (Context : access Gtk_Print_Context_Record) 
  77.       return Gdouble; 
  78.    --  Obtains the height of the Gtk_Print_Context, in pixels. 
  79.  
  80.    function Get_Page_Setup 
  81.      (Context : access Gtk_Print_Context_Record) 
  82.       return Gtk.Page_Setup.Gtk_Page_Setup; 
  83.    --  Obtains the Gtk_Page_Setup that determines the page 
  84.    --  dimensions of the Gtk_Print_Context. 
  85.  
  86.    function Get_Width 
  87.      (Context : access Gtk_Print_Context_Record) 
  88.       return Gdouble; 
  89.    --  Obtains the width of the Gtk_Print_Context, in pixels. 
  90.  
  91.    procedure Set_Cairo_Context 
  92.      (Context : access Gtk_Print_Context_Record; 
  93.       Cr      : Cairo.Cairo_Context; 
  94.       Dpi_X   : Gdouble; 
  95.       Dpi_Y   : Gdouble); 
  96.    --  Context: a Gtk_Print_Context 
  97.    --  Cr: the cairo context 
  98.    --  Dpi_X: the horizontal resolution to use with Cr 
  99.    --  Dpi_Y: the vertical resolution to use with Cr 
  100.    -- 
  101.    --  Sets a new cairo context on a print context. 
  102.    -- 
  103.    --  This function is intended to be used when implementing 
  104.    --  an internal print preview, it is not needed for printing, 
  105.    --  since GTK+ itself creates a suitable cairo context in that 
  106.    --  case. 
  107.  
  108. private 
  109.  
  110.    type Gtk_Print_Context_Record is 
  111.      new Glib.Object.GObject_Record with null record; 
  112.  
  113.    pragma Import (C, Get_Type, "gtk_print_context_get_type"); 
  114.  
  115. end Gtk.Print_Context;