/src/wrappers/gdk/library/gdk_cursor.e

http://github.com/tybor/Liberty · Specman e · 86 lines · 62 code · 19 blank · 5 comment · 2 complexity · 409a79d1b2587aeb7dec8933f0c2efc1 MD5 · raw file

  1. indexing
  2. description: "A GdkCursor structure represents a cursor."
  3. copyright: "[
  4. Copyright (C) 2006 eiffel-libraries team, GTK+ team
  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. This library is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. license: "LGPL v2 or later"
  19. date: "$Date:$"
  20. revision: "$Revision:$"
  21. class GDK_CURSOR
  22. inherit
  23. G_STRUCT
  24. redefine dispose end
  25. insert
  26. GDK_CURSOR_EXTERNALS
  27. creation from_type, from_external_cursor
  28. feature -- size
  29. struct_size: INTEGER is
  30. external "C inline use <gdk/gdk.h>"
  31. alias "sizeof(GdkCursor)"
  32. end
  33. feature {} -- Creation
  34. from_type (a_cursor_type: INTEGER) is
  35. require
  36. is_valid_gdk_cursor_type (a_cursor_type)
  37. do
  38. from_external_pointer (gdk_cursor_new (a_cursor_type))
  39. end
  40. from_external_cursor (a_cursor: POINTER) is
  41. -- Creates a cursor from an already existing C cursor. This feature
  42. -- Increases the reference count to a_cursor by one.
  43. require
  44. a_cursor.is_not_null
  45. local
  46. dummy: POINTER
  47. do
  48. from_external_pointer (a_cursor)
  49. dummy := gdk_cursor_ref (a_cursor)
  50. end
  51. feature -- Disposing
  52. dispose is
  53. do
  54. gdk_cursor_unref (handle)
  55. handle:= default_pointer -- null
  56. end
  57. feature
  58. --typedef struct {
  59. -- GdkCursorType type;
  60. --} GdkCursor;
  61. cursor_type: INTEGER is
  62. do
  63. Result := gdk_cursor_type (handle)
  64. ensure
  65. is_valid_gdk_cursor_type (Result)
  66. end
  67. end -- class GDK_CURSOR