vdr/xine-lib-vdr/src/video_out/macosx Makefile.am Makefile.in XineOpenGLView.h XineOpenGLView.m XineVideoWindow.h XineVideoWindow.m video_window.h

Darren Salt pkg-vdr-dvb-changes@lists.alioth.debian.org
Mon, 04 Apr 2005 22:38:32 +0000


Update of /cvsroot/pkg-vdr-dvb/vdr/xine-lib-vdr/src/video_out/macosx
In directory haydn:/tmp/cvs-serv13100/src/video_out/macosx

Added Files:
	Makefile.am Makefile.in XineOpenGLView.h XineOpenGLView.m 
	XineVideoWindow.h XineVideoWindow.m video_window.h 
Log Message:
Import of VDR-patched xine-lib.

--- NEW FILE: Makefile.in ---
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@


SOURCES = $(libxineMacOSXVideo_la_SOURCES)

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \
	$(srcdir)/Makefile.in $(top_srcdir)/misc/Makefile.common
subdir = src/video_out/macosx
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/_xine.m4 $(top_srcdir)/m4/aa.m4 \
	$(top_srcdir)/m4/alsa.m4 $(top_srcdir)/m4/arts.m4 \
	$(top_srcdir)/m4/as.m4 $(top_srcdir)/m4/caca.m4 \
	$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/directx.m4 \
	$(top_srcdir)/m4/dl.m4 $(top_srcdir)/m4/dvdnav.m4 \
	$(top_srcdir)/m4/esd.m4 $(top_srcdir)/m4/ffmpeg.m4 \
	$(top_srcdir)/m4/freetype2.m4 $(top_srcdir)/m4/gettext.m4 \
	$(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \
	$(top_srcdir)/m4/irixal.m4 $(top_srcdir)/m4/lcmessage.m4 \
	$(top_srcdir)/m4/libFLAC.m4 $(top_srcdir)/m4/libfame.m4 \
	$(top_srcdir)/m4/ogg.m4 $(top_srcdir)/m4/opengl.m4 \
	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/progtest.m4 \
	$(top_srcdir)/m4/sdl.m4 $(top_srcdir)/m4/speex.m4 \
	$(top_srcdir)/m4/theora.m4 $(top_srcdir)/m4/vorbis.m4 \
	$(top_srcdir)/m4/xv.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libxineMacOSXVideo_la_LIBADD =
am__libxineMacOSXVideo_la_SOURCES_DIST = XineOpenGLView.m \
	XineVideoWindow.m
@HAVE_MACOSX_VIDEO_TRUE@am_libxineMacOSXVideo_la_OBJECTS =  \
@HAVE_MACOSX_VIDEO_TRUE@	XineOpenGLView.lo XineVideoWindow.lo
libxineMacOSXVideo_la_OBJECTS = $(am_libxineMacOSXVideo_la_OBJECTS)
@HAVE_MACOSX_VIDEO_TRUE@am_libxineMacOSXVideo_la_rpath = -rpath \
@HAVE_MACOSX_VIDEO_TRUE@	$(libdir)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
OBJCCOMPILE = $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)
LTOBJCCOMPILE = $(LIBTOOL) --mode=compile $(OBJC) $(DEFS) \
	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
	$(AM_OBJCFLAGS) $(OBJCFLAGS)
OBJCLD = $(OBJC)
OBJCLINK = $(LIBTOOL) --mode=link $(OBJCLD) $(AM_OBJCFLAGS) \
	$(OBJCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libxineMacOSXVideo_la_SOURCES)
DIST_SOURCES = $(am__libxineMacOSXVideo_la_SOURCES_DIST)
am__include_HEADERS_DIST = video_window.h XineOpenGLView.h \
	XineVideoWindow.h
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
AAINFO = @AAINFO@
AALIB_CFLAGS = @AALIB_CFLAGS@
AALIB_CONFIG = @AALIB_CONFIG@
AALIB_LIBS = @AALIB_LIBS@
ACLOCAL = @ACLOCAL@
ACLOCAL_DIR = @ACLOCAL_DIR@
ALLOCA = @ALLOCA@
ALSA_CFLAGS = @ALSA_CFLAGS@
ALSA_LIBS = @ALSA_LIBS@
ALSA_STATIC_LIB = @ALSA_STATIC_LIB@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
ARTS_CFLAGS = @ARTS_CFLAGS@
ARTS_CONFIG = @ARTS_CONFIG@
ARTS_LIBS = @ARTS_LIBS@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_ASF_FALSE = @BUILD_ASF_FALSE@
BUILD_ASF_TRUE = @BUILD_ASF_TRUE@
BUILD_DHA_KMOD_FALSE = @BUILD_DHA_KMOD_FALSE@
BUILD_DHA_KMOD_TRUE = @BUILD_DHA_KMOD_TRUE@
BUILD_FAAD_FALSE = @BUILD_FAAD_FALSE@
BUILD_FAAD_TRUE = @BUILD_FAAD_TRUE@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CACA_CFLAGS = @CACA_CFLAGS@
CACA_CONFIG = @CACA_CONFIG@
CACA_LIBS = @CACA_LIBS@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCAS = @CCAS@
CCASCOMPILE = @CCASCOMPILE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEBUG_CFLAGS = @DEBUG_CFLAGS@
DEFS = @DEFS@
DEPCOMP = @DEPCOMP@
DEPDIR = @DEPDIR@
DEPMOD = @DEPMOD@
DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
DIRECTFB_LIBS = @DIRECTFB_LIBS@
DIRECTX_AUDIO_LIBS = @DIRECTX_AUDIO_LIBS@
DIRECTX_CPPFLAGS = @DIRECTX_CPPFLAGS@
DIRECTX_VIDEO_LIBS = @DIRECTX_VIDEO_LIBS@
DLLTOOL = @DLLTOOL@
DVDNAV_CFLAGS = @DVDNAV_CFLAGS@
DVDNAV_CONFIG = @DVDNAV_CONFIG@
DVDNAV_LIBS = @DVDNAV_LIBS@
DYNAMIC_LD_LIBS = @DYNAMIC_LD_LIBS@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_VCD_FALSE = @ENABLE_VCD_FALSE@
ENABLE_VCD_TRUE = @ENABLE_VCD_TRUE@
ESD_CFLAGS = @ESD_CFLAGS@
ESD_CONFIG = @ESD_CONFIG@
ESD_LIBS = @ESD_LIBS@
EXEEXT = @EXEEXT@
EXTRA_X_CFLAGS = @EXTRA_X_CFLAGS@
EXTRA_X_LIBS = @EXTRA_X_LIBS@
F77 = @F77@
FFLAGS = @FFLAGS@
FFMPEG_CPPFLAGS = @FFMPEG_CPPFLAGS@
FFMPEG_LIBS = @FFMPEG_LIBS@
FIG2DEV = @FIG2DEV@
FREETYPE_CONFIG = @FREETYPE_CONFIG@
FT2_CFLAGS = @FT2_CFLAGS@
FT2_LIBS = @FT2_LIBS@
GENCAT = @GENCAT@
GLIBC21 = @GLIBC21@
GLUT_LIBS = @GLUT_LIBS@
GLU_LIBS = @GLU_LIBS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
GOOM_LIBS = @GOOM_LIBS@
HAVE_AA_FALSE = @HAVE_AA_FALSE@
HAVE_AA_TRUE = @HAVE_AA_TRUE@
HAVE_ALSA09_FALSE = @HAVE_ALSA09_FALSE@
HAVE_ALSA09_TRUE = @HAVE_ALSA09_TRUE@
HAVE_ALSA_FALSE = @HAVE_ALSA_FALSE@
HAVE_ALSA_TRUE = @HAVE_ALSA_TRUE@
HAVE_ARMV4L_FALSE = @HAVE_ARMV4L_FALSE@
HAVE_ARMV4L_TRUE = @HAVE_ARMV4L_TRUE@
HAVE_ARTS_FALSE = @HAVE_ARTS_FALSE@
HAVE_ARTS_TRUE = @HAVE_ARTS_TRUE@
HAVE_BSDI_CDROM = @HAVE_BSDI_CDROM@
HAVE_CACA_FALSE = @HAVE_CACA_FALSE@
HAVE_CACA_TRUE = @HAVE_CACA_TRUE@
HAVE_CDROM_IOCTLS_FALSE = @HAVE_CDROM_IOCTLS_FALSE@
HAVE_CDROM_IOCTLS_TRUE = @HAVE_CDROM_IOCTLS_TRUE@
HAVE_COREAUDIO_FALSE = @HAVE_COREAUDIO_FALSE@
HAVE_COREAUDIO_TRUE = @HAVE_COREAUDIO_TRUE@
HAVE_DARWIN_CDROM = @HAVE_DARWIN_CDROM@
HAVE_DIRECTFB_FALSE = @HAVE_DIRECTFB_FALSE@
HAVE_DIRECTFB_TRUE = @HAVE_DIRECTFB_TRUE@
HAVE_DIRECTX_FALSE = @HAVE_DIRECTX_FALSE@
HAVE_DIRECTX_TRUE = @HAVE_DIRECTX_TRUE@
HAVE_DVDNAV_FALSE = @HAVE_DVDNAV_FALSE@
HAVE_DVDNAV_TRUE = @HAVE_DVDNAV_TRUE@
HAVE_DXR3_FALSE = @HAVE_DXR3_FALSE@
HAVE_DXR3_TRUE = @HAVE_DXR3_TRUE@
HAVE_ESD_FALSE = @HAVE_ESD_FALSE@
HAVE_ESD_TRUE = @HAVE_ESD_TRUE@
HAVE_FB_FALSE = @HAVE_FB_FALSE@
HAVE_FB_TRUE = @HAVE_FB_TRUE@
HAVE_FFMMX_FALSE = @HAVE_FFMMX_FALSE@
HAVE_FFMMX_TRUE = @HAVE_FFMMX_TRUE@
HAVE_FFMPEG_FALSE = @HAVE_FFMPEG_FALSE@
HAVE_FFMPEG_TRUE = @HAVE_FFMPEG_TRUE@
HAVE_FIG2DEV_FALSE = @HAVE_FIG2DEV_FALSE@
HAVE_FIG2DEV_TRUE = @HAVE_FIG2DEV_TRUE@
HAVE_FLAC_FALSE = @HAVE_FLAC_FALSE@
HAVE_FLAC_TRUE = @HAVE_FLAC_TRUE@
HAVE_FREEBSD_CDROM = @HAVE_FREEBSD_CDROM@
HAVE_GNOME_VFS_FALSE = @HAVE_GNOME_VFS_FALSE@
HAVE_GNOME_VFS_TRUE = @HAVE_GNOME_VFS_TRUE@
HAVE_IRIXAL_FALSE = @HAVE_IRIXAL_FALSE@
HAVE_IRIXAL_TRUE = @HAVE_IRIXAL_TRUE@
HAVE_LIBFAME_FALSE = @HAVE_LIBFAME_FALSE@
HAVE_LIBFAME_TRUE = @HAVE_LIBFAME_TRUE@
HAVE_LIBMNG_FALSE = @HAVE_LIBMNG_FALSE@
HAVE_LIBMNG_TRUE = @HAVE_LIBMNG_TRUE@
HAVE_LIBPNG_FALSE = @HAVE_LIBPNG_FALSE@
HAVE_LIBPNG_TRUE = @HAVE_LIBPNG_TRUE@
HAVE_LIBRTE_FALSE = @HAVE_LIBRTE_FALSE@
HAVE_LIBRTE_TRUE = @HAVE_LIBRTE_TRUE@
HAVE_LIBSMBCLIENT_FALSE = @HAVE_LIBSMBCLIENT_FALSE@
HAVE_LIBSMBCLIENT_TRUE = @HAVE_LIBSMBCLIENT_TRUE@
HAVE_LINUX_CDROM = @HAVE_LINUX_CDROM@
HAVE_LINUX_FALSE = @HAVE_LINUX_FALSE@
HAVE_LINUX_TRUE = @HAVE_LINUX_TRUE@
HAVE_MACOSX_VIDEO_FALSE = @HAVE_MACOSX_VIDEO_FALSE@
HAVE_MACOSX_VIDEO_TRUE = @HAVE_MACOSX_VIDEO_TRUE@
HAVE_MLIB_FALSE = @HAVE_MLIB_FALSE@
HAVE_MLIB_TRUE = @HAVE_MLIB_TRUE@
HAVE_OPENGL_FALSE = @HAVE_OPENGL_FALSE@
HAVE_OPENGL_TRUE = @HAVE_OPENGL_TRUE@
HAVE_OSS_FALSE = @HAVE_OSS_FALSE@
HAVE_OSS_TRUE = @HAVE_OSS_TRUE@
HAVE_POLYPAUDIO_FALSE = @HAVE_POLYPAUDIO_FALSE@
HAVE_POLYPAUDIO_TRUE = @HAVE_POLYPAUDIO_TRUE@
HAVE_SDL_FALSE = @HAVE_SDL_FALSE@
HAVE_SDL_TRUE = @HAVE_SDL_TRUE@
HAVE_SGMLTOOLS_FALSE = @HAVE_SGMLTOOLS_FALSE@
HAVE_SGMLTOOLS_TRUE = @HAVE_SGMLTOOLS_TRUE@
HAVE_SOLARIS_CDROM = @HAVE_SOLARIS_CDROM@
HAVE_SPEEX_FALSE = @HAVE_SPEEX_FALSE@
HAVE_SPEEX_TRUE = @HAVE_SPEEX_TRUE@
HAVE_STK_FALSE = @HAVE_STK_FALSE@
HAVE_STK_TRUE = @HAVE_STK_TRUE@
HAVE_SUNAUDIO_FALSE = @HAVE_SUNAUDIO_FALSE@
HAVE_SUNAUDIO_TRUE = @HAVE_SUNAUDIO_TRUE@
HAVE_SUNDGA_FALSE = @HAVE_SUNDGA_FALSE@
HAVE_SUNDGA_TRUE = @HAVE_SUNDGA_TRUE@
HAVE_SUNFB_FALSE = @HAVE_SUNFB_FALSE@
HAVE_SUNFB_TRUE = @HAVE_SUNFB_TRUE@
HAVE_SYNCFB_FALSE = @HAVE_SYNCFB_FALSE@
HAVE_SYNCFB_TRUE = @HAVE_SYNCFB_TRUE@
HAVE_THEORA_FALSE = @HAVE_THEORA_FALSE@
HAVE_THEORA_TRUE = @HAVE_THEORA_TRUE@
HAVE_V4L_FALSE = @HAVE_V4L_FALSE@
HAVE_V4L_TRUE = @HAVE_V4L_TRUE@
HAVE_VCDNAV_FALSE = @HAVE_VCDNAV_FALSE@
HAVE_VCDNAV_TRUE = @HAVE_VCDNAV_TRUE@
HAVE_VIDIX_FALSE = @HAVE_VIDIX_FALSE@
HAVE_VIDIX_TRUE = @HAVE_VIDIX_TRUE@
HAVE_VLDXVMC_FALSE = @HAVE_VLDXVMC_FALSE@
HAVE_VLDXVMC_TRUE = @HAVE_VLDXVMC_TRUE@
HAVE_VORBIS_FALSE = @HAVE_VORBIS_FALSE@
HAVE_VORBIS_TRUE = @HAVE_VORBIS_TRUE@
HAVE_W32DLL_FALSE = @HAVE_W32DLL_FALSE@
HAVE_W32DLL_TRUE = @HAVE_W32DLL_TRUE@
HAVE_WIN32_CDROM = @HAVE_WIN32_CDROM@
HAVE_X11_FALSE = @HAVE_X11_FALSE@
HAVE_X11_TRUE = @HAVE_X11_TRUE@
HAVE_XVMC_FALSE = @HAVE_XVMC_FALSE@
HAVE_XVMC_TRUE = @HAVE_XVMC_TRUE@
HAVE_XV_FALSE = @HAVE_XV_FALSE@
HAVE_XV_TRUE = @HAVE_XV_TRUE@
HAVE_XXMC_FALSE = @HAVE_XXMC_FALSE@
HAVE_XXMC_TRUE = @HAVE_XXMC_TRUE@
HAVE_ZLIB_FALSE = @HAVE_ZLIB_FALSE@
HAVE_ZLIB_TRUE = @HAVE_ZLIB_TRUE@
HOST_OS_DARWIN_FALSE = @HOST_OS_DARWIN_FALSE@
HOST_OS_DARWIN_TRUE = @HOST_OS_DARWIN_TRUE@
INCLUDED_INTL_FALSE = @INCLUDED_INTL_FALSE@
INCLUDED_INTL_TRUE = @INCLUDED_INTL_TRUE@
INCLUDES = @INCLUDES@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_M4_FALSE = @INSTALL_M4_FALSE@
INSTALL_M4_TRUE = @INSTALL_M4_TRUE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLDIR = @INTLDIR@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
IRIXAL_CFLAGS = @IRIXAL_CFLAGS@
IRIXAL_LIBS = @IRIXAL_LIBS@
IRIXAL_STATIC_LIB = @IRIXAL_STATIC_LIB@
KSTAT_LIBS = @KSTAT_LIBS@
LDFLAGS = @LDFLAGS@
LIBCDIO_CFLAGS = @LIBCDIO_CFLAGS@
LIBCDIO_LIBS = @LIBCDIO_LIBS@
LIBFAME_CFLAGS = @LIBFAME_CFLAGS@
LIBFAME_CONFIG = @LIBFAME_CONFIG@
LIBFAME_LIBS = @LIBFAME_LIBS@
LIBFFMPEG_CFLAGS = @LIBFFMPEG_CFLAGS@
LIBFLAC_CFLAGS = @LIBFLAC_CFLAGS@
LIBFLAC_LIBS = @LIBFLAC_LIBS@
LIBICONV = @LIBICONV@
LIBISO9660_LIBS = @LIBISO9660_LIBS@
LIBMODPLUG_CFLAGS = @LIBMODPLUG_CFLAGS@
LIBMODPLUG_LIBS = @LIBMODPLUG_LIBS@
LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
LIBNAME = @LIBNAME@
LIBOBJS = @LIBOBJS@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBSMBCLIENT_LIBS = @LIBSMBCLIENT_LIBS@
LIBSTK_CFLAGS = @LIBSTK_CFLAGS@
LIBSTK_LIBS = @LIBSTK_LIBS@
LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIBVCDINFO_LIBS = @LIBVCDINFO_LIBS@
LIBVCD_CFLAGS = @LIBVCD_CFLAGS@
LIBVCD_LIBS = @LIBVCD_LIBS@
LIBVCD_SYSDEP = @LIBVCD_SYSDEP@
LINUX_CDROM_TIMEOUT = @LINUX_CDROM_TIMEOUT@
LINUX_INCLUDE = @LINUX_INCLUDE@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_REVISION = @LT_REVISION@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MKNOD = @MKNOD@
MLIB_CFLAGS = @MLIB_CFLAGS@
MLIB_LIBS = @MLIB_LIBS@
MNG_LIBS = @MNG_LIBS@
MSGFMT = @MSGFMT@
NET_LIBS = @NET_LIBS@
OBJC = @OBJC@
OBJCDEPMODE = @OBJCDEPMODE@
OBJCFLAGS = @OBJCFLAGS@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OGG_CFLAGS = @OGG_CFLAGS@
OGG_LIBS = @OGG_LIBS@
OPENGL_CFLAGS = @OPENGL_CFLAGS@
OPENGL_LIBS = @OPENGL_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PASS1_CFLAGS = @PASS1_CFLAGS@
PASS2_CFLAGS = @PASS2_CFLAGS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PNG_CFLAGS = @PNG_CFLAGS@
PNG_LIBS = @PNG_LIBS@
POFILES = @POFILES@
POLYPAUDIO_CFLAGS = @POLYPAUDIO_CFLAGS@
POLYPAUDIO_LIBS = @POLYPAUDIO_LIBS@
POSUB = @POSUB@
PPC_ARCH_FALSE = @PPC_ARCH_FALSE@
PPC_ARCH_TRUE = @PPC_ARCH_TRUE@
RANLIB = @RANLIB@
RT_LIBS = @RT_LIBS@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SGMLTOOLS = @SGMLTOOLS@
SHELL = @SHELL@
SPEC_VERSION = @SPEC_VERSION@
SPEEX_CFLAGS = @SPEEX_CFLAGS@
SPEEX_LIBS = @SPEEX_LIBS@
STATIC = @STATIC@
STRIP = @STRIP@
SUNDGA_CFLAGS = @SUNDGA_CFLAGS@
SUNDGA_LIBS = @SUNDGA_LIBS@
TAR_NAME = @TAR_NAME@
THEORAENC_LIBS = @THEORAENC_LIBS@
THEORAFILE_LIBS = @THEORAFILE_LIBS@
THEORA_CFLAGS = @THEORA_CFLAGS@
THEORA_LIBS = @THEORA_LIBS@
THREAD_CFLAGS = @THREAD_CFLAGS@
THREAD_CFLAGS_CONFIG = @THREAD_CFLAGS_CONFIG@
THREAD_INCLUDES = @THREAD_INCLUDES@
THREAD_LIBS = @THREAD_LIBS@
THREAD_LIBS_CONFIG = @THREAD_LIBS_CONFIG@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VORBISENC_LIBS = @VORBISENC_LIBS@
VORBISFILE_LIBS = @VORBISFILE_LIBS@
VORBIS_CFLAGS = @VORBIS_CFLAGS@
VORBIS_LIBS = @VORBIS_LIBS@
W32DLL_DEP = @W32DLL_DEP@
W32_NO_OPTIMIZE = @W32_NO_OPTIMIZE@
WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
WIN32_FALSE = @WIN32_FALSE@
WIN32_TRUE = @WIN32_TRUE@
XGETTEXT = @XGETTEXT@
XINE_ACFLAGS = @XINE_ACFLAGS@
XINE_BIN_AGE = @XINE_BIN_AGE@
XINE_BUILD_CC = @XINE_BUILD_CC@
XINE_BUILD_DATE = @XINE_BUILD_DATE@
XINE_BUILD_OS = @XINE_BUILD_OS@
XINE_CONFIG_PREFIX = @XINE_CONFIG_PREFIX@
XINE_DATADIR = @XINE_DATADIR@
XINE_FONTDIR = @XINE_FONTDIR@
XINE_FONTPATH = @XINE_FONTPATH@
XINE_IFACE_AGE = @XINE_IFACE_AGE@
XINE_LOCALEDIR = @XINE_LOCALEDIR@
XINE_LOCALEPATH = @XINE_LOCALEPATH@
XINE_MAJOR = @XINE_MAJOR@
XINE_MINOR = @XINE_MINOR@
XINE_PLUGINDIR = @XINE_PLUGINDIR@
XINE_PLUGINPATH = @XINE_PLUGINPATH@
XINE_PLUGIN_MIN_SYMS = @XINE_PLUGIN_MIN_SYMS@
XINE_SCRIPTPATH = @XINE_SCRIPTPATH@
XINE_SUB = @XINE_SUB@
XVMC_LIB = @XVMC_LIB@
XV_LIB = @XV_LIB@
XXMC_LIB = @XXMC_LIB@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ZLIB_INCLUDES = @ZLIB_INCLUDES@
ZLIB_LIBS = @ZLIB_LIBS@
ZLIB_LIBS_CONFIG = @ZLIB_LIBS_CONFIG@
ac_ct_AR = @ac_ct_AR@
ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
ac_ct_F77 = @ac_ct_F77@
ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__fastdepOBJC_FALSE = @am__fastdepOBJC_FALSE@
am__fastdepOBJC_TRUE = @am__fastdepOBJC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
w32_path = @w32_path@
XINE_LIB = $(top_builddir)/src/xine-engine/libxine.la
EXTRA_DIST = \
             video_window.h \
             XineOpenGLView.m \
             XineOpenGLView.h \
             XineVideoWindow.m \
             XineVideoWindow.h

