Ignore:
Timestamp:
Mar 7, 2006, 10:17:35 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Polished the driver split a bit (still no events, except resize events), properly credited authors and documented a few things.
File:
1 edited

Legend:

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

    r539 r540  
    1010 */
    1111
    12 /** \file graphics.c
     12/** \file driver_x11.c
    1313 *  \version \$Id$
    1414 *  \author Sam Hocevar <sam@zoy.org>
    15  *  \brief Character drawing
     15 *  \brief X11 driver
    1616 *
    17  *  This file contains character and string drawing functions.
     17 *  This file contains the libcaca X11 input and output driver
    1818 */
    1919
    2020#include "config.h"
    21 
    22 #if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)
    23 #   include <inttypes.h>
    24 #else
    25 typedef unsigned int uint32_t;
    26 typedef unsigned char uint8_t;
    27 #endif
    2821
    2922#if defined(USE_X11)
     
    4740#include "cucul_internals.h"
    4841
    49 int x11_init_graphics(caca_t *);
    50 int x11_end_graphics(caca_t *);
    51 int x11_set_window_title(caca_t *, char const *);
    52 unsigned int x11_get_window_width(caca_t *);
    53 unsigned int x11_get_window_height(caca_t *);
    54 void x11_display(caca_t *);
    55 void x11_handle_resize(caca_t *);
    56 
    5742/*
    5843 * Local functions
     
    6045static int x11_error_handler(Display *, XErrorEvent *);
    6146
    62 #if !defined(_DOXYGEN_SKIP_ME)
    63 int x11_init_graphics(caca_t *kk)
     47static int x11_init_graphics(caca_t *kk)
    6448{
    6549    static int const x11_palette[] =
     
    211195}
    212196
    213 int x11_end_graphics(caca_t *kk)
     197static int x11_end_graphics(caca_t *kk)
    214198{
    215199    XSync(kk->x11.dpy, False);
     
    227211    return 0;
    228212}
    229 #endif /* _DOXYGEN_SKIP_ME */
    230 
    231 int x11_set_window_title(caca_t *kk, char const *title)
     213
     214static int x11_set_window_title(caca_t *kk, char const *title)
    232215{
    233216    XStoreName(kk->x11.dpy, kk->x11.window, title);
     
    235218}
    236219
    237 unsigned int x11_get_window_width(caca_t *kk)
     220static unsigned int x11_get_window_width(caca_t *kk)
    238221{
    239222    return kk->qq->width * kk->x11.font_width;
    240223}
    241224
    242 unsigned int x11_get_window_height(caca_t *kk)
     225static unsigned int x11_get_window_height(caca_t *kk)
    243226{
    244227    return kk->qq->height * kk->x11.font_height;
    245228}
    246229
    247 void x11_display(caca_t *kk)
     230static void x11_display(caca_t *kk)
    248231{
    249232    unsigned int x, y, len;
     
    309292}
    310293
    311 void x11_handle_resize(caca_t *kk)
    312 {
    313     unsigned int new_width, new_height;
    314 
     294static void x11_handle_resize(caca_t *kk, unsigned int *new_width,
     295                                          unsigned int *new_height)
     296{
    315297    Pixmap new_pixmap;
    316298
    317     new_width = kk->qq->width;
    318     new_height = kk->qq->height;
    319 
    320     new_width = kk->x11.new_width;
    321     new_height = kk->x11.new_height;
     299    *new_width = kk->x11.new_width;
     300    *new_height = kk->x11.new_height;
    322301
    323302    new_pixmap = XCreatePixmap(kk->x11.dpy, kk->x11.window,
Note: See TracChangeset for help on using the changeset viewer.