From 67fbe8354f27386235e0c8dc57bd036e34a4fe5e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 5 Feb 2003 10:48:37 +0000 Subject: dont make wrap a subdir of otk --- Makefile.am | 2 +- configure.ac | 2 +- otk/Makefile.am | 2 -- otk/wrap/.cvsignore | 9 ------ otk/wrap/Makefile.am | 32 --------------------- otk/wrap/otk.i | 81 ---------------------------------------------------- otk/wrap/ustring.i | 40 -------------------------- wrap/.cvsignore | 9 ++++++ wrap/Makefile.am | 35 +++++++++++++++++++++++ wrap/otk.i | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ wrap/ustring.i | 40 ++++++++++++++++++++++++++ 11 files changed, 167 insertions(+), 166 deletions(-) delete mode 100644 otk/wrap/.cvsignore delete mode 100644 otk/wrap/Makefile.am delete mode 100644 otk/wrap/otk.i delete mode 100644 otk/wrap/ustring.i create mode 100644 wrap/.cvsignore create mode 100644 wrap/Makefile.am create mode 100644 wrap/otk.i create mode 100644 wrap/ustring.i diff --git a/Makefile.am b/Makefile.am index 2c96933d..e6c9a7a6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = po data doc otk src scripts +SUBDIRS = po data doc otk wrap src scripts MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in .PHONY: doc diff --git a/configure.ac b/configure.ac index 9d58ce20..9e7d9bfc 100644 --- a/configure.ac +++ b/configure.ac @@ -48,8 +48,8 @@ X11_EXT_XINERAMA AC_CONFIG_FILES([Makefile po/Makefile.in otk/Makefile - otk/wrap/Makefile src/Makefile + wrap/Makefile scripts/Makefile doc/Makefile doc/doxygen/Makefile diff --git a/otk/Makefile.am b/otk/Makefile.am index 31eb4a76..feeda741 100644 --- a/otk/Makefile.am +++ b/otk/Makefile.am @@ -1,5 +1,3 @@ -SUBDIRS = wrap - buttonsdir = $(pkgdatadir)/buttons includeotkdir = $(includedir)/otk pkgconfigdir = $(libdir)/pkgconfig diff --git a/otk/wrap/.cvsignore b/otk/wrap/.cvsignore deleted file mode 100644 index 63aba835..00000000 --- a/otk/wrap/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -otk.py -.deps -.libs -otkpy.la -otkpy_la-wrap_otk.lo -otkpy_la-wrap_otk.o -wrap_otk.cc diff --git a/otk/wrap/Makefile.am b/otk/wrap/Makefile.am deleted file mode 100644 index 4c2de002..00000000 --- a/otk/wrap/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -# XXX - INSTALL THIS GLOBALLY!#&@(!!! -pythondir = $(libdir)/openbox/python - -CXXFLAGS = $(XFT_CFLAGS) $(filter-out -W -Wall,@CXXFLAGS@) - -INCLUDES = -I.. -I../.. - -python_LTLIBRARIES = otkpy.la - -otkpy_la_CXXFLAGS = $(PYTHON_CFLAGS) -otkpy_la_LDFLAGS = -module -otkpy_la_SOURCES = wrap_otk.cc -otkpy_la_LIBADD = ../libotk.la - -CLEANFILES = wrap_* otk.py -MAINTAINERCLEANFILES = Makefile.in - -python_PYTHON = otk.py - -install-exec-hook: - $(mkinstalldirs) "$(DESTDIR)$(pythondir)" - cd "$(DESTDIR)$(pythondir)" && \ - $(RM) -f _otk.so && $(LN_S) otkpy.so _otk.so - -uninstall-local: - rm -f "$(DESTDIR)$(pythondir)/_otk.so" - -%.py: wrap_%.cc - -wrap_%.cc: %.i $(wildcard ../*.hh) - swig $(INCLUDES) $(filter -I%,$(CXXFLAGS)) -python -shadow -c++ -nodefault -o $@ $< - diff --git a/otk/wrap/otk.i b/otk/wrap/otk.i deleted file mode 100644 index 5bf17a21..00000000 --- a/otk/wrap/otk.i +++ /dev/null @@ -1,81 +0,0 @@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- - -%module otk - -%{ -#include "otk.hh" -%} - -%include "stl.i" -//%include std_list.i -%include "ustring.i" - -%ignore otk::display; -%inline %{ - otk::Display *Display_instance() { return otk::display; } -%}; - -%ignore otk::Property::atoms; -%inline %{ - const otk::Atoms& Property_atoms() { return otk::Property::atoms; } -%}; - -namespace otk { -/*%rename(setValue_bool) Configuration::setValue(std::string const &,bool); -%rename(setValue_unsigned) Configuration::setValue(const std::string &, unsigned int); -%rename(setValue_long) Configuration::setValue(const std::string &, long); -%rename(setValue_unsignedlong) Configuration::setValue(const std::string &, unsigned long); -%rename(setValue_string) Configuration::setValue(const std::string &, const std::string &); -%rename(setValue_charptr) Configuration::setValue(const std::string &, const char *);*/ - -%rename(itostring_unsigned) itostring(unsigned int); -%rename(itostring_long) itostring(long); -%rename(itostring_unsigned_long) itostring(unsigned long); - -// these are needed for guile, but not needed for python! -//%rename(equals) BColor::operator==; -//%rename(equals) Rect::operator==; -//%rename(equals) BTexture::operator==; -//%ignore BColor::operator!=; -//%ignore BTexture::operator!=; -%ignore Rect::operator!=; -%ignore Rect::operator|; -%ignore Rect::operator|=; -%ignore Rect::operator&; -%ignore Rect::operator&=; -//%ignore OBTimer::operator<; -%ignore TimerLessThan; - -/* -%rename(set_multi) OtkProperty::set(Window, Atoms, Atoms, unsigned long[], int); -%rename(set_string) OtkProperty::set(Window, Atoms, StringType, const std::string &); -%rename(set_string_multi) OtkProperty::set(Window, Atoms, StringType, const StringVect &); -*/ -} - -%include "eventhandler.hh" -%include "eventdispatcher.hh" -%include "point.hh" -%include "rect.hh" -%include "rendercolor.hh" -%include "rendertexture.hh" -%include "font.hh" -%include "renderstyle.hh" -%include "widget.hh" -%include "label.hh" -%include "focuswidget.hh" -%include "focuslabel.hh" -%include "appwidget.hh" -%include "application.hh" -%include "assassin.hh" -%include "button.hh" -%include "display.hh" -%include "rendercontrol.hh" -%include "property.hh" -%include "screeninfo.hh" -%include "strut.hh" -%include "timer.hh" -%include "util.hh" - -// for Mod1Mask etc -%include "X11/X.h" diff --git a/otk/wrap/ustring.i b/otk/wrap/ustring.i deleted file mode 100644 index d693e7dc..00000000 --- a/otk/wrap/ustring.i +++ /dev/null @@ -1,40 +0,0 @@ -// SWIG typemaps for otk::ustring - -%{ -#include "otk/ustring.hh" -%} - -namespace otk { - - class ustring; - - /* Overloading check */ - - %typemap(typecheck) ustring = char *; - %typemap(typecheck) const ustring & = char *; - - %typemap(in) ustring { - if (PyString_Check($input)) - $1 = otk::ustring(PyString_AsString($input)); - else - SWIG_exception(SWIG_TypeError, "ustring expected"); - } - - %typemap(in) const ustring & (otk::ustring temp) { - if (PyString_Check($input)) { - temp = otk::ustring(PyString_AsString($input)); - $1 = &temp; - } else { - SWIG_exception(SWIG_TypeError, "ustring expected"); - } - } - - %typemap(out) ustring { - $result = PyString_FromString($1.c_str()); - } - - %typemap(out) const ustring & { - $result = PyString_FromString($1->c_str()); - } - -} diff --git a/wrap/.cvsignore b/wrap/.cvsignore new file mode 100644 index 00000000..63aba835 --- /dev/null +++ b/wrap/.cvsignore @@ -0,0 +1,9 @@ +Makefile +Makefile.in +otk.py +.deps +.libs +otkpy.la +otkpy_la-wrap_otk.lo +otkpy_la-wrap_otk.o +wrap_otk.cc diff --git a/wrap/Makefile.am b/wrap/Makefile.am new file mode 100644 index 00000000..7c8e603a --- /dev/null +++ b/wrap/Makefile.am @@ -0,0 +1,35 @@ +# XXX - INSTALL THIS GLOBALLY!#&@(!!! +pythondir = $(libdir)/openbox/python + +CXXFLAGS = $(XFT_CFLAGS) $(filter-out -W -Wall,@CXXFLAGS@) + +INCLUDES = -I.. -I../swig + +python_LTLIBRARIES = otkpy.la + +otkpy_la_CXXFLAGS = $(PYTHON_CFLAGS) +otkpy_la_LDFLAGS = -module +otkpy_la_SOURCES = wrap_otk.cc +otkpy_la_LIBADD = ../otk/libotk.la + +CLEANFILES = wrap_* otk.py +MAINTAINERCLEANFILES = Makefile.in + +python_PYTHON = otk.py + +install-exec-hook: + $(mkinstalldirs) "$(DESTDIR)$(pythondir)" + cd "$(DESTDIR)$(pythondir)" && \ + $(RM) -f _otk.so && $(LN_S) otkpy.so _otk.so + +uninstall-local: + rm -f "$(DESTDIR)$(pythondir)/_otk.so" + +%.py: wrap_%.cc + +otk.i: $(wildcard ../otk/*.hh) + @touch $@ + +wrap_%.cc: %.i + swig $(INCLUDES) $(filter -I%,$(CXXFLAGS)) -python -shadow -c++ -nodefault -o $@ $< + diff --git a/wrap/otk.i b/wrap/otk.i new file mode 100644 index 00000000..5bf17a21 --- /dev/null +++ b/wrap/otk.i @@ -0,0 +1,81 @@ +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- + +%module otk + +%{ +#include "otk.hh" +%} + +%include "stl.i" +//%include std_list.i +%include "ustring.i" + +%ignore otk::display; +%inline %{ + otk::Display *Display_instance() { return otk::display; } +%}; + +%ignore otk::Property::atoms; +%inline %{ + const otk::Atoms& Property_atoms() { return otk::Property::atoms; } +%}; + +namespace otk { +/*%rename(setValue_bool) Configuration::setValue(std::string const &,bool); +%rename(setValue_unsigned) Configuration::setValue(const std::string &, unsigned int); +%rename(setValue_long) Configuration::setValue(const std::string &, long); +%rename(setValue_unsignedlong) Configuration::setValue(const std::string &, unsigned long); +%rename(setValue_string) Configuration::setValue(const std::string &, const std::string &); +%rename(setValue_charptr) Configuration::setValue(const std::string &, const char *);*/ + +%rename(itostring_unsigned) itostring(unsigned int); +%rename(itostring_long) itostring(long); +%rename(itostring_unsigned_long) itostring(unsigned long); + +// these are needed for guile, but not needed for python! +//%rename(equals) BColor::operator==; +//%rename(equals) Rect::operator==; +//%rename(equals) BTexture::operator==; +//%ignore BColor::operator!=; +//%ignore BTexture::operator!=; +%ignore Rect::operator!=; +%ignore Rect::operator|; +%ignore Rect::operator|=; +%ignore Rect::operator&; +%ignore Rect::operator&=; +//%ignore OBTimer::operator<; +%ignore TimerLessThan; + +/* +%rename(set_multi) OtkProperty::set(Window, Atoms, Atoms, unsigned long[], int); +%rename(set_string) OtkProperty::set(Window, Atoms, StringType, const std::string &); +%rename(set_string_multi) OtkProperty::set(Window, Atoms, StringType, const StringVect &); +*/ +} + +%include "eventhandler.hh" +%include "eventdispatcher.hh" +%include "point.hh" +%include "rect.hh" +%include "rendercolor.hh" +%include "rendertexture.hh" +%include "font.hh" +%include "renderstyle.hh" +%include "widget.hh" +%include "label.hh" +%include "focuswidget.hh" +%include "focuslabel.hh" +%include "appwidget.hh" +%include "application.hh" +%include "assassin.hh" +%include "button.hh" +%include "display.hh" +%include "rendercontrol.hh" +%include "property.hh" +%include "screeninfo.hh" +%include "strut.hh" +%include "timer.hh" +%include "util.hh" + +// for Mod1Mask etc +%include "X11/X.h" diff --git a/wrap/ustring.i b/wrap/ustring.i new file mode 100644 index 00000000..d693e7dc --- /dev/null +++ b/wrap/ustring.i @@ -0,0 +1,40 @@ +// SWIG typemaps for otk::ustring + +%{ +#include "otk/ustring.hh" +%} + +namespace otk { + + class ustring; + + /* Overloading check */ + + %typemap(typecheck) ustring = char *; + %typemap(typecheck) const ustring & = char *; + + %typemap(in) ustring { + if (PyString_Check($input)) + $1 = otk::ustring(PyString_AsString($input)); + else + SWIG_exception(SWIG_TypeError, "ustring expected"); + } + + %typemap(in) const ustring & (otk::ustring temp) { + if (PyString_Check($input)) { + temp = otk::ustring(PyString_AsString($input)); + $1 = &temp; + } else { + SWIG_exception(SWIG_TypeError, "ustring expected"); + } + } + + %typemap(out) ustring { + $result = PyString_FromString($1.c_str()); + } + + %typemap(out) const ustring & { + $result = PyString_FromString($1->c_str()); + } + +} -- cgit v1.2.3