PageRenderTime 18ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/library/gtk_rc.e

http://github.com/tybor/Liberty
Specman e | 68 lines | 58 code | 10 blank | 0 comment | 2 complexity | ac5db99f6c1b2b5939eee932ee26b4a4 MD5 | raw file
 1indexing
 2	description: "Resource Files -- Routines for handling resource files"
 3	copyright: "[
 4					Copyright (C) 2006 eiffel-libraries team, 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 hope 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
22expanded class GTK_RC
23
24insert
25	ANY
26	GTK_RC_EXTERNALS
27
28feature -- Operations
29
30	parse (a_filename: STRING) is
31		require
32			a_filename /= Void
33		do
34			gtk_rc_parse (a_filename.to_external)
35		end
36
37	default_files: ARRAY [STRING] is
38		local
39			native_array: NATIVE_ARRAY [POINTER]
40			i: INTEGER
41		do
42			create native_array.default_create
43			native_array := native_array.from_pointer (gtk_rc_get_default_files)
44			create Result.make (1,0)
45			from i := 0 until native_array.item (i).is_null loop
46				Result.add_last (create {STRING}.from_external_copy (native_array.item (i)))
47				i := i + 1
48			end
49		end
50
51	set_default_files (some_default_files: ARRAY [STRING]) is
52		require
53			some_default_files /= Void
54		local
55			pointers: ARRAY [POINTER]
56			iter: ITERATOR [STRING]
57		do
58			create pointers.make (1,0)
59			from iter := some_default_files.get_new_iterator
60			until iter.is_off
61			loop
62				pointers.add_last (iter.item.to_external)
63			end
64			pointers.add_last (default_pointer)
65			gtk_rc_set_default_files (pointers.to_external)
66		end
67
68end -- class GTK_RC