Commit a66d8d94e77c673f243d4e1d0e4269af5b886699
1 parent
319824b9
Exists in
master
and in
5 other branches
wip
Showing
4 changed files
with
91 additions
and
2 deletions
Show diff stats
src/oxt/Makefile.in
| @@ -24,9 +24,12 @@ | @@ -24,9 +24,12 @@ | ||
| 24 | # erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | 24 | # erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) |
| 25 | # | 25 | # |
| 26 | 26 | ||
| 27 | +SOURCES=info.cc | ||
| 28 | + | ||
| 27 | #---[ LibreOffice SDK ]-------------------------------------------------------- | 29 | #---[ LibreOffice SDK ]-------------------------------------------------------- |
| 28 | 30 | ||
| 29 | OO_SDK_HOME=@OO_SDK_HOME@ | 31 | OO_SDK_HOME=@OO_SDK_HOME@ |
| 32 | +OO_SDK_URE_HOME=@OO_SDK_URE_HOME@ | ||
| 30 | IDLC=@IDLC@ | 33 | IDLC=@IDLC@ |
| 31 | REGMERGE=@REGMERGE@ | 34 | REGMERGE=@REGMERGE@ |
| 32 | CPPUMAKER=@CPPUMAKER@ | 35 | CPPUMAKER=@CPPUMAKER@ |
| @@ -67,6 +70,10 @@ BINRLS=$(BINDIR)/Release | @@ -67,6 +70,10 @@ BINRLS=$(BINDIR)/Release | ||
| 67 | CPPUENV="gcc3" | 70 | CPPUENV="gcc3" |
| 68 | CXXFLAGS=@CXXFLAGS@ -Wno-strict-aliasing -I./include -I$(includedir)/libreoffice -Wno-strict-aliasing -DCPPU_ENV=$(CPPUENV) -DLANGUAGE_BINDING_NAME=\"$(CPPUENV)\" | 71 | CXXFLAGS=@CXXFLAGS@ -Wno-strict-aliasing -I./include -I$(includedir)/libreoffice -Wno-strict-aliasing -DCPPU_ENV=$(CPPUENV) -DLANGUAGE_BINDING_NAME=\"$(CPPUENV)\" |
| 69 | 72 | ||
| 73 | +OO_LDFLAGS=-L$(OO_SDK_HOME)/lib -L$(OO_SDK_URE_HOME)/lib \ | ||
| 74 | + -Wl,-rpath-link=$(OO_SDK_URE_HOME)/lib,-rpath=$(OO_SDK_URE_HOME)/lib \ | ||
| 75 | + -luno_cppu -luno_cppuhelpergcc3 -luno_salhelpergcc3 | ||
| 76 | + | ||
| 70 | #---[ Rules ]------------------------------------------------------------------ | 77 | #---[ Rules ]------------------------------------------------------------------ |
| 71 | 78 | ||
| 72 | %.urd: %.idl | 79 | %.urd: %.idl |
| @@ -87,7 +94,7 @@ CXXFLAGS=@CXXFLAGS@ -Wno-strict-aliasing -I./include -I$(includedir)/libreoffice | @@ -87,7 +94,7 @@ CXXFLAGS=@CXXFLAGS@ -Wno-strict-aliasing -I./include -I$(includedir)/libreoffice | ||
| 87 | $(OBJDBG)/%.o: %.cc include/pw3270/lib3270.hpp include/com/sun/star/uno/XWeak.hpp *.hpp Makefile | 94 | $(OBJDBG)/%.o: %.cc include/pw3270/lib3270.hpp include/com/sun/star/uno/XWeak.hpp *.hpp Makefile |
| 88 | @echo $< ... | 95 | @echo $< ... |
| 89 | @mkdir -p `dirname $@` | 96 | @mkdir -p `dirname $@` |
| 90 | - $(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ $< | 97 | + $(CXX) -DDEBUG=1 $(CXXFLAGS) -o $@ -c $< |
| 91 | # $(DBG_CFLAGS) $(CXXFLAGS) $(LIB3270_CFLAGS) -DLIBNAME=\"$(BINDBG)/$(PROGRAM_NAME).uno@DLLEXT@\" -o $@ -c $< | 98 | # $(DBG_CFLAGS) $(CXXFLAGS) $(LIB3270_CFLAGS) -DLIBNAME=\"$(BINDBG)/$(PROGRAM_NAME).uno@DLLEXT@\" -o $@ -c $< |
| 92 | 99 | ||
| 93 | 100 | ||
| @@ -106,10 +113,15 @@ include/com/sun/star/uno/%.hpp: %.rdb | @@ -106,10 +113,15 @@ include/com/sun/star/uno/%.hpp: %.rdb | ||
| 106 | 113 | ||
| 107 | #---[ Debug targets ]---------------------------------------------------------- | 114 | #---[ Debug targets ]---------------------------------------------------------- |
| 108 | 115 | ||
| 109 | -Debug: $(OBJDBG)/testprogram.o | 116 | +Debug: $(BINDBG)/pw3270.uno@DLLEXT@ |
| 110 | 117 | ||
| 111 | cleanDebug: clean | 118 | cleanDebug: clean |
| 112 | 119 | ||
| 120 | +$(BINDBG)/pw3270.uno@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) | ||
| 121 | + @echo $@ ... | ||
| 122 | + @$(MKDIR) `dirname $@` | ||
| 123 | + $(CXX) -shared $(LDFLAGS) $(OO_LDFLAGS) -o $@ $^ | ||
| 124 | + | ||
| 113 | 125 | ||
| 114 | #---[ Misc targets ]----------------------------------------------------------- | 126 | #---[ Misc targets ]----------------------------------------------------------- |
| 115 | 127 |
src/oxt/globals.hpp
| @@ -68,6 +68,22 @@ | @@ -68,6 +68,22 @@ | ||
| 68 | { | 68 | { |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | + /* | ||
| 72 | + // https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Implementing_without_Helpers | ||
| 73 | + class session_impl : public ::pw3270::lib3270, lang::XServiceInfo | ||
| 74 | + { | ||
| 75 | + private: | ||
| 76 | + oslInterlockedCount m_refcount; | ||
| 77 | + public: | ||
| 78 | + | ||
| 79 | + inline session_impl() throw () : m_refcount( 0 ) { } | ||
| 80 | + | ||
| 81 | + // XInterface | ||
| 82 | + virtual Any SAL_CALL queryInterface( Type const & type ) throw (RuntimeException); | ||
| 83 | + virtual void SAL_CALL acquire() throw (); | ||
| 84 | + virtual void SAL_CALL release() throw (); | ||
| 85 | + }; | ||
| 86 | + */ | ||
| 71 | }; | 87 | }; |
| 72 | 88 | ||
| 73 | 89 |
| @@ -0,0 +1,60 @@ | @@ -0,0 +1,60 @@ | ||
| 1 | +/* | ||
| 2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | ||
| 3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | ||
| 4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | ||
| 5 | + * | ||
| 6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | ||
| 7 | + * | ||
| 8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | ||
| 9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | ||
| 10 | + * Free Software Foundation. | ||
| 11 | + * | ||
| 12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | ||
| 13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | ||
| 14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | ||
| 15 | + * obter mais detalhes. | ||
| 16 | + * | ||
| 17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | ||
| 18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | ||
| 19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | ||
| 20 | + * | ||
| 21 | + * Este programa está nomeado como info.cc e possui - linhas de código. | ||
| 22 | + * | ||
| 23 | + * Contatos: | ||
| 24 | + * | ||
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ||
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | ||
| 27 | + * | ||
| 28 | + * Referência: | ||
| 29 | + * | ||
| 30 | + * https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/C%2B%2B/Class_Definition_with_Helper_Template_Classes | ||
| 31 | + * | ||
| 32 | + */ | ||
| 33 | + | ||
| 34 | + #include "globals.hpp" | ||
| 35 | + #include "pw3270/lib3270.hpp" | ||
| 36 | + | ||
| 37 | +/*---[ Implement ]-----------------------------------------------------------------------------------------*/ | ||
| 38 | + | ||
| 39 | +using namespace pw3270_impl; | ||
| 40 | + | ||
| 41 | +/* | ||
| 42 | +// XServiceInfo implementation | ||
| 43 | +OUString session_impl::getImplementationName() throw (RuntimeException) | ||
| 44 | +{ | ||
| 45 | + // unique implementation name | ||
| 46 | + return OUString( RTL_CONSTASCII_USTRINGPARAM("pw3270.pw3270_impl.session") ); | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | + | ||
| 50 | +sal_Bool session_impl::supportsService( OUString const & serviceName ) throw (RuntimeException) | ||
| 51 | +{ | ||
| 52 | + // this object only supports one service, so the test is simple | ||
| 53 | + return serviceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("pw3270.session") ); | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +Sequence< OUString > session_impl::getSupportedServiceNames() throw (RuntimeException) | ||
| 57 | +{ | ||
| 58 | + return getSupportedServiceNames_pw3270_impl(); | ||
| 59 | +} | ||
| 60 | +*/ |
src/oxt/loffice3270.cbp
| @@ -39,6 +39,7 @@ | @@ -39,6 +39,7 @@ | ||
| 39 | <Unit filename="../classlib/session.cc" /> | 39 | <Unit filename="../classlib/session.cc" /> |
| 40 | <Unit filename="Makefile.in" /> | 40 | <Unit filename="Makefile.in" /> |
| 41 | <Unit filename="globals.hpp" /> | 41 | <Unit filename="globals.hpp" /> |
| 42 | + <Unit filename="info.cc" /> | ||
| 42 | <Unit filename="pw3270.idl" /> | 43 | <Unit filename="pw3270.idl" /> |
| 43 | <Unit filename="testprogram.cc" /> | 44 | <Unit filename="testprogram.cc" /> |
| 44 | <Extensions> | 45 | <Extensions> |