Changeset 352


Ignore:
Timestamp:
Jan 17, 2004, 11:32:39 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • src/graphics.c: + Renamed caca_set_title() to caca_set_window_title(). + Implemented caca_get_window_width() and caca_get_window_height().
  • examples/cacaview.c: + Set the window title to cacaview.
Location:
libcaca/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/TODO

    r270 r352  
    99      http://groups.yahoo.com/group/zepp/message/381
    1010
    11    o  Write a window resize handler.
    12 
     11   o  DONE 13 Jan 2004: Write a window resize handler.
    1312   o  DONE 12 Nov 2003: Port to conio.h
    1413
     
    2221   o  Alpha layer for sprites
    2322
    24    o  Clip all graphics primitives
    25 
    2623   o  Fix the thin ellipse rendering
    2724
    2825   o  DONE 26 Nov 2003: Support more colour depths, more bitmask orderings
     26   o  DONE 15 Nov 2003: Clip all graphics primitives
    2927
    3028
  • libcaca/trunk/examples/cacaview.c

    r344 r352  
    8585
    8686    /* Set the window title */
    87     caca_set_title("cacaview");
     87    caca_set_window_title("cacaview");
    8888
    8989    /* Load items into playlist */
  • libcaca/trunk/src/caca.h

    r347 r352  
    247247unsigned int caca_get_width(void);
    248248unsigned int caca_get_height(void);
    249 int caca_set_title(char const *);
     249int caca_set_window_title(char const *);
     250unsigned int caca_get_window_width(void);
     251unsigned int caca_get_window_height(void);
    250252void caca_refresh(void);
    251253void caca_end(void);
  • libcaca/trunk/src/graphics.c

    r349 r352  
    980980 *  \return 0 upon success, a non-zero value if an error occurs.
    981981 */
    982 int caca_set_title(char const *title)
     982int caca_set_window_title(char const *title)
    983983{
    984984#if defined(USE_X11)
     
    10021002
    10031003    return 0;
     1004}
     1005
     1006/** \brief Get the window width.
     1007 *
     1008 *  If libcaca runs in a window, get the usable window width. This value can
     1009 *  be used for aspect ratio calculation. If libcaca does not run in a window
     1010 *  or if there is no way to know the font size, assume a 6x10 font is being
     1011 *  used. Note that the units are not necessarily pixels.
     1012 *
     1013 *  \return The window width.
     1014 */
     1015unsigned int caca_get_window_width(void)
     1016{
     1017#if defined(USE_X11)
     1018    if(_caca_driver == CACA_DRIVER_X11)
     1019    {
     1020        return _caca_width * x11_font_width;
     1021    }
     1022    else
     1023#endif
     1024#if defined(USE_WIN32)
     1025    if(_caca_driver == CACA_DRIVER_WIN32)
     1026    {
     1027        /* FIXME */
     1028    }
     1029    else
     1030#endif
     1031    {
     1032        /* Dummy */
     1033    }
     1034
     1035    /* Fallback to a 6x10 font */
     1036    return _caca_width * 6;
     1037}
     1038
     1039/** \brief Get the window height.
     1040 *
     1041 *  If libcaca runs in a window, get the usable window height. This value can
     1042 *  be used for aspect ratio calculation. If libcaca does not run in a window
     1043 *  or if there is no way to know the font size, assume a 6x10 font is being
     1044 *  used. Note that the units are not necessarily pixels.
     1045 *
     1046 *  \return The window height.
     1047 */
     1048unsigned int caca_get_window_height(void)
     1049{
     1050#if defined(USE_X11)
     1051    if(_caca_driver == CACA_DRIVER_X11)
     1052    {
     1053        return _caca_height * x11_font_height;
     1054    }
     1055    else
     1056#endif
     1057#if defined(USE_WIN32)
     1058    if(_caca_driver == CACA_DRIVER_WIN32)
     1059    {
     1060        /* FIXME */
     1061    }
     1062    else
     1063#endif
     1064    {
     1065        /* Dummy */
     1066    }
     1067
     1068    /* Fallback to a 6x10 font */
     1069    return _caca_height * 10;
    10041070}
    10051071
Note: See TracChangeset for help on using the changeset viewer.