/src/wrappers/gobject/library/g_enum_value.e

http://github.com/tybor/Liberty · Specman e · 76 lines · 51 code · 16 blank · 9 comment · 2 complexity · ae5fc783475742e50a9002cbe89e2be2 MD5 · raw file

  1. indexing
  2. description: "A structure which contains a single enum value, it's name, and it's nickname.."
  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. class G_ENUM_VALUE
  19. inherit
  20. C_STRUCT
  21. SHARED
  22. creation from_external_pointer
  23. feature -- size
  24. struct_size: INTEGER is
  25. external "C inline use <glib-object.h>"
  26. alias "sizeof(GEnumValue)"
  27. end
  28. feature
  29. value: INTEGER is
  30. -- the enum value
  31. do
  32. Result:=get_value (handle)
  33. end
  34. name: STRING is
  35. -- the name of the value
  36. do
  37. create Result.from_external_copy (get_name(handle))
  38. end
  39. nick: STRING is
  40. -- the nickname of the value
  41. do
  42. create Result.from_external_copy (get_nick(handle))
  43. end
  44. feature {} -- External call
  45. -- GEnumValue
  46. -- typedef struct {
  47. -- gint value;
  48. -- gchar *value_name;
  49. -- gchar *value_nick;
  50. --} ;
  51. get_value (a_genum_value: POINTER): INTEGER is
  52. external "C struct GEnumValue get value use <glib-object.h>"
  53. end
  54. get_name (a_genum_value: POINTER): POINTER is
  55. external "C struct GEnumValue get value_name use <glib-object.h>"
  56. end
  57. get_nick (a_genum_value: POINTER): POINTER is
  58. external "C struct GEnumValue get value_nick use <glib-object.h>"
  59. end
  60. end