Changeset 819 for libcaca


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
Files:
34 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)
  • libcaca/trunk/cpp/caca++.cpp

    r811 r819  
    2828Caca::Caca(Cucul *cv)
    2929{
    30     dp = caca_attach(cv->get_cucul_canvas_t());
     30    dp = caca_create_display(cv->get_cucul_canvas_t());
    3131    if(!dp) throw -1;
    3232}
    3333Caca::~Caca()
    3434{
    35     caca_detach(dp);
     35    caca_free_display(dp);
    3636}
    3737void Caca::attach(Cucul *cv)
    3838{
    39     dp = caca_attach(cv->get_cucul_canvas_t());
     39    dp = caca_create_display(cv->get_cucul_canvas_t());
    4040    if(!dp) throw -1;
    4141}
    4242void    Caca::detach ()
    4343{
    44     caca_detach(dp);
     44    caca_free_display(dp);
    4545}
    4646void    Caca::set_delay (unsigned int d)
     
    5050void    Caca::display ()
    5151{
    52     caca_display(dp);
     52    caca_refresh_display(dp);
    5353}
    5454unsigned int    Caca::get_rendertime ()
     
    5656    return caca_get_rendertime(dp);
    5757}
    58 unsigned int    Caca::get_window_width ()
     58unsigned int    Caca::get_display_width ()
    5959{
    60     return caca_get_window_width(dp);
     60    return caca_get_display_width(dp);
    6161}
    62 unsigned int    Caca::get_window_height ()
     62unsigned int    Caca::get_display_height ()
    6363{
    64     return caca_get_window_height(dp);
     64    return caca_get_display_height(dp);
    6565}
    66 int     Caca::set_window_title (char const *s)
     66int     Caca::set_display_title (char const *s)
    6767{
    68     return caca_set_window_title(dp, s);
     68    return caca_set_display_title(dp, s);
    6969}
    7070int     Caca::get_event (unsigned int g, Event *n, int aa)
  • libcaca/trunk/cpp/caca++.h

    r811 r819  
    6262    void        display ();
    6363    unsigned int        get_rendertime ();
    64     unsigned int        get_window_width ();
    65     unsigned int        get_window_height ();
    66     int         set_window_title (char const *);
     64    unsigned int        get_display_width ();
     65    unsigned int        get_display_height ();
     66    int         set_display_title (char const *);
    6767    int         get_event (unsigned int, Event*, int);
    6868    unsigned int        get_mouse_x ();
  • libcaca/trunk/cucul/cucul.c

    r818 r819  
    137137 *
    138138 *  It is an error to try to resize the canvas if an output driver has
    139  *  been attached to the canvas using caca_attach(). You need to remove
    140  *  the output driver using caca_detach() before you can change the
    141  *  canvas size again. However, the caca output driver can cause a canvas
    142  *  resize through user interaction. See the caca_event() documentation
     139 *  been attached to the canvas using caca_create_display(). You need to
     140 *  remove the output driver using caca_free_display() before you can change
     141 *  the  canvas size again. However, the caca output driver can cause a
     142 *  canvas resize through user interaction. See the caca_event() documentation
    143143 *  for more about this.
    144144 *
  • libcaca/trunk/python/pypycaca.c

    r769 r819  
    2323    {"set_width", pycaca_set_width, METH_VARARGS, "Set width"},
    2424    {"set_height", pycaca_set_height, METH_VARARGS, "Set height"},
    25     {"set_window_title", pycaca_set_window_title, METH_VARARGS, "Set window titl"},
    26     {"get_window_width", pycaca_get_window_width, METH_NOARGS, "Get window width"},
    27     {"get_window_height", pycaca_get_window_height, METH_NOARGS, "Get Window height"},
     25    {"set_display_title", pycaca_set_display_title, METH_VARARGS, "Set window titl"},
     26    {"get_display_width", pycaca_get_display_width, METH_NOARGS, "Get window width"},
     27    {"get_display_height", pycaca_get_display_height, METH_NOARGS, "Get Window height"},
    2828    {"refresh", pycaca_refresh, METH_NOARGS, "Refresh window"},
    2929    {"end", pycaca_end, METH_NOARGS, "End libcaca"},
     
    256256
    257257static PyObject *
    258 pycaca_set_window_title(PyObject *self, PyObject *args)
     258pycaca_set_display_title(PyObject *self, PyObject *args)
    259259{
    260260  int ret;
    261261  const char *str;
    262262  if (!PyArg_ParseTuple(args, "s", &str));
    263   ret = caca_set_window_title(str);
     263  ret = caca_set_display_title(str);
    264264  return Py_BuildValue("i", ret);  /* FIXME */
    265265}
    266266
    267267static PyObject *
    268 pycaca_get_window_width(PyObject *self, PyObject *args)
    269 {
    270   int ret = caca_get_window_width();
    271   return Py_BuildValue("i", ret);
    272 }
    273 
    274 static PyObject *
    275 pycaca_get_window_height(PyObject *self, PyObject *args)
    276 {
    277   int ret = caca_get_window_height();
     268pycaca_get_display_width(PyObject *self, PyObject *args)
     269{
     270  int ret = caca_get_display_width();
     271  return Py_BuildValue("i", ret);
     272}
     273
     274static PyObject *
     275pycaca_get_display_height(PyObject *self, PyObject *args)
     276{
     277  int ret = caca_get_display_height();
    278278  return Py_BuildValue("i", ret);
    279279}
  • libcaca/trunk/python/pypycaca.h

    r769 r819  
    3939pycaca_set_height(PyObject *self, PyObject *args);
    4040static PyObject *
    41 pycaca_set_window_title(PyObject *self, PyObject *args);
     41pycaca_set_display_title(PyObject *self, PyObject *args);
    4242static PyObject *
    43 pycaca_get_window_width(PyObject *self, PyObject *args);
     43pycaca_get_display_width(PyObject *self, PyObject *args);
    4444static PyObject *
    45 pycaca_get_window_height(PyObject *self, PyObject *args);
     45pycaca_get_display_height(PyObject *self, PyObject *args);
    4646static PyObject *
    4747pycaca_refresh(PyObject *self, PyObject *args);
  • libcaca/trunk/src/aafire.c

    r816 r819  
    107107      exit (1);
    108108    }
    109   dp = caca_attach(cv);
     109  dp = caca_create_display(cv);
    110110  if (!dp)
    111111    {
     
    155155{
    156156#ifdef LIBCACA
    157   caca_detach(dp);
     157  caca_free_display(dp);
    158158  cucul_free_canvas(cv);
    159159#else
     
    244244               cucul_get_canvas_height(cv) - 2, " -=[ Powered by libcaca ]=- ");
    245245 
    246   caca_display(dp);
     246  caca_refresh_display(dp);
    247247  /*XSIZ = caca_get_width() * 2;
    248248  YSIZ = caca_get_height() * 2 - 4;*/
  • libcaca/trunk/src/cacaball.c

    r816 r819  
    5757    if(!cv)
    5858        return 1;
    59     dp = caca_attach(cv);
     59    dp = caca_create_display(cv);
    6060    if(!dp)
    6161        return 1;
     
    163163                         " -=[ Powered by libcaca ]=- ");
    164164
    165         caca_display(dp);
     165        caca_refresh_display(dp);
    166166    }
    167167
     
    169169end:
    170170    cucul_free_dither(cucul_dither);
    171     caca_detach(dp);
     171    caca_free_display(dp);
    172172    cucul_free_canvas(cv);
    173173
  • libcaca/trunk/src/cacamoir.c

    r816 r819  
    4646    if(!cv)
    4747        return 1;
    48     dp = caca_attach(cv);
     48    dp = caca_create_display(cv);
    4949    if(!dp)
    5050        return 1;
     
    115115                         cucul_get_canvas_height(cv) - 2,
    116116                         " -=[ Powered by libcaca ]=- ");
    117         caca_display(dp);
     117        caca_refresh_display(dp);
    118118    }
    119119
    120120end:
    121121    cucul_free_dither(dither);
    122     caca_detach(dp);
     122    caca_free_display(dp);
    123123    cucul_free_canvas(cv);
    124124
  • libcaca/trunk/src/cacaplas.c

    r816 r819  
    5050    if(!cv)
    5151        return 1;
    52     dp = caca_attach(cv);
     52    dp = caca_create_display(cv);
    5353    if(!dp)
    5454        return 1;
     
    137137                         cucul_get_canvas_height(cv) - 2,
    138138                         " -=[ Powered by libcaca ]=- ");
    139         caca_display(dp);
     139        caca_refresh_display(dp);
    140140    }
    141141
    142142end:
    143143    cucul_free_dither(dither);
    144     caca_detach(dp);
     144    caca_free_display(dp);
    145145    cucul_free_canvas(cv);
    146146
  • libcaca/trunk/src/cacaplay.c

    r813 r819  
    6363    }
    6464
    65     dp = caca_attach(cv);
     65    dp = caca_create_display(cv);
    6666
    67     caca_display(dp);
     67    caca_refresh_display(dp);
    6868
    6969    while(caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1))
     
    7474
    7575    /* Clean up */
    76     caca_detach(dp);
     76    caca_free_display(dp);
    7777    cucul_free_canvas(cv);
    7878
  • libcaca/trunk/src/cacaview.c

    r816 r819  
    7676    }
    7777
    78     dp = caca_attach(cv);
     78    dp = caca_create_display(cv);
    7979    if(!dp)
    8080    {
     
    8484
    8585    /* Set the window title */
    86     caca_set_window_title(dp, "cacaview");
     86    caca_set_display_title(dp, "cacaview");
    8787
    8888    ww = cucul_get_canvas_width(cv);
     
    274274            else if(ev.type == CACA_EVENT_RESIZE)
    275275            {
    276                 caca_display(dp);
     276                caca_refresh_display(dp);
    277277                ww = ev.data.resize.w;
    278278                wh = ev.data.resize.h;
     
    304304            cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
    305305            cucul_putstr(cv, (ww - strlen(buffer)) / 2, wh / 2, buffer);
    306             caca_display(dp);
     306            caca_refresh_display(dp);
    307307            ww = cucul_get_canvas_width(cv);
    308308            wh = cucul_get_canvas_height(cv);
     
    400400        }
    401401
    402         caca_display(dp);
     402        caca_refresh_display(dp);
    403403        update = 0;
    404404    }
     
    407407    if(im)
    408408        unload_image(im);
    409     caca_detach(dp);
     409    caca_free_display(dp);
    410410    cucul_free_canvas(cv);
    411411
     
    477477    yfactor = xfactor * ww / height * im->h / im->w
    478478               * cucul_get_canvas_height(cv) / cucul_get_canvas_width(cv)
    479                * caca_get_window_width(dp) / caca_get_window_height(dp);
     479               * caca_get_display_width(dp) / caca_get_display_height(dp);
    480480
    481481    if(yfactor > xfactor)
  • libcaca/trunk/test/colors.c

    r814 r819  
    3232        return 1;
    3333
    34     dp = caca_attach(cv);
     34    dp = caca_create_display(cv);
    3535    if(!dp)
    3636        return 1;
     
    5050    }
    5151
    52     caca_display(dp);
     52    caca_refresh_display(dp);
    5353    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    5454
    55     caca_detach(dp);
     55    caca_free_display(dp);
    5656    cucul_free_canvas(cv);
    5757
  • libcaca/trunk/test/demo.c

    r816 r819  
    4949    if(!cv)
    5050        return 1;
    51     dp = caca_attach(cv);
     51    dp = caca_create_display(cv);
    5252    if(!dp)
    5353        return 1;
     
    6767    /* Main menu */
    6868    display_menu();
    69     caca_display(dp);
     69    caca_refresh_display(dp);
    7070
    7171    /* Go ! */
     
    166166                cucul_putstr(cv, xmouse, ymouse + 1, "|\\");
    167167            }
    168             caca_display(dp);
     168            caca_refresh_display(dp);
    169169            mouse = menu = 0;
    170170        }
     
    180180                         1000000 / caca_get_rendertime(dp),
    181181                         (10000000 / caca_get_rendertime(dp)) % 10);
    182             caca_display(dp);
     182            caca_refresh_display(dp);
    183183        }
    184184    }
     
    186186    /* Clean up */
    187187    cucul_free_sprite(sprite);
    188     caca_detach(dp);
     188    caca_free_display(dp);
    189189    cucul_free_canvas(cv);
    190190
     
    226226    cucul_putstr(cv, 4, yo - 2, "'q': quit");
    227227
    228     caca_display(dp);
     228    caca_refresh_display(dp);
    229229}
    230230
  • libcaca/trunk/test/dithering.c

    r815 r819  
    4242
    4343    cv = cucul_create_canvas(0, 0);
    44     dp = caca_attach(cv);
     44    dp = caca_create_display(cv);
    4545
    4646    for(x = 0; x < 100; x++)
     
    123123    }
    124124
    125     caca_display(dp);
     125    caca_refresh_display(dp);
    126126
    127127    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    128128
    129     caca_detach(dp);
     129    caca_free_display(dp);
    130130    cucul_free_canvas(cv);
    131131
  • libcaca/trunk/test/event.c

    r814 r819  
    3434    if(!cv)
    3535        return 1;
    36     dp = caca_attach(cv);
     36    dp = caca_create_display(cv);
    3737    if(!dp)
    3838        return 1;
     
    4646    cucul_putstr(cv, 0, h, "type \"quit\" to exit");
    4747
    48     caca_display(dp);
     48    caca_refresh_display(dp);
    4949
    5050    events = malloc(h * sizeof(caca_event_t));
     
    9797            print_event(0, i, events + i);
    9898
    99         caca_display(dp);
     99        caca_refresh_display(dp);
    100100    }
    101101
    102102    /* Clean up */
    103     caca_detach(dp);
     103    caca_free_display(dp);
    104104    cucul_free_canvas(cv);
    105105
  • libcaca/trunk/test/font.c

    r816 r819  
    7979    /* Just for fun, render the image using libcaca */
    8080    cucul_set_canvas_size(cv, 80, 32);
    81     dp = caca_attach(cv);
     81    dp = caca_create_display(cv);
    8282
    8383#if defined(HAVE_ENDIAN_H)
     
    9696    cucul_dither_bitmap(cv, 0, 0, cucul_get_canvas_width(cv),
    9797                                  cucul_get_canvas_height(cv), d, buf);
    98     caca_display(dp);
     98    caca_refresh_display(dp);
    9999
    100100    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    101101
    102102    /* Free everything */
    103     caca_detach(dp);
     103    caca_free_display(dp);
    104104    free(buf);
    105105    cucul_free_dither(d);
  • libcaca/trunk/test/gamma.c

    r816 r819  
    4242
    4343    cv = cucul_create_canvas(0, 0);
    44     dp = caca_attach(cv);
     44    dp = caca_create_display(cv);
    4545
    4646    cw = cucul_create_canvas(cucul_get_canvas_width(cv), cucul_get_canvas_height(cv));
     
    107107                     "gamma=%g - use arrows to change, Esc to quit", gam);
    108108
    109         caca_display(dp);
     109        caca_refresh_display(dp);
    110110    }
    111111
     
    113113    cucul_free_dither(right);
    114114
    115     caca_detach(dp);
     115    caca_free_display(dp);
    116116    cucul_free_canvas(cv);
    117117
  • libcaca/trunk/test/hsv.c

    r816 r819  
    3737
    3838    cv = cucul_create_canvas(0, 0);
    39     dp = caca_attach(cv);
     39    dp = caca_create_display(cv);
    4040
    4141    for(y = 0; y < 256; y++)
     
    5151    cucul_free_dither(dither);
    5252
    53     caca_display(dp);
     53    caca_refresh_display(dp);
    5454
    5555    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    5656
    57     caca_detach(dp);
     57    caca_free_display(dp);
    5858    cucul_free_canvas(cv);
    5959
  • libcaca/trunk/test/spritedit.c

    r814 r819  
    4141    if(!cv)
    4242        return 1;
    43     dp = caca_attach(cv);
     43    dp = caca_create_display(cv);
    4444    if(!dp)
    4545        return 1;
     
    4949    if(!sprite)
    5050    {
    51         caca_detach(dp);
     51        caca_free_display(dp);
    5252        cucul_free_canvas(cv);
    5353        fprintf(stderr, "%s: could not open `%s'.\n", argv[0], argv[1]);
     
    133133        cucul_draw_sprite(cv, 20, 10, sprite, frame);
    134134
    135         caca_display(dp);
     135        caca_refresh_display(dp);
    136136    }
    137137
    138138    /* Clean up */
    139     caca_detach(dp);
     139    caca_free_display(dp);
    140140    cucul_free_canvas(cv);
    141141
  • libcaca/trunk/test/transform.c

    r813 r819  
    5656
    5757    cv = cucul_create_canvas(0, 0);
    58     dp = caca_attach(cv);
     58    dp = caca_create_display(cv);
    5959
    6060    normal = cucul_create_canvas(70, 6);
     
    107107    cucul_blit(cv, 10, 18, rotate, NULL);
    108108
    109     caca_display(dp);
     109    caca_refresh_display(dp);
    110110
    111111    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    112112
    113     caca_detach(dp);
     113    caca_free_display(dp);
    114114    cucul_free_canvas(rotate);
    115115    cucul_free_canvas(flop);
  • libcaca/trunk/test/truecolor.c

    r813 r819  
    3434
    3535    cv = cucul_create_canvas(32, 16);
    36     dp = caca_attach(cv);
     36    dp = caca_create_display(cv);
    3737
    3838    for(y = 0; y < 16; y++)
     
    4949    cucul_putstr(cv, 2, 1, " truecolor libcaca ");
    5050
    51     caca_display(dp);
     51    caca_refresh_display(dp);
    5252
    5353    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    5454
    55     caca_detach(dp);
     55    caca_free_display(dp);
    5656    cucul_free_canvas(cv);
    5757
  • libcaca/trunk/test/unicode.c

    r813 r819  
    3232
    3333    cv = cucul_create_canvas(0, 0);
    34     dp = caca_attach(cv);
     34    dp = caca_create_display(cv);
    3535
    3636    cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     
    8686    cucul_putstr(cv, 1, 22, "drawing blocks: ███ ▓▓▓ ▒▒▒ ░░░ ▀ ▄ ▌ ▐ █ ▖ ▗ ▘ ▝ ▚ ▞ ▙ ▛ ▜ ▟");
    8787
    88     caca_display(dp);
     88    caca_refresh_display(dp);
    8989
    9090    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    9191
    92     caca_detach(dp);
     92    caca_free_display(dp);
    9393    cucul_free_canvas(cv);
    9494
Note: See TracChangeset for help on using the changeset viewer.