aboutsummaryrefslogtreecommitdiffstats
path: root/src/extract
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/extract/libgamma-method-extract28
1 files changed, 27 insertions, 1 deletions
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))