diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-27 13:42:41 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-27 13:42:41 +0000 |
| commit | 5face4c6f35172761367f63ac0b6eaf62d84e532 (patch) | |
| tree | 061851b68cc6e2d645b5966f76fa4ad0d300af92 /otk | |
| parent | 5168a8add5ed46f74b615ecc60738c1113606734 (diff) | |
use otk objects in the ob scripts by importing otk
Diffstat (limited to 'otk')
| -rw-r--r-- | otk/Makefile.am | 77 | ||||
| -rw-r--r-- | otk/otk.i | 43 | ||||
| -rw-r--r-- | otk/rendercolor.hh | 25 | ||||
| -rw-r--r-- | otk/rendertexture.hh | 8 |
4 files changed, 51 insertions, 102 deletions
diff --git a/otk/Makefile.am b/otk/Makefile.am index c714f472..29b35442 100644 --- a/otk/Makefile.am +++ b/otk/Makefile.am @@ -1,4 +1,5 @@ buttonsdir = $(pkgdatadir)/buttons +scriptdir = $(libdir)/openbox/python CXXFLAGS=$(XFT_CFLAGS) $(PYTHON_CFLAGS) @CXXFLAGS@ \ -DBUTTONSDIR=\"$(buttonsdir)\" @@ -6,7 +7,7 @@ CXXFLAGS=$(XFT_CFLAGS) $(PYTHON_CFLAGS) @CXXFLAGS@ \ INCLUDES= -I../src #noinst_LIBRARIES=libotk.a -noinst_LTLIBRARIES=libotk.la +lib_LTLIBRARIES=libotk.la libotk_la_SOURCES=rendercontrol.cc truerendercontrol.cc surface.cc \ renderstyle.cc rendercolor.cc \ @@ -15,13 +16,17 @@ libotk_la_SOURCES=rendercontrol.cc truerendercontrol.cc surface.cc \ timer.cc \ configuration.cc util.cc widget.cc focuswidget.cc \ button.cc eventhandler.cc eventdispatcher.cc ustring.cc \ - label.cc focuslabel.cc application.cc appwidget.cc -# otk_wrap.cc + label.cc focuslabel.cc application.cc appwidget.cc \ + otk_wrap.cc libotk_la_LDFLAGS = $(XFT_LIBS) $(PYTHON_LIBS) @LIBS@ MAINTAINERCLEANFILES= Makefile.in +script_DATA = otk.py + +EXTRA_DIST = $(script_DATA) + distclean-local: rm -f *\~ *.orig *.rej .\#* @@ -31,68 +36,10 @@ otk_test: libotk.la otk_test.cc rendertest: libotk.la rendertest.cc $(CXX) $(CXXFLAGS) -DHAVE_CONFIG_H -I. -I. -I.. -I../src $(XFT_CFLAGS) -Wall -W -pedantic -DNDEBUG -g -O2 -o $@ rendertest.cc $(XFT_LIBS) .libs/libotk.al @LIBS@ -#otk.i: $(wildcard *.hh) -# touch $@ +otk.i: $(wildcard *.hh) + touch $@ -#otk_wrap.cc: otk.i -# swig $(filter -I%,$(CXXFLAGS)) -python -shadow -c++ -o $@ $< +%_wrap.cc: %.i + swig -c $(filter -I%,$(CXXFLAGS)) -python -shadow -c++ -nodefault -o $@ $< # local dependencies -application.o: application.cc application.hh eventdispatcher.hh \ - eventhandler.hh display.hh configuration.hh \ - timer.hh image.hh color.hh screeninfo.hh rect.hh \ - point.hh style.hh font.hh texture.hh util.hh widget.hh -appwidget.o: appwidget.cc appwidget.hh widget.hh rect.hh point.hh \ - texture.hh color.hh util.hh style.hh font.hh image.hh screeninfo.hh \ - timer.hh configuration.hh eventdispatcher.hh eventhandler.hh \ - application.hh display.hh -button.o: button.cc button.hh focuslabel.hh focuswidget.hh widget.hh \ - rect.hh point.hh texture.hh color.hh util.hh style.hh font.hh \ - image.hh screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \ - eventhandler.hh application.hh display.hh -color.o: color.cc color.hh display.hh screeninfo.hh rect.hh point.hh -configuration.o: configuration.cc configuration.hh util.hh -eventdispatcher.o: eventdispatcher.cc eventdispatcher.hh \ - eventhandler.hh display.hh -eventhandler.o: eventhandler.cc eventhandler.hh -focuslabel.o: focuslabel.cc focuslabel.hh focuswidget.hh widget.hh \ - rect.hh point.hh texture.hh color.hh util.hh style.hh font.hh \ - image.hh screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \ - eventhandler.hh application.hh display.hh -focuswidget.o: focuswidget.cc focuswidget.hh widget.hh rect.hh \ - point.hh texture.hh color.hh util.hh style.hh font.hh image.hh \ - screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \ - eventhandler.hh application.hh display.hh -font.o: font.cc font.hh util.hh display.hh color.hh screeninfo.hh \ - rect.hh point.hh -gccache.o: gccache.cc gccache.hh display.hh color.hh assassin.hh \ - screeninfo.hh rect.hh point.hh -image.o: image.cc display.hh gccache.hh color.hh image.hh \ - screeninfo.hh rect.hh point.hh timer.hh texture.hh util.hh -imagecontrol.o: imagecontrol.cc display.hh color.hh image.hh \ - screeninfo.hh rect.hh point.hh timer.hh texture.hh util.hh -label.o: label.cc label.hh widget.hh rect.hh point.hh texture.hh \ - color.hh util.hh style.hh font.hh image.hh screeninfo.hh timer.hh \ - configuration.hh eventdispatcher.hh eventhandler.hh application.hh \ - display.hh -otk_test.o: otk_test.cc application.hh eventdispatcher.hh \ - eventhandler.hh display.hh configuration.hh \ - timer.hh image.hh color.hh screeninfo.hh rect.hh \ - point.hh style.hh font.hh texture.hh util.hh focuswidget.hh widget.hh \ - appwidget.hh button.hh focuslabel.hh -property.o: property.cc property.hh screeninfo.hh rect.hh point.hh \ - display.hh -rect.o: rect.cc rect.hh point.hh -screeninfo.o: screeninfo.cc screeninfo.hh rect.hh point.hh display.hh \ - util.hh -style.o: style.cc display.hh util.hh style.hh color.hh font.hh \ - texture.hh image.hh screeninfo.hh rect.hh point.hh timer.hh \ - configuration.hh -texture.o: texture.cc texture.hh color.hh util.hh display.hh image.hh \ - screeninfo.hh rect.hh point.hh timer.hh -timer.o: timer.cc timer.hh -util.o: util.cc util.hh -widget.o: widget.cc widget.hh rect.hh point.hh texture.hh color.hh \ - util.hh style.hh font.hh image.hh screeninfo.hh timer.hh \ - configuration.hh eventdispatcher.hh eventhandler.hh application.hh \ - display.hh assassin.hh @@ -14,35 +14,40 @@ //%include std_list.i %include "ustring.i" -%ignore otk::OBDisplay::display; +%ignore otk::display; %inline %{ - Display *OBDisplay_display() { return otk::OBDisplay::display; } + 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_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(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!=; +//%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 OBTimer::operator<; %ignore TimerLessThan; /* @@ -52,8 +57,13 @@ namespace otk { */ } -%include "eventdispatcher.hh" %include "eventhandler.hh" +%include "eventdispatcher.hh" +%include "point.hh" +%include "rect.hh" +%include "rendercolor.hh" +%include "rendertexture.hh" +%include "renderstyle.hh" %include "widget.hh" %include "focuswidget.hh" %include "focuslabel.hh" @@ -61,23 +71,16 @@ namespace otk { %include "application.hh" %include "assassin.hh" %include "button.hh" -%include "color.hh" -%include "configuration.hh" +//%include "configuration.hh" %include "display.hh" %include "font.hh" -%include "gccache.hh" -%include "image.hh" +%include "rendercontrol.hh" %include "label.hh" -%include "point.hh" %include "property.hh" -%include "rect.hh" %include "screeninfo.hh" %include "strut.hh" -%include "style.hh" -%include "texture.hh" %include "timer.hh" %include "util.hh" -%include "widget.hh" // for Mod1Mask etc %include "X11/X.h" diff --git a/otk/rendercolor.hh b/otk/rendercolor.hh index c5835385..8ed8ce58 100644 --- a/otk/rendercolor.hh +++ b/otk/rendercolor.hh @@ -10,20 +10,19 @@ extern "C" { namespace otk { -class RenderColor { -public: - struct RGB { - int r; - int g; - int b; - RGB(int red, int green, int blue) : r(red), g(green), b(blue) {} - // color is in ARGB format - RGB(unsigned long color) - : r((color >> 16) & 0xff), - g((color >> 8) & 0xff), - b((color) & 0xff) {} - }; +struct RGB { + int r; + int g; + int b; + RGB(int red, int green, int blue) : r(red), g(green), b(blue) {} + // color is in ARGB format + RGB(unsigned long color) + : r((color >> 16) & 0xff), + g((color >> 8) & 0xff), + b((color) & 0xff) {} +}; +class RenderColor { private: struct CacheItem { GC gc; diff --git a/otk/rendertexture.hh b/otk/rendertexture.hh index 8e588558..54fbd9c2 100644 --- a/otk/rendertexture.hh +++ b/otk/rendertexture.hh @@ -70,10 +70,10 @@ public: RenderTexture(int screen, bool parent_relative, ReliefType relief, BevelType bevel, bool border, GradientType gradient, bool interlaced, - const RenderColor::RGB &color, - const RenderColor::RGB &secondary_color, - const RenderColor::RGB &border_color, - const RenderColor::RGB &interlace_color) + const RGB &color, + const RGB &secondary_color, + const RGB &border_color, + const RGB &interlace_color) : _screen(screen), _parent_relative(parent_relative), _relief(relief), |
