rgd 0.4.1a-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/BSDL +22 -0
  2. data/COPYING +4 -0
  3. data/README +3 -0
  4. data/Rakefile +48 -0
  5. data/ext/rgd/extconf.rb +15 -0
  6. data/ext/rgd/gd_playground/bmp.h +114 -0
  7. data/ext/rgd/gd_playground/gd_bmp.c +1130 -0
  8. data/ext/rgd/gd_playground/gdhelpers.h +61 -0
  9. data/ext/rgd/rgd.c +2976 -0
  10. data/lib/rgd/1.8/rgd.so +0 -0
  11. data/lib/rgd/1.9/rgd.so +0 -0
  12. data/lib/rgd.rb +2 -0
  13. data/test/main.rb +22 -0
  14. data/test/mtest_stringft_cn.png +0 -0
  15. data/test/mtest_stringft_cn.rb +20 -0
  16. data/test/test_arc.png +0 -0
  17. data/test/test_arc.rb +10 -0
  18. data/test/test_color_closest.rb +32 -0
  19. data/test/test_color_exact.rb +37 -0
  20. data/test/test_color_resolve.rb +42 -0
  21. data/test/test_color_transparent.rb +16 -0
  22. data/test/test_copy.png +0 -0
  23. data/test/test_copy.rb +13 -0
  24. data/test/test_copy_rotated.png +0 -0
  25. data/test/test_copy_rotated.rb +14 -0
  26. data/test/test_fill_1.png +0 -0
  27. data/test/test_fill_1.rb +9 -0
  28. data/test/test_fill_2.png +0 -0
  29. data/test/test_fill_2.rb +30 -0
  30. data/test/test_fill_3.png +0 -0
  31. data/test/test_fill_3.rb +35 -0
  32. data/test/test_fill_4.png +0 -0
  33. data/test/test_fill_4.rb +25 -0
  34. data/test/test_fill_to_border.rb +14 -0
  35. data/test/test_filled_ellipse.png +0 -0
  36. data/test/test_filled_ellipse.rb +8 -0
  37. data/test/test_filled_rectangle.rb +46 -0
  38. data/test/test_line_1.png +0 -0
  39. data/test/test_line_1.rb +18 -0
  40. data/test/test_line_2.rb +18 -0
  41. data/test/test_line_3.rb +40 -0
  42. data/test/test_line_3_1.png +0 -0
  43. data/test/test_line_3_2.png +0 -0
  44. data/test/test_line_3_3.png +0 -0
  45. data/test/test_line_3_4.png +0 -0
  46. data/test/test_line_3_5.png +0 -0
  47. data/test/test_line_3_6.png +0 -0
  48. data/test/test_line_3_7.png +0 -0
  49. data/test/test_line_3_8.png +0 -0
  50. data/test/test_tiled.png +0 -0
  51. data/test/test_tiled.rb +15 -0
  52. metadata +117 -0
@@ -0,0 +1,61 @@
1
+ #ifdef __cplusplus
2
+ extern "C" {
3
+ #endif
4
+
5
+ #ifndef GDHELPERS_H
6
+ #define GDHELPERS_H 1
7
+
8
+ /* sys/types.h is needed for size_t on Sparc-SunOS-4.1 */
9
+ #include <sys/types.h>
10
+
11
+ /* TBB: strtok_r is not universal; provide an implementation of it. */
12
+
13
+ char * gd_strtok_r (char *s, char *sep, char **state);
14
+
15
+ /* These functions wrap memory management. gdFree is
16
+ in gd.h, where callers can utilize it to correctly
17
+ free memory allocated by these functions with the
18
+ right version of free(). */
19
+ void *gdCalloc (size_t nmemb, size_t size);
20
+ void *gdMalloc (size_t size);
21
+ void *gdRealloc (void *ptr, size_t size);
22
+
23
+ /* Returns nonzero if multiplying the two quantities will
24
+ result in integer overflow. Also returns nonzero if
25
+ either quantity is negative. By Phil Knirsch based on
26
+ netpbm fixes by Alan Cox. */
27
+
28
+ int overflow2(int a, int b);
29
+
30
+ /* 2.0.16: portable mutex support for thread safety. */
31
+
32
+ #ifdef WIN32
33
+ /* 2.0.18: must include windows.h to get CRITICAL_SECTION. */
34
+ #include <windows.h>
35
+ #define gdMutexDeclare(x) CRITICAL_SECTION x
36
+ #define gdMutexSetup(x) InitializeCriticalSection(&x)
37
+ #define gdMutexShutdown(x) DeleteCriticalSection(&x)
38
+ #define gdMutexLock(x) EnterCriticalSection(&x)
39
+ #define gdMutexUnlock(x) LeaveCriticalSection(&x)
40
+ #else
41
+ #ifdef HAVE_PTHREAD
42
+ #include <pthread.h>
43
+ #define gdMutexDeclare(x) pthread_mutex_t x
44
+ #define gdMutexSetup(x) pthread_mutex_init(&x, 0)
45
+ #define gdMutexShutdown(x) pthread_mutex_destroy(&x)
46
+ #define gdMutexLock(x) pthread_mutex_lock(&x)
47
+ #define gdMutexUnlock(x) pthread_mutex_unlock(&x)
48
+ #else
49
+ #define gdMutexDeclare(x)
50
+ #define gdMutexSetup(x)
51
+ #define gdMutexShutdown(x)
52
+ #define gdMutexLock(x)
53
+ #define gdMutexUnlock(x)
54
+ #endif /* HAVE_PTHREAD */
55
+ #endif /* WIN32 */
56
+
57
+ #endif /* GDHELPERS_H */
58
+
59
+ #ifdef __cplusplus
60
+ }
61
+ #endif