From ba96b04b631a9ea28b75d83d8fd5de92217f53fc Mon Sep 17 00:00:00 2001 From: Jan Scheffczyk Date: Fri, 27 Sep 2019 12:53:49 +0100 Subject: [PATCH] More readable/speakable Class Names. --- NatlinkSource/CMakeLists.txt | 4 +- NatlinkSource/COM/appsupp.cpp | 2 +- NatlinkSource/COPYRIGHT.txt | 186 ------------------ NatlinkSource/DictationObject.cpp | 52 ++--- NatlinkSource/DictationObject.h | 4 +- .../{DragCode.cpp => DragonCode.cpp} | 32 +-- NatlinkSource/{DragCode.h => DragonCode.h} | 48 ++--- NatlinkSource/Exceptions.cpp | 2 +- NatlinkSource/GrammarObject.cpp | 50 ++--- NatlinkSource/GrammarObject.h | 4 +- NatlinkSource/MessageWindow.cpp | 14 +- NatlinkSource/MessageWindow.h | 6 +- NatlinkSource/ResultObject.cpp | 20 +- NatlinkSource/ResultObject.h | 18 +- NatlinkSource/natlink.cpp | 2 +- NatlinkSource/natlink.def | 8 - NatlinkSource/natlink.rc | 2 +- NatlinkSource/pythwrap.cpp | 102 +++++----- 18 files changed, 173 insertions(+), 383 deletions(-) delete mode 100644 NatlinkSource/COPYRIGHT.txt rename NatlinkSource/{DragCode.cpp => DragonCode.cpp} (99%) rename NatlinkSource/{DragCode.h => DragonCode.h} (91%) delete mode 100644 NatlinkSource/natlink.def diff --git a/NatlinkSource/CMakeLists.txt b/NatlinkSource/CMakeLists.txt index 584ae636..704c65de 100644 --- a/NatlinkSource/CMakeLists.txt +++ b/NatlinkSource/CMakeLists.txt @@ -16,7 +16,7 @@ project(${PROJECT_NAME}) set(SRC_FILES COM/appsupp.cpp DictationObject.cpp - ./DragCode.cpp + DragonCode.cpp Exceptions.cpp GrammarObject.cpp ./natlink.cpp @@ -33,7 +33,7 @@ set(HEADERS_FILES COM/appsupp.h COM/comsupp.h DictationObject.h - DragCode.h + DragonCode.h COM/dspeech.h Exceptions.h GrammarObject.h diff --git a/NatlinkSource/COM/appsupp.cpp b/NatlinkSource/COM/appsupp.cpp index 56a7949c..ab494d5f 100644 --- a/NatlinkSource/COM/appsupp.cpp +++ b/NatlinkSource/COM/appsupp.cpp @@ -12,7 +12,7 @@ #include "../StdAfx.h" #include "../Resource.h" -#include "../DragCode.h" +#include "../DragonCode.h" #include "appsupp.h" // from PythWrap.cpp diff --git a/NatlinkSource/COPYRIGHT.txt b/NatlinkSource/COPYRIGHT.txt deleted file mode 100644 index 79ea30eb..00000000 --- a/NatlinkSource/COPYRIGHT.txt +++ /dev/null @@ -1,186 +0,0 @@ -NatLink - (c) Copyright 1997-1999 by Joel Gould. - Portions (c) Copyright 1997-1999 by Dragon Systems, - Inc. All Rights Reserved. Permission to use, copy, modify and - distribute this software (except for the files noted below) and - documentation for any purpose and without fee is hereby granted, - provided that this copyright notice appear in all copies and - that both the copyright notice and this permission notice appear - in supporting documentation, and that the name Joel Gould not be - used in advertising or publicity pertaining to distribution of - the software without specific, written permission. - - The following files are NOT covered by the previous previous - paragraph: NatlinkSource\speech.h and - NatlinkSource\dspeech.h. These files may not be redistributed - although they can be freely downloaded from - http://www.synapseadaptive.com/joel/PythonMacroSystem.html and - used on one machine. - - Joel Gould disclaim all warranties with regard to this software, - including all implied warranties of merchantability and fitness, - in no event shall Joel Gould be liable for any special, indirect - or consequential damages or any damages whatsoever resulting - from the loss of use, data or profits whether in an action of - contract, negligence or tortious action, arising out of - connection with the use or performance of this software. - Possession of this software does NOT grant the possessor any - license to Dragon NaturallySpeaking or any other Dragon Systems - product, except where license to Dragon NaturallySpeaking or any - other Dragon Systems products is purchased or otherwise obtained - separately. This copyright only applies to NatLink, including - source and object code and not to Dragon NaturallySpeaking or - any other Dragon Systems product. Software on this web site is - not available from Dragon Systems, nor is Dragon Systems - formally associated with this software in any way. - ------------------------------------ - -Vocola - Copyright (c) 2002-2011 by Rick Mohr - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - ------------------------------------ - -Configurenatlinkunimacrovocola: - Copyright (c) 2008 by Quintijn Hoogenboom. It may be - redistributed in any way as long as this copyright notice - remains. - ------------------------------------ - -Unimacro (c) 2002-2011 Quintijn Hoogenboom, Ben Staniford, Bart Jan van Os - 2011 Frank Olaf Sem-Jacobsen - - "unimacro" is free software; you can redistribute it - and/or modify it under the terms of the GNU General - Public License, see: http://www.gnu.org/licenses/gpl.txt - - "unimacro" is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; See the GNU General - Public License details. - -"unimacro" makes use of another SourceForge project "natlink", -which has the copyright notice shown above. - ------------------------------------ - -ConfigureNatLink.exe NLVCSetup.msi MessageWindow.dll - Copyright (c) 2004-2005 Applied Recognition Inc. All rights reserved. - - You may freely obtain this software from - http://speechwiki.org/NL.HomePage - - Unauthorized redistribution, reverse engineering, and - decompilation is prohibited. - - The Software comes "as is", with no warranties. None - whatsoever. This means no express, implied or statutory - warranty, including without limitation, warranties of - merchantability or fitness for a particular purpose or any - warranty of title or non-infringement. - - Neither Applied Recognition Inc. nor any contributor to the - Software will be liable for any of those types of damages known - as indirect, special, consequential, or incidental related to - the Software or this license, to the maximum extent the law - permits, no matter what legal theory it's based on. - - ------------------------------------ - -Shared Source License for Microsoft Visual Basic Power Pack for -Microsoft Visual Basic 2003 - -This license governs use of the accompanying software -(`Software'), and your use of the Software constitutes acceptance -of this license. - -You may use the Software for any commercial or noncommercial purpose, -including distributing derivative works. - -In return, we simply require that you agree: - -1. Not to remove any copyright or other notices from the Software. - -2. That if you distribute the Software in source code form you do so - only under this license (i.e. you must include a complete copy of - this license with your distribution), and if you distribute the - Software solely in object form you only do so under a license that - complies with this license. - -3. That the Software comes "as is", with no warranties. None - whatsoever. This means no express, implied or statutory warranty, - including without limitation, warranties of merchantability or - fitness for a particular purpose or any warranty of title or - non-infringement. Also, you must pass this disclaimer on whenever you - distribute the Software or derivative works. - -4. That neither Microsoft nor any contributor to the Software will be - liable for any of those types of damages known as indirect, special, - consequential, or incidental related to the Software or this license, - to the maximum extent the law permits, no matter what legal theory - it's based on. Also, you must pass this limitation of liability on - whenever you distribute the Software or derivative works. - -5. That if you sue anyone over patents that you think may apply to the - Software for a person's use of the Software, your license to the - Software ends automatically. - -6. That the patent rights, if any, granted in this license only apply to - the Software, not to any derivative works you make. - -7. That the Software is subject to U.S. export jurisdiction at the time - it is licensed to you, and it may be subject to additional export or - import laws in other places. You agree to comply with all such laws - and regulations that may apply to the Software after delivery of the - software to you. - -8. That if you are an agency of the U.S. Government, (i) Software - provided pursuant to a solicitation issued on or after December 1, - 1995, is provided with the commercial license rights set forth in - this license, and (ii) Software provided pursuant to a solicitation - issued prior to December 1, 1995, is provided with `Restricted - Rights' as set forth in FAR, 48 C.F.R. 52.227-14 (June 1987) or DFAR, - 48 C.F.R. 252.227-7013 (Oct 1988), as applicable. - -9. That your rights under this License end automatically if you breach - it in any way. - -10. That all rights not expressly granted to you in this license are - reserved. - ---------------------------------------- - - -XPCommonControls.dll -From http://www.steepvalley.net - -The controls plus the source code are completely free to use. There are -no cost at all attached to this project. - -This means also that I cannot take any responsibility for bugs and -errors resulting from this code. - - ----------------------------- diff --git a/NatlinkSource/DictationObject.cpp b/NatlinkSource/DictationObject.cpp index 879ef1d4..b77feaba 100644 --- a/NatlinkSource/DictationObject.cpp +++ b/NatlinkSource/DictationObject.cpp @@ -4,12 +4,12 @@ Portions (c) Copyright 1999 by Dragon Systems, Inc. dictobj.cpp - Implementation of the CDictObj class which encapulates a VoiceDictation + Implementation of the CDicationObject class which encapulates a VoiceDictation object and is exposed in Python as a DictObj. */ #include "stdafx.h" -#include "DragCode.h" +#include "DragonCode.h" #include "DictationObject.h" #include "ResultObject.h" #include "Exceptions.h" @@ -147,7 +147,7 @@ END_COM_MAP() STDMETHOD (SinkFlagsGet) (DWORD* ); // not inline // this is our parent - CDictObj * m_pParent; + CDicationObject * m_pParent; }; //--------------------------------------------------------------------------- @@ -232,12 +232,12 @@ STDMETHODIMP CVDct0NotifySink::JITPause() ///////////////////////////////////////////////////////////////////////////// // -// CDictObj +// CDicationObject // //--------------------------------------------------------------------------- -BOOL CDictObj::create( CDragonCode * pDragCode ) +BOOL CDicationObject::create(CDragonCode * pDragCode ) { m_nLockCount = 0; m_pBeginCallback = NULL; @@ -307,7 +307,7 @@ BOOL CDictObj::create( CDragonCode * pDragCode ) //--------------------------------------------------------------------------- -void CDictObj::destroy() +void CDicationObject::destroy() { setBeginCallback( Py_None ); setChangeCallback( Py_None ); @@ -329,7 +329,7 @@ void CDictObj::destroy() //--------------------------------------------------------------------------- -BOOL CDictObj::setBeginCallback( PyObject *pCallback ) +BOOL CDicationObject::setBeginCallback(PyObject *pCallback ) { if( pCallback == Py_None ) { @@ -348,7 +348,7 @@ BOOL CDictObj::setBeginCallback( PyObject *pCallback ) //--------------------------------------------------------------------------- -BOOL CDictObj::setChangeCallback( PyObject *pCallback ) +BOOL CDicationObject::setChangeCallback(PyObject *pCallback ) { if( pCallback == Py_None ) { @@ -367,7 +367,7 @@ BOOL CDictObj::setChangeCallback( PyObject *pCallback ) //--------------------------------------------------------------------------- -BOOL CDictObj::activate( HWND hWnd ) +BOOL CDicationObject::activate(HWND hWnd ) { HRESULT rc; @@ -388,7 +388,7 @@ BOOL CDictObj::activate( HWND hWnd ) //--------------------------------------------------------------------------- -BOOL CDictObj::deactivate() +BOOL CDicationObject::deactivate() { HRESULT rc; @@ -402,7 +402,7 @@ BOOL CDictObj::deactivate() //--------------------------------------------------------------------------- -BOOL CDictObj::setLock( BOOL bState ) +BOOL CDicationObject::setLock(BOOL bState ) { HRESULT rc; @@ -435,7 +435,7 @@ BOOL CDictObj::setLock( BOOL bState ) //--------------------------------------------------------------------------- -BOOL CDictObj::setText( const char * pText, int nStart, int nEnd ) +BOOL CDicationObject::setText(const char * pText, int nStart, int nEnd ) { HRESULT rc; @@ -467,7 +467,7 @@ BOOL CDictObj::setText( const char * pText, int nStart, int nEnd ) //--------------------------------------------------------------------------- -BOOL CDictObj::setTextSel( int nStart, int nEnd ) +BOOL CDicationObject::setTextSel(int nStart, int nEnd ) { HRESULT rc; @@ -490,7 +490,7 @@ BOOL CDictObj::setTextSel( int nStart, int nEnd ) //--------------------------------------------------------------------------- -BOOL CDictObj::setVisibleText( int nStart, int nEnd ) +BOOL CDicationObject::setVisibleText(int nStart, int nEnd ) { HRESULT rc; @@ -519,7 +519,7 @@ BOOL CDictObj::setVisibleText( int nStart, int nEnd ) //--------------------------------------------------------------------------- -PyObject * CDictObj::getLength() +PyObject * CDicationObject::getLength() { MUSTBEUSABLE( "getLength" ) @@ -538,7 +538,7 @@ PyObject * CDictObj::getLength() //--------------------------------------------------------------------------- -PyObject * CDictObj::getText( int nStart, int nEnd ) +PyObject * CDicationObject::getText(int nStart, int nEnd ) { HRESULT rc; @@ -592,7 +592,7 @@ PyObject * CDictObj::getText( int nStart, int nEnd ) //--------------------------------------------------------------------------- -PyObject * CDictObj::getTextSel() +PyObject * CDicationObject::getTextSel() { HRESULT rc; @@ -613,7 +613,7 @@ PyObject * CDictObj::getTextSel() //--------------------------------------------------------------------------- -PyObject * CDictObj::getVisibleText() +PyObject * CDicationObject::getVisibleText() { HRESULT rc; @@ -645,7 +645,7 @@ PyObject * CDictObj::getVisibleText() // // This function can only be called when a lock is in effect. -BOOL CDictObj::computeLength( int & nCount ) +BOOL CDicationObject::computeLength(int & nCount ) { HRESULT rc; @@ -684,7 +684,7 @@ BOOL CDictObj::computeLength( int & nCount ) // pair. In general we are very forgiving of the Python input mimicing the // behavior of the slicing operation. -BOOL CDictObj::computeRange( int & nStart, int & nEndCount ) +BOOL CDicationObject::computeRange(int & nStart, int & nEndCount ) { // because computing the length can be slow, we only do it if necessary @@ -719,7 +719,7 @@ BOOL CDictObj::computeRange( int & nStart, int & nEndCount ) //--------------------------------------------------------------------------- -BOOL CDictObj::TextChanged( DWORD dwReason ) +BOOL CDicationObject::TextChanged(DWORD dwReason ) { HRESULT rc; @@ -804,7 +804,7 @@ BOOL CDictObj::TextChanged( DWORD dwReason ) //--------------------------------------------------------------------------- -BOOL CDictObj::TextSelChanged() +BOOL CDicationObject::TextSelChanged() { HRESULT rc; @@ -836,7 +836,7 @@ BOOL CDictObj::TextSelChanged() //--------------------------------------------------------------------------- -BOOL CDictObj::JITPause() +BOOL CDicationObject::JITPause() { // if there is no callback then there is nothing to do if( !m_pBeginCallback ) @@ -845,7 +845,7 @@ BOOL CDictObj::JITPause() } // compute the callback information - m_pDragCode->logMessage("+ CDictObj::JITPause\n"); + m_pDragCode->logMessage("+ CDicationObject::JITPause\n"); PyObject * pInfo = m_pDragCode->getCurrentModule(); if( pInfo == NULL ) { @@ -853,11 +853,11 @@ BOOL CDictObj::JITPause() } // make the callback - m_pDragCode->logMessage(" CDictObj::JITPause making callback\n"); + m_pDragCode->logMessage(" CDicationObject::JITPause making callback\n"); m_pDragCode->makeCallback( m_pBeginCallback, Py_BuildValue( "(O)", pInfo ) ); // clean up Py_XDECREF( pInfo ); - m_pDragCode->logMessage("- CDictObj::JITPause\n"); + m_pDragCode->logMessage("- CDicationObject::JITPause\n"); return TRUE; } diff --git a/NatlinkSource/DictationObject.h b/NatlinkSource/DictationObject.h index bbdbe9fd..bc1cf198 100644 --- a/NatlinkSource/DictationObject.h +++ b/NatlinkSource/DictationObject.h @@ -16,7 +16,7 @@ class CDragonCode; // since Python directly access this data structure (using the variables // defined in the PyObject_HEAD macro). -struct CDictObj +struct CDicationObject { // this must be first, it is the Python header data PyObject_HEAD @@ -41,7 +41,7 @@ struct CDictObj // the CDragonCode class keeps a linked list of all grammar objects // which have active interfaces; this is the "next" pointer for that // linked list - CDictObj * m_pNextDictObj; + CDicationObject * m_pNextDictObj; // to make it easier to deal with the locking from Python, we keep an // internal copy of the lock count diff --git a/NatlinkSource/DragCode.cpp b/NatlinkSource/DragonCode.cpp similarity index 99% rename from NatlinkSource/DragCode.cpp rename to NatlinkSource/DragonCode.cpp index c9fb1234..3fb2bb5c 100644 --- a/NatlinkSource/DragCode.cpp +++ b/NatlinkSource/DragonCode.cpp @@ -119,7 +119,7 @@ #include "stdafx.h" #include "Resource.h" -#include "DragCode.h" +#include "DragonCode.h" #include "GrammarObject.h" #include "ResultObject.h" #include "DictationObject.h" @@ -129,7 +129,7 @@ #include // defined in PythWrap.cpp -CResObj * resobj_new(); +CResultObject * resobj_new(); // This macro is used at the top of functions which can not be called // during initialization @@ -700,7 +700,7 @@ void CDragonCode::releaseObjects() // linked list changes while( m_pFirstGramObj ) { - CGramObj * pOldFirst = m_pFirstGramObj; + CGrammarObject * pOldFirst = m_pFirstGramObj; m_pFirstGramObj->unload(); @@ -715,7 +715,7 @@ void CDragonCode::releaseObjects() // iterate over all results objects and free them while( m_pFirstResObj ) { - CResObj * pOldFirst = m_pFirstResObj; + CResultObject * pOldFirst = m_pFirstResObj; m_pFirstResObj->destroy(); @@ -730,7 +730,7 @@ void CDragonCode::releaseObjects() // iterate over all dictation objects and free them while( m_pFirstDictObj ) { - CDictObj * pOldFirst = m_pFirstDictObj; + CDicationObject * pOldFirst = m_pFirstDictObj; m_pFirstDictObj->destroy(); @@ -803,7 +803,7 @@ void CDragonCode::doPausedProcessing( QWORD dwCookie ) // now we call the grammar callbacks - CGramObj * pGramObj; + CGrammarObject * pGramObj; for( pGramObj = m_pFirstGramObj; pGramObj != NULL; pGramObj = pGramObj->m_pNextGramObj ) @@ -836,7 +836,7 @@ void CDragonCode::doPausedProcessing( QWORD dwCookie ) //--------------------------------------------------------------------------- -void CDragonCode::addGramObj( CGramObj * pGramObj ) +void CDragonCode::addGramObj(CGrammarObject * pGramObj ) { assert( pGramObj != NULL ); assert( pGramObj->m_pNextGramObj == NULL ); @@ -847,7 +847,7 @@ void CDragonCode::addGramObj( CGramObj * pGramObj ) //--------------------------------------------------------------------------- -void CDragonCode::removeGramObj( CGramObj * pGramObj ) +void CDragonCode::removeGramObj(CGrammarObject * pGramObj ) { assert( pGramObj != NULL ); @@ -870,7 +870,7 @@ void CDragonCode::removeGramObj( CGramObj * pGramObj ) // otherwise, we need to find the grammar object in the linked list - CGramObj * pCur; + CGrammarObject * pCur; for( pCur = m_pFirstGramObj; pCur->m_pNextGramObj != NULL; pCur = pCur->m_pNextGramObj ) @@ -888,7 +888,7 @@ void CDragonCode::removeGramObj( CGramObj * pGramObj ) //--------------------------------------------------------------------------- -void CDragonCode::addResObj( CResObj * pResObj ) +void CDragonCode::addResObj(CResultObject * pResObj ) { assert( pResObj != NULL ); assert( pResObj->m_pNextResObj == NULL ); @@ -899,7 +899,7 @@ void CDragonCode::addResObj( CResObj * pResObj ) //--------------------------------------------------------------------------- -void CDragonCode::removeResObj( CResObj * pResObj ) +void CDragonCode::removeResObj(CResultObject * pResObj ) { assert( pResObj != NULL ); @@ -922,7 +922,7 @@ void CDragonCode::removeResObj( CResObj * pResObj ) // otherwise, we need to find the results object in the linked list - CResObj * pCur; + CResultObject * pCur; for( pCur = m_pFirstResObj; pCur->m_pNextResObj != NULL; pCur = pCur->m_pNextResObj ) @@ -940,7 +940,7 @@ void CDragonCode::removeResObj( CResObj * pResObj ) //--------------------------------------------------------------------------- -void CDragonCode::addDictObj( CDictObj * pDictObj ) +void CDragonCode::addDictObj(CDicationObject * pDictObj ) { assert( pDictObj != NULL ); assert( pDictObj->m_pNextDictObj == NULL ); @@ -951,7 +951,7 @@ void CDragonCode::addDictObj( CDictObj * pDictObj ) //--------------------------------------------------------------------------- -void CDragonCode::removeDictObj( CDictObj * pDictObj ) +void CDragonCode::removeDictObj(CDicationObject * pDictObj ) { assert( pDictObj != NULL ); @@ -974,7 +974,7 @@ void CDragonCode::removeDictObj( CDictObj * pDictObj ) // otherwise, we need to find the dictation object in the linked list - CDictObj * pCur; + CDicationObject * pCur; for( pCur = m_pFirstDictObj; pCur->m_pNextDictObj != NULL; pCur = pCur->m_pNextDictObj ) @@ -1683,7 +1683,7 @@ BOOL CDragonCode::natConnect( IServiceProvider * pIDgnSite, BOOL bUseThreads ) if( pIDgnSite != NULL ) { - m_pSecdThrd = new CSecondThread(); + m_pSecdThrd = new MessageWindow(); } // Connect to NatSpeak diff --git a/NatlinkSource/DragCode.h b/NatlinkSource/DragonCode.h similarity index 91% rename from NatlinkSource/DragCode.h rename to NatlinkSource/DragonCode.h index 51180403..25a0d753 100644 --- a/NatlinkSource/DragCode.h +++ b/NatlinkSource/DragonCode.h @@ -9,20 +9,16 @@ which implement the export Python natlink functions. */ -struct CGramObj; -struct CResObj; -struct CDictObj; +struct CGrammarObject; +struct CResultObject; +struct CDicationObject; class CDgnSRNotifySink; class CDgnAppSupport; -class CSecondThread; +class MessageWindow; class CMessageStack; typedef const char * PCCHAR; -#ifdef INHOUSE -#include "inhouse.h" -#endif - //--------------------------------------------------------------------------- class CDragonCode @@ -112,18 +108,18 @@ class CDragonCode void setAppClass( CDgnAppSupport * pAppClass ) { m_pAppClass = pAppClass; } void setDuringInit( BOOL bState ) { m_bDuringInit = bState; } - // these functions are called from CGramObj + // these functions are called from CGrammarObject ISRCentral * pISRCentral() { return m_pISRCentral; } - void addGramObj( CGramObj * pGramObj ); - void removeGramObj( CGramObj * pGramObj ); + void addGramObj(CGrammarObject * pGramObj ); + void removeGramObj(CGrammarObject * pGramObj ); - // these functions are called from CResObj - void addResObj( CResObj * pResObj ); - void removeResObj( CResObj * pResObj ); + // these functions are called from CResultObject + void addResObj(CResultObject * pResObj ); + void removeResObj(CResultObject * pResObj ); - // these functions are called from CDictObj - void addDictObj( CDictObj * pDictObj ); - void removeDictObj( CDictObj * pDictObj ); + // these functions are called from CDicationObject + void addDictObj(CDicationObject * pDictObj ); + void removeDictObj(CDicationObject * pDictObj ); // when we need to post a message from a COM notify sink to the message // window, make this call @@ -195,19 +191,19 @@ class CDragonCode // messages HWND m_hMsgWnd; - // The CGramObj instances are in a linked list and the head of that list + // The CGrammarObject instances are in a linked list and the head of that list // is stored in the CDragonCode object. This allows us to unload all // grammars when we call natDisconnect - CGramObj * m_pFirstGramObj; + CGrammarObject * m_pFirstGramObj; - // The CResObj instances are also in a linked list for the same reason. - CResObj * m_pFirstResObj; + // The CResultObject instances are also in a linked list for the same reason. + CResultObject * m_pFirstResObj; - // And also the CDictObj instances - CDictObj * m_pFirstDictObj; + // And also the CDicationObject instances + CDicationObject * m_pFirstDictObj; // this is a pointer to the second thread where we can display messages - CSecondThread * m_pSecdThrd; + MessageWindow * m_pSecdThrd; // we remember a pointer to the CDgnAppSupport class so we can handle // the reinitialization function @@ -287,7 +283,5 @@ class CDragonCode void TriggerMessage( UINT message, WPARAM wParam, LPARAM lParam ); BOOL IsMessageTriggered( UINT message, WPARAM wParam, LPARAM & lParam ); -#ifdef INHOUSE - INH_DRAGCODE_CLASS -#endif + }; diff --git a/NatlinkSource/Exceptions.cpp b/NatlinkSource/Exceptions.cpp index 1e7b61a6..3f00120d 100644 --- a/NatlinkSource/Exceptions.cpp +++ b/NatlinkSource/Exceptions.cpp @@ -9,7 +9,7 @@ #include "stdafx.h" #include -#include "DragCode.h" +#include "DragonCode.h" #include "GrammarObject.h" #include "ResultObject.h" #include "Exceptions.h" diff --git a/NatlinkSource/GrammarObject.cpp b/NatlinkSource/GrammarObject.cpp index 6c65e95f..85782e2b 100644 --- a/NatlinkSource/GrammarObject.cpp +++ b/NatlinkSource/GrammarObject.cpp @@ -4,12 +4,12 @@ Portions (c) Copyright 1999 by Dragon Systems, Inc. gramobj.h - Implementation of the CGramObj class which encapulates a SAPI grammar + Implementation of the CGrammarObject class which encapulates a SAPI grammar and is exposed in Python as a GramObj. */ #include "stdafx.h" -#include "DragCode.h" +#include "DragonCode.h" #include "GrammarObject.h" #include "ResultObject.h" #include "Exceptions.h" @@ -17,7 +17,7 @@ #include // defined in PythWrap.cpp -CResObj * resobj_new(); +CResultObject * resobj_new(); // This macro is used at the top of functions which can not be called // when no grammar has been loaded @@ -62,7 +62,7 @@ END_COM_MAP() STDMETHOD (SinkFlagsGet) (DWORD* ); // not inline // this is our parent - CGramObj * m_pParent; + CGrammarObject * m_pParent; // this flag is set when we want to receive all PhraseFinish messages, // not just ones specific to this grammar. @@ -144,12 +144,12 @@ STDMETHODIMP CSRGramNotifySink::PhraseHypothesis( ///////////////////////////////////////////////////////////////////////////// // -// CGramObj +// CGrammarObject // //--------------------------------------------------------------------------- -void CGramObj::create( CDragonCode * pDragCode ) +void CGrammarObject::create(CDragonCode * pDragCode ) { m_pBeginCallback = NULL; m_pResultsCallback = NULL; @@ -162,7 +162,7 @@ void CGramObj::create( CDragonCode * pDragCode ) //--------------------------------------------------------------------------- -void CGramObj::destroy() +void CGrammarObject::destroy() { setBeginCallback( Py_None ); setResultsCallback( Py_None ); @@ -171,7 +171,7 @@ void CGramObj::destroy() //--------------------------------------------------------------------------- -BOOL CGramObj::unload() +BOOL CGrammarObject::unload() { if( m_pISRGramCommon ) { @@ -186,7 +186,7 @@ BOOL CGramObj::unload() //--------------------------------------------------------------------------- -BOOL CGramObj::load( BYTE * pData, DWORD dwSize, BOOL bAllResults, BOOL bHypothesis ) +BOOL CGrammarObject::load(BYTE * pData, DWORD dwSize, BOOL bAllResults, BOOL bHypothesis ) { HRESULT rc; @@ -295,7 +295,7 @@ BOOL CGramObj::load( BYTE * pData, DWORD dwSize, BOOL bAllResults, BOOL bHypothe //--------------------------------------------------------------------------- -BOOL CGramObj::setBeginCallback( PyObject *pCallback ) +BOOL CGrammarObject::setBeginCallback(PyObject *pCallback ) { if( pCallback == Py_None ) { @@ -314,7 +314,7 @@ BOOL CGramObj::setBeginCallback( PyObject *pCallback ) //--------------------------------------------------------------------------- -BOOL CGramObj::setResultsCallback( PyObject *pCallback ) +BOOL CGrammarObject::setResultsCallback(PyObject *pCallback ) { if( pCallback == Py_None ) { @@ -333,7 +333,7 @@ BOOL CGramObj::setResultsCallback( PyObject *pCallback ) //--------------------------------------------------------------------------- -BOOL CGramObj::setHypothesisCallback( PyObject *pCallback ) +BOOL CGrammarObject::setHypothesisCallback(PyObject *pCallback ) { if( pCallback == Py_None ) { @@ -352,7 +352,7 @@ BOOL CGramObj::setHypothesisCallback( PyObject *pCallback ) //--------------------------------------------------------------------------- -BOOL CGramObj::activate( char * ruleName, HWND hWnd ) +BOOL CGrammarObject::activate(char * ruleName, HWND hWnd ) { HRESULT rc; @@ -405,7 +405,7 @@ BOOL CGramObj::activate( char * ruleName, HWND hWnd ) //--------------------------------------------------------------------------- -BOOL CGramObj::deactivate( char * ruleName ) +BOOL CGrammarObject::deactivate(char * ruleName ) { HRESULT rc; @@ -429,7 +429,7 @@ BOOL CGramObj::deactivate( char * ruleName ) //--------------------------------------------------------------------------- -BOOL CGramObj::emptyList( char * listName ) +BOOL CGrammarObject::emptyList(char * listName ) { HRESULT rc; @@ -463,7 +463,7 @@ BOOL CGramObj::emptyList( char * listName ) //--------------------------------------------------------------------------- -BOOL CGramObj::appendList( char * listName, char * word ) +BOOL CGrammarObject::appendList(char * listName, char * word ) { HRESULT rc; @@ -514,7 +514,7 @@ BOOL CGramObj::appendList( char * listName, char * word ) //--------------------------------------------------------------------------- -BOOL CGramObj::PhraseFinish( +BOOL CGrammarObject::PhraseFinish( DWORD dwFlags, PSRPHRASE pSRPhrase, LPUNKNOWN pIUnknown ) { // do nothing if there is no results object @@ -544,7 +544,7 @@ BOOL CGramObj::PhraseFinish( // here we create a results object which will be returned - CResObj * pObj = resobj_new(); + CResultObject * pObj = resobj_new(); PyObject * pResObj = (PyObject*)pObj; if( pObj == NULL || !pObj->create( m_pDragCode, pIUnknown ) ) @@ -591,7 +591,7 @@ BOOL CGramObj::PhraseFinish( //--------------------------------------------------------------------------- -BOOL CGramObj::PhraseHypothesis( DWORD dwFlags, PSRPHRASE pSRPhrase ) +BOOL CGrammarObject::PhraseHypothesis(DWORD dwFlags, PSRPHRASE pSRPhrase ) { // do nothing if we do not have a callback @@ -649,7 +649,7 @@ BOOL CGramObj::PhraseHypothesis( DWORD dwFlags, PSRPHRASE pSRPhrase ) //--------------------------------------------------------------------------- -BOOL CGramObj::setExclusive( BOOL bState ) +BOOL CGrammarObject::setExclusive(BOOL bState ) { HRESULT rc; @@ -668,7 +668,7 @@ BOOL CGramObj::setExclusive( BOOL bState ) //--------------------------------------------------------------------------- -BOOL CGramObj::setContext( char * beforeText, char * afterText ) +BOOL CGrammarObject::setContext(char * beforeText, char * afterText ) { HRESULT rc; @@ -701,7 +701,7 @@ BOOL CGramObj::setContext( char * beforeText, char * afterText ) //--------------------------------------------------------------------------- -BOOL CGramObj::setSelectText( char * text ) +BOOL CGrammarObject::setSelectText(char * text ) { HRESULT rc; @@ -741,7 +741,7 @@ BOOL CGramObj::setSelectText( char * text ) //--------------------------------------------------------------------------- -PyObject * CGramObj::getSelectText() +PyObject * CGrammarObject::getSelectText() { HRESULT rc; @@ -778,12 +778,12 @@ PyObject * CGramObj::getSelectText() //--------------------------------------------------------------------------- -BOOL CGramObj::getGrammarGuid( GUID * pGrammarGuid ) +BOOL CGrammarObject::getGrammarGuid(GUID * pGrammarGuid ) { HRESULT rc; // Note this is not called from Python directly but as a side effect of - // calling getSelectText from CResObj. + // calling getSelectText from CResultObject. NEEDGRAMMAR( "ResObj.getSelectInfo" ); IDgnSRGramCommonPtr pIDgnSRGramCommon; diff --git a/NatlinkSource/GrammarObject.h b/NatlinkSource/GrammarObject.h index dc84d0ea..e0e5c347 100644 --- a/NatlinkSource/GrammarObject.h +++ b/NatlinkSource/GrammarObject.h @@ -16,7 +16,7 @@ class CDragonCode; // since Python directly access this data structure (using the variables // defined in the PyObject_HEAD macro). -struct CGramObj +struct CGrammarObject { // this must be first, it is the Python header data PyObject_HEAD @@ -49,7 +49,7 @@ struct CGramObj // the CDragonCode class keeps a linked list of all grammar objects // which have active interfaces; this is the "next" pointer for that // linked list - CGramObj * m_pNextGramObj; + CGrammarObject * m_pNextGramObj; //----- // functions diff --git a/NatlinkSource/MessageWindow.cpp b/NatlinkSource/MessageWindow.cpp index 999f4da8..db894d68 100644 --- a/NatlinkSource/MessageWindow.cpp +++ b/NatlinkSource/MessageWindow.cpp @@ -40,15 +40,15 @@ BOOL CALLBACK dialogProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - // This is the threads copy of the CSecondThread class pointer. I + // This is the threads copy of the MessageWindow class pointer. I // supposed that this should not really be global but stored in some // thread or windows storage instead. Oh, well. - static CSecondThread * s_pSecdThrd = NULL; + static MessageWindow * s_pSecdThrd = NULL; switch( msg ) { case WM_INITDIALOG: - s_pSecdThrd = (CSecondThread *)lParam; + s_pSecdThrd = (MessageWindow *)lParam; ShowWindow( hWnd, SW_HIDE ); return TRUE; @@ -135,7 +135,7 @@ BOOL CALLBACK dialogProc( DWORD CALLBACK threadMain( void * pArg ) { - CSecondThread * pThis = (CSecondThread *)pArg; + MessageWindow * pThis = (MessageWindow *)pArg; // create a dialog box to display the messages @@ -174,7 +174,7 @@ DWORD CALLBACK threadMain( void * pArg ) //--------------------------------------------------------------------------- -CSecondThread::CSecondThread() +MessageWindow::MessageWindow() { // create the thread we use to display messages; we use an event to make // sure that the thread has started before continuing @@ -205,7 +205,7 @@ CSecondThread::CSecondThread() //--------------------------------------------------------------------------- -CSecondThread::~CSecondThread() +MessageWindow::~MessageWindow() { // terminate the output window then wait for the thread to terminate @@ -223,7 +223,7 @@ CSecondThread::~CSecondThread() //--------------------------------------------------------------------------- -void CSecondThread::displayText( const char * pszText, BOOL bError ) +void MessageWindow::displayText(const char * pszText, BOOL bError ) { if( m_hOutWnd ) { diff --git a/NatlinkSource/MessageWindow.h b/NatlinkSource/MessageWindow.h index dd2669db..6a736382 100644 --- a/NatlinkSource/MessageWindow.h +++ b/NatlinkSource/MessageWindow.h @@ -7,14 +7,14 @@ Declarations for the second thread. See SecdThrd.cpp for details. */ -class CSecondThread +class MessageWindow { public: // the constructor will create the thread - CSecondThread(); + MessageWindow(); // the destructor will terminate the thread - ~CSecondThread(); + ~MessageWindow(); // this will post a string to the output window in the second thread void displayText( const char * pszText, BOOL bError ); diff --git a/NatlinkSource/ResultObject.cpp b/NatlinkSource/ResultObject.cpp index 0e3a89f1..56384ec0 100644 --- a/NatlinkSource/ResultObject.cpp +++ b/NatlinkSource/ResultObject.cpp @@ -8,7 +8,7 @@ */ #include "stdafx.h" -#include "DragCode.h" +#include "DragonCode.h" #include "ResultObject.h" #include "Exceptions.h" #include "GrammarObject.h" @@ -87,12 +87,12 @@ SRPHRASE * makePhrase( PCCHAR * ppWords ) ///////////////////////////////////////////////////////////////////////////// // -// CResObj +// CResultObject // //--------------------------------------------------------------------------- -BOOL CResObj::create( CDragonCode * pDragCode, LPUNKNOWN pIUnknown ) +BOOL CResultObject::create(CDragonCode * pDragCode, LPUNKNOWN pIUnknown ) { HRESULT rc; @@ -130,7 +130,7 @@ BOOL CResObj::create( CDragonCode * pDragCode, LPUNKNOWN pIUnknown ) //--------------------------------------------------------------------------- -void CResObj::destroy() +void CResultObject::destroy() { if( m_pISRResBasic ) { @@ -143,7 +143,7 @@ void CResObj::destroy() //--------------------------------------------------------------------------- -PyObject * CResObj::getResults( int nChoice ) +PyObject * CResultObject::getResults(int nChoice ) { HRESULT rc; @@ -210,7 +210,7 @@ PyObject * CResObj::getResults( int nChoice ) // information because we only have to make one COM call instead one COM // call per word in the results. -PyObject * CResObj::getWords( int nChoice ) +PyObject * CResultObject::getWords(int nChoice ) { HRESULT rc; @@ -270,7 +270,7 @@ PyObject * CResObj::getWords( int nChoice ) //--------------------------------------------------------------------------- -PyObject * CResObj::correction( PCCHAR * ppWords ) +PyObject * CResultObject::correction(PCCHAR * ppWords ) { HRESULT rc; @@ -293,7 +293,7 @@ PyObject * CResObj::correction( PCCHAR * ppWords ) //--------------------------------------------------------------------------- -PyObject * CResObj::getWave() +PyObject * CResultObject::getWave() { HRESULT rc; @@ -317,7 +317,7 @@ PyObject * CResObj::getWave() //--------------------------------------------------------------------------- -PyObject * CResObj::getWordInfo( int nChoice ) +PyObject * CResultObject::getWordInfo(int nChoice ) { HRESULT rc; @@ -440,7 +440,7 @@ PyObject * CResObj::getWordInfo( int nChoice ) //--------------------------------------------------------------------------- -PyObject * CResObj::getSelectInfo( CGramObj * pGrammar, int nChoice ) +PyObject * CResultObject::getSelectInfo(CGrammarObject * pGrammar, int nChoice ) { HRESULT rc; diff --git a/NatlinkSource/ResultObject.h b/NatlinkSource/ResultObject.h index 21ce7ee7..41c9c2db 100644 --- a/NatlinkSource/ResultObject.h +++ b/NatlinkSource/ResultObject.h @@ -4,23 +4,21 @@ Portions (c) Copyright 1999 by Dragon Systems, Inc. resobj.h - Implementation of the CResObj class which encapulates a SAPI result + Implementation of the CResultObject class which encapulates a SAPI result and is exposed in Python as a ResObj. */ class CDragonCode; -struct CGramObj; +struct CGrammarObject; + -#ifdef INHOUSE -#include "inhouse.h" -#endif //--------------------------------------------------------------------------- // This is a struct not a class to make sure we are compatibile with Python // since Python directly access this data structure (using the variables // defined in the PyObject_HEAD macro). -struct CResObj +struct CResultObject { // this must be first, it is the Python header data PyObject_HEAD @@ -36,7 +34,7 @@ struct CResObj // the CDragonCode class keeps a linked list of all results objects // which have active interfaces; this is the "next" pointer for that // linked list - CResObj * m_pNextResObj; + CResultObject * m_pNextResObj; //----- // functions @@ -59,9 +57,7 @@ struct CResObj PyObject * correction( PCCHAR * ppWords ); PyObject * getWave(); PyObject * getWordInfo( int nChoice ); - PyObject * getSelectInfo( CGramObj * pGrammar, int nChoice ); + PyObject * getSelectInfo(CGrammarObject * pGrammar, int nChoice ); -#ifdef INHOUSE - INH_RESOBJ_CLASS -#endif + }; diff --git a/NatlinkSource/natlink.cpp b/NatlinkSource/natlink.cpp index a309cbba..dc114c94 100644 --- a/NatlinkSource/natlink.cpp +++ b/NatlinkSource/natlink.cpp @@ -12,7 +12,7 @@ #include "stdafx.h" #include "Resource.h" #include "initguid.h" -#include "DragCode.h" +#include "DragonCode.h" #include "COM/appsupp.h" CComModule _Module; diff --git a/NatlinkSource/natlink.def b/NatlinkSource/natlink.def deleted file mode 100644 index 0ae90d75..00000000 --- a/NatlinkSource/natlink.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY "natlink.pyd" - -EXPORTS - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE - initnatlink diff --git a/NatlinkSource/natlink.rc b/NatlinkSource/natlink.rc index 73fdcb10..37c67110 100644 --- a/NatlinkSource/natlink.rc +++ b/NatlinkSource/natlink.rc @@ -96,7 +96,7 @@ IDR_APPSUPP REGISTRY "appsupp.reg" IDD_STDOUT DIALOGEX 0, 25, 285, 135 STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Messages from NatLink - built 01/01/2014" +CAPTION "Messages from NatLink - built 2019" //MENU IDR_MENU FONT 9, "Courier New", 0, 0, 0x0 BEGIN diff --git a/NatlinkSource/pythwrap.cpp b/NatlinkSource/pythwrap.cpp index d0aa2fff..31aadedf 100644 --- a/NatlinkSource/pythwrap.cpp +++ b/NatlinkSource/pythwrap.cpp @@ -19,15 +19,13 @@ PyMem_DEL. Changing these calls to PyObject_Del below eliminated the crashes. */ #include "stdafx.h" -#include "DragCode.h" +#include "DragonCode.h" #include "GrammarObject.h" #include "ResultObject.h" #include "DictationObject.h" #include "Exceptions.h" -#ifdef INHOUSE -#include "inhouse.h" -#endif + /* * Buffer size for error message string formatting. @@ -1199,7 +1197,7 @@ gramobj_load( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->load( (BYTE *)pData, (DWORD)nData, bAllResults != 0, bHypothesis != 0 ) ) { return NULL; @@ -1222,7 +1220,7 @@ gramobj_unload( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->unload() ) { return NULL; @@ -1247,7 +1245,7 @@ gramobj_activate( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->activate( pName, hWnd ) ) { return NULL; @@ -1271,7 +1269,7 @@ gramobj_deactivate( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->deactivate( pName ) ) { return NULL; @@ -1301,7 +1299,7 @@ gramobj_setBeginCallback( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->setBeginCallback( pFunc ) ) { return NULL; @@ -1331,7 +1329,7 @@ gramobj_setResultsCallback( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->setResultsCallback( pFunc ) ) { return NULL; @@ -1361,7 +1359,7 @@ gramobj_setHypothesisCallback( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->setHypothesisCallback( pFunc ) ) { return NULL; @@ -1385,7 +1383,7 @@ gramobj_emptyList( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->emptyList( pName ) ) { return NULL; @@ -1410,7 +1408,7 @@ gramobj_appendList( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->appendList( pName, pWord ) ) { return NULL; @@ -1434,7 +1432,7 @@ gramobj_setExclusive( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->setExclusive( bState ) ) { return NULL; @@ -1459,7 +1457,7 @@ gramobj_setContext( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->setContext( beforeText, afterText ) ) { return NULL; @@ -1483,7 +1481,7 @@ gramobj_setSelectText( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; if( !pObj->setSelectText( text ) ) { return NULL; @@ -1506,7 +1504,7 @@ gramobj_getSelectText( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; return pObj->getSelectText(); } @@ -1550,7 +1548,7 @@ gramobj_getattr( PyObject *self, char *name ) extern "C" static void gramobj_dealloc(PyObject *self) { - CGramObj * pObj = (CGramObj *)self; + CGrammarObject * pObj = (CGrammarObject *)self; pObj->destroy(); //PyMem_DEL( self ); @@ -1566,7 +1564,7 @@ static PyTypeObject gramobj_stackType = { PyObject_HEAD_INIT(&PyType_Type) 0, // ob_size "GramObj", // tp_name - sizeof(CGramObj), // tp_basicsize + sizeof(CGrammarObject), // tp_basicsize 0, // tp_itemsize gramobj_dealloc, // tp_dealloc 0, // tp_print @@ -1585,7 +1583,7 @@ static PyTypeObject gramobj_stackType = { // gramObj = GramObj() from Python // // This function is called when we create a new GramObj instance. We have -// to call CGramObj::create to initialize the object since we can not rely +// to call CGrammarObject::create to initialize the object since we can not rely // on the constructor being called. extern "C" PyObject * @@ -1596,7 +1594,7 @@ gramobj_new( PyObject *self, PyObject *args ) return NULL; } - CGramObj * pObj = PyObject_NEW( CGramObj, &gramobj_stackType ); + CGrammarObject * pObj = PyObject_NEW(CGrammarObject, &gramobj_stackType ); if( pObj == NULL ) { return NULL; @@ -1622,7 +1620,7 @@ resobj_getResults( PyObject *self, PyObject *args ) return NULL; } - CResObj * pObj = (CResObj *)self; + CResultObject * pObj = (CResultObject *)self; PyObject * pRetn = pObj->getResults( nChoice ); if( pRetn == NULL ) { @@ -1646,7 +1644,7 @@ resobj_getWords( PyObject *self, PyObject *args ) return NULL; } - CResObj * pObj = (CResObj *)self; + CResultObject * pObj = (CResultObject *)self; PyObject * pRetn = pObj->getWords( nChoice ); if( pRetn == NULL ) { @@ -1670,7 +1668,7 @@ resobj_correction( PyObject *self, PyObject *args ) return NULL; } - CResObj * pObj = (CResObj *)self; + CResultObject * pObj = (CResultObject *)self; PyObject * pRetn = pObj->correction( ppWords ); if( pRetn == NULL ) { @@ -1694,7 +1692,7 @@ resobj_getWave( PyObject *self, PyObject *args ) return NULL; } - CResObj * pObj = (CResObj *)self; + CResultObject * pObj = (CResultObject *)self; PyObject * pRetn = pObj->getWave(); if( pRetn == NULL ) { @@ -1715,7 +1713,7 @@ resobj_getWordInfo( PyObject *self, PyObject *args ) return NULL; } - CResObj * pObj = (CResObj *)self; + CResultObject * pObj = (CResultObject *)self; return pObj->getWordInfo( nChoice ); } @@ -1747,8 +1745,8 @@ resobj_getSelectInfo( PyObject *self, PyObject *args ) return NULL; } - CResObj * pObj = (CResObj *)self; - return pObj->getSelectInfo( (CGramObj *)pGrammar, nChoice ); + CResultObject * pObj = (CResultObject *)self; + return pObj->getSelectInfo((CGrammarObject *)pGrammar, nChoice ); } //--------------------------------------------------------------------------- @@ -1761,9 +1759,7 @@ static struct PyMethodDef resobj_methods[] = { { "getWave", resobj_getWave, METH_VARARGS }, { "getWordInfo", resobj_getWordInfo, METH_VARARGS }, { "getSelectInfo", resobj_getSelectInfo, METH_VARARGS }, -#ifdef INHOUSE - INH_RESOBJ_METHODS -#endif + { NULL, NULL } }; @@ -1787,7 +1783,7 @@ resobj_getattr( PyObject *self, char *name ) extern "C" static void resobj_dealloc(PyObject *self) { - CResObj * pObj = (CResObj *)self; + CResultObject * pObj = (CResultObject *)self; pObj->destroy(); // PyMem_DEL( self ); @@ -1803,7 +1799,7 @@ static PyTypeObject resobj_stackType = { PyObject_HEAD_INIT(&PyType_Type) 0, // ob_size "ResObj", // tp_name - sizeof(CResObj), // tp_basicsize + sizeof(CResultObject), // tp_basicsize 0, // tp_itemsize resobj_dealloc, // tp_dealloc 0, // tp_print @@ -1822,9 +1818,9 @@ static PyTypeObject resobj_stackType = { // Create a new ResObj. This is not called from Python. Instead it is // called from GramObj.cpp -CResObj * resobj_new() +CResultObject * resobj_new() { - return PyObject_NEW( CResObj, &resobj_stackType ); + return PyObject_NEW(CResultObject, &resobj_stackType ); } ///////////////////////////////////////////////////////////////////////////// @@ -1840,7 +1836,7 @@ dictobj_activate( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->activate( hWnd ) ) { return NULL; @@ -1860,7 +1856,7 @@ dictobj_deactivate( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->deactivate() ) { return NULL; @@ -1887,7 +1883,7 @@ dictobj_setBeginCallback( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->setBeginCallback( pFunc ) ) { return NULL; @@ -1914,7 +1910,7 @@ dictobj_setChangeCallback( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->setChangeCallback( pFunc ) ) { return NULL; @@ -1935,7 +1931,7 @@ dictobj_setLock( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->setLock( nState != 0 ) ) { return NULL; @@ -1958,7 +1954,7 @@ dictobj_setText( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->setText( pText, nStart, nEnd ) ) { return NULL; @@ -1980,7 +1976,7 @@ dictobj_setTextSel( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->setTextSel( nStart, nEnd ) ) { return NULL; @@ -2002,7 +1998,7 @@ dictobj_setVisibleText( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; if( !pObj->setVisibleText( nStart, nEnd ) ) { return NULL; @@ -2022,7 +2018,7 @@ dictobj_getLength( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; PyObject * pRetn = pObj->getLength(); if( pRetn == NULL ) { @@ -2044,7 +2040,7 @@ dictobj_getText( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; PyObject * pRetn = pObj->getText( nStart, nEnd ); if( pRetn == NULL ) { @@ -2064,7 +2060,7 @@ dictobj_getTextSel( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; PyObject * pRetn = pObj->getTextSel(); if( pRetn == NULL ) { @@ -2084,7 +2080,7 @@ dictobj_getVisibleText( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; PyObject * pRetn = pObj->getVisibleText(); if( pRetn == NULL ) { @@ -2133,7 +2129,7 @@ dictobj_getattr( PyObject *self, char *name ) extern "C" static void dictobj_dealloc(PyObject *self) { - CDictObj * pObj = (CDictObj *)self; + CDicationObject * pObj = (CDicationObject *)self; pObj->destroy(); // PyMem_DEL( self ); @@ -2149,7 +2145,7 @@ static PyTypeObject dictobj_stackType = { PyObject_HEAD_INIT(&PyType_Type) 0, // ob_size "DictObj", // tp_name - sizeof(CDictObj), // tp_basicsize + sizeof(CDicationObject), // tp_basicsize 0, // tp_itemsize dictobj_dealloc, // tp_dealloc 0, // tp_print @@ -2168,7 +2164,7 @@ static PyTypeObject dictobj_stackType = { // dictObj = DictObj() from Python // // This function is called when we create a new DictObj instance. We have -// to call CDictObj::create to initialize the object since we can not rely +// to call CDicationObject::create to initialize the object since we can not rely // on the constructor being called. extern "C" PyObject * @@ -2179,7 +2175,7 @@ dictobj_new( PyObject *self, PyObject *args ) return NULL; } - CDictObj * pObj = PyObject_NEW( CDictObj, &dictobj_stackType ); + CDicationObject * pObj = PyObject_NEW(CDicationObject, &dictobj_stackType ); if( pObj == NULL ) { return NULL; @@ -2239,9 +2235,7 @@ static struct PyMethodDef natlink_methods[] = { { "setTrayIcon", natlink_setTrayIcon, METH_VARARGS }, { "GramObj", gramobj_new, METH_VARARGS }, { "DictObj", dictobj_new, METH_VARARGS }, -#ifdef INHOUSE - INH_NATLINK_METHODS -#endif + { NULL, NULL } };