Changeset 1396 for libcaca


Ignore:
Timestamp:
Nov 14, 2006, 7:02:29 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Added all the glue needed for a Cocoa output driver.
Location:
libcaca/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/Makefile.am

    r1208 r1396  
    2828        driver_vga.c \
    2929        driver_win32.c \
    30         $(extra_drivers) \
     30        $(cocoa_source) \
     31        $(extra_source) \
    3132        $(NULL)
    3233libcaca_la_LDFLAGS = -no-undefined -version-info @LT_VERSION@
     
    4546libgl_plugin_la_LIBADD = libcaca.la ../cucul/libcucul.la @GL_LIBS@
    4647else
    47 extra_drivers = driver_x11.c driver_gl.c
     48extra_source = driver_x11.c driver_gl.c
    4849endif
    4950
     51if USE_COCOA
     52cocoa_source = driver_cocoa.m
     53endif
     54
  • libcaca/trunk/caca/caca.c

    r1362 r1396  
    163163#if defined(HAVE_GETENV) && defined(HAVE_STRCASECMP)
    164164    char *var = getenv("CACA_DRIVER");
    165    
     165
    166166    /* If the environment variable was set, use it */
    167167    if(var && *var)
    168168    {
     169#if defined(USE_COCOA)
     170        if(!strcasecmp(var, "cocoa")) return cocoa_install(dp);
     171#endif
    169172#if defined(USE_WIN32)
    170173        if(!strcasecmp(var, "win32")) return win32_install(dp);
     
    195198#endif
    196199
     200#if defined(USE_COCOA)
     201    if(cocoa_install(dp) == 0) return 0;
     202#endif
    197203#if defined(USE_WIN32)
    198204    if(win32_install(dp) == 0) return 0;
  • libcaca/trunk/caca/caca_internals.h

    r1392 r1396  
    3030    CACA_DRIVER_NONE = 0,
    3131    CACA_DRIVER_RAW = 1,
     32#if defined(USE_COCOA)
     33    CACA_DRIVER_COCOA = 2,
     34#endif
    3235#if defined(USE_CONIO)
    33     CACA_DRIVER_CONIO = 2,
     36    CACA_DRIVER_CONIO = 3,
    3437#endif
    3538#if defined(USE_GL)
    36     CACA_DRIVER_GL = 3,
     39    CACA_DRIVER_GL = 4,
    3740#endif
    3841#if defined(USE_NCURSES)
    39     CACA_DRIVER_NCURSES = 4,
     42    CACA_DRIVER_NCURSES = 5,
    4043#endif
    4144#if defined(USE_SLANG)
    42     CACA_DRIVER_SLANG = 5,
     45    CACA_DRIVER_SLANG = 6,
    4346#endif
    4447#if defined(USE_VGA)
    45     CACA_DRIVER_VGA = 6,
     48    CACA_DRIVER_VGA = 7,
    4649#endif
    4750#if defined(USE_WIN32)
    48     CACA_DRIVER_WIN32 = 7,
     51    CACA_DRIVER_WIN32 = 8,
    4952#endif
    5053#if defined(USE_X11)
    51     CACA_DRIVER_X11 = 8,
     54    CACA_DRIVER_X11 = 9,
    5255#endif
    5356};
    5457
    5558/* Available external drivers */
     59#if defined(USE_COCOA)
     60int cocoa_install(caca_display_t *);
     61#endif
    5662#if defined(USE_CONIO)
    5763int conio_install(caca_display_t *);
  • libcaca/trunk/configure.ac

    r1370 r1396  
    1616AC_PROG_CXX
    1717AC_PROG_CXXCPP
     18_AM_DEPENDENCIES([OBJC])
     19OBJC="${CXX}"
     20AC_SUBST(OBJC)
     21AC_SUBST(OBJCFLAGS)
    1822AM_PROG_AS
    1923
     
    4953AC_ARG_ENABLE(gl,
    5054  [  --enable-gl             OpenGL support (autodetected)])
     55AC_ARG_ENABLE(cocoa,
     56  [  --enable-cocoa          Cocoa support (autodetected)])
    5157AC_ARG_ENABLE(network,
    5258  [  --enable-network        Network support (autodetected)])
     
    191197  fi
    192198fi
     199
     200if test "${enable_cocoa}" != "no"; then
     201  ac_cv_my_have_cocoa="no"
     202  AC_LANG_PUSH(C++)
     203  savedCPPFLAGS="${CPPFLAGS}"
     204  CPPFLAGS="${CPPFLAGS} -ObjC"
     205  AC_CHECK_HEADERS(Cocoa/Cocoa.h,
     206   [ac_cv_my_have_cocoa="yes"])
     207  if test "${ac_cv_my_have_cocoa}" = "yes"; then
     208    AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
     209    CACA_LIBS="${CACA_LIBS} -Wl,-framework,Cocoa"
     210    CACA_DRIVERS="${CACA_DRIVERS} cocoa"
     211  elif test "${enable_cocoa}" = "yes"; then
     212    AC_MSG_ERROR([cannot find Cocoa development files])
     213  fi
     214  CPPFLAGS="${savedCPPFLAGS}"
     215  AC_LANG_POP(C++)
     216fi
     217AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes")
    193218
    194219if test "${enable_ncurses}" != "no"; then
Note: See TracChangeset for help on using the changeset viewer.