2014-01-13 08:05:00 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
# vim: encoding=utf-8
|
|
|
|
# Generate the file lists for processing with g-ir-scanner
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import re
|
|
|
|
import string
|
|
|
|
import subprocess
|
|
|
|
import optparse
|
|
|
|
|
|
|
|
from msvcfiles import read_vars_from_AM
|
|
|
|
|
|
|
|
def gen_gdk_filelist(srcroot, subdir, dest):
|
|
|
|
vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'),
|
|
|
|
vars = {},
|
|
|
|
conds = {},
|
2014-06-09 04:44:46 +00:00
|
|
|
filters = ['gdk_h_sources', 'gdk_c_sources'])
|
2014-01-13 08:05:00 +00:00
|
|
|
|
|
|
|
vars['gdk_enums'] = 'gdkenumtypes.c gdkenumtypes.h'
|
|
|
|
|
2014-07-01 05:26:18 +00:00
|
|
|
files = vars['gdk_h_sources'].split() + \
|
2014-01-13 08:05:00 +00:00
|
|
|
vars['gdk_c_sources'].split() + \
|
|
|
|
vars['gdk_enums'].split()
|
|
|
|
|
|
|
|
sources = [i for i in files if (i != 'gdkkeysyms-compat.h')]
|
|
|
|
|
|
|
|
with open(dest, 'w') as d:
|
|
|
|
for i in sources:
|
|
|
|
d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
|
|
|
|
|
2014-04-03 07:49:05 +00:00
|
|
|
def gen_gdkwin32_filelist(srcroot, subdir, dest):
|
|
|
|
vars = read_vars_from_AM(os.path.join(srcroot, subdir, 'Makefile.am'),
|
|
|
|
vars = {},
|
|
|
|
conds = {'HAVE_INTROSPECTION': True,
|
|
|
|
'OS_WIN32': True},
|
|
|
|
filters = ['w32_introspection_files'])
|
|
|
|
|
|
|
|
files = vars['w32_introspection_files'].split()
|
|
|
|
|
|
|
|
with open(dest, 'w') as d:
|
|
|
|
for i in files:
|
|
|
|
d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
|
|
|
|
|
|
|
|
def gen_gtk_filelist(srcroot, subdir, dest):
|
2014-01-13 08:05:00 +00:00
|
|
|
vars = read_vars_from_AM(os.path.join(srcroot, 'gtk', 'Makefile.am'),
|
|
|
|
vars = {},
|
2014-04-03 07:49:05 +00:00
|
|
|
conds = {'USE_WIN32': True,
|
2014-01-13 08:05:00 +00:00
|
|
|
'USE_QUARTZ': False,
|
|
|
|
'USE_X11': False,
|
|
|
|
'USE_EXTERNAL_ICON_CACHE': False},
|
|
|
|
filters = ['gtkinclude_HEADERS',
|
2014-06-09 04:44:46 +00:00
|
|
|
'a11yinclude_HEADERS',
|
2014-01-13 08:05:00 +00:00
|
|
|
'deprecatedinclude_HEADERS',
|
|
|
|
'gtk_base_c_sources',
|
|
|
|
'gtk_clipboard_dnd_c_sources'])
|
|
|
|
|
|
|
|
vars['gtk_other_src'] = 'gtkprintoperation-win32.c gtktypebuiltins.h gtktypebuiltins.c'
|
|
|
|
|
|
|
|
files = vars['gtkinclude_HEADERS'].split() + \
|
2014-06-09 04:44:46 +00:00
|
|
|
vars['a11yinclude_HEADERS'].split() + \
|
2014-01-13 08:05:00 +00:00
|
|
|
vars['deprecatedinclude_HEADERS'].split() + \
|
|
|
|
vars['gtk_base_c_sources'].split() + \
|
|
|
|
vars['gtk_clipboard_dnd_c_sources'].split() + \
|
|
|
|
vars['gtk_other_src'].split()
|
|
|
|
|
2014-07-16 10:04:38 +00:00
|
|
|
sources = [i for i in files \
|
|
|
|
if not (i.endswith('private.h')) \
|
|
|
|
and i != 'gtktextdisplay.h' \
|
|
|
|
and i != 'gtktextlayout.h' \
|
|
|
|
and i != 'gtkx.h']
|
2014-01-13 08:05:00 +00:00
|
|
|
|
|
|
|
with open(dest, 'w') as d:
|
|
|
|
for i in sources:
|
|
|
|
d.write(srcroot + '\\' + subdir + '\\' + i.replace('/', '\\') + '\n')
|
|
|
|
|
|
|
|
def main(argv):
|
|
|
|
srcroot = '..'
|
|
|
|
subdir_gdk = 'gdk'
|
|
|
|
subdir_gtk = 'gtk'
|
|
|
|
|
|
|
|
gen_gdk_filelist(srcroot, subdir_gdk, 'gdk_list')
|
2014-04-03 07:49:05 +00:00
|
|
|
gen_gdkwin32_filelist(srcroot, subdir_gdk, 'gdkwin32_list')
|
|
|
|
gen_gtk_filelist(srcroot, subdir_gtk, 'gtk_list')
|
2014-01-13 08:05:00 +00:00
|
|
|
return 0
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main(sys.argv))
|