Commit 422fe907 authored by Mike Gabriel's avatar Mike Gabriel

library clean-up: Drop nx-X11/lib/Xcursor. Not used at build time.

parent cfc0202b
Copyright © 2002 Keith Packard
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of Keith Packard not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. Keith Packard makes no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
2005-06-30 Daniel Stone <daniel@freedesktop.org>
* lib/Xcursor/file.c:
* lib/Xcursor/library.c:
* lib/Xcursor/xlib.c:
Check arguments for validity on almost all functions.
2005-06-17 Branden Robinson <branden@deadbeast.net>
Merge changes from freedesktop.org xorg CVS trunk.
* cursor.c:
* library.c:
Add preprocessor test for HAVE_XFIXES being defined before testing
its value. [merged by Egbert Eich; author unknown]
* COPYING:
* ChangeLog:
* Xcursor.3:
* Xcursor.h:
* cursor.c:
* display.c:
* file.c:
* library.c:
* xcursorint.h:
* xlib.c:
Encoding of numerous files changed to UTF-8 [Markus Kuhn]
* cursor.c:
Bug #1043: Fix leak when creating animated cursors. [Daniel Stone]
Tue Feb 8 14:26:32 2005 Owen Taylor <otaylor@redhat.com>
* configure.ac: Remove AC_CONFIG_AUX_DIR()
2004-04-13 Daniel Stone <daniel@freedesktop.org>
* ChangeLog:
Tag 1.1.3, for xlibs 1.0.1.
2004-04-07 Keith Packard <keithp@keithp.com>
reviewed by: Michel Dänzer <michel@daenzer.net>
* configure.ac:
Make sure X_CFLAGS/X_LIBS are substituted in the xcursor.pc file
2004-02-24 Fredrik Höglund <fredrik@kde.org>
* configure.ac:
* xcursorint.h:
Make the Xfixes code actually work by including the Xfixes.h
header file.
2004-02-03 Jim Gettys <jg@freedesktop.org>
* AUTHORS: Add contents to author's file
2004-01-17 Daniel Stone <daniel@fooishbar.org>
* Xcursor.h:
* configure.ac:
Bump package version to 1.1.2, slated for first fd.o platform release.
2004-01-15 Harold L Hunt II <huntharo@msu.edu>
* Makefile.am: Pass -no-undefined to libtool via LDFLAGS.
2003-11-10 Keith Packard <keithp@keithp.com>
* library.c: (_XcursorBuildThemeDir):
Make sure the allocated path has space for directory separators
2003-10-29 Keith Packard <keithp@keithp.com>
* Xcursor.h:
* configure.ac:
Bump package version to 1.1.1 and library info to 1.2.0 as
the library exports new name-based APIs and uses Xfixes
2003-10-28 Keith Packard <keithp@keithp.com>
* Makefile.am:
* Xcursor.h:
* configure.ac:
* cursor.c: (XcursorImagesLoadCursor):
* file.c: (XcursorImagesCreate), (XcursorImagesDestroy),
(XcursorImagesSetName):
* library.c: (XcursorLibraryLoadImages),
(XcursorLibraryLoadCursor):
Add support for XFixes version 2 cursor naming functions
2003-10-16 23:45 fredrik
* Xcursor-def.cpp, Xcursor.h, configure.ac, library.c:
Rename _XcursorLibraryPath() to XcursorLibraryPath() and make
it a public function, since it's useful for theme selectors.
Bump version to 1.1.0
2003-05-21 10:21 keithp
* Makefile.am, Xcursor.h, configure.ac, xcursorint.h: Package
Xcursor.3, bump version to 1.0.2
2003-05-06 11:20 keithp
* ChangeLog: Add initial change log
2003-05-06 11:09 keithp
* .cvsignore, Makefile.am, Xcursor-def.cpp, Xcursor.3, Xcursor.h,
Xcursor.man, cursor.c, display.c, file.c, library.c, xcursorint.h,
xlib.c: Update .cvsignore, move manual and install, fix CVS ident
lines
2003-05-06 11:00 keithp
* configure.ac: replace Xrender test with fragment from Xft
2003-05-06 10:52 keithp
* Makefile.am: Add xcursorint.h to library sources list
2003-05-06 10:49 keithp
* Imakefile, Makefile.am, Xcursor.h, autogen.sh, configure.ac,
file.c, xcursor.pc.in: Convert Xcursor to autotools
2003-02-21 22:16 dawes
* xlib.c: 941. Fix a problem where a malformed Ximage can cause
Xcursor to step
outside the image data (#A.1636, Keith Packard, reported by
Michel Dänzer).
2003-02-19 19:13 dawes
* display.c: 924. Fix a memory leak in XCloseDisplay, and a
potential race condition
when multiple threads attempt to initialize the Xcursor
library
simultaneously (#A.1623, Keith Packard).
2003-02-12 19:09 dawes
* Xcursor.man: 880. Fix the Xcursor include path in the man page
(#5617, Kevin Brosius).
2003-01-25 19:22 eich
* Xcursor.h, cursor.c, library.c, xcursorint.h: 787. Add "core"
theme to Xcursor to force old behaviour (Keith Packard).
2002-11-26 21:35 keithp
* display.c: Fix XcursorSetTheme to permit NULL theme
2002-11-22 18:34 keithp
* Xcursor.h, cursor.c, display.c, xcursorint.h, xlib.c: Add animate
cursor support, client side
2002-10-11 10:06 keithp
* cursor.c: Off by one in XcursorAnimateNext (from Anders Carlsson)
2002-09-30 15:02 alanh
* Xcursor-def.cpp: add Xv-def.cpp file add $XFree86$ tags
2002-09-26 00:52 alanh
* Imakefile: #elif -> #else
2002-09-25 16:27 alanh
* Xcursor-def.cpp: #5350, add Xcursor-def.cpp
2002-09-25 09:10 torrey
* Imakefile: Add SharedXcursorReqs for operating systems that
require it.
2002-09-18 10:11 tsi
* file.c: Pacify gcc 3.2
2002-09-05 00:55 keithp
* display.c: Clean up parsing of option that forces use of core
cursors
2002-09-05 00:29 keithp
* Xcursor.h, cursor.c, display.c, xcursorint.h, xlib.c: Add
themeable app-specific cursors. Add dithers for core cursors.
Dont theme servers without Render by default
2002-08-28 21:40 keithp
* Imakefile, Xcursor.h, Xcursor.man, config-subst, cursor.c,
display.c, file.c, library.c, xcursor-config.in, xcursor.pc.in,
xcursorint.h, xlib.c: Add Xcursor library and Xlib hooks for it
XCOMM $XdotOrg: xc/lib/Xcursor/Imakefile,v 1.5 2005/10/09 21:52:42 alanc Exp $
XCOMM $XFree86: xc/lib/Xcursor/Imakefile,v 1.3 2002/09/26 07:52:01 alanh Exp $
#ifndef NormalLibXcursor
#define NormalLibXcursor YES
SOXCURSORREV=1.0.2
#endif
#ifndef SharedLibXcursor
#define SharedLibXcursor YES
#endif
#define DoNormalLib NormalLibXcursor
#define DoSharedLib SharedLibXcursor
#define DoDebugLib DebugLibXcursor
#define DoProfileLib ProfileLibXcursor
#define LibName NX_Xcursor
#define SoRev SOXCURSORREV
#define IncSubdir X11
#define IncSubSubdir Xcursor
#include <Threads.tmpl>
#ifdef SharedXcursorReqs
REQUIREDLIBS = SharedXcursorReqs
#else
REQUIREDLIBS = $(LDPRELIB) $(XRENDERLIB)
#endif
XCURSOR_VERSION=1.1.4
XRENDER_LIBS=$(XRENDERLIB)
XRENDER_CFLAGS=$(XRENDERINCLUDES)
X_LIBS=-L$(SHLIBDIR) $(XONLYLIB)
X_CFLAGS=-I$(INCROOT) $(THREADS_DEFINES)
#if BuildRenderLibrary
XRENDER_LIBS=-L$(USRLIBDIR) $(XRENDERLIB)
XRENDER_CFLAGS=-I$(INCROOT)
#endif
#if BuildXfixesLibrary
XFIXES_DEFINES = -DHAVE_XFIXES
REQUIREDLIBS += $(XFIXESLIB)
#endif
RPATH_CFLAG = HardCodeLibdirFlag
ICONDIR=$(LIBDIR)/icons
DEFINES=-DICONDIR=\"$(ICONDIR)\" $(XFIXES_DEFINES)
SRCS = cursor.c display.c file.c library.c xlib.c
OBJS = cursor.o display.o file.o library.o xlib.o
HEADERS = Xcursor.h
SUBSTVARS=prefix="$(PROJECTROOT)" \
exec_prefix="$(BINDIR)" \
libdir="$(USRLIBDIR)" \
hardcode_libdir_flag_spec="$(RPATH_CFLAG)" \
includedir="$(INCROOT)" \
XRENDER_LIBS="$(XRENDER_LIBS)"\
XRENDER_CFLAGS="$(XRENDER_CFLAGS)"\
X_LIBS="$(X_LIBS)" \
X_CFLAGS="$(X_CFLAGS)" \
VERSION="$(XCURSOR_VERSION)"
#include <Library.tmpl>
MANSUFFIX=$(LIBMANSUFFIX)
InstallManPage(Xcursor,$(LIBMANDIR))
DependTarget()
all:: xcursor-config.script
xcursor-config.script: xcursor-config.in
RemoveFile($@)
sh config-subst $(SUBSTVARS) < xcursor-config.in > $@
InstallScript(xcursor-config,$(BINDIR))
clean::
RemoveFile(xcursor-config.script)
all:: xcursor.pc
xcursor.pc: xcursor.pc.in
RemoveFile($@)
sh config-subst $(SUBSTVARS) < xcursor.pc.in > $@
InstallNonExecFile(xcursor.pc,$(USRLIBDIR)/pkgconfig)
clean::
RemoveFile(xcursor.pc)
LIBRARY Xcursor
VERSION LIBRARY_VERSION
EXPORTS
XcursorAnimateCreate
XcursorAnimateDestroy
XcursorAnimateNext
XcursorCursorsCreate
XcursorCursorsDestroy
XcursorFilenameLoadCursor
XcursorFilenameLoadCursors
XcursorImageLoadCursor
XcursorImagesLoadCursors
XcursorLibraryLoadCursor
XcursorLibraryLoadCursors
XcursorShapeLoadCursor
XcursorShapeLoadCursors
_XcursorCreateGlyphCursor
XcursorGetDefaultSize
XcursorGetTheme
XcursorSetDefaultSize
XcursorSetTheme
XcursorSupportsARGB
_XcursorGetDisplayInfo
XcursorCommentCreate
XcursorCommentDestroy
XcursorCommentsCreate
XcursorCommentsDestroy
XcursorFileLoad
XcursorFileLoadAllImages
XcursorFileLoadImage
XcursorFileLoadImages
XcursorFileSave
XcursorFileSaveImages
XcursorFilenameLoad
XcursorFilenameLoadAllImages
XcursorFilenameLoadImage
XcursorFilenameLoadImages
XcursorFilenameSave
XcursorFilenameSaveImages
XcursorImageCreate
XcursorImageDestroy
XcursorImagesCreate
XcursorImagesDestroy
XcursorXcFileLoad
XcursorXcFileLoadAllImages
XcursorXcFileLoadImage
XcursorXcFileLoadImages
XcursorXcFileSave
XcursorLibraryPath
XcursorLibraryLoadImage
XcursorLibraryLoadImages
XcursorShapeLoadImage
XcursorShapeLoadImages
XcursorTryShapeCursor
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
$srcdir/configure --enable-maintainer-mode "$@"
dnl
dnl $Id: configure.ac,v 1.3 2005/06/29 18:46:53 daniels Exp $
dnl
dnl Copyright © 2003 Keith Packard
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
dnl copyright notice and this permission notice appear in supporting
dnl documentation, and that the name of Keith Packard not be used in
dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Keith Packard makes no
dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty.
dnl
dnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dnl PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57])
dnl
dnl This is the package version number, not the shared library
dnl version. This same version number must appear in Xcursor.h
dnl Yes, it is a pain to synchronize version numbers. Unfortunately, it's
dnl not possible to extract the version number here from Xcursor.h
dnl
AC_INIT([libXcursor],1.1.4,[keithp@keithp.com],[libXcursor])
AM_INIT_AUTOMAKE([dist-bzip2])
AC_CONFIG_SRCDIR([Makefile.am])
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
dnl libtool versioning
LT_CURRENT=1
LT_REVISION=2
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
LT_AGE=0
LT_VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
AC_SUBST(LT_VERSION_INFO)
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
AC_SUBST(LT_CURRENT_MINUS_AGE)
# Check for progs
AC_PROG_CC
AC_PROG_LIBTOOL
# Check for X
PKG_CHECK_MODULES(X, x11,
[x_found_with_pkgconfig=yes],
[x_found_with_pkgconfig=no])
if test "$x_found_with_pkgconfig" = "no"
then
AC_PATH_XTRA
X_LIBS="$X_LIBS -lX11"
if test "x$no_x" = "xyes"
then
AC_MSG_ERROR([X is required, but it was either disabled or not found.])
fi
# Check for XTHREADS
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $X_CFLAGS"
LIBS="$LIBS $X_LIBS"
AC_MSG_CHECKING([for XTHREADS in Xlib])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[#include <X11/Xlib.h>]],
[[return XInitThreads() == 0 ? 0 : 1;]])],
[xthreads=no],
[xthreads=yes],
[xthreads=yes])
AC_MSG_RESULT($xthreads)
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
if test "x$xthreads" = "xyes"
then
X_CFLAGS="$X_CFLAGS -DXTHREADS"
fi
if test "x$no_x" = "xyes"
then
AC_MSG_ERROR([X is required, but it was either disabled or not found.])
fi
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LIBS)
PKG_CHECK_MODULES(XRENDER, xrender >= 0.8.2, [xrender_found_with_pkgconfig=yes],
[xrender_found_with_pkgconfig=no])
case "$xrender_found_with_pkgconfig" in
no)
PKG_CHECK_MODULES(XRENDER, xrender >= 0.8, [old_xrender_found_with_pkgconfig=yes],
[old_xrender_found_with_pkgconfig=no])
case "$old_xrender_found_with_pkgconfig" in
no)
# checks for X
AC_PATH_X
XRENDER_CFLAGS="-I$x_includes"
XRENDER_LIBS="-L$x_libraries -lXrender -lXext -lX11"
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS"
AC_CHECK_HEADERS([X11/extensions/Xrender.h], [], [AC_MSG_ERROR([Xrender.h not found.])])
CPPFLAGS="$saved_CPPFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $XRENDER_LIBS"
AC_CHECK_FUNCS([XRenderCreateAnimCursor], [], [AC_MSG_ERROR([libXrender not found.])])
LIBS="$saved_LIBS"
;;
yes)
XRENDER_LIBS="$XRENDER_LIBS -lXext -lX11"
;;
esac
;;
esac
PKG_CHECK_MODULES(XFIXES, xfixes, [AC_DEFINE_UNQUOTED(HAVE_XFIXES, 1, [Define to 1 if you have Xfixes])])
AC_SUBST(XRENDER_LIBS)
AC_SUBST(XRENDER_CFLAGS)
AC_OUTPUT([Makefile
xcursor.pc])
/*
* $Id: display.c,v 1.6 2005/10/19 22:26:55 ajax Exp $
*
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "xcursorint.h"
#include <X11/Xlibint.h>
#include <ctype.h>
static XcursorDisplayInfo *_XcursorDisplayInfo;
static void
_XcursorFreeDisplayInfo (XcursorDisplayInfo *info)
{
if (info->theme)
free (info->theme);
if (info->theme_from_config)
free (info->theme_from_config);
free (info);
}
static int
_XcursorCloseDisplay (Display *dpy, XExtCodes *codes)
{
XcursorDisplayInfo *info, **prev;
/*
* Unhook from the global list
*/
_XLockMutex (_Xglobal_lock);
for (prev = &_XcursorDisplayInfo; (info = *prev); prev = &(*prev)->next)
if (info->display == dpy)
{
*prev = info->next;
break;
}
_XUnlockMutex (_Xglobal_lock);
_XcursorFreeDisplayInfo (info);
return 0;
}
static int
_XcursorDefaultParseBool (char *v)
{
char c0, c1;
c0 = *v;
if (isupper ((int)c0))
c0 = tolower (c0);
if (c0 == 't' || c0 == 'y' || c0 == '1')
return 1;
if (c0 == 'f' || c0 == 'n' || c0 == '0')
return 0;
if (c0 == 'o')
{
c1 = v[1];
if (isupper ((int)c1))
c1 = tolower (c1);
if (c1 == 'n')
return 1;
if (c1 == 'f')
return 0;
}
return -1;
}
XcursorDisplayInfo *
_XcursorGetDisplayInfo (Display *dpy)
{
XcursorDisplayInfo *info, **prev, *old;
int event_base, error_base;
int major, minor;
char *v;
int i;
_XLockMutex (_Xglobal_lock);
for (prev = &_XcursorDisplayInfo; (info = *prev); prev = &(*prev)->next)
{
if (info->display == dpy)
{
/*
* MRU the list
*/
if (prev != &_XcursorDisplayInfo)
{
*prev = info->next;
info->next = _XcursorDisplayInfo;
_XcursorDisplayInfo = info;
}
break;
}
}
_XUnlockMutex (_Xglobal_lock);
if (info)
return info;
info = (XcursorDisplayInfo *) malloc (sizeof (XcursorDisplayInfo));
if (!info)
return 0;
info->next = 0;
info->display = dpy;
info->codes = XAddExtension (dpy);
if (!info->codes)
{
free (info);
return 0;
}
(void) XESetCloseDisplay (dpy, info->codes->extension, _XcursorCloseDisplay);
/*
* Check whether the display supports the Render CreateCursor request
*/
info->has_render_cursor = XcursorFalse;
info->has_anim_cursor = XcursorFalse;
if (XRenderQueryExtension (dpy, &event_base, &error_base) &&
XRenderQueryVersion (dpy, &major, &minor))
{
if (major > 0 || minor >= 5)
{
info->has_render_cursor = XcursorTrue;
v = getenv ("XCURSOR_CORE");
if (!v)
v = XGetDefault (dpy, "Xcursor", "core");
if (v && _XcursorDefaultParseBool (v) == 1)
info->has_render_cursor = XcursorFalse;
}
if (info->has_render_cursor && (major > 0 || minor >= 8))
{
info->has_anim_cursor = XcursorTrue;
v = getenv ("XCURSOR_ANIM");
if (!v)
v = XGetDefault (dpy, "Xcursor", "anim");
if (v && _XcursorDefaultParseBool (v) == 0)
info->has_anim_cursor = XcursorFalse;
}
}
info->size = 0;
/*
* Get desired cursor size
*/
v = getenv ("XCURSOR_SIZE");
if (!v)
v = XGetDefault (dpy, "Xcursor", "size");
if (v)
info->size = atoi (v);
/*
* Use the Xft size to guess a size; make cursors 16 "points" tall
*/
if (info->size == 0)
{
int dpi = 0;
v = XGetDefault (dpy, "Xft", "dpi");
if (v)
dpi = atoi (v);
if (dpi)
info->size = dpi * 16 / 72;
}
/*
* Use display size to guess a size
*/
if (info->size == 0)
{
int dim;
if (DisplayHeight (dpy, DefaultScreen (dpy)) <
DisplayWidth (dpy, DefaultScreen (dpy)))
dim = DisplayHeight (dpy, DefaultScreen (dpy));
else
dim = DisplayWidth (dpy, DefaultScreen (dpy));
/*
* 16 pixels on a display of dimension 768
*/
info->size = dim / 48;
}
info->theme = 0;
info->theme_from_config = 0;
/*
* Get the desired theme
*/
v = getenv ("XCURSOR_THEME");
if (!v)
v = XGetDefault (dpy, "Xcursor", "theme");
if (v)
{
int len;
len = strlen (v) + 1;
info->theme = malloc (len);
if (info->theme)
strcpy (info->theme, v);
info->theme_from_config = malloc (len);
if (info->theme_from_config)
strcpy (info->theme_from_config, v);
}
/*
* Get the desired dither
*/
info->dither = XcursorDitherThreshold;
v = getenv ("XCURSOR_DITHER");
if (!v)
v = XGetDefault (dpy, "Xcursor", "dither");
if (v)
{
if (!strcmp (v, "threshold"))
info->dither = XcursorDitherThreshold;
if (!strcmp (v, "median"))
info->dither = XcursorDitherMedian;
if (!strcmp (v, "ordered"))
info->dither = XcursorDitherOrdered;
if (!strcmp (v, "diffuse"))
info->dither = XcursorDitherDiffuse;
}
info->theme_core = False;
/*
* Find out if core cursors should
* be themed
*/
v = getenv ("XCURSOR_THEME_CORE");
if (!v)
v = XGetDefault (dpy, "Xcursor", "theme_core");
if (v)
{
i = _XcursorDefaultParseBool (v);
if (i >= 0)
info->theme_core = i;
}
info->fonts = 0;
for (i = 0; i < NUM_BITMAPS; i++)
info->bitmaps[i].bitmap = None;
/*
* Link new info info list, making sure another
* thread hasn't inserted something into the list while
* this one was busy setting up the data
*/
_XLockMutex (_Xglobal_lock);
for (old = _XcursorDisplayInfo; old; old = old->next)
if (old->display == dpy)
break;
if (old)
{
_XcursorFreeDisplayInfo (info);
info = old;
}
else
{
info->next = _XcursorDisplayInfo;
_XcursorDisplayInfo = info;
}
_XUnlockMutex (_Xglobal_lock);
return info;
}
XcursorBool
XcursorSupportsARGB (Display *dpy)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
return info && info->has_render_cursor;
}
XcursorBool
XcursorSupportsAnim (Display *dpy)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
return info && info->has_anim_cursor;
}
XcursorBool
XcursorSetDefaultSize (Display *dpy, int size)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
if (!info)
return XcursorFalse;
info->size = size;
return XcursorTrue;
}
int
XcursorGetDefaultSize (Display *dpy)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
if (!info)
return 0;
return info->size;
}
XcursorBool
XcursorSetTheme (Display *dpy, const char *theme)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
char *copy;
if (!info)
return XcursorFalse;
if (!theme)
theme = info->theme_from_config;
if (theme)
{
copy = malloc (strlen (theme) + 1);
if (!copy)
return XcursorFalse;
strcpy (copy, theme);
}
else
copy = 0;
if (info->theme)
free (info->theme);
info->theme = copy;
return XcursorTrue;
}
char *
XcursorGetTheme (Display *dpy)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
if (!info)
return 0;
return info->theme;
}
XcursorBool
XcursorGetThemeCore (Display *dpy)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
if (!info)
return XcursorFalse;
return info->theme_core;
}
XcursorBool
XcursorSetThemeCore (Display *dpy, XcursorBool theme_core)
{
XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy);
if (!info)
return XcursorFalse;
info->theme_core = theme_core;
return XcursorTrue;
}
#! /bin/sh
prefix="@prefix@"
exec_prefix="@exec_prefix@"
libdir="@libdir@"
hardcode_libdir_flag_spec=@hardcode_libdir_flag_spec@
includedir="@includedir@"
version="@VERSION@"
usage()
{
cat <<EOF
Usage: xcursor-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--version]
[--libs]
[--cflags]
EOF
exit $1
}
if test $# -eq 0 ; then
usage 1 1>&2
fi
while test $# -gt 0 ; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
local_prefix=yes
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
local_prefix=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo $version
exit 0
;;
--cflags)
echo_cflags=yes
;;
--libs)
echo_libs=yes
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test "$local_prefix" = "yes" ; then
if test "$exec_prefix_set" != "yes" ; then
exec_prefix=$prefix
fi
fi
if test "$echo_prefix" = "yes" ; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes" ; then
echo $exec_prefix
fi
if test "$echo_cflags" = "yes" ; then
cflags="-I${includedir}"
echo $cflags
fi
if test "$echo_libs" = "yes" ; then
libs="-lXcursor"
if test "${libdir}" != "/usr/lib" ; then
echo ${hardcode_libdir_flag_spec} -L${libdir} $libs
else
echo $libs
fi
fi
# EOF
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
xrenderlibs=@XRENDER_LIBS@
xrendercflags=@XRENDER_CFLAGS@
xlibs=@X_LIBS@
xcflags=@X_CFLAGS@
Name: Xcursor
Description: X Cursor Library
Version: @VERSION@
Requires: xrender
Cflags: -I${includedir} ${xrendercflags} ${xcflags}
Libs: -L${libdir} -lNX_Xcursor ${xrenderlibs} ${xlibs}
/*
* $Id: xcursorint.h,v 1.6 2005/10/19 22:26:55 ajax Exp $
*
* Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _XCURSORINT_H_
#define _XCURSORINT_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <X11/extensions/Xrender.h>
#ifdef HAVE_XFIXES
#include <X11/extensions/Xfixes.h>
#endif
#include "Xcursor.h"
#include "config.h"
typedef struct _XcursorFontInfo {
struct _XcursorFontInfo *next;
Font font;
XcursorBool is_cursor_font;
} XcursorFontInfo;
/*
* Track a few recently created bitmaps to see
* if they get used to create cursors. This
* is done by hooking into Xlib and watching
* for XCreatePixmap, XPutImage, XCreatePixmapCursor
* with appropriate arguments. When this happens
* Xcursor computes a hash value for the source image
* and tries to load a library cursor of that name.
*/
/* large bitmaps are unlikely to be cursors */
#define MAX_BITMAP_CURSOR_SIZE 64
/* don't need to remember very many; in fact, 2 is likely sufficient */
#define NUM_BITMAPS 8
typedef struct _XcursorBitmapInfo {
Pixmap bitmap;
unsigned long sequence;
unsigned int width, height;
Bool has_image;
unsigned char hash[XCURSOR_BITMAP_HASH_SIZE];
} XcursorBitmapInfo;
typedef enum _XcursorDither {
XcursorDitherThreshold,
XcursorDitherMedian,
XcursorDitherOrdered,
XcursorDitherDiffuse
} XcursorDither;
typedef struct _XcursorDisplayInfo {
struct _XcursorDisplayInfo *next;
Display *display;
XExtCodes *codes;
XcursorBool has_render_cursor;
XcursorBool has_anim_cursor;
XcursorBool theme_core;
int size;
XcursorFontInfo *fonts;
char *theme;
char *theme_from_config;
XcursorDither dither;
XcursorBitmapInfo bitmaps[NUM_BITMAPS];
} XcursorDisplayInfo;
XcursorDisplayInfo *
_XcursorGetDisplayInfo (Display *dpy);
Cursor
_XcursorCreateGlyphCursor(Display *dpy,
Font source_font,
Font mask_font,
unsigned int source_char,
unsigned int mask_char,
XColor _Xconst *foreground,
XColor _Xconst *background);
Cursor
_XcursorCreateFontCursor (Display *dpy, unsigned int shape);
#endif /* _XCURSORINT_H_ */
...@@ -159,7 +159,7 @@ all:: xrender.pc ...@@ -159,7 +159,7 @@ all:: xrender.pc
xrender.pc: xrender.pc.in xrender.pc: xrender.pc.in
RemoveFile($@) RemoveFile($@)
sh ../Xcursor/config-subst $(SUBSTVARS) < xrender.pc.in > $@ sh config-subst $(SUBSTVARS) < xrender.pc.in > $@
InstallNonExecFile(xrender.pc,$(USRLIBDIR)/pkgconfig) InstallNonExecFile(xrender.pc,$(USRLIBDIR)/pkgconfig)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment