PageRenderTime 10ms CodeModel.GetById 8ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gdk/library/gdk_event_motion.e

http://github.com/tybor/Liberty
Specman e | 102 lines | 65 code | 20 blank | 17 comment | 3 complexity | 6b581b81c4330d00a73b8fee745dfe9a MD5 | raw file
  1indexing
  2	description: "Event generated when the pointer moves."
  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 GDK_EVENT_MOTION
 23
 24inherit GDK_EVENT
 25
 26insert
 27	GDK_EVENT_MOTION_EXTERNALS
 28	GDK_MODIFIER_TYPE
 29
 30creation from_external_pointer
 31
 32feature -- access
 33
 34	time: INTEGER is
 35			-- the time of the event in milliseconds.
 36		do
 37			Result := gdk_event_motion_get_time (handle)
 38		end
 39
 40	x: REAL_64 is
 41			-- the x coordinate of the pointer relative to the window.
 42		do
 43			Result := gdk_event_motion_get_x (handle)
 44		end
 45
 46	y: REAL_64 is
 47			-- the y coordinate of the pointer relative to the window.
 48		do
 49			Result := gdk_event_motion_get_y (handle)
 50		end
 51
 52	axes: TUPLE [REAL_64, REAL_64] is
 53			-- x, y translated to the axes of device, or Void if device is the mouse.
 54		local
 55			device_axes: NATIVE_ARRAY [REAL_64]
 56		do
 57			device_axes := device_axes.from_pointer (gdk_event_motion_get_axes (handle))
 58			if device_axes.is_not_null then
 59				Result := [device_axes.item (0), device_axes.item (1)]
 60			end
 61		end
 62
 63	state: INTEGER is
 64			-- a bit-mask representing the state of the modifier keys
 65			-- (e.g. Control, Shift and Alt) and the pointer buttons.
 66			-- See GDK_MODIFIER_TYPE.
 67		do
 68			Result := gdk_event_motion_get_state (handle)
 69		ensure
 70			is_valid_gdk_modifier_type (Result)
 71		end
 72
 73	is_hint: BOOLEAN is
 74			-- Returns True if this event is just a hint, see the
 75			-- gdk_pointer_motion_hint_mask value in GDK_EVENT_MASK.
 76		do
 77			Result := gdk_event_motion_get_is_hint (handle) = 1
 78		end
 79
 80-- Not implemented: GdkDevice *device; 	the device where the event originated.
 81
 82	x_root: REAL_64 is
 83			-- the x coordinate of the pointer relative to the root of the screen.
 84		do
 85			Result := gdk_event_motion_get_x_root (handle)
 86		end
 87
 88	y_root: REAL_64 is
 89			-- the y coordinate of the pointer relative to the root of the screen.
 90		do
 91			Result := gdk_event_motion_get_y_root (handle)
 92		end
 93
 94-- feature -- size
 95-- 	struct_size: INTEGER is
 96-- 		external "C inline use <gdk/gdk.h>"
 97-- 		alias "sizeof(GdkEventMotion)"
 98-- 		end
 99
100invariant is_event_motion
101
102end -- class GDK_EVENT_MOTION