changeset 649:2272223c990b

Prepared for use of extra version file and version info in the executable file for Windows. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@908 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Tue, 03 Feb 2009 16:58:02 +0000
parents b964e594c0a4
children 9d16fd3971b1
files resources/programicon.rc src/UiGuiVersion.cpp src/UiGuiVersion.h
diffstat 3 files changed, 195 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/resources/programicon.rc	Tue Feb 03 16:41:37 2009 +0000
+++ b/resources/programicon.rc	Tue Feb 03 16:58:02 2009 +0000
@@ -1,1 +1,95 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2009 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program 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 program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "UiGuiVersion.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "windows.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Deutsch (Deutschland) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+#ifdef _WIN32
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION RESOURCE_VERSION
+ PRODUCTVERSION RESOURCE_VERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040704b0"
+        BEGIN
+            VALUE "Comments", "\0"
+            VALUE "CompanyName", "Thomas Schweitzer\0"
+            VALUE "FileDescription", PROGRAM_TITLE "\0"
+            VALUE "FileVersion", RESOURCE_VERSION_STRING
+            VALUE "InternalName", "UiGUI\0"
+            VALUE "LegalCopyright", "Copyright © Thomas Schweitzer 2009\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "UniversalIndentGUI.exe\0"
+            VALUE "PrivateBuild", "\0"
+            VALUE "ProductName", PROGRAM_TITLE "\0"
+            VALUE "ProductVersion", RESOURCE_VERSION_STRING
+            VALUE "SpecialBuild", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x407, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
 IDI_ICON1   ICON   DISCARDABLE   "universalIndentGUI.ico"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiVersion.cpp	Tue Feb 03 16:58:02 2009 +0000
@@ -0,0 +1,69 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2009 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program 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 program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "UiGuiVersion.h"
+
+#include "stdlib.h"
+#include "string.h"
+
+const int programVersionDate()
+{
+    static int version = 0;
+
+    if (0 == version) {
+        union timeUnion {
+            struct {
+                char Mmm[3];
+                char space1;
+                char dd[2];
+                char space2;
+                char yyyy[4];
+                char terminator;
+            };
+            char timeString[12];
+        };
+        timeUnion timeVar;
+        //get date from system
+        const char * dateString = __DATE__;
+        //copy to internal
+        strncpy((char *)&timeVar.timeString, dateString, 11);
+        //terminate string
+        timeVar.timeString[11] = 0;
+        //swap characters
+        char convertString[9];
+        strncpy((char *)&convertString, (char *)&timeVar.yyyy, 4);
+        strncpy((char *)&convertString[6], (char *)&timeVar.dd, 2);
+        //convert month
+        const char * month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dez", NULL};
+        const char * monthNumbers[] = {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "00"};
+        //find string in table
+        for (int i = 0; month[i] != NULL; i++) {
+            if (strncmp(month[i], (char *)&timeVar.Mmm, 2) == 0) {
+                strncpy((char *)&convertString[4], monthNumbers[i], 2);
+                break;
+            }
+        }
+        //terminate string
+        convertString[8] = 0;
+        version = atoi((char *)&convertString);
+    }
+
+    return version;
+    //return PROGRAM_DATE; //ORIGINAL 24.11.2008!!!
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiVersion.h	Tue Feb 03 16:58:02 2009 +0000
@@ -0,0 +1,32 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2009 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program 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 program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef UIGUIVERSION_H
+#define UIGUIVERSION_H
+
+#define PROGRAM_VERSION 1.0.2
+#define PROGRAM_VERSION_STRING "1.0.2"
+#define RESOURCE_VERSION 1,0,2,0
+#define RESOURCE_VERSION_STRING "1,0,2,0\0"
+#define PROGRAM_REVISION "$Revision: 2831 $"
+#define PROGRAM_TITLE "UniversalIndentGUI"
+
+const int programVersionDate();
+
+#endif  // UIGUIVERSION_H