diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2013-03-09 16:34:38 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2013-03-09 16:34:38 +0000 |
commit | 3e338c9cd51f4e327ed9fe626fefbe35d03aac93 (patch) | |
tree | fc533a7ff5f39950a479e9d9b4b7856d156847a6 /lib/libXrandr/src | |
parent | 0186d1252763bdcf11925666c74ff46f2ef2dc4b (diff) |
Update to libXrandr 1.4.0
Diffstat (limited to 'lib/libXrandr/src')
-rw-r--r-- | lib/libXrandr/src/Makefile.am | 6 | ||||
-rw-r--r-- | lib/libXrandr/src/Makefile.in | 412 | ||||
-rw-r--r-- | lib/libXrandr/src/Xrandr.c | 85 | ||||
-rw-r--r-- | lib/libXrandr/src/Xrandrint.h | 8 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrConfig.c | 44 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrCrtc.c | 24 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrMode.c | 8 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrOutput.c | 19 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrProperty.c | 4 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrProvider.c | 217 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrProviderProperty.c | 339 | ||||
-rw-r--r-- | lib/libXrandr/src/XrrScreen.c | 14 |
12 files changed, 972 insertions, 208 deletions
diff --git a/lib/libXrandr/src/Makefile.am b/lib/libXrandr/src/Makefile.am index 85b05da75..7a47b9c4b 100644 --- a/lib/libXrandr/src/Makefile.am +++ b/lib/libXrandr/src/Makefile.am @@ -8,7 +8,9 @@ libXrandr_la_SOURCES = \ XrrMode.c \ XrrOutput.c \ XrrProperty.c \ - XrrScreen.c + XrrScreen.c \ + XrrProvider.c \ + XrrProviderProperty.c libXrandr_la_LIBADD = @RANDR_LIBS@ @@ -22,4 +24,4 @@ INCLUDES = -I$(top_srcdir)/include/X11/extensions libXrandr_la_LDFLAGS = -version-number 2:2:0 -no-undefined libXrandrincludedir = $(includedir)/X11/extensions -libXrandrinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xrandr.h +libXrandrinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xrandr.h diff --git a/lib/libXrandr/src/Makefile.in b/lib/libXrandr/src/Makefile.in index cb7f673d1..a03b414c4 100644 --- a/lib/libXrandr/src/Makefile.in +++ b/lib/libXrandr/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1994-2012 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. @@ -15,18 +15,32 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 -install_sh_PROGRAM = ${SHELL} $(install_sh) -c -install_sh_SCRIPT = ${SHELL} $(install_sh) -c +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 = : @@ -39,42 +53,98 @@ build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = $(libXrandrinclude_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in + $(srcdir)/Makefile.in $(top_srcdir)/depcomp 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 = $(SHELL) $(install_sh) -d +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 = `echo $$p | sed -e 's|^.*/||'`; +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__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libXrandrincludedir)" -libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libXrandr_la_DEPENDENCIES = am_libXrandr_la_OBJECTS = Xrandr.lo XrrConfig.lo XrrCrtc.lo XrrMode.lo \ - XrrOutput.lo XrrProperty.lo XrrScreen.lo + XrrOutput.lo XrrProperty.lo XrrScreen.lo XrrProvider.lo \ + XrrProviderProperty.lo libXrandr_la_OBJECTS = $(am_libXrandr_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libXrandr_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libXrandr_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +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) --tag=CC --mode=compile $(CC) $(DEFS) \ +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_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +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_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libXrandr_la_SOURCES) DIST_SOURCES = $(libXrandr_la_SOURCES) -libXrandrincludeHEADERS_INSTALL = $(INSTALL_HEADER) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(libXrandrinclude_HEADERS) ETAGS = etags CTAGS = ctags @@ -82,8 +152,6 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ @@ -93,6 +161,7 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -100,55 +169,59 @@ 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@ +DLLTOOL = @DLLTOOL@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ +INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MALLOC_ZERO_CFLAGS = @MALLOC_ZERO_CFLAGS@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ @@ -159,18 +232,19 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ XMALLOC_ZERO_CFLAGS = @XMALLOC_ZERO_CFLAGS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -182,6 +256,7 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -209,8 +284,12 @@ 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 = libXrandr.la libXrandr_la_SOURCES = \ Xrandr.c \ @@ -220,7 +299,9 @@ libXrandr_la_SOURCES = \ XrrMode.c \ XrrOutput.c \ XrrProperty.c \ - XrrScreen.c + XrrScreen.c \ + XrrProvider.c \ + XrrProviderProperty.c libXrandr_la_LIBADD = @RANDR_LIBS@ AM_CFLAGS = \ @@ -231,7 +312,7 @@ AM_CFLAGS = \ INCLUDES = -I$(top_srcdir)/include/X11/extensions libXrandr_la_LDFLAGS = -version-number 2:2:0 -no-undefined libXrandrincludedir = $(includedir)/X11/extensions -libXrandrinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xrandr.h +libXrandrinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xrandr.h all: all-am .SUFFIXES: @@ -240,14 +321,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( 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'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile + 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 \ @@ -265,35 +346,43 @@ $(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)'; for p in $$list; do \ + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + 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) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + @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 -libXrandr.la: $(libXrandr_la_OBJECTS) $(libXrandr_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libXrandr_la_LDFLAGS) $(libXrandr_la_OBJECTS) $(libXrandr_la_LIBADD) $(LIBS) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libXrandr.la: $(libXrandr_la_OBJECTS) $(libXrandr_la_DEPENDENCIES) $(EXTRA_libXrandr_la_DEPENDENCIES) + $(AM_V_CCLD)$(libXrandr_la_LINK) -rpath $(libdir) $(libXrandr_la_OBJECTS) $(libXrandr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -307,129 +396,151 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrrMode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrrOutput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrrProperty.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrrProvider.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrrProviderProperty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrrScreen.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@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 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@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 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@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 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: install-libXrandrincludeHEADERS: $(libXrandrinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libXrandrincludedir)" || $(mkdir_p) "$(DESTDIR)$(libXrandrincludedir)" - @list='$(libXrandrinclude_HEADERS)'; for p in $$list; do \ + @list='$(libXrandrinclude_HEADERS)'; test -n "$(libXrandrincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libXrandrincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libXrandrincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(libXrandrincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libXrandrincludedir)/$$f'"; \ - $(libXrandrincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libXrandrincludedir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libXrandrincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libXrandrincludedir)" || exit $$?; \ done uninstall-libXrandrincludeHEADERS: @$(NORMAL_UNINSTALL) - @list='$(libXrandrinclude_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(libXrandrincludedir)/$$f'"; \ - rm -f "$(DESTDIR)$(libXrandrincludedir)/$$f"; \ - done + @list='$(libXrandrinclude_HEADERS)'; test -n "$(libXrandrincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libXrandrincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(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) - tags=; \ + 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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(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; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + 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) - tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + $(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) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - $(mkdir_p) $(distdir)/../include/X11/extensions - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @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; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + 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 -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -438,7 +549,7 @@ check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libXrandrincludedir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -450,16 +561,22 @@ install-am: all-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 + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi 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" @@ -473,7 +590,7 @@ distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags + distclean-tags dvi: dvi-am @@ -481,18 +598,38 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: install-data-am: install-libXrandrincludeHEADERS +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 @@ -513,23 +650,28 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ +uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libXrandrincludeHEADERS +.MAKE: install-am install-strip + .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ + clean-libLTLIBRARIES clean-libtool cscopelist 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-exec \ - install-exec-am install-info install-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-libXrandrincludeHEADERS \ - install-man install-strip installcheck installcheck-am \ + 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-info-am uninstall-libLTLIBRARIES \ + uninstall-am uninstall-libLTLIBRARIES \ uninstall-libXrandrincludeHEADERS + # 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/lib/libXrandr/src/Xrandr.c b/lib/libXrandr/src/Xrandr.c index 8ab1eaed5..b1e97ec30 100644 --- a/lib/libXrandr/src/Xrandr.c +++ b/lib/libXrandr/src/Xrandr.c @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Jim Gettys, HP Labs, HP. @@ -137,7 +137,46 @@ static Bool XRRWireToEvent(Display *dpy, XEvent *event, xEvent *wire) aevent->state = awire->state; return True; } - + case RRNotify_ProviderChange: { + XRRProviderChangeNotifyEvent *aevent = (XRRProviderChangeNotifyEvent *) event; + xRRProviderChangeNotifyEvent *awire = (xRRProviderChangeNotifyEvent *) wire; + aevent->type = awire->type & 0x7F; + aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire); + aevent->send_event = (awire->type & 0x80) != 0; + aevent->display = dpy; + aevent->window = awire->window; + aevent->subtype = awire->subCode; + aevent->provider = awire->provider; + aevent->timestamp = awire->timestamp; + return True; + } + case RRNotify_ProviderProperty: { + XRRProviderPropertyNotifyEvent *aevent = (XRRProviderPropertyNotifyEvent *) event; + xRRProviderPropertyNotifyEvent *awire = (xRRProviderPropertyNotifyEvent *) wire; + aevent->type = awire->type & 0x7F; + aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire); + aevent->send_event = (awire->type & 0x80) != 0; + aevent->display = dpy; + aevent->window = awire->window; + aevent->subtype = awire->subCode; + aevent->provider = awire->provider; + aevent->property = awire->atom; + aevent->timestamp = awire->timestamp; + aevent->state = awire->state; + return True; + } + case RRNotify_ResourceChange: { + XRRResourceChangeNotifyEvent *aevent = (XRRResourceChangeNotifyEvent *) event; + xRRResourceChangeNotifyEvent *awire = (xRRResourceChangeNotifyEvent *) wire; + aevent->type = awire->type & 0x7F; + aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire); + aevent->send_event = (awire->type & 0x80) != 0; + aevent->display = dpy; + aevent->window = awire->window; + aevent->subtype = awire->subCode; + aevent->timestamp = awire->timestamp; + return True; + } break; } } @@ -214,6 +253,30 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire) awire->state = aevent->state; return True; } + case RRNotify_ProviderChange: { + xRRProviderChangeNotifyEvent *awire = (xRRProviderChangeNotifyEvent *) wire; + XRRProviderChangeNotifyEvent *aevent = (XRRProviderChangeNotifyEvent *) event; + awire->window = aevent->window; + awire->provider = aevent->provider; + return True; + } + case RRNotify_ProviderProperty: { + xRRProviderPropertyNotifyEvent *awire = (xRRProviderPropertyNotifyEvent *) wire; + XRRProviderPropertyNotifyEvent *aevent = (XRRProviderPropertyNotifyEvent *) event; + awire->window = aevent->window; + awire->provider = aevent->provider; + awire->atom = aevent->property; + awire->timestamp = aevent->timestamp; + awire->state = aevent->state; + return True; + } + case RRNotify_ResourceChange: { + xRRResourceChangeNotifyEvent *awire = (xRRResourceChangeNotifyEvent *) wire; + XRRResourceChangeNotifyEvent *aevent = (XRRResourceChangeNotifyEvent *) event; + awire->window = aevent->window; + awire->timestamp = aevent->timestamp; + return True; + } } } } @@ -229,15 +292,15 @@ XRRFindDisplay (Display *dpy) dpyinfo = XextFindDisplay (&XRRExtensionInfo, dpy); if (!dpyinfo) { - dpyinfo = XextAddDisplay (&XRRExtensionInfo, dpy, + dpyinfo = XextAddDisplay (&XRRExtensionInfo, dpy, XRRExtensionName, &rr_extension_hooks, RRNumberEvents, NULL); numscreens = ScreenCount(dpy); - xrri = Xmalloc (sizeof(XRandRInfo) + + xrri = Xmalloc (sizeof(XRandRInfo) + sizeof(char *) * numscreens); xrri->config = (XRRScreenConfiguration **)(xrri + 1); - for(i = 0; i < numscreens; i++) + for(i = 0; i < numscreens; i++) xrri->config[i] = NULL; xrri->major_version = -1; dpyinfo->data = (char *) xrri; @@ -316,7 +379,7 @@ Status XRRQueryVersion (Display *dpy, xrri = (XRandRInfo *) info->data; - /* + /* * only get the version information from the server if we don't have it already */ if (xrri->major_version == -1) { @@ -369,7 +432,7 @@ _XRRVersionHandler (Display *dpy, return True; } -/* +/* * in protocol version 0.1, routine added to allow selecting for new events. */ @@ -418,7 +481,7 @@ int XRRUpdateConfiguration(XEvent *event) switch (event->type - info->codes->first_event) { case RRScreenChangeNotify: scevent = (XRRScreenChangeNotifyEvent *) event; - snum = XRRRootToScreen(dpy, + snum = XRRRootToScreen(dpy, ((XRRScreenChangeNotifyEvent *) event)->root); if (scevent->rotation & (RR_Rotate_90 | RR_Rotate_270)) { dpy->screens[snum].width = scevent->height; @@ -437,9 +500,9 @@ int XRRUpdateConfiguration(XEvent *event) return 0; } xrri = (XRandRInfo *) info->data; - /* - * so the next time someone wants some data, it will be fetched; - * it might be better to force the round trip immediately, but + /* + * so the next time someone wants some data, it will be fetched; + * it might be better to force the round trip immediately, but * I dislike pounding the server simultaneously when not necessary */ if (xrri->config[snum] != NULL) { diff --git a/lib/libXrandr/src/Xrandrint.h b/lib/libXrandr/src/Xrandrint.h index 7fb5831ef..aed10e478 100644 --- a/lib/libXrandr/src/Xrandrint.h +++ b/lib/libXrandr/src/Xrandrint.h @@ -1,5 +1,5 @@ /* - * Copyright © 2000, Compaq Computer Corporation, + * Copyright © 2000, Compaq Computer Corporation, * Copyright © 2002, Hewlett Packard, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP * 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 + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. @@ -43,7 +43,7 @@ extern char XRRExtensionName[]; XExtDisplayInfo *XRRFindDisplay (Display *dpy); -/* deliberately opaque internal data structure; can be extended, +/* deliberately opaque internal data structure; can be extended, but not reordered */ struct _XRRScreenConfiguration { Screen *screen; /* the root window in GetScreenInfo */ @@ -69,7 +69,7 @@ struct _XRRScreenConfiguration { * when next used. Returns invalid status if not an event type * the library routine understand. */ - + /* we cache one screen configuration/screen */ typedef struct _XRandRInfo { diff --git a/lib/libXrandr/src/XrrConfig.c b/lib/libXrandr/src/XrrConfig.c index 793d8b6ee..2f0282b61 100644 --- a/lib/libXrandr/src/XrrConfig.c +++ b/lib/libXrandr/src/XrrConfig.c @@ -82,7 +82,7 @@ Time XRRConfigTimes (XRRScreenConfiguration *config, Time *config_timestamp) } -SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config, +SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config, Rotation *rotation) { *rotation = (Rotation) config->current_rotation; @@ -94,11 +94,11 @@ short XRRConfigCurrentRate (XRRScreenConfiguration *config) return config->current_rate; } -/* - * Go get the screen configuration data and salt it away for future use; +/* + * Go get the screen configuration data and salt it away for future use; * returns NULL if extension not supported */ -static XRRScreenConfiguration *_XRRValidateCache (Display *dpy, +static XRRScreenConfiguration *_XRRValidateCache (Display *dpy, XExtDisplayInfo *info, int screen) { @@ -140,7 +140,7 @@ Rotation XRRRotations(Display *dpy, int screen, Rotation *current_rotation) /* given a screen, return the information from the (possibly) cached data */ XRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes) { - XRRScreenConfiguration *config; + XRRScreenConfiguration *config; XExtDisplayInfo *info = XRRFindDisplay(dpy); XRRScreenSize *sizes; @@ -155,12 +155,12 @@ XRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes) UnlockDisplay(dpy); *nsizes = 0; return NULL; - } + } } short *XRRRates (Display *dpy, int screen, int sizeID, int *nrates) { - XRRScreenConfiguration *config; + XRRScreenConfiguration *config; XExtDisplayInfo *info = XRRFindDisplay(dpy); short *rates; @@ -174,13 +174,13 @@ short *XRRRates (Display *dpy, int screen, int sizeID, int *nrates) UnlockDisplay(dpy); *nrates = 0; return NULL; - } + } } /* given a screen, return the information from the (possibly) cached data */ Time XRRTimes (Display *dpy, int screen, Time *config_timestamp) { - XRRScreenConfiguration *config; + XRRScreenConfiguration *config; XExtDisplayInfo *info = XRRFindDisplay(dpy); Time ts; @@ -227,7 +227,7 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, vreq->randrReqType = X_RRQueryVersion; vreq->majorVersion = RANDR_MAJOR; vreq->minorVersion = RANDR_MINOR; - + async_state.version_seq = dpy->request; async_state.error = False; async.next = dpy->async_handlers; @@ -272,14 +272,14 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, rep.rate = 0; rep.nrateEnts = 0; } - + nbytes = (long) rep.length << 2; nbytesRead = (long) (rep.nSizes * SIZEOF (xScreenSizes) + ((rep.nrateEnts + 1)& ~1) * 2 /* SIZEOF (CARD16) */); - - /* - * first we must compute how much space to allocate for + + /* + * first we must compute how much space to allocate for * randr library's use; we'll allocate the structures in a single * allocation, on cleanlyness grounds. */ @@ -299,7 +299,7 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, rates = (short *) (ssp + rep.nSizes); /* set up the screen configuration structure */ - scp->screen = + scp->screen = ScreenOfDisplay (dpy, XRRRootToScreen(dpy, rep.root)); scp->sizes = ssp; @@ -322,7 +322,7 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, */ for (i = 0; i < rep.nSizes; i++) { _XReadPad (dpy, (char *) &size, SIZEOF (xScreenSizes)); - + ssp[i].width = size.widthInPixels; ssp[i].height = size.heightInPixels; ssp[i].mwidth = size.widthInMillimeters; @@ -332,13 +332,13 @@ static XRRScreenConfiguration *_XRRGetScreenInfo (Display *dpy, * And the rates */ _XRead16Pad (dpy, rates, 2 /* SIZEOF (CARD16) */ * rep.nrateEnts); - + /* * Skip any extra data */ if (nbytes > nbytesRead) _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); - + return (XRRScreenConfiguration *)(scp); } @@ -354,7 +354,7 @@ XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy, Window window) return config; } - + void XRRFreeScreenConfigInfo (XRRScreenConfiguration *config) { Xfree (config); @@ -364,7 +364,7 @@ Status XRRSetScreenConfigAndRate (Display *dpy, XRRScreenConfiguration *config, Drawable draw, int size_index, - Rotation rotation, + Rotation rotation, short rate, Time timestamp) { @@ -378,7 +378,7 @@ Status XRRSetScreenConfigAndRate (Display *dpy, /* Make sure has_rates is set */ if (!XRRQueryVersion (dpy, &major, &minor)) return 0; - + LockDisplay (dpy); xrri = (XRandRInfo *) info->data; if (xrri->has_rates) @@ -406,7 +406,7 @@ Status XRRSetScreenConfigAndRate (Display *dpy, req->timestamp = timestamp; req->configTimestamp = config->config_timestamp; } - + (void) _XReply (dpy, (xReply *) &rep, 0, xTrue); /* actually .errorCode in struct xError */ diff --git a/lib/libXrandr/src/XrrCrtc.c b/lib/libXrandr/src/XrrCrtc.c index 697987ae2..076237376 100644 --- a/lib/libXrandr/src/XrrCrtc.c +++ b/lib/libXrandr/src/XrrCrtc.c @@ -62,8 +62,8 @@ XRRGetCrtcInfo (Display *dpy, XRRScreenResources *resources, RRCrtc crtc) nbytesRead = (long) (rep.nOutput * 4 + rep.nPossibleOutput * 4); - /* - * first we must compute how much space to allocate for + /* + * first we must compute how much space to allocate for * randr library's use; we'll allocate the structures in a single * allocation, on cleanlyness grounds. */ @@ -95,13 +95,13 @@ XRRGetCrtcInfo (Display *dpy, XRRScreenResources *resources, RRCrtc crtc) _XRead32 (dpy, xci->outputs, rep.nOutput << 2); _XRead32 (dpy, xci->possible, rep.nPossibleOutput << 2); - + /* * Skip any extra data */ if (nbytes > nbytesRead) _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); - + UnlockDisplay (dpy); SyncHandle (); return (XRRCrtcInfo *) xci; @@ -195,12 +195,12 @@ XRRGetCrtcGamma (Display *dpy, RRCrtc crtc) goto out; nbytes = (long) rep.length << 2; - + /* three channels of CARD16 data */ nbytesRead = (rep.size * 2 * 3); crtc_gamma = XRRAllocGamma (rep.size); - + if (!crtc_gamma) { _XEatData (dpy, (unsigned long) nbytes); @@ -209,7 +209,7 @@ XRRGetCrtcGamma (Display *dpy, RRCrtc crtc) _XRead16 (dpy, crtc_gamma->red, rep.size * 2); _XRead16 (dpy, crtc_gamma->green, rep.size * 2); _XRead16 (dpy, crtc_gamma->blue, rep.size * 2); - + if (nbytes > nbytesRead) _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); @@ -255,7 +255,7 @@ XRRSetCrtcGamma (Display *dpy, RRCrtc crtc, XRRCrtcGamma *crtc_gamma) * otherwise the channels might not be contiguous */ Data16 (dpy, crtc_gamma->red, crtc_gamma->size * 2 * 3); - + UnlockDisplay (dpy); SyncHandle (); } @@ -304,7 +304,7 @@ xRenderTransform_from_XTransform (xRenderTransform *render, void XRRSetCrtcTransform (Display *dpy, - RRCrtc crtc, + RRCrtc crtc, XTransform *transform, char *filter, XFixed *params, @@ -334,7 +334,7 @@ XRRSetCrtcTransform (Display *dpy, } #define CrtcTransformExtra (SIZEOF(xRRGetCrtcTransformReply) - 32) - + static const xRenderTransform identity = { 0x10000, 0, 0, 0, 0x10000, 0, @@ -364,7 +364,7 @@ XRRGetCrtcTransform (Display *dpy, RRCheckExtension (dpy, info, False); - if (!XRRQueryVersion (dpy, &major_version, &minor_version) || + if (!XRRQueryVersion (dpy, &major_version, &minor_version) || !_XRRHasTransform (major_version, minor_version)) { /* For pre-1.3 servers, just report identity matrices everywhere */ @@ -382,7 +382,7 @@ XRRGetCrtcTransform (Display *dpy, req->reqType = info->codes->major_opcode; req->randrReqType = X_RRGetCrtcTransform; req->crtc = crtc; - + if (!_XReply (dpy, (xReply *) &rep, CrtcTransformExtra >> 2, xFalse)) { rep.pendingTransform = identity; diff --git a/lib/libXrandr/src/XrrMode.c b/lib/libXrandr/src/XrrMode.c index 58ef68b50..0b74a73e4 100644 --- a/lib/libXrandr/src/XrrMode.c +++ b/lib/libXrandr/src/XrrMode.c @@ -62,9 +62,9 @@ XRRCreateMode (Display *dpy, Window window, XRRModeInfo *mode_info) req->reqType = info->codes->major_opcode; req->randrReqType = X_RRCreateMode; req->length += (mode_info->nameLength + 3) >> 2; - + req->window = window; - + req->modeInfo.id = 0; req->modeInfo.width = mode_info->width; req->modeInfo.height = mode_info->height; @@ -78,7 +78,7 @@ XRRCreateMode (Display *dpy, Window window, XRRModeInfo *mode_info) req->modeInfo.vTotal = mode_info->vTotal; req->modeInfo.nameLength = mode_info->nameLength; req->modeInfo.modeFlags = mode_info->modeFlags; - + Data (dpy, mode_info->name, mode_info->nameLength); if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { @@ -86,7 +86,7 @@ XRRCreateMode (Display *dpy, Window window, XRRModeInfo *mode_info) SyncHandle (); return None; } - + UnlockDisplay (dpy); SyncHandle (); return rep.mode; diff --git a/lib/libXrandr/src/XrrOutput.c b/lib/libXrandr/src/XrrOutput.c index 18863bdaf..f13a9327a 100644 --- a/lib/libXrandr/src/XrrOutput.c +++ b/lib/libXrandr/src/XrrOutput.c @@ -34,7 +34,7 @@ #include "Xrandrint.h" #define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32) - + XRROutputInfo * XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output) { @@ -67,8 +67,8 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output) rep.nClones * 4 + ((rep.nameLength + 3) & ~3)); - /* - * first we must compute how much space to allocate for + /* + * first we must compute how much space to allocate for * randr library's use; we'll allocate the structures in a single * allocation, on cleanlyness grounds. */ @@ -105,19 +105,20 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output) _XRead32 (dpy, xoi->crtcs, rep.nCrtcs << 2); _XRead32 (dpy, xoi->modes, rep.nModes << 2); _XRead32 (dpy, xoi->clones, rep.nClones << 2); - + /* * Read name and '\0' terminate */ _XReadPad (dpy, xoi->name, rep.nameLength); xoi->name[rep.nameLength] = '\0'; - + xoi->nameLen = rep.nameLength; + /* * Skip any extra data */ if (nbytes > nbytesRead) _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); - + UnlockDisplay (dpy); SyncHandle (); return (XRROutputInfo *) xoi; @@ -144,7 +145,7 @@ XRRSetOutputPrimary(Display *dpy, Window window, RROutput output) RRSimpleCheckExtension (dpy, info); - if (!XRRQueryVersion (dpy, &major_version, &minor_version) || + if (!XRRQueryVersion (dpy, &major_version, &minor_version) || !_XRRHasOutputPrimary (major_version, minor_version)) return; @@ -169,7 +170,7 @@ XRRGetOutputPrimary(Display *dpy, Window window) RRCheckExtension (dpy, info, 0); - if (!XRRQueryVersion (dpy, &major_version, &minor_version) || + if (!XRRQueryVersion (dpy, &major_version, &minor_version) || !_XRRHasOutputPrimary (major_version, minor_version)) return None; @@ -181,7 +182,7 @@ XRRGetOutputPrimary(Display *dpy, Window window) if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) rep.output = None; - + UnlockDisplay(dpy); SyncHandle(); diff --git a/lib/libXrandr/src/XrrProperty.c b/lib/libXrandr/src/XrrProperty.c index 1a125b276..4c3fdb000 100644 --- a/lib/libXrandr/src/XrrProperty.c +++ b/lib/libXrandr/src/XrrProperty.c @@ -159,7 +159,7 @@ XRRConfigureOutputProperty (Display *dpy, RROutput output, Atom property, UnlockDisplay(dpy); SyncHandle(); } - + void XRRChangeOutputProperty (Display *dpy, RROutput output, Atom property, Atom type, @@ -244,7 +244,7 @@ XRRDeleteOutputProperty (Display *dpy, RROutput output, Atom property) int XRRGetOutputProperty (Display *dpy, RROutput output, Atom property, long offset, long length, - Bool delete, Bool pending, Atom req_type, + Bool delete, Bool pending, Atom req_type, Atom *actual_type, int *actual_format, unsigned long *nitems, unsigned long *bytes_after, unsigned char **prop) diff --git a/lib/libXrandr/src/XrrProvider.c b/lib/libXrandr/src/XrrProvider.c new file mode 100644 index 000000000..fcd06ffca --- /dev/null +++ b/lib/libXrandr/src/XrrProvider.c @@ -0,0 +1,217 @@ +/* + * Copyright © 2011 Dave Airlie + * + * 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 the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <X11/Xlib.h> +/* we need to be able to manipulate the Display structure on events */ +#include <X11/Xlibint.h> +#include <X11/extensions/render.h> +#include <X11/extensions/Xrender.h> +#include "Xrandrint.h" + +XRRProviderResources * +XRRGetProviderResources(Display *dpy, Window window) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRGetProvidersReply rep; + xRRGetProvidersReq *req; + XRRProviderResources *xrpr; + long nbytes, nbytesRead; + int rbytes; + + RRCheckExtension (dpy, info, NULL); + + LockDisplay (dpy); + + GetReq(RRGetProviders, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRGetProviders; + req->window = window; + + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) + { + UnlockDisplay (dpy); + SyncHandle (); + return NULL; + } + + nbytes = (long) rep.length << 2; + + nbytesRead = (long) (rep.nProviders * 4); + + rbytes = (sizeof(XRRProviderResources) + rep.nProviders * sizeof(RRProvider)); + xrpr = (XRRProviderResources *) Xmalloc(rbytes); + + if (xrpr == NULL) { + _XEatData (dpy, (unsigned long) nbytes); + UnlockDisplay (dpy); + SyncHandle (); + return NULL; + } + + xrpr->timestamp = rep.timestamp; + xrpr->nproviders = rep.nProviders; + xrpr->providers = (RRProvider *)(xrpr + 1); + + _XRead32(dpy, xrpr->providers, rep.nProviders << 2); + + if (nbytes > nbytesRead) + _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); + + + UnlockDisplay (dpy); + SyncHandle(); + + return (XRRProviderResources *) xrpr; +} + +void +XRRFreeProviderResources(XRRProviderResources *provider_resources) +{ + free(provider_resources); +} + +#define ProviderInfoExtra (SIZEOF(xRRGetProviderInfoReply) - 32) +XRRProviderInfo * +XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provider) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRGetProviderInfoReply rep; + xRRGetProviderInfoReq *req; + int nbytes, nbytesRead, rbytes; + XRRProviderInfo *xpi; + + RRCheckExtension (dpy, info, NULL); + + LockDisplay (dpy); + GetReq (RRGetProviderInfo, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRGetProviderInfo; + req->provider = provider; + req->configTimestamp = resources->configTimestamp; + + if (!_XReply (dpy, (xReply *) &rep, ProviderInfoExtra >> 2, xFalse)) + { + UnlockDisplay (dpy); + SyncHandle (); + return NULL; + } + + nbytes = ((long) rep.length << 2) - ProviderInfoExtra; + + nbytesRead = (long)(rep.nCrtcs * 4 + + rep.nOutputs * 4 + + rep.nAssociatedProviders * 8 + + ((rep.nameLength + 3) & ~3)); + + rbytes = (sizeof(XRRProviderInfo) + + rep.nCrtcs * sizeof(RRCrtc) + + rep.nOutputs * sizeof(RROutput) + + rep.nAssociatedProviders * (sizeof(RRProvider) + sizeof(unsigned int))+ + rep.nameLength + 1); + + xpi = (XRRProviderInfo *)Xmalloc(rbytes); + if (xpi == NULL) { + _XEatData (dpy, (unsigned long) nbytes); + UnlockDisplay (dpy); + SyncHandle (); + return NULL; + } + + xpi->capabilities = rep.capabilities; + xpi->ncrtcs = rep.nCrtcs; + xpi->noutputs = rep.nOutputs; + xpi->nassociatedproviders = rep.nAssociatedProviders; + xpi->crtcs = (RRCrtc *)(xpi + 1); + xpi->outputs = (RROutput *)(xpi->crtcs + rep.nCrtcs); + xpi->associated_providers = (RRProvider *)(xpi->outputs + rep.nOutputs); + xpi->associated_capability = (unsigned int *)(xpi->associated_providers + rep.nAssociatedProviders); + xpi->name = (char *)(xpi->associated_capability + rep.nAssociatedProviders); + + _XRead32(dpy, xpi->crtcs, rep.nCrtcs << 2); + _XRead32(dpy, xpi->outputs, rep.nOutputs << 2); + + _XRead32(dpy, xpi->associated_providers, rep.nAssociatedProviders << 2); + _XRead32(dpy, xpi->associated_capability, rep.nAssociatedProviders << 2); + + _XReadPad(dpy, xpi->name, rep.nameLength); + xpi->name[rep.nameLength] = '\0'; + + /* + * Skip any extra data + */ + if (nbytes > nbytesRead) + _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); + + UnlockDisplay (dpy); + SyncHandle (); + return (XRRProviderInfo *) xpi; +} + +void +XRRFreeProviderInfo(XRRProviderInfo *provider) +{ + free(provider); +} + +int +XRRSetProviderOutputSource(Display *dpy, XID provider, + XID source_provider) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRSetProviderOutputSourceReq *req; + + RRCheckExtension (dpy, info, 0); + LockDisplay (dpy); + GetReq (RRSetProviderOutputSource, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRSetProviderOutputSource; + req->provider = provider; + req->source_provider = source_provider; + UnlockDisplay (dpy); + SyncHandle (); + return 0; +} + +int +XRRSetProviderOffloadSink(Display *dpy, XID provider, + XID sink_provider) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRSetProviderOffloadSinkReq *req; + + RRCheckExtension (dpy, info, 0); + LockDisplay (dpy); + GetReq (RRSetProviderOffloadSink, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRSetProviderOffloadSink; + req->provider = provider; + req->sink_provider = sink_provider; + UnlockDisplay (dpy); + SyncHandle (); + return 0; +} diff --git a/lib/libXrandr/src/XrrProviderProperty.c b/lib/libXrandr/src/XrrProviderProperty.c new file mode 100644 index 000000000..c8c08e9d0 --- /dev/null +++ b/lib/libXrandr/src/XrrProviderProperty.c @@ -0,0 +1,339 @@ +/* + * Copyright © 2006 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 the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <X11/Xlib.h> +/* we need to be able to manipulate the Display structure on events */ +#include <X11/Xlibint.h> +#include <X11/extensions/render.h> +#include <X11/extensions/Xrender.h> +#include "Xrandrint.h" + +Atom * +XRRListProviderProperties (Display *dpy, RRProvider provider, int *nprop) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRListProviderPropertiesReply rep; + xRRListProviderPropertiesReq *req; + int nbytes, rbytes; + Atom *props = NULL; + + RRCheckExtension (dpy, info, NULL); + + LockDisplay (dpy); + GetReq (RRListProviderProperties, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRListProviderProperties; + req->provider = provider; + + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { + UnlockDisplay (dpy); + SyncHandle (); + *nprop = 0; + return NULL; + } + + if (rep.nAtoms) { + rbytes = rep.nAtoms * sizeof (Atom); + nbytes = rep.nAtoms << 2; + + props = (Atom *) Xmalloc (rbytes); + if (props == NULL) { + _XEatData (dpy, nbytes); + UnlockDisplay (dpy); + SyncHandle (); + *nprop = 0; + return NULL; + } + + _XRead32 (dpy, props, nbytes); + } + + *nprop = rep.nAtoms; + UnlockDisplay (dpy); + SyncHandle (); + return props; +} + +XRRPropertyInfo * +XRRQueryProviderProperty (Display *dpy, RRProvider provider, Atom property) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRQueryProviderPropertyReply rep; + xRRQueryProviderPropertyReq *req; + int rbytes, nbytes; + XRRPropertyInfo *prop_info; + + RRCheckExtension (dpy, info, NULL); + + LockDisplay (dpy); + GetReq (RRQueryProviderProperty, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRQueryProviderProperty; + req->provider = provider; + req->property = property; + + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { + UnlockDisplay (dpy); + SyncHandle (); + return NULL; + } + + rbytes = sizeof (XRRPropertyInfo) + rep.length * sizeof (long); + nbytes = rep.length << 2; + + prop_info = (XRRPropertyInfo *) Xmalloc (rbytes); + if (prop_info == NULL) { + _XEatData (dpy, nbytes); + UnlockDisplay (dpy); + SyncHandle (); + return NULL; + } + + prop_info->pending = rep.pending; + prop_info->range = rep.range; + prop_info->immutable = rep.immutable; + prop_info->num_values = rep.length; + if (rep.length != 0) { + prop_info->values = (long *) (prop_info + 1); + _XRead32 (dpy, prop_info->values, nbytes); + } else { + prop_info->values = NULL; + } + + UnlockDisplay (dpy); + SyncHandle (); + return prop_info; +} + +void +XRRConfigureProviderProperty (Display *dpy, RRProvider provider, Atom property, + Bool pending, Bool range, int num_values, + long *values) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRConfigureProviderPropertyReq *req; + long len; + + RRSimpleCheckExtension (dpy, info); + + LockDisplay(dpy); + GetReq (RRConfigureProviderProperty, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRConfigureProviderProperty; + req->provider = provider; + req->property = property; + req->pending = pending; + req->range = range; + + len = num_values; + if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { + SetReqLen(req, len, len); + len = (long)num_values << 2; + Data32 (dpy, values, len); + } /* else force BadLength */ + + UnlockDisplay(dpy); + SyncHandle(); +} + +void +XRRChangeProviderProperty (Display *dpy, RRProvider provider, + Atom property, Atom type, + int format, int mode, + _Xconst unsigned char *data, int nelements) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRChangeProviderPropertyReq *req; + long len; + + RRSimpleCheckExtension (dpy, info); + + LockDisplay(dpy); + GetReq (RRChangeProviderProperty, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRChangeProviderProperty; + req->provider = provider; + req->property = property; + req->type = type; + req->mode = mode; + if (nelements < 0) { + req->nUnits = 0; + req->format = 0; /* ask for garbage, get garbage */ + } else { + req->nUnits = nelements; + req->format = format; + } + + switch (req->format) { + case 8: + len = ((long)nelements + 3) >> 2; + if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { + SetReqLen(req, len, len); + Data (dpy, (char *)data, nelements); + } /* else force BadLength */ + break; + + case 16: + len = ((long)nelements + 1) >> 1; + if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { + SetReqLen(req, len, len); + len = (long)nelements << 1; + Data16 (dpy, (short *) data, len); + } /* else force BadLength */ + break; + + case 32: + len = nelements; + if (dpy->bigreq_size || req->length + len <= (unsigned) 65535) { + SetReqLen(req, len, len); + len = (long)nelements << 2; + Data32 (dpy, (long *) data, len); + } /* else force BadLength */ + break; + + default: + /* BadValue will be generated */ ; + } + + UnlockDisplay(dpy); + SyncHandle(); +} + +void +XRRDeleteProviderProperty (Display *dpy, RRProvider provider, Atom property) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRDeleteProviderPropertyReq *req; + + RRSimpleCheckExtension (dpy, info); + + LockDisplay(dpy); + GetReq(RRDeleteProviderProperty, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRDeleteProviderProperty; + req->provider = provider; + req->property = property; + UnlockDisplay(dpy); + SyncHandle(); +} + +int +XRRGetProviderProperty (Display *dpy, RRProvider provider, + Atom property, long offset, long length, + Bool delete, Bool pending, Atom req_type, + Atom *actual_type, int *actual_format, + unsigned long *nitems, unsigned long *bytes_after, + unsigned char **prop) +{ + XExtDisplayInfo *info = XRRFindDisplay(dpy); + xRRGetProviderPropertyReply rep; + xRRGetProviderPropertyReq *req; + long nbytes, rbytes; + + RRCheckExtension (dpy, info, 1); + + LockDisplay (dpy); + GetReq (RRGetProviderProperty, req); + req->reqType = info->codes->major_opcode; + req->randrReqType = X_RRGetProviderProperty; + req->provider = provider; + req->property = property; + req->type = req_type; + req->longOffset = offset; + req->longLength = length; + req->delete = delete; + req->pending = pending; + + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) + { + UnlockDisplay (dpy); + SyncHandle (); + return ((xError *)&rep)->errorCode; + } + + *prop = (unsigned char *) NULL; + if (rep.propertyType != None) { + /* + * One extra byte is malloced than is needed to contain the property + * data, but this last byte is null terminated and convenient for + * returning string properties, so the client doesn't then have to + * recopy the string to make it null terminated. + */ + switch (rep.format) { + case 8: + nbytes = rep.nItems; + rbytes = rep.nItems + 1; + if (rbytes > 0 && + (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes))) + _XReadPad (dpy, (char *) *prop, nbytes); + break; + + case 16: + nbytes = rep.nItems << 1; + rbytes = rep.nItems * sizeof (short) + 1; + if (rbytes > 0 && + (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes))) + _XRead16Pad (dpy, (short *) *prop, nbytes); + break; + + case 32: + nbytes = rep.nItems << 2; + rbytes = rep.nItems * sizeof (long) + 1; + if (rbytes > 0 && + (*prop = (unsigned char *) Xmalloc ((unsigned)rbytes))) + _XRead32 (dpy, (long *) *prop, nbytes); + break; + + default: + /* + * This part of the code should never be reached. If it is, + * the server sent back a property with an invalid format. + */ + nbytes = rep.length << 2; + _XEatData(dpy, (unsigned long) nbytes); + UnlockDisplay(dpy); + SyncHandle(); + return(BadImplementation); + } + if (! *prop) { + _XEatData(dpy, (unsigned long) nbytes); + UnlockDisplay(dpy); + SyncHandle(); + return(BadAlloc); + } + (*prop)[rbytes - 1] = '\0'; + } + + *actual_type = rep.propertyType; + *actual_format = rep.format; + *nitems = rep.nItems; + *bytes_after = rep.bytesAfter; + UnlockDisplay (dpy); + SyncHandle (); + + return Success; +} diff --git a/lib/libXrandr/src/XrrScreen.c b/lib/libXrandr/src/XrrScreen.c index 54bc2cafc..f830913d7 100644 --- a/lib/libXrandr/src/XrrScreen.c +++ b/lib/libXrandr/src/XrrScreen.c @@ -66,7 +66,7 @@ doGetScreenResources (Display *dpy, Window window, int poll) vreq->randrReqType = X_RRQueryVersion; vreq->majorVersion = RANDR_MAJOR; vreq->minorVersion = RANDR_MINOR; - + async_state.version_seq = dpy->request; async_state.error = False; async.next = dpy->async_handlers; @@ -112,8 +112,8 @@ doGetScreenResources (Display *dpy, Window window, int poll) rep.nModes * SIZEOF (xRRModeInfo) + ((rep.nbytesNames + 3) & ~3)); - /* - * first we must compute how much space to allocate for + /* + * first we must compute how much space to allocate for * randr library's use; we'll allocate the structures in a single * allocation, on cleanlyness grounds. */ @@ -147,10 +147,10 @@ doGetScreenResources (Display *dpy, Window window, int poll) _XRead32 (dpy, xrsr->crtcs, rep.nCrtcs << 2); _XRead32 (dpy, xrsr->outputs, rep.nOutputs << 2); - + for (i = 0; i < rep.nModes; i++) { xRRModeInfo modeInfo; - + _XReadPad (dpy, (char *) &modeInfo, SIZEOF (xRRModeInfo)); xrsr->modes[i].id = modeInfo.id; xrsr->modes[i].width = modeInfo.width; @@ -180,13 +180,13 @@ doGetScreenResources (Display *dpy, Window window, int poll) wire_name += xrsr->modes[i].nameLength; } Xfree (wire_names); - + /* * Skip any extra data */ if (nbytes > nbytesRead) _XEatData (dpy, (unsigned long) (nbytes - nbytesRead)); - + UnlockDisplay (dpy); SyncHandle(); return (XRRScreenResources *) xrsr; |