diff options
author | marha <marha@users.sourceforge.net> | 2010-05-27 08:08:37 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-05-27 08:08:37 +0000 |
commit | 958dcdff6d845fcff20a414bd28be8ee2ced8c6c (patch) | |
tree | 3bc998a5af389cd1357dd672d96828573025cd0a /libXext/src | |
parent | 9b02c06e9c08d3d537d0a6fed3304b2146d49511 (diff) | |
parent | bc4f49f9a9eccb73bc2c5610295febaf4b14559e (diff) | |
download | vcxsrv-958dcdff6d845fcff20a414bd28be8ee2ced8c6c.tar.gz vcxsrv-958dcdff6d845fcff20a414bd28be8ee2ced8c6c.tar.bz2 vcxsrv-958dcdff6d845fcff20a414bd28be8ee2ced8c6c.zip |
svn merge ^/branches/released .
Diffstat (limited to 'libXext/src')
-rw-r--r-- | libXext/src/Makefile.am | 134 | ||||
-rw-r--r-- | libXext/src/Makefile.in | 683 | ||||
-rw-r--r-- | libXext/src/Xdbe.c | 947 | ||||
-rw-r--r-- | libXext/src/extutil.c | 564 |
4 files changed, 822 insertions, 1506 deletions
diff --git a/libXext/src/Makefile.am b/libXext/src/Makefile.am index 6a7d379cb..99c711aaa 100644 --- a/libXext/src/Makefile.am +++ b/libXext/src/Makefile.am @@ -1,66 +1,68 @@ -lib_LTLIBRARIES=libXext.la - -AM_CFLAGS=\ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/include/X11/extensions\ - $(XEXT_CFLAGS) $(MALLOC_ZERO_CFLAGS) - -libXext_la_LDFLAGS = -version-number $(XEXT_SOREV) -no-undefined - -libXext_la_LIBADD = $(XEXT_LIBS) - -libXext_la_SOURCES = \ - DPMS.c \ - MITMisc.c \ - XAppgroup.c \ - XEVI.c \ - XLbx.c \ - XMultibuf.c \ - XSecurity.c \ - XShape.c \ - XShm.c \ - XSync.c \ - XTestExt1.c \ - Xcup.c \ - Xdbe.c \ - Xge.c \ - extutil.c \ - globals.c - -libXextincludedir = $(includedir)/X11/extensions -libXextinclude_HEADERS = $(top_srcdir)/include/X11/extensions/dpms.h \ - $(top_srcdir)/include/X11/extensions/extutil.h \ - $(top_srcdir)/include/X11/extensions/lbxbuf.h \ - $(top_srcdir)/include/X11/extensions/lbxbufstr.h \ - $(top_srcdir)/include/X11/extensions/lbximage.h \ - $(top_srcdir)/include/X11/extensions/MITMisc.h \ - $(top_srcdir)/include/X11/extensions/multibuf.h \ - $(top_srcdir)/include/X11/extensions/security.h \ - $(top_srcdir)/include/X11/extensions/shape.h \ - $(top_srcdir)/include/X11/extensions/sync.h \ - $(top_srcdir)/include/X11/extensions/Xag.h \ - $(top_srcdir)/include/X11/extensions/Xcup.h \ - $(top_srcdir)/include/X11/extensions/Xdbe.h \ - $(top_srcdir)/include/X11/extensions/XEVI.h \ - $(top_srcdir)/include/X11/extensions/Xext.h \ - $(top_srcdir)/include/X11/extensions/Xge.h \ - $(top_srcdir)/include/X11/extensions/XLbx.h \ - $(top_srcdir)/include/X11/extensions/XShm.h \ - $(top_srcdir)/include/X11/extensions/xtestext1.h - -if LINT -ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) - -lint: - $(LINT) $(ALL_LINT_FLAGS) $(libXext_la_SOURCES) $(XEXT_LIBS) -endif LINT - -if MAKE_LINT_LIB -lintlibdir = $(libdir) - -lintlib_DATA = $(LINTLIB) - -$(LINTLIB): $(libXext_la_SOURCES) - $(LINT) -y -oXext -x $(ALL_LINT_FLAGS) $(libXext_la_SOURCES) -endif MAKE_LINT_LIB +lib_LTLIBRARIES=libXext.la
+
+AM_CPPFLAGS=\
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/include/X11/extensions\
+ $(XEXT_CFLAGS) $(MALLOC_ZERO_CFLAGS)
+
+AM_CFLAGS=$(CWARNFLAGS)
+
+libXext_la_LDFLAGS = -version-number $(XEXT_SOREV) -no-undefined
+
+libXext_la_LIBADD = $(XEXT_LIBS)
+
+libXext_la_SOURCES = \
+ DPMS.c \
+ MITMisc.c \
+ XAppgroup.c \
+ XEVI.c \
+ XLbx.c \
+ XMultibuf.c \
+ XSecurity.c \
+ XShape.c \
+ XShm.c \
+ XSync.c \
+ XTestExt1.c \
+ Xcup.c \
+ Xdbe.c \
+ Xge.c \
+ extutil.c \
+ globals.c
+
+libXextincludedir = $(includedir)/X11/extensions
+libXextinclude_HEADERS = $(top_srcdir)/include/X11/extensions/dpms.h \
+ $(top_srcdir)/include/X11/extensions/extutil.h \
+ $(top_srcdir)/include/X11/extensions/lbxbuf.h \
+ $(top_srcdir)/include/X11/extensions/lbxbufstr.h \
+ $(top_srcdir)/include/X11/extensions/lbximage.h \
+ $(top_srcdir)/include/X11/extensions/MITMisc.h \
+ $(top_srcdir)/include/X11/extensions/multibuf.h \
+ $(top_srcdir)/include/X11/extensions/security.h \
+ $(top_srcdir)/include/X11/extensions/shape.h \
+ $(top_srcdir)/include/X11/extensions/sync.h \
+ $(top_srcdir)/include/X11/extensions/Xag.h \
+ $(top_srcdir)/include/X11/extensions/Xcup.h \
+ $(top_srcdir)/include/X11/extensions/Xdbe.h \
+ $(top_srcdir)/include/X11/extensions/XEVI.h \
+ $(top_srcdir)/include/X11/extensions/Xext.h \
+ $(top_srcdir)/include/X11/extensions/Xge.h \
+ $(top_srcdir)/include/X11/extensions/XLbx.h \
+ $(top_srcdir)/include/X11/extensions/XShm.h \
+ $(top_srcdir)/include/X11/extensions/xtestext1.h
+
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS)
+
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(libXext_la_SOURCES) $(XEXT_LIBS)
+endif LINT
+
+if MAKE_LINT_LIB
+lintlibdir = $(libdir)
+
+lintlib_DATA = $(LINTLIB)
+
+$(LINTLIB): $(libXext_la_SOURCES)
+ $(LINT) -y -oXext -x $(ALL_LINT_FLAGS) $(libXext_la_SOURCES)
+endif MAKE_LINT_LIB
diff --git a/libXext/src/Makefile.in b/libXext/src/Makefile.in deleted file mode 100644 index 932430f8e..000000000 --- a/libXext/src/Makefile.in +++ /dev/null @@ -1,683 +0,0 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ - - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -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@ -subdir = src -DIST_COMMON = $(libXextinclude_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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 = -CONFIG_CLEAN_VPATH_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 = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(lintlibdir)" \ - "$(DESTDIR)$(libXextincludedir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libXext_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libXext_la_OBJECTS = DPMS.lo MITMisc.lo XAppgroup.lo XEVI.lo \ - XLbx.lo XMultibuf.lo XSecurity.lo XShape.lo XShm.lo XSync.lo \ - XTestExt1.lo Xcup.lo Xdbe.lo Xge.lo extutil.lo globals.lo -libXext_la_OBJECTS = $(am_libXext_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -libXext_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libXext_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libXext_la_SOURCES) -DIST_SOURCES = $(libXext_la_SOURCES) -DATA = $(lintlib_DATA) -HEADERS = $(libXextinclude_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ -ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APP_MAN_DIR = @APP_MAN_DIR@ -APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHANGELOG_CMD = @CHANGELOG_CMD@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWARNFLAGS = @CWARNFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ -DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FILE_MAN_DIR = @FILE_MAN_DIR@ -FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_MAN_DIR = @LIB_MAN_DIR@ -LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LINT = @LINT@ -LINTLIB = @LINTLIB@ -LINT_FLAGS = @LINT_FLAGS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MALLOC_ZERO_CFLAGS = @MALLOC_ZERO_CFLAGS@ -MISC_MAN_DIR = @MISC_MAN_DIR@ -MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ -MKDIR_P = @MKDIR_P@ -NMEDIT = @NMEDIT@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -RAWCPP = @RAWCPP@ -RAWCPPFLAGS = @RAWCPPFLAGS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XEXT_CFLAGS = @XEXT_CFLAGS@ -XEXT_LIBS = @XEXT_LIBS@ -XEXT_SOREV = @XEXT_SOREV@ -XMALLOC_ZERO_CFLAGS = @XMALLOC_ZERO_CFLAGS@ -XTMALLOC_ZERO_CFLAGS = @XTMALLOC_ZERO_CFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -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@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -distcleancheck_listfiles = @distcleancheck_listfiles@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -lib_LTLIBRARIES = libXext.la -AM_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/include/X11/extensions\ - $(XEXT_CFLAGS) $(MALLOC_ZERO_CFLAGS) - -libXext_la_LDFLAGS = -version-number $(XEXT_SOREV) -no-undefined -libXext_la_LIBADD = $(XEXT_LIBS) -libXext_la_SOURCES = \ - DPMS.c \ - MITMisc.c \ - XAppgroup.c \ - XEVI.c \ - XLbx.c \ - XMultibuf.c \ - XSecurity.c \ - XShape.c \ - XShm.c \ - XSync.c \ - XTestExt1.c \ - Xcup.c \ - Xdbe.c \ - Xge.c \ - extutil.c \ - globals.c - -libXextincludedir = $(includedir)/X11/extensions -libXextinclude_HEADERS = $(top_srcdir)/include/X11/extensions/dpms.h \ - $(top_srcdir)/include/X11/extensions/extutil.h \ - $(top_srcdir)/include/X11/extensions/lbxbuf.h \ - $(top_srcdir)/include/X11/extensions/lbxbufstr.h \ - $(top_srcdir)/include/X11/extensions/lbximage.h \ - $(top_srcdir)/include/X11/extensions/MITMisc.h \ - $(top_srcdir)/include/X11/extensions/multibuf.h \ - $(top_srcdir)/include/X11/extensions/security.h \ - $(top_srcdir)/include/X11/extensions/shape.h \ - $(top_srcdir)/include/X11/extensions/sync.h \ - $(top_srcdir)/include/X11/extensions/Xag.h \ - $(top_srcdir)/include/X11/extensions/Xcup.h \ - $(top_srcdir)/include/X11/extensions/Xdbe.h \ - $(top_srcdir)/include/X11/extensions/XEVI.h \ - $(top_srcdir)/include/X11/extensions/Xext.h \ - $(top_srcdir)/include/X11/extensions/Xge.h \ - $(top_srcdir)/include/X11/extensions/XLbx.h \ - $(top_srcdir)/include/X11/extensions/XShm.h \ - $(top_srcdir)/include/X11/extensions/xtestext1.h - -@LINT_TRUE@ALL_LINT_FLAGS = $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ -@LINT_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS) - -@MAKE_LINT_LIB_TRUE@lintlibdir = $(libdir) -@MAKE_LINT_LIB_TRUE@lintlib_DATA = $(LINTLIB) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - 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 -libXext.la: $(libXext_la_OBJECTS) $(libXext_la_DEPENDENCIES) - $(AM_V_CCLD)$(libXext_la_LINK) -rpath $(libdir) $(libXext_la_OBJECTS) $(libXext_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DPMS.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MITMisc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XAppgroup.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XEVI.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XLbx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XMultibuf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSecurity.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XShape.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XShm.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XSync.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XTestExt1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xcup.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xdbe.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Xge.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extutil.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-lintlibDATA: $(lintlib_DATA) - @$(NORMAL_INSTALL) - test -z "$(lintlibdir)" || $(MKDIR_P) "$(DESTDIR)$(lintlibdir)" - @list='$(lintlib_DATA)'; test -n "$(lintlibdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(lintlibdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(lintlibdir)" || exit $$?; \ - done - -uninstall-lintlibDATA: - @$(NORMAL_UNINSTALL) - @list='$(lintlib_DATA)'; test -n "$(lintlibdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(lintlibdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(lintlibdir)" && rm -f $$files -install-libXextincludeHEADERS: $(libXextinclude_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(libXextincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libXextincludedir)" - @list='$(libXextinclude_HEADERS)'; test -n "$(libXextincludedir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libXextincludedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libXextincludedir)" || exit $$?; \ - done - -uninstall-libXextincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(libXextinclude_HEADERS)'; test -n "$(libXextincludedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(libXextincludedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(libXextincludedir)" && rm -f $$files - -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; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - 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; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - 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; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$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) $(DATA) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(lintlibdir)" "$(DESTDIR)$(libXextincludedir)"; 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 -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -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-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-libXextincludeHEADERS install-lintlibDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -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-libLTLIBRARIES uninstall-libXextincludeHEADERS \ - uninstall-lintlibDATA - -.MAKE: install-am install-strip - -.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-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-libXextincludeHEADERS \ - install-lintlibDATA install-man install-pdf install-pdf-am \ - install-ps install-ps-am 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-libLTLIBRARIES \ - uninstall-libXextincludeHEADERS uninstall-lintlibDATA - - -@LINT_TRUE@lint: -@LINT_TRUE@ $(LINT) $(ALL_LINT_FLAGS) $(libXext_la_SOURCES) $(XEXT_LIBS) - -@MAKE_LINT_LIB_TRUE@$(LINTLIB): $(libXext_la_SOURCES) -@MAKE_LINT_LIB_TRUE@ $(LINT) -y -oXext -x $(ALL_LINT_FLAGS) $(libXext_la_SOURCES) - -# 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: diff --git a/libXext/src/Xdbe.c b/libXext/src/Xdbe.c index 77344b4aa..2dd3509ca 100644 --- a/libXext/src/Xdbe.c +++ b/libXext/src/Xdbe.c @@ -1,475 +1,472 @@ -/* $Xorg: Xdbe.c,v 1.4 2000/08/17 19:45:53 cpqbld Exp $ */ -/****************************************************************************** - * - * Copyright (c) 1994, 1995 Hewlett-Packard Company - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the Hewlett-Packard - * Company shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the Hewlett-Packard Company. - * - * Xlib DBE code - * - *****************************************************************************/ -/* $XFree86: xc/lib/Xext/Xdbe.c,v 3.7 2002/10/16 02:19:22 dawes Exp $ */ - -#define NEED_EVENTS -#define NEED_REPLIES -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <stdio.h> -#include <X11/Xlibint.h> -#include <X11/extensions/Xext.h> -#include <X11/extensions/extutil.h> -#include <X11/extensions/Xdbe.h> -#include <X11/extensions/dbeproto.h> - -static XExtensionInfo _dbe_info_data; -static XExtensionInfo *dbe_info = &_dbe_info_data; -static char *dbe_extension_name = DBE_PROTOCOL_NAME; - -#define DbeCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, dbe_extension_name, val) -#define DbeSimpleCheckExtension(dpy,i) \ - XextSimpleCheckExtension (dpy, i, dbe_extension_name) - -#if !defined(UNIXCPP) -#define DbeGetReq(name,req,info) GetReq (name, req); \ - req->reqType = info->codes->major_opcode; \ - req->dbeReqType = X_##name; -#else -#define DbeGetReq(name,req,info) GetReq (name, req); \ - req->reqType = info->codes->major_opcode; \ - req->dbeReqType = X_/**/name; -#endif - - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -/* - * find_display - locate the display info block - */ -static int close_display(Display *dpy, XExtCodes *codes); -static char *error_string(Display *dpy, int code, XExtCodes *codes, - char *buf, int n); -static XExtensionHooks dbe_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - error_string, /* error_string */ -}; - -static char *dbe_error_list[] = { - "BadBuffer", /* DbeBadBuffer */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, dbe_info, - dbe_extension_name, - &dbe_extension_hooks, - DbeNumberEvents, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, dbe_info) - -static XEXT_GENERATE_ERROR_STRING (error_string, dbe_extension_name, - DbeNumberErrors, - dbe_error_list) - - -/***************************************************************************** - * * - * Double-Buffering public interfaces * - * * - *****************************************************************************/ - -/* - * XdbeQueryExtension - - * Sets major_version_return and minor_verion_return to the major and - * minor DBE protocol version supported by the server. If the DBE - * library is compatible with the version returned by the server, this - * function returns non-zero. If dpy does not support the DBE - * extension, or if there was an error during communication with the - * server, or if the server and library protocol versions are - * incompatible, this functions returns zero. No other Xdbe functions - * may be called before this function. If a client violates this rule, - * the effects of all subsequent Xdbe calls are undefined. - */ -Status XdbeQueryExtension ( - Display *dpy, - int *major_version_return, - int *minor_version_return) -{ - XExtDisplayInfo *info = find_display (dpy); - xDbeGetVersionReply rep; - register xDbeGetVersionReq *req; - - if (!XextHasExtension (info)) - return (Status)0; /* failure */ - - LockDisplay (dpy); - DbeGetReq (DbeGetVersion, req, info); - req->majorVersion = DBE_MAJOR_VERSION; - req->minorVersion = DBE_MINOR_VERSION; - - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return (Status)0; /* failure */ - } - *major_version_return = rep.majorVersion; - *minor_version_return = rep.minorVersion; - UnlockDisplay (dpy); - - SyncHandle (); - - if (*major_version_return != DBE_MAJOR_VERSION) - return (Status)0; /* failure */ - else - return (Status)1; /* success */ -} - - -/* - * XdbeAllocateBackBuffer - - * This function returns a drawable ID used to refer to the back buffer - * of the specified window. The swap_action is a hint to indicate the - * swap action that will likely be used in subsequent calls to - * XdbeSwapBuffers. The actual swap action used in calls to - * XdbeSwapBuffers does not have to be the same as the swap_action - * passed to this function, though clients are encouraged to provide - * accurate information whenever possible. - */ - -XdbeBackBuffer XdbeAllocateBackBufferName( - Display *dpy, - Window window, - XdbeSwapAction swap_action) -{ - XExtDisplayInfo *info = find_display (dpy); - register xDbeAllocateBackBufferNameReq *req; - XdbeBackBuffer buffer; - - /* make sure extension is available; if not, return the - * third parameter (0). - */ - DbeCheckExtension (dpy, info, (XdbeBackBuffer)0); - - /* allocate the id */ - buffer = XAllocID (dpy); - - LockDisplay(dpy); - DbeGetReq(DbeAllocateBackBufferName, req, info); - req->window = window; - req->swapAction = (unsigned char)swap_action; - req->buffer = buffer; - - UnlockDisplay (dpy); - SyncHandle (); - return buffer; - -} /* XdbeAllocateBackBufferName() */ - -/* - * XdbeDeallocateBackBufferName - - * This function frees a drawable ID, buffer, that was obtained via - * XdbeAllocateBackBufferName. The buffer must refer to the back buffer - * of the specified window, or a protocol error results. - */ -Status XdbeDeallocateBackBufferName ( - Display *dpy, - XdbeBackBuffer buffer) -{ - XExtDisplayInfo *info = find_display (dpy); - register xDbeDeallocateBackBufferNameReq *req; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeDeallocateBackBufferName, req, info); - req->buffer = buffer; - UnlockDisplay (dpy); - SyncHandle (); - - return (Status)1; /* success */ -} - - -/* - * XdbeSwapBuffers - - * This function swaps the front and back buffers for a list of windows. - * The argument num_windows specifies how many windows are to have their - * buffers swapped; it is the number of elements in the swap_info array. - * The argument swap_info specifies the information needed per window - * to do the swap. - */ -Status XdbeSwapBuffers ( - Display *dpy, - XdbeSwapInfo *swap_info, - int num_windows) -{ - XExtDisplayInfo *info = find_display (dpy); - register xDbeSwapBuffersReq *req; - int i; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeSwapBuffers, req, info); - req->length += 2*num_windows; - req->n = num_windows; - - /* We need to handle 64-bit machines, where we can not use PackData32 - * directly because info would be lost in translating from 32- to 64-bit. - * Instead we send data via a loop that accounts for the translation. - */ - for (i = 0; i < num_windows; i++) - { - char tmp[4]; - Data32 (dpy, (long *)&swap_info[i].swap_window, 4); - tmp[0] = swap_info[i].swap_action; - Data (dpy, (char *)tmp, 4); - } - - UnlockDisplay (dpy); - SyncHandle (); - - - return (Status)1; /* success */ - -} /* XdbeSwapBuffers() */ - - -/* - * XdbeBeginIdiom - - * This function marks the beginning of an idiom sequence. - */ -Status XdbeBeginIdiom (Display *dpy) -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeBeginIdiomReq *req; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeBeginIdiom, req, info); - UnlockDisplay (dpy); - SyncHandle (); - - return (Status)1; /* success */ -} - - -/* - * XdbeEndIdiom - - * This function marks the end of an idiom sequence. - */ -Status XdbeEndIdiom (Display *dpy) -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeEndIdiomReq *req; - - DbeCheckExtension (dpy, info, (Status)0 /* failure */); - - LockDisplay (dpy); - DbeGetReq (DbeEndIdiom, req, info); - UnlockDisplay (dpy); - SyncHandle (); - - return (Status)1; /* success */ -} - - -/* - * XdbeGetVisualInfo - - * This function returns information about which visuals support - * double buffering. The argument num_screens specifies how many - * elements there are in the screen_specifiers list. Each drawable - * in screen_specifiers designates a screen for which the supported - * visuals are being requested. If num_screens is zero, information - * for all screens is requested. In this case, upon return from this - * function, num_screens will be set to the number of screens that were - * found. If an error occurs, this function returns NULL, else it returns - * a pointer to a list of XdbeScreenVisualInfo structures of length - * num_screens. The nth element in the returned list corresponds to the - * nth drawable in the screen_specifiers list, unless num_screens was - * passed in with the value zero, in which case the nth element in the - * returned list corresponds to the nth screen of the server, starting - * with screen zero. - */ -XdbeScreenVisualInfo *XdbeGetVisualInfo ( - Display *dpy, - Drawable *screen_specifiers, - int *num_screens) /* SEND and RETURN */ -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeGetVisualInfoReq *req; - xDbeGetVisualInfoReply rep; - XdbeScreenVisualInfo *scrVisInfo; - int i; - - DbeCheckExtension (dpy, info, (XdbeScreenVisualInfo *)NULL); - - LockDisplay (dpy); - - DbeGetReq(DbeGetVisualInfo, req, info); - req->length = 2 + *num_screens; - req->n = *num_screens; - Data32 (dpy, screen_specifiers, (*num_screens * sizeof (CARD32))); - - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - - /* return the number of screens actually found if we - * requested information about all screens (*num_screens == 0) - */ - if (*num_screens == 0) - *num_screens = rep.m; - - /* allocate list of visual information to be returned */ - if (!(scrVisInfo = - (XdbeScreenVisualInfo *)Xmalloc( - (unsigned)(*num_screens * sizeof(XdbeScreenVisualInfo))))) { - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - - for (i = 0; i < *num_screens; i++) - { - int nbytes; - int j; - long c; - - _XRead32 (dpy, &c, sizeof(CARD32)); - scrVisInfo[i].count = c; - - nbytes = scrVisInfo[i].count * sizeof(XdbeVisualInfo); - - /* if we can not allocate the list of visual/depth info - * then free the lists that we already allocate as well - * as the visual info list itself - */ - if (!(scrVisInfo[i].visinfo = (XdbeVisualInfo *)Xmalloc( - (unsigned)nbytes))) { - for (j = 0; j < i; j++) { - Xfree ((char *)scrVisInfo[j].visinfo); - } - Xfree ((char *)scrVisInfo); - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - - /* Read the visual info item into the wire structure. Then copy each - * element into the library structure. The element sizes and/or - * padding may be different in the two structures. - */ - for (j = 0; j < scrVisInfo[i].count; j++) { - xDbeVisInfo xvi; - - _XRead (dpy, (char *)&xvi, sizeof(xDbeVisInfo)); - scrVisInfo[i].visinfo[j].visual = xvi.visualID; - scrVisInfo[i].visinfo[j].depth = xvi.depth; - scrVisInfo[i].visinfo[j].perflevel = xvi.perfLevel; - } - - } - - UnlockDisplay (dpy); - SyncHandle (); - return scrVisInfo; - -} /* XdbeGetVisualInfo() */ - - -/* - * XdbeFreeVisualInfo - - * This function frees the list of XdbeScreenVisualInfo returned by the - * function XdbeGetVisualInfo. - */ -void XdbeFreeVisualInfo(XdbeScreenVisualInfo *visual_info) -{ - if (visual_info == NULL) { - return; - } - - if (visual_info->visinfo) { - XFree(visual_info->visinfo); - } - - XFree(visual_info); -} - - -/* - * XdbeGetBackBufferAttributes - - * This function returns the attributes associated with the specified - * buffer. - */ -XdbeBackBufferAttributes *XdbeGetBackBufferAttributes( - Display *dpy, - XdbeBackBuffer buffer) -{ - XExtDisplayInfo *info = find_display(dpy); - register xDbeGetBackBufferAttributesReq *req; - xDbeGetBackBufferAttributesReply rep; - XdbeBackBufferAttributes *attr; - - DbeCheckExtension(dpy, info, (XdbeBackBufferAttributes *)NULL); - - if (!(attr = - (XdbeBackBufferAttributes *)Xmalloc(sizeof(XdbeBackBufferAttributes)))) { - return NULL; - } - - LockDisplay(dpy); - DbeGetReq(DbeGetBackBufferAttributes, req, info); - req->buffer = buffer; - - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - Xfree(attr); - return NULL; - } - attr->window = rep.attributes; - - UnlockDisplay (dpy); - SyncHandle (); - - return attr; -} - +/* $Xorg: Xdbe.c,v 1.4 2000/08/17 19:45:53 cpqbld Exp $ */
+/******************************************************************************
+ *
+ * Copyright (c) 1994, 1995 Hewlett-Packard Company
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the Hewlett-Packard
+ * Company shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization from the Hewlett-Packard Company.
+ *
+ * Xlib DBE code
+ *
+ *****************************************************************************/
+/* $XFree86: xc/lib/Xext/Xdbe.c,v 3.7 2002/10/16 02:19:22 dawes Exp $ */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
+#include <X11/Xlibint.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
+#include <X11/extensions/Xdbe.h>
+#include <X11/extensions/dbeproto.h>
+
+static XExtensionInfo _dbe_info_data;
+static XExtensionInfo *dbe_info = &_dbe_info_data;
+static char *dbe_extension_name = DBE_PROTOCOL_NAME;
+
+#define DbeCheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, dbe_extension_name, val)
+#define DbeSimpleCheckExtension(dpy,i) \
+ XextSimpleCheckExtension (dpy, i, dbe_extension_name)
+
+#if !defined(UNIXCPP)
+#define DbeGetReq(name,req,info) GetReq (name, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->dbeReqType = X_##name;
+#else
+#define DbeGetReq(name,req,info) GetReq (name, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->dbeReqType = X_/**/name;
+#endif
+
+
+/*****************************************************************************
+ * *
+ * private utility routines *
+ * *
+ *****************************************************************************/
+
+/*
+ * find_display - locate the display info block
+ */
+static int close_display(Display *dpy, XExtCodes *codes);
+static char *error_string(Display *dpy, int code, XExtCodes *codes,
+ char *buf, int n);
+static XExtensionHooks dbe_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ close_display, /* close_display */
+ NULL, /* wire_to_event */
+ NULL, /* event_to_wire */
+ NULL, /* error */
+ error_string, /* error_string */
+};
+
+static char *dbe_error_list[] = {
+ "BadBuffer", /* DbeBadBuffer */
+};
+
+static XEXT_GENERATE_FIND_DISPLAY (find_display, dbe_info,
+ dbe_extension_name,
+ &dbe_extension_hooks,
+ DbeNumberEvents, NULL)
+
+static XEXT_GENERATE_CLOSE_DISPLAY (close_display, dbe_info)
+
+static XEXT_GENERATE_ERROR_STRING (error_string, dbe_extension_name,
+ DbeNumberErrors,
+ dbe_error_list)
+
+
+/*****************************************************************************
+ * *
+ * Double-Buffering public interfaces *
+ * *
+ *****************************************************************************/
+
+/*
+ * XdbeQueryExtension -
+ * Sets major_version_return and minor_verion_return to the major and
+ * minor DBE protocol version supported by the server. If the DBE
+ * library is compatible with the version returned by the server, this
+ * function returns non-zero. If dpy does not support the DBE
+ * extension, or if there was an error during communication with the
+ * server, or if the server and library protocol versions are
+ * incompatible, this functions returns zero. No other Xdbe functions
+ * may be called before this function. If a client violates this rule,
+ * the effects of all subsequent Xdbe calls are undefined.
+ */
+Status XdbeQueryExtension (
+ Display *dpy,
+ int *major_version_return,
+ int *minor_version_return)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xDbeGetVersionReply rep;
+ register xDbeGetVersionReq *req;
+
+ if (!XextHasExtension (info))
+ return (Status)0; /* failure */
+
+ LockDisplay (dpy);
+ DbeGetReq (DbeGetVersion, req, info);
+ req->majorVersion = DBE_MAJOR_VERSION;
+ req->minorVersion = DBE_MINOR_VERSION;
+
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return (Status)0; /* failure */
+ }
+ *major_version_return = rep.majorVersion;
+ *minor_version_return = rep.minorVersion;
+ UnlockDisplay (dpy);
+
+ SyncHandle ();
+
+ if (*major_version_return != DBE_MAJOR_VERSION)
+ return (Status)0; /* failure */
+ else
+ return (Status)1; /* success */
+}
+
+
+/*
+ * XdbeAllocateBackBuffer -
+ * This function returns a drawable ID used to refer to the back buffer
+ * of the specified window. The swap_action is a hint to indicate the
+ * swap action that will likely be used in subsequent calls to
+ * XdbeSwapBuffers. The actual swap action used in calls to
+ * XdbeSwapBuffers does not have to be the same as the swap_action
+ * passed to this function, though clients are encouraged to provide
+ * accurate information whenever possible.
+ */
+
+XdbeBackBuffer XdbeAllocateBackBufferName(
+ Display *dpy,
+ Window window,
+ XdbeSwapAction swap_action)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ register xDbeAllocateBackBufferNameReq *req;
+ XdbeBackBuffer buffer;
+
+ /* make sure extension is available; if not, return the
+ * third parameter (0).
+ */
+ DbeCheckExtension (dpy, info, (XdbeBackBuffer)0);
+
+ LockDisplay(dpy);
+ DbeGetReq(DbeAllocateBackBufferName, req, info);
+ req->window = window;
+ req->swapAction = (unsigned char)swap_action;
+ req->buffer = buffer = XAllocID (dpy);
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return buffer;
+
+} /* XdbeAllocateBackBufferName() */
+
+/*
+ * XdbeDeallocateBackBufferName -
+ * This function frees a drawable ID, buffer, that was obtained via
+ * XdbeAllocateBackBufferName. The buffer must refer to the back buffer
+ * of the specified window, or a protocol error results.
+ */
+Status XdbeDeallocateBackBufferName (
+ Display *dpy,
+ XdbeBackBuffer buffer)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ register xDbeDeallocateBackBufferNameReq *req;
+
+ DbeCheckExtension (dpy, info, (Status)0 /* failure */);
+
+ LockDisplay (dpy);
+ DbeGetReq (DbeDeallocateBackBufferName, req, info);
+ req->buffer = buffer;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+
+ return (Status)1; /* success */
+}
+
+
+/*
+ * XdbeSwapBuffers -
+ * This function swaps the front and back buffers for a list of windows.
+ * The argument num_windows specifies how many windows are to have their
+ * buffers swapped; it is the number of elements in the swap_info array.
+ * The argument swap_info specifies the information needed per window
+ * to do the swap.
+ */
+Status XdbeSwapBuffers (
+ Display *dpy,
+ XdbeSwapInfo *swap_info,
+ int num_windows)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ register xDbeSwapBuffersReq *req;
+ int i;
+
+ DbeCheckExtension (dpy, info, (Status)0 /* failure */);
+
+ LockDisplay (dpy);
+ DbeGetReq (DbeSwapBuffers, req, info);
+ req->length += 2*num_windows;
+ req->n = num_windows;
+
+ /* We need to handle 64-bit machines, where we can not use PackData32
+ * directly because info would be lost in translating from 32- to 64-bit.
+ * Instead we send data via a loop that accounts for the translation.
+ */
+ for (i = 0; i < num_windows; i++)
+ {
+ char tmp[4];
+ Data32 (dpy, (long *)&swap_info[i].swap_window, 4);
+ tmp[0] = swap_info[i].swap_action;
+ Data (dpy, (char *)tmp, 4);
+ }
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+
+
+ return (Status)1; /* success */
+
+} /* XdbeSwapBuffers() */
+
+
+/*
+ * XdbeBeginIdiom -
+ * This function marks the beginning of an idiom sequence.
+ */
+Status XdbeBeginIdiom (Display *dpy)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ register xDbeBeginIdiomReq *req;
+
+ DbeCheckExtension (dpy, info, (Status)0 /* failure */);
+
+ LockDisplay (dpy);
+ DbeGetReq (DbeBeginIdiom, req, info);
+ UnlockDisplay (dpy);
+ SyncHandle ();
+
+ return (Status)1; /* success */
+}
+
+
+/*
+ * XdbeEndIdiom -
+ * This function marks the end of an idiom sequence.
+ */
+Status XdbeEndIdiom (Display *dpy)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ register xDbeEndIdiomReq *req;
+
+ DbeCheckExtension (dpy, info, (Status)0 /* failure */);
+
+ LockDisplay (dpy);
+ DbeGetReq (DbeEndIdiom, req, info);
+ UnlockDisplay (dpy);
+ SyncHandle ();
+
+ return (Status)1; /* success */
+}
+
+
+/*
+ * XdbeGetVisualInfo -
+ * This function returns information about which visuals support
+ * double buffering. The argument num_screens specifies how many
+ * elements there are in the screen_specifiers list. Each drawable
+ * in screen_specifiers designates a screen for which the supported
+ * visuals are being requested. If num_screens is zero, information
+ * for all screens is requested. In this case, upon return from this
+ * function, num_screens will be set to the number of screens that were
+ * found. If an error occurs, this function returns NULL, else it returns
+ * a pointer to a list of XdbeScreenVisualInfo structures of length
+ * num_screens. The nth element in the returned list corresponds to the
+ * nth drawable in the screen_specifiers list, unless num_screens was
+ * passed in with the value zero, in which case the nth element in the
+ * returned list corresponds to the nth screen of the server, starting
+ * with screen zero.
+ */
+XdbeScreenVisualInfo *XdbeGetVisualInfo (
+ Display *dpy,
+ Drawable *screen_specifiers,
+ int *num_screens) /* SEND and RETURN */
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ register xDbeGetVisualInfoReq *req;
+ xDbeGetVisualInfoReply rep;
+ XdbeScreenVisualInfo *scrVisInfo;
+ int i;
+
+ DbeCheckExtension (dpy, info, (XdbeScreenVisualInfo *)NULL);
+
+ LockDisplay (dpy);
+
+ DbeGetReq(DbeGetVisualInfo, req, info);
+ req->length = 2 + *num_screens;
+ req->n = *num_screens;
+ Data32 (dpy, screen_specifiers, (*num_screens * sizeof (CARD32)));
+
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ /* return the number of screens actually found if we
+ * requested information about all screens (*num_screens == 0)
+ */
+ if (*num_screens == 0)
+ *num_screens = rep.m;
+
+ /* allocate list of visual information to be returned */
+ if (!(scrVisInfo =
+ (XdbeScreenVisualInfo *)Xmalloc(
+ (unsigned)(*num_screens * sizeof(XdbeScreenVisualInfo))))) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ for (i = 0; i < *num_screens; i++)
+ {
+ int nbytes;
+ int j;
+ long c;
+
+ _XRead32 (dpy, &c, sizeof(CARD32));
+ scrVisInfo[i].count = c;
+
+ nbytes = scrVisInfo[i].count * sizeof(XdbeVisualInfo);
+
+ /* if we can not allocate the list of visual/depth info
+ * then free the lists that we already allocate as well
+ * as the visual info list itself
+ */
+ if (!(scrVisInfo[i].visinfo = (XdbeVisualInfo *)Xmalloc(
+ (unsigned)nbytes))) {
+ for (j = 0; j < i; j++) {
+ Xfree ((char *)scrVisInfo[j].visinfo);
+ }
+ Xfree ((char *)scrVisInfo);
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ /* Read the visual info item into the wire structure. Then copy each
+ * element into the library structure. The element sizes and/or
+ * padding may be different in the two structures.
+ */
+ for (j = 0; j < scrVisInfo[i].count; j++) {
+ xDbeVisInfo xvi;
+
+ _XRead (dpy, (char *)&xvi, sizeof(xDbeVisInfo));
+ scrVisInfo[i].visinfo[j].visual = xvi.visualID;
+ scrVisInfo[i].visinfo[j].depth = xvi.depth;
+ scrVisInfo[i].visinfo[j].perflevel = xvi.perfLevel;
+ }
+
+ }
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return scrVisInfo;
+
+} /* XdbeGetVisualInfo() */
+
+
+/*
+ * XdbeFreeVisualInfo -
+ * This function frees the list of XdbeScreenVisualInfo returned by the
+ * function XdbeGetVisualInfo.
+ */
+void XdbeFreeVisualInfo(XdbeScreenVisualInfo *visual_info)
+{
+ if (visual_info == NULL) {
+ return;
+ }
+
+ if (visual_info->visinfo) {
+ XFree(visual_info->visinfo);
+ }
+
+ XFree(visual_info);
+}
+
+
+/*
+ * XdbeGetBackBufferAttributes -
+ * This function returns the attributes associated with the specified
+ * buffer.
+ */
+XdbeBackBufferAttributes *XdbeGetBackBufferAttributes(
+ Display *dpy,
+ XdbeBackBuffer buffer)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ register xDbeGetBackBufferAttributesReq *req;
+ xDbeGetBackBufferAttributesReply rep;
+ XdbeBackBufferAttributes *attr;
+
+ DbeCheckExtension(dpy, info, (XdbeBackBufferAttributes *)NULL);
+
+ if (!(attr =
+ (XdbeBackBufferAttributes *)Xmalloc(sizeof(XdbeBackBufferAttributes)))) {
+ return NULL;
+ }
+
+ LockDisplay(dpy);
+ DbeGetReq(DbeGetBackBufferAttributes, req, info);
+ req->buffer = buffer;
+
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ Xfree(attr);
+ return NULL;
+ }
+ attr->window = rep.attributes;
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+
+ return attr;
+}
+
diff --git a/libXext/src/extutil.c b/libXext/src/extutil.c index ac861eaa4..144af9072 100644 --- a/libXext/src/extutil.c +++ b/libXext/src/extutil.c @@ -1,282 +1,282 @@ -/* - * $Xorg: extutil.c,v 1.4 2001/02/09 02:03:49 xorgcvs Exp $ - * -Copyright 1989, 1998 The Open Group - -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. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Jim Fulton, MIT X Consortium - * - * - * Xlib Extension-Writing Utilities - * - * This package contains utilities for writing the client API for various - * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND - * ARE SUBJECT TO CHANGE! - * - * Routines include: - * - * XextCreateExtension called once per extension - * XextDestroyExtension if no longer using extension - * XextAddDisplay add another display - * XextRemoveDisplay remove a display - * XextFindDisplay is a display open - * - * In addition, the following Xlib-style interfaces are provided: - * - * XSetExtensionErrorHandler establish an extension error handler - * XMissingExtension raise an error about missing ext - */ -/* $XFree86: xc/lib/Xext/extutil.c,v 1.5 2002/10/16 00:37:27 dawes Exp $ */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <stdio.h> -#include <X11/Xlibint.h> -#include <X11/extensions/Xext.h> -#include <X11/extensions/extutil.h> -#include <X11/extensions/ge.h> - -/* defined in Xge.c */ -extern Bool -xgeExtRegister(Display* dpy, int extension, XExtensionHooks* callbacks); - -/* - * XextCreateExtension - return an extension descriptor containing context - * information for this extension. This object is passed to all Xext - * routines. - */ -XExtensionInfo *XextCreateExtension (void) -{ - register XExtensionInfo *info = - (XExtensionInfo *) Xmalloc (sizeof (XExtensionInfo)); - - if (info) { - info->head = NULL; - info->cur = NULL; - info->ndisplays = 0; - } - return info; -} - - -/* - * XextDestroyExtension - free memory the given extension descriptor - */ -void XextDestroyExtension (XExtensionInfo *info) -{ - info->head = NULL; /* to catch refs after this */ - info->cur = NULL; - info->ndisplays = 0; - XFree ((char *) info); -} - - - -/* - * XextAddDisplay - add a display to this extension - */ -XExtDisplayInfo *XextAddDisplay ( - XExtensionInfo *extinfo, - Display *dpy, - char *ext_name, - XExtensionHooks *hooks, - int nevents, - XPointer data) -{ - XExtDisplayInfo *dpyinfo; - - dpyinfo = (XExtDisplayInfo *) Xmalloc (sizeof (XExtDisplayInfo)); - if (!dpyinfo) return NULL; - dpyinfo->display = dpy; - dpyinfo->data = data; - dpyinfo->codes = XInitExtension (dpy, ext_name); - - /* - * if the server has the extension, then we can initialize the - * appropriate function vectors - */ - if (dpyinfo->codes) { - int i, j; - - for (i = 0, j = dpyinfo->codes->first_event; i < nevents; i++, j++) { - XESetWireToEvent (dpy, j, hooks->wire_to_event); - XESetEventToWire (dpy, j, hooks->event_to_wire); - } - - /* register extension for XGE */ - if (strcmp(ext_name, GE_NAME)) - xgeExtRegister(dpy, dpyinfo->codes->major_opcode, hooks); - - if (hooks->create_gc) - XESetCreateGC (dpy, dpyinfo->codes->extension, hooks->create_gc); - if (hooks->copy_gc) - XESetCopyGC (dpy, dpyinfo->codes->extension, hooks->copy_gc); - if (hooks->flush_gc) - XESetFlushGC (dpy, dpyinfo->codes->extension, hooks->flush_gc); - if (hooks->free_gc) - XESetFreeGC (dpy, dpyinfo->codes->extension, hooks->free_gc); - if (hooks->create_font) - XESetCreateFont (dpy, dpyinfo->codes->extension, hooks->create_font); - if (hooks->free_font) - XESetFreeFont (dpy, dpyinfo->codes->extension, hooks->free_font); - if (hooks->close_display) - XESetCloseDisplay (dpy, dpyinfo->codes->extension, - hooks->close_display); - if (hooks->error) - XESetError (dpy, dpyinfo->codes->extension, hooks->error); - if (hooks->error_string) - XESetErrorString (dpy, dpyinfo->codes->extension, - hooks->error_string); - } else if (hooks->close_display) { - /* The server doesn't have this extension. - * Use a private Xlib-internal extension to hang the close_display - * hook on so that the "cache" (extinfo->cur) is properly cleaned. - * (XBUG 7955) - */ - XExtCodes *codes = XAddExtension(dpy); - if (!codes) { - XFree(dpyinfo); - return NULL; - } - XESetCloseDisplay (dpy, codes->extension, hooks->close_display); - } - - /* - * now, chain it onto the list - */ - _XLockMutex(_Xglobal_lock); - dpyinfo->next = extinfo->head; - extinfo->head = dpyinfo; - extinfo->cur = dpyinfo; - extinfo->ndisplays++; - _XUnlockMutex(_Xglobal_lock); - return dpyinfo; -} - - -/* - * XextRemoveDisplay - remove the indicated display from the extension object - */ -int XextRemoveDisplay (XExtensionInfo *extinfo, Display *dpy) -{ - XExtDisplayInfo *dpyinfo, *prev; - - /* - * locate this display and its back link so that it can be removed - */ - _XLockMutex(_Xglobal_lock); - prev = NULL; - for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) { - if (dpyinfo->display == dpy) break; - prev = dpyinfo; - } - if (!dpyinfo) { - _XUnlockMutex(_Xglobal_lock); - return 0; /* hmm, actually an error */ - } - - /* - * remove the display from the list; handles going to zero - */ - if (prev) - prev->next = dpyinfo->next; - else - extinfo->head = dpyinfo->next; - - extinfo->ndisplays--; - if (dpyinfo == extinfo->cur) extinfo->cur = NULL; /* flush cache */ - _XUnlockMutex(_Xglobal_lock); - - Xfree ((char *) dpyinfo); - return 1; -} - - -/* - * XextFindDisplay - look for a display in this extension; keeps a cache - * of the most-recently used for efficiency. - */ -XExtDisplayInfo *XextFindDisplay (XExtensionInfo *extinfo, Display *dpy) -{ - register XExtDisplayInfo *dpyinfo; - - /* - * see if this was the most recently accessed display - */ - if ((dpyinfo = extinfo->cur)&& dpyinfo->display == dpy) return dpyinfo; - - - /* - * look for display in list - */ - _XLockMutex(_Xglobal_lock); - for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) { - if (dpyinfo->display == dpy) { - extinfo->cur = dpyinfo; /* cache most recently used */ - _XUnlockMutex(_Xglobal_lock); - return dpyinfo; - } - } - _XUnlockMutex(_Xglobal_lock); - - return NULL; -} - - - -static int _default_exterror (Display *dpy, _Xconst char *ext_name, _Xconst char *reason) -{ - fprintf (stderr, "Xlib: extension \"%s\" %s on display \"%s\".\n", - ext_name, reason, DisplayString(dpy)); - return 0; -} - - -/* - * XSetExtensionErrorHandler - sets the handler that gets called when a - * requested extension is referenced. This should eventually move into Xlib. - */ - -extern XextErrorHandler _XExtensionErrorFunction; - -XextErrorHandler XSetExtensionErrorHandler (XextErrorHandler handler) -{ - XextErrorHandler oldhandler = _XExtensionErrorFunction; - - _XExtensionErrorFunction = (handler ? handler : - _default_exterror); - return oldhandler; -} - - -/* - * XMissingExtension - call the extension error handler - */ -int XMissingExtension (Display *dpy, _Xconst char *ext_name) -{ - XextErrorHandler func = (_XExtensionErrorFunction ? - _XExtensionErrorFunction : _default_exterror); - - if (!ext_name) ext_name = X_EXTENSION_UNKNOWN; - return (*func) (dpy, ext_name, X_EXTENSION_MISSING); -} +/*
+ * $Xorg: extutil.c,v 1.4 2001/02/09 02:03:49 xorgcvs Exp $
+ *
+Copyright 1989, 1998 The Open Group
+
+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.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ * Author: Jim Fulton, MIT X Consortium
+ *
+ *
+ * Xlib Extension-Writing Utilities
+ *
+ * This package contains utilities for writing the client API for various
+ * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
+ * ARE SUBJECT TO CHANGE!
+ *
+ * Routines include:
+ *
+ * XextCreateExtension called once per extension
+ * XextDestroyExtension if no longer using extension
+ * XextAddDisplay add another display
+ * XextRemoveDisplay remove a display
+ * XextFindDisplay is a display open
+ *
+ * In addition, the following Xlib-style interfaces are provided:
+ *
+ * XSetExtensionErrorHandler establish an extension error handler
+ * XMissingExtension raise an error about missing ext
+ */
+/* $XFree86: xc/lib/Xext/extutil.c,v 1.5 2002/10/16 00:37:27 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
+#include <X11/Xlibint.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
+#include <X11/extensions/ge.h>
+
+/* defined in Xge.c */
+extern _X_HIDDEN Bool
+xgeExtRegister(Display* dpy, int extension, XExtensionHooks* callbacks);
+
+/*
+ * XextCreateExtension - return an extension descriptor containing context
+ * information for this extension. This object is passed to all Xext
+ * routines.
+ */
+XExtensionInfo *XextCreateExtension (void)
+{
+ register XExtensionInfo *info =
+ (XExtensionInfo *) Xmalloc (sizeof (XExtensionInfo));
+
+ if (info) {
+ info->head = NULL;
+ info->cur = NULL;
+ info->ndisplays = 0;
+ }
+ return info;
+}
+
+
+/*
+ * XextDestroyExtension - free memory the given extension descriptor
+ */
+void XextDestroyExtension (XExtensionInfo *info)
+{
+ info->head = NULL; /* to catch refs after this */
+ info->cur = NULL;
+ info->ndisplays = 0;
+ XFree ((char *) info);
+}
+
+
+
+/*
+ * XextAddDisplay - add a display to this extension
+ */
+XExtDisplayInfo *XextAddDisplay (
+ XExtensionInfo *extinfo,
+ Display *dpy,
+ char *ext_name,
+ XExtensionHooks *hooks,
+ int nevents,
+ XPointer data)
+{
+ XExtDisplayInfo *dpyinfo;
+
+ dpyinfo = (XExtDisplayInfo *) Xmalloc (sizeof (XExtDisplayInfo));
+ if (!dpyinfo) return NULL;
+ dpyinfo->display = dpy;
+ dpyinfo->data = data;
+ dpyinfo->codes = XInitExtension (dpy, ext_name);
+
+ /*
+ * if the server has the extension, then we can initialize the
+ * appropriate function vectors
+ */
+ if (dpyinfo->codes) {
+ int i, j;
+
+ for (i = 0, j = dpyinfo->codes->first_event; i < nevents; i++, j++) {
+ XESetWireToEvent (dpy, j, hooks->wire_to_event);
+ XESetEventToWire (dpy, j, hooks->event_to_wire);
+ }
+
+ /* register extension for XGE */
+ if (strcmp(ext_name, GE_NAME))
+ xgeExtRegister(dpy, dpyinfo->codes->major_opcode, hooks);
+
+ if (hooks->create_gc)
+ XESetCreateGC (dpy, dpyinfo->codes->extension, hooks->create_gc);
+ if (hooks->copy_gc)
+ XESetCopyGC (dpy, dpyinfo->codes->extension, hooks->copy_gc);
+ if (hooks->flush_gc)
+ XESetFlushGC (dpy, dpyinfo->codes->extension, hooks->flush_gc);
+ if (hooks->free_gc)
+ XESetFreeGC (dpy, dpyinfo->codes->extension, hooks->free_gc);
+ if (hooks->create_font)
+ XESetCreateFont (dpy, dpyinfo->codes->extension, hooks->create_font);
+ if (hooks->free_font)
+ XESetFreeFont (dpy, dpyinfo->codes->extension, hooks->free_font);
+ if (hooks->close_display)
+ XESetCloseDisplay (dpy, dpyinfo->codes->extension,
+ hooks->close_display);
+ if (hooks->error)
+ XESetError (dpy, dpyinfo->codes->extension, hooks->error);
+ if (hooks->error_string)
+ XESetErrorString (dpy, dpyinfo->codes->extension,
+ hooks->error_string);
+ } else if (hooks->close_display) {
+ /* The server doesn't have this extension.
+ * Use a private Xlib-internal extension to hang the close_display
+ * hook on so that the "cache" (extinfo->cur) is properly cleaned.
+ * (XBUG 7955)
+ */
+ XExtCodes *codes = XAddExtension(dpy);
+ if (!codes) {
+ XFree(dpyinfo);
+ return NULL;
+ }
+ XESetCloseDisplay (dpy, codes->extension, hooks->close_display);
+ }
+
+ /*
+ * now, chain it onto the list
+ */
+ _XLockMutex(_Xglobal_lock);
+ dpyinfo->next = extinfo->head;
+ extinfo->head = dpyinfo;
+ extinfo->cur = dpyinfo;
+ extinfo->ndisplays++;
+ _XUnlockMutex(_Xglobal_lock);
+ return dpyinfo;
+}
+
+
+/*
+ * XextRemoveDisplay - remove the indicated display from the extension object
+ */
+int XextRemoveDisplay (XExtensionInfo *extinfo, Display *dpy)
+{
+ XExtDisplayInfo *dpyinfo, *prev;
+
+ /*
+ * locate this display and its back link so that it can be removed
+ */
+ _XLockMutex(_Xglobal_lock);
+ prev = NULL;
+ for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) {
+ if (dpyinfo->display == dpy) break;
+ prev = dpyinfo;
+ }
+ if (!dpyinfo) {
+ _XUnlockMutex(_Xglobal_lock);
+ return 0; /* hmm, actually an error */
+ }
+
+ /*
+ * remove the display from the list; handles going to zero
+ */
+ if (prev)
+ prev->next = dpyinfo->next;
+ else
+ extinfo->head = dpyinfo->next;
+
+ extinfo->ndisplays--;
+ if (dpyinfo == extinfo->cur) extinfo->cur = NULL; /* flush cache */
+ _XUnlockMutex(_Xglobal_lock);
+
+ Xfree ((char *) dpyinfo);
+ return 1;
+}
+
+
+/*
+ * XextFindDisplay - look for a display in this extension; keeps a cache
+ * of the most-recently used for efficiency.
+ */
+XExtDisplayInfo *XextFindDisplay (XExtensionInfo *extinfo, Display *dpy)
+{
+ register XExtDisplayInfo *dpyinfo;
+
+ /*
+ * see if this was the most recently accessed display
+ */
+ if ((dpyinfo = extinfo->cur)&& dpyinfo->display == dpy) return dpyinfo;
+
+
+ /*
+ * look for display in list
+ */
+ _XLockMutex(_Xglobal_lock);
+ for (dpyinfo = extinfo->head; dpyinfo; dpyinfo = dpyinfo->next) {
+ if (dpyinfo->display == dpy) {
+ extinfo->cur = dpyinfo; /* cache most recently used */
+ _XUnlockMutex(_Xglobal_lock);
+ return dpyinfo;
+ }
+ }
+ _XUnlockMutex(_Xglobal_lock);
+
+ return NULL;
+}
+
+
+
+static int _default_exterror (Display *dpy, _Xconst char *ext_name, _Xconst char *reason)
+{
+ fprintf (stderr, "Xlib: extension \"%s\" %s on display \"%s\".\n",
+ ext_name, reason, DisplayString(dpy));
+ return 0;
+}
+
+
+/*
+ * XSetExtensionErrorHandler - sets the handler that gets called when a
+ * requested extension is referenced. This should eventually move into Xlib.
+ */
+
+extern XextErrorHandler _XExtensionErrorFunction;
+
+XextErrorHandler XSetExtensionErrorHandler (XextErrorHandler handler)
+{
+ XextErrorHandler oldhandler = _XExtensionErrorFunction;
+
+ _XExtensionErrorFunction = (handler ? handler :
+ _default_exterror);
+ return oldhandler;
+}
+
+
+/*
+ * XMissingExtension - call the extension error handler
+ */
+int XMissingExtension (Display *dpy, _Xconst char *ext_name)
+{
+ XextErrorHandler func = (_XExtensionErrorFunction ?
+ _XExtensionErrorFunction : _default_exterror);
+
+ if (!ext_name) ext_name = X_EXTENSION_UNKNOWN;
+ return (*func) (dpy, ext_name, X_EXTENSION_MISSING);
+}
|