/src/wrappers/gdk/library/gdk_cursor.e
Specman e | 86 lines | 62 code | 19 blank | 5 comment | 2 complexity | 409a79d1b2587aeb7dec8933f0c2efc1 MD5 | raw file
1indexing 2 description: "A GdkCursor structure represents a cursor." 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 license: "LGPL v2 or later" 22 date: "$Date:$" 23 revision: "$Revision:$" 24 25class GDK_CURSOR 26 27inherit 28 G_STRUCT 29 redefine dispose end 30 31insert 32 GDK_CURSOR_EXTERNALS 33 34creation from_type, from_external_cursor 35 36feature -- size 37 38 struct_size: INTEGER is 39 external "C inline use <gdk/gdk.h>" 40 alias "sizeof(GdkCursor)" 41 end 42 43feature {} -- Creation 44 45 from_type (a_cursor_type: INTEGER) is 46 require 47 is_valid_gdk_cursor_type (a_cursor_type) 48 do 49 from_external_pointer (gdk_cursor_new (a_cursor_type)) 50 end 51 52 from_external_cursor (a_cursor: POINTER) is 53 -- Creates a cursor from an already existing C cursor. This feature 54 -- Increases the reference count to a_cursor by one. 55 require 56 a_cursor.is_not_null 57 local 58 dummy: POINTER 59 do 60 from_external_pointer (a_cursor) 61 dummy := gdk_cursor_ref (a_cursor) 62 end 63 64feature -- Disposing 65 66 dispose is 67 do 68 gdk_cursor_unref (handle) 69 handle:= default_pointer -- null 70 end 71 72feature 73 74--typedef struct { 75-- GdkCursorType type; 76--} GdkCursor; 77 78 cursor_type: INTEGER is 79 do 80 Result := gdk_cursor_type (handle) 81 ensure 82 is_valid_gdk_cursor_type (Result) 83 end 84 85end -- class GDK_CURSOR 86