/src/wrappers/gtk/library/gtk_color_selection_dialog.e

http://github.com/tybor/Liberty · Specman e · 97 lines · 57 code · 20 blank · 20 comment · 4 complexity · d9f0f16159305d7e98e8a66e2d120166 MD5 · raw file

  1. indexing
  2. description: "GtkColorSelectionDialog — A standard dialog box for selecting a color."
  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. date: "$Date:$"
  19. revision: "$Revision:$"
  20. class GTK_COLOR_SELECTION_DIALOG
  21. -- The GtkColorSelectionDialog provides a standard dialog which allows the
  22. -- user to select a color much like the GtkFileSelection provides a standard
  23. -- dialog for file selection.
  24. inherit
  25. GTK_DIALOG
  26. rename make as make_dialog
  27. redefine struct_size
  28. end
  29. -- GtkColorSelectionDialog implements AtkImplementorIface.
  30. insert
  31. GTK_COLOR_SELECTION_DIALOG_EXTERNALS
  32. creation make, from_external_pointer
  33. feature {} -- Creation
  34. make (a_title: STRING) is
  35. -- Creates a new GtkColorSelectionDialog.
  36. require title_not_void: a_title /= Void
  37. do
  38. from_external_pointer (gtk_color_selection_new(a_title.to_external))
  39. end
  40. feature
  41. colorselection: GTK_COLOR_SELECTION is
  42. local
  43. selection_ptr: POINTER
  44. cs: G_OBJECT_FACTORY [GTK_COLOR_SELECTION]
  45. do
  46. selection_ptr := gtk_color_selection_dialog_get_colorsel (handle)
  47. Result := cs.existant_wrapper (selection_ptr)
  48. if Result=Void then
  49. create Result.from_external_pointer (selection_ptr)
  50. end
  51. end
  52. feature {} -- External call
  53. gtk_color_selection_dialog_new (a_title: POINTER): POINTER is -- GtkWidget*
  54. external "C use <gtk/gtk.h>"
  55. end
  56. feature {} -- GtkColorSelectionDialog struct
  57. -- typedef struct _GtkColorSelectionDialog GtkColorSelectionDialog;
  58. -- The GtkColorSelectionDialog struct contains the following
  59. -- fields. (These fields should be considered read-only. They
  60. -- should never be set by an application.)
  61. -- GtkWidget *colorsel; The GtkColorSelection widget contained
  62. -- within the dialog. Use this widget and its
  63. -- gtk_color_selection_get_current_color() function to gain access
  64. -- to the selected color. Connect a handler for this widget's
  65. -- color_changed signal to be notified when the color changes.
  66. -- GtkWidget *ok_button; The OK button widget contained within the
  67. -- dialog. Connect a handler for the clicked event.
  68. -- GtkWidget *cancel_button; The cancel button widget contained
  69. -- within the dialog. Connect a handler for the clicked event.
  70. -- GtkWidget *help_button; The help button widget contained within
  71. -- the dialog. Connect a handler for the clicked event.
  72. feature -- struct size
  73. struct_size: INTEGER is
  74. external "C inline use <gtk/gtk.h>"
  75. alias "sizeof(GtkColorSelectionDialog)"
  76. end
  77. end -- class GTK_COLOR_SELECTION_DIALOG