Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

58 строки
2.2 KiB

  1. /*
  2. * libcucul Ruby bindings
  3. * Copyright (c) 2007 Pascal Terjan <pterjan@linuxfr.org>
  4. *
  5. * This library is free software. It comes without any warranty, to
  6. * the extent permitted by applicable law. You can redistribute it
  7. * and/or modify it under the terms of the Do What The Fuck You Want
  8. * To Public License, Version 2, as published by Sam Hocevar. See
  9. * http://sam.zoy.org/wtfpl/COPYING for more details.
  10. */
  11. #include <ruby.h>
  12. #include <cucul.h>
  13. #include "cucul-canvas.h"
  14. #include "cucul-dither.h"
  15. #include "cucul-font.h"
  16. static VALUE get_version(VALUE self)
  17. {
  18. return rb_str_new2(cucul_get_version());
  19. }
  20. void Init_cucul()
  21. {
  22. VALUE mCucul = rb_define_module("Cucul");
  23. rb_define_singleton_method(mCucul, "version", get_version, 0);
  24. rb_define_const(mCucul, "BLACK", INT2FIX(CUCUL_BLACK));
  25. rb_define_const(mCucul, "BLUE", INT2FIX(CUCUL_BLUE));
  26. rb_define_const(mCucul, "GREEN", INT2FIX(CUCUL_GREEN));
  27. rb_define_const(mCucul, "CYAN", INT2FIX(CUCUL_CYAN));
  28. rb_define_const(mCucul, "RED", INT2FIX(CUCUL_RED));
  29. rb_define_const(mCucul, "MAGENTA", INT2FIX(CUCUL_MAGENTA));
  30. rb_define_const(mCucul, "BROWN", INT2FIX(CUCUL_BROWN));
  31. rb_define_const(mCucul, "LIGHTGRAY", INT2FIX(CUCUL_LIGHTGRAY));
  32. rb_define_const(mCucul, "DARKGRAY", INT2FIX(CUCUL_DARKGRAY));
  33. rb_define_const(mCucul, "LIGHTBLUE", INT2FIX(CUCUL_LIGHTBLUE));
  34. rb_define_const(mCucul, "LIGHTGREEN", INT2FIX(CUCUL_LIGHTGREEN));
  35. rb_define_const(mCucul, "LIGHTCYAN", INT2FIX(CUCUL_LIGHTCYAN));
  36. rb_define_const(mCucul, "LIGHTRED", INT2FIX(CUCUL_LIGHTRED));
  37. rb_define_const(mCucul, "LIGHTMAGENTA", INT2FIX(CUCUL_LIGHTMAGENTA));
  38. rb_define_const(mCucul, "YELLOW", INT2FIX(CUCUL_YELLOW));
  39. rb_define_const(mCucul, "WHITE", INT2FIX(CUCUL_WHITE));
  40. rb_define_const(mCucul, "DEFAULT", INT2FIX(CUCUL_DEFAULT));
  41. rb_define_const(mCucul, "TRANSPARENT", INT2FIX(CUCUL_TRANSPARENT));
  42. rb_define_const(mCucul, "BOLD", INT2FIX(CUCUL_BOLD));
  43. rb_define_const(mCucul, "ITALICS", INT2FIX(CUCUL_ITALICS));
  44. rb_define_const(mCucul, "UNDERLINE", INT2FIX(CUCUL_UNDERLINE));
  45. rb_define_const(mCucul, "BLINK", INT2FIX(CUCUL_BLINK));
  46. Init_cucul_canvas(mCucul);
  47. Init_cucul_dither(mCucul);
  48. Init_cucul_font(mCucul);
  49. }