/src/wrappers/gtk/library/gtk_rc.e

http://github.com/tybor/Liberty · Specman e · 68 lines · 58 code · 10 blank · 0 comment · 2 complexity · ac5db99f6c1b2b5939eee932ee26b4a4 MD5 · raw file

  1. indexing
  2. description: "Resource Files -- Routines for handling resource files"
  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. expanded class GTK_RC
  19. insert
  20. ANY
  21. GTK_RC_EXTERNALS
  22. feature -- Operations
  23. parse (a_filename: STRING) is
  24. require
  25. a_filename /= Void
  26. do
  27. gtk_rc_parse (a_filename.to_external)
  28. end
  29. default_files: ARRAY [STRING] is
  30. local
  31. native_array: NATIVE_ARRAY [POINTER]
  32. i: INTEGER
  33. do
  34. create native_array.default_create
  35. native_array := native_array.from_pointer (gtk_rc_get_default_files)
  36. create Result.make (1,0)
  37. from i := 0 until native_array.item (i).is_null loop
  38. Result.add_last (create {STRING}.from_external_copy (native_array.item (i)))
  39. i := i + 1
  40. end
  41. end
  42. set_default_files (some_default_files: ARRAY [STRING]) is
  43. require
  44. some_default_files /= Void
  45. local
  46. pointers: ARRAY [POINTER]
  47. iter: ITERATOR [STRING]
  48. do
  49. create pointers.make (1,0)
  50. from iter := some_default_files.get_new_iterator
  51. until iter.is_off
  52. loop
  53. pointers.add_last (iter.item.to_external)
  54. end
  55. pointers.add_last (default_pointer)
  56. gtk_rc_set_default_files (pointers.to_external)
  57. end
  58. end -- class GTK_RC