PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/src/wrappers/gdk/library/gdk_event_factory.e

http://github.com/tybor/Liberty
Specman e | 74 lines | 69 code | 5 blank | 0 comment | 4 complexity | e1a964b64de9ddb876f6739903a35fc6 MD5 | raw file
 1indexing
 2	description: "."
 3	copyright: "[
 4					Copyright (C) 2008 Paolo Redaelli					
 5					This library is free software; you can redistribute it and/or
 6					modify it under the terms of the GNU Lesser General Public License
 7					as published by the Free Software Foundation; either version 2.1 of
 8					the License, or (at your option) any later version.
 9					
10					This library is distributed in the hope that it will be useful, but
11					WITHOUT ANY WARRANTY; without even the implied warranty of
12					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13					Lesser General Public License for more details.
14
15					You should have received a copy of the GNU Lesser General Public
16					License along with this library; if not, write to the Free Software
17					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18					02110-1301 USA
19			]"
20
21expanded class GDK_EVENT_FACTORY
22
23insert 
24	WRAPPER_FACTORY[GDK_EVENT]
25	GDK_EVENT_TYPE
26	GDK_EVENT_EXTERNALS
27	EXCEPTIONS
28
29feature
30	wrapper (an_event_pointer: POINTER): GDK_EVENT is
31		local a_type: INTEGER
32		do
33			a_type:=gdk_event_type(an_event_pointer)
34			if     a_type = gdk_event_nothing then  create Result.from_external_pointer(an_event_pointer)
35			elseif a_type = gdk_event_delete then  create Result.from_external_pointer(an_event_pointer)
36			elseif a_type = gdk_event_destroy then  create Result.from_external_pointer(an_event_pointer)
37			elseif a_type = gdk_event_expose then 
38				create {GDK_EVENT_EXPOSE} Result.from_external_pointer(an_event_pointer)
39			elseif a_type = gdk_event_motion_notify then  create Result.from_external_pointer(an_event_pointer)
40			elseif a_type = gdk_event_button_press or a_type = gdk_event_2button_press or
41				a_type = gdk_event_3button_press or a_type = gdk_event_button_release then 
42				create {GDK_EVENT_BUTTON} Result.from_external_pointer(an_event_pointer)
43			elseif a_type = gdk_event_key_press then  create Result.from_external_pointer(an_event_pointer)
44			elseif a_type = gdk_event_key_release then  create Result.from_external_pointer(an_event_pointer)
45			elseif a_type = gdk_event_enter_notify or a_type = gdk_event_leave_notify then
46				create {GDK_EVENT_CROSSING} Result.from_external_pointer(an_event_pointer)
47			elseif a_type = gdk_event_focus_change then 
48				create {GDK_EVENT_FOCUS} Result.from_external_pointer(an_event_pointer)
49			elseif a_type = gdk_event_configure then  create Result.from_external_pointer(an_event_pointer)
50			elseif a_type = gdk_event_map then  create Result.from_external_pointer(an_event_pointer)
51			elseif a_type = gdk_event_unmap then  create Result.from_external_pointer(an_event_pointer)
52			elseif a_type = gdk_event_property_notify then  create Result.from_external_pointer(an_event_pointer)
53			elseif a_type = gdk_event_selection_clear then  create Result.from_external_pointer(an_event_pointer)
54			elseif a_type = gdk_event_selection_request then  create Result.from_external_pointer(an_event_pointer)
55			elseif a_type = gdk_event_selection_notify then  create Result.from_external_pointer(an_event_pointer)
56			elseif a_type = gdk_event_proximity_in then  create Result.from_external_pointer(an_event_pointer)
57			elseif a_type = gdk_event_proximity_out then  create Result.from_external_pointer(an_event_pointer)
58			elseif a_type = gdk_event_drag_enter then  create Result.from_external_pointer(an_event_pointer)
59			elseif a_type = gdk_event_drag_leave then  create Result.from_external_pointer(an_event_pointer)
60			elseif a_type = gdk_event_drag_motion then  create Result.from_external_pointer(an_event_pointer)
61			elseif a_type = gdk_event_drag_status then  create Result.from_external_pointer(an_event_pointer)
62			elseif a_type = gdk_event_drop_start then  create Result.from_external_pointer(an_event_pointer)
63			elseif a_type = gdk_event_drop_finished then  create Result.from_external_pointer(an_event_pointer)
64			elseif a_type = gdk_event_client_event then  create Result.from_external_pointer(an_event_pointer)
65			elseif a_type = gdk_event_visibility_notify then  create Result.from_external_pointer(an_event_pointer)
66			elseif a_type = gdk_event_no_expose then  create Result.from_external_pointer(an_event_pointer)
67			elseif a_type = gdk_event_scroll then  create Result.from_external_pointer(an_event_pointer)
68			elseif a_type = gdk_event_window_state then  create Result.from_external_pointer(an_event_pointer)
69			elseif a_type = gdk_event_setting then  create Result.from_external_pointer(an_event_pointer)
70			elseif a_type = gdk_event_owner_change then  create Result.from_external_pointer(an_event_pointer)
71			else raise("Unknown GdkEvent type")
72			end
73		end
74end