Ignore:
Timestamp:
Nov 12, 2006, 12:06:34 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Documented caca_event_t members.
File:
1 edited

Legend:

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

    r1104 r1358  
    3434#endif
    3535
    36 /** \e libcaca context */
     36/** \e libcaca display context */
    3737typedef struct caca_display caca_display_t;
    38 /** event structure */
     38/** \e libcaca event structure */
    3939typedef struct caca_event caca_event_t;
    4040
    41 /** \brief User events.
     41/** \brief Handling of user events.
    4242 *
    4343 *  This structure is filled by caca_get_event() when an event is received.
    44  *  The \e type field is always valid. The validity of the \e data union
    45  *  depends on the value of the \e type field:
    46  *  - \b CACA_EVENT_NONE: no other field is valid.
    47  *  - \b CACA_EVENT_KEY_PRESS, \b CACA_EVENT_KEY_RELEASE: the \e data.key.ch
    48  *      field is valid and contains either the ASCII value for the key, or
    49  *      an \e enum \e caca_key value. If the value is a printable ASCII
    50  *      character, the \e data.key.utf32 and \e data.key.utf8 fields are
    51  *      also filled and contain respectively the UTF-32/UCS-4 and the UTF-8
    52  *      representations of the character. Otherwise, their content is
    53  *      undefined.
    54  *  - \b CACA_EVENT_MOUSE_PRESS, \b CACA_EVENT_MOUSE_RELEASE: the
    55  *      \e data.mouse.button field is valid and contains the index of the
    56  *      mouse button that was pressed.
    57  *  - \b CACA_EVENT_MOUSE_MOTION: the \e data.mouse.x and \e data.mouse.y
    58  *      fields are valid and contain the mouse coordinates in character
    59  *      cells.
    60  *  - \b CACA_EVENT_RESIZE: the \e data.resize.w and \e data.resize.h
    61  *      fields are valid and contain the new width and height values of
    62  *      the \e libcucul canvas attached to \e libcaca.
    63  *  - \b CACA_EVENT_QUIT: no other field is valid.
    64  *
    65  *  The result of accessing data members outside the above conditions is
    66  *  undefined.
    67  */
     44 *  The \e type field is always valid. */
    6845struct caca_event
    6946{
     47    /** \brief User event type enumeration.
     48     *
     49     *  This enum serves two purposes:
     50     *  - Build listening masks for caca_get_event().
     51     *  - Define the type of a \e caca_event_t.
     52     */
    7053    enum caca_event_type
    7154    {
     
    8164
    8265        CACA_EVENT_ANY =           0xffff  /**< Bitmask for any event. */
    83     } type;
     66    }
     67    /** \brief User event type member.
     68     *
     69     *  This field is always valid when caca_get_event() returns.
     70     */
     71    type;
    8472
     73    /** \brief User event data member.
     74     *
     75     *  The validity of the \e data union depends on the value of the \e type
     76     *  field:
     77     *  - \c CACA_EVENT_NONE: no field is valid.
     78     *  - \c CACA_EVENT_KEY_PRESS, \c CACA_EVENT_KEY_RELEASE: the
     79     *  \e data.key.ch field is valid and contains either the ASCII value for
     80     *  the key, or an \e enum \e caca_key value. If the value is a printable
     81     *  ASCII character, the \e data.key.utf32 and \e data.key.utf8 fields are
     82     *  also filled and contain respectively the UTF-32/UCS-4 and the UTF-8
     83     *  representations of the character. Otherwise, their content is
     84     *  undefined.
     85     *  - \c CACA_EVENT_MOUSE_PRESS, \c CACA_EVENT_MOUSE_RELEASE: the
     86     *  \e data.mouse.button field is valid and contains the index of the
     87     *  mouse button that was pressed.
     88     *  - \c CACA_EVENT_MOUSE_MOTION: the \e data.mouse.x and \e data.mouse.y
     89     *  fields are valid and contain the mouse coordinates in character
     90     *  cells.
     91     *  - \c CACA_EVENT_RESIZE: the \e data.resize.w and \e data.resize.h
     92     *  fields are valid and contain the new width and height values of
     93     *  the \e libcucul canvas attached to \e libcaca.
     94     *  - \c CACA_EVENT_QUIT: no other field is valid.
     95     *
     96     *  The result of accessing data members outside the above conditions is
     97     *  undefined.
     98     */
    8599    union
    86100    {
Note: See TracChangeset for help on using the changeset viewer.