#!/usr/bin/env python
#
# Generate the SIP specification files for C++ templates.
#
# Copyright (C) 2001-2005 Gerard Vermeulen
# Copyright (C) 2000 Mark Colclough
#
# This file is part of PyQwt.
#
# -- LICENSE --
#
# PyQwt is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# PyQwt is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along
# with PyQwt; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# In addition, as a special exception, Gerard Vermeulen gives permission to
# link PyQwt dynamically with commercial, non-commercial or educational
# versions of Qt, PyQt and sip, and distribute PyQwt in this form, provided
# that equally powerful versions of Qt, PyQt and sip have been released under
# the terms of the GNU General Public License.
#
# If PyQwt is dynamically linked with commercial, non-commercial or
# educational versions of Qt, PyQt and sip, PyQwt3D becomes a free plug-in for
# a non-free program.
#
# -- LICENSE --


import os

QWT_ARRAY_BASE = open('QWT_ARRAY_BASE').read()
QWT_ARRAY_USER = open('QWT_ARRAY_USER').read()

file = open('QwtArrayDouble.sip', 'w')
print >> file, QWT_ARRAY_BASE % {
    'HEAD': ('\n#include <qwt_array.h>'          
             '\ntypedef QwtArray<double> QwtArrayDouble;'
             ),
    'ITEM': 'double',
    'ARRAY': 'QwtArrayDouble',
    }

file = open('QwtArrayLong.sip', 'w')
print >> file, QWT_ARRAY_BASE % {
    'HEAD': ('\n#include <qwt_array.h>'          
             '\ntypedef QwtArray<long> QwtArrayLong;'
             ),
    'ITEM': 'long',
    'ARRAY': 'QwtArrayLong',
    }

file = open('QwtArrayQwtDiMap.sip', 'w')
print >> file, QWT_ARRAY_USER % {
    'HEAD': ('\n#include <qwt_array.h>'
             '\n#include <qwt_dimap.h>'
             '\ntypedef QwtArray<QwtDiMap> QwtArrayQwtDiMap;'
             ),
    'ITEM': 'QwtDiMap',
    'ARRAY': 'QwtArrayQwtDiMap',
    }

file = open('QwtArrayQwtDoublePoint.sip', 'w')
print >> file, QWT_ARRAY_USER % {
    'HEAD': ('\n#include <qwt_array.h>'
             '\n#include <qwt_double_rect.h>'
             '\ntypedef QwtArray<QwtDoublePoint> QwtArrayQwtDoublePoint;'
             ),
    'ITEM': 'QwtDoublePoint',
    'ARRAY': 'QwtArrayQwtDoublePoint',
    }

file = open('QwtArrayQwtKeyPattern.sip', 'w')
print >> file, QWT_ARRAY_USER % {
    'HEAD': ('\n#include <qwt_array.h>'
             '\n#include <qwt_event_pattern.h>'
             '\ntypedef QwtArray<QwtEventPattern::KeyPattern>'
             ' QwtArrayQwtKeyPattern;'
             ),
    'ITEM': 'QwtEventPattern::KeyPattern',
    'ARRAY': 'QwtArrayQwtKeyPattern',
    }

file = open('QwtArrayQwtMousePattern.sip', 'w')
print >> file, QWT_ARRAY_USER % {
    'HEAD': ('\n#include <qwt_array.h>'
             '\n#include <qwt_event_pattern.h>'
             '\ntypedef QwtArray<QwtEventPattern::MousePattern>'
             ' QwtArrayQwtMousePattern;'
             ),
    'ITEM': 'QwtEventPattern::MousePattern',
    'ARRAY': 'QwtArrayQwtMousePattern',
    }

file = open('QwtArrayQwtScaleMap.sip', 'w')
print >> file, QWT_ARRAY_USER % {
    'HEAD': ('\n#include <qwt_array.h>'
             '\n#include <qwt_dimap.h>'
             '\ntypedef QwtArray<QwtScaleMap> QwtArrayQwtScaleMap;'
             ),
    'ITEM': 'QwtScaleMap',
    'ARRAY': 'QwtArrayQwtScaleMap',
    }

# Local Variables: ***
# mode: python ***
# End: ***
