source: libcaca/trunk/ruby/cucul.c @ 2077

Last change on this file since 2077 was 2077, checked in by Pascal Terjan, 12 years ago
  • Add Caca.version and Cucul.version
  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
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
12#include <ruby.h>
13#include <cucul.h>
14
15#include "cucul-canvas.h"
16#include "cucul-dither.h"
17#include "cucul-font.h"
18
19static VALUE get_version(VALUE self)
20{
21    return rb_str_new2(cucul_get_version());
22}
23
24void Init_cucul()
25{
26    VALUE mCucul = rb_define_module("Cucul");
27
28    rb_define_singleton_method(mCucul, "version", get_version, 0);
29
30    rb_define_const(mCucul, "BLACK", INT2FIX(CUCUL_BLACK));
31    rb_define_const(mCucul, "BLUE", INT2FIX(CUCUL_BLUE));
32    rb_define_const(mCucul, "GREEN", INT2FIX(CUCUL_GREEN));
33    rb_define_const(mCucul, "CYAN", INT2FIX(CUCUL_CYAN));
34    rb_define_const(mCucul, "RED", INT2FIX(CUCUL_RED));
35    rb_define_const(mCucul, "MAGENTA", INT2FIX(CUCUL_MAGENTA));
36    rb_define_const(mCucul, "BROWN", INT2FIX(CUCUL_BROWN));
37    rb_define_const(mCucul, "LIGHTGRAY", INT2FIX(CUCUL_LIGHTGRAY));
38    rb_define_const(mCucul, "DARKGRAY", INT2FIX(CUCUL_DARKGRAY));
39    rb_define_const(mCucul, "LIGHTBLUE", INT2FIX(CUCUL_LIGHTBLUE));
40    rb_define_const(mCucul, "LIGHTGREEN", INT2FIX(CUCUL_LIGHTGREEN));
41    rb_define_const(mCucul, "LIGHTCYAN", INT2FIX(CUCUL_LIGHTCYAN));
42    rb_define_const(mCucul, "LIGHTRED", INT2FIX(CUCUL_LIGHTRED));
43    rb_define_const(mCucul, "LIGHTMAGENTA", INT2FIX(CUCUL_LIGHTMAGENTA));
44    rb_define_const(mCucul, "YELLOW", INT2FIX(CUCUL_YELLOW));
45    rb_define_const(mCucul, "WHITE", INT2FIX(CUCUL_WHITE));
46    rb_define_const(mCucul, "DEFAULT", INT2FIX(CUCUL_DEFAULT));
47    rb_define_const(mCucul, "TRANSPARENT", INT2FIX(CUCUL_TRANSPARENT));
48
49    rb_define_const(mCucul, "BOLD", INT2FIX(CUCUL_BOLD));
50    rb_define_const(mCucul, "ITALICS", INT2FIX(CUCUL_ITALICS));
51    rb_define_const(mCucul, "UNDERLINE", INT2FIX(CUCUL_UNDERLINE));
52    rb_define_const(mCucul, "BLINK", INT2FIX(CUCUL_BLINK));
53
54    Init_cucul_canvas(mCucul);
55    Init_cucul_dither(mCucul);
56    Init_cucul_font(mCucul);
57}
Note: See TracBrowser for help on using the repository browser.