/src/wrappers/gtk/library/gtk_target_entry.e

http://github.com/tybor/Liberty · Specman e · 107 lines · 69 code · 22 blank · 16 comment · 3 complexity · 95f023e3a6c88bce836d7f9209d6a86c MD5 · raw file

  1. indexing
  2. description: "GtkTargetEntry -- String representing the drag type."
  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. gtk_documentation: "[
  19. ]"
  20. class GTK_TARGET_ENTRY
  21. -- A GtkTargetEntry structure represents a single type of data than
  22. -- can be supplied for by a widget for a selection or for supplied
  23. -- or received during drag-and-drop. It contains a string
  24. -- representing the drag type, a flags field (used only for drag
  25. -- and drop - see GtkTargetFlags), and an application assigned
  26. -- integer ID. The integer ID will later be passed as a signal
  27. -- parameter for signals like %"selection_get%". It allows the
  28. -- application to identify the target type without extensive string
  29. -- compares.
  30. -- GtkTargetEntry
  31. --
  32. -- typedef struct {
  33. -- gchar *target;
  34. -- guint flags;
  35. -- guint info;
  36. -- } GtkTargetEntry;
  37. inherit
  38. G_STRUCT
  39. insert
  40. GTK_TARGET_ENTRY_EXTERNALS
  41. creation from_external_pointer, make
  42. feature -- Creation
  43. make is
  44. do
  45. allocate
  46. end
  47. feature -- Access
  48. target: STRING is
  49. local
  50. c_ptr: POINTER
  51. do
  52. c_ptr := gtk_target_entry_get_target (handle)
  53. if c_ptr.is_not_null then
  54. create Result.from_external (c_ptr)
  55. end
  56. end
  57. flags: INTEGER is
  58. do
  59. Result := gtk_target_entry_get_flags (handle)
  60. end
  61. info: INTEGER is
  62. do
  63. Result := gtk_target_entry_get_info (handle)
  64. end
  65. feature -- Operations
  66. set_target (a_target: STRING) is
  67. require
  68. a_target /= Void
  69. do
  70. gtk_target_entry_set_target (handle, a_target.to_external)
  71. end
  72. set_flags (some_flags: INTEGER) is
  73. do
  74. gtk_target_entry_set_flags (handle, some_flags)
  75. end
  76. set_info (some_info: INTEGER) is
  77. do
  78. gtk_target_entry_set_info (handle, some_info)
  79. end
  80. feature -- size
  81. struct_size: INTEGER is
  82. external "C inline use <gtk/gtk.h>"
  83. alias "sizeof (GtkTargetEntry)"
  84. end
  85. end