/src/wrappers/gtk/library/paste_clipboard_callback.e

http://github.com/tybor/Liberty · Specman e · 71 lines · 53 code · 16 blank · 2 comment · 3 complexity · 9d5a61432c8f43c8036130e8dfeabac0 MD5 · raw file

  1. indexing
  2. description: "Callback for the paste-clipboard signal"
  3. copyright: "[
  4. Copyright (C) 2008 Anthony Lenton, Soluciones Inform??ticas Libres S.A.,
  5. eiffel-libraries team, GTK+ team and others
  6. This library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public License
  8. as published by the Free Software Foundation; either version 2.1 of
  9. the License, or (at your option) any later version.
  10. This library is distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with this library; if not, write to the Free Software
  16. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  17. 02110-1301 USA
  18. ]"
  19. license: "LGPL v2 or later"
  20. date: "$Date:$"
  21. revision "$Revision:$"
  22. class PASTE_CLIPBOARD_CALLBACK
  23. inherit CALLBACK redefine object end
  24. insert G_OBJECT_FACTORY [GTK_TEXT_VIEW]
  25. creation make
  26. feature
  27. object: GTK_TEXT_VIEW
  28. feature
  29. callback (instance: POINTER) is
  30. require
  31. instance_not_null: instance.is_not_null
  32. do
  33. -- The following is written with the implicit requirement
  34. -- that the object is actually created by the Eiffel
  35. object := wrapper(instance)
  36. procedure.call ([object])
  37. end
  38. callback_pointer: POINTER is
  39. do
  40. Result := get_callback_pointer ($callback)
  41. ensure
  42. Result.is_not_null
  43. end
  44. connect (an_object: like object; a_procedure: like procedure) is
  45. require
  46. an_object /= Void
  47. a_procedure /= Void
  48. do
  49. handler_id := g_signal_connect_closure (an_object.handle, signal_name.to_external,
  50. handle, 1) -- i.e. call it after default handler
  51. procedure := a_procedure
  52. end
  53. signal_name: STRING is "paste-clipboard"
  54. procedure: PROCEDURE [ANY, TUPLE [like object]]
  55. end -- class PASTE_CLIPBOARD_CALLBACK