1 /*M///////////////////////////////////////////////////////////////////////////////////////
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
10 // Intel License Agreement
11 // For Open Source Computer Vision Library
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
19 // * Redistribution's of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
22 // * Redistribution's in binary form must reproduce the above copyright notice,
23 // this list of conditions and the following disclaimer in the documentation
24 // and/or other materials provided with the distribution.
26 // * The name of Intel Corporation may not be used to endorse or promote products
27 // derived from this software without specific prior written permission.
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
40 //M*/// Hawk.h : main header file for the HAWK application
43 #if !defined(AFX_HAWK_H__6FFD53A7_939A_11D3_AE7E_00A0C9989BC6__INCLUDED_)
44 #define AFX_HAWK_H__6FFD53A7_939A_11D3_AE7E_00A0C9989BC6__INCLUDED_
48 #endif // _MSC_VER > 1000
51 #error include 'stdafx.h' before including this file for PCH
54 #include "resource.h" // main symbols
57 #include "FuncDialog.h"
58 #include "eicdllwrap.h"
78 #pragma warning(disable:4786)
91 /////////////////////////////////////////////////////////////////////////////
93 // See Hawk.cpp for the implementation of this class
100 CStringArray* m_functions;
102 void (*m_GetInfo)(plugin_info*);
103 void (*m_SetErrLevel)(errlevel_t);
104 void (*m_SetErrMark)(jmp_buf*);
105 void (*m_SetEiCStack)(AR_t**);
106 void (*m_SetEiCCallback)(void(*)(void*));
107 void (*m_GetFunctions)(char***, val_t (***)(void), int*);
110 template<> void AFXAPI DestructElements<CMenu*> (CMenu** pElements, int nCount);
111 typedef CArray<CMenu*, CMenu*> CMenuArray;
113 template<> void AFXAPI DestructElements<plugin_t> (plugin_t* pElements, int nCount);
114 typedef CArray<plugin_t, plugin_t&> CPluginArray;
118 typedef void(__cdecl *HAWK_SIGFUNC)(int);
120 //typedef basic_string<char> string;
122 class CHawkApp : public CWinApp
125 CArray<void*, void*> m_funcDialogs;
127 CMenuArray m_childMenus;
128 CHeadBand m_headband;
131 CFuncDialog* GetFuncDialog(int index);
132 CString GenDecl(const char* name);
133 BOOL LoadModuleFunction(HMODULE handle, LPCTSTR name, BOOL isOpenCV);
134 BOOL EnumModuleFunctions(LPCTSTR filename, CStringArray& names);
135 BOOL EnumHeaders(LPCTSTR path);
136 BOOL Attach(string filename);
139 CStringArray m_wrapperStrings;
141 void LoadModuleFunctions(LPCTSTR filename, LPCTSTR modulename);
142 CString GetTypeString(void* _type, const char* name = "");
144 HANDLE m_printfMutex;
146 void CloseEiCHandles();
147 BOOL InitEiCHandles();
148 const CStringArray& GetVideoPath();
149 void AddVideoPath(const CString& path);
150 void SetStatusString(LPCTSTR str);
151 void SetSBRun(BOOL sbRun);
153 void UpdateMark(jmp_buf* mark = 0);
154 CPluginArray m_plugins;
156 errlevel_t GetErrLevel();
157 void SetErrLevel(errlevel_t level);
159 CStringArray* GetFunctions(int i);
160 CMenu* GetContextMenu();
161 void InitPopupMenu();
162 LPCTSTR GetModulePath();
163 BOOL FindAndAttach(LPCTSTR path, LPCTSTR fileName);
164 stream_pipe m_eicOut;
165 stream_pipe m_eicErr;
167 CMap<int, int, HAWK_SIGFUNC, HAWK_SIGFUNC> m_eicSigFuncs;
174 // ClassWizard generated virtual function overrides
175 //{{AFX_VIRTUAL(CHawkApp)
177 virtual BOOL InitInstance();
178 virtual int ExitInstance();
182 //{{AFX_MSG(CHawkApp)
183 afx_msg void OnAppAbout();
184 // NOTE - the ClassWizard will add and remove member functions here.
185 // DO NOT EDIT what you see in these blocks of generated code !
187 DECLARE_MESSAGE_MAP()
189 void InitPopupDialogs();
191 vector<string> m_includeDirs;
192 vector<string> m_includeFiles;
193 vector<string> m_includeFilePath;
194 BOOL AddStructType(const type_expr* type);
195 CPtrArray m_structTypes;
196 BOOL GenAutoWrapper(void* func, LPCTSTR func_name);
197 CString m_EiCErrFile;
198 CStringArray m_videoPath;
200 errlevel_t m_errlevel;
201 CStringArray m_eicFiles;
202 BOOL LoadPluginFunctions(HMODULE module);
204 CString m_wrappersPath;
205 CString m_modulePath;
206 BOOL InitModulePath();
210 /////////////////////////////////////////////////////////////////////////////
212 //{{AFX_INSERT_LOCATION}}
213 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
215 #endif // !defined(AFX_HAWK_H__6FFD53A7_939A_11D3_AE7E_00A0C9989BC6__INCLUDED_)