From: <jim...@us...> - 2007-02-06 02:00:48
|
Revision: 666 http://svn.sourceforge.net/panotools/?rev=666&view=rev Author: jim0watters Date: 2007-02-05 18:00:45 -0800 (Mon, 05 Feb 2007) Log Message: ----------- Updated Windows version of Pano12Info that displays a dialog box with data. Added Paths: ----------- branches/pano12/PTInfo/ branches/pano12/PTInfo/Pano12Info.rc branches/pano12/PTInfo/Pano12Info.sln branches/pano12/PTInfo/Pano12InfoResource.h branches/pano12/PTInfo/PanoInfo.vcproj branches/pano12/PTInfo/pano12info.c Added: branches/pano12/PTInfo/Pano12Info.rc =================================================================== --- branches/pano12/PTInfo/Pano12Info.rc (rev 0) +++ branches/pano12/PTInfo/Pano12Info.rc 2007-02-06 02:00:45 UTC (rev 666) @@ -0,0 +1,160 @@ +// Microsoft Visual C++ generated resource script. +// +#include "Pano12InfoResource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +//VS2005Express Version +//#include "MFC\winres.h" +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "Pano12InfoResource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "//VS2005Express Version\r\n" + "//#include ""MFC\\winres.h""\r\n" + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_PANINFO DIALOGEX 0, 0, 371, 241 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "PanoTools Info" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "File Version:",IDC_STATIC,7,9,57,8,0,WS_EX_RIGHT + EDITTEXT IDC_FILEVER,70,7,70,14,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_TABSTOP + LTEXT "Comment:",IDC_STATIC,7,25,57,8,0,WS_EX_RIGHT + EDITTEXT IDC_COMMENT,70,23,294,14,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_TABSTOP + LTEXT "Copyright:",IDC_STATIC,7,41,57,8,0,WS_EX_RIGHT + EDITTEXT IDC_COPYRIGHT,70,39,294,14,ES_AUTOHSCROLL | ES_READONLY | + NOT WS_TABSTOP + LTEXT "Optimizer Error:",IDC_STATIC,7,57,57,8,0,WS_EX_RIGHT + EDITTEXT IDC_OPTIMIZERERROR,71,55,70,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + LTEXT "Field of View Limit:",IDC_STATIC,152,56,93,8,0, + WS_EX_RIGHT + EDITTEXT IDC_FIELDOFVIEWLIMIT,252,54,47,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_TABSTOP + LTEXT "\xB0",IDC_STATIC,302,56,8,8 + LTEXT "Feature List:",IDC_STATIC,7,77,57,8 + EDITTEXT IDC_EDIT,7,88,357,146,ES_MULTILINE | ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER | WS_VSCROLL | WS_HSCROLL | + NOT WS_TABSTOP,WS_EX_CLIENTEDGE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_PANINFO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 364 + TOPMARGIN, 7 + BOTTOMMARGIN, 234 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,2,0 + PRODUCTVERSION 1,0,2,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Display features of the pano12.dll" + VALUE "CompanyName", "Panorama Tools" + VALUE "FileDescription", "Pano12 Information" + VALUE "FileVersion", "1, 0, 2, 0" + VALUE "InternalName", "PanoInfo" + VALUE "LegalCopyright", "Copyright (C) 2007" + VALUE "OriginalFilename", "Pano12Info.exe" + VALUE "ProductName", " Pano12 Application" + VALUE "ProductVersion", "1, 0, 2, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Added: branches/pano12/PTInfo/Pano12Info.sln =================================================================== --- branches/pano12/PTInfo/Pano12Info.sln (rev 0) +++ branches/pano12/PTInfo/Pano12Info.sln 2007-02-06 02:00:45 UTC (rev 666) @@ -0,0 +1,23 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Pano12 Info", "PanoInfo.vcproj", "{611A30E5-3D17-403B-A715-4739C7EE59F1}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {611A30E5-3D17-403B-A715-4739C7EE59F1}.Debug.ActiveCfg = Debug|Win32 + {611A30E5-3D17-403B-A715-4739C7EE59F1}.Debug.Build.0 = Debug|Win32 + {611A30E5-3D17-403B-A715-4739C7EE59F1}.Release.ActiveCfg = Release|Win32 + {611A30E5-3D17-403B-A715-4739C7EE59F1}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal Added: branches/pano12/PTInfo/Pano12InfoResource.h =================================================================== --- branches/pano12/PTInfo/Pano12InfoResource.h (rev 0) +++ branches/pano12/PTInfo/Pano12InfoResource.h 2007-02-06 02:00:45 UTC (rev 666) @@ -0,0 +1,23 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Pano12Info.rc +// +#define IDD_PANINFO 101 +#define IDC_EDIT 1001 +#define IDC_FILEVER 1003 +#define IDC_COMMENT 1004 +#define IDC_COPYRIGHT 1005 +#define IDC_OPTIMIZERERROR 1006 +#define IDC_OPTIMIZERERROR2 1007 +#define IDC_FIELDOFVIEWLIMIT 1007 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1004 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif Added: branches/pano12/PTInfo/PanoInfo.vcproj =================================================================== --- branches/pano12/PTInfo/PanoInfo.vcproj (rev 0) +++ branches/pano12/PTInfo/PanoInfo.vcproj 2007-02-06 02:00:45 UTC (rev 666) @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="Pano12 Info" + ProjectGUID="{611A30E5-3D17-403B-A715-4739C7EE59F1}" + Keyword="Win32Proj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="1" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + FavorSizeOrSpeed="2" + AdditionalIncludeDirectories="..\libpano" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" + MinimalRebuild="TRUE" + BasicRuntimeChecks="3" + RuntimeLibrary="5" + StructMemberAlignment="4" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)/Pano12Info.exe" + LinkIncremental="2" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile="$(OutDir)/PanoInfo.pdb" + SubSystem="2" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="1" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + FavorSizeOrSpeed="2" + AdditionalIncludeDirectories="..\libpano" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" + RuntimeLibrary="4" + StructMemberAlignment="4" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="TRUE" + DebugInformationFormat="3"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)/Pano12Info.exe" + LinkIncremental="1" + GenerateDebugInformation="TRUE" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter=""> + <File + RelativePath=".\pano12info.c"> + </File> + </Filter> + <File + RelativePath=".\Pano12Info.rc"> + </File> + <File + RelativePath=".\Pano12InfoResource.h"> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Copied: branches/pano12/PTInfo/pano12info.c (from rev 665, branches/pano12/libpano/tools/pano12info.c) =================================================================== --- branches/pano12/PTInfo/pano12info.c (rev 0) +++ branches/pano12/PTInfo/pano12info.c 2007-02-06 02:00:45 UTC (rev 666) @@ -0,0 +1,232 @@ +/* + * PanoInfo Demo app + * + * Display info from pano12 dll/library + * + * May 2004 + * + * Jim Watters (jwatters AT photocreations DOT ca) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#define VC_EXTRALEAN +#include <stdio.h> +#include <windows.h> +#include"version.h" +#include"queryfeature.h" +#include "Pano12InfoResource.h" + +// Use the secure version of the string function starting with Microsoft Visual Studio 2005 . +// These macros are for backwards compatibility for older versions +#if _MSC_VER < 1400 +#define strcat_s(buf,size,str) strcat(buf,str) +#endif + + + +typedef int (*PROC_QF) (int ,char** ,Tp12FeatureType* ); +typedef int (*PROC_QFNUM) (void); +typedef int (*PROC_QFINT) (const char *, int *); +typedef int (*PROC_QFDOUBLE) (const char *, double *); +typedef int (*PROC_QFSTRING) (const char *, char *, const int); + +// Function prototypes. +int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int); +LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM); + +// Application entry point. +int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + DialogBox(hinstance, (LPCTSTR)IDD_PANINFO, (HWND)NULL, MainWndProc); + return 1; +} + +LRESULT CALLBACK MainWndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) +{ + switch(Message) + { + case WM_INITDIALOG: + { + HINSTANCE hDll = NULL; + PROC_QF pfQF = NULL; + PROC_QFNUM pfQFNum = NULL; + PROC_QFINT pfQFInt = NULL; + PROC_QFDOUBLE pfQFDouble = NULL; + PROC_QFSTRING pfQFString = NULL; + + int iResult; + double dResult; + char sResult[256]; + char str1[1000]; + char Description[10000]; + HWND hEditBox = NULL; + + Description[0] = '\0'; + hDll = LoadLibrary("pano12.dll"); + if(!hDll) + { + MessageBox((HWND)NULL, "Could not load pano12.dll", "Pano12 Info", MB_ICONEXCLAMATION); + return TRUE; + } + + pfQF = (PROC_QF) GetProcAddress( hDll, "queryFeatures" ); + pfQFNum = (PROC_QFNUM) GetProcAddress( hDll, "queryFeatureCount" ); + pfQFInt = (PROC_QFINT) GetProcAddress( hDll, "queryFeatureInt" ); + pfQFDouble = (PROC_QFDOUBLE) GetProcAddress( hDll, "queryFeatureDouble" ); + pfQFString = (PROC_QFSTRING) GetProcAddress( hDll, "queryFeatureString" ); + + if(!pfQF) + { + strcat_s(Description, 10000, "Error: The 'queryFeatures' funtion not pressent\r\n"); + } + if(!pfQFNum) + { + strcat_s(Description, 10000, "Error: The 'queryFeatureCount' funtion not pressent\r\n"); + } + if(!pfQFString) + { + strcat_s(Description, 10000, "Error: The 'queryFeatureString' funtion not pressent\r\n"); + } + if(!pfQFInt) + { + strcat_s(Description, 10000, "Error: The 'queryFeatureInt' funtion not pressent\r\n"); + } + if(!pfQFDouble) + { + strcat_s(Description, 10000, "Error: The 'queryFeatureDouble' funtion not pressent\r\n"); + } + + if(pfQFString) + { + if((pfQFString) (PTVERSION_NAME_FILEVERSION, sResult, sizeof(sResult)/sizeof(sResult[0]) )) + { + hEditBox = GetDlgItem(hWnd, IDC_FILEVER); + if( hEditBox ) + { + SendMessage( hEditBox, WM_SETTEXT, (WPARAM)NULL, (LPARAM)sResult); + } + } + + // if((pfQFString) (PTVERSION_NAME_LONG, sResult, sizeof(sResult)/sizeof(sResult[0]) )) + // { + // sprintf_s(str1, 1000, "Pano12 version:\t%s\r\n\r\n", sResult ); + // strcat_s(Description, 10000, str1); + // } + + if((pfQFString) (PTVERSION_NAME_COMMENT, sResult, sizeof(sResult)/sizeof(sResult[0]) )) + { + hEditBox = GetDlgItem(hWnd, IDC_COMMENT); + if( hEditBox ) + { + SendMessage( hEditBox, WM_SETTEXT, (WPARAM)NULL, (LPARAM)sResult); + } + } + + if((pfQFString) (PTVERSION_NAME_LEGALCOPYRIGHT, sResult, sizeof(sResult)/sizeof(sResult[0]) )) + { + hEditBox = GetDlgItem(hWnd, IDC_COPYRIGHT); + if( hEditBox ) + { + SendMessage( hEditBox, WM_SETTEXT, (WPARAM)NULL, (LPARAM)sResult); + } + } + } + + if(pfQFInt) + { + if((pfQFInt) ("CPErrorIsDistSphere", &iResult )) + { + hEditBox = GetDlgItem(hWnd, IDC_OPTIMIZERERROR); + if( hEditBox ) + { + SendMessage( hEditBox, WM_SETTEXT, (WPARAM)NULL, (LPARAM)(iResult? "dist sphere" : "dist rect")); + } + } + } + + if(pfQFDouble) + { + if((pfQFDouble) ("MaxFFOV", &dResult )) + { + hEditBox = GetDlgItem(hWnd, IDC_FIELDOFVIEWLIMIT); + if( hEditBox ) + { +#if _MSC_VER >= 1400 + sprintf_s(str1, 1000, "%2.0f", dResult ); +#else + sprintf(str1, "%2.0f", dResult ); +#endif + SendMessage( hEditBox, WM_SETTEXT, (WPARAM)NULL, (LPARAM)str1); + } + } + } + + if(pfQFNum && pfQF && pfQFString) + { + int i,bufsize,numfeatures; + char *name; + char *value; + Tp12FeatureType type; + + numfeatures = pfQFNum(); + for(i=0; i < numfeatures;i++) + { + pfQF(i, &name, &type); + bufsize = pfQFString(name, NULL, 0)+1; + value = (char*)malloc(bufsize); + pfQFString(name, value, bufsize); + +#if _MSC_VER >= 1400 + sprintf_s(str1, 1000, " %26.26s:\t%s\r\n", name, value); +#else + sprintf(str1, " %26.26s:\t%s\r\n", name, value); +#endif + strcat_s(Description, 10000, str1); + + free(value); + } + + hEditBox = GetDlgItem(hWnd, IDC_EDIT); + + if( hEditBox ) + { + SendMessage( hEditBox, WM_SETTEXT, (WPARAM)NULL, (LPARAM)Description); + } + } + + if(hDll) + FreeLibrary(hDll); + return TRUE; + } + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDOK: + EndDialog(hWnd, IDOK); + return TRUE; + + case IDCANCEL: + EndDialog(hWnd, IDCANCEL); + return TRUE; + } + break; + } + } + return FALSE; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |