Sfoglia il codice sorgente

A lot of documentation updates here and there, including bugfixes dating

back to the libcucul merge.
tags/v0.99.beta17
Sam Hocevar sam 16 anni fa
parent
commit
1fe8a8702a
7 ha cambiato i file con 42 aggiunte e 29 eliminazioni
  1. +3
    -0
      caca/event.c
  2. +2
    -0
      doc/doxygen.cfg.in
  3. +20
    -19
      doc/migrating.dox
  4. +7
    -0
      doc/style.dox
  5. +5
    -5
      doc/tutorial.dox
  6. +1
    -1
      doc/user.dox
  7. +4
    -4
      ruby/ruby-caca.dox

+ 3
- 0
caca/event.c Vedi File

@@ -229,6 +229,9 @@ uint32_t caca_get_event_key_utf32(caca_event_t const *ev)
* will be undefined. See caca_get_event_type() for more information. * will be undefined. See caca_get_event_type() for more information.
* *
* \param ev The libcaca event. * \param ev The libcaca event.
* \param utf8 A string buffer with enough bytes to hold the pressed
* key value in UTF-8. Though fewer bytes may be written to
* it, 7 bytes is the minimum safe size.
* \return This function always returns 0. * \return This function always returns 0.
*/ */
int caca_get_event_key_utf8(caca_event_t const *ev, char *utf8) int caca_get_event_key_utf8(caca_event_t const *ev, char *utf8)


+ 2
- 0
doc/doxygen.cfg.in Vedi File

@@ -567,6 +567,8 @@ WARN_LOGFILE =
INPUT = @top_srcdir@ \ INPUT = @top_srcdir@ \
@top_srcdir@/doc \ @top_srcdir@/doc \
@top_srcdir@/caca \ @top_srcdir@/caca \
@top_srcdir@/caca/codec \
@top_srcdir@/caca/driver \
@top_srcdir@/ruby @top_srcdir@/ruby


# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files


+ 20
- 19
doc/migrating.dox Vedi File

@@ -47,7 +47,7 @@ int main(void)
/* Initialise libcaca */ /* Initialise libcaca */
caca_canvas_t *cv; caca_canvas_t *cv;
caca_display_t *dp; caca_display_t *dp;
dp = caca_create_display(cv);
dp = caca_create_display(NULL);
cv = caca_get_canvas(dp); cv = caca_get_canvas(dp);
/* Set window title */ /* Set window title */
caca_set_display_title(dp, "Window"); caca_set_display_title(dp, "Window");
@@ -71,9 +71,7 @@ int main(void)


Note the following important things: Note the following important things:


- Functions now take an object handle as their first argument.
- All input/output functions start with \b caca_ and all
drawing and text handling functions start with \b caca_ .
- Most functions now take an object handle as their first argument.


\section foo2 Migration strategy \section foo2 Migration strategy


@@ -105,6 +103,9 @@ int main(void)
\endcode \endcode
</td></tr></table> </td></tr></table>


The modified code is guaranteed to build both with \e libcaca 0.x and
\e libcaca 1.0.

\section foo3 Function equivalence list \section foo3 Function equivalence list


\subsection bar1 Basic functions \subsection bar1 Basic functions
@@ -146,7 +147,7 @@ int main(void)
uselessness. uselessness.
- \b caca_putchar(): use caca_put_char(). - \b caca_putchar(): use caca_put_char().
- \b caca_putstr(): use caca_put_str(). - \b caca_putstr(): use caca_put_str().
- \b caca_printf(): use caca_printf().
- \b caca_printf(): unchanged.
- \b caca_clear(): use caca_clear_canvas(). - \b caca_clear(): use caca_clear_canvas().


\subsection bar4 Primitives drawing \subsection bar4 Primitives drawing
@@ -154,27 +155,27 @@ int main(void)
These functions are almost unchanged, except for Unicode support and the These functions are almost unchanged, except for Unicode support and the
fact that they now act on a given canvas. fact that they now act on a given canvas.


- \b caca_draw_line(): use caca_draw_line().
- \b caca_draw_polyline(): use caca_draw_polyline().
- \b caca_draw_thin_line(): use caca_draw_thin_line().
- \b caca_draw_thin_polyline(): use caca_draw_thin_polyline().
- \b caca_draw_line(): unchanged.
- \b caca_draw_polyline(): unchanged.
- \b caca_draw_thin_line(): unchanged.
- \b caca_draw_thin_polyline(): unchanged.


- \b caca_draw_circle(): use caca_draw_circle().
- \b caca_draw_ellipse(): use caca_draw_ellipse().
- \b caca_draw_thin_ellipse(): use caca_draw_thin_ellipse().
- \b caca_fill_ellipse(): use caca_fill_ellipse().
- \b caca_draw_circle(): unchanged.
- \b caca_draw_ellipse(): unchanged.
- \b caca_draw_thin_ellipse(): unchanged.
- \b caca_fill_ellipse(): unchanged.


- \b caca_draw_box(): use caca_draw_box().
- \b caca_draw_box(): unchanged.
- \b caca_draw_thin_box(): use caca_draw_thin_box() or caca_draw_cp437_box(). - \b caca_draw_thin_box(): use caca_draw_thin_box() or caca_draw_cp437_box().
- \b caca_fill_box(): use caca_fill_box().
- \b caca_fill_box(): unchanged.


- \b caca_draw_triangle(): use caca_draw_triangle().
- \b caca_draw_thin_triangle(): use caca_draw_thin_triangle().
- \b caca_fill_triangle(): use caca_fill_triangle().
- \b caca_draw_triangle(): unchanged.
- \b caca_draw_thin_triangle(): unchanged.
- \b caca_fill_triangle(): unchanged.


\subsection bar5 Mathematical functions \subsection bar5 Mathematical functions


- \b caca_rand(): use caca_rand(). The second argument is different, make
- \b caca_rand(): unchanged, but the second argument is different, make
sure you take that into account. sure you take that into account.
- \b caca_sqrt(): this function is now deprecated, use your system's - \b caca_sqrt(): this function is now deprecated, use your system's
\b sqrt() call instead. \b sqrt() call instead.


+ 7
- 0
doc/style.dox Vedi File

@@ -47,9 +47,16 @@ x = min(x1, x2, x3);


\code \code
int function(int); int function(int);
\endcode

A space can be inserted after keywords such as \c for, \c while or \c if,
but consistency with the rest of the page is encouraged:


\code
if(a == b) if(a == b)
return; return;

if (p == NULL)
\endcode \endcode


Do not put parentheses around return values: Do not put parentheses around return values:


+ 5
- 5
doc/tutorial.dox Vedi File

@@ -38,15 +38,15 @@ What does it do?
- Set the display's window name (only available in windowed displays, does - Set the display's window name (only available in windowed displays, does
nothing otherwise). nothing otherwise).
- Set the current canvas colours to black background and white foreground. - Set the current canvas colours to black background and white foreground.
- Write the string "This is a message" using the current colors onto the
canvas.
- Refresh the display.
- Wait for an event of type "CACA_EVENT_KEY_PRESS".
- Write the string \c "This is a message" onto the canvas, using the current
colour pair.
- Refresh the display, causing the text to be effectively displayed.
- Wait for an event of type \c CACA_EVENT_KEY_PRESS.
- Free the display (release memory). Since it was created together with the - Free the display (release memory). Since it was created together with the
display, the canvas will be automatically freed as well. display, the canvas will be automatically freed as well.


You can then compile this code on an UNIX-like system using the following You can then compile this code on an UNIX-like system using the following
comman (requiring pkg-config and gcc):
commans (requiring \c pkg-config and \c gcc):
\code \code
gcc `pkg-config --libs --cflags caca` example.c -o example gcc `pkg-config --libs --cflags caca` example.c -o example
\endcode \endcode


+ 1
- 1
doc/user.dox Vedi File

@@ -3,7 +3,7 @@
/** \page libcaca-env Libcaca environment variables /** \page libcaca-env Libcaca environment variables


Some environment variables can be used to change the behaviour of Some environment variables can be used to change the behaviour of
\e libcaca without having to modify the program which uses them. These
\e libcaca without having to modify the program which uses it. These
variables are: variables are:


\li \b CACA_DRIVER: set the backend video driver. In order of preference: \li \b CACA_DRIVER: set the backend video driver. In order of preference:


+ 4
- 4
ruby/ruby-caca.dox Vedi File

@@ -1,6 +1,6 @@
/*$Id$ */ /** \page libcaca-ruby-api Libcaca Ruby API /*$Id$ */ /** \page libcaca-ruby-api Libcaca Ruby API


Theclasses available for libcaca are :
The classes available for libcaca are :


\li\b Caca::Canvas : functions that have a caca_canvas_t* as first argument \li\b Caca::Canvas : functions that have a caca_canvas_t* as first argument
\li\b Caca::Dither : functions that have a caca_dither_t* as first argument \li\b Caca::Dither : functions that have a caca_dither_t* as first argument
@@ -18,7 +18,7 @@ Theclasses available for libcaca are :
\li\b Caca::Event::Resize \li\b Caca::Event::Resize
\li\b Caca::Event::Quit \li\b Caca::Event::Quit


Thecharacter set conversion functions are not available yet in the binding.
The character set conversion functions are not available yet in the binding.


\code \code
$irb -rcaca $irb -rcaca
@@ -117,7 +117,7 @@ irb(main):015:0>Caca::Event::Resize.my_instance_methods
=>["w", "h"] =>["w", "h"]
\endcode \endcode


\sectionSamples
\section Samples


\code \code
$ruby -rcaca -e 'c=Caca::Canvas.new(6, 3).fill_box(0,0,2,2,"#"[0]); $ruby -rcaca -e 'c=Caca::Canvas.new(6, 3).fill_box(0,0,2,2,"#"[0]);
@@ -132,7 +132,7 @@ c.export_memory("irc")'
$ruby -e 'puts Caca::Canvas.new(6,3).draw_thin_polyline([[0,0], [0,2], $ruby -e 'puts Caca::Canvas.new(6,3).draw_thin_polyline([[0,0], [0,2],
[5,2],[0,0]]).export_memory("irc")' [5,2],[0,0]]).export_memory("irc")'
-. -.
|`.
| `.
----`- ----`-
\endcode \endcode




Caricamento…
Annulla
Salva