@HAVE_MACOSX_VIDEO_TRUE@lib_LTLIBRARIES = libxineMacOSXVideo.la
@HAVE_MACOSX_VIDEO_TRUE@libxineMacOSXVideo_la_SOURCES = XineOpenGLView.m XineVideoWindow.m
# The "-Wl,-framework -Wl,..." is needed for libtool versions before
# 1.5.x (1.257): the default version that ships with Mac OS X is 1.5 (1.1220)
@HAVE_MACOSX_VIDEO_TRUE@libxineMacOSXVideo_la_LDFLAGS = -version-info \
@HAVE_MACOSX_VIDEO_TRUE@	$(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
@HAVE_MACOSX_VIDEO_TRUE@	-Wl,-framework -Wl,Cocoa -framework Cocoa \
@HAVE_MACOSX_VIDEO_TRUE@	-Wl,-framework -Wl,OpenGL -framework OpenGL

@HAVE_MACOSX_VIDEO_TRUE@libxine_MacOSXVideo_la_OBJCFLAGS = $(OBJCFLAGS)
@HAVE_MACOSX_VIDEO_TRUE@include_HEADERS = video_window.h XineOpenGLView.h XineVideoWindow.h
all: all-am

.SUFFIXES:
.SUFFIXES: .lo .m .o .obj
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/misc/Makefile.common $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/video_out/macosx/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  src/video_out/macosx/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure:  $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
	    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
	  else :; fi; \
	done

uninstall-libLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
	done

clean-libLTLIBRARIES:
	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
libxineMacOSXVideo.la: $(libxineMacOSXVideo_la_OBJECTS) $(libxineMacOSXVideo_la_DEPENDENCIES) 
	$(OBJCLINK) $(am_libxineMacOSXVideo_la_rpath) $(libxineMacOSXVideo_la_LDFLAGS) $(libxineMacOSXVideo_la_OBJECTS) $(libxineMacOSXVideo_la_LIBADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XineOpenGLView.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XineVideoWindow.Plo@am__quote@

.m.o:
@am__fastdepOBJC_TRUE@	if $(OBJCCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepOBJC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepOBJC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepOBJC_FALSE@	DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepOBJC_FALSE@	$(OBJCCOMPILE) -c -o $@ $<

.m.obj:
@am__fastdepOBJC_TRUE@	if $(OBJCCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepOBJC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepOBJC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepOBJC_FALSE@	DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepOBJC_FALSE@	$(OBJCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`

.m.lo:
@am__fastdepOBJC_TRUE@	if $(LTOBJCCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepOBJC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepOBJC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepOBJC_FALSE@	DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepOBJC_FALSE@	$(LTOBJCCOMPILE) -c -o $@ $<

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

distclean-libtool:
	-rm -f libtool
uninstall-info-am:

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '    { files[$$0] = 1; } \
	       END { for (i in files) print i; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '    { files[$$0] = 1; } \
	       END { for (i in files) print i; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '    { files[$$0] = 1; } \
	       END { for (i in files) print i; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	$(mkdir_p) $(distdir)/../../../misc
	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
	list='$(DISTFILES)'; for file in $$list; do \
	  case $$file in \
	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
	  esac; \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
	    dir="/$$dir"; \
	    $(mkdir_p) "$(distdir)$$dir"; \
	  else \
	    dir=''; \
	  fi; \
	  if test -d $$d/$$file; then \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
clean: clean-am

clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
	mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-libtool distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-includeHEADERS
	@$(NORMAL_INSTALL)
	$(MAKE) $(AM_MAKEFLAGS) install-data-hook

install-exec-am: install-libLTLIBRARIES

install-info: install-info-am

install-man:

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-includeHEADERS uninstall-info-am \
	uninstall-libLTLIBRARIES
	@$(NORMAL_INSTALL)
	$(MAKE) $(AM_MAKEFLAGS) uninstall-hook

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libLTLIBRARIES clean-libtool ctags distclean \
	distclean-compile distclean-generic distclean-libtool \
	distclean-tags distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am \
	install-data-hook install-exec install-exec-am \
	install-includeHEADERS install-info install-info-am \
	install-libLTLIBRARIES install-man install-strip installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags uninstall uninstall-am uninstall-hook \
	uninstall-includeHEADERS uninstall-info-am \
	uninstall-libLTLIBRARIES


$(XINE_LIB):
	@cd $(top_srcdir)/src/xine-engine && $(MAKE)

install-data-hook:
	@if test $$MAKELEVEL -le 4 ; then \
	  if test -x "$(top_srcdir)/post-install.sh" ; then \
	    $(top_srcdir)/post-install.sh ; \
	  fi \
	fi

pass1:
	@$(MAKE) MULTIPASS_CFLAGS="$(PASS1_CFLAGS)"

pass2:
	@$(MAKE) MULTIPASS_CFLAGS="$(PASS2_CFLAGS)"

debug:
	@$(MAKE) CFLAGS="$(DEBUG_CFLAGS)"

install-debug: debug
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
	@list='$(SUBDIRS)'; for subdir in $$list; do \
	  (cd $$subdir && $(MAKE) $@) || exit; \
	done;
	$(MAKE) $(AM_MAKEFLAGS) install-data-hook

install-includeHEADERS: $(include_HEADERS)
	@$(NORMAL_INSTALL)
	$(install_sh) -d $(DESTDIR)$(includedir)/xine
	@list='$(include_HEADERS)'; for p in $$list; do \
	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/xine/$$p"; \
	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/xine/$$p; \
	done

uninstall-includeHEADERS:
	@$(NORMAL_UNINSTALL)
	list='$(include_HEADERS)'; for p in $$list; do \
	  rm -f $(DESTDIR)$(includedir)/xine/$$p; \
	done

uninstall-hook:
	@if echo '$(libdir)' | egrep ^'$(XINE_PLUGINDIR)' >/dev/null; then \
	  list='$(lib_LTLIBRARIES)'; for p in $$list; do \
	    p="`echo $$p | sed -e 's/\.la$$/\.so/g;s|^.*/||'`"; \
	    echo " rm -f $(DESTDIR)$(libdir)/$$p"; \
	    rm -f $(DESTDIR)$(libdir)/$$p; \
	  done; \
	fi

mostlyclean-generic:
	-rm -f *~ \#* .*~ .\#*

maintainer-clean-generic:
	-@echo "This command is intended for maintainers to use;"
	-@echo "it deletes files that may require special tools to rebuild."
	-rm -f Makefile.in
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

--- NEW FILE: XineOpenGLView.m ---
/*
 * Copyright (C) 2004 the xine project
 *
 * This file is part of xine, a free video player.
 *
 * xine is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * xine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
 *
 */


/*
#define LOG
*/

#import <Cocoa/Cocoa.h>
#import <OpenGL/OpenGL.h>
#import <OpenGL/gl.h>
#import <OpenGL/glext.h>

#import "XineOpenGLView.h"

#ifdef XINE_COMPILE
#  include "xineutils.h"
#else
#  include <xine/xineutils.h>
#endif


NSString *XineViewDidResizeNotification = @"XineViewDidResizeNotification";


/* XineOpenGLView delegate methods */

@protocol XineOpenGLViewDelegate

- (void) mouseDown:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView;
- (void) mouseMoved:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView;
- (void) otherMouseDown:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView;
- (void) rightMouseDown:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView;
- (NSSize) xineViewWillResize:(NSSize)oldSize toSize:(NSSize)proposedSize;
- (void) xineViewDidResize:(NSNotification *)note;

@end


static uint32_t NSColorToYUV (NSColor *color);


@implementation XineOpenGLView

- (void) setKeepsVideoAspectRatio:(BOOL)flag
{
    keepsVideoAspectRatio = flag;
}

- (BOOL) keepsVideoAspectRatio
{
    return keepsVideoAspectRatio;
}

- (void) setResizeViewOnVideoSizeChange:(BOOL)flag
{
    resizeViewOnVideoSizeChange = flag;
}

- (BOOL) resizeViewOnVideoSizeChange
{
    return resizeViewOnVideoSizeChange;
}

- (BOOL)mouseDownCanMoveWindow
{
    return YES;
}

- (void)passEventToDelegate:(NSEvent *)theEvent withSelector:(SEL)selector
{
    NSPoint point = [self convertPoint:[theEvent locationInWindow]
                              fromView:nil];
    
    if (!NSMouseInRect(point, [self bounds], [self isFlipped])) return;
    
    if ([delegate respondsToSelector:selector])
    {
        [delegate performSelector:selector
                       withObject:theEvent
                       withObject:self];
        return;
    }
    
    if ([_xineController respondsToSelector:selector])
    {
        [_xineController performSelector:selector
                              withObject:theEvent
                              withObject:self];
        return;
    }
}

- (void)mouseMoved:(NSEvent *)theEvent
{
    [self passEventToDelegate:theEvent
                 withSelector:@selector(mouseMoved:inXineView:)];
    
    [super mouseMoved:theEvent];
}

- (void)mouseDown:(NSEvent *)theEvent
{
    [self passEventToDelegate:theEvent
                 withSelector:@selector(mouseDown:inXineView:)];
    
    [super mouseDown:theEvent];
}

- (void)rightMouseDown:(NSEvent *)theEvent
{
    [self passEventToDelegate:theEvent
                 withSelector:@selector(rightMouseDown:inXineView:)];
    
    [super rightMouseDown:theEvent];
}

- (void)otherMouseDown:(NSEvent *)theEvent
{
    [self passEventToDelegate:theEvent
                 withSelector:@selector(otherMouseDown:inXineView:)];
    
    [super otherMouseDown:theEvent];
}

- (NSSize)videoSize
{
    return NSMakeSize(video_width, video_height);
}

- (void) displayTexture {
    if ([self lockFocusIfCanDraw])
    {
        [self drawRect: [self bounds]];
        [self reloadTexture];
        [self unlockFocus];
    }
}

- (id) initWithFrame: (NSRect) frame
{
    NSOpenGLPixelFormatAttribute attribs[] = {
        NSOpenGLPFAAccelerated,
        NSOpenGLPFANoRecovery,
        NSOpenGLPFADoubleBuffer,
        NSOpenGLPFAColorSize, 24,
        NSOpenGLPFAAlphaSize, 8,
        NSOpenGLPFADepthSize, 24,
        NSOpenGLPFAWindow,
        0
    };
    
    NSOpenGLPixelFormat * fmt = [[NSOpenGLPixelFormat alloc]
        initWithAttributes: attribs];
    
    if (!fmt)
    {
        NSLog (@"Cannot create NSOpenGLPixelFormat\n");
        return nil;
    }
    
    self = [super initWithFrame:frame pixelFormat:fmt];
    
    currentContext = [self openGLContext];
    [currentContext makeCurrentContext];
    [mutex lock];
    [currentContext update];
    [mutex unlock];
    
    i_texture       = 0;
    initDone        = NO;
    isFullScreen    = NO;
    video_width     = frame.size.width;
    video_height    = frame.size.height;
    texture_buffer  = nil;
    mutex           = [[NSLock alloc] init];
    currentCursor   = [[NSCursor arrowCursor] retain];
    initialColor    = nil;
    initialColorYUV = 0;
    initialColorYUVIsSet = NO;
    _xineController = nil;
    
    [self initTextures];
    
    /* Set GL_COLOR_BUFFER_BIT to black */
    glClearColor (0.0, 0.0, 0.0, 0.0);

#ifdef LOG
    NSLog(@"XineOpenGLView: initWithFrame called");
#endif
    
    return self;
}

- (void) awakeFromNib
{
#ifdef LOG
    NSLog(@"XineOpenGLView: awakeFromNib called");
#endif
}

- (id) initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    
    self = [self initWithFrame:[self frame]];
    
    if ([coder allowsKeyedCoding])
    {
        keepsVideoAspectRatio = [coder decodeBoolForKey:@"keepsVideoAspectRatio"];
        resizeViewOnVideoSizeChange = [coder decodeBoolForKey:
            @"resizeViewOnVideoSizeChange"];

        NSColor *color = [coder decodeObjectForKey:@"initialColor"];
        if (color)
            initialColor = [color copy];
    }
    else
    {
        /* Must decode values in the same order as encodeWithCoder: */
        [coder decodeValueOfObjCType:@encode(BOOL) at:&keepsVideoAspectRatio];
        [coder decodeValueOfObjCType:@encode(BOOL) at:&resizeViewOnVideoSizeChange];

        NSColor *color = [coder decodeObject];
        if (color)
            initialColor = [color copy];
    }

    [self initTextures];

#ifdef LOG
    NSLog(@"XineOpenGLView: initWithCoder called");
#endif
    
    return self;
}

- (void) encodeWithCoder:(NSCoder *)coder
{
    [super encodeWithCoder:coder];
    
    if ([coder allowsKeyedCoding])
    {
        [coder encodeBool:keepsVideoAspectRatio forKey:@"keepsVideoAspectRatio"];
        [coder encodeBool:resizeViewOnVideoSizeChange
                   forKey:@"resizeViewOnVideoSizeChange"];
        [coder encodeObject:initialColor forKey:@"initialColor"];
    }
    else
    {
        [coder encodeValueOfObjCType:@encode(BOOL) at:&keepsVideoAspectRatio];
        [coder encodeValueOfObjCType:@encode(BOOL) at:&resizeViewOnVideoSizeChange];
        [coder encodeObject:initialColor];
    }
}

- (void) dealloc {
    if (texture_buffer)
        free (texture_buffer);
    
    if (fullScreenContext)
    {
        [NSOpenGLContext clearCurrentContext];
        [mutex lock];
        [fullScreenContext clearDrawable];
        [fullScreenContext release];
        [mutex unlock];
        if (currentContext == fullScreenContext) currentContext = nil;
        fullScreenContext = nil;
    }
    
    if (currentContext)
    {
        [NSOpenGLContext clearCurrentContext];
        [mutex lock];
        [currentContext clearDrawable];
        [currentContext release];
        [mutex unlock];
        currentContext = nil;
    }
    
    [mutex dealloc];

    if (currentCursor)
    {
        [currentCursor release];
        currentCursor = NULL;
    }

    if (initialColor)
    {
        [initialColor release];
        initialColor = NULL;
    }

    // Enabling the [super dealloc] below (which should be correct behaviour)
    // crashes -- not sure why ...
    //
    // [super dealloc];
    //
    // Maybe dealloc in main thread?
}

- (void) reshape
{
    [mutex lock];
    
    if (!initDone)
    {
        [mutex unlock];
        return;
    }
    
    [currentContext makeCurrentContext];
    
    NSRect bounds = [self bounds];
    glViewport (0, 0, bounds.size.width, bounds.size.height);
    
#ifdef LOG
    NSLog(@"XineOpenGLView: Reshape: %x%x%x%x%x%x%x%x",
          texture_buffer[0],
          texture_buffer[1],
          texture_buffer[2],
          texture_buffer[3],
          texture_buffer[4],
          texture_buffer[5],
          texture_buffer[6],
          texture_buffer[7]
    );
#endif

    [mutex unlock];
}

- (void) setNormalSize
{
    NSSize size;
    
    if (isFullScreen)
        return;
    
    size.width = video_width;
    size.height = video_height;
    
    [self setViewSizeInMainThread:size];
}

- (void) setHalfSize
{
    NSSize size;
    
    if (isFullScreen)
        return;
    
    size.width = video_width / 2;
    size.height = video_height / 2;
    
    [self setViewSizeInMainThread:size];
}

- (void) setDoubleSize
{
    NSSize size;
    
    if (isFullScreen)
        return;
    
    size.width = video_width * 2;
    size.height = video_height * 2;
    
    [self setViewSizeInMainThread:size];
}

- (void) initTextures
{
    [mutex lock];
    
    [currentContext makeCurrentContext];
    
    /* Free previous texture if any */
    if (i_texture)
        glDeleteTextures (1, &i_texture);
    
    if (texture_buffer)
    {
        texture_buffer = realloc (texture_buffer, sizeof (char) *
                                  video_width * video_height * 3);
    }
    else
    {
        texture_buffer = malloc (sizeof (char) *
                                 video_width * video_height * 3);

        {
            // There _has_ to be a better way of doing this ...

            uint32_t *p, *q;
            p = (uint32_t *) texture_buffer;
            q = (uint32_t *) (char *) (texture_buffer + (sizeof(char) * video_width * video_height * 3));

            for (; p < q; p++) *p = initialColorYUV;
        }

    }

    if (!initialColorYUVIsSet && initialColor)
    {
        initialColorYUV = NSColorToYUV(initialColor);
        initialColorYUVIsSet = YES;
    }

    /* Create textures */
    glGenTextures (1, &i_texture);
    
    glEnable (GL_TEXTURE_RECTANGLE_EXT);
    glEnable (GL_UNPACK_CLIENT_STORAGE_APPLE);
    
    glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
    glPixelStorei (GL_UNPACK_ROW_LENGTH, video_width);
    
    glBindTexture (GL_TEXTURE_RECTANGLE_EXT, i_texture);
    glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    
    /* Use VRAM texturing */
    glTexParameteri (GL_TEXTURE_RECTANGLE_EXT,
                     GL_TEXTURE_STORAGE_HINT_APPLE, GL_STORAGE_CACHED_APPLE);
    
    /* Tell the driver not to make a copy of the texture but to use
        our buffer */
    glPixelStorei (GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE);
    
    /* Linear interpolation */
    glTexParameteri (GL_TEXTURE_RECTANGLE_EXT,
                     GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri (GL_TEXTURE_RECTANGLE_EXT,
                     GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    
    /* I have no idea what this exactly does, but it seems to be
        necessary for scaling */
    glTexParameteri (GL_TEXTURE_RECTANGLE_EXT,
                     GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri (GL_TEXTURE_RECTANGLE_EXT,
                     GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    
    glTexImage2D (GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA,
                  video_width, video_height, 0,
                  GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE,
                  texture_buffer);
    
    initDone = YES;
    [mutex unlock];

#ifdef LOG
    NSLog(@"XineOpenGLView: initTextures called: %hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx",
          texture_buffer[0],
          texture_buffer[1],
          texture_buffer[2],
          texture_buffer[3],
          texture_buffer[4],
          texture_buffer[5],
          texture_buffer[6],
          texture_buffer[7]
    );
#endif
}

- (void) reloadTexture
{
    if (!initDone)
    {
        return;
    }
    
    [mutex lock];
    
    [currentContext makeCurrentContext];
    
    glBindTexture (GL_TEXTURE_RECTANGLE_EXT, i_texture);
    glPixelStorei (GL_UNPACK_ROW_LENGTH, video_width);
    
    // glTexSubImage2D is faster than glTexImage2D
    // http://developer.apple.com/samplecode/Sample_Code/Graphics_3D/TextureRange/MainOpenGLView.m.htm
    glTexSubImage2D (GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0,
                     video_width, video_height,
                     GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE,
                     texture_buffer);
    
    [mutex unlock];

#ifdef LOG
    NSLog(@"reloadTexture called");
#endif
}

- (void) calcFullScreenAspect
{
    int fs_width, fs_height, x = 0, y = 0, w = 0, h = 0;
    
    fs_width = CGDisplayPixelsWide (kCGDirectMainDisplay);
    fs_height = CGDisplayPixelsHigh (kCGDirectMainDisplay);
    
    switch (fullscreen_mode) {
        case XINE_FULLSCREEN_OVERSCAN:
            if (((float) fs_width / (float) fs_height) > ((float) video_width / (float) video_height))
            {
                w = (float) video_width * ((float) fs_height / (float) video_height);
                h = fs_height;
                x = (fs_width - w) / 2;
                y = 0;
            }
            else
            {
                w = fs_width;
                h = (float) video_height * ((float) fs_width / (float) video_width);
                x = 0;
                y = (fs_height - h) / 2;
            }
            break;
            
        case XINE_FULLSCREEN_CROP:
            if (((float) fs_width / (float) fs_height) > ((float) video_width / (float) video_height))
            {
                w = fs_width;
                h = (float) video_height * ((float) fs_width / (float) video_width);
                x = 0;
                y = (fs_height - h) / 2;
            }
            else
            {
                w = (float) video_width * ((float) fs_height / (float) video_height);
                h = fs_height;
                x = (fs_width - w) / 2;
                y = 0;
            }
            break;
    }
    
    NSLog(@"MacOSX fullscreen mode: %dx%d => %dx%d @ %d,%d\n",
          video_width, video_height, w, h, x, y);
    
    [mutex lock];
    glViewport (x, y, w, h);
    [mutex unlock];
}

- (void) goFullScreen: (XineVideoWindowFullScreenMode) mode
{
    [mutex lock];
    
    /* Create the new pixel format */
    NSOpenGLPixelFormatAttribute attribs[] =
    {
        NSOpenGLPFAAccelerated,
        NSOpenGLPFANoRecovery,
        NSOpenGLPFADoubleBuffer,
        NSOpenGLPFAColorSize, 24,
        NSOpenGLPFAAlphaSize, 8,
        NSOpenGLPFADepthSize, 24,
        NSOpenGLPFAFullScreen,
        NSOpenGLPFAScreenMask,
        CGDisplayIDToOpenGLDisplayMask (kCGDirectMainDisplay),
        0
    };
    
    NSOpenGLPixelFormat * fmt = [[NSOpenGLPixelFormat alloc]
        initWithAttributes: attribs];
    
    if (!fmt)
    {
        NSLog (@"Cannot create NSOpenGLPixelFormat\n");
        return;
    }
    
    /* Create the new OpenGL context */
    fullScreenContext = [[NSOpenGLContext alloc]
        initWithFormat: fmt shareContext: nil];
    
    if (!fullScreenContext)
    {
        NSLog(@"Failed to create new NSOpenGLContext\n");
        return;
    }
    currentContext = fullScreenContext;
    
    /* Capture display, switch to fullscreen */
    if (CGCaptureAllDisplays() != CGDisplayNoErr)
    {
        NSLog(@"CGCaptureAllDisplays() failed\n");
        return;
    }
    
    [fullScreenContext setFullScreen];
    [fullScreenContext makeCurrentContext];
    [mutex unlock];
    
    fullscreen_mode = mode;
    
    [self initTextures];
    [self calcFullScreenAspect];
    
    /* Redraw the last picture */
    [self setNeedsDisplay: YES];
    
    isFullScreen = YES;
}

- (void) exitFullScreen
{
    initDone = NO;
    
    currentContext = [self openGLContext];
    
    /* Free current OpenGL context */
    [NSOpenGLContext clearCurrentContext];
    [mutex lock];
    [fullScreenContext clearDrawable];
    [mutex unlock];
    [fullScreenContext release];
    fullScreenContext = nil;
    CGReleaseAllDisplays();
    
    [self reshape];
    [self initTextures];
    
    /* Redraw the last picture */
    [self setNeedsDisplay: YES];
    
    isFullScreen = NO;
    initDone = YES;
}

- (void) drawQuad
{
    float f_x = 1.0, f_y = 1.0;
    
    glBegin (GL_QUADS);
    /* Top left */
    glTexCoord2f (0.0, 0.0);
    glVertex2f (-f_x, f_y);
    /* Bottom left */
    glTexCoord2f (0.0, (float) video_height);
    glVertex2f (-f_x, -f_y);
    /* Bottom right */
    glTexCoord2f ((float) video_width, (float) video_height);
    glVertex2f (f_x, -f_y);
    /* Top right */
    glTexCoord2f ((float) video_width, 0.0);
    glVertex2f (f_x, f_y);
    glEnd();
}

- (void) drawRect: (NSRect) rect
{
    [currentContext makeCurrentContext];
    
    if (!initDone)
        return;
    
    [mutex lock];
    
    // Swap buffers only during the vertical retrace of the monitor.
    // http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL/chap5/chapter_5_section_44.html
    
    long params[] = { 1 };
    CGLSetParameter (CGLGetCurrentContext(), kCGLCPSwapInterval, params);
    
    /* Draw */
    glBindTexture (GL_TEXTURE_RECTANGLE_EXT, i_texture);
    [self drawQuad];
    
    /* Wait for the job to be done */
    [currentContext flushBuffer];
    
    [mutex unlock];
}

- (char *) getTextureBuffer
{
    return texture_buffer;
}

- (void) setVideoSize:(NSSize)size
{
    video_width = size.width;
    video_height = size.height;
    
    if (resizeViewOnVideoSizeChange)
        [self setViewSizeInMainThread:size];
    
    [self initTextures];
}

- (void) setViewSizeInMainThread:(NSSize)size
{
    // Create an autorelease pool, since we're running in a xine thread that
    // may not have a pool of its own */
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
    NSValue *sizeWrapper = [NSValue valueWithBytes:&size
                                          objCType:@encode(NSSize)];
    
    [self performSelectorOnMainThread:@selector(setViewSize:)
                           withObject:sizeWrapper
                        waitUntilDone:NO];
    
#ifdef LOG
    NSLog(@"setViewSizeInMainThread called");
#endif
    
    [pool release];
}

- (void) setViewSize:(NSValue *)sizeWrapper
{
    NSSize proposedSize, newSize, currentSize;
    
    [sizeWrapper getValue:&proposedSize];
    newSize = proposedSize;
    
    currentSize = [self frame].size;
    if (proposedSize.width == currentSize.width &&
        proposedSize.height == currentSize.height)
    {
        return;
    }
    
    /* If our controller handles xineViewWillResize:toSize:, send the
        * message to him first.  Note that the delegate still has a chance
        * to override the controller's resize preference ... */
    if ([_xineController respondsToSelector:@selector(xineViewWillResize:toSize:)])
    {
        NSSize oldSize = [self frame].size;
        newSize = [_xineController xineViewWillResize:oldSize toSize:proposedSize];
    }
    
    /* If our delegate handles xineViewWillResize:toSize:, send the
        * message to him; otherwise, just resize ourselves */
    if ([delegate respondsToSelector:@selector(xineViewWillResize:toSize:)])
    {
        NSSize oldSize = [self frame].size;
        newSize = [delegate xineViewWillResize:oldSize toSize:proposedSize];
    }
    
    [self setFrameSize:newSize];
    [self setBoundsSize:newSize];
    
    /* Post a notification that we resized and also notify our controller */
    /* and delegate */
    NSNotification *note =
        [NSNotification notificationWithName:XineViewDidResizeNotification
                                      object:self];
    [[NSNotificationCenter defaultCenter] postNotification:note];
    
    if ([_xineController respondsToSelector:@selector(xineViewDidResize:)])
        [_xineController xineViewDidResize:note];
    
    if ([delegate respondsToSelector:@selector(xineViewDidResize:)])
        [delegate xineViewDidResize:note];
    
    if (isFullScreen)
        [self calcFullScreenAspect];
    
    [self initTextures];
}

- (BOOL) isFullScreen
{
    return isFullScreen;
}

- (id) delegate
{
    return delegate;
}

- (void) setDelegate:(id)aDelegate {
    delegate = aDelegate;
}

- (BOOL)acceptsFirstResponder {
    return YES;
}

- (void) setCurrentCursor:(NSCursor *)cursor
{
    currentCursor = cursor;
    [currentCursor retain];
    [self resetCursorRectsInMainThread];
}

- (NSCursor *) currentCursor
{
    return currentCursor;
}

- (void) resetCursorRectsInMainThread
{
    [self discardCursorRects];
    [self performSelectorOnMainThread:@selector(resetCursorRects)
                           withObject:nil
                        waitUntilDone:NO];
}

- (void) resetCursorRects
{
    [self addCursorRect:[self visibleRect] cursor:currentCursor];
    [currentCursor set];
}

- (void) setXineController:(id)controller
{
    [_xineController autorelease];
    _xineController = controller;
    [_xineController retain];
}

- (id) xineController
{
    return _xineController;
}

- (void) setInitialColor:(NSColor *)color
{
    [initialColor autorelease];
    initialColor = [color copy];
}

- (NSColor *) initialColor
{
    return initialColor;
}

@end /* XineOpenGLView */


static uint32_t NSColorToYUV (NSColor *color)
{
    float red, green, blue, alpha;
    unsigned char r, g, b;
    unsigned char y, u, v;
    uint32_t yuv;

    NSColor *calibratedColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
    [calibratedColor getRed:&red green:&green blue:&blue alpha:&alpha];

    r = red * 255;
    g = green * 255;
    b = blue * 255;

    init_yuv_conversion();

    y = COMPUTE_Y(r, g, b);
    u = COMPUTE_U(r, g, b);
    v = COMPUTE_V(r, g, b);

    yuv = y << 24 | u << 16 | y << 8 | v;

    return yuv;
}


--- NEW FILE: XineVideoWindow.m ---
/*
 * Copyright (C) 2004 the xine project
 *
 * This file is part of xine, a free video player.
 *
 * xine is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * xine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
 *
 * Written by Daniel Mack <xine@zonque.org>
 * 
 * Most parts of this code were taken from VLC, http://www.videolan.org
 * Thanks for the good research!
 */


#import "XineOpenGLView.h"
#import "XineVideoWindow.h"


#define DEFAULT_VIDEO_WINDOW_SIZE (NSMakeSize(320, 200))

@implementation XineVideoWindow

- (void) setContentSize: (NSSize) size
{
#ifdef LOG
    NSLog(@"setContent called with new size w:%d h:%d", size.width, size.height);
#endif
    [xineView setViewSizeInMainThread:size];
	
    [super setContentSize: size];
}

- (id) init
{
    return [self initWithContentSize:DEFAULT_VIDEO_WINDOW_SIZE];
}

- (id) initWithContentSize:(NSSize)size
{
    NSScreen *screen = [NSScreen mainScreen];
    NSSize screen_size = [screen frame].size;
    
    /* make a centered window */
    NSRect frame;
    frame.size = size;
    frame.origin.x = (screen_size.width - frame.size.width) / 2;
    frame.origin.y = (screen_size.height - frame.size.height) / 2;
	
    unsigned int style_mask = NSTitledWindowMask | NSMiniaturizableWindowMask |
        NSClosableWindowMask | NSResizableWindowMask;
	
    return ([self initWithContentRect:frame styleMask:style_mask
                              backing:NSBackingStoreBuffered defer:NO
                               screen:screen]);
}

- (id) initWithContentRect: (NSRect)rect 
				 styleMask:(unsigned int)styleMask 
				   backing:(NSBackingStoreType)bufferingType 
					 defer:(BOOL)flag 
					screen:(NSScreen *)aScreen
{
    self = [super initWithContentRect: rect
							styleMask: styleMask
							  backing: bufferingType
								defer: flag
							   screen: aScreen];
	
#ifdef LOG
    NSLog(@"initWithContentRect called with rect x:%d y:%d w:%d h:%d",
          rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
#endif
	
    xineView = [[XineOpenGLView alloc] initWithFrame:rect];
    [xineView setResizeViewOnVideoSizeChange:YES];
	
    /* receive notifications about window resizing from the xine view */
    NSNotificationCenter *noticeBoard = [NSNotificationCenter defaultCenter];
    [noticeBoard addObserver:self
                    selector:@selector(xineViewDidResize:)
                        name:XineViewDidResizeNotification
                      object:xineView];
	
    [self setContentView: xineView];
    [self setTitle: @"xine video output"];
	
    return self;
}

- (void) dealloc
{
    [xineView release];
    xineView = nil;
	
    [super dealloc];
}


- (XineOpenGLView *) xineView
{
    return xineView;
}

- (NSRect)windowWillUseStandardFrame:(NSWindow *)sender
                        defaultFrame:(NSRect)defaultFrame
{
    NSSize screen_size, video_size;
    NSRect standard_frame;
	
    if ([xineView isFullScreen])
        return defaultFrame;
	
    screen_size = defaultFrame.size;
    video_size = [xineView videoSize];
	
    if (screen_size.width / screen_size.height >
        video_size.width / video_size.height)
	{
        standard_frame.size.width  = video_size.width *
		(screen_size.height / video_size.height);
        standard_frame.size.height = screen_size.height;
    } 
	else
	{
        standard_frame.size.width  = screen_size.width;
        standard_frame.size.height = video_size.height *
			(screen_size.width / video_size.width);
    }
	
    standard_frame.origin.x =
        (screen_size.width - standard_frame.size.width) / 2;
    standard_frame.origin.y =
        (screen_size.height - standard_frame.size.height) / 2;
	
    return standard_frame;
}


/* Notifications */

- (void) xineViewDidResize:(NSNotification *)note
{
	NSRect frame = [self frame];
	frame.size = [[self contentView] frame].size;
	
	[self setFrame:[self frameRectForContentRect:frame] display:YES];
}

@end /* XineVideoWindow */


@implementation NSWindow (AspectRatioAdditions)

- (void) setKeepsAspectRatio: (BOOL) flag {
    if (flag) {
        NSSize size = [self frame].size;
        [self setAspectRatio:size];
    }
    else {
        [self setResizeIncrements:NSMakeSize(1.0, 1.0)];
    }
}

/* XXX: This is 100% untested ... */
- (BOOL) keepsAspectRatio {
    NSSize size = [self aspectRatio];
    if (size.width == 0 && size.height == 0)
        return false;
    else
        return true;
}

@end /* NSWindow (AspectRatioAdditions) */


--- NEW FILE: video_window.h ---
/*
 * Copyright (C) 2004 the xine project
 *
 * This file is part of xine, a free video player.
 *
 * xine is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * xine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
 *
 * Written by Daniel Mack <xine@zonque.org>
 * 
 * Most parts of this code were taken from VLC, http://www.videolan.org
 * Thanks for the good research!
 */


#ifndef HAVE_VIDEO_WINDOW_H
#define HAVE_VIDEO_WINDOW_H

#include "XineOpenGLView.h"
#include "XineVideoWindow.h"

#endif

--- NEW FILE: Makefile.am ---
include $(top_srcdir)/misc/Makefile.common

EXTRA_DIST = \
             video_window.h \
             XineOpenGLView.m \
             XineOpenGLView.h \
             XineVideoWindow.m \
             XineVideoWindow.h

if HAVE_MACOSX_VIDEO

lib_LTLIBRARIES = libxineMacOSXVideo.la

libxineMacOSXVideo_la_SOURCES = XineOpenGLView.m XineVideoWindow.m
# The "-Wl,-framework -Wl,..." is needed for libtool versions before
# 1.5.x (1.257): the default version that ships with Mac OS X is 1.5 (1.1220)
libxineMacOSXVideo_la_LDFLAGS = -version-info \
	$(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
	-Wl,-framework -Wl,Cocoa -framework Cocoa \
	-Wl,-framework -Wl,OpenGL -framework OpenGL
libxine_MacOSXVideo_la_OBJCFLAGS = $(OBJCFLAGS)

include_HEADERS = video_window.h XineOpenGLView.h XineVideoWindow.h

endif


--- NEW FILE: XineOpenGLView.h ---
/*
 * Copyright (C) 2004 the xine project
 *
 * This file is part of xine, a free video player.
 *
 * xine is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * xine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
 *
 */

#ifndef __HAVE_XINE_OPENGL_VIEW_H__
#define __HAVE_XINE_OPENGL_VIEW_H__

#import <Cocoa/Cocoa.h>

#import "XineVideoWindow.h"

@protocol XineOpenGLViewDelegate;

extern NSString *XineViewDidResizeNotification;

@interface XineOpenGLView : NSOpenGLView
{
    IBOutlet id <NSObject, XineOpenGLViewDelegate>  delegate;
    int                            video_width, video_height;
    char                          *texture_buffer;
    unsigned long                  i_texture;
    BOOL                           initDone;
    BOOL                           isFullScreen;
    XineVideoWindowFullScreenMode  fullscreen_mode;
    NSOpenGLContext               *fullScreenContext;
    NSOpenGLContext               *currentContext;
    NSLock                        *mutex;
    BOOL                           keepsVideoAspectRatio;
    BOOL                           resizeViewOnVideoSizeChange;
    NSCursor                      *currentCursor;
    id <NSObject, XineOpenGLViewDelegate>  _xineController;
    NSColor                       *initialColor;
    unsigned int                   initialColorYUV;
    BOOL                           initialColorYUVIsSet;
}

- (void) displayTexture;
- (void) drawQuad;
- (void) drawRect: (NSRect) rect;
- (void) goFullScreen: (XineVideoWindowFullScreenMode) mode;
- (void) exitFullScreen;
- (BOOL) isFullScreen;
- (void) reshape;
- (void) initTextures;
- (void) reloadTexture;
- (char *) getTextureBuffer;
- (void) setViewSizeInMainThread:(NSSize)size;
// TODO: replace set...Size below with setSize:(double)videoSizeMultiplier
- (void) setNormalSize;
- (void) setHalfSize;
- (void) setDoubleSize;
- (void) setResizeViewOnVideoSizeChange:(BOOL)flag;
- (BOOL) resizeViewOnVideoSizeChange;
- (void) resetCursorRectsInMainThread;

// Accessors
- (void) setVideoSize:(NSSize)size;
- (NSSize) videoSize;
- (void) setKeepsVideoAspectRatio:(BOOL)flag;
- (BOOL) keepsVideoAspectRatio;
- (void) setCurrentCursor:(NSCursor *)cursor;
- (NSCursor *) currentCursor;
- (void) setXineController:(id)controller;
- (id) xineController;
- (void) setInitialColor:(NSColor *)color;
- (NSColor *) initialColor;

// Delegate Methods
- (id) delegate;
- (void) setDelegate:(id)aDelegate;

@end

/* XineOpenGLView delegate methods */

@interface NSObject (XineOpenGLViewDelegate)

- (NSSize) xineViewWillResize:(NSSize)oldSize toSize:(NSSize)proposedSize;
- (void) xineViewDidResize:(NSNotification *)aNotification;
- (void) mouseDown:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView;
- (void) mouseMoved:(NSEvent *)theEvent inXineView:(XineOpenGLView *)theView;
- (void) otherMouseDown:(NSEvent *)theEvent
             inXineView:(XineOpenGLView *)theView;
- (void) rightMouseDown:(NSEvent *)theEvent
             inXineView:(XineOpenGLView *)theView;

@end

#endif /* __HAVE_XINE_OPENGL_VIEW_H__ */


--- NEW FILE: XineVideoWindow.h ---
/*
 * Copyright (C) 2004 the xine project
 *
 * This file is part of xine, a free video player.
 *
 * xine is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * xine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
 *
 */

#ifndef __HAVE_XINE_VIDEO_WINDOW_H__
#define __HAVE_XINE_VIDEO_WINDOW_H__


#import <Cocoa/Cocoa.h>


typedef enum
{
    XINE_FULLSCREEN_OVERSCAN,
    XINE_FULLSCREEN_CROP
} XineVideoWindowFullScreenMode;


@interface XineVideoWindow : NSWindow
{
    int                        width, height;
    id /* XineOpenGLView * */  xineView;
}

- (id) initWithContentSize:(NSSize)size;
- (id /* XineOpenGLView * */) xineView;

@end


/* NSWindow aspect ratio convenience methods */

@interface NSWindow (AspectRatioAdditions)

- (void) setKeepsAspectRatio:(BOOL)flag;
- (BOOL) keepsAspectRatio;

@end


#endif /* __HAVE_XINE_VIDEO_WINDOW_H__ */