Changeset 2821 for libcaca/trunk/cxx
- Timestamp:
- Sep 27, 2008, 3:12:46 PM (14 years ago)
- Location:
- libcaca/trunk/cxx
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cxx/Makefile.am
r2424 r2821 1 1 # $Id: Makefile.am 552 2006-04-13 16:10:16Z jylam $ 2 2 3 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul \ 4 -I$(top_srcdir)/caca 3 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca 5 4 6 5 if USE_CXX 7 pkgconfig_DATA = c ucul++.pc caca++.pc6 pkgconfig_DATA = caca++.pc 8 7 pkgconfigdir = $(libdir)/pkgconfig 9 8 10 include_HEADERS = c ucul++.h caca++.h11 lib_LTLIBRARIES = libc ucul++.la libcaca++.la9 include_HEADERS = caca++.h 10 lib_LTLIBRARIES = libcaca++.la 12 11 endif 13 12 14 libcucul___la_SOURCES = cucul++.cpp cucul++.h 15 libcucul___la_LDFLAGS = -no-undefined -version-number @LT_VERSION@ 16 libcucul___la_LIBADD = ../cucul/libcucul.la 17 18 libcaca___la_SOURCES = caca++.cpp caca++.h 13 libcaca___la_SOURCES = caca++.cpp cucul++.cpp caca++.h 19 14 libcaca___la_LDFLAGS = -no-undefined -version-number @LT_VERSION@ 20 libcaca___la_LIBADD = libcucul++.la../caca/libcaca.la15 libcaca___la_LIBADD = ../caca/libcaca.la 21 16 22 17 if USE_CXX … … 25 20 26 21 cxxtest_SOURCES = cxxtest.cpp 27 cxxtest_LDADD = libcaca++.la libcucul++.la ../caca/libcaca.la ../cucul/libcucul.la22 cxxtest_LDADD = libcaca++.la ../caca/libcaca.la 28 23 -
libcaca/trunk/cxx/caca++.cpp
r2191 r2821 25 25 #include "caca++.h" 26 26 27 Caca::Caca(C ucul*cv)27 Caca::Caca(Canvas *cv) 28 28 { 29 dp = caca_create_display(cv->get_c ucul_canvas_t());29 dp = caca_create_display(cv->get_caca_canvas_t()); 30 30 if(!dp) 31 31 throw -1; … … 37 37 } 38 38 39 void Caca::Attach(C ucul*cv)39 void Caca::Attach(Canvas *cv) 40 40 { 41 dp = caca_create_display(cv->get_c ucul_canvas_t());41 dp = caca_create_display(cv->get_caca_canvas_t()); 42 42 if(!dp) 43 43 throw -1; -
libcaca/trunk/cxx/caca++.h
r2074 r2821 24 24 #define _CACA_PP_H 25 25 26 #include <cucul.h>27 26 #include <caca.h> 28 27 #include <caca++.h> 29 28 #include <cucul++.h> 30 29 … … 62 61 public: 63 62 Caca(); 64 Caca(C ucul*cv);63 Caca(Canvas *cv); 65 64 ~Caca(); 66 65 67 void Attach(C ucul*cv);66 void Attach(Canvas *cv); 68 67 void Detach(); 69 68 void setDisplayTime(unsigned int); -
libcaca/trunk/cxx/cucul++.cpp
r2321 r2821 1 1 /* 2 * libc ucul++ C++ bindings for libcucul2 * libcaca++ C++ bindings for libcaca 3 3 * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> 4 4 * All Rights Reserved … … 14 14 15 15 /* 16 * This file contains the main functions used by \e libc ucul++ applications16 * This file contains the main functions used by \e libcaca++ applications 17 17 * to initialise a drawing context. 18 18 */ … … 23 23 #include <stdarg.h> // va_* 24 24 25 #include "c ucul++.h"25 #include "caca++.h" 26 26 27 27 28 28 uint32_t Charset::utf8ToUtf32(char const *s, size_t *read) 29 29 { 30 return c ucul_utf8_to_utf32(s, read);30 return caca_utf8_to_utf32(s, read); 31 31 } 32 32 size_t Charset::utf32ToUtf8(char *buf, uint32_t ch) 33 33 { 34 return c ucul_utf32_to_utf8(buf, ch);34 return caca_utf32_to_utf8(buf, ch); 35 35 } 36 36 uint8_t Charset::utf32ToCp437(uint32_t ch) 37 37 { 38 return c ucul_utf32_to_cp437(ch);38 return caca_utf32_to_cp437(ch); 39 39 } 40 40 uint32_t Charset::cp437ToUtf32(uint8_t ch) 41 41 { 42 return c ucul_cp437_to_utf32(ch);43 } 44 45 46 C ucul::Cucul()47 { 48 cv = c ucul_create_canvas(0, 0);42 return caca_cp437_to_utf32(ch); 43 } 44 45 46 Canvas::Canvas() 47 { 48 cv = caca_create_canvas(0, 0); 49 49 if(!cv) 50 50 throw -1; 51 51 } 52 52 53 C ucul::Cucul(int width, int height)54 { 55 cv = c ucul_create_canvas(width, height);53 Canvas::Canvas(int width, int height) 54 { 55 cv = caca_create_canvas(width, height); 56 56 if(!cv) throw -1; 57 57 } 58 58 59 C ucul::~Cucul()59 Canvas::~Canvas() 60 60 { 61 61 if(cv) 62 c ucul_free_canvas(cv);63 } 64 65 c ucul_canvas_t *Cucul::get_cucul_canvas_t()62 caca_free_canvas(cv); 63 } 64 65 caca_canvas_t *Canvas::get_caca_canvas_t() 66 66 { 67 67 return cv; 68 68 } 69 69 70 void C ucul::setSize(unsigned int width, unsigned int height)71 { 72 c ucul_set_canvas_size(cv, width, height);73 } 74 75 unsigned int C ucul::getWidth(void)76 { 77 return c ucul_get_canvas_width(cv);78 } 79 80 unsigned int C ucul::getHeight(void)81 { 82 return c ucul_get_canvas_height(cv);83 } 84 85 int C ucul::setColorANSI(uint8_t f, uint8_t b)86 { 87 return c ucul_set_color_ansi(cv, f, b);88 } 89 90 int C ucul::setColorARGB(unsigned int f, unsigned int b)91 { 92 return c ucul_set_color_argb(cv, f, b);93 } 94 95 void C ucul::putChar(int x, int y, uint32_t ch)96 { 97 c ucul_put_char(cv, x, y, ch);98 } 99 100 uint32_t C ucul::getChar(int x, int y)101 { 102 return c ucul_get_char(cv, x, y);103 } 104 105 void C ucul::putStr(int x, int y, char *str)106 { 107 c ucul_put_str(cv, x, y, str);108 } 109 110 void C ucul::Printf(int x, int y, char const * format, ...)70 void Canvas::setSize(unsigned int width, unsigned int height) 71 { 72 caca_set_canvas_size(cv, width, height); 73 } 74 75 unsigned int Canvas::getWidth(void) 76 { 77 return caca_get_canvas_width(cv); 78 } 79 80 unsigned int Canvas::getHeight(void) 81 { 82 return caca_get_canvas_height(cv); 83 } 84 85 int Canvas::setColorANSI(uint8_t f, uint8_t b) 86 { 87 return caca_set_color_ansi(cv, f, b); 88 } 89 90 int Canvas::setColorARGB(unsigned int f, unsigned int b) 91 { 92 return caca_set_color_argb(cv, f, b); 93 } 94 95 void Canvas::putChar(int x, int y, uint32_t ch) 96 { 97 caca_put_char(cv, x, y, ch); 98 } 99 100 uint32_t Canvas::getChar(int x, int y) 101 { 102 return caca_get_char(cv, x, y); 103 } 104 105 void Canvas::putStr(int x, int y, char *str) 106 { 107 caca_put_str(cv, x, y, str); 108 } 109 110 void Canvas::Printf(int x, int y, char const * format, ...) 111 111 { 112 112 char tmp[BUFSIZ]; … … 126 126 } 127 127 128 void C ucul::Clear(void)129 { 130 c ucul_clear_canvas(cv);131 } 132 133 void C ucul::Blit(int x, int y, Cucul* c1, Cucul* c2)134 { 135 c ucul_blit(cv, x, y, c1->get_cucul_canvas_t(),136 c2 ? c2->get_c ucul_canvas_t() : NULL);137 } 138 139 void C ucul::Invert()140 { 141 c ucul_invert(cv);142 } 143 144 void C ucul::Flip()145 { 146 c ucul_flip(cv);147 } 148 149 void C ucul::Flop()150 { 151 c ucul_flop(cv);152 } 153 154 void C ucul::Rotate180()155 { 156 c ucul_rotate_180(cv);157 } 158 159 void C ucul::RotateLeft()160 { 161 c ucul_rotate_left(cv);162 } 163 164 void C ucul::RotateRight()165 { 166 c ucul_rotate_right(cv);167 } 168 169 void C ucul::drawLine(int x1, int y1, int x2, int y2, uint32_t ch)170 { 171 c ucul_draw_line(cv, x1, y1, x2, y2, ch);172 } 173 174 void C ucul::drawPolyline(int const x[], int const y[], int f, uint32_t ch)175 { 176 c ucul_draw_polyline(cv, x, y, f, ch);177 } 178 179 void C ucul::drawThinLine(int x1, int y1, int x2, int y2)180 { 181 c ucul_draw_thin_line(cv, x1, y1, x2, y2);182 } 183 184 void C ucul::drawThinPolyline(int const x[], int const y[], int f)185 { 186 c ucul_draw_thin_polyline(cv, x, y, f);187 } 188 189 void C ucul::drawCircle(int x, int y, int d, uint32_t ch)190 { 191 c ucul_draw_circle(cv, x, y, d, ch);192 } 193 194 void C ucul::drawEllipse(int x, int y, int d1, int d2, uint32_t ch)195 { 196 c ucul_draw_ellipse(cv, x, y, d1, d2, ch);197 } 198 199 void C ucul::drawThinEllipse(int x, int y, int d1, int d2)200 { 201 c ucul_draw_thin_ellipse(cv, x, y, d1, d2);202 } 203 204 void C ucul::fillEllipse(int x, int y, int d1, int d2, uint32_t ch)205 { 206 c ucul_fill_ellipse(cv, x, y, d1, d2, ch);207 } 208 209 void C ucul::drawBox(int x, int y, int w, int h, uint32_t ch)210 { 211 c ucul_draw_box(cv, x, y, w, h, ch);212 } 213 214 void C ucul::drawThinBox(int x, int y, int w, int h)215 { 216 c ucul_draw_thin_box(cv, x, y, w, h);217 } 218 219 void C ucul::drawCP437Box(int x, int y, int w, int h)220 { 221 c ucul_draw_cp437_box(cv, x, y, w, h);222 } 223 224 void C ucul::fillBox(int x, int y, int w, int h, uint32_t ch)225 { 226 c ucul_fill_box(cv, x, y, w, h, ch);227 } 228 229 void C ucul::drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch)230 { 231 c ucul_draw_triangle(cv, x1, y1, x2, y2, x3, y3, ch);232 } 233 234 void C ucul::drawThinTriangle(int x1, int y1, int x2, int y2, int x3, int y3)235 { 236 c ucul_draw_thin_triangle(cv, x1, y1, x2, y2, x3, y3);237 } 238 239 void C ucul::fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch)240 { 241 c ucul_fill_triangle(cv, x1, y1, x2, y2, x3, y3, ch);242 } 243 244 int C ucul::Rand(int min, int max)245 { 246 return c ucul_rand(min, max);247 } 248 249 const char * C ucul::getVersion()250 { 251 return c ucul_get_version();252 } 253 254 int C ucul::setAttr(uint32_t attr)255 { 256 return c ucul_set_attr(cv, attr);257 } 258 259 uint32_t C ucul::getAttr(int x, int y)260 { 261 return c ucul_get_attr(cv, x, y);262 } 263 264 int C ucul::setBoundaries(cucul_canvas_t *, int x, int y,128 void Canvas::Clear(void) 129 { 130 caca_clear_canvas(cv); 131 } 132 133 void Canvas::Blit(int x, int y, Canvas* c1, Canvas* c2) 134 { 135 caca_blit(cv, x, y, c1->get_caca_canvas_t(), 136 c2 ? c2->get_caca_canvas_t() : NULL); 137 } 138 139 void Canvas::Invert() 140 { 141 caca_invert(cv); 142 } 143 144 void Canvas::Flip() 145 { 146 caca_flip(cv); 147 } 148 149 void Canvas::Flop() 150 { 151 caca_flop(cv); 152 } 153 154 void Canvas::Rotate180() 155 { 156 caca_rotate_180(cv); 157 } 158 159 void Canvas::RotateLeft() 160 { 161 caca_rotate_left(cv); 162 } 163 164 void Canvas::RotateRight() 165 { 166 caca_rotate_right(cv); 167 } 168 169 void Canvas::drawLine(int x1, int y1, int x2, int y2, uint32_t ch) 170 { 171 caca_draw_line(cv, x1, y1, x2, y2, ch); 172 } 173 174 void Canvas::drawPolyline(int const x[], int const y[], int f, uint32_t ch) 175 { 176 caca_draw_polyline(cv, x, y, f, ch); 177 } 178 179 void Canvas::drawThinLine(int x1, int y1, int x2, int y2) 180 { 181 caca_draw_thin_line(cv, x1, y1, x2, y2); 182 } 183 184 void Canvas::drawThinPolyline(int const x[], int const y[], int f) 185 { 186 caca_draw_thin_polyline(cv, x, y, f); 187 } 188 189 void Canvas::drawCircle(int x, int y, int d, uint32_t ch) 190 { 191 caca_draw_circle(cv, x, y, d, ch); 192 } 193 194 void Canvas::drawEllipse(int x, int y, int d1, int d2, uint32_t ch) 195 { 196 caca_draw_ellipse(cv, x, y, d1, d2, ch); 197 } 198 199 void Canvas::drawThinEllipse(int x, int y, int d1, int d2) 200 { 201 caca_draw_thin_ellipse(cv, x, y, d1, d2); 202 } 203 204 void Canvas::fillEllipse(int x, int y, int d1, int d2, uint32_t ch) 205 { 206 caca_fill_ellipse(cv, x, y, d1, d2, ch); 207 } 208 209 void Canvas::drawBox(int x, int y, int w, int h, uint32_t ch) 210 { 211 caca_draw_box(cv, x, y, w, h, ch); 212 } 213 214 void Canvas::drawThinBox(int x, int y, int w, int h) 215 { 216 caca_draw_thin_box(cv, x, y, w, h); 217 } 218 219 void Canvas::drawCP437Box(int x, int y, int w, int h) 220 { 221 caca_draw_cp437_box(cv, x, y, w, h); 222 } 223 224 void Canvas::fillBox(int x, int y, int w, int h, uint32_t ch) 225 { 226 caca_fill_box(cv, x, y, w, h, ch); 227 } 228 229 void Canvas::drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch) 230 { 231 caca_draw_triangle(cv, x1, y1, x2, y2, x3, y3, ch); 232 } 233 234 void Canvas::drawThinTriangle(int x1, int y1, int x2, int y2, int x3, int y3) 235 { 236 caca_draw_thin_triangle(cv, x1, y1, x2, y2, x3, y3); 237 } 238 239 void Canvas::fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch) 240 { 241 caca_fill_triangle(cv, x1, y1, x2, y2, x3, y3, ch); 242 } 243 244 int Canvas::Rand(int min, int max) 245 { 246 return caca_rand(min, max); 247 } 248 249 const char * Canvas::getVersion() 250 { 251 return caca_get_version(); 252 } 253 254 int Canvas::setAttr(uint32_t attr) 255 { 256 return caca_set_attr(cv, attr); 257 } 258 259 uint32_t Canvas::getAttr(int x, int y) 260 { 261 return caca_get_attr(cv, x, y); 262 } 263 264 int Canvas::setBoundaries(caca_canvas_t *, int x, int y, 265 265 unsigned int w, unsigned int h) 266 266 { 267 return c ucul_set_canvas_boundaries(cv, x, y, h, w);268 } 269 270 unsigned int C ucul::getFrameCount()271 { 272 return c ucul_get_frame_count(cv);273 } 274 int C ucul::setFrame(unsigned int f)275 { 276 return c ucul_set_frame(cv, f);277 } 278 int C ucul::createFrame(unsigned int f)279 { 280 return c ucul_create_frame(cv, f);281 } 282 int C ucul::freeFrame(unsigned int f)283 { 284 return c ucul_create_frame(cv, f);285 } 286 287 char const *const * C ucul::getImportList(void)288 { 289 return c ucul_get_import_list();290 } 291 292 long int C ucul::importMemory(void const *buf, size_t len, char const *fmt)293 { 294 return c ucul_import_memory(cv, buf, len, fmt);295 } 296 297 long int C ucul::importFile(char const *file, char const *fmt)298 { 299 return c ucul_import_file(cv, file, fmt);300 } 301 302 char const *const * C ucul::getExportList(void)303 { 304 return c ucul_get_export_list();305 } 306 307 void *C ucul::exportMemory(char const *fmt, size_t *len)308 { 309 return c ucul_export_memory(cv, fmt, len);267 return caca_set_canvas_boundaries(cv, x, y, h, w); 268 } 269 270 unsigned int Canvas::getFrameCount() 271 { 272 return caca_get_frame_count(cv); 273 } 274 int Canvas::setFrame(unsigned int f) 275 { 276 return caca_set_frame(cv, f); 277 } 278 int Canvas::createFrame(unsigned int f) 279 { 280 return caca_create_frame(cv, f); 281 } 282 int Canvas::freeFrame(unsigned int f) 283 { 284 return caca_create_frame(cv, f); 285 } 286 287 char const *const * Canvas::getImportList(void) 288 { 289 return caca_get_import_list(); 290 } 291 292 long int Canvas::importMemory(void const *buf, size_t len, char const *fmt) 293 { 294 return caca_import_memory(cv, buf, len, fmt); 295 } 296 297 long int Canvas::importFile(char const *file, char const *fmt) 298 { 299 return caca_import_file(cv, file, fmt); 300 } 301 302 char const *const * Canvas::getExportList(void) 303 { 304 return caca_get_export_list(); 305 } 306 307 void *Canvas::exportMemory(char const *fmt, size_t *len) 308 { 309 return caca_export_memory(cv, fmt, len); 310 310 } 311 311 312 312 Dither::Dither(unsigned int v1, unsigned int v2, unsigned int v3, unsigned int v4, unsigned int v5, unsigned int v6, unsigned int v7, unsigned int v8) 313 313 { 314 dither = c ucul_create_dither(v1, v2, v3, v4, v5, v6, v7, v8);314 dither = caca_create_dither(v1, v2, v3, v4, v5, v6, v7, v8); 315 315 } 316 316 Dither::~Dither() 317 317 { 318 c ucul_free_dither(dither);318 caca_free_dither(dither); 319 319 } 320 320 321 321 void Dither::setPalette(uint32_t r[], uint32_t g[], uint32_t b[], uint32_t a[]) 322 322 { 323 c ucul_set_dither_palette(dither, r, g, b, a);323 caca_set_dither_palette(dither, r, g, b, a); 324 324 } 325 325 326 326 void Dither::setBrightness(float f) 327 327 { 328 c ucul_set_dither_brightness(dither, f);328 caca_set_dither_brightness(dither, f); 329 329 } 330 330 331 331 void Dither::setGamma(float f) 332 332 { 333 c ucul_set_dither_gamma(dither, f);333 caca_set_dither_gamma(dither, f); 334 334 } 335 335 336 336 void Dither::setContrast(float f) 337 337 { 338 c ucul_set_dither_contrast(dither, f);338 caca_set_dither_contrast(dither, f); 339 339 } 340 340 341 341 void Dither::setAntialias(char const *cv) 342 342 { 343 c ucul_set_dither_antialias(dither, cv);343 caca_set_dither_antialias(dither, cv); 344 344 } 345 345 346 346 char const *const * Dither::getAntialiasList() 347 347 { 348 return c ucul_get_dither_antialias_list(dither);348 return caca_get_dither_antialias_list(dither); 349 349 } 350 350 351 351 void Dither::setColor(char const *cv) 352 352 { 353 c ucul_set_dither_color(dither, cv);353 caca_set_dither_color(dither, cv); 354 354 } 355 355 356 356 char const *const * Dither::getColorList() 357 357 { 358 return c ucul_get_dither_color_list(dither);358 return caca_get_dither_color_list(dither); 359 359 } 360 360 361 361 void Dither::setCharset(char const *cv) 362 362 { 363 c ucul_set_dither_charset(dither, cv);363 caca_set_dither_charset(dither, cv); 364 364 } 365 365 366 366 char const *const * Dither::getCharsetList() 367 367 { 368 return c ucul_get_dither_charset_list(dither);368 return caca_get_dither_charset_list(dither); 369 369 } 370 370 371 371 void Dither::setMode(char const *cv) 372 372 { 373 c ucul_set_dither_algorithm(dither, cv);373 caca_set_dither_algorithm(dither, cv); 374 374 } 375 375 376 376 char const *const * Dither::getModeList(void) 377 377 { 378 return c ucul_get_dither_algorithm_list(dither);379 } 380 381 void Dither::Bitmap(C ucul*cv, int x, int y, int w, int h, void *v)382 { 383 c ucul_dither_bitmap(cv->get_cucul_canvas_t(), x, y, w, h, dither, v);378 return caca_get_dither_algorithm_list(dither); 379 } 380 381 void Dither::Bitmap(Canvas *cv, int x, int y, int w, int h, void *v) 382 { 383 caca_dither_bitmap(cv->get_caca_canvas_t(), x, y, w, h, dither, v); 384 384 } 385 385 386 386 Font::Font(void const *s, unsigned int v) 387 387 { 388 font = c ucul_load_font(s, v);388 font = caca_load_font(s, v); 389 389 if(!font) throw -1; 390 390 } … … 392 392 char const *const * Font::getList(void) 393 393 { 394 return c ucul_get_font_list();394 return caca_get_font_list(); 395 395 } 396 396 397 397 unsigned int Font::getWidth() 398 398 { 399 return c ucul_get_font_width(font);399 return caca_get_font_width(font); 400 400 } 401 401 402 402 unsigned int Font::getHeight() 403 403 { 404 return c ucul_get_font_height(font);405 } 406 407 void Font::renderCanvas(C ucul*cv, uint8_t *buf, unsigned int x, unsigned int y, unsigned int w)408 { 409 c ucul_render_canvas(cv->get_cucul_canvas_t(), font, buf, x, y, w);404 return caca_get_font_height(font); 405 } 406 407 void Font::renderCanvas(Canvas *cv, uint8_t *buf, unsigned int x, unsigned int y, unsigned int w) 408 { 409 caca_render_canvas(cv->get_caca_canvas_t(), font, buf, x, y, w); 410 410 } 411 411 412 412 uint32_t const *Font::getBlocks() 413 413 { 414 return c ucul_get_font_blocks(font);414 return caca_get_font_blocks(font); 415 415 } 416 416 417 417 Font::~Font() 418 418 { 419 c ucul_free_font(font);420 } 421 419 caca_free_font(font); 420 } 421 -
libcaca/trunk/cxx/cucul++.h
r2321 r2821 1 1 /* 2 * libc ucul++ C++ bindings for libcucul2 * libcaca++ C++ bindings for libcaca 3 3 * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> 4 4 * All Rights Reserved … … 13 13 */ 14 14 15 /** \file c ucul++.h15 /** \file caca++.h 16 16 * \version \$Id$ 17 17 * \author Jean-Yves Lamoureux <jylam@lnxscene.org> 18 * \brief The \e libc ucul++ public header.18 * \brief The \e libcaca++ public header. 19 19 * 20 20 * This header contains the public types and functions that applications 21 * using \e libc ucul++ may use.21 * using \e libcaca++ may use. 22 22 */ 23 23 … … 25 25 #define _CUCUL_PP_H 26 26 27 #include <c ucul.h>27 #include <caca.h> 28 28 29 29 #undef __class 30 #if defined(_WIN32) && defined(__LIBC UCUL_PP__)30 #if defined(_WIN32) && defined(__LIBCACA_PP__) 31 31 # define __class class __declspec(dllexport) 32 32 #else … … 34 34 #endif 35 35 36 class C ucul;36 class Canvas; 37 37 38 38 __class Charset … … 54 54 unsigned int getWidth(); 55 55 unsigned int getHeight(); 56 void renderCanvas(C ucul*, uint8_t *, unsigned int,56 void renderCanvas(Canvas *, uint8_t *, unsigned int, 57 57 unsigned int, unsigned int); 58 58 uint32_t const *getBlocks(); 59 59 60 60 private: 61 c ucul_font *font;61 caca_font *font; 62 62 }; 63 63 … … 82 82 void setMode(char const *); 83 83 char const *const * getModeList(); 84 void Bitmap(C ucul*, int, int, int, int, void *);84 void Bitmap(Canvas *, int, int, int, int, void *); 85 85 86 86 private: 87 c ucul_dither *dither;87 caca_dither *dither; 88 88 }; 89 89 90 __class C ucul90 __class Canvas 91 91 { 92 92 friend class Caca; … … 94 94 friend class Font; 95 95 public: 96 C ucul();97 C ucul(int width, int height);98 ~C ucul();96 Canvas(); 97 Canvas(int width, int height); 98 ~Canvas(); 99 99 100 100 void setSize(unsigned int w, unsigned int h); … … 110 110 void putStr(int x, int y, char *str); 111 111 void Clear(void); 112 void Blit(int, int, C ucul* c1, Cucul* c2);112 void Blit(int, int, Canvas* c1, Canvas* c2); 113 113 void Invert(); 114 114 void Flip(); … … 132 132 void drawThinTriangle(int, int, int, int, int, int); 133 133 void fillTriangle(int, int, int, int, int, int, uint32_t); 134 int setBoundaries(c ucul_canvas_t *, int, int, unsigned int, unsigned int);134 int setBoundaries(caca_canvas_t *, int, int, unsigned int, unsigned int); 135 135 unsigned int getFrameCount(); 136 136 int setFrame(unsigned int); … … 148 148 149 149 protected: 150 c ucul_canvas_t *get_cucul_canvas_t();150 caca_canvas_t *get_caca_canvas_t(); 151 151 152 152 private: 153 c ucul_canvas_t *cv;153 caca_canvas_t *cv; 154 154 }; 155 155 -
libcaca/trunk/cxx/cxxtest.cpp
r2136 r2821 41 41 int main(int argc, char *argv[]) 42 42 { 43 C ucul*cv, *pig;43 Canvas *cv, *pig; 44 44 Caca *dp; 45 45 … … 47 47 48 48 try { 49 cv = new C ucul();49 cv = new Canvas(); 50 50 } 51 51 catch (int e) { … … 64 64 try { 65 65 // Import buffer into a canvas 66 pig = new C ucul();67 pig->setColorANSI(C UCUL_LIGHTMAGENTA, CUCUL_TRANSPARENT);66 pig = new Canvas(); 67 pig->setColorANSI(CACA_LIGHTMAGENTA, CACA_TRANSPARENT); 68 68 pig->importMemory(pigstring, strlen(pigstring), "text"); 69 69 } … … 90 90 91 91 /* printf works */ 92 cv->setColorANSI(C UCUL_LIGHTBLUE, CUCUL_BLACK);92 cv->setColorANSI(CACA_LIGHTBLUE, CACA_BLACK); 93 93 cv->Printf(cv->getWidth() / 2 - 10, cv->getHeight() / 2, 94 94 "Powered by libcaca %s", dp->getVersion());
Note: See TracChangeset
for help on using the changeset viewer.