Ignore:
Timestamp:
Apr 19, 2006, 12:10:58 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • More function mass-renaming: caca_attach -> caca_create_display, etc.
Location:
libcaca/trunk/caca
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.c

    r811 r819  
    4242 *  \return The caca graphical context or NULL if an error occurred.
    4343 */
    44 caca_display_t * caca_attach(cucul_canvas_t * cv)
     44caca_display_t * caca_create_display(cucul_canvas_t * cv)
    4545{
    4646    caca_display_t *dp = malloc(sizeof(caca_display_t));
     
    101101 *  \param dp The libcaca graphical context.
    102102 */
    103 void caca_detach(caca_display_t *dp)
     103void caca_free_display(caca_display_t *dp)
    104104{
    105105    dp->drv.end_graphics(dp);
  • libcaca/trunk/caca/caca.h

    r811 r819  
    204204 *
    205205 *  @{ */
    206 caca_display_t * caca_attach(cucul_canvas_t *);
    207 void caca_detach(caca_display_t *);
     206caca_display_t * caca_create_display(cucul_canvas_t *);
     207void caca_free_display(caca_display_t *);
    208208void caca_set_delay(caca_display_t *, unsigned int);
    209 void caca_display(caca_display_t *);
     209void caca_refresh_display(caca_display_t *);
    210210unsigned int caca_get_rendertime(caca_display_t *);
    211 unsigned int caca_get_window_width(caca_display_t *);
    212 unsigned int caca_get_window_height(caca_display_t *);
    213 int caca_set_window_title(caca_display_t *, char const *);
     211unsigned int caca_get_display_width(caca_display_t *);
     212unsigned int caca_get_display_height(caca_display_t *);
     213int caca_set_display_title(caca_display_t *, char const *);
    214214/*  @} */
    215215
  • libcaca/trunk/caca/caca_internals.h

    r811 r819  
    104104        int (* init_graphics) (caca_display_t *);
    105105        int (* end_graphics) (caca_display_t *);
    106         int (* set_window_title) (caca_display_t *, char const *);
    107         unsigned int (* get_window_width) (caca_display_t *);
    108         unsigned int (* get_window_height) (caca_display_t *);
     106        int (* set_display_title) (caca_display_t *, char const *);
     107        unsigned int (* get_display_width) (caca_display_t *);
     108        unsigned int (* get_display_height) (caca_display_t *);
    109109        void (* display) (caca_display_t *);
    110110        void (* handle_resize) (caca_display_t *);
  • libcaca/trunk/caca/driver_conio.c

    r813 r819  
    7777}
    7878
    79 static int conio_set_window_title(caca_display_t *dp, char const *title)
     79static int conio_set_display_title(caca_display_t *dp, char const *title)
    8080{
    8181    return 0;
    8282}
    8383
    84 static unsigned int conio_get_window_width(caca_display_t *dp)
     84static unsigned int conio_get_display_width(caca_display_t *dp)
    8585{
    8686    /* Fallback to a 6x10 font */
     
    8888}
    8989
    90 static unsigned int conio_get_window_height(caca_display_t *dp)
     90static unsigned int conio_get_display_height(caca_display_t *dp)
    9191{
    9292    /* Fallback to a 6x10 font */
     
    156156    dp->drv.init_graphics = conio_init_graphics;
    157157    dp->drv.end_graphics = conio_end_graphics;
    158     dp->drv.set_window_title = conio_set_window_title;
    159     dp->drv.get_window_width = conio_get_window_width;
    160     dp->drv.get_window_height = conio_get_window_height;
     158    dp->drv.set_display_title = conio_set_display_title;
     159    dp->drv.get_display_width = conio_get_display_width;
     160    dp->drv.get_display_height = conio_get_display_height;
    161161    dp->drv.display = conio_display;
    162162    dp->drv.handle_resize = conio_handle_resize;
  • libcaca/trunk/caca/driver_gl.c

    r813 r819  
    203203}
    204204
    205 static int gl_set_window_title(caca_display_t *dp, char const *title)
     205static int gl_set_display_title(caca_display_t *dp, char const *title)
    206206{
    207207    glutSetWindowTitle(title);
     
    209209}
    210210
    211 static unsigned int gl_get_window_width(caca_display_t *dp)
     211static unsigned int gl_get_display_width(caca_display_t *dp)
    212212{
    213213    return dp->drv.p->width;
    214214}
    215215
    216 static unsigned int gl_get_window_height(caca_display_t *dp)
     216static unsigned int gl_get_display_height(caca_display_t *dp)
    217217{
    218218    return dp->drv.p->height;
     
    502502    dp->drv.init_graphics = gl_init_graphics;
    503503    dp->drv.end_graphics = gl_end_graphics;
    504     dp->drv.set_window_title = gl_set_window_title;
    505     dp->drv.get_window_width = gl_get_window_width;
    506     dp->drv.get_window_height = gl_get_window_height;
     504    dp->drv.set_display_title = gl_set_display_title;
     505    dp->drv.get_display_width = gl_get_display_width;
     506    dp->drv.get_display_height = gl_get_display_height;
    507507    dp->drv.display = gl_display;
    508508    dp->drv.handle_resize = gl_handle_resize;
  • libcaca/trunk/caca/driver_ncurses.c

    r813 r819  
    169169}
    170170
    171 static int ncurses_set_window_title(caca_display_t *dp, char const *title)
     171static int ncurses_set_display_title(caca_display_t *dp, char const *title)
    172172{
    173173    return 0;
    174174}
    175175
    176 static unsigned int ncurses_get_window_width(caca_display_t *dp)
     176static unsigned int ncurses_get_display_width(caca_display_t *dp)
    177177{
    178178    /* Fallback to a 6x10 font */
     
    180180}
    181181
    182 static unsigned int ncurses_get_window_height(caca_display_t *dp)
     182static unsigned int ncurses_get_display_height(caca_display_t *dp)
    183183{
    184184    /* Fallback to a 6x10 font */
     
    535535    dp->drv.init_graphics = ncurses_init_graphics;
    536536    dp->drv.end_graphics = ncurses_end_graphics;
    537     dp->drv.set_window_title = ncurses_set_window_title;
    538     dp->drv.get_window_width = ncurses_get_window_width;
    539     dp->drv.get_window_height = ncurses_get_window_height;
     537    dp->drv.set_display_title = ncurses_set_display_title;
     538    dp->drv.get_display_width = ncurses_get_display_width;
     539    dp->drv.get_display_height = ncurses_get_display_height;
    540540    dp->drv.display = ncurses_display;
    541541    dp->drv.handle_resize = ncurses_handle_resize;
  • libcaca/trunk/caca/driver_raw.c

    r818 r819  
    3737}
    3838
    39 static int raw_set_window_title(caca_display_t *dp, char const *title)
     39static int raw_set_display_title(caca_display_t *dp, char const *title)
    4040{
    4141    return 0;
    4242}
    4343
    44 static unsigned int raw_get_window_width(caca_display_t *dp)
     44static unsigned int raw_get_display_width(caca_display_t *dp)
    4545{
    4646    return 0;
    4747}
    4848
    49 static unsigned int raw_get_window_height(caca_display_t *dp)
     49static unsigned int raw_get_display_height(caca_display_t *dp)
    5050{
    5151    return 0;
     
    8484    dp->drv.init_graphics = raw_init_graphics;
    8585    dp->drv.end_graphics = raw_end_graphics;
    86     dp->drv.set_window_title = raw_set_window_title;
    87     dp->drv.get_window_width = raw_get_window_width;
    88     dp->drv.get_window_height = raw_get_window_height;
     86    dp->drv.set_display_title = raw_set_display_title;
     87    dp->drv.get_display_width = raw_get_display_width;
     88    dp->drv.get_display_height = raw_get_display_height;
    8989    dp->drv.display = raw_display;
    9090    dp->drv.handle_resize = raw_handle_resize;
  • libcaca/trunk/caca/driver_slang.c

    r813 r819  
    180180}
    181181
    182 static int slang_set_window_title(caca_display_t *dp, char const *title)
     182static int slang_set_display_title(caca_display_t *dp, char const *title)
    183183{
    184184    /* FIXME */
     
    186186}
    187187
    188 static unsigned int slang_get_window_width(caca_display_t *dp)
     188static unsigned int slang_get_display_width(caca_display_t *dp)
    189189{
    190190    /* Fallback to a 6x10 font */
     
    192192}
    193193
    194 static unsigned int slang_get_window_height(caca_display_t *dp)
     194static unsigned int slang_get_display_height(caca_display_t *dp)
    195195{
    196196    /* Fallback to a 6x10 font */
     
    473473    dp->drv.init_graphics = slang_init_graphics;
    474474    dp->drv.end_graphics = slang_end_graphics;
    475     dp->drv.set_window_title = slang_set_window_title;
    476     dp->drv.get_window_width = slang_get_window_width;
    477     dp->drv.get_window_height = slang_get_window_height;
     475    dp->drv.set_display_title = slang_set_display_title;
     476    dp->drv.get_display_width = slang_get_display_width;
     477    dp->drv.get_display_height = slang_get_display_height;
    478478    dp->drv.display = slang_display;
    479479    dp->drv.handle_resize = slang_handle_resize;
  • libcaca/trunk/caca/driver_vga.c

    r813 r819  
    9494}
    9595
    96 static int vga_set_window_title(caca_display_t *dp, char const *title)
     96static int vga_set_display_title(caca_display_t *dp, char const *title)
    9797{
    9898    /* Unsupported, of course. */
     
    100100}
    101101
    102 static unsigned int vga_get_window_width(caca_display_t *dp)
     102static unsigned int vga_get_display_width(caca_display_t *dp)
    103103{
    104104    /* Fallback to a 320x200 screen */
     
    106106}
    107107
    108 static unsigned int vga_get_window_height(caca_display_t *dp)
     108static unsigned int vga_get_display_height(caca_display_t *dp)
    109109{
    110110    /* Fallback to a 320x200 screen */
     
    150150    dp->drv.init_graphics = vga_init_graphics;
    151151    dp->drv.end_graphics = vga_end_graphics;
    152     dp->drv.set_window_title = vga_set_window_title;
    153     dp->drv.get_window_width = vga_get_window_width;
    154     dp->drv.get_window_height = vga_get_window_height;
     152    dp->drv.set_display_title = vga_set_display_title;
     153    dp->drv.get_display_width = vga_get_display_width;
     154    dp->drv.get_display_height = vga_get_display_height;
    155155    dp->drv.display = vga_display;
    156156    dp->drv.handle_resize = vga_handle_resize;
  • libcaca/trunk/caca/driver_win32.c

    r813 r819  
    163163}
    164164
    165 static int win32_set_window_title(caca_display_t *dp, char const *title)
     165static int win32_set_display_title(caca_display_t *dp, char const *title)
    166166{
    167167    SetConsoleTitle(title);
     
    169169}
    170170
    171 static unsigned int win32_get_window_width(caca_display_t *dp)
     171static unsigned int win32_get_display_width(caca_display_t *dp)
    172172{
    173173    /* FIXME */
     
    177177}
    178178
    179 static unsigned int win32_get_window_height(caca_display_t *dp)
     179static unsigned int win32_get_display_height(caca_display_t *dp)
    180180{
    181181    /* FIXME */
     
    338338    dp->drv.init_graphics = win32_init_graphics;
    339339    dp->drv.end_graphics = win32_end_graphics;
    340     dp->drv.set_window_title = win32_set_window_title;
    341     dp->drv.get_window_width = win32_get_window_width;
    342     dp->drv.get_window_height = win32_get_window_height;
     340    dp->drv.set_display_title = win32_set_display_title;
     341    dp->drv.get_display_width = win32_get_display_width;
     342    dp->drv.get_display_height = win32_get_display_height;
    343343    dp->drv.display = win32_display;
    344344    dp->drv.handle_resize = win32_handle_resize;
  • libcaca/trunk/caca/driver_x11.c

    r813 r819  
    221221}
    222222
    223 static int x11_set_window_title(caca_display_t *dp, char const *title)
     223static int x11_set_display_title(caca_display_t *dp, char const *title)
    224224{
    225225    XStoreName(dp->drv.p->dpy, dp->drv.p->window, title);
     
    227227}
    228228
    229 static unsigned int x11_get_window_width(caca_display_t *dp)
     229static unsigned int x11_get_display_width(caca_display_t *dp)
    230230{
    231231    return dp->cv->width * dp->drv.p->font_width;
    232232}
    233233
    234 static unsigned int x11_get_window_height(caca_display_t *dp)
     234static unsigned int x11_get_display_height(caca_display_t *dp)
    235235{
    236236    return dp->cv->height * dp->drv.p->font_height;
     
    593593    dp->drv.init_graphics = x11_init_graphics;
    594594    dp->drv.end_graphics = x11_end_graphics;
    595     dp->drv.set_window_title = x11_set_window_title;
    596     dp->drv.get_window_width = x11_get_window_width;
    597     dp->drv.get_window_height = x11_get_window_height;
     595    dp->drv.set_display_title = x11_set_display_title;
     596    dp->drv.get_display_width = x11_get_display_width;
     597    dp->drv.get_display_height = x11_get_display_height;
    598598    dp->drv.display = x11_display;
    599599    dp->drv.handle_resize = x11_handle_resize;
  • libcaca/trunk/caca/graphics.c

    r813 r819  
    2323#include "cucul_internals.h"
    2424
    25 /** \brief Set the window title.
     25/** \brief Set the display title.
    2626 *
    2727 *  If libcaca runs in a window, try to change its title. This works with
     
    2929 *
    3030 *  \param dp The libcaca graphical context.
    31  *  \param title The desired window title.
     31 *  \param title The desired display title.
    3232 *  \return 0 upon success, a non-zero value if an error occurs.
    3333 */
    34 int caca_set_window_title(caca_display_t *dp, char const *title)
     34int caca_set_display_title(caca_display_t *dp, char const *title)
    3535{
    36     return dp->drv.set_window_title(dp, title);
     36    return dp->drv.set_display_title(dp, title);
    3737}
    3838
    39 /** \brief Get the window width.
     39/** \brief Get the display width.
    4040 *
    4141 *  If libcaca runs in a window, get the usable window width. This value can
     
    4545 *
    4646 *  \param dp The libcaca graphical context.
    47  *  \return The window width.
     47 *  \return The display width.
    4848 */
    49 unsigned int caca_get_window_width(caca_display_t *dp)
     49unsigned int caca_get_display_width(caca_display_t *dp)
    5050{
    51     return dp->drv.get_window_width(dp);
     51    return dp->drv.get_display_width(dp);
    5252}
    5353
    54 /** \brief Get the window height.
     54/** \brief Get the display height.
    5555 *
    5656 *  If libcaca runs in a window, get the usable window height. This value can
     
    6060 *
    6161 *  \param dp The libcaca graphical context.
    62  *  \return The window height.
     62 *  \return The display height.
    6363 */
    64 unsigned int caca_get_window_height(caca_display_t *dp)
     64unsigned int caca_get_display_height(caca_display_t *dp)
    6565{
    66     return dp->drv.get_window_height(dp);
     66    return dp->drv.get_display_height(dp);
    6767}
    6868
     
    7070 *
    7171 *  This function sets the refresh delay in microseconds. The refresh delay
    72  *  is used by caca_display() to achieve constant framerate. See the
    73  *  caca_display() documentation for more details.
     72 *  is used by caca_refresh_display() to achieve constant framerate. See the
     73 *  caca_refresh_display() documentation for more details.
    7474 *
    7575 *  If the argument is zero, constant framerate is disabled. This is the
     
    8787 *
    8888 *  This function returns the average rendering time, which is the average
    89  *  measured time between two caca_display() calls, in microseconds. If
     89 *  measured time between two caca_refresh_display() calls, in microseconds. If
    9090 *  constant framerate was activated by calling caca_set_delay(), the average
    9191 *  rendering time will not be considerably shorter than the requested delay
     
    103103 *
    104104 *  This function flushes all graphical operations and prints them to the
    105  *  screen. Nothing will show on the screen until caca_display() is
     105 *  screen. Nothing will show on the screen until caca_refresh_display() is
    106106 *  called.
    107107 *
    108  *  If caca_set_delay() was called with a non-zero value, caca_display()
    109  *  will use that value to achieve constant framerate: if two consecutive
    110  *  calls to caca_display() are within a time range shorter than the value
    111  *  set with caca_set_delay(), the second call will wait a bit before
    112  *  performing the screen refresh.
     108 *  If caca_set_delay() was called with a non-zero value,
     109 *  caca_refresh_display() will use that value to achieve constant
     110 *  framerate: if two consecutive calls to caca_refresh_display() are
     111 *  within a time range shorter than the value set with caca_set_delay(),
     112 *  the second call will be delayed before performing the screen refresh.
    113113 *
    114114 *  \param dp The libcaca graphical context.
    115115 */
    116 void caca_display(caca_display_t *dp)
     116void caca_refresh_display(caca_display_t *dp)
    117117{
    118118#if !defined(_DOXYGEN_SKIP_ME)
Note: See TracChangeset for help on using the changeset viewer.