Ignore:
Timestamp:
Sep 27, 2008 4:29:11 PM (6 years ago)
Author:
sam
Message:

Continuing the libcucul-libcaca merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/doc/migrating.dox

    r2062 r2824  
    88 \section foo1 Overview 
    99 
    10  The most important changes in the 1.0 API of \e libcaca are the 
    11  \e libcaca / \e libcucul split and the object-oriented design. See these 
    12  two examples for a rough idea of what changed: 
     10 The most important change in the 1.0 API of \e libcaca is the 
     11 object-oriented design. See these two examples for a rough idea of 
     12 what changed: 
    1313 
    1414<table border="0"><tr><td valign="top"> 
     
    4040</td><td> 
    4141\code 
    42 #include <cucul.h> 
    4342#include <caca.h> 
    4443 
     
    4746{ 
    4847    /* Initialise libcaca */ 
    49     cucul_canvas_t *cv; 
     48    caca_canvas_t *cv; 
    5049    caca_display_t *dp; 
    5150    dp = caca_create_display(cv); 
     
    5453    caca_set_display_title(dp, "Window"); 
    5554    /* Choose drawing colours */ 
    56     cucul_set_color_ansi(cv, CUCUL_BLACK, 
    57                              CUCUL_WHITE); 
     55    caca_set_color_ansi(cv, CACA_BLACK, 
     56                            CACA_WHITE); 
    5857    /* Draw a string at (0, 0) */ 
    59     cucul_put_str(cv, 0, 0, "Hello world!"); 
     58    caca_put_str(cv, 0, 0, "Hello world!"); 
    6059    /* Refresh display */ 
    6160    caca_refresh_display(); 
     
    7574 - Functions now take an object handle as their first argument. 
    7675 - All input/output functions start with \b caca_ and all 
    77    drawing and text handling functions start with \b cucul_ . 
     76   drawing and text handling functions start with \b caca_ . 
    7877 
    7978 \section foo2 Migration strategy 
     
    111110 \subsection bar1 Basic functions 
    112111 
    113  - \b caca_init(): use cucul_create_canvas() to create a \e libcucul canvas, 
     112 - \b caca_init(): use caca_create_canvas() to create a \e libcaca canvas, 
    114113   followed by caca_create_display() to attach a \e libcaca display to it. 
    115114 - \b caca_set_delay(): use caca_set_display_time(). 
    116115 - \b caca_get_feature(): deprecated. 
    117  - \b caca_set_feature(): deprecated, see cucul_set_dither_antialias(), 
    118    cucul_set_dither_color() and cucul_set_dither_mode() instead. 
    119  - \b caca_get_feature_name(): deprecated, see cucul_get_dither_mode_list(), 
    120    cucul_get_dither_antialias_list() and cucul_get_dither_color_list() 
     116 - \b caca_set_feature(): deprecated, see caca_set_dither_antialias(), 
     117   caca_set_dither_color() and caca_set_dither_mode() instead. 
     118 - \b caca_get_feature_name(): deprecated, see caca_get_dither_mode_list(), 
     119   caca_get_dither_antialias_list() and caca_get_dither_color_list() 
    121120   instead. 
    122121 - \b caca_get_rendertime(): use caca_get_display_time(). 
    123  - \b caca_get_width(): use cucul_get_canvas_width(). 
    124  - \b caca_get_height(): use cucul_get_canvas_height(). 
     122 - \b caca_get_width(): use caca_get_canvas_width(). 
     123 - \b caca_get_height(): use caca_get_canvas_height(). 
    125124 - \b caca_set_window_title(): use caca_set_display_title(). 
    126125 - \b caca_get_window_width(): use caca_get_display_width(). 
     
    128127 - \b caca_refresh(): use caca_refresh_display(). 
    129128 - \b caca_end(): use caca_free_display() to detach the \e libcaca display, 
    130    followed by cucul_free_canvas() to free the underlying \e libcucul canvas. 
     129   followed by caca_free_canvas() to free the underlying \e libcaca canvas. 
    131130 
    132131 \subsection bar2 Event handling 
     
    141140 \subsection bar3 Character printing 
    142141 
    143  - \b caca_set_color(): use cucul_set_color_ansi() or cucul_set_color_argb(). 
    144  - \b caca_get_fg_color(): use cucul_get_attr(). 
    145  - \b caca_get_bg_color(): use cucul_get_attr(). 
     142 - \b caca_set_color(): use caca_set_color_ansi() or caca_set_color_argb(). 
     143 - \b caca_get_fg_color(): use caca_get_attr(). 
     144 - \b caca_get_bg_color(): use caca_get_attr(). 
    146145 - \b caca_get_color_name(): this function is now deprecated due to major 
    147146   uselessness. 
    148  - \b caca_putchar(): use cucul_put_char(). 
    149  - \b caca_putstr(): use cucul_put_str(). 
    150  - \b caca_printf(): use cucul_printf(). 
    151  - \b caca_clear(): use cucul_clear_canvas(). 
     147 - \b caca_putchar(): use caca_put_char(). 
     148 - \b caca_putstr(): use caca_put_str(). 
     149 - \b caca_printf(): use caca_printf(). 
     150 - \b caca_clear(): use caca_clear_canvas(). 
    152151 
    153152 \subsection bar4 Primitives drawing 
     
    156155 fact that they now act on a given canvas. 
    157156 
    158  - \b caca_draw_line(): use cucul_draw_line(). 
    159  - \b caca_draw_polyline(): use cucul_draw_polyline(). 
    160  - \b caca_draw_thin_line(): use cucul_draw_thin_line(). 
    161  - \b caca_draw_thin_polyline(): use cucul_draw_thin_polyline(). 
    162  
    163  - \b caca_draw_circle(): use cucul_draw_circle(). 
    164  - \b caca_draw_ellipse(): use cucul_draw_ellipse(). 
    165  - \b caca_draw_thin_ellipse(): use cucul_draw_thin_ellipse(). 
    166  - \b caca_fill_ellipse(): use cucul_fill_ellipse(). 
    167  
    168  - \b caca_draw_box(): use cucul_draw_box(). 
    169  - \b caca_draw_thin_box(): use cucul_draw_thin_box() or cucul_draw_cp437_box(). 
    170  - \b caca_fill_box(): use cucul_fill_box(). 
    171  
    172  - \b caca_draw_triangle(): use cucul_draw_triangle(). 
    173  - \b caca_draw_thin_triangle(): use cucul_draw_thin_triangle(). 
    174  - \b caca_fill_triangle(): use cucul_fill_triangle(). 
     157 - \b caca_draw_line(): use caca_draw_line(). 
     158 - \b caca_draw_polyline(): use caca_draw_polyline(). 
     159 - \b caca_draw_thin_line(): use caca_draw_thin_line(). 
     160 - \b caca_draw_thin_polyline(): use caca_draw_thin_polyline(). 
     161 
     162 - \b caca_draw_circle(): use caca_draw_circle(). 
     163 - \b caca_draw_ellipse(): use caca_draw_ellipse(). 
     164 - \b caca_draw_thin_ellipse(): use caca_draw_thin_ellipse(). 
     165 - \b caca_fill_ellipse(): use caca_fill_ellipse(). 
     166 
     167 - \b caca_draw_box(): use caca_draw_box(). 
     168 - \b caca_draw_thin_box(): use caca_draw_thin_box() or caca_draw_cp437_box(). 
     169 - \b caca_fill_box(): use caca_fill_box(). 
     170 
     171 - \b caca_draw_triangle(): use caca_draw_triangle(). 
     172 - \b caca_draw_thin_triangle(): use caca_draw_thin_triangle(). 
     173 - \b caca_fill_triangle(): use caca_fill_triangle(). 
    175174 
    176175 \subsection bar5 Mathematical functions 
    177176 
    178  - \b caca_rand(): use cucul_rand(). The second argument is different, make 
     177 - \b caca_rand(): use caca_rand(). The second argument is different, make 
    179178   sure you take that into account. 
    180179 - \b caca_sqrt(): this function is now deprecated, use your system's 
     
    186185 completely deprecated. 
    187186 
    188  - \b caca_load_sprite(): use cucul_import_file(). 
    189  - \b caca_get_sprite_frames(): use cucul_get_frame_count(). 
    190  - \b caca_get_sprite_width(): use cucul_get_canvas_width(). 
    191  - \b caca_get_sprite_height(): use cucul_get_canvas_height(). 
    192  - \b caca_get_sprite_dx(): use cucul_get_canvas_handle_x(). 
    193  - \b caca_get_sprite_dy(): use cucul_get_canvas_handle_y(). 
    194  - \b caca_draw_sprite(): use cucul_set_frame() and cucul_blit(). 
    195  - \b caca_free_sprite(): use cucul_free_canvas(). 
     187 - \b caca_load_sprite(): use caca_import_file(). 
     188 - \b caca_get_sprite_frames(): use caca_get_frame_count(). 
     189 - \b caca_get_sprite_width(): use caca_get_canvas_width(). 
     190 - \b caca_get_sprite_height(): use caca_get_canvas_height(). 
     191 - \b caca_get_sprite_dx(): use caca_get_canvas_handle_x(). 
     192 - \b caca_get_sprite_dy(): use caca_get_canvas_handle_y(). 
     193 - \b caca_draw_sprite(): use caca_set_frame() and caca_blit(). 
     194 - \b caca_free_sprite(): use caca_free_canvas(). 
    196195 
    197196 \subsection bar7 Bitmap handling 
     
    200199 store any pixels, they just have information on how bitmaps will be dithered. 
    201200 
    202  - \b caca_create_bitmap(): use cucul_create_dither(). 
    203  - \b caca_set_bitmap_palette(): use cucul_set_dither_palette(). 
    204  - \b caca_draw_bitmap(): use cucul_dither_bitmap(). 
    205  - \b caca_free_bitmap(): use cucul_free_dither(). 
     201 - \b caca_create_bitmap(): use caca_create_dither(). 
     202 - \b caca_set_bitmap_palette(): use caca_set_dither_palette(). 
     203 - \b caca_draw_bitmap(): use caca_dither_bitmap(). 
     204 - \b caca_free_bitmap(): use caca_free_dither(). 
    206205 
    207206 \section foo4 Compilation 
Note: See TracChangeset for help on using the changeset viewer.