/src/wrappers/cairo/library/cairo_surface_pattern.e

http://github.com/tybor/Liberty · Specman e · 44 lines · 27 code · 8 blank · 9 comment · 2 complexity · c5c156dd83ae1e1b31ea53f0240cb634 MD5 · raw file

  1. note
  2. description: "."
  3. copyright: "[
  4. Copyright (C) 2007-2017: Paolo Redaelli, Cairo 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 CAIRO_SURFACE_PATTERN
  19. inherit CAIRO_PATTERN
  20. create {ANY} from_surface, from_external_pointer
  21. feature {} -- Creation
  22. from_surface (a_surface: CAIRO_SURFACE)
  23. -- Create a new cairo_pattern_t for the given surface.
  24. require surface_not_void: a_surface /= Void
  25. do
  26. from_external_pointer(cairo_pattern_create_for_surface(a_surface.handle))
  27. -- cairo_pattern_create_for_surface returns the newly created
  28. -- cairo_pattern_t if succesful, or an error pattern in case
  29. -- of no memory. The caller owns the returned object and
  30. -- should call cairo_pattern_destroy() when finished with
  31. -- it. This function will always return a valid pointer, but
  32. -- if an error occurred the pattern status will be set to an
  33. -- error. To inspect the status of a pattern use
  34. -- cairo_pattern_status().
  35. end
  36. end -- class CAIRO_SURFACE_PATTERN