aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--info/libgamma.texinfo33
-rwxr-xr-xsrc/extract/libgamma-method-extract28
2 files changed, 60 insertions, 1 deletions
diff --git a/info/libgamma.texinfo b/info/libgamma.texinfo
index fead5de..0fd280c 100644
--- a/info/libgamma.texinfo
+++ b/info/libgamma.texinfo
@@ -467,6 +467,7 @@ and for the freedom of all.
@menu
* Adjustment methods:: Selecting adjustment method.
+* CRTC information:: Retrieving information about CRTC:s.
* Errors:: Error codes and how to handle errors.
@end menu
@@ -554,6 +555,38 @@ values.
+@node CRTC information
+@section CRTC information
+
+CRTC information.
+
+@table @code
+£>for info in $(libgamma-method-extract --list --info); do
+@item £{info}
+£>libgamma-method-extract --info $info | texise
+£>done
+@end table
+
+Subpixel order.
+
+@table @code
+£>for order in $(libgamma-method-extract --list --subpixel); do
+@item £{order}
+£>libgamma-method-extract --subpixel $order | texise
+£>done
+@end table
+
+Connector type.
+
+@table @code
+£>for type in $(libgamma-method-extract --list --connector); do
+@item £{type}
+£>libgamma-method-extract --connector $type | texise
+£>done
+@end table
+
+
+
@node Errors
@section Errors
diff --git a/src/extract/libgamma-method-extract b/src/extract/libgamma-method-extract
index 983f606..b521971 100755
--- a/src/extract/libgamma-method-extract
+++ b/src/extract/libgamma-method-extract
@@ -31,8 +31,23 @@ if sys.argv[1] == '--list':
test3 = lambda line : not line.endswith('_H')
defs = [line for line in data.split('\n') if test1(line) and test2(line) and test3(line)]
print('\n'.join([d.split(' ')[1] for d in defs]))
+ elif sys.argv[2] == '--info':
+ test1 = lambda line : line.startswith('#define LIBGAMMA_CRTC_INFO_')
+ test2 = lambda line : not line.split(' ')[1] == 'LIBGAMMA_CRTC_INFO_COUNT'
+ defs = [line for line in data.split('\n') if test1(line) and test2(line)]
+ print('\n'.join([d.split(' ')[1] for d in defs]))
+ elif sys.argv[2] == '--connector':
+ test1 = lambda line : line.strip().startswith('LIBGAMMA_CONNECTOR_TYPE_')
+ test2 = lambda line : not line.split(' ')[1] == 'LIBGAMMA_CONNECTOR_TYPE_COUNT'
+ defs = [line for line in data.split('\n') if test1(line) and test2(line)]
+ print('\n'.join([d.strip().split(' ')[0].rstrip(',') for d in defs]))
+ elif sys.argv[2] == '--subpixel':
+ test1 = lambda line : line.strip().startswith('LIBGAMMA_SUBPIXEL_ORDER_')
+ test2 = lambda line : not line.split(' ')[1] == 'LIBGAMMA_SUBPIXEL_ORDER_COUNT'
+ defs = [line for line in data.split('\n') if test1(line) and test2(line)]
+ print('\n'.join([d.strip().split(' ')[0].rstrip(',') for d in defs]))
else:
- if sys.argv[1] == '--method':
+ if sys.argv[1] in ('--method', '--info'):
i = data.find('\n#define ' + sys.argv[2])
data = data[:i]
i = data.rfind('\n */')
@@ -41,4 +56,15 @@ else:
data = data[i + len('/**\n'):]
data = [line[3:] for line in data.split('\n')]
print('\n'.join(data))
+ if sys.argv[1] in ('--connector', '--subpixel'):
+ while '\n ' in data:
+ data = data.replace('\n ', '\n')
+ i = data.find('\n' + sys.argv[2])
+ data = data[:i]
+ i = data.rfind('\n*/')
+ data = data[:i]
+ i = data.rfind('/**\n')
+ data = data[i + len('/**\n'):]
+ data = [line[2:] for line in data.split('\n')]
+ print('\n'.join(data))