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

/src/wrappers/gobject/library/g_enum_value.e

http://github.com/tybor/Liberty
Specman e | 76 lines | 51 code | 16 blank | 9 comment | 2 complexity | ae5fc783475742e50a9002cbe89e2be2 MD5 | raw file
 1indexing
 2	description: "A structure which contains a single enum value, it's name, and it's nickname.."
 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
22class G_ENUM_VALUE
23
24inherit 
25	C_STRUCT
26	SHARED
27
28creation from_external_pointer
29
30feature -- size
31	struct_size: INTEGER is
32		external "C inline use <glib-object.h>"
33		alias "sizeof(GEnumValue)"
34		end
35
36feature 
37
38	value: INTEGER is
39		-- the enum value
40		do
41			Result:=get_value (handle)
42		end
43
44	name: STRING is
45			-- the name of the value
46		do
47			create Result.from_external_copy (get_name(handle))
48		end
49
50	nick: STRING is
51			-- the nickname of the value
52		do
53			create Result.from_external_copy (get_nick(handle))
54		end
55
56feature {} -- External call
57	-- GEnumValue
58	
59	-- typedef struct {
60	--   gint	 value;
61	--   gchar *value_name;
62	--   gchar *value_nick;
63	--} ;
64
65	get_value (a_genum_value: POINTER): INTEGER is
66		external "C struct GEnumValue get value use <glib-object.h>"
67		end
68
69	get_name (a_genum_value: POINTER): POINTER is
70		external "C struct GEnumValue get value_name use <glib-object.h>"
71		end
72
73	get_nick (a_genum_value: POINTER): POINTER is
74		external "C struct GEnumValue get value_nick use <glib-object.h>"
75		end
76end