PageRenderTime 22ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/library/gtk_page_setup_unix_dialog.e

http://github.com/tybor/Liberty
Specman e | 142 lines | 90 code | 23 blank | 29 comment | 6 complexity | 7b4832f0226728f42d313586c5fd98d9 MD5 | raw file
  1indexing
  2	description: "A page setup dialog."
  3	copyright: "[
  4					Copyright (C) 2007 Paolo Redaelli, GTK+ team
  5					
  6					This library is free software; you can redistribute it and/or
  7					modify it under the terms of the GNU Lesser General Public License
  8					as published by the Free Software Foundation; either version 2.1 of
  9					the License, or (at your option) any later version.
 10					
 11					This library is distributed in the hopeOA that it will be useful, but
 12					WITHOUT ANY WARRANTY; without even the implied warranty of
 13					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14					Lesser General Public License for more details.
 15
 16					You should have received a copy of the GNU Lesser General Public
 17					License along with this library; if not, write to the Free Software
 18					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 19					02110-1301 USA
 20			]"
 21
 22	wrapped_version: "2.10.6"
 23
 24class GTK_PAGE_SETUP_UNIX_DIALOG
 25	-- GtkPageSetupUnixDialog implements a page setup dialog for
 26	-- platforms which don't provide a native page setup dialog, like
 27	-- Unix. It can be used very much like any other GTK+ dialog, at
 28	-- the cost of the portability offered by the high-level printing
 29	-- API
 30	
 31	-- Printing support was added in GTK+ 2.10.
 32
 33inherit
 34	GTK_DIALOG
 35		rename
 36			make as make_dialog
 37		redefine
 38			struct_size
 39		end
 40	
 41	--   GtkPageSetupUnixDialog implements AtkImplementorIface.
 42
 43creation make, from_external_pointer
 44
 45feature {} -- Creation
 46	make (a_title: STRING; a_parent: GTK_WINDOW) is
 47			-- Creates a new page setup dialog.
 48			
 49			-- `a_title': the title of the dialog, or Void.
 50		
 51			-- `a_parent':  transient parent of the dialog, or Void
 52		do
 53			from_external_pointer(gtk_page_setup_unix_dialog_new
 54										 (null_or_string(a_title),
 55										  null_or(a_parent)))
 56		end
 57
 58	set_page_setup (a_page_setup: GTK_PAGE_SETUP) is
 59			-- Sets the GtkPageSetup from which the page setup dialog
 60			-- takes its values.
 61		require setup_not_void: a_page_setup/=Void
 62		do
 63			gtk_page_setup_unix_dialog_set_page_setup(handle,a_page_setup.handle)
 64		end
 65
 66	page_setup: GTK_PAGE_SETUP is
 67			--  the current page setup
 68		local p: POINTER; factory: G_OBJECT_EXPANDED_FACTORY[GTK_PAGE_SETUP]
 69		do
 70			p := gtk_page_setup_unix_dialog_get_page_setup(handle) 
 71			if p.is_not_null then
 72				Result:=factory.existant_wrapper(p)
 73				if Result=Void then
 74					create Result.from_external_pointer(p)
 75				end
 76			end
 77		end
 78
 79	set_print_settings (some_settings: GTK_PRINT_SETTINGS) is
 80			--Sets the GtkPrintSettings from which the page setup dialog takes its
 81		require settings_not_void: some_settings/= Void
 82		do
 83			gtk_page_setup_unix_dialog_set_print_settings
 84			(handle,some_settings.handle)
 85		ensure set: print_settings = some_settings
 86		end
 87
 88	print_settings: GTK_PRINT_SETTINGS is
 89			-- The current print settings
 90		local p: POINTER; r: G_OBJECT_EXPANDED_FACTORY[GTK_PRINT_SETTINGS]
 91		do
 92			p:=gtk_page_setup_unix_dialog_get_print_settings(handle)
 93			if p.is_not_null then
 94				Result:=r.existant_wrapper(p)
 95				if Result=Void then
 96					create Result.from_external_pointer(p)
 97				end
 98			end
 99		end
100
101feature {} -- External calls
102	-- #include <gtk/gtkpagesetupunixdialog.h>
103	
104	gtk_page_setup_unix_dialog_new  (a_title, a_parent: POINTER): POINTER is
105			-- GtkWidget* gtk_page_setup_unix_dialog_new (const gchar
106			-- *title, GtkWindow *parent);
107		external "C use <gtk/gtkpagesetupunixdialog.h>"
108		end
109
110	gtk_page_setup_unix_dialog_set_page_setup (a_dialog, a_page_setup: POINTER) is
111			--	void gtk_page_setup_unix_dialog_set_page_setup
112			--	(GtkPageSetupUnixDialog *dialog, GtkPageSetup
113			--	*page_setup);
114		external "C use <gtk/gtkpagesetupunixdialog.h>"
115		end
116
117	gtk_page_setup_unix_dialog_get_page_setup (a_dialog: POINTER): POINTER is
118			--	GtkPageSetup* gtk_page_setup_unix_dialog_get_page_setup
119			--	(GtkPageSetupUnixDialog *dialog);
120		external "C use <gtk/gtkpagesetupunixdialog.h>"
121		end
122
123	gtk_page_setup_unix_dialog_set_print_settings (a_dialog, a_print_settings: POINTER) is
124			-- void gtk_page_setup_unix_dialog_set_print_settings
125			-- (GtkPageSetupUnixDialog *dialog, GtkPrintSettings
126			-- *print_settings);
127		external "C use <gtk/gtkpagesetupunixdialog.h>"
128		end
129
130	gtk_page_setup_unix_dialog_get_print_settings (a_dialog: POINTER): POINTER is
131			-- GtkPrintSettings*
132			-- gtk_page_setup_unix_dialog_get_print_settings
133			-- (GtkPageSetupUnixDialog *dialog);
134		external "C use <gtk/gtkpagesetupunixdialog.h>"
135		end
136
137feature -- size
138	struct_size: INTEGER is
139		external "C inline use <gtk/gtkpagesetupunixdialog.h>"
140		alias "sizeof(GtkPageSetupUnixDialog)"
141		end
142end -- class GTK_PAGE_SETUP_UNIX_DIALOG