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. --  This package contains functionality for composing a custom print preview 
  31. --  facility. 
  32. --  </description> 
  33. --  <c_version>2.16.6</c_version> 
  34.  
  35. with Glib.Types; 
  36.  
  37. package Gtk.Print_Operation_Preview is 
  38.  
  39.    type Gtk_Print_Operation_Preview is new Glib.Types.GType_Interface; 
  40.  
  41.    function Get_Type return GType; 
  42.  
  43.    procedure End_Preview (Preview : Gtk_Print_Operation_Preview); 
  44.    --  Ends a preview. 
  45.    --  This function must be called to finish a custom print preview. 
  46.  
  47.    function Is_Selected 
  48.      (Preview : Gtk_Print_Operation_Preview; 
  49.       Page_Nr : Gint) 
  50.       return Boolean; 
  51.    --  Returns whether the given page is included in the set of pages that 
  52.    --  have been selected for printing. 
  53.  
  54.    procedure Render_Page 
  55.      (Preview : Gtk_Print_Operation_Preview; 
  56.       Page_Nr : Gint); 
  57.    --  Renders a page to the preview, using the print context that 
  58.    --  was passed to the "preview" handler together with Preview. 
  59.    -- 
  60.    --  A custom iprint preview should use this function in its "expose" 
  61.    --  handler to render the currently selected page. 
  62.    -- 
  63.    --  Note that this function requires a suitable cairo context to 
  64.    --  be associated with the print context. 
  65.  
  66. private 
  67.  
  68.    pragma Import (C, Get_Type, "gtk_print_operation_preview_get_type"); 
  69.    pragma Import (C, End_Preview, "gtk_print_operation_preview_end_preview"); 
  70.    pragma Import (C, Render_Page, "gtk_print_operation_preview_render_page"); 
  71.  
  72. end Gtk.Print_Operation_Preview;