From 562d093da4086fb7429489133b1cd741000dea73 Mon Sep 17 00:00:00 2001 From: HyungKyu Song Date: Sat, 16 Feb 2013 00:19:31 +0900 Subject: [PATCH] Tizen 2.0 Release --- AUTHORS | 2 + COPYING | 22 ++ ChangeLog | 579 +++++++++++++++++++++++++++++++++++++ INSTALL | 291 +++++++++++++++++++ Makefile.am | 39 +++ README | 25 ++ configure.ac | 62 ++++ include/X11/extensions/XRes.h | 56 ++++ man/Makefile.am | 46 +++ man/XRes.man | 137 +++++++++ man/XResQueryClientPixmapBytes.man | 1 + man/XResQueryClientResources.man | 1 + man/XResQueryClients.man | 1 + man/XResQueryExtension.man | 1 + man/XResQueryVersion.man | 1 + packaging/libXres.spec | 67 +++++ src/Makefile.am | 19 ++ src/XRes.c | 230 +++++++++++++++ xres.pc.in | 12 + 19 files changed, 1592 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 README create mode 100644 configure.ac create mode 100644 include/X11/extensions/XRes.h create mode 100644 man/Makefile.am create mode 100644 man/XRes.man create mode 100644 man/XResQueryClientPixmapBytes.man create mode 100644 man/XResQueryClientResources.man create mode 100644 man/XResQueryClients.man create mode 100644 man/XResQueryExtension.man create mode 100644 man/XResQueryVersion.man create mode 100644 packaging/libXres.spec create mode 100644 src/Makefile.am create mode 100644 src/XRes.c create mode 100644 xres.pc.in diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..fa63869 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Mark Vojkovich, XFree86 + diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..ae577a0 --- /dev/null +++ b/COPYING @@ -0,0 +1,22 @@ + Copyright (c) 2002 XFree86 Inc +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 fur- +nished 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, FIT- +NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- +NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the XFree86 Project shall not +be used in advertising or otherwise to promote the sale, use or other deal- +ings in this Software without prior written authorization from the XFree86 +Project. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..5832f59 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,579 @@ +commit e6e0e02e4bf764fa58798540793bdeb44a60cc7f +Author: Alan Coopersmith +Date: Wed Mar 7 20:53:56 2012 -0800 + + libXres 1.0.6 + + Signed-off-by: Alan Coopersmith + +commit 96c59e1c7c61d7e42b8da5ddbe9af1a12567fd47 +Author: Alan Coopersmith +Date: Thu Nov 10 21:40:51 2011 -0800 + + Fix gcc -Wwrite-strings warning + + Signed-off-by: Alan Coopersmith + +commit fb6002c5736eda80a8ae1df46626862ca53a1c25 +Author: Alan Coopersmith +Date: Fri Sep 16 22:52:12 2011 -0700 + + Strip trailing whitespace + + Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' + git diff -w & git diff -b show no diffs from this change + + Signed-off-by: Alan Coopersmith + +commit 455c02ee9143b2bfbfd99b6481a1b22a0ce2a2bf +Author: Gaetan Nadon +Date: Wed Feb 2 11:43:40 2011 -0500 + + config: comment, minor upgrade, quote and layout configure.ac + + Group statements per section as per Autoconf standard layout + Quote statements where appropriate. + Autoconf recommends not using dnl instead of # for comments + + Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters. + Add AC_CONFIG_SRCDIR([Makefile.am]) + + This helps automated maintenance and release activities. + Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines + +commit ecb0cb424a93e7de7671353d9514a8bf193ad678 +Author: Gaetan Nadon +Date: Fri Jan 28 19:41:37 2011 -0500 + + config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS + + Signed-off-by: Gaetan Nadon + +commit 34e906a430185bd4debc00606321980ac25737db +Author: Gaetan Nadon +Date: Fri Jan 28 16:34:14 2011 -0500 + + config: remove unrequired AC_CONFIG_AUX_DIR + + The default location for the generation of configuation files is the current + package root directory. These files are config.* and friends. + + Signed-off-by: Gaetan Nadon + +commit 2f16931c01e667a24210b3a76c50c5d5fe46e314 +Author: Gaetan Nadon +Date: Thu Jan 27 18:50:15 2011 -0500 + + config: remove AC_PROG_CC as it overrides AC_PROG_C_C99 + + XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls + AC_PROG_C_C99. This sets gcc with -std=gnu99. + If AC_PROG_CC macro is called afterwards, it resets CC to gcc. + + Signed-off-by: Gaetan Nadon + +commit 1cb91aaf819ae3c9385c130e4fa0146057c4c89b +Author: Alan Coopersmith +Date: Thu Oct 28 16:21:39 2010 -0700 + + libXres 1.0.5 + + Signed-off-by: Alan Coopersmith + +commit 564236eb299eb9224f4f09c7bda5bebc987c8af9 +Author: Alan Coopersmith +Date: Thu Oct 28 16:19:46 2010 -0700 + + Sun's copyrights now belong to Oracle + + Signed-off-by: Alan Coopersmith + +commit f00517c478c6e34afd7d1e1477554156d36baf0e +Author: Jesse Adkins +Date: Tue Sep 28 13:30:02 2010 -0700 + + Purge cvs tags. + + Signed-off-by: Jesse Adkins + Signed-off-by: Alan Coopersmith + +commit c8bbca66bc1cf75ca01c66901605549dc780def6 +Author: Gaetan Nadon +Date: Tue Aug 17 08:39:22 2010 -0400 + + man: store shadow man pages in git rather than generating them + + Simplify the build process and the makefile. + + Local fix in CVS for bug 5628 is not required + as the problem has been fixed in + util-macros d9062e4077ebfd0985baf8418f3d0f111b9ddbba + + Signed-off-by: Gaetan Nadon + +commit b4975daf8c85eda619da1cb6f1584876786feaaa +Author: Alan Coopersmith +Date: Thu Jul 8 14:55:32 2010 -0700 + + config: upgrade to util-macros 1.8 for additional man page support + + Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS + The value of MAN_SUBST is the same for all X.Org packages. + + Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS + Use platform appropriate version of sed. + + Signed-off-by: Alan Coopersmith + +commit d2a60612f4a9f50830d3c62780fe74507a8c82ad +Author: Fernando Carrijo +Date: Thu Jul 1 07:03:29 2010 -0300 + + Purge macros NEED_EVENTS and NEED_REPLIES + + Signed-off-by: Fernando Carrijo + Acked-by: Tiago Vignatti + Reviewed-by: Alan Coopersmith + +commit f0c0c4e6d50c65b7da6f72404796c25f860a3198 +Author: Gaetan Nadon +Date: Mon Mar 29 16:50:33 2010 -0400 + + config: update AC_PREREQ statement to 2.60 + + Unrelated to the previous patches, the new value simply reflects + the reality that the minimum level for autoconf to configure + all x.org modules is 2.60 dated June 2006. + + ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz + + Signed-off-by: Gaetan Nadon + +commit eca8fc252af729453a2db8218fcfe3a686ba3df5 +Author: Gaetan Nadon +Date: Mon Mar 29 14:53:48 2010 -0400 + + config: remove the pkgconfig pc.in file from EXTRA_DIST + + Automake always includes it in the tarball. + + Signed-off-by: Gaetan Nadon + +commit ceaddfbd0f55c4863bed9c42fcce1fad0348ad19 +Author: Gaetan Nadon +Date: Tue Feb 16 10:37:21 2010 -0500 + + config: move CWARNFLAGS from configure.ac to Makefile.am + + Compiler warning flags should be explicitly set in the makefile + rather than being merged with other packages compiler flags. + + Signed-off-by: Gaetan Nadon + +commit 17eeac2a9218f5d22c71d18eee9ec1fe64bdbf5a +Author: Alan Coopersmith +Date: Thu Jan 14 21:12:39 2010 -0800 + + Update Sun license notices to current X.Org standard form + + Signed-off-by: Alan Coopersmith + +commit 79251c2f41643ba06d0fd706ea4116f7924ddefa +Author: Gaetan Nadon +Date: Fri Nov 27 20:56:03 2009 -0500 + + Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES + + Now that the INSTALL file is generated. + Allows running make maintainer-clean. + +commit 1f393e74c3dd55c3422804cac98716f1e7e35d85 +Author: Gaetan Nadon +Date: Wed Oct 28 15:08:51 2009 -0400 + + configure.ac: AM_MAINTAINER_MODE missing #24238 + + This turns off maintainer mode build rules in tarballs. + Works in conjunction with autogen.sh --enable-maintainer-mode + For all X.Org components. + +commit c4f650e235c4cb286377792b836a551e9b63a0e5 +Author: Gaetan Nadon +Date: Wed Oct 28 14:09:10 2009 -0400 + + INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 + + Add missing INSTALL file. Use standard GNU file on building tarball + README may have been updated + Remove AUTHORS file as it is empty and no content available yet. + Remove NEWS file as it is empty and no content available yet. + +commit a8ab75d941ebf3fe83832c990dd7e5f75dc0971b +Author: Gaetan Nadon +Date: Mon Oct 26 22:08:42 2009 -0400 + + Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432 + + ChangeLog filename is known to Automake and requires no further + coding in the makefile. + +commit 24890a580d43d2224f6f7074c1e3cb2072536d81 +Author: Gaetan Nadon +Date: Thu Oct 22 12:34:19 2009 -0400 + + .gitignore: use common defaults with custom section # 24239 + + Using common defaults will reduce errors and maintenance. + Only the very small or inexistent custom section need periodic maintenance + when the structure of the component changes. Do not edit defaults. + +commit c34ef112fa1b20ee65a6b287759e899bca2c5823 +Author: Jeremy Huddleston +Date: Wed Oct 21 12:47:23 2009 -0700 + + This is not a GNU project, so declare it foreign. + + On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote: + > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote: + > > I noticed an INSTALL file in xlsclients and libXvMC today, and it + > > was quite annoying to work around since 'autoreconf -fvi' replaces + > > it and git wants to commit it. Should these files even be in git? + > > Can I nuke them for the betterment of humanity and since they get + > > created by autoreconf anyways? + > + > See https://bugs.freedesktop.org/show_bug.cgi?id=24206 + + As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with + AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation + of the INSTALL file. It is also part of the 24206 solution. + + Signed-off-by: Jeremy Huddleston + +commit 08032a51fccda19ad4722015f4cc0b1a587592f7 +Author: Alan Coopersmith +Date: Fri Oct 9 07:54:44 2009 -0700 + + libXres 1.0.4 + + Signed-off-by: Alan Coopersmith + +commit 619eec21134a0ca9a8adb92383a05deea05b768d +Author: Alan Coopersmith +Date: Thu Oct 8 23:48:41 2009 -0700 + + XRes.man: Fix typo, improve wording, drop RCS tags + + Signed-off-by: Alan Coopersmith + +commit e854448a9bfcdfdeb6262b89a93bcbe8bcd7545c +Author: Alan Coopersmith +Date: Thu Oct 8 23:39:04 2009 -0700 + + Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS + + Signed-off-by: Alan Coopersmith + +commit 1805655654217830ae943806e6a7d653cdc48047 +Author: Alan Coopersmith +Date: Mon Feb 2 20:34:31 2009 -0800 + + Add README with pointers to mailing list, bugzilla & git repos + + Signed-off-by: Alan Coopersmith + +commit 13ee4d00a06421dfb5ee613cbd99a3111135c379 +Author: Paulo Cesar Pereira de Andrade +Date: Fri Jan 30 16:56:38 2009 -0200 + + Janitor: Correct make distcheck and remove extra .gitignore files. + +commit 168153d1e7d196ca46c5b2e286fcf7e7793f2804 +Author: Peter Hutterer +Date: Mon May 19 17:53:23 2008 +0930 + + Rename parameters to clarify QueryVersion/QueryExtension. + + These parameters are not treated as input. Rename them to make the inner + workings slightly more obvious. + + X.Org Bug 14511 + +commit 5d2e4b05ff988a0f941aa78e62857791ae2d56aa +Author: Matthieu Herrb +Date: Sun Mar 9 00:19:31 2008 +0100 + + nuke RCS Ids + +commit a4323e1bb491cbfc5b5090311cc16c805b9dd7d6 +Author: James Cloos +Date: Thu Dec 6 15:51:14 2007 -0500 + + Add missing PHONY line for automatic ChangeLog generation + +commit 04381b5f703975ffa6514d474f5fe31bc76540c4 +Author: James Cloos +Date: Mon Sep 3 05:53:33 2007 -0400 + + Add *~ to .gitignore to skip patch/emacs droppings + +commit 322797ec5679919b8616c17c51492b2d596efecb +Author: Daniel Stone +Date: Sat Dec 16 01:29:45 2006 +0200 + + bump to 1.0.3 + +commit 6a2f43119d483c1ad47b99ddec61bebcb218b534 +Author: Daniel Stone +Date: Wed Dec 6 18:58:35 2006 +0200 + + Makefile.am: make ChangeLog hook as safe as possible + +commit ec347de8a81e7af3a9b9155a9dbf703294cdfc77 +Author: Adam Jackson +Date: Fri Oct 13 16:28:28 2006 -0400 + + Bump to 1.0.2 + +commit a5608546e433a829a0d17e2b60ac196e044dde94 +Author: Adam Jackson +Date: Thu Oct 12 20:14:37 2006 -0400 + + Fix the ChangeLog hook to distcheck. + +commit ed20661748b0070771116861972f5d1f00b45ed1 +Author: Matthieu Herrb +Date: Sat Jul 29 20:23:07 2006 +0200 + + Remove ChangeLog, add a rule to generate it with git-log. + +commit 5faf9733ca4b632ec9a3640b00186b48052b3c03 +Author: Federico G. Schwindt +Date: Sat Jul 29 20:12:01 2006 +0200 + + Typo in path to XRes.h + +commit cf9bc567fbbafc57348abb7e398729d40f566e3d +Author: Alan Coopersmith +Date: Thu Jul 13 14:58:46 2006 -0700 + + renamed: .cvsignore -> .gitignore + +commit 405d6e8e7e9918a86a40e78a2baf7a1f20b86d6d +Author: Adam Jackson +Date: Thu Apr 27 00:22:20 2006 +0000 + + Bump to 1.0.1 + +commit f49ba1035cf9e8f7cc8a9c44162e5a95d692d446 +Author: Adam Jackson +Date: Mon Apr 3 19:26:13 2006 +0000 + + Bug #6407: Cygwin build fix. (Yaakov Selkowitz) + +commit d7d53b5a5b6efc54b405006103fce1721853aa02 +Author: Alan Coopersmith +Date: Sun Feb 12 18:19:20 2006 +0000 + + Bug #5628 Shadow pages + not created correctly when MANDIR & MANSUFFIX don't match. + +commit 4cfcdcae80e4e54c40cafcde1f7d341c0a9eccf5 +Author: Kevin E Martin +Date: Thu Dec 15 00:24:28 2005 +0000 + + Update package version number for final X11R7 release candidate. + +commit d65c058cb0e8cc6f1bc657a5afbf728b446c0c77 +Author: Kevin E Martin +Date: Tue Dec 6 22:48:42 2005 +0000 + + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +commit 9e37dcb3199b4c0013dcf1acc95bf9f194622e83 +Author: Kevin E Martin +Date: Sat Dec 3 05:49:42 2005 +0000 + + Update package version number for X11R7 RC3 release. + +commit f84239e6f526a4b52158c4670da8d1bd02d527f2 +Author: Kevin E Martin +Date: Sat Dec 3 04:41:48 2005 +0000 + + Add check and cflags for malloc(0) returning NULL. + +commit f125e444a022300ae4aa69db2d209cc3c2fbbe0b +Author: Alan Coopersmith +Date: Mon Nov 28 22:03:04 2005 +0000 + + Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4 + update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir) + +commit 110fc9c3da409c53f2d6f638d0a137c29559cd32 +Author: Kevin E Martin +Date: Sat Nov 19 07:15:40 2005 +0000 + + Update pkgconfig files to separate library build-time dependencies from + application build-time dependencies, and update package deps to work + with separate build roots. + +commit c6674701dade763eb2d3380755b4c23f47fa6cdb +Author: Kevin E Martin +Date: Wed Nov 9 21:19:12 2005 +0000 + + Update package version number for X11R7 RC2 release. + +commit 3e53ff688524152ea26436b9a5797d9a10647844 +Author: Kevin E Martin +Date: Tue Nov 1 15:11:50 2005 +0000 + + Update pkgcheck dependencies to work with separate build roots. + +commit c9df69c6197623623d5c7d444181cfaddb9b23bb +Author: Kevin E Martin +Date: Wed Oct 19 02:48:08 2005 +0000 + + Update package version number for RC1 release. + +commit b9bf386000f448f3ba559ea435840648a6b202f0 +Author: Alan Coopersmith +Date: Tue Oct 18 00:00:08 2005 +0000 + + Use @LIB_MAN_SUFFIX@ instead of $(LIB_MAN_SUFFIX) in macro substitutions to + work better with BSD make + +commit f6248446b56651ad08ef9ae036f3d266d5a1d108 +Author: Alan Coopersmith +Date: Mon Oct 17 21:13:15 2005 +0000 + + Rename .shadows.DONE to shadows.DONE to avoid some make's thinking it's a + suffix rule (reported by Matthieu Herrb) + +commit 67f04ddabfdda0d8c69c8f251eab631e4b6585e4 +Author: Alan Coopersmith +Date: Thu Oct 13 04:25:46 2005 +0000 + + Add generated man pages to .cvsignores + +commit 1192ba3d6749837a501db95014c71f1d801b3bae +Author: Alan Coopersmith +Date: Thu Oct 13 01:44:46 2005 +0000 + + Use sed to fill in variables in man page Add shadow man pages for man pages + that document multiple functions. + +commit 8eb24cbd838af67ffe96b074dc66cfff3f12ada4 +Author: Kevin E Martin +Date: Fri Jul 29 21:22:50 2005 +0000 + + Various changes preparing packages for RC0: + - Verify and update package version numbers as needed + - Implement versioning scheme + - Change bug address to point to bugzilla bug entry form + - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to + reenable it) + - Fix makedepend to use pkgconfig and pass distcheck + - Update build script to build macros first + - Update modular Xorg version + +commit 4b937bf0b80d1e7520beda11e5958858c1d8be63 +Author: Daniel Stone +Date: Sat Jul 16 06:28:05 2005 +0000 + + Set soversion to 1.0.0 using -version-number. + +commit 4e618f40eedcb5f8b3e2e1e32cb055a65af52961 +Author: Daniel Stone +Date: Tue Jul 12 06:07:58 2005 +0000 + + Bump soversion to 1.0.0. + +commit c38c5edc353971b2ca6b3d2b55288b88cd46de5b +Author: Keith Packard +Date: Sat Jul 9 06:03:13 2005 +0000 + + Add .cvsignore files Switch _la_CFLAGS for AM_CFLAGS to clean up directory + +commit c1ed34d39740625d52eca7f2c5bf5c6797f28097 +Author: Søren Sandmann Pedersen +Date: Wed Jun 22 22:46:38 2005 +0000 + + Apply these patches from Theo van Klaveren: + lib-dmx.patch lib-FS.patch lib-X11.patch lib-XRes.patch + lib-XScrnSaver.patch lib-xtrans.patch + to make the libraries distcheck. + +commit 2dbb8e41c6accaf9d86f3fdadfed5aea330da1fd +Author: Søren Sandmann Pedersen +Date: Tue Jun 14 17:31:59 2005 +0000 + + XRes/src/Makefile.am: Add $(top_srcdir)/include to INCLUDES + +commit a30727351e6cdeb7ff2ffa0bddad8c3a1be9eda0 +Author: Søren Sandmann Pedersen +Date: Tue Jun 7 18:51:23 2005 +0000 + + - symlink.sh: Move XRes.h from proto/Resource to + lib/XRes/include/X11/extensions + - symlink.sh: Add XRes linking + - xc/lib/XRes/*.c: conditionally include config.h + - lib/XRes: add directories and build system. + +commit e47da1b068cd9b8a772a99e30b2c1d5271d4295e +Author: Egbert Eich +Date: Fri Apr 23 18:43:36 2004 +0000 + + Merging XORG-CURRENT into trunk + +commit 5597850916b8c24c6d430fcac50c88b2d97a6f01 +Author: Egbert Eich +Date: Sun Mar 14 08:32:00 2004 +0000 + + Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 + +commit 247bcd0cd4b6f288ebe950933aee57c8c429268d +Author: Egbert Eich +Date: Wed Mar 3 12:11:19 2004 +0000 + + Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 + +commit 16b6e9a93ba18983468ce7e4e58eea4a1e46adf1 +Author: Egbert Eich +Date: Thu Feb 26 13:35:30 2004 +0000 + + readding XFree86's cvs IDs + +commit 559e2ccbe7259e3cff4614c97a8b730bd9dafac2 +Author: Egbert Eich +Date: Thu Feb 26 09:22:39 2004 +0000 + + Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 + +commit c783cd6e35b7a7770b16518060b5cc970c9b3d0d +Author: Kaleb Keithley +Date: Fri Dec 19 20:54:31 2003 +0000 + + XFree86 4.3.99.902 (RC 2) + +commit 2dc3bb158d8859d529dce8c88066a7570351319d +Author: Kaleb Keithley +Date: Tue Nov 25 19:28:09 2003 +0000 + + XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks + +commit 345fbee57dc02964c90e8e232cb9274860276d27 +Author: Kaleb Keithley +Date: Tue Nov 25 19:28:09 2003 +0000 + + Initial revision + +commit 8379290050be8b8fcbdcc74e11cebbc637ff96ba +Author: Kaleb Keithley +Date: Fri Nov 14 16:48:47 2003 +0000 + + XFree86 4.3.0.1 + +commit 0ee742ac9989d710dafc982a212768d8311f80ff +Author: Kaleb Keithley +Date: Fri Nov 14 16:48:47 2003 +0000 + + Initial revision diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..8b82ade --- /dev/null +++ b/INSTALL @@ -0,0 +1,291 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008 Free Software Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..456e398 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,39 @@ +# +# Copyright © 2003 Keith Packard, Noah Levitt +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Keith Packard not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Keith Packard makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +AUTOMAKE_OPTIONS = foreign + +SUBDIRS = src man + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = xres.pc + +MAINTAINERCLEANFILES = ChangeLog INSTALL + +.PHONY: ChangeLog INSTALL + +INSTALL: + $(INSTALL_CMD) + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog INSTALL diff --git a/README b/README new file mode 100644 index 0000000..2704086 --- /dev/null +++ b/README @@ -0,0 +1,25 @@ +libXRes - X-Resource extension client library + +All questions regarding this software should be directed at the +Xorg mailing list: + + http://lists.freedesktop.org/mailman/listinfo/xorg + +Please submit bug reports to the Xorg bugzilla: + + https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +The master development code repository can be found at: + + git://anongit.freedesktop.org/git/xorg/lib/libXRes + + http://cgit.freedesktop.org/xorg/lib/libXRes + +For patch submission instructions, see: + + http://www.x.org/wiki/Development/Documentation/SubmittingPatches + +For more information on the git code manager, see: + + http://wiki.x.org/wiki/GitPage + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..bc4e8a6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,62 @@ +# +# Copyright © 2003 Keith Packard, Noah Levitt +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Keith Packard not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Keith Packard makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# + +# Initialize Autoconf +AC_PREREQ([2.60]) +# +# Version should match the current XRes version. XResQueryVersion +# returns the version from XResproto.h, NOT the version we set here. But we +# try to keep these the same. Note that the library has an extra +# digit in the version number to track changes which don't affect the +# protocol, so XRes version l.n.m corresponds to protocol version l.n +# +AC_INIT([libXres], [1.0.6], + [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXres]) +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_HEADERS([config.h]) + +# Initialize Automake +AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_MAINTAINER_MODE + +# Initialize libtool +AC_PROG_LIBTOOL + +# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.8) +XORG_DEFAULT_OPTIONS +XORG_CHECK_MALLOC_ZERO + +# Check xres configuration, strip extra digits from package version to +# find the required protocol version +RES_VERSION=[`echo $VERSION | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`] + +# Obtain compiler/linker options for depedencies +PKG_CHECK_MODULES(XRES, x11 xext xextproto [resourceproto >= $RES_VERSION]) + +AC_CONFIG_FILES([Makefile + src/Makefile + man/Makefile + xres.pc]) +AC_OUTPUT diff --git a/include/X11/extensions/XRes.h b/include/X11/extensions/XRes.h new file mode 100644 index 0000000..ed4b2b8 --- /dev/null +++ b/include/X11/extensions/XRes.h @@ -0,0 +1,56 @@ +/* + Copyright (c) 2002 XFree86 Inc +*/ + +#ifndef _XRES_H +#define _XRES_H + +#include + +typedef struct { + XID resource_base; + XID resource_mask; +} XResClient; + +typedef struct { + Atom resource_type; + unsigned int count; +} XResType; + +_XFUNCPROTOBEGIN + + +Bool XResQueryExtension ( + Display *dpy, + int *event_base_return, + int *error_base_return +); + +Status XResQueryVersion ( + Display *dpy, + int *major_version_return, + int *minor_version_return +); + +Status XResQueryClients ( + Display *dpy, + int *num_clients, + XResClient **clients +); + +Status XResQueryClientResources ( + Display *dpy, + XID xid, + int *num_types, + XResType **types +); + +Status XResQueryClientPixmapBytes ( + Display *dpy, + XID xid, + unsigned long *bytes +); + +_XFUNCPROTOEND + +#endif /* _XRES_H */ diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 0000000..93e19c3 --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,46 @@ +# +# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# +# 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 (including the next +# paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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. +# + +libmandir = $(LIB_MAN_DIR) + +libman_PRE = \ + XRes.man \ + $(XRes_shadows:=.man) + +XRes_shadows = \ + XResQueryExtension \ + XResQueryVersion \ + XResQueryClients \ + XResQueryClientResources \ + XResQueryClientPixmapBytes + +EXTRA_DIST = $(libman_PRE) +CLEANFILES = $(libman_DATA) + +libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@) + +SUFFIXES = .$(LIB_MAN_SUFFIX) .man + +# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure +.man.$(LIB_MAN_SUFFIX): + $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ diff --git a/man/XRes.man b/man/XRes.man new file mode 100644 index 0000000..c35dec4 --- /dev/null +++ b/man/XRes.man @@ -0,0 +1,137 @@ +.\" +.\" Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. +.\" +.\" 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 NON-INFRINGEMENT. +.\" IN NO EVENT SHALL THE XFREE86 PROJECT 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 XFree86 Project +.\" 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 XFree86 Project. +.\" +.TH XRes __libmansuffix__ __vendorversion__ +.SH NAME +XRes \- X-Resource extension client library +.SH SYNOPSIS +.B #include +.PP +.nf +.ta .5i 2i +typedef struct { + XID resource_base; + XID resource_mask; +} XResClient; + +typedef struct { + Atom resource_type; + unsigned int count; +} XResType; +.fi +.HP +Bool XResQueryExtension(Display *\fIdpy\fP, +int *\fIevent_base_return\fP, int *\fIerror_base_return\fP\^); +.HP +Status XResQueryVersion(Display *\fIdpy\fP, int *\fImajor_version_return\fP, +int *\fIminor_version_return\fP\^); +.HP +Status XResQueryClients(Display *\fIdpy\fP, int *\fInum_clients\fP, +XResClient **\fIclients\fP\^); +.HP +Status XResQueryClientResources(Display *\fIdpy\fP, XID \fIxid\fP, +int *\fInum_types\fP, XResType **\fItypes\fP\^); +.HP +Status XResQueryClientPixmapBytes(Display *\fIdpy\fP, XID \fIxid\fP, +unsigned long *\fIbytes\fP\^); +.PP +.SH DESCRIPTION +.B X-Resource +is an extension that allows a client to query the X +server about its usage of various resources. It should not be confused +with the X resource database access functions. +.PP +.B XResQueryExtension +returns +.B True +if the +.I XRes +extension is available on the given display. +A client must call +.B XResQueryExtension +before calling any other XRes function in order +to negotiate a compatible protocol version; otherwise the client will +get undefined behavior (XRes may or may not work). +.PP +.B XResQueryVersion +returns +.B True +if the request succeeded; the values of the major and minor protocol +versions supported by the server are returned in +.I major_version_return +and +.I minor_version_return . +.PP +.PP +.B XResQueryClients +fills a list of clients of the given display. For each client it +returns in the +.I XResClient +structure a mask and a base value of the resources used by these +clients. +Returns +.B True +on success or +.B False +on failure. +.PP +.B XResQueryClientResources +fills a list of +XResType +structures, indicating for each resource type allocated by the client its +name (as an Atom) and the number of resources of this type allocated. +Returns +.B True +on success or +.B False +on failure. +.PP +.B XResQueryClientPixmapBytes +gives, for resources of type +.I PIXMAP +the total number of bytes allocated in the X server by the given +client. +Returns +.B True +on success or +.B False +on failure. +.SH "ERRORS" +.B XResQueryClientResources +and +.B XResQueryClientPixmapBytes +will return +.I BadValue +if passed an illegal client identifier. +.SH "SEE ALSO" +X(__miscmansuffix__) +.SH AUTHOR +Mark Vojkovich, originally for The XFree86 Project Inc. +.SH STABILITY +This API is considered as experimental. The XRes library major +revision may be incremented whenever incompatible changes are done to +the API without notice. Use with care. diff --git a/man/XResQueryClientPixmapBytes.man b/man/XResQueryClientPixmapBytes.man new file mode 100644 index 0000000..10d7bd3 --- /dev/null +++ b/man/XResQueryClientPixmapBytes.man @@ -0,0 +1 @@ +.so man__libmansuffix__/XRes.__libmansuffix__ diff --git a/man/XResQueryClientResources.man b/man/XResQueryClientResources.man new file mode 100644 index 0000000..10d7bd3 --- /dev/null +++ b/man/XResQueryClientResources.man @@ -0,0 +1 @@ +.so man__libmansuffix__/XRes.__libmansuffix__ diff --git a/man/XResQueryClients.man b/man/XResQueryClients.man new file mode 100644 index 0000000..10d7bd3 --- /dev/null +++ b/man/XResQueryClients.man @@ -0,0 +1 @@ +.so man__libmansuffix__/XRes.__libmansuffix__ diff --git a/man/XResQueryExtension.man b/man/XResQueryExtension.man new file mode 100644 index 0000000..10d7bd3 --- /dev/null +++ b/man/XResQueryExtension.man @@ -0,0 +1 @@ +.so man__libmansuffix__/XRes.__libmansuffix__ diff --git a/man/XResQueryVersion.man b/man/XResQueryVersion.man new file mode 100644 index 0000000..10d7bd3 --- /dev/null +++ b/man/XResQueryVersion.man @@ -0,0 +1 @@ +.so man__libmansuffix__/XRes.__libmansuffix__ diff --git a/packaging/libXres.spec b/packaging/libXres.spec new file mode 100644 index 0000000..b73b880 --- /dev/null +++ b/packaging/libXres.spec @@ -0,0 +1,67 @@ +Summary: X-Resource extension client library +Name: libXres +Version: 1.0.6 +Release: 1 +License: MIT +Group: System Environment/Libraries +URL: http://www.x.org + +Source0: %{name}-%{version}.tar.gz + +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(resourceproto) +BuildRequires: pkgconfig(xorg-macros) +BuildRequires: pkgconfig(xproto) + +%description +X-Resource is an extension that allows a client to query +the X server about its usage of various resources. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Provides: libxres-devel + +%description devel +X.Org X11 libXres development package + +%prep +%setup -q + +%build +%reconfigure --disable-static \ + LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed" +make %{?jobs:-j%jobs} + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p %{buildroot}/usr/share/license +cp -af COPYING %{buildroot}/usr/share/license/%{name} +make install DESTDIR=$RPM_BUILD_ROOT + +# We intentionally don't ship *.la files +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la + +%remove_docs + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +/usr/share/license/%{name} +%doc AUTHORS COPYING ChangeLog +%{_libdir}/libXRes.so.1 +%{_libdir}/libXRes.so.1.0.0 + +%files devel +%defattr(-,root,root,-) +%{_includedir}/X11/extensions/XRes.h +%{_libdir}/libXRes.so +%{_libdir}/pkgconfig/xres.pc +#%dir %{_mandir}/man3x +#%{_mandir}/man3/*.3* diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..fd508da --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,19 @@ +lib_LTLIBRARIES = libXRes.la + +libXRes_la_SOURCES = \ + XRes.c + +libXRes_la_LIBADD = @XRES_LIBS@ + +AM_CFLAGS = \ + $(CWARNFLAGS) \ + $(XRES_CFLAGS) \ + $(MALLOC_ZERO_CFLAGS) + +INCLUDES = -I$(top_srcdir)/include + +libXRes_la_LDFLAGS = -version-number 1:0:0 -no-undefined + +libXResincludedir = $(includedir)/X11/extensions +libXResinclude_HEADERS = $(top_srcdir)/include/X11/extensions/XRes.h + diff --git a/src/XRes.c b/src/XRes.c new file mode 100644 index 0000000..6091c96 --- /dev/null +++ b/src/XRes.c @@ -0,0 +1,230 @@ +/* + Copyright (c) 2002 XFree86 Inc +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include + + +static XExtensionInfo _xres_ext_info_data; +static XExtensionInfo *xres_ext_info = &_xres_ext_info_data; +static const char *xres_extension_name = XRES_NAME; + +#define XResCheckExtension(dpy,i,val) \ + XextCheckExtension (dpy, i, xres_extension_name, val) + +static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xres_ext_info) + +static XExtensionHooks xres_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 */ + NULL, /* error_string */ +}; + +static XEXT_GENERATE_FIND_DISPLAY (find_display, xres_ext_info, + xres_extension_name, + &xres_extension_hooks, + 0, NULL) + +Bool XResQueryExtension ( + Display *dpy, + int *event_base_return, + int *error_base_return +) +{ + XExtDisplayInfo *info = find_display (dpy); + + if (XextHasExtension(info)) { + *event_base_return = info->codes->first_event; + *error_base_return = info->codes->first_error; + return True; + } else { + return False; + } +} + +Status XResQueryVersion( + Display *dpy, + int *major_version_return, + int *minor_version_return +) +{ + XExtDisplayInfo *info = find_display (dpy); + xXResQueryVersionReply rep; + xXResQueryVersionReq *req; + + XResCheckExtension (dpy, info, 0); + + LockDisplay (dpy); + GetReq (XResQueryVersion, req); + req->reqType = info->codes->major_opcode; + req->XResReqType = X_XResQueryVersion; + req->client_major = XRES_MAJOR_VERSION; + req->client_minor = XRES_MINOR_VERSION; + if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay (dpy); + SyncHandle (); + return 0; + } + *major_version_return = rep.server_major; + *minor_version_return = rep.server_minor; + UnlockDisplay (dpy); + SyncHandle (); + return 1; +} + + +Status XResQueryClients ( + Display *dpy, + int *num_clients, + XResClient **clients +) +{ + XExtDisplayInfo *info = find_display (dpy); + xXResQueryClientsReq *req; + xXResQueryClientsReply rep; + XResClient *clnts; + int result = 0; + + *num_clients = 0; + *clients = NULL; + + XResCheckExtension (dpy, info, 0); + + LockDisplay (dpy); + GetReq (XResQueryClients, req); + req->reqType = info->codes->major_opcode; + req->XResReqType = X_XResQueryClients; + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { + UnlockDisplay (dpy); + SyncHandle (); + return 0; + } + + if(rep.num_clients) { + if((clnts = Xmalloc(sizeof(XResClient) * rep.num_clients))) { + xXResClient scratch; + int i; + + for(i = 0; i < rep.num_clients; i++) { + _XRead(dpy, (char*)&scratch, sz_xXResClient); + clnts[i].resource_base = scratch.resource_base; + clnts[i].resource_mask = scratch.resource_mask; + } + *clients = clnts; + *num_clients = rep.num_clients; + result = 1; + } else { + _XEatData(dpy, rep.length << 2); + } + } + + UnlockDisplay (dpy); + SyncHandle (); + return result; +} + +Status XResQueryClientResources ( + Display *dpy, + XID xid, + int *num_types, + XResType **types +) +{ + XExtDisplayInfo *info = find_display (dpy); + xXResQueryClientResourcesReq *req; + xXResQueryClientResourcesReply rep; + XResType *typs; + int result = 0; + + *num_types = 0; + *types = NULL; + + XResCheckExtension (dpy, info, 0); + + LockDisplay (dpy); + GetReq (XResQueryClientResources, req); + req->reqType = info->codes->major_opcode; + req->XResReqType = X_XResQueryClientResources; + req->xid = xid; + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { + UnlockDisplay (dpy); + SyncHandle (); + return 0; + } + + if(rep.num_types) { + if((typs = Xmalloc(sizeof(XResType) * rep.num_types))) { + xXResType scratch; + int i; + + for(i = 0; i < rep.num_types; i++) { + _XRead(dpy, (char*)&scratch, sz_xXResType); + typs[i].resource_type = scratch.resource_type; + typs[i].count = scratch.count; + } + *types = typs; + *num_types = rep.num_types; + result = 1; + } else { + _XEatData(dpy, rep.length << 2); + } + } + + UnlockDisplay (dpy); + SyncHandle (); + return result; +} + +Status XResQueryClientPixmapBytes ( + Display *dpy, + XID xid, + unsigned long *bytes +) +{ + XExtDisplayInfo *info = find_display (dpy); + xXResQueryClientPixmapBytesReq *req; + xXResQueryClientPixmapBytesReply rep; + + *bytes = 0; + + XResCheckExtension (dpy, info, 0); + + LockDisplay (dpy); + GetReq (XResQueryClientPixmapBytes, req); + req->reqType = info->codes->major_opcode; + req->XResReqType = X_XResQueryClientPixmapBytes; + req->xid = xid; + if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay (dpy); + SyncHandle (); + return 0; + } + +#ifdef LONG64 + *bytes = (rep.bytes_overflow * 4294967295) + rep.bytes; +#else + *bytes = rep.bytes_overflow ? 0xffffffff : rep.bytes; +#endif + + UnlockDisplay (dpy); + SyncHandle (); + return 1; +} + diff --git a/xres.pc.in b/xres.pc.in new file mode 100644 index 0000000..abbb4b6 --- /dev/null +++ b/xres.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: XRes +Description: X Resource Information Extension Library +Version: @VERSION@ +Requires: xproto +Requires.private: x11 xext +Cflags: -I${includedir} +Libs: -L${libdir} -lXRes -- 2.7.